@cnwenf/occ 2.1.285 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +58 -11
  2. 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.285","BINARY_NAME":"occ","BUILD_TIME":"2026-07-24T13:06:07.876Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
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;
@@ -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
 
@@ -361610,7 +361611,7 @@ function claimConcurrentSubagentSlot(context4) {
361610
361611
  }
361611
361612
  return context4.taskRegistry?.takeConcurrencySlot() ?? (() => {});
361612
361613
  }
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 = 1;
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;
361614
361615
 
361615
361616
  // src/utils/sdkEventQueue.ts
361616
361617
  import { randomUUID as randomUUID12 } from "crypto";
@@ -451784,7 +451785,7 @@ var init_detection = __esm(() => {
451784
451785
  });
451785
451786
 
451786
451787
  // 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;
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;
451788
451789
  var init_coreSchemas = __esm(() => {
451789
451790
  init_v4();
451790
451791
  ModelUsageSchema = lazySchema(() => exports_external.object({
@@ -451982,7 +451983,8 @@ var init_coreSchemas = __esm(() => {
451982
451983
  "InstructionsLoaded",
451983
451984
  "CwdChanged",
451984
451985
  "FileChanged",
451985
- "MessageDisplay"
451986
+ "MessageDisplay",
451987
+ "DirectoryAdded"
451986
451988
  ];
451987
451989
  HookEventSchema = lazySchema(() => exports_external.enum(HOOK_EVENTS2));
451988
451990
  BaseHookInputSchema = lazySchema(() => exports_external.object({
@@ -452172,6 +452174,11 @@ var init_coreSchemas = __esm(() => {
452172
452174
  file_path: exports_external.string(),
452173
452175
  event: exports_external.enum(["change", "add", "unlink"])
452174
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
+ })));
452175
452182
  PostToolBatchToolCallSchema = lazySchema(() => exports_external.object({
452176
452183
  tool_name: exports_external.string(),
452177
452184
  tool_input: exports_external.unknown(),
@@ -452241,7 +452248,8 @@ var init_coreSchemas = __esm(() => {
452241
452248
  FileChangedHookInputSchema(),
452242
452249
  PostToolBatchHookInputSchema(),
452243
452250
  UserPromptExpansionHookInputSchema(),
452244
- MessageDisplayHookInputSchema()
452251
+ MessageDisplayHookInputSchema(),
452252
+ DirectoryAddedHookInputSchema()
452245
452253
  ]));
452246
452254
  AsyncHookJSONOutputSchema = lazySchema(() => exports_external.object({
452247
452255
  async: exports_external.literal(true),
@@ -473014,7 +473022,8 @@ function convertPluginHooksToMatchers(plugin) {
473014
473022
  FileChanged: [],
473015
473023
  PostToolBatch: [],
473016
473024
  UserPromptExpansion: [],
473017
- MessageDisplay: []
473025
+ MessageDisplay: [],
473026
+ DirectoryAdded: []
473018
473027
  };
473019
473028
  if (!plugin.hooksConfig) {
473020
473029
  return pluginMatchers;
@@ -473135,7 +473144,8 @@ var init_loadPluginHooks = __esm(() => {
473135
473144
  FileChanged: [],
473136
473145
  PostToolBatch: [],
473137
473146
  UserPromptExpansion: [],
473138
- MessageDisplay: []
473147
+ MessageDisplay: [],
473148
+ DirectoryAdded: []
473139
473149
  };
473140
473150
  for (const plugin of enabled2) {
473141
473151
  if (!plugin.hooksConfig) {
@@ -599734,7 +599744,8 @@ var init_coreTypes = __esm(() => {
599734
599744
  "InstructionsLoaded",
599735
599745
  "CwdChanged",
599736
599746
  "FileChanged",
599737
- "MessageDisplay"
599747
+ "MessageDisplay",
599748
+ "DirectoryAdded"
599738
599749
  ];
599739
599750
  });
599740
599751
 
@@ -638762,10 +638773,14 @@ async function call8(onDone, context7, args) {
638762
638773
  toolPermissionContext: updatedContext
638763
638774
  }));
638764
638775
  const currentDirs = getAdditionalDirectoriesForClaudeMd();
638765
- if (!currentDirs.includes(path35)) {
638776
+ const wasNewlyRegistered = !currentDirs.includes(path35);
638777
+ if (wasNewlyRegistered) {
638766
638778
  setAdditionalDirectoriesForClaudeMd([...currentDirs, path35]);
638767
638779
  }
638768
638780
  SandboxManager2.refreshConfig();
638781
+ if (wasNewlyRegistered) {
638782
+ executeDirectoryAddedHooks(path35, "add-dir").catch(() => {});
638783
+ }
638769
638784
  let message;
638770
638785
  if (remember) {
638771
638786
  try {
@@ -638817,6 +638832,7 @@ var init_add_dir = __esm(() => {
638817
638832
  init_ink2();
638818
638833
  init_PermissionUpdate();
638819
638834
  init_sandbox_adapter();
638835
+ init_hooks5();
638820
638836
  init_validation3();
638821
638837
  import_compiler_runtime127 = __toESM(require_compiler_runtime(), 1);
638822
638838
  import_react96 = __toESM(require_react(), 1);
@@ -705563,7 +705579,8 @@ function groupHooksByEventAndMatcher(appState, toolNames) {
705563
705579
  FileChanged: {},
705564
705580
  PostToolBatch: {},
705565
705581
  UserPromptExpansion: {},
705566
- MessageDisplay: {}
705582
+ MessageDisplay: {},
705583
+ DirectoryAdded: {}
705567
705584
  };
705568
705585
  const metadata = getHookEventMetadata(toolNames);
705569
705586
  getAllHooks(appState).forEach((hook) => {
@@ -705909,6 +705926,14 @@ Other exit codes - show stderr to user only`
705909
705926
  CLAUDE_ENV_FILE is set \u2014 write bash exports there to apply env to subsequent BashTool commands.
705910
705927
  Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to register with the FileChanged watcher.
705911
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
705912
705937
  Other exit codes - show stderr to user only`
705913
705938
  },
705914
705939
  FileChanged: {
@@ -725655,6 +725680,7 @@ __export(exports_hooks2, {
725655
725680
  executeFileChangedHooks: () => executeFileChangedHooks,
725656
725681
  executeElicitationResultHooks: () => executeElicitationResultHooks,
725657
725682
  executeElicitationHooks: () => executeElicitationHooks,
725683
+ executeDirectoryAddedHooks: () => executeDirectoryAddedHooks,
725658
725684
  executeCwdChangedHooks: () => executeCwdChangedHooks,
725659
725685
  executeConfigChangeHooks: () => executeConfigChangeHooks,
725660
725686
  createBaseHookInput: () => createBaseHookInput,
@@ -726613,6 +726639,9 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools
726613
726639
  case "ConfigChange":
726614
726640
  matchQuery = hookInput.source;
726615
726641
  break;
726642
+ case "DirectoryAdded":
726643
+ matchQuery = hookInput.source;
726644
+ break;
726616
726645
  case "InstructionsLoaded":
726617
726646
  matchQuery = hookInput.load_reason;
726618
726647
  break;
@@ -728326,6 +728355,24 @@ function executeCwdChangedHooks(oldCwd, newCwd, timeoutMs = TOOL_HOOK_EXECUTION_
728326
728355
  };
728327
728356
  return executeEnvHooks(hookInput, timeoutMs);
728328
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
+ }
728329
728376
  function executeFileChangedHooks(filePath, event, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) {
728330
728377
  const hookInput = {
728331
728378
  ...createBaseHookInput(undefined),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.285",
3
+ "version": "2.1.286",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {