@cnwenf/occ 2.1.285 → 2.1.287
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 +81 -12
- 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.287","BINARY_NAME":"occ","BUILD_TIME":"2026-07-26T17:34:43.289Z","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;
|
|
@@ -58134,7 +58134,8 @@ var init_agentSdkTypes = __esm(() => {
|
|
|
58134
58134
|
"InstructionsLoaded",
|
|
58135
58135
|
"CwdChanged",
|
|
58136
58136
|
"FileChanged",
|
|
58137
|
-
"MessageDisplay"
|
|
58137
|
+
"MessageDisplay",
|
|
58138
|
+
"DirectoryAdded"
|
|
58138
58139
|
];
|
|
58139
58140
|
});
|
|
58140
58141
|
|
|
@@ -96172,7 +96173,7 @@ var init_bedrock = __esm(() => {
|
|
|
96172
96173
|
});
|
|
96173
96174
|
|
|
96174
96175
|
// src/utils/model/configs.ts
|
|
96175
|
-
var CLAUDE_3_7_SONNET_CONFIG, CLAUDE_3_5_V2_SONNET_CONFIG, CLAUDE_3_5_HAIKU_CONFIG, CLAUDE_HAIKU_4_5_CONFIG, CLAUDE_SONNET_4_CONFIG, CLAUDE_SONNET_4_5_CONFIG, CLAUDE_OPUS_4_CONFIG, CLAUDE_OPUS_4_1_CONFIG, CLAUDE_OPUS_4_5_CONFIG, CLAUDE_OPUS_4_6_CONFIG, CLAUDE_SONNET_4_6_CONFIG, CLAUDE_OPUS_4_7_CONFIG, CLAUDE_OPUS_4_8_CONFIG, CLAUDE_SONNET_5_CONFIG, CLAUDE_FABLE_5_CONFIG, ALL_MODEL_CONFIGS, CANONICAL_MODEL_IDS, CANONICAL_ID_TO_KEY;
|
|
96176
|
+
var CLAUDE_3_7_SONNET_CONFIG, CLAUDE_3_5_V2_SONNET_CONFIG, CLAUDE_3_5_HAIKU_CONFIG, CLAUDE_HAIKU_4_5_CONFIG, CLAUDE_SONNET_4_CONFIG, CLAUDE_SONNET_4_5_CONFIG, CLAUDE_OPUS_4_CONFIG, CLAUDE_OPUS_4_1_CONFIG, CLAUDE_OPUS_4_5_CONFIG, CLAUDE_OPUS_4_6_CONFIG, CLAUDE_SONNET_4_6_CONFIG, CLAUDE_OPUS_4_7_CONFIG, CLAUDE_OPUS_4_8_CONFIG, CLAUDE_OPUS_5_CONFIG, CLAUDE_SONNET_5_CONFIG, CLAUDE_FABLE_5_CONFIG, ALL_MODEL_CONFIGS, CANONICAL_MODEL_IDS, CANONICAL_ID_TO_KEY;
|
|
96176
96177
|
var init_configs = __esm(() => {
|
|
96177
96178
|
CLAUDE_3_7_SONNET_CONFIG = {
|
|
96178
96179
|
firstParty: "claude-3-7-sonnet-20250219",
|
|
@@ -96291,6 +96292,15 @@ var init_configs = __esm(() => {
|
|
|
96291
96292
|
mantle: "anthropic.claude-opus-4-8",
|
|
96292
96293
|
gateway: "claude-opus-4-8"
|
|
96293
96294
|
};
|
|
96295
|
+
CLAUDE_OPUS_5_CONFIG = {
|
|
96296
|
+
firstParty: "claude-opus-5",
|
|
96297
|
+
bedrock: "us.anthropic.claude-opus-5",
|
|
96298
|
+
vertex: "claude-opus-5",
|
|
96299
|
+
foundry: "claude-opus-5",
|
|
96300
|
+
anthropic_aws: "claude-opus-5",
|
|
96301
|
+
mantle: "anthropic.claude-opus-5",
|
|
96302
|
+
gateway: "claude-opus-5"
|
|
96303
|
+
};
|
|
96294
96304
|
CLAUDE_SONNET_5_CONFIG = {
|
|
96295
96305
|
firstParty: "claude-sonnet-5",
|
|
96296
96306
|
bedrock: "us.anthropic.claude-sonnet-5",
|
|
@@ -96324,6 +96334,7 @@ var init_configs = __esm(() => {
|
|
|
96324
96334
|
opus46: CLAUDE_OPUS_4_6_CONFIG,
|
|
96325
96335
|
opus47: CLAUDE_OPUS_4_7_CONFIG,
|
|
96326
96336
|
opus48: CLAUDE_OPUS_4_8_CONFIG,
|
|
96337
|
+
opus5: CLAUDE_OPUS_5_CONFIG,
|
|
96327
96338
|
fable5: CLAUDE_FABLE_5_CONFIG
|
|
96328
96339
|
};
|
|
96329
96340
|
CANONICAL_MODEL_IDS = Object.values(ALL_MODEL_CONFIGS).map((c7) => c7.firstParty);
|
|
@@ -101006,6 +101017,9 @@ function getDefaultMainLoopModel() {
|
|
|
101006
101017
|
}
|
|
101007
101018
|
function firstPartyNameToCanonical(name) {
|
|
101008
101019
|
name = name.toLowerCase();
|
|
101020
|
+
if (name.includes("claude-opus-5")) {
|
|
101021
|
+
return "claude-opus-5";
|
|
101022
|
+
}
|
|
101009
101023
|
if (name.includes("claude-opus-4-8")) {
|
|
101010
101024
|
return "claude-opus-4-8";
|
|
101011
101025
|
}
|
|
@@ -101114,6 +101128,10 @@ function renderModelSetting(setting) {
|
|
|
101114
101128
|
}
|
|
101115
101129
|
function getPublicModelDisplayName(model) {
|
|
101116
101130
|
switch (model) {
|
|
101131
|
+
case getModelStrings2().opus5:
|
|
101132
|
+
return "Opus 5";
|
|
101133
|
+
case getModelStrings2().opus5 + "[1m]":
|
|
101134
|
+
return "Opus 5 (1M context)";
|
|
101117
101135
|
case getModelStrings2().opus48:
|
|
101118
101136
|
return "Opus 4.8";
|
|
101119
101137
|
case getModelStrings2().opus48 + "[1m]":
|
|
@@ -101270,6 +101288,9 @@ function getMarketingNameForModel(modelId) {
|
|
|
101270
101288
|
}
|
|
101271
101289
|
const has1m = modelId.toLowerCase().includes("[1m]");
|
|
101272
101290
|
const canonical = getCanonicalName(modelId);
|
|
101291
|
+
if (canonical.includes("claude-opus-5")) {
|
|
101292
|
+
return has1m ? "Opus 5 (with 1M context)" : "Opus 5";
|
|
101293
|
+
}
|
|
101273
101294
|
if (canonical.includes("claude-opus-4-8")) {
|
|
101274
101295
|
return has1m ? "Opus 4.8 (with 1M context)" : "Opus 4.8";
|
|
101275
101296
|
}
|
|
@@ -361610,7 +361631,7 @@ function claimConcurrentSubagentSlot(context4) {
|
|
|
361610
361631
|
}
|
|
361611
361632
|
return context4.taskRegistry?.takeConcurrencySlot() ?? (() => {});
|
|
361612
361633
|
}
|
|
361613
|
-
var DEFAULT_MAX_WEB_SEARCHES_PER_SESSION = 200, DEFAULT_MAX_SUBAGENTS_PER_SESSION = 200, DEFAULT_MAX_CONCURRENT_SUBAGENTS = 20, DEFAULT_MAX_SUBAGENT_SPAWN_DEPTH =
|
|
361634
|
+
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;
|
|
361614
361635
|
|
|
361615
361636
|
// src/utils/sdkEventQueue.ts
|
|
361616
361637
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
@@ -366453,6 +366474,8 @@ function sanitizeSurfaceKey(surfaceKey) {
|
|
|
366453
366474
|
return `${surface}/${sanitizedModel}`;
|
|
366454
366475
|
}
|
|
366455
366476
|
function sanitizeModelName(shortName) {
|
|
366477
|
+
if (shortName.includes("opus-5"))
|
|
366478
|
+
return "claude-opus-5";
|
|
366456
366479
|
if (shortName.includes("opus-4-6"))
|
|
366457
366480
|
return "claude-opus-4-6";
|
|
366458
366481
|
if (shortName.includes("opus-4-5"))
|
|
@@ -451784,7 +451807,7 @@ var init_detection = __esm(() => {
|
|
|
451784
451807
|
});
|
|
451785
451808
|
|
|
451786
451809
|
// src/entrypoints/sdk/coreSchemas.ts
|
|
451787
|
-
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;
|
|
451810
|
+
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;
|
|
451788
451811
|
var init_coreSchemas = __esm(() => {
|
|
451789
451812
|
init_v4();
|
|
451790
451813
|
ModelUsageSchema = lazySchema(() => exports_external.object({
|
|
@@ -451982,7 +452005,8 @@ var init_coreSchemas = __esm(() => {
|
|
|
451982
452005
|
"InstructionsLoaded",
|
|
451983
452006
|
"CwdChanged",
|
|
451984
452007
|
"FileChanged",
|
|
451985
|
-
"MessageDisplay"
|
|
452008
|
+
"MessageDisplay",
|
|
452009
|
+
"DirectoryAdded"
|
|
451986
452010
|
];
|
|
451987
452011
|
HookEventSchema = lazySchema(() => exports_external.enum(HOOK_EVENTS2));
|
|
451988
452012
|
BaseHookInputSchema = lazySchema(() => exports_external.object({
|
|
@@ -452172,6 +452196,11 @@ var init_coreSchemas = __esm(() => {
|
|
|
452172
452196
|
file_path: exports_external.string(),
|
|
452173
452197
|
event: exports_external.enum(["change", "add", "unlink"])
|
|
452174
452198
|
})));
|
|
452199
|
+
DirectoryAddedHookInputSchema = lazySchema(() => BaseHookInputSchema().and(exports_external.object({
|
|
452200
|
+
hook_event_name: exports_external.literal("DirectoryAdded"),
|
|
452201
|
+
directory: exports_external.string(),
|
|
452202
|
+
source: exports_external.string()
|
|
452203
|
+
})));
|
|
452175
452204
|
PostToolBatchToolCallSchema = lazySchema(() => exports_external.object({
|
|
452176
452205
|
tool_name: exports_external.string(),
|
|
452177
452206
|
tool_input: exports_external.unknown(),
|
|
@@ -452241,7 +452270,8 @@ var init_coreSchemas = __esm(() => {
|
|
|
452241
452270
|
FileChangedHookInputSchema(),
|
|
452242
452271
|
PostToolBatchHookInputSchema(),
|
|
452243
452272
|
UserPromptExpansionHookInputSchema(),
|
|
452244
|
-
MessageDisplayHookInputSchema()
|
|
452273
|
+
MessageDisplayHookInputSchema(),
|
|
452274
|
+
DirectoryAddedHookInputSchema()
|
|
452245
452275
|
]));
|
|
452246
452276
|
AsyncHookJSONOutputSchema = lazySchema(() => exports_external.object({
|
|
452247
452277
|
async: exports_external.literal(true),
|
|
@@ -473014,7 +473044,8 @@ function convertPluginHooksToMatchers(plugin) {
|
|
|
473014
473044
|
FileChanged: [],
|
|
473015
473045
|
PostToolBatch: [],
|
|
473016
473046
|
UserPromptExpansion: [],
|
|
473017
|
-
MessageDisplay: []
|
|
473047
|
+
MessageDisplay: [],
|
|
473048
|
+
DirectoryAdded: []
|
|
473018
473049
|
};
|
|
473019
473050
|
if (!plugin.hooksConfig) {
|
|
473020
473051
|
return pluginMatchers;
|
|
@@ -473135,7 +473166,8 @@ var init_loadPluginHooks = __esm(() => {
|
|
|
473135
473166
|
FileChanged: [],
|
|
473136
473167
|
PostToolBatch: [],
|
|
473137
473168
|
UserPromptExpansion: [],
|
|
473138
|
-
MessageDisplay: []
|
|
473169
|
+
MessageDisplay: [],
|
|
473170
|
+
DirectoryAdded: []
|
|
473139
473171
|
};
|
|
473140
473172
|
for (const plugin of enabled2) {
|
|
473141
473173
|
if (!plugin.hooksConfig) {
|
|
@@ -599734,7 +599766,8 @@ var init_coreTypes = __esm(() => {
|
|
|
599734
599766
|
"InstructionsLoaded",
|
|
599735
599767
|
"CwdChanged",
|
|
599736
599768
|
"FileChanged",
|
|
599737
|
-
"MessageDisplay"
|
|
599769
|
+
"MessageDisplay",
|
|
599770
|
+
"DirectoryAdded"
|
|
599738
599771
|
];
|
|
599739
599772
|
});
|
|
599740
599773
|
|
|
@@ -638762,10 +638795,14 @@ async function call8(onDone, context7, args) {
|
|
|
638762
638795
|
toolPermissionContext: updatedContext
|
|
638763
638796
|
}));
|
|
638764
638797
|
const currentDirs = getAdditionalDirectoriesForClaudeMd();
|
|
638765
|
-
|
|
638798
|
+
const wasNewlyRegistered = !currentDirs.includes(path35);
|
|
638799
|
+
if (wasNewlyRegistered) {
|
|
638766
638800
|
setAdditionalDirectoriesForClaudeMd([...currentDirs, path35]);
|
|
638767
638801
|
}
|
|
638768
638802
|
SandboxManager2.refreshConfig();
|
|
638803
|
+
if (wasNewlyRegistered) {
|
|
638804
|
+
executeDirectoryAddedHooks(path35, "add-dir").catch(() => {});
|
|
638805
|
+
}
|
|
638769
638806
|
let message;
|
|
638770
638807
|
if (remember) {
|
|
638771
638808
|
try {
|
|
@@ -638817,6 +638854,7 @@ var init_add_dir = __esm(() => {
|
|
|
638817
638854
|
init_ink2();
|
|
638818
638855
|
init_PermissionUpdate();
|
|
638819
638856
|
init_sandbox_adapter();
|
|
638857
|
+
init_hooks5();
|
|
638820
638858
|
init_validation3();
|
|
638821
638859
|
import_compiler_runtime127 = __toESM(require_compiler_runtime(), 1);
|
|
638822
638860
|
import_react96 = __toESM(require_react(), 1);
|
|
@@ -705563,7 +705601,8 @@ function groupHooksByEventAndMatcher(appState, toolNames) {
|
|
|
705563
705601
|
FileChanged: {},
|
|
705564
705602
|
PostToolBatch: {},
|
|
705565
705603
|
UserPromptExpansion: {},
|
|
705566
|
-
MessageDisplay: {}
|
|
705604
|
+
MessageDisplay: {},
|
|
705605
|
+
DirectoryAdded: {}
|
|
705567
705606
|
};
|
|
705568
705607
|
const metadata = getHookEventMetadata(toolNames);
|
|
705569
705608
|
getAllHooks(appState).forEach((hook) => {
|
|
@@ -705909,6 +705948,14 @@ Other exit codes - show stderr to user only`
|
|
|
705909
705948
|
CLAUDE_ENV_FILE is set \u2014 write bash exports there to apply env to subsequent BashTool commands.
|
|
705910
705949
|
Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to register with the FileChanged watcher.
|
|
705911
705950
|
Exit code 0 - command completes successfully
|
|
705951
|
+
Other exit codes - show stderr to user only`
|
|
705952
|
+
},
|
|
705953
|
+
DirectoryAdded: {
|
|
705954
|
+
summary: "After a working directory is added mid-session",
|
|
705955
|
+
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).
|
|
705956
|
+
Input to command is JSON with directory (the added path) and source (the add origin).
|
|
705957
|
+
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.
|
|
705958
|
+
Exit code 0 - command completes successfully
|
|
705912
705959
|
Other exit codes - show stderr to user only`
|
|
705913
705960
|
},
|
|
705914
705961
|
FileChanged: {
|
|
@@ -725655,6 +725702,7 @@ __export(exports_hooks2, {
|
|
|
725655
725702
|
executeFileChangedHooks: () => executeFileChangedHooks,
|
|
725656
725703
|
executeElicitationResultHooks: () => executeElicitationResultHooks,
|
|
725657
725704
|
executeElicitationHooks: () => executeElicitationHooks,
|
|
725705
|
+
executeDirectoryAddedHooks: () => executeDirectoryAddedHooks,
|
|
725658
725706
|
executeCwdChangedHooks: () => executeCwdChangedHooks,
|
|
725659
725707
|
executeConfigChangeHooks: () => executeConfigChangeHooks,
|
|
725660
725708
|
createBaseHookInput: () => createBaseHookInput,
|
|
@@ -726613,6 +726661,9 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools
|
|
|
726613
726661
|
case "ConfigChange":
|
|
726614
726662
|
matchQuery = hookInput.source;
|
|
726615
726663
|
break;
|
|
726664
|
+
case "DirectoryAdded":
|
|
726665
|
+
matchQuery = hookInput.source;
|
|
726666
|
+
break;
|
|
726616
726667
|
case "InstructionsLoaded":
|
|
726617
726668
|
matchQuery = hookInput.load_reason;
|
|
726618
726669
|
break;
|
|
@@ -728326,6 +728377,24 @@ function executeCwdChangedHooks(oldCwd, newCwd, timeoutMs = TOOL_HOOK_EXECUTION_
|
|
|
728326
728377
|
};
|
|
728327
728378
|
return executeEnvHooks(hookInput, timeoutMs);
|
|
728328
728379
|
}
|
|
728380
|
+
async function executeDirectoryAddedHooks(directory, source2, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) {
|
|
728381
|
+
const hookInput = {
|
|
728382
|
+
...createBaseHookInput(undefined),
|
|
728383
|
+
hook_event_name: "DirectoryAdded",
|
|
728384
|
+
directory,
|
|
728385
|
+
source: source2
|
|
728386
|
+
};
|
|
728387
|
+
const results = await executeHooksOutsideREPL({
|
|
728388
|
+
hookInput,
|
|
728389
|
+
timeoutMs,
|
|
728390
|
+
matchQuery: source2
|
|
728391
|
+
});
|
|
728392
|
+
if (results.length > 0) {
|
|
728393
|
+
invalidateSessionEnvCache();
|
|
728394
|
+
}
|
|
728395
|
+
const systemMessages = results.map((r4) => r4.systemMessage).filter((m5) => !!m5);
|
|
728396
|
+
return { results, systemMessages };
|
|
728397
|
+
}
|
|
728329
728398
|
function executeFileChangedHooks(filePath, event, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) {
|
|
728330
728399
|
const hookInput = {
|
|
728331
728400
|
...createBaseHookInput(undefined),
|