@cnwenf/occ 2.1.284 → 2.1.286
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/cli.js +70 -20
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.286","BINARY_NAME":"occ","BUILD_TIME":"2026-07-25T17:38:43.639Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -57989,7 +57989,6 @@ __export(exports_permissions, {
|
|
|
57989
57989
|
});
|
|
57990
57990
|
var EXTERNAL_PERMISSION_MODES, INTERNAL_PERMISSION_MODES, PERMISSION_MODES;
|
|
57991
57991
|
var init_permissions = __esm(() => {
|
|
57992
|
-
init_featureFlags();
|
|
57993
57992
|
EXTERNAL_PERMISSION_MODES = [
|
|
57994
57993
|
"acceptEdits",
|
|
57995
57994
|
"auto",
|
|
@@ -57999,8 +57998,7 @@ var init_permissions = __esm(() => {
|
|
|
57999
57998
|
"plan"
|
|
58000
57999
|
];
|
|
58001
58000
|
INTERNAL_PERMISSION_MODES = [
|
|
58002
|
-
...EXTERNAL_PERMISSION_MODES
|
|
58003
|
-
...feature("TRANSCRIPT_CLASSIFIER") ? ["auto"] : []
|
|
58001
|
+
...EXTERNAL_PERMISSION_MODES
|
|
58004
58002
|
];
|
|
58005
58003
|
PERMISSION_MODES = INTERNAL_PERMISSION_MODES;
|
|
58006
58004
|
});
|
|
@@ -58136,7 +58134,8 @@ var init_agentSdkTypes = __esm(() => {
|
|
|
58136
58134
|
"InstructionsLoaded",
|
|
58137
58135
|
"CwdChanged",
|
|
58138
58136
|
"FileChanged",
|
|
58139
|
-
"MessageDisplay"
|
|
58137
|
+
"MessageDisplay",
|
|
58138
|
+
"DirectoryAdded"
|
|
58140
58139
|
];
|
|
58141
58140
|
});
|
|
58142
58141
|
|
|
@@ -361612,7 +361611,7 @@ function claimConcurrentSubagentSlot(context4) {
|
|
|
361612
361611
|
}
|
|
361613
361612
|
return context4.taskRegistry?.takeConcurrencySlot() ?? (() => {});
|
|
361614
361613
|
}
|
|
361615
|
-
var DEFAULT_MAX_WEB_SEARCHES_PER_SESSION = 200, DEFAULT_MAX_SUBAGENTS_PER_SESSION = 200, DEFAULT_MAX_CONCURRENT_SUBAGENTS = 20, DEFAULT_MAX_SUBAGENT_SPAWN_DEPTH =
|
|
361614
|
+
var DEFAULT_MAX_WEB_SEARCHES_PER_SESSION = 200, DEFAULT_MAX_SUBAGENTS_PER_SESSION = 200, DEFAULT_MAX_CONCURRENT_SUBAGENTS = 20, DEFAULT_MAX_SUBAGENT_SPAWN_DEPTH = 3;
|
|
361616
361615
|
|
|
361617
361616
|
// src/utils/sdkEventQueue.ts
|
|
361618
361617
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
@@ -451786,7 +451785,7 @@ var init_detection = __esm(() => {
|
|
|
451786
451785
|
});
|
|
451787
451786
|
|
|
451788
451787
|
// src/entrypoints/sdk/coreSchemas.ts
|
|
451789
|
-
var ModelUsageSchema, OutputFormatTypeSchema, BaseOutputFormatSchema, JsonSchemaOutputFormatSchema, OutputFormatSchema, ApiKeySourceSchema, ConfigScopeSchema2, SdkBetaSchema, ThinkingAdaptiveSchema, ThinkingEnabledSchema, ThinkingDisabledSchema, ThinkingConfigSchema, McpStdioServerConfigSchema2, McpSSEServerConfigSchema2, McpHttpServerConfigSchema, McpSdkServerConfigSchema2, McpServerConfigForProcessTransportSchema, McpClaudeAIProxyServerConfigSchema2, McpServerStatusConfigSchema, McpServerStatusSchema, McpSetServersResultSchema, PermissionUpdateDestinationSchema, PermissionBehaviorSchema, PermissionRuleValueSchema, PermissionUpdateSchema, PermissionDecisionClassificationSchema, PermissionResultSchema, PermissionModeSchema, HOOK_EVENTS2, HookEventSchema, BaseHookInputSchema, PreToolUseHookInputSchema, PermissionRequestHookInputSchema, PostToolUseHookInputSchema, PostToolUseFailureHookInputSchema, PermissionDeniedHookInputSchema, NotificationHookInputSchema, UserPromptSubmitHookInputSchema, SessionStartHookInputSchema, SetupHookInputSchema, StopHookInputSchema, StopFailureHookInputSchema, SubagentStartHookInputSchema, SubagentStopHookInputSchema, PreCompactHookInputSchema, PostCompactHookInputSchema, TeammateIdleHookInputSchema, TaskCreatedHookInputSchema, TaskCompletedHookInputSchema, ElicitationHookInputSchema, ElicitationResultHookInputSchema, CONFIG_CHANGE_SOURCES, ConfigChangeHookInputSchema, INSTRUCTIONS_LOAD_REASONS, INSTRUCTIONS_MEMORY_TYPES, InstructionsLoadedHookInputSchema, WorktreeCreateHookInputSchema, WorktreeRemoveHookInputSchema, CwdChangedHookInputSchema, FileChangedHookInputSchema, PostToolBatchToolCallSchema, PostToolBatchHookInputSchema, UserPromptExpansionHookInputSchema, MessageDisplayHookInputSchema, EXIT_REASONS, ExitReasonSchema, SessionEndHookInputSchema, HookInputSchema, AsyncHookJSONOutputSchema, PreToolUseHookSpecificOutputSchema, UserPromptSubmitHookSpecificOutputSchema, SessionStartHookSpecificOutputSchema, SetupHookSpecificOutputSchema, SubagentStartHookSpecificOutputSchema, PostToolUseHookSpecificOutputSchema, PostToolUseFailureHookSpecificOutputSchema, PermissionDeniedHookSpecificOutputSchema, NotificationHookSpecificOutputSchema, PermissionRequestHookSpecificOutputSchema, CwdChangedHookSpecificOutputSchema, FileChangedHookSpecificOutputSchema, PostToolBatchHookSpecificOutputSchema, UserPromptExpansionHookSpecificOutputSchema, MessageDisplayHookSpecificOutputSchema, SyncHookJSONOutputSchema, ElicitationHookSpecificOutputSchema, ElicitationResultHookSpecificOutputSchema, WorktreeCreateHookSpecificOutputSchema, HookJSONOutputSchema, PromptRequestOptionSchema, PromptRequestSchema, PromptResponseSchema, SlashCommandSchema, AgentInfoSchema, ModelInfoSchema, AccountInfoSchema, AgentMcpServerSpecSchema2, AgentDefinitionSchema, SettingSourceSchema, SdkPluginConfigSchema, RewindFilesResultSchema, APIUserMessagePlaceholder, APIAssistantMessagePlaceholder, RawMessageStreamEventPlaceholder, UUIDPlaceholder, NonNullableUsagePlaceholder, SDKAssistantMessageErrorSchema, SDKStatusSchema, SDKUserMessageContentSchema, SDKUserMessageSchema, SDKUserMessageReplaySchema, SDKRateLimitInfoSchema, SDKAssistantMessageSchema, SDKRateLimitEventSchema, SDKStreamlinedTextMessageSchema, SDKStreamlinedToolUseSummaryMessageSchema, SDKPermissionDenialSchema, SDKResultSuccessSchema, SDKResultErrorSchema, SDKResultMessageSchema, SDKSystemMessageSchema, SDKPartialAssistantMessageSchema, SDKCompactBoundaryMessageSchema, SDKStatusMessageSchema, SDKPostTurnSummaryMessageSchema, SDKAPIRetryMessageSchema, SDKLocalCommandOutputMessageSchema, SDKHookStartedMessageSchema, SDKHookProgressMessageSchema, SDKHookResponseMessageSchema, SDKToolProgressMessageSchema, SDKAuthStatusMessageSchema, SDKFilesPersistedEventSchema, SDKTaskNotificationMessageSchema, SDKTaskStartedMessageSchema, SDKSessionStateChangedMessageSchema, SDKTaskProgressMessageSchema, SDKToolUseSummaryMessageSchema, SDKElicitationCompleteMessageSchema, SDKPromptSuggestionMessageSchema, SDKSessionInfoSchema, SDKMessageSchema, FastModeStateSchema;
|
|
451788
|
+
var ModelUsageSchema, OutputFormatTypeSchema, BaseOutputFormatSchema, JsonSchemaOutputFormatSchema, OutputFormatSchema, ApiKeySourceSchema, ConfigScopeSchema2, SdkBetaSchema, ThinkingAdaptiveSchema, ThinkingEnabledSchema, ThinkingDisabledSchema, ThinkingConfigSchema, McpStdioServerConfigSchema2, McpSSEServerConfigSchema2, McpHttpServerConfigSchema, McpSdkServerConfigSchema2, McpServerConfigForProcessTransportSchema, McpClaudeAIProxyServerConfigSchema2, McpServerStatusConfigSchema, McpServerStatusSchema, McpSetServersResultSchema, PermissionUpdateDestinationSchema, PermissionBehaviorSchema, PermissionRuleValueSchema, PermissionUpdateSchema, PermissionDecisionClassificationSchema, PermissionResultSchema, PermissionModeSchema, HOOK_EVENTS2, HookEventSchema, BaseHookInputSchema, PreToolUseHookInputSchema, PermissionRequestHookInputSchema, PostToolUseHookInputSchema, PostToolUseFailureHookInputSchema, PermissionDeniedHookInputSchema, NotificationHookInputSchema, UserPromptSubmitHookInputSchema, SessionStartHookInputSchema, SetupHookInputSchema, StopHookInputSchema, StopFailureHookInputSchema, SubagentStartHookInputSchema, SubagentStopHookInputSchema, PreCompactHookInputSchema, PostCompactHookInputSchema, TeammateIdleHookInputSchema, TaskCreatedHookInputSchema, TaskCompletedHookInputSchema, ElicitationHookInputSchema, ElicitationResultHookInputSchema, CONFIG_CHANGE_SOURCES, ConfigChangeHookInputSchema, INSTRUCTIONS_LOAD_REASONS, INSTRUCTIONS_MEMORY_TYPES, InstructionsLoadedHookInputSchema, WorktreeCreateHookInputSchema, WorktreeRemoveHookInputSchema, CwdChangedHookInputSchema, FileChangedHookInputSchema, DirectoryAddedHookInputSchema, PostToolBatchToolCallSchema, PostToolBatchHookInputSchema, UserPromptExpansionHookInputSchema, MessageDisplayHookInputSchema, EXIT_REASONS, ExitReasonSchema, SessionEndHookInputSchema, HookInputSchema, AsyncHookJSONOutputSchema, PreToolUseHookSpecificOutputSchema, UserPromptSubmitHookSpecificOutputSchema, SessionStartHookSpecificOutputSchema, SetupHookSpecificOutputSchema, SubagentStartHookSpecificOutputSchema, PostToolUseHookSpecificOutputSchema, PostToolUseFailureHookSpecificOutputSchema, PermissionDeniedHookSpecificOutputSchema, NotificationHookSpecificOutputSchema, PermissionRequestHookSpecificOutputSchema, CwdChangedHookSpecificOutputSchema, FileChangedHookSpecificOutputSchema, PostToolBatchHookSpecificOutputSchema, UserPromptExpansionHookSpecificOutputSchema, MessageDisplayHookSpecificOutputSchema, SyncHookJSONOutputSchema, ElicitationHookSpecificOutputSchema, ElicitationResultHookSpecificOutputSchema, WorktreeCreateHookSpecificOutputSchema, HookJSONOutputSchema, PromptRequestOptionSchema, PromptRequestSchema, PromptResponseSchema, SlashCommandSchema, AgentInfoSchema, ModelInfoSchema, AccountInfoSchema, AgentMcpServerSpecSchema2, AgentDefinitionSchema, SettingSourceSchema, SdkPluginConfigSchema, RewindFilesResultSchema, APIUserMessagePlaceholder, APIAssistantMessagePlaceholder, RawMessageStreamEventPlaceholder, UUIDPlaceholder, NonNullableUsagePlaceholder, SDKAssistantMessageErrorSchema, SDKStatusSchema, SDKUserMessageContentSchema, SDKUserMessageSchema, SDKUserMessageReplaySchema, SDKRateLimitInfoSchema, SDKAssistantMessageSchema, SDKRateLimitEventSchema, SDKStreamlinedTextMessageSchema, SDKStreamlinedToolUseSummaryMessageSchema, SDKPermissionDenialSchema, SDKResultSuccessSchema, SDKResultErrorSchema, SDKResultMessageSchema, SDKSystemMessageSchema, SDKPartialAssistantMessageSchema, SDKCompactBoundaryMessageSchema, SDKStatusMessageSchema, SDKPostTurnSummaryMessageSchema, SDKAPIRetryMessageSchema, SDKLocalCommandOutputMessageSchema, SDKHookStartedMessageSchema, SDKHookProgressMessageSchema, SDKHookResponseMessageSchema, SDKToolProgressMessageSchema, SDKAuthStatusMessageSchema, SDKFilesPersistedEventSchema, SDKTaskNotificationMessageSchema, SDKTaskStartedMessageSchema, SDKSessionStateChangedMessageSchema, SDKTaskProgressMessageSchema, SDKToolUseSummaryMessageSchema, SDKElicitationCompleteMessageSchema, SDKPromptSuggestionMessageSchema, SDKSessionInfoSchema, SDKMessageSchema, FastModeStateSchema;
|
|
451790
451789
|
var init_coreSchemas = __esm(() => {
|
|
451791
451790
|
init_v4();
|
|
451792
451791
|
ModelUsageSchema = lazySchema(() => exports_external.object({
|
|
@@ -451984,7 +451983,8 @@ var init_coreSchemas = __esm(() => {
|
|
|
451984
451983
|
"InstructionsLoaded",
|
|
451985
451984
|
"CwdChanged",
|
|
451986
451985
|
"FileChanged",
|
|
451987
|
-
"MessageDisplay"
|
|
451986
|
+
"MessageDisplay",
|
|
451987
|
+
"DirectoryAdded"
|
|
451988
451988
|
];
|
|
451989
451989
|
HookEventSchema = lazySchema(() => exports_external.enum(HOOK_EVENTS2));
|
|
451990
451990
|
BaseHookInputSchema = lazySchema(() => exports_external.object({
|
|
@@ -452174,6 +452174,11 @@ var init_coreSchemas = __esm(() => {
|
|
|
452174
452174
|
file_path: exports_external.string(),
|
|
452175
452175
|
event: exports_external.enum(["change", "add", "unlink"])
|
|
452176
452176
|
})));
|
|
452177
|
+
DirectoryAddedHookInputSchema = lazySchema(() => BaseHookInputSchema().and(exports_external.object({
|
|
452178
|
+
hook_event_name: exports_external.literal("DirectoryAdded"),
|
|
452179
|
+
directory: exports_external.string(),
|
|
452180
|
+
source: exports_external.string()
|
|
452181
|
+
})));
|
|
452177
452182
|
PostToolBatchToolCallSchema = lazySchema(() => exports_external.object({
|
|
452178
452183
|
tool_name: exports_external.string(),
|
|
452179
452184
|
tool_input: exports_external.unknown(),
|
|
@@ -452243,7 +452248,8 @@ var init_coreSchemas = __esm(() => {
|
|
|
452243
452248
|
FileChangedHookInputSchema(),
|
|
452244
452249
|
PostToolBatchHookInputSchema(),
|
|
452245
452250
|
UserPromptExpansionHookInputSchema(),
|
|
452246
|
-
MessageDisplayHookInputSchema()
|
|
452251
|
+
MessageDisplayHookInputSchema(),
|
|
452252
|
+
DirectoryAddedHookInputSchema()
|
|
452247
452253
|
]));
|
|
452248
452254
|
AsyncHookJSONOutputSchema = lazySchema(() => exports_external.object({
|
|
452249
452255
|
async: exports_external.literal(true),
|
|
@@ -473016,7 +473022,8 @@ function convertPluginHooksToMatchers(plugin) {
|
|
|
473016
473022
|
FileChanged: [],
|
|
473017
473023
|
PostToolBatch: [],
|
|
473018
473024
|
UserPromptExpansion: [],
|
|
473019
|
-
MessageDisplay: []
|
|
473025
|
+
MessageDisplay: [],
|
|
473026
|
+
DirectoryAdded: []
|
|
473020
473027
|
};
|
|
473021
473028
|
if (!plugin.hooksConfig) {
|
|
473022
473029
|
return pluginMatchers;
|
|
@@ -473137,7 +473144,8 @@ var init_loadPluginHooks = __esm(() => {
|
|
|
473137
473144
|
FileChanged: [],
|
|
473138
473145
|
PostToolBatch: [],
|
|
473139
473146
|
UserPromptExpansion: [],
|
|
473140
|
-
MessageDisplay: []
|
|
473147
|
+
MessageDisplay: [],
|
|
473148
|
+
DirectoryAdded: []
|
|
473141
473149
|
};
|
|
473142
473150
|
for (const plugin of enabled2) {
|
|
473143
473151
|
if (!plugin.hooksConfig) {
|
|
@@ -599736,7 +599744,8 @@ var init_coreTypes = __esm(() => {
|
|
|
599736
599744
|
"InstructionsLoaded",
|
|
599737
599745
|
"CwdChanged",
|
|
599738
599746
|
"FileChanged",
|
|
599739
|
-
"MessageDisplay"
|
|
599747
|
+
"MessageDisplay",
|
|
599748
|
+
"DirectoryAdded"
|
|
599740
599749
|
];
|
|
599741
599750
|
});
|
|
599742
599751
|
|
|
@@ -638764,10 +638773,14 @@ async function call8(onDone, context7, args) {
|
|
|
638764
638773
|
toolPermissionContext: updatedContext
|
|
638765
638774
|
}));
|
|
638766
638775
|
const currentDirs = getAdditionalDirectoriesForClaudeMd();
|
|
638767
|
-
|
|
638776
|
+
const wasNewlyRegistered = !currentDirs.includes(path35);
|
|
638777
|
+
if (wasNewlyRegistered) {
|
|
638768
638778
|
setAdditionalDirectoriesForClaudeMd([...currentDirs, path35]);
|
|
638769
638779
|
}
|
|
638770
638780
|
SandboxManager2.refreshConfig();
|
|
638781
|
+
if (wasNewlyRegistered) {
|
|
638782
|
+
executeDirectoryAddedHooks(path35, "add-dir").catch(() => {});
|
|
638783
|
+
}
|
|
638771
638784
|
let message;
|
|
638772
638785
|
if (remember) {
|
|
638773
638786
|
try {
|
|
@@ -638819,6 +638832,7 @@ var init_add_dir = __esm(() => {
|
|
|
638819
638832
|
init_ink2();
|
|
638820
638833
|
init_PermissionUpdate();
|
|
638821
638834
|
init_sandbox_adapter();
|
|
638835
|
+
init_hooks5();
|
|
638822
638836
|
init_validation3();
|
|
638823
638837
|
import_compiler_runtime127 = __toESM(require_compiler_runtime(), 1);
|
|
638824
638838
|
import_react96 = __toESM(require_react(), 1);
|
|
@@ -705565,7 +705579,8 @@ function groupHooksByEventAndMatcher(appState, toolNames) {
|
|
|
705565
705579
|
FileChanged: {},
|
|
705566
705580
|
PostToolBatch: {},
|
|
705567
705581
|
UserPromptExpansion: {},
|
|
705568
|
-
MessageDisplay: {}
|
|
705582
|
+
MessageDisplay: {},
|
|
705583
|
+
DirectoryAdded: {}
|
|
705569
705584
|
};
|
|
705570
705585
|
const metadata = getHookEventMetadata(toolNames);
|
|
705571
705586
|
getAllHooks(appState).forEach((hook) => {
|
|
@@ -705911,6 +705926,14 @@ Other exit codes - show stderr to user only`
|
|
|
705911
705926
|
CLAUDE_ENV_FILE is set \u2014 write bash exports there to apply env to subsequent BashTool commands.
|
|
705912
705927
|
Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to register with the FileChanged watcher.
|
|
705913
705928
|
Exit code 0 - command completes successfully
|
|
705929
|
+
Other exit codes - show stderr to user only`
|
|
705930
|
+
},
|
|
705931
|
+
DirectoryAdded: {
|
|
705932
|
+
summary: "After a working directory is added mid-session",
|
|
705933
|
+
description: `Fires after /add-dir or the register_repo_root SDK control request registers a new working directory, after the sandbox configuration has been refreshed \u2014 so sandboxed tools and permission state already see the new directory (hook commands themselves run unsandboxed).
|
|
705934
|
+
Input to command is JSON with directory (the added path) and source (the add origin).
|
|
705935
|
+
A directory that is already a registered working directory (including a duplicate of an earlier request) is denied with an error; the registration pipeline and DirectoryAdded hooks do not re-run.
|
|
705936
|
+
Exit code 0 - command completes successfully
|
|
705914
705937
|
Other exit codes - show stderr to user only`
|
|
705915
705938
|
},
|
|
705916
705939
|
FileChanged: {
|
|
@@ -725657,6 +725680,7 @@ __export(exports_hooks2, {
|
|
|
725657
725680
|
executeFileChangedHooks: () => executeFileChangedHooks,
|
|
725658
725681
|
executeElicitationResultHooks: () => executeElicitationResultHooks,
|
|
725659
725682
|
executeElicitationHooks: () => executeElicitationHooks,
|
|
725683
|
+
executeDirectoryAddedHooks: () => executeDirectoryAddedHooks,
|
|
725660
725684
|
executeCwdChangedHooks: () => executeCwdChangedHooks,
|
|
725661
725685
|
executeConfigChangeHooks: () => executeConfigChangeHooks,
|
|
725662
725686
|
createBaseHookInput: () => createBaseHookInput,
|
|
@@ -726615,6 +726639,9 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools
|
|
|
726615
726639
|
case "ConfigChange":
|
|
726616
726640
|
matchQuery = hookInput.source;
|
|
726617
726641
|
break;
|
|
726642
|
+
case "DirectoryAdded":
|
|
726643
|
+
matchQuery = hookInput.source;
|
|
726644
|
+
break;
|
|
726618
726645
|
case "InstructionsLoaded":
|
|
726619
726646
|
matchQuery = hookInput.load_reason;
|
|
726620
726647
|
break;
|
|
@@ -728328,6 +728355,24 @@ function executeCwdChangedHooks(oldCwd, newCwd, timeoutMs = TOOL_HOOK_EXECUTION_
|
|
|
728328
728355
|
};
|
|
728329
728356
|
return executeEnvHooks(hookInput, timeoutMs);
|
|
728330
728357
|
}
|
|
728358
|
+
async function executeDirectoryAddedHooks(directory, source2, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) {
|
|
728359
|
+
const hookInput = {
|
|
728360
|
+
...createBaseHookInput(undefined),
|
|
728361
|
+
hook_event_name: "DirectoryAdded",
|
|
728362
|
+
directory,
|
|
728363
|
+
source: source2
|
|
728364
|
+
};
|
|
728365
|
+
const results = await executeHooksOutsideREPL({
|
|
728366
|
+
hookInput,
|
|
728367
|
+
timeoutMs,
|
|
728368
|
+
matchQuery: source2
|
|
728369
|
+
});
|
|
728370
|
+
if (results.length > 0) {
|
|
728371
|
+
invalidateSessionEnvCache();
|
|
728372
|
+
}
|
|
728373
|
+
const systemMessages = results.map((r4) => r4.systemMessage).filter((m5) => !!m5);
|
|
728374
|
+
return { results, systemMessages };
|
|
728375
|
+
}
|
|
728331
728376
|
function executeFileChangedHooks(filePath, event, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) {
|
|
728332
728377
|
const hookInput = {
|
|
728333
728378
|
...createBaseHookInput(undefined),
|
|
@@ -823187,17 +823232,22 @@ async function run() {
|
|
|
823187
823232
|
throw new Error("--task-budget must be a positive integer");
|
|
823188
823233
|
}
|
|
823189
823234
|
return tokens;
|
|
823190
|
-
}).hideHelp()).option("--replay-user-messages", "Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)", () => true).addOption(new Option("--enable-auth-status", "Enable auth status messages in SDK mode").default(false).hideHelp()).option("--allowedTools, --allowed-tools <tools...>", 'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>", 'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>", 'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config <configs...>", "Load MCP servers from JSON files or strings (space-separated)").addOption(new Option("--permission-prompt-tool <tool>", "MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new Option("--system-prompt <prompt>", "System prompt to use for the session").argParser(String)).addOption(new Option("--system-prompt-file <file>", "Read system prompt from a file").argParser(String).hideHelp()).addOption(new Option("--append-system-prompt <prompt>", "Append a system prompt to the default system prompt").argParser(String)).addOption(new Option("--append-system-prompt-file <file>", "Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new Option("--permission-mode <mode>", "Permission mode to use for the session").
|
|
823235
|
+
}).hideHelp()).option("--replay-user-messages", "Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)", () => true).addOption(new Option("--enable-auth-status", "Enable auth status messages in SDK mode").default(false).hideHelp()).option("--allowedTools, --allowed-tools <tools...>", 'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>", 'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>", 'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config <configs...>", "Load MCP servers from JSON files or strings (space-separated)").addOption(new Option("--permission-prompt-tool <tool>", "MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new Option("--system-prompt <prompt>", "System prompt to use for the session").argParser(String)).addOption(new Option("--system-prompt-file <file>", "Read system prompt from a file").argParser(String).hideHelp()).addOption(new Option("--append-system-prompt <prompt>", "Append a system prompt to the default system prompt").argParser(String)).addOption(new Option("--append-system-prompt-file <file>", "Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new Option("--permission-mode <mode>", "Permission mode to use for the session").choices(PERMISSION_MODES).argParser((raw) => {
|
|
823236
|
+
const normalized = normalizePermissionModeInput(raw);
|
|
823237
|
+
if (!PERMISSION_MODES.includes(normalized)) {
|
|
823238
|
+
throw new InvalidArgumentError(`Allowed choices are ${PERMISSION_MODES.join(", ")}.`);
|
|
823239
|
+
}
|
|
823240
|
+
return normalized;
|
|
823241
|
+
})).option("-c, --continue", "Continue the most recent conversation in the current directory", () => true).option("-r, --resume [value]", "Resume a conversation by session ID, or open interactive picker with optional search term", (value) => value || true).option("--fork-session", "When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)", () => true).addOption(new Option("--prefill <text>", "Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new Option("--deep-link-origin", "Signal that this session was launched from a deep link").hideHelp()).addOption(new Option("--deep-link-repo <slug>", "Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new Option("--deep-link-last-fetch <ms>", "FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((v6) => {
|
|
823191
823242
|
const n6 = Number(v6);
|
|
823192
823243
|
return Number.isFinite(n6) ? n6 : undefined;
|
|
823193
|
-
}).hideHelp()).option("--from-pr [value]", "Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term", (value) => value || true).option("--no-session-persistence", "Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new Option("--resume-session-at <message id>", "When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new Option("--rewind-files <user-message-id>", "Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>", `Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).addOption(new Option("--effort <level>", `Effort level for the current session (
|
|
823244
|
+
}).hideHelp()).option("--from-pr [value]", "Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term", (value) => value || true).option("--no-session-persistence", "Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new Option("--resume-session-at <message id>", "When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new Option("--rewind-files <user-message-id>", "Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>", `Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').`).addOption(new Option("--effort <level>", `Effort level for the current session (${EFFORT_LEVELS.join(", ")})`).argParser((rawValue) => {
|
|
823194
823245
|
const value = rawValue.toLowerCase();
|
|
823195
|
-
|
|
823196
|
-
|
|
823197
|
-
throw new InvalidArgumentError(`It must be one of: ${allowed.join(", ")}`);
|
|
823246
|
+
if (!EFFORT_LEVELS.includes(value)) {
|
|
823247
|
+
throw new InvalidArgumentError(`It must be one of: ${EFFORT_LEVELS.join(", ")}`);
|
|
823198
823248
|
}
|
|
823199
823249
|
return value;
|
|
823200
|
-
})).option("--agent <agent>", `Agent for the current session. Overrides the 'agent' setting.`).option("--betas <betas...>", "Beta headers to include in API requests (API key users only)").option("--fallback-model <model>", "Enable automatic fallback to specified model when default model is overloaded (only works with --print)").addOption(new Option("--workload <tag>", "Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)").hideHelp()).option("--settings <file-or-json>", "Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>", "Additional directories to allow tool access to").option("--ide", "Automatically connect to IDE on startup if exactly one valid IDE is available", () => true).option("--strict-mcp-config", "Only use MCP servers from --mcp-config, ignoring all other MCP configurations", () => true).option("--session-id <uuid>", "Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>", "Set a display name for this session (shown in /resume and terminal title)").option("--agents <json>", `JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>", "Comma-separated list of setting sources to load (user, project, local).").addOption(new Option("--prompt-suggestions [value]", "Enable prompt suggestions. In print/SDK mode, emits a prompt_suggestion message after each turn with a predicted next user prompt").choices(["true", "false", "1", "0", "yes", "no", "on", "off"]).preset("true").argParser((raw) => {
|
|
823250
|
+
})).option("--agent <agent>", `Agent for the current session. Overrides the 'agent' setting.`).option("--betas <betas...>", "Beta headers to include in API requests (API key users only)").option("--fallback-model <model>", "Enable automatic fallback to specified model(s) when the default model is overloaded or not available. Accepts a comma-separated list to try each in order. Re-tries the primary at the start of each user turn. (only works with --print)").addOption(new Option("--workload <tag>", "Workload tag for billing-header attribution (cc_workload). Process-scoped; set by SDK daemon callers that spawn subprocesses for cron work. (only works with --print)").hideHelp()).option("--settings <file-or-json>", "Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>", "Additional directories to allow tool access to").option("--ide", "Automatically connect to IDE on startup if exactly one valid IDE is available", () => true).option("--strict-mcp-config", "Only use MCP servers from --mcp-config, ignoring all other MCP configurations", () => true).option("--session-id <uuid>", "Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>", "Set a display name for this session (shown in /resume and terminal title)").option("--agents <json>", `JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>", "Comma-separated list of setting sources to load (user, project, local).").addOption(new Option("--prompt-suggestions [value]", "Enable prompt suggestions. In print/SDK mode, emits a prompt_suggestion message after each turn with a predicted next user prompt").choices(["true", "false", "1", "0", "yes", "no", "on", "off"]).preset("true").argParser((raw) => {
|
|
823201
823251
|
const allowed = ["true", "false", "1", "0", "yes", "no", "on", "off"];
|
|
823202
823252
|
if (!allowed.includes(raw)) {
|
|
823203
823253
|
throw new InvalidArgumentError("Allowed choices are true, false, 1, 0, yes, no, on, off.");
|