@anthropic-ai/claude-agent-sdk 0.2.1 → 0.2.2
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/cli.js +1682 -1745
- package/package.json +1 -1
- package/sdk-tools.d.ts +4 -0
- package/sdk.d.ts +1586 -1
- package/sdk.mjs +10 -9
- package/entrypoints/agentSdkTypes.d.ts +0 -56
- package/entrypoints/sandboxTypes.d.ts +0 -44
- package/entrypoints/sdk/controlTypes.d.ts +0 -2
- package/entrypoints/sdk/controlTypes.generated.d.ts +0 -135
- package/entrypoints/sdk/coreTypes.d.ts +0 -5
- package/entrypoints/sdk/coreTypes.generated.d.ts +0 -476
- package/entrypoints/sdk/runtimeTypes.d.ts +0 -560
- package/entrypoints/sdk/sdkUtilityTypes.d.ts +0 -4
- package/transport/processTransportTypes.d.ts +0 -60
- package/transport/transport.d.ts +0 -30
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AUTO-GENERATED - DO NOT EDIT
|
|
3
|
-
*
|
|
4
|
-
* This file is auto-generated from Zod schemas in coreSchemas.ts.
|
|
5
|
-
* To modify these types, edit the Zod schemas and run:
|
|
6
|
-
*
|
|
7
|
-
* bun scripts/generate-sdk-types.ts
|
|
8
|
-
*/
|
|
9
|
-
import type { MessageParam as APIUserMessage } from '@anthropic-ai/sdk/resources';
|
|
10
|
-
import type { BetaMessage as APIAssistantMessage, BetaRawMessageStreamEvent as RawMessageStreamEvent } from '@anthropic-ai/sdk/resources/beta/messages/messages.mjs';
|
|
11
|
-
import type { UUID } from 'crypto';
|
|
12
|
-
import type { NonNullableUsage } from './sdkUtilityTypes.js';
|
|
13
|
-
/**
|
|
14
|
-
* Information about the logged in user's account.
|
|
15
|
-
*/
|
|
16
|
-
export type AccountInfo = {
|
|
17
|
-
email?: string;
|
|
18
|
-
organization?: string;
|
|
19
|
-
subscriptionType?: string;
|
|
20
|
-
tokenSource?: string;
|
|
21
|
-
apiKeySource?: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Definition for a custom subagent that can be invoked via the Task tool.
|
|
25
|
-
*/
|
|
26
|
-
export type AgentDefinition = {
|
|
27
|
-
/** Natural language description of when to use this agent */
|
|
28
|
-
description: string;
|
|
29
|
-
/** Array of allowed tool names. If omitted, inherits all tools from parent */
|
|
30
|
-
tools?: string[];
|
|
31
|
-
/** Array of tool names to explicitly disallow for this agent */
|
|
32
|
-
disallowedTools?: string[];
|
|
33
|
-
/** The agent's system prompt */
|
|
34
|
-
prompt: string;
|
|
35
|
-
/** Model to use for this agent. If omitted or 'inherit', uses the main model */
|
|
36
|
-
model?: 'sonnet' | 'opus' | 'haiku' | 'inherit';
|
|
37
|
-
mcpServers?: AgentMcpServerSpec[];
|
|
38
|
-
/** Experimental: Critical reminder added to system prompt */
|
|
39
|
-
criticalSystemReminder_EXPERIMENTAL?: string;
|
|
40
|
-
};
|
|
41
|
-
export type AgentMcpServerSpec = string | Record<string, McpServerConfigForProcessTransport>;
|
|
42
|
-
export type ApiKeySource = 'user' | 'project' | 'org' | 'temporary';
|
|
43
|
-
export type AsyncHookJSONOutput = {
|
|
44
|
-
async: true;
|
|
45
|
-
asyncTimeout?: number;
|
|
46
|
-
};
|
|
47
|
-
export type BaseHookInput = {
|
|
48
|
-
session_id: string;
|
|
49
|
-
transcript_path: string;
|
|
50
|
-
cwd: string;
|
|
51
|
-
permission_mode?: string;
|
|
52
|
-
};
|
|
53
|
-
export type BaseOutputFormat = {
|
|
54
|
-
type: OutputFormatType;
|
|
55
|
-
};
|
|
56
|
-
export type ConfigScope = 'local' | 'user' | 'project';
|
|
57
|
-
export type ExitReason = 'clear' | 'logout' | 'prompt_input_exit' | 'other' | 'bypass_permissions_disabled';
|
|
58
|
-
export type HookEvent = 'PreToolUse' | 'PostToolUse' | 'PostToolUseFailure' | 'Notification' | 'UserPromptSubmit' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'SubagentStart' | 'SubagentStop' | 'PreCompact' | 'PermissionRequest';
|
|
59
|
-
export type HookInput = PreToolUseHookInput | PostToolUseHookInput | PostToolUseFailureHookInput | NotificationHookInput | UserPromptSubmitHookInput | SessionStartHookInput | SessionEndHookInput | StopHookInput | SubagentStartHookInput | SubagentStopHookInput | PreCompactHookInput | PermissionRequestHookInput;
|
|
60
|
-
export type HookJSONOutput = AsyncHookJSONOutput | SyncHookJSONOutput;
|
|
61
|
-
export type JsonSchemaOutputFormat = {
|
|
62
|
-
type: 'json_schema';
|
|
63
|
-
schema: Record<string, unknown>;
|
|
64
|
-
};
|
|
65
|
-
export type McpHttpServerConfig = {
|
|
66
|
-
type: 'http';
|
|
67
|
-
url: string;
|
|
68
|
-
headers?: Record<string, string>;
|
|
69
|
-
};
|
|
70
|
-
export type McpSSEServerConfig = {
|
|
71
|
-
type: 'sse';
|
|
72
|
-
url: string;
|
|
73
|
-
headers?: Record<string, string>;
|
|
74
|
-
};
|
|
75
|
-
export type McpSdkServerConfig = {
|
|
76
|
-
type: 'sdk';
|
|
77
|
-
name: string;
|
|
78
|
-
};
|
|
79
|
-
export type McpServerConfigForProcessTransport = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig | McpSdkServerConfig;
|
|
80
|
-
/**
|
|
81
|
-
* Status information for an MCP server connection.
|
|
82
|
-
*/
|
|
83
|
-
export type McpServerStatus = {
|
|
84
|
-
/** Server name as configured */
|
|
85
|
-
name: string;
|
|
86
|
-
/** Current connection status */
|
|
87
|
-
status: 'connected' | 'failed' | 'needs-auth' | 'pending';
|
|
88
|
-
/** Server information (available when connected) */
|
|
89
|
-
serverInfo?: {
|
|
90
|
-
name: string;
|
|
91
|
-
version: string;
|
|
92
|
-
};
|
|
93
|
-
/** Error message (available when status is 'failed') */
|
|
94
|
-
error?: string;
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Result of a setMcpServers operation.
|
|
98
|
-
*/
|
|
99
|
-
export type McpSetServersResult = {
|
|
100
|
-
/** Names of servers that were added */
|
|
101
|
-
added: string[];
|
|
102
|
-
/** Names of servers that were removed */
|
|
103
|
-
removed: string[];
|
|
104
|
-
/** Map of server names to error messages for servers that failed to connect */
|
|
105
|
-
errors: Record<string, string>;
|
|
106
|
-
};
|
|
107
|
-
export type McpStdioServerConfig = {
|
|
108
|
-
type?: 'stdio';
|
|
109
|
-
command: string;
|
|
110
|
-
args?: string[];
|
|
111
|
-
env?: Record<string, string>;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Information about an available model.
|
|
115
|
-
*/
|
|
116
|
-
export type ModelInfo = {
|
|
117
|
-
/** Model identifier to use in API calls */
|
|
118
|
-
value: string;
|
|
119
|
-
/** Human-readable display name */
|
|
120
|
-
displayName: string;
|
|
121
|
-
/** Description of the model's capabilities */
|
|
122
|
-
description: string;
|
|
123
|
-
};
|
|
124
|
-
export type ModelUsage = {
|
|
125
|
-
inputTokens: number;
|
|
126
|
-
outputTokens: number;
|
|
127
|
-
cacheReadInputTokens: number;
|
|
128
|
-
cacheCreationInputTokens: number;
|
|
129
|
-
webSearchRequests: number;
|
|
130
|
-
costUSD: number;
|
|
131
|
-
contextWindow: number;
|
|
132
|
-
};
|
|
133
|
-
export type NotificationHookInput = BaseHookInput & {
|
|
134
|
-
hook_event_name: 'Notification';
|
|
135
|
-
message: string;
|
|
136
|
-
title?: string;
|
|
137
|
-
notification_type: string;
|
|
138
|
-
};
|
|
139
|
-
export type OutputFormat = JsonSchemaOutputFormat;
|
|
140
|
-
export type OutputFormatType = 'json_schema';
|
|
141
|
-
export type PermissionBehavior = 'allow' | 'deny' | 'ask';
|
|
142
|
-
/**
|
|
143
|
-
* Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'delegate' - Delegate mode, restricts team leader to only Teammate and Task tools. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved.
|
|
144
|
-
*/
|
|
145
|
-
export type PermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | 'delegate' | 'dontAsk';
|
|
146
|
-
export type PermissionRequestHookInput = BaseHookInput & {
|
|
147
|
-
hook_event_name: 'PermissionRequest';
|
|
148
|
-
tool_name: string;
|
|
149
|
-
tool_input: unknown;
|
|
150
|
-
permission_suggestions?: PermissionUpdate[];
|
|
151
|
-
};
|
|
152
|
-
export type PermissionRequestHookSpecificOutput = {
|
|
153
|
-
hookEventName: 'PermissionRequest';
|
|
154
|
-
decision: {
|
|
155
|
-
behavior: 'allow';
|
|
156
|
-
updatedInput?: Record<string, unknown>;
|
|
157
|
-
updatedPermissions?: PermissionUpdate[];
|
|
158
|
-
} | {
|
|
159
|
-
behavior: 'deny';
|
|
160
|
-
message?: string;
|
|
161
|
-
interrupt?: boolean;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
export type PermissionResult = {
|
|
165
|
-
behavior: 'allow';
|
|
166
|
-
updatedInput: Record<string, unknown>;
|
|
167
|
-
updatedPermissions?: PermissionUpdate[];
|
|
168
|
-
toolUseID?: string;
|
|
169
|
-
} | {
|
|
170
|
-
behavior: 'deny';
|
|
171
|
-
message: string;
|
|
172
|
-
interrupt?: boolean;
|
|
173
|
-
toolUseID?: string;
|
|
174
|
-
};
|
|
175
|
-
export type PermissionRuleValue = {
|
|
176
|
-
toolName: string;
|
|
177
|
-
ruleContent?: string;
|
|
178
|
-
};
|
|
179
|
-
export type PermissionUpdateDestination = 'userSettings' | 'projectSettings' | 'localSettings' | 'session' | 'cliArg';
|
|
180
|
-
export type PermissionUpdate = {
|
|
181
|
-
type: 'addRules';
|
|
182
|
-
rules: PermissionRuleValue[];
|
|
183
|
-
behavior: PermissionBehavior;
|
|
184
|
-
destination: PermissionUpdateDestination;
|
|
185
|
-
} | {
|
|
186
|
-
type: 'replaceRules';
|
|
187
|
-
rules: PermissionRuleValue[];
|
|
188
|
-
behavior: PermissionBehavior;
|
|
189
|
-
destination: PermissionUpdateDestination;
|
|
190
|
-
} | {
|
|
191
|
-
type: 'removeRules';
|
|
192
|
-
rules: PermissionRuleValue[];
|
|
193
|
-
behavior: PermissionBehavior;
|
|
194
|
-
destination: PermissionUpdateDestination;
|
|
195
|
-
} | {
|
|
196
|
-
type: 'setMode';
|
|
197
|
-
mode: PermissionMode;
|
|
198
|
-
destination: PermissionUpdateDestination;
|
|
199
|
-
} | {
|
|
200
|
-
type: 'addDirectories';
|
|
201
|
-
directories: string[];
|
|
202
|
-
destination: PermissionUpdateDestination;
|
|
203
|
-
} | {
|
|
204
|
-
type: 'removeDirectories';
|
|
205
|
-
directories: string[];
|
|
206
|
-
destination: PermissionUpdateDestination;
|
|
207
|
-
};
|
|
208
|
-
export type PostToolUseFailureHookInput = BaseHookInput & {
|
|
209
|
-
hook_event_name: 'PostToolUseFailure';
|
|
210
|
-
tool_name: string;
|
|
211
|
-
tool_input: unknown;
|
|
212
|
-
tool_use_id: string;
|
|
213
|
-
error: string;
|
|
214
|
-
is_interrupt?: boolean;
|
|
215
|
-
};
|
|
216
|
-
export type PostToolUseFailureHookSpecificOutput = {
|
|
217
|
-
hookEventName: 'PostToolUseFailure';
|
|
218
|
-
additionalContext?: string;
|
|
219
|
-
};
|
|
220
|
-
export type PostToolUseHookInput = BaseHookInput & {
|
|
221
|
-
hook_event_name: 'PostToolUse';
|
|
222
|
-
tool_name: string;
|
|
223
|
-
tool_input: unknown;
|
|
224
|
-
tool_response: unknown;
|
|
225
|
-
tool_use_id: string;
|
|
226
|
-
};
|
|
227
|
-
export type PostToolUseHookSpecificOutput = {
|
|
228
|
-
hookEventName: 'PostToolUse';
|
|
229
|
-
additionalContext?: string;
|
|
230
|
-
updatedMCPToolOutput?: unknown;
|
|
231
|
-
};
|
|
232
|
-
export type PreCompactHookInput = BaseHookInput & {
|
|
233
|
-
hook_event_name: 'PreCompact';
|
|
234
|
-
trigger: 'manual' | 'auto';
|
|
235
|
-
custom_instructions: string | null;
|
|
236
|
-
};
|
|
237
|
-
export type PreToolUseHookInput = BaseHookInput & {
|
|
238
|
-
hook_event_name: 'PreToolUse';
|
|
239
|
-
tool_name: string;
|
|
240
|
-
tool_input: unknown;
|
|
241
|
-
tool_use_id: string;
|
|
242
|
-
};
|
|
243
|
-
export type PreToolUseHookSpecificOutput = {
|
|
244
|
-
hookEventName: 'PreToolUse';
|
|
245
|
-
permissionDecision?: 'allow' | 'deny' | 'ask';
|
|
246
|
-
permissionDecisionReason?: string;
|
|
247
|
-
updatedInput?: Record<string, unknown>;
|
|
248
|
-
};
|
|
249
|
-
/**
|
|
250
|
-
* Result of a rewindFiles operation.
|
|
251
|
-
*/
|
|
252
|
-
export type RewindFilesResult = {
|
|
253
|
-
canRewind: boolean;
|
|
254
|
-
error?: string;
|
|
255
|
-
filesChanged?: string[];
|
|
256
|
-
insertions?: number;
|
|
257
|
-
deletions?: number;
|
|
258
|
-
};
|
|
259
|
-
export type SDKAssistantMessageError = 'authentication_failed' | 'billing_error' | 'rate_limit' | 'invalid_request' | 'server_error' | 'unknown';
|
|
260
|
-
export type SDKAssistantMessage = {
|
|
261
|
-
type: 'assistant';
|
|
262
|
-
message: APIAssistantMessage;
|
|
263
|
-
parent_tool_use_id: string | null;
|
|
264
|
-
error?: SDKAssistantMessageError;
|
|
265
|
-
uuid: UUID;
|
|
266
|
-
session_id: string;
|
|
267
|
-
};
|
|
268
|
-
export type SDKAuthStatusMessage = {
|
|
269
|
-
type: 'auth_status';
|
|
270
|
-
isAuthenticating: boolean;
|
|
271
|
-
output: string[];
|
|
272
|
-
error?: string;
|
|
273
|
-
uuid: UUID;
|
|
274
|
-
session_id: string;
|
|
275
|
-
};
|
|
276
|
-
export type SDKCompactBoundaryMessage = {
|
|
277
|
-
type: 'system';
|
|
278
|
-
subtype: 'compact_boundary';
|
|
279
|
-
compact_metadata: {
|
|
280
|
-
trigger: 'manual' | 'auto';
|
|
281
|
-
pre_tokens: number;
|
|
282
|
-
};
|
|
283
|
-
uuid: UUID;
|
|
284
|
-
session_id: string;
|
|
285
|
-
};
|
|
286
|
-
export type SDKHookResponseMessage = {
|
|
287
|
-
type: 'system';
|
|
288
|
-
subtype: 'hook_response';
|
|
289
|
-
hook_name: string;
|
|
290
|
-
hook_event: string;
|
|
291
|
-
stdout: string;
|
|
292
|
-
stderr: string;
|
|
293
|
-
exit_code?: number;
|
|
294
|
-
uuid: UUID;
|
|
295
|
-
session_id: string;
|
|
296
|
-
};
|
|
297
|
-
export type SDKMessage = SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage | SDKStatusMessage | SDKHookResponseMessage | SDKToolProgressMessage | SDKAuthStatusMessage;
|
|
298
|
-
export type SDKPartialAssistantMessage = {
|
|
299
|
-
type: 'stream_event';
|
|
300
|
-
event: RawMessageStreamEvent;
|
|
301
|
-
parent_tool_use_id: string | null;
|
|
302
|
-
uuid: UUID;
|
|
303
|
-
session_id: string;
|
|
304
|
-
};
|
|
305
|
-
export type SDKPermissionDenial = {
|
|
306
|
-
tool_name: string;
|
|
307
|
-
tool_use_id: string;
|
|
308
|
-
tool_input: Record<string, unknown>;
|
|
309
|
-
};
|
|
310
|
-
export type SDKResultError = {
|
|
311
|
-
type: 'result';
|
|
312
|
-
subtype: 'error_during_execution' | 'error_max_turns' | 'error_max_budget_usd' | 'error_max_structured_output_retries';
|
|
313
|
-
duration_ms: number;
|
|
314
|
-
duration_api_ms: number;
|
|
315
|
-
is_error: boolean;
|
|
316
|
-
num_turns: number;
|
|
317
|
-
total_cost_usd: number;
|
|
318
|
-
usage: NonNullableUsage;
|
|
319
|
-
modelUsage: Record<string, ModelUsage>;
|
|
320
|
-
permission_denials: SDKPermissionDenial[];
|
|
321
|
-
errors: string[];
|
|
322
|
-
uuid: UUID;
|
|
323
|
-
session_id: string;
|
|
324
|
-
};
|
|
325
|
-
export type SDKResultMessage = SDKResultSuccess | SDKResultError;
|
|
326
|
-
export type SDKResultSuccess = {
|
|
327
|
-
type: 'result';
|
|
328
|
-
subtype: 'success';
|
|
329
|
-
duration_ms: number;
|
|
330
|
-
duration_api_ms: number;
|
|
331
|
-
is_error: boolean;
|
|
332
|
-
num_turns: number;
|
|
333
|
-
result: string;
|
|
334
|
-
total_cost_usd: number;
|
|
335
|
-
usage: NonNullableUsage;
|
|
336
|
-
modelUsage: Record<string, ModelUsage>;
|
|
337
|
-
permission_denials: SDKPermissionDenial[];
|
|
338
|
-
structured_output?: unknown;
|
|
339
|
-
uuid: UUID;
|
|
340
|
-
session_id: string;
|
|
341
|
-
};
|
|
342
|
-
export type SDKStatusMessage = {
|
|
343
|
-
type: 'system';
|
|
344
|
-
subtype: 'status';
|
|
345
|
-
status: SDKStatus;
|
|
346
|
-
uuid: UUID;
|
|
347
|
-
session_id: string;
|
|
348
|
-
};
|
|
349
|
-
export type SDKStatus = 'compacting' | null;
|
|
350
|
-
export type SDKSystemMessage = {
|
|
351
|
-
type: 'system';
|
|
352
|
-
subtype: 'init';
|
|
353
|
-
agents?: string[];
|
|
354
|
-
apiKeySource: ApiKeySource;
|
|
355
|
-
betas?: string[];
|
|
356
|
-
claude_code_version: string;
|
|
357
|
-
cwd: string;
|
|
358
|
-
tools: string[];
|
|
359
|
-
mcp_servers: {
|
|
360
|
-
name: string;
|
|
361
|
-
status: string;
|
|
362
|
-
}[];
|
|
363
|
-
model: string;
|
|
364
|
-
/** Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'delegate' - Delegate mode, restricts team leader to only Teammate and Task tools. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved. */
|
|
365
|
-
permissionMode: PermissionMode;
|
|
366
|
-
slash_commands: string[];
|
|
367
|
-
output_style: string;
|
|
368
|
-
skills: string[];
|
|
369
|
-
plugins: {
|
|
370
|
-
name: string;
|
|
371
|
-
path: string;
|
|
372
|
-
}[];
|
|
373
|
-
uuid: UUID;
|
|
374
|
-
session_id: string;
|
|
375
|
-
};
|
|
376
|
-
export type SDKToolProgressMessage = {
|
|
377
|
-
type: 'tool_progress';
|
|
378
|
-
tool_use_id: string;
|
|
379
|
-
tool_name: string;
|
|
380
|
-
parent_tool_use_id: string | null;
|
|
381
|
-
elapsed_time_seconds: number;
|
|
382
|
-
uuid: UUID;
|
|
383
|
-
session_id: string;
|
|
384
|
-
};
|
|
385
|
-
export type SDKUserMessageReplay = {
|
|
386
|
-
type: 'user';
|
|
387
|
-
message: APIUserMessage;
|
|
388
|
-
parent_tool_use_id: string | null;
|
|
389
|
-
isSynthetic?: boolean;
|
|
390
|
-
tool_use_result?: unknown;
|
|
391
|
-
uuid: UUID;
|
|
392
|
-
session_id: string;
|
|
393
|
-
isReplay: true;
|
|
394
|
-
};
|
|
395
|
-
export type SDKUserMessage = {
|
|
396
|
-
type: 'user';
|
|
397
|
-
message: APIUserMessage;
|
|
398
|
-
parent_tool_use_id: string | null;
|
|
399
|
-
isSynthetic?: boolean;
|
|
400
|
-
tool_use_result?: unknown;
|
|
401
|
-
uuid?: UUID;
|
|
402
|
-
session_id: string;
|
|
403
|
-
};
|
|
404
|
-
export type SdkBeta = 'context-1m-2025-08-07';
|
|
405
|
-
/**
|
|
406
|
-
* Configuration for loading a plugin.
|
|
407
|
-
*/
|
|
408
|
-
export type SdkPluginConfig = {
|
|
409
|
-
/** Plugin type. Currently only 'local' is supported */
|
|
410
|
-
type: 'local';
|
|
411
|
-
/** Absolute or relative path to the plugin directory */
|
|
412
|
-
path: string;
|
|
413
|
-
};
|
|
414
|
-
export type SessionEndHookInput = BaseHookInput & {
|
|
415
|
-
hook_event_name: 'SessionEnd';
|
|
416
|
-
reason: ExitReason;
|
|
417
|
-
};
|
|
418
|
-
export type SessionStartHookInput = BaseHookInput & {
|
|
419
|
-
hook_event_name: 'SessionStart';
|
|
420
|
-
source: 'startup' | 'resume' | 'clear' | 'compact';
|
|
421
|
-
};
|
|
422
|
-
export type SessionStartHookSpecificOutput = {
|
|
423
|
-
hookEventName: 'SessionStart';
|
|
424
|
-
additionalContext?: string;
|
|
425
|
-
};
|
|
426
|
-
/**
|
|
427
|
-
* Source for loading filesystem-based settings. 'user' - Global user settings (~/.claude/settings.json). 'project' - Project settings (.claude/settings.json). 'local' - Local settings (.claude/settings.local.json).
|
|
428
|
-
*/
|
|
429
|
-
export type SettingSource = 'user' | 'project' | 'local';
|
|
430
|
-
/**
|
|
431
|
-
* Information about an available skill (invoked via /command syntax).
|
|
432
|
-
*/
|
|
433
|
-
export type SlashCommand = {
|
|
434
|
-
/** Skill name (without the leading slash) */
|
|
435
|
-
name: string;
|
|
436
|
-
/** Description of what the skill does */
|
|
437
|
-
description: string;
|
|
438
|
-
/** Hint for skill arguments (e.g., "<file>") */
|
|
439
|
-
argumentHint: string;
|
|
440
|
-
};
|
|
441
|
-
export type StopHookInput = BaseHookInput & {
|
|
442
|
-
hook_event_name: 'Stop';
|
|
443
|
-
stop_hook_active: boolean;
|
|
444
|
-
};
|
|
445
|
-
export type SubagentStartHookInput = BaseHookInput & {
|
|
446
|
-
hook_event_name: 'SubagentStart';
|
|
447
|
-
agent_id: string;
|
|
448
|
-
agent_type: string;
|
|
449
|
-
};
|
|
450
|
-
export type SubagentStartHookSpecificOutput = {
|
|
451
|
-
hookEventName: 'SubagentStart';
|
|
452
|
-
additionalContext?: string;
|
|
453
|
-
};
|
|
454
|
-
export type SubagentStopHookInput = BaseHookInput & {
|
|
455
|
-
hook_event_name: 'SubagentStop';
|
|
456
|
-
stop_hook_active: boolean;
|
|
457
|
-
agent_id: string;
|
|
458
|
-
agent_transcript_path: string;
|
|
459
|
-
};
|
|
460
|
-
export type SyncHookJSONOutput = {
|
|
461
|
-
continue?: boolean;
|
|
462
|
-
suppressOutput?: boolean;
|
|
463
|
-
stopReason?: string;
|
|
464
|
-
decision?: 'approve' | 'block';
|
|
465
|
-
systemMessage?: string;
|
|
466
|
-
reason?: string;
|
|
467
|
-
hookSpecificOutput?: PreToolUseHookSpecificOutput | UserPromptSubmitHookSpecificOutput | SessionStartHookSpecificOutput | SubagentStartHookSpecificOutput | PostToolUseHookSpecificOutput | PostToolUseFailureHookSpecificOutput | PermissionRequestHookSpecificOutput;
|
|
468
|
-
};
|
|
469
|
-
export type UserPromptSubmitHookInput = BaseHookInput & {
|
|
470
|
-
hook_event_name: 'UserPromptSubmit';
|
|
471
|
-
prompt: string;
|
|
472
|
-
};
|
|
473
|
-
export type UserPromptSubmitHookSpecificOutput = {
|
|
474
|
-
hookEventName: 'UserPromptSubmit';
|
|
475
|
-
additionalContext?: string;
|
|
476
|
-
};
|