@google/gemini-cli-core 0.13.0-nightly.20251102.d7243fb8 → 0.13.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/google-gemini-cli-core-0.13.0-nightly.20251031.c89bc30d.tgz +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/src/agents/executor.d.ts +19 -0
- package/dist/src/agents/executor.js +226 -32
- package/dist/src/agents/executor.js.map +1 -1
- package/dist/src/agents/executor.test.js +335 -9
- package/dist/src/agents/executor.test.js.map +1 -1
- package/dist/src/agents/types.d.ts +2 -1
- package/dist/src/agents/types.js +1 -0
- package/dist/src/agents/types.js.map +1 -1
- package/dist/src/code_assist/experiments/client_metadata.d.ts +12 -0
- package/dist/src/code_assist/experiments/client_metadata.js +49 -0
- package/dist/src/code_assist/experiments/client_metadata.js.map +1 -0
- package/dist/src/code_assist/experiments/experiments.d.ts +17 -0
- package/dist/src/code_assist/experiments/experiments.js +36 -0
- package/dist/src/code_assist/experiments/experiments.js.map +1 -0
- package/dist/src/code_assist/experiments/types.d.ts +35 -0
- package/dist/src/code_assist/experiments/types.js +7 -0
- package/dist/src/code_assist/experiments/types.js.map +1 -0
- package/dist/src/code_assist/server.d.ts +3 -1
- package/dist/src/code_assist/server.js +11 -0
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +17 -0
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/types.d.ts +1 -1
- package/dist/src/code_assist/types.js.map +1 -1
- package/dist/src/config/config.d.ts +51 -15
- package/dist/src/config/config.js +130 -30
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +231 -1
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/models.d.ts +1 -1
- package/dist/src/config/models.js +2 -2
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/storage.d.ts +2 -0
- package/dist/src/config/storage.js +17 -0
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/core/apiKeyCredentialStorage.js +7 -7
- package/dist/src/core/apiKeyCredentialStorage.js.map +1 -1
- package/dist/src/core/apiKeyCredentialStorage.test.js +5 -0
- package/dist/src/core/apiKeyCredentialStorage.test.js.map +1 -1
- package/dist/src/core/logger.js +10 -9
- package/dist/src/core/logger.js.map +1 -1
- package/dist/src/core/prompts.js +104 -55
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/hooks/hookPlanner.d.ts +46 -0
- package/dist/src/hooks/hookPlanner.js +108 -0
- package/dist/src/hooks/hookPlanner.js.map +1 -0
- package/dist/src/hooks/hookPlanner.test.d.ts +6 -0
- package/dist/src/hooks/hookPlanner.test.js +255 -0
- package/dist/src/hooks/hookPlanner.test.js.map +1 -0
- package/dist/src/hooks/hookRegistry.d.ts +87 -0
- package/dist/src/hooks/hookRegistry.js +198 -0
- package/dist/src/hooks/hookRegistry.js.map +1 -0
- package/dist/src/hooks/hookRegistry.test.d.ts +6 -0
- package/dist/src/hooks/hookRegistry.test.js +341 -0
- package/dist/src/hooks/hookRegistry.test.js.map +1 -0
- package/dist/src/hooks/hookTranslator.d.ts +113 -0
- package/dist/src/hooks/hookTranslator.js +232 -0
- package/dist/src/hooks/hookTranslator.js.map +1 -0
- package/dist/src/hooks/hookTranslator.test.d.ts +6 -0
- package/dist/src/hooks/hookTranslator.test.js +192 -0
- package/dist/src/hooks/hookTranslator.test.js.map +1 -0
- package/dist/src/hooks/types.d.ts +384 -0
- package/dist/src/hooks/types.js +284 -0
- package/dist/src/hooks/types.js.map +1 -0
- package/dist/src/hooks/types.test.d.ts +6 -0
- package/dist/src/hooks/types.test.js +35 -0
- package/dist/src/hooks/types.test.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +8 -5
- package/dist/src/mcp/oauth-provider.js +114 -31
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +54 -1
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.js +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/file-token-storage.test.js +7 -5
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.js +2 -2
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -1
- package/dist/src/policy/config.d.ts +31 -0
- package/dist/src/policy/config.js +197 -0
- package/dist/src/policy/config.js.map +1 -0
- package/dist/src/policy/config.test.d.ts +6 -0
- package/dist/src/policy/config.test.js +404 -0
- package/dist/src/policy/config.test.js.map +1 -0
- package/dist/src/policy/index.d.ts +2 -0
- package/dist/src/policy/index.js +2 -0
- package/dist/src/policy/index.js.map +1 -1
- package/dist/src/policy/policies/read-only.toml +56 -0
- package/dist/src/policy/policies/write.toml +63 -0
- package/dist/src/policy/policies/yolo.toml +31 -0
- package/dist/src/policy/toml-loader.d.ts +46 -0
- package/dist/src/policy/toml-loader.js +314 -0
- package/dist/src/policy/toml-loader.js.map +1 -0
- package/dist/src/policy/toml-loader.test.d.ts +6 -0
- package/dist/src/policy/toml-loader.test.js +522 -0
- package/dist/src/policy/toml-loader.test.js.map +1 -0
- package/dist/src/policy/types.d.ts +18 -0
- package/dist/src/policy/types.js +6 -0
- package/dist/src/policy/types.js.map +1 -1
- package/dist/src/services/chatCompressionService.js +2 -1
- package/dist/src/services/chatCompressionService.js.map +1 -1
- package/dist/src/services/chatRecordingService.js +9 -8
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/loopDetectionService.d.ts +1 -1
- package/dist/src/services/loopDetectionService.js +3 -3
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +69 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +18 -4
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +16 -4
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +3 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +31 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +4 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +6 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/loggers.d.ts +2 -1
- package/dist/src/telemetry/loggers.js +13 -1
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +10 -5
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/metrics.d.ts +21 -1
- package/dist/src/telemetry/metrics.js +34 -0
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +43 -126
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/telemetry/types.d.ts +24 -10
- package/dist/src/telemetry/types.js +47 -19
- package/dist/src/telemetry/types.js.map +1 -1
- package/dist/src/tools/edit.js +1 -1
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +1 -1
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +31 -6
- package/dist/src/tools/mcp-client-manager.js +111 -41
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +130 -38
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.d.ts +1 -0
- package/dist/src/tools/mcp-client.js +4 -4
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +49 -0
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/shell.js +1 -1
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/smart-edit.d.ts +1 -1
- package/dist/src/tools/smart-edit.js +12 -1
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js +2 -1
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-registry.d.ts +1 -18
- package/dist/src/tools/tool-registry.js +1 -44
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +2 -24
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/web-fetch.js +3 -6
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +1 -1
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/write-file.js +1 -1
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +1 -1
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/utils/channel.d.ts +1 -0
- package/dist/src/utils/channel.js +4 -4
- package/dist/src/utils/channel.js.map +1 -1
- package/dist/src/utils/channel.test.js +35 -1
- package/dist/src/utils/channel.test.js.map +1 -1
- package/dist/src/utils/events.d.ts +18 -1
- package/dist/src/utils/events.js +8 -0
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/events.test.js +10 -0
- package/dist/src/utils/events.test.js.map +1 -1
- package/dist/src/utils/extensionLoader.d.ts +67 -27
- package/dist/src/utils/extensionLoader.js +149 -7
- package/dist/src/utils/extensionLoader.js.map +1 -1
- package/dist/src/utils/extensionLoader.test.d.ts +6 -0
- package/dist/src/utils/extensionLoader.test.js +90 -0
- package/dist/src/utils/extensionLoader.test.js.map +1 -0
- package/dist/src/utils/fetch.js +1 -6
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.d.ts +1 -1
- package/dist/src/utils/llm-edit-fixer.js +27 -3
- package/dist/src/utils/llm-edit-fixer.js.map +1 -1
- package/dist/src/utils/llm-edit-fixer.test.js +21 -0
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -1
- package/dist/src/utils/shell-utils.js +29 -1
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +18 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { GenerateContentResponse, GenerateContentParameters, ToolConfig as GenAIToolConfig, ToolListUnion } from '@google/genai';
|
|
7
|
+
import type { LLMRequest, LLMResponse, HookToolConfig } from './hookTranslator.js';
|
|
8
|
+
/**
|
|
9
|
+
* Event names for the hook system
|
|
10
|
+
*/
|
|
11
|
+
export declare enum HookEventName {
|
|
12
|
+
BeforeTool = "BeforeTool",
|
|
13
|
+
AfterTool = "AfterTool",
|
|
14
|
+
BeforeAgent = "BeforeAgent",
|
|
15
|
+
Notification = "Notification",
|
|
16
|
+
AfterAgent = "AfterAgent",
|
|
17
|
+
SessionStart = "SessionStart",
|
|
18
|
+
SessionEnd = "SessionEnd",
|
|
19
|
+
PreCompress = "PreCompress",
|
|
20
|
+
BeforeModel = "BeforeModel",
|
|
21
|
+
AfterModel = "AfterModel",
|
|
22
|
+
BeforeToolSelection = "BeforeToolSelection"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hook configuration entry
|
|
26
|
+
*/
|
|
27
|
+
export interface CommandHookConfig {
|
|
28
|
+
type: HookType.Command;
|
|
29
|
+
command: string;
|
|
30
|
+
timeout?: number;
|
|
31
|
+
}
|
|
32
|
+
export type HookConfig = CommandHookConfig;
|
|
33
|
+
/**
|
|
34
|
+
* Hook definition with matcher
|
|
35
|
+
*/
|
|
36
|
+
export interface HookDefinition {
|
|
37
|
+
matcher?: string;
|
|
38
|
+
sequential?: boolean;
|
|
39
|
+
hooks: HookConfig[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Hook implementation types
|
|
43
|
+
*/
|
|
44
|
+
export declare enum HookType {
|
|
45
|
+
Command = "command"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Decision types for hook outputs
|
|
49
|
+
*/
|
|
50
|
+
export type HookDecision = 'ask' | 'block' | 'deny' | 'approve' | 'allow' | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Base hook input - common fields for all events
|
|
53
|
+
*/
|
|
54
|
+
export interface HookInput {
|
|
55
|
+
session_id: string;
|
|
56
|
+
transcript_path: string;
|
|
57
|
+
cwd: string;
|
|
58
|
+
hook_event_name: string;
|
|
59
|
+
timestamp: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Base hook output - common fields for all events
|
|
63
|
+
*/
|
|
64
|
+
export interface HookOutput {
|
|
65
|
+
continue?: boolean;
|
|
66
|
+
stopReason?: string;
|
|
67
|
+
suppressOutput?: boolean;
|
|
68
|
+
systemMessage?: string;
|
|
69
|
+
decision?: HookDecision;
|
|
70
|
+
reason?: string;
|
|
71
|
+
hookSpecificOutput?: Record<string, unknown>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Factory function to create the appropriate hook output class based on event name
|
|
75
|
+
* Returns DefaultHookOutput for all events since it contains all necessary methods
|
|
76
|
+
*/
|
|
77
|
+
export declare function createHookOutput(eventName: string, data: Partial<HookOutput>): DefaultHookOutput;
|
|
78
|
+
/**
|
|
79
|
+
* Default implementation of HookOutput with utility methods
|
|
80
|
+
*/
|
|
81
|
+
export declare class DefaultHookOutput implements HookOutput {
|
|
82
|
+
continue?: boolean;
|
|
83
|
+
stopReason?: string;
|
|
84
|
+
suppressOutput?: boolean;
|
|
85
|
+
systemMessage?: string;
|
|
86
|
+
decision?: HookDecision;
|
|
87
|
+
reason?: string;
|
|
88
|
+
hookSpecificOutput?: Record<string, unknown>;
|
|
89
|
+
constructor(data?: Partial<HookOutput>);
|
|
90
|
+
/**
|
|
91
|
+
* Check if this output represents a blocking decision
|
|
92
|
+
*/
|
|
93
|
+
isBlockingDecision(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Check if this output requests to stop execution
|
|
96
|
+
*/
|
|
97
|
+
shouldStopExecution(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Get the effective reason for blocking or stopping
|
|
100
|
+
*/
|
|
101
|
+
getEffectiveReason(): string;
|
|
102
|
+
/**
|
|
103
|
+
* Apply LLM request modifications (specific method for BeforeModel hooks)
|
|
104
|
+
*/
|
|
105
|
+
applyLLMRequestModifications(target: GenerateContentParameters): GenerateContentParameters;
|
|
106
|
+
/**
|
|
107
|
+
* Apply tool config modifications (specific method for BeforeToolSelection hooks)
|
|
108
|
+
*/
|
|
109
|
+
applyToolConfigModifications(target: {
|
|
110
|
+
toolConfig?: GenAIToolConfig;
|
|
111
|
+
tools?: ToolListUnion;
|
|
112
|
+
}): {
|
|
113
|
+
toolConfig?: GenAIToolConfig;
|
|
114
|
+
tools?: ToolListUnion;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Get additional context for adding to responses
|
|
118
|
+
*/
|
|
119
|
+
getAdditionalContext(): string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Check if execution should be blocked and return error info
|
|
122
|
+
*/
|
|
123
|
+
getBlockingError(): {
|
|
124
|
+
blocked: boolean;
|
|
125
|
+
reason: string;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Specific hook output class for BeforeTool events with compatibility support
|
|
130
|
+
*/
|
|
131
|
+
export declare class BeforeToolHookOutput extends DefaultHookOutput {
|
|
132
|
+
/**
|
|
133
|
+
* Get the effective blocking reason, considering compatibility fields
|
|
134
|
+
*/
|
|
135
|
+
getEffectiveReason(): string;
|
|
136
|
+
/**
|
|
137
|
+
* Check if this output represents a blocking decision, considering compatibility fields
|
|
138
|
+
*/
|
|
139
|
+
isBlockingDecision(): boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Specific hook output class for BeforeModel events
|
|
143
|
+
*/
|
|
144
|
+
export declare class BeforeModelHookOutput extends DefaultHookOutput {
|
|
145
|
+
/**
|
|
146
|
+
* Get synthetic LLM response if provided by hook
|
|
147
|
+
*/
|
|
148
|
+
getSyntheticResponse(): GenerateContentResponse | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Apply modifications to LLM request
|
|
151
|
+
*/
|
|
152
|
+
applyLLMRequestModifications(target: GenerateContentParameters): GenerateContentParameters;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Specific hook output class for BeforeToolSelection events
|
|
156
|
+
*/
|
|
157
|
+
export declare class BeforeToolSelectionHookOutput extends DefaultHookOutput {
|
|
158
|
+
/**
|
|
159
|
+
* Apply tool configuration modifications
|
|
160
|
+
*/
|
|
161
|
+
applyToolConfigModifications(target: {
|
|
162
|
+
toolConfig?: GenAIToolConfig;
|
|
163
|
+
tools?: ToolListUnion;
|
|
164
|
+
}): {
|
|
165
|
+
toolConfig?: GenAIToolConfig;
|
|
166
|
+
tools?: ToolListUnion;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Specific hook output class for AfterModel events
|
|
171
|
+
*/
|
|
172
|
+
export declare class AfterModelHookOutput extends DefaultHookOutput {
|
|
173
|
+
/**
|
|
174
|
+
* Get modified LLM response if provided by hook
|
|
175
|
+
*/
|
|
176
|
+
getModifiedResponse(): GenerateContentResponse | undefined;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* BeforeTool hook input
|
|
180
|
+
*/
|
|
181
|
+
export interface BeforeToolInput extends HookInput {
|
|
182
|
+
tool_name: string;
|
|
183
|
+
tool_input: Record<string, unknown>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* BeforeTool hook output
|
|
187
|
+
*/
|
|
188
|
+
export interface BeforeToolOutput extends HookOutput {
|
|
189
|
+
hookSpecificOutput?: {
|
|
190
|
+
hookEventName: 'BeforeTool';
|
|
191
|
+
permissionDecision?: HookDecision;
|
|
192
|
+
permissionDecisionReason?: string;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* AfterTool hook input
|
|
197
|
+
*/
|
|
198
|
+
export interface AfterToolInput extends HookInput {
|
|
199
|
+
tool_name: string;
|
|
200
|
+
tool_input: Record<string, unknown>;
|
|
201
|
+
tool_response: Record<string, unknown>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* AfterTool hook output
|
|
205
|
+
*/
|
|
206
|
+
export interface AfterToolOutput extends HookOutput {
|
|
207
|
+
hookSpecificOutput?: {
|
|
208
|
+
hookEventName: 'AfterTool';
|
|
209
|
+
additionalContext?: string;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* BeforeAgent hook input
|
|
214
|
+
*/
|
|
215
|
+
export interface BeforeAgentInput extends HookInput {
|
|
216
|
+
prompt: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* BeforeAgent hook output
|
|
220
|
+
*/
|
|
221
|
+
export interface BeforeAgentOutput extends HookOutput {
|
|
222
|
+
hookSpecificOutput?: {
|
|
223
|
+
hookEventName: 'BeforeAgent';
|
|
224
|
+
additionalContext?: string;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Notification types
|
|
229
|
+
*/
|
|
230
|
+
export declare enum NotificationType {
|
|
231
|
+
ToolPermission = "ToolPermission"
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Notification hook input
|
|
235
|
+
*/
|
|
236
|
+
export interface NotificationInput extends HookInput {
|
|
237
|
+
notification_type: NotificationType;
|
|
238
|
+
message: string;
|
|
239
|
+
details: Record<string, unknown>;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Notification hook output
|
|
243
|
+
*/
|
|
244
|
+
export interface NotificationOutput {
|
|
245
|
+
suppressOutput?: boolean;
|
|
246
|
+
systemMessage?: string;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* AfterAgent hook input
|
|
250
|
+
*/
|
|
251
|
+
export interface AfterAgentInput extends HookInput {
|
|
252
|
+
prompt: string;
|
|
253
|
+
prompt_response: string;
|
|
254
|
+
stop_hook_active: boolean;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* SessionStart source types
|
|
258
|
+
*/
|
|
259
|
+
export declare enum SessionStartSource {
|
|
260
|
+
Startup = "startup",
|
|
261
|
+
Resume = "resume",
|
|
262
|
+
Clear = "clear",
|
|
263
|
+
Compress = "compress"
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* SessionStart hook input
|
|
267
|
+
*/
|
|
268
|
+
export interface SessionStartInput extends HookInput {
|
|
269
|
+
source: SessionStartSource;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* SessionStart hook output
|
|
273
|
+
*/
|
|
274
|
+
export interface SessionStartOutput extends HookOutput {
|
|
275
|
+
hookSpecificOutput?: {
|
|
276
|
+
hookEventName: 'SessionStart';
|
|
277
|
+
additionalContext?: string;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* SessionEnd reason types
|
|
282
|
+
*/
|
|
283
|
+
export declare enum SessionEndReason {
|
|
284
|
+
Exit = "exit",
|
|
285
|
+
Clear = "clear",
|
|
286
|
+
Logout = "logout",
|
|
287
|
+
PromptInputExit = "prompt_input_exit",
|
|
288
|
+
Other = "other"
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* SessionEnd hook input
|
|
292
|
+
*/
|
|
293
|
+
export interface SessionEndInput extends HookInput {
|
|
294
|
+
reason: SessionEndReason;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* PreCompress trigger types
|
|
298
|
+
*/
|
|
299
|
+
export declare enum PreCompressTrigger {
|
|
300
|
+
Manual = "manual",
|
|
301
|
+
Auto = "auto"
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* PreCompress hook input
|
|
305
|
+
*/
|
|
306
|
+
export interface PreCompressInput extends HookInput {
|
|
307
|
+
trigger: PreCompressTrigger;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* PreCompress hook output
|
|
311
|
+
*/
|
|
312
|
+
export interface PreCompressOutput {
|
|
313
|
+
suppressOutput?: boolean;
|
|
314
|
+
systemMessage?: string;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* BeforeModel hook input - uses decoupled types
|
|
318
|
+
*/
|
|
319
|
+
export interface BeforeModelInput extends HookInput {
|
|
320
|
+
llm_request: LLMRequest;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* BeforeModel hook output
|
|
324
|
+
*/
|
|
325
|
+
export interface BeforeModelOutput extends HookOutput {
|
|
326
|
+
hookSpecificOutput?: {
|
|
327
|
+
hookEventName: 'BeforeModel';
|
|
328
|
+
llm_request?: Partial<LLMRequest>;
|
|
329
|
+
llm_response?: LLMResponse;
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* AfterModel hook input - uses decoupled types
|
|
334
|
+
*/
|
|
335
|
+
export interface AfterModelInput extends HookInput {
|
|
336
|
+
llm_request: LLMRequest;
|
|
337
|
+
llm_response: LLMResponse;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* AfterModel hook output
|
|
341
|
+
*/
|
|
342
|
+
export interface AfterModelOutput extends HookOutput {
|
|
343
|
+
hookSpecificOutput?: {
|
|
344
|
+
hookEventName: 'AfterModel';
|
|
345
|
+
llm_response?: Partial<LLMResponse>;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* BeforeToolSelection hook input - uses decoupled types
|
|
350
|
+
*/
|
|
351
|
+
export interface BeforeToolSelectionInput extends HookInput {
|
|
352
|
+
llm_request: LLMRequest;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* BeforeToolSelection hook output
|
|
356
|
+
*/
|
|
357
|
+
export interface BeforeToolSelectionOutput extends HookOutput {
|
|
358
|
+
hookSpecificOutput?: {
|
|
359
|
+
hookEventName: 'BeforeToolSelection';
|
|
360
|
+
toolConfig?: HookToolConfig;
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Hook execution result
|
|
365
|
+
*/
|
|
366
|
+
export interface HookExecutionResult {
|
|
367
|
+
hookConfig: HookConfig;
|
|
368
|
+
eventName: HookEventName;
|
|
369
|
+
success: boolean;
|
|
370
|
+
output?: HookOutput;
|
|
371
|
+
stdout?: string;
|
|
372
|
+
stderr?: string;
|
|
373
|
+
exitCode?: number;
|
|
374
|
+
duration: number;
|
|
375
|
+
error?: Error;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Hook execution plan for an event
|
|
379
|
+
*/
|
|
380
|
+
export interface HookExecutionPlan {
|
|
381
|
+
eventName: HookEventName;
|
|
382
|
+
hookConfigs: HookConfig[];
|
|
383
|
+
sequential: boolean;
|
|
384
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { defaultHookTranslator } from './hookTranslator.js';
|
|
7
|
+
/**
|
|
8
|
+
* Event names for the hook system
|
|
9
|
+
*/
|
|
10
|
+
export var HookEventName;
|
|
11
|
+
(function (HookEventName) {
|
|
12
|
+
HookEventName["BeforeTool"] = "BeforeTool";
|
|
13
|
+
HookEventName["AfterTool"] = "AfterTool";
|
|
14
|
+
HookEventName["BeforeAgent"] = "BeforeAgent";
|
|
15
|
+
HookEventName["Notification"] = "Notification";
|
|
16
|
+
HookEventName["AfterAgent"] = "AfterAgent";
|
|
17
|
+
HookEventName["SessionStart"] = "SessionStart";
|
|
18
|
+
HookEventName["SessionEnd"] = "SessionEnd";
|
|
19
|
+
HookEventName["PreCompress"] = "PreCompress";
|
|
20
|
+
HookEventName["BeforeModel"] = "BeforeModel";
|
|
21
|
+
HookEventName["AfterModel"] = "AfterModel";
|
|
22
|
+
HookEventName["BeforeToolSelection"] = "BeforeToolSelection";
|
|
23
|
+
})(HookEventName || (HookEventName = {}));
|
|
24
|
+
/**
|
|
25
|
+
* Hook implementation types
|
|
26
|
+
*/
|
|
27
|
+
export var HookType;
|
|
28
|
+
(function (HookType) {
|
|
29
|
+
HookType["Command"] = "command";
|
|
30
|
+
})(HookType || (HookType = {}));
|
|
31
|
+
/**
|
|
32
|
+
* Factory function to create the appropriate hook output class based on event name
|
|
33
|
+
* Returns DefaultHookOutput for all events since it contains all necessary methods
|
|
34
|
+
*/
|
|
35
|
+
export function createHookOutput(eventName, data) {
|
|
36
|
+
switch (eventName) {
|
|
37
|
+
case 'BeforeModel':
|
|
38
|
+
return new BeforeModelHookOutput(data);
|
|
39
|
+
case 'AfterModel':
|
|
40
|
+
return new AfterModelHookOutput(data);
|
|
41
|
+
case 'BeforeToolSelection':
|
|
42
|
+
return new BeforeToolSelectionHookOutput(data);
|
|
43
|
+
default:
|
|
44
|
+
return new DefaultHookOutput(data);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Default implementation of HookOutput with utility methods
|
|
49
|
+
*/
|
|
50
|
+
export class DefaultHookOutput {
|
|
51
|
+
continue;
|
|
52
|
+
stopReason;
|
|
53
|
+
suppressOutput;
|
|
54
|
+
systemMessage;
|
|
55
|
+
decision;
|
|
56
|
+
reason;
|
|
57
|
+
hookSpecificOutput;
|
|
58
|
+
constructor(data = {}) {
|
|
59
|
+
this.continue = data.continue;
|
|
60
|
+
this.stopReason = data.stopReason;
|
|
61
|
+
this.suppressOutput = data.suppressOutput;
|
|
62
|
+
this.systemMessage = data.systemMessage;
|
|
63
|
+
this.decision = data.decision;
|
|
64
|
+
this.reason = data.reason;
|
|
65
|
+
this.hookSpecificOutput = data.hookSpecificOutput;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Check if this output represents a blocking decision
|
|
69
|
+
*/
|
|
70
|
+
isBlockingDecision() {
|
|
71
|
+
return this.decision === 'block' || this.decision === 'deny';
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Check if this output requests to stop execution
|
|
75
|
+
*/
|
|
76
|
+
shouldStopExecution() {
|
|
77
|
+
return this.continue === false;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the effective reason for blocking or stopping
|
|
81
|
+
*/
|
|
82
|
+
getEffectiveReason() {
|
|
83
|
+
return this.reason || this.stopReason || 'No reason provided';
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Apply LLM request modifications (specific method for BeforeModel hooks)
|
|
87
|
+
*/
|
|
88
|
+
applyLLMRequestModifications(target) {
|
|
89
|
+
// Base implementation - overridden by BeforeModelHookOutput
|
|
90
|
+
return target;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Apply tool config modifications (specific method for BeforeToolSelection hooks)
|
|
94
|
+
*/
|
|
95
|
+
applyToolConfigModifications(target) {
|
|
96
|
+
// Base implementation - overridden by BeforeToolSelectionHookOutput
|
|
97
|
+
return target;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get additional context for adding to responses
|
|
101
|
+
*/
|
|
102
|
+
getAdditionalContext() {
|
|
103
|
+
if (this.hookSpecificOutput &&
|
|
104
|
+
'additionalContext' in this.hookSpecificOutput) {
|
|
105
|
+
const context = this.hookSpecificOutput['additionalContext'];
|
|
106
|
+
return typeof context === 'string' ? context : undefined;
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Check if execution should be blocked and return error info
|
|
112
|
+
*/
|
|
113
|
+
getBlockingError() {
|
|
114
|
+
if (this.isBlockingDecision()) {
|
|
115
|
+
return {
|
|
116
|
+
blocked: true,
|
|
117
|
+
reason: this.getEffectiveReason(),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return { blocked: false, reason: '' };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Specific hook output class for BeforeTool events with compatibility support
|
|
125
|
+
*/
|
|
126
|
+
export class BeforeToolHookOutput extends DefaultHookOutput {
|
|
127
|
+
/**
|
|
128
|
+
* Get the effective blocking reason, considering compatibility fields
|
|
129
|
+
*/
|
|
130
|
+
getEffectiveReason() {
|
|
131
|
+
// Check for compatibility fields first
|
|
132
|
+
if (this.hookSpecificOutput) {
|
|
133
|
+
if ('permissionDecisionReason' in this.hookSpecificOutput) {
|
|
134
|
+
const compatReason = this.hookSpecificOutput['permissionDecisionReason'];
|
|
135
|
+
if (typeof compatReason === 'string') {
|
|
136
|
+
return compatReason;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return super.getEffectiveReason();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Check if this output represents a blocking decision, considering compatibility fields
|
|
144
|
+
*/
|
|
145
|
+
isBlockingDecision() {
|
|
146
|
+
// Check compatibility field first
|
|
147
|
+
if (this.hookSpecificOutput &&
|
|
148
|
+
'permissionDecision' in this.hookSpecificOutput) {
|
|
149
|
+
const compatDecision = this.hookSpecificOutput['permissionDecision'];
|
|
150
|
+
if (compatDecision === 'block' || compatDecision === 'deny') {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return super.isBlockingDecision();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Specific hook output class for BeforeModel events
|
|
159
|
+
*/
|
|
160
|
+
export class BeforeModelHookOutput extends DefaultHookOutput {
|
|
161
|
+
/**
|
|
162
|
+
* Get synthetic LLM response if provided by hook
|
|
163
|
+
*/
|
|
164
|
+
getSyntheticResponse() {
|
|
165
|
+
if (this.hookSpecificOutput && 'llm_response' in this.hookSpecificOutput) {
|
|
166
|
+
const hookResponse = this.hookSpecificOutput['llm_response'];
|
|
167
|
+
if (hookResponse) {
|
|
168
|
+
// Convert hook format to SDK format
|
|
169
|
+
return defaultHookTranslator.fromHookLLMResponse(hookResponse);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Apply modifications to LLM request
|
|
176
|
+
*/
|
|
177
|
+
applyLLMRequestModifications(target) {
|
|
178
|
+
if (this.hookSpecificOutput && 'llm_request' in this.hookSpecificOutput) {
|
|
179
|
+
const hookRequest = this.hookSpecificOutput['llm_request'];
|
|
180
|
+
if (hookRequest) {
|
|
181
|
+
// Convert hook format to SDK format
|
|
182
|
+
const sdkRequest = defaultHookTranslator.fromHookLLMRequest(hookRequest, target);
|
|
183
|
+
return {
|
|
184
|
+
...target,
|
|
185
|
+
...sdkRequest,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return target;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Specific hook output class for BeforeToolSelection events
|
|
194
|
+
*/
|
|
195
|
+
export class BeforeToolSelectionHookOutput extends DefaultHookOutput {
|
|
196
|
+
/**
|
|
197
|
+
* Apply tool configuration modifications
|
|
198
|
+
*/
|
|
199
|
+
applyToolConfigModifications(target) {
|
|
200
|
+
if (this.hookSpecificOutput && 'toolConfig' in this.hookSpecificOutput) {
|
|
201
|
+
const hookToolConfig = this.hookSpecificOutput['toolConfig'];
|
|
202
|
+
if (hookToolConfig) {
|
|
203
|
+
// Convert hook format to SDK format
|
|
204
|
+
const sdkToolConfig = defaultHookTranslator.fromHookToolConfig(hookToolConfig);
|
|
205
|
+
return {
|
|
206
|
+
...target,
|
|
207
|
+
tools: target.tools || [],
|
|
208
|
+
toolConfig: sdkToolConfig,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return target;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Specific hook output class for AfterModel events
|
|
217
|
+
*/
|
|
218
|
+
export class AfterModelHookOutput extends DefaultHookOutput {
|
|
219
|
+
/**
|
|
220
|
+
* Get modified LLM response if provided by hook
|
|
221
|
+
*/
|
|
222
|
+
getModifiedResponse() {
|
|
223
|
+
if (this.hookSpecificOutput && 'llm_response' in this.hookSpecificOutput) {
|
|
224
|
+
const hookResponse = this.hookSpecificOutput['llm_response'];
|
|
225
|
+
if (hookResponse?.candidates?.[0]?.content) {
|
|
226
|
+
// Convert hook format to SDK format
|
|
227
|
+
return defaultHookTranslator.fromHookLLMResponse(hookResponse);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// If hook wants to stop execution, create a synthetic stop response
|
|
231
|
+
if (this.shouldStopExecution()) {
|
|
232
|
+
const stopResponse = {
|
|
233
|
+
candidates: [
|
|
234
|
+
{
|
|
235
|
+
content: {
|
|
236
|
+
role: 'model',
|
|
237
|
+
parts: [this.getEffectiveReason() || 'Execution stopped by hook'],
|
|
238
|
+
},
|
|
239
|
+
finishReason: 'STOP',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
};
|
|
243
|
+
return defaultHookTranslator.fromHookLLMResponse(stopResponse);
|
|
244
|
+
}
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Notification types
|
|
250
|
+
*/
|
|
251
|
+
export var NotificationType;
|
|
252
|
+
(function (NotificationType) {
|
|
253
|
+
NotificationType["ToolPermission"] = "ToolPermission";
|
|
254
|
+
})(NotificationType || (NotificationType = {}));
|
|
255
|
+
/**
|
|
256
|
+
* SessionStart source types
|
|
257
|
+
*/
|
|
258
|
+
export var SessionStartSource;
|
|
259
|
+
(function (SessionStartSource) {
|
|
260
|
+
SessionStartSource["Startup"] = "startup";
|
|
261
|
+
SessionStartSource["Resume"] = "resume";
|
|
262
|
+
SessionStartSource["Clear"] = "clear";
|
|
263
|
+
SessionStartSource["Compress"] = "compress";
|
|
264
|
+
})(SessionStartSource || (SessionStartSource = {}));
|
|
265
|
+
/**
|
|
266
|
+
* SessionEnd reason types
|
|
267
|
+
*/
|
|
268
|
+
export var SessionEndReason;
|
|
269
|
+
(function (SessionEndReason) {
|
|
270
|
+
SessionEndReason["Exit"] = "exit";
|
|
271
|
+
SessionEndReason["Clear"] = "clear";
|
|
272
|
+
SessionEndReason["Logout"] = "logout";
|
|
273
|
+
SessionEndReason["PromptInputExit"] = "prompt_input_exit";
|
|
274
|
+
SessionEndReason["Other"] = "other";
|
|
275
|
+
})(SessionEndReason || (SessionEndReason = {}));
|
|
276
|
+
/**
|
|
277
|
+
* PreCompress trigger types
|
|
278
|
+
*/
|
|
279
|
+
export var PreCompressTrigger;
|
|
280
|
+
(function (PreCompressTrigger) {
|
|
281
|
+
PreCompressTrigger["Manual"] = "manual";
|
|
282
|
+
PreCompressTrigger["Auto"] = "auto";
|
|
283
|
+
})(PreCompressTrigger || (PreCompressTrigger = {}));
|
|
284
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAN,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,0CAAyB,CAAA;IACzB,wCAAuB,CAAA;IACvB,4CAA2B,CAAA;IAC3B,8CAA6B,CA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