chore(node-sdk): audit providers claudecode codex cursor gemini
Add plugins/shell-command.ts for the shared quoting and command parsers; runtime status checks go through managed-runtime-status; Codex and Cursor write through managed-transaction. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
b7f14ba34b
commit
81ecb372ba
15 files changed
+285
-914
No files matched your search
@@ -1,7 +1,9 @@
|
||||
import type { InstallConfig } from './base.js';
|
||||
import {
|
||||
AGENT_KEY,
|
||||
AUDIT_OPTIONS,
|
||||
AUDIT_SCRIPT,
|
||||
GUARD_OPTIONS,
|
||||
GUARD_SCRIPT,
|
||||
} from './gemini-contract.js';
|
||||
import type { RenderedGeminiDocument } from './gemini-config.js';
|
||||
@@ -18,14 +20,10 @@ const DISPLAY_NAME = 'Gemini CLI';
|
||||
const SETTINGS_DIRECTORY_LABEL = 'Gemini CLI configuration directory';
|
||||
const SETTINGS_LABEL = 'Gemini CLI user settings';
|
||||
|
||||
export type GeminiRuntimePaths = ManagedRuntimePaths;
|
||||
export type PreparedGeminiInstallation = PreparedManagedInstallation;
|
||||
export type { RenameFile };
|
||||
|
||||
export async function preflightGeminiInstallation(
|
||||
config: InstallConfig,
|
||||
settingsPath: string,
|
||||
): Promise<GeminiRuntimePaths> {
|
||||
): Promise<ManagedRuntimePaths> {
|
||||
return preflightManagedInstallation({
|
||||
agentKey: AGENT_KEY,
|
||||
hookLocations: [{ directoryLabel: SETTINGS_DIRECTORY_LABEL, filePath: settingsPath }],
|
||||
@@ -36,7 +34,7 @@ export async function preflightGeminiInstallation(
|
||||
export async function prepareGeminiInstallation(
|
||||
config: InstallConfig,
|
||||
rendered: RenderedGeminiDocument,
|
||||
): Promise<PreparedGeminiInstallation> {
|
||||
): Promise<PreparedManagedInstallation> {
|
||||
const settingsSource = rendered.next ?? rendered.document.raw;
|
||||
if (settingsSource === undefined) throw new Error('Gemini CLI hook settings are missing');
|
||||
return prepareManagedInstallation({
|
||||
@@ -50,13 +48,13 @@ export async function prepareGeminiInstallation(
|
||||
source: settingsSource,
|
||||
}],
|
||||
config,
|
||||
guardOptions: { successOutput: '{}\n' },
|
||||
auditOptions: { nativePayload: true, successOutput: '{}\n' },
|
||||
guardOptions: GUARD_OPTIONS,
|
||||
auditOptions: AUDIT_OPTIONS,
|
||||
}, GUARD_SCRIPT, AUDIT_SCRIPT);
|
||||
}
|
||||
|
||||
export async function commitGeminiInstallation(
|
||||
prepared: PreparedGeminiInstallation,
|
||||
prepared: PreparedManagedInstallation,
|
||||
renameFile?: RenameFile,
|
||||
): Promise<void> {
|
||||
await commitManagedInstallation(prepared, renameFile);
|
||||
|
||||
Reference in new issue
Block a user