@margay/ccl-core 1.3.5-rc.6 → 1.3.5-rc.8

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 (3) hide show
  1. package/README.md +14 -0
  2. package/dist/cli.js +1654 -583
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -116,7 +116,7 @@ var __callDispose = (stack, error, hasError) => {
116
116
  var require_package = __commonJS((exports, module) => {
117
117
  module.exports = {
118
118
  name: "@margay/ccl-core",
119
- version: "1.3.5-rc.6",
119
+ version: "1.3.5-rc.8",
120
120
  description: "Core runtime extracted from Claude Code (ccl) for Margay integration",
121
121
  license: "SEE LICENSE IN README.md",
122
122
  type: "module",
@@ -35814,7 +35814,8 @@ var init_constants2 = __esm(() => {
35814
35814
  "code-reviewer",
35815
35815
  "test-runner",
35816
35816
  "Advisor",
35817
- "Critic"
35817
+ "Critic",
35818
+ "visual-ui-analysis"
35818
35819
  ]);
35819
35820
  });
35820
35821
 
@@ -162288,7 +162289,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
162288
162289
  if (isApiKeyHelperFromProjectOrLocalSettings()) {
162289
162290
  const hasTrust = checkHasTrustDialogAccepted();
162290
162291
  if (!hasTrust && !isNonInteractiveSession) {
162291
- const error5 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL}.`);
162292
+ const error5 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL}.`);
162292
162293
  logAntError("apiKeyHelper invoked before trust check", error5);
162293
162294
  logEvent("tengu_apiKeyHelper_missing_trust11", {});
162294
162295
  return null;
@@ -162332,7 +162333,7 @@ async function runAwsAuthRefresh() {
162332
162333
  if (isAwsAuthRefreshFromProjectSettings()) {
162333
162334
  const hasTrust = checkHasTrustDialogAccepted();
162334
162335
  if (!hasTrust && !getIsNonInteractiveSession()) {
162335
- const error5 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL}.`);
162336
+ const error5 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL}.`);
162336
162337
  logAntError("awsAuthRefresh invoked before trust check", error5);
162337
162338
  logEvent("tengu_awsAuthRefresh_missing_trust", {});
162338
162339
  return false;
@@ -162392,7 +162393,7 @@ async function getAwsCredsFromCredentialExport() {
162392
162393
  if (isAwsCredentialExportFromProjectSettings()) {
162393
162394
  const hasTrust = checkHasTrustDialogAccepted();
162394
162395
  if (!hasTrust && !getIsNonInteractiveSession()) {
162395
- const error5 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL}.`);
162396
+ const error5 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL}.`);
162396
162397
  logAntError("awsCredentialExport invoked before trust check", error5);
162397
162398
  logEvent("tengu_awsCredentialExport_missing_trust", {});
162398
162399
  return null;
@@ -162477,7 +162478,7 @@ async function runGcpAuthRefresh() {
162477
162478
  if (isGcpAuthRefreshFromProjectSettings()) {
162478
162479
  const hasTrust = checkHasTrustDialogAccepted();
162479
162480
  if (!hasTrust && !getIsNonInteractiveSession()) {
162480
- const error5 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL}.`);
162481
+ const error5 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL}.`);
162481
162482
  logAntError("gcpAuthRefresh invoked before trust check", error5);
162482
162483
  logEvent("tengu_gcpAuthRefresh_missing_trust", {});
162483
162484
  return false;
@@ -163187,7 +163188,7 @@ var init_auth2 = __esm(() => {
163187
163188
 
163188
163189
  // utils/userAgent.ts
163189
163190
  function getClaudeCodeUserAgent() {
163190
- return `claude-code/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}`;
163191
+ return `claude-code/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}`;
163191
163192
  }
163192
163193
 
163193
163194
  // utils/workloadContext.ts
@@ -163209,7 +163210,7 @@ function getUserAgent() {
163209
163210
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
163210
163211
  const workload = getWorkload();
163211
163212
  const workloadSuffix = workload ? `, workload/${workload}` : "";
163212
- return `claude-cli/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
163213
+ return `claude-cli/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
163213
163214
  }
163214
163215
  function getMCPUserAgent() {
163215
163216
  const parts = [];
@@ -163223,7 +163224,7 @@ function getMCPUserAgent() {
163223
163224
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
163224
163225
  }
163225
163226
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
163226
- return `claude-code/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}${suffix}`;
163227
+ return `claude-code/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}${suffix}`;
163227
163228
  }
163228
163229
  function getWebFetchUserAgent() {
163229
163230
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -163361,7 +163362,7 @@ var init_user = __esm(() => {
163361
163362
  deviceId,
163362
163363
  sessionId: getSessionId(),
163363
163364
  email: getEmail(),
163364
- appVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
163365
+ appVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
163365
163366
  platform: getHostPlatformForAnalytics(),
163366
163367
  organizationUuid,
163367
163368
  accountUuid,
@@ -171058,7 +171059,7 @@ var init_metadata = __esm(() => {
171058
171059
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
171059
171060
  WHITESPACE_REGEX = /\s+/;
171060
171061
  getVersionBase = memoize20(() => {
171061
- const match = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
171062
+ const match = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
171062
171063
  return match ? match[0] : undefined;
171063
171064
  });
171064
171065
  buildEnvContext = memoize20(async () => {
@@ -171098,9 +171099,9 @@ var init_metadata = __esm(() => {
171098
171099
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
171099
171100
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
171100
171101
  isClaudeAiAuth: isClaudeAISubscriber(),
171101
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
171102
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
171102
171103
  versionBase: getVersionBase(),
171103
- buildTime: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.BUILD_TIME,
171104
+ buildTime: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.BUILD_TIME,
171104
171105
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
171105
171106
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
171106
171107
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -171767,7 +171768,7 @@ function initialize1PEventLogging() {
171767
171768
  const platform2 = getPlatform();
171768
171769
  const attributes = {
171769
171770
  [import_semantic_conventions.ATTR_SERVICE_NAME]: "claude-code",
171770
- [import_semantic_conventions.ATTR_SERVICE_VERSION]: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
171771
+ [import_semantic_conventions.ATTR_SERVICE_VERSION]: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
171771
171772
  };
171772
171773
  if (platform2 === "wsl") {
171773
171774
  const wslVersion = getWslVersion();
@@ -171794,7 +171795,7 @@ function initialize1PEventLogging() {
171794
171795
  })
171795
171796
  ]
171796
171797
  });
171797
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
171798
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
171798
171799
  }
171799
171800
  async function reinitialize1PEventLoggingIfConfigChanged() {
171800
171801
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -200714,7 +200715,7 @@ function getAttributionHeader(fingerprint) {
200714
200715
  if (!isAttributionHeaderEnabled()) {
200715
200716
  return "";
200716
200717
  }
200717
- const version4 = `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}.${fingerprint}`;
200718
+ const version4 = `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}.${fingerprint}`;
200718
200719
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
200719
200720
  const cch = "";
200720
200721
  const workload = getWorkload();
@@ -232935,7 +232936,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
232935
232936
  }
232936
232937
  function getFeedbackGuideline() {
232937
232938
  if (isUsing3PServices()) {
232938
- return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.ISSUES_EXPLAINER}`;
232939
+ return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.ISSUES_EXPLAINER}`;
232939
232940
  }
232940
232941
  return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
232941
232942
  }
@@ -233728,43 +233729,67 @@ Use the literal string \`VERDICT: \` followed by exactly one of \`PASS\`, \`FAIL
233728
233729
  };
233729
233730
  });
233730
233731
 
233731
- // tools/AgentTool/built-in/visualUiAnalysisAgent.ts
233732
- var VISUAL_UI_ANALYSIS_PROMPT = `You are CCL's read-only visual and UI analysis specialist.
233733
-
233734
- Inspect every supplied image path with Read before drawing a visual conclusion.
233735
- You may use Grep and Glob only to locate source leads explicitly connected to
233736
- the observed UI. You cannot edit files, run shell commands, or spawn agents.
233737
-
233738
- Report:
233739
- 1. grounded observations visible in the image bytes;
233740
- 2. differences relevant to the stated reference or goal;
233741
- 3. inference kept separate from observation;
233742
- 4. uncertainty and any source-file leads worth checking next.
233732
+ // services/visual/visualSpecialist.ts
233733
+ function assertVisualImagePaths(agentType, imagePaths) {
233734
+ if (agentType !== "visual-ui-analysis") {
233735
+ if (imagePaths !== undefined) {
233736
+ throw new Error("image_paths is only supported by visual-ui-analysis");
233737
+ }
233738
+ return [];
233739
+ }
233740
+ if (!Array.isArray(imagePaths) || imagePaths.length === 0) {
233741
+ throw new Error("visual-ui-analysis requires a non-empty image_paths list");
233742
+ }
233743
+ if (imagePaths.length > 20 || imagePaths.some((path11) => typeof path11 !== "string" || !path11.trim())) {
233744
+ throw new Error("visual-ui-analysis image_paths must contain 1-20 non-empty paths");
233745
+ }
233746
+ return imagePaths.map((path11) => path11.trim());
233747
+ }
233748
+ async function runVisualSpecialist(input, deps) {
233749
+ const imagePaths = assertVisualImagePaths("visual-ui-analysis", input.imagePaths);
233750
+ const images = [];
233751
+ for (const path11 of imagePaths)
233752
+ images.push(await deps.loadImage(path11));
233753
+ const selection = await deps.resolve({
233754
+ role: "visual.experimental",
233755
+ mode: input.mode ?? "quality",
233756
+ requirements: { vision: true }
233757
+ });
233758
+ if (!selection) {
233759
+ throw new Error("Specialist capability unavailable: visual.experimental");
233760
+ }
233761
+ return deps.infer({
233762
+ model: selection.resolved_model,
233763
+ ...selection.canonical_model ? { canonicalModel: selection.canonical_model } : {},
233764
+ clientProtocol: selection.client_protocol,
233765
+ systemPrompt: VISUAL_SPECIALIST_SYSTEM_PROMPT,
233766
+ prompt: input.prompt,
233767
+ images,
233768
+ maxOutputTokens: 2048,
233769
+ signal: input.signal ?? new AbortController().signal
233770
+ });
233771
+ }
233772
+ var VISUAL_SPECIALIST_SYSTEM_PROMPT = `You are CCL's bounded visual analysis specialist.
233773
+
233774
+ Analyze only the supplied image bytes and the user's stated visual question.
233775
+ Report grounded observations first, then relevant differences, then clearly
233776
+ separated inferences and uncertainty. Do not claim to inspect source code, call
233777
+ tools, plan edits, or gather additional evidence. Return one concise conclusion.`;
233743
233778
 
233744
- If image bytes are missing, unreadable, or unsupported, state that limitation
233745
- and do not pretend to have seen the image.`, VISUAL_UI_ANALYSIS_AGENT;
233779
+ // tools/AgentTool/built-in/visualUiAnalysisAgent.ts
233780
+ var VISUAL_UI_ANALYSIS_AGENT;
233746
233781
  var init_visualUiAnalysisAgent = __esm(() => {
233747
- init_prompt2();
233748
- init_prompt3();
233749
- init_prompt();
233750
- init_constants2();
233751
233782
  VISUAL_UI_ANALYSIS_AGENT = {
233752
233783
  agentType: "visual-ui-analysis",
233753
233784
  whenToUse: "Use when a conclusion materially depends on pixels, layout, spacing, color, typography, screenshots, or visual comparison that the current main model cannot ground itself. Supply accessible image paths and wait for its grounded observations before claiming a visual result.",
233754
- tools: [FILE_READ_TOOL_NAME, GREP_TOOL_NAME, GLOB_TOOL_NAME],
233755
- disallowedTools: [
233756
- AGENT_TOOL_NAME,
233757
- FILE_EDIT_TOOL_NAME,
233758
- FILE_WRITE_TOOL_NAME,
233759
- NOTEBOOK_EDIT_TOOL_NAME,
233760
- BASH_TOOL_NAME
233761
- ],
233785
+ tools: [],
233786
+ disallowedTools: [],
233762
233787
  source: "built-in",
233763
233788
  baseDir: "built-in",
233764
233789
  model: "pool:visual",
233765
- maxTurns: 8,
233790
+ maxTurns: 1,
233766
233791
  omitClaudeMd: true,
233767
- getSystemPrompt: () => VISUAL_UI_ANALYSIS_PROMPT
233792
+ getSystemPrompt: () => VISUAL_SPECIALIST_SYSTEM_PROMPT
233768
233793
  };
233769
233794
  });
233770
233795
 
@@ -238969,7 +238994,7 @@ function getAssistantMessageFromError(error5, model, options) {
238969
238994
  if (process.env.USER_TYPE === "ant") {
238970
238995
  const baseMessage = `API Error: 400 ${error5.message}
238971
238996
 
238972
- Run /share and post the JSON file to ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL}.`;
238997
+ Run /share and post the JSON file to ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL}.`;
238973
238998
  const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation.";
238974
238999
  return createAssistantAPIErrorMessage({
238975
239000
  content: baseMessage + rewindInstruction,
@@ -239005,7 +239030,7 @@ Run /share and post the JSON file to ${{ USER_TYPE: "external", VERSION: "1.3.5-
239005
239030
  if (process.env.USER_TYPE === "ant" && !process.env.ANTHROPIC_MODEL && error5 instanceof Error && error5.message.toLowerCase().includes("invalid model name")) {
239006
239031
  const orgId = getOauthAccountInfo()?.organizationUuid;
239007
239032
  const baseMsg = `[ANT-ONLY] Your org isn't gated into the \`${model}\` model. Either run \`ccl\` with \`ANTHROPIC_MODEL=${getDefaultMainLoopModelSetting()}\``;
239008
- const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL} for help getting access.`;
239033
+ const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL} for help getting access.`;
239009
239034
  return createAssistantAPIErrorMessage({
239010
239035
  content: msg,
239011
239036
  error: "invalid_request"
@@ -330965,7 +330990,7 @@ function getTelemetryAttributes() {
330965
330990
  attributes["session.id"] = sessionId;
330966
330991
  }
330967
330992
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
330968
- attributes["app.version"] = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
330993
+ attributes["app.version"] = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
330969
330994
  }
330970
330995
  const oauthAccount = getOauthAccountInfo();
330971
330996
  if (oauthAccount) {
@@ -346984,11 +347009,58 @@ __export(exports_capabilityResolver, {
346984
347009
  function resetCapabilityResolverForTests() {
346985
347010
  resolverUnavailable = false;
346986
347011
  }
346987
- function validResolution(value, request) {
347012
+ function normalizeResolution(value, request) {
346988
347013
  if (typeof value !== "object" || value === null)
346989
- return false;
347014
+ return null;
346990
347015
  const v6 = value;
346991
- return v6.requested_role === request.role && v6.mode === request.mode && typeof v6.resolved_model === "string" && Array.isArray(v6.eligible_models) && v6.eligible_models.every((item) => typeof item === "string") && v6.eligible_models[0] === v6.resolved_model && typeof v6.catalog_version === "string" && v6.reason === "first_eligible_in_order";
347016
+ const validLegacy = v6.requested_role === request.role && v6.mode === request.mode && typeof v6.resolved_model === "string" && Array.isArray(v6.eligible_models) && v6.eligible_models.every((item) => typeof item === "string") && v6.eligible_models[0] === v6.resolved_model && typeof v6.catalog_version === "string" && v6.reason === "first_eligible_in_order";
347017
+ if (!validLegacy)
347018
+ return null;
347019
+ const eligibleModels = v6.eligible_models;
347020
+ const rawCandidates = v6.eligible_candidates;
347021
+ const candidates = rawCandidates === undefined ? eligibleModels.map((model) => ({
347022
+ model,
347023
+ client_protocol: "anthropic_messages"
347024
+ })) : normalizeCandidates(rawCandidates, eligibleModels);
347025
+ if (candidates.length !== eligibleModels.length)
347026
+ return null;
347027
+ const selected = candidates[0];
347028
+ if (v6.client_protocol !== undefined && v6.client_protocol !== selected.client_protocol)
347029
+ return null;
347030
+ if (v6.canonical_model !== undefined && (typeof v6.canonical_model !== "string" || v6.canonical_model !== selected.canonical_model))
347031
+ return null;
347032
+ return {
347033
+ requested_role: request.role,
347034
+ mode: request.mode,
347035
+ resolved_model: v6.resolved_model,
347036
+ eligible_models: eligibleModels,
347037
+ eligible_candidates: candidates,
347038
+ ...selected.canonical_model ? { canonical_model: selected.canonical_model } : {},
347039
+ client_protocol: selected.client_protocol,
347040
+ catalog_version: v6.catalog_version,
347041
+ reason: "first_eligible_in_order"
347042
+ };
347043
+ }
347044
+ function normalizeCandidates(raw, eligibleModels) {
347045
+ if (!Array.isArray(raw) || raw.length !== eligibleModels.length)
347046
+ return [];
347047
+ const candidates = [];
347048
+ for (let index = 0;index < raw.length; index++) {
347049
+ const value = raw[index];
347050
+ if (typeof value !== "object" || value === null)
347051
+ return [];
347052
+ const candidate = value;
347053
+ const protocol = candidate.client_protocol;
347054
+ if (candidate.model !== eligibleModels[index] || protocol !== "anthropic_messages" && protocol !== "openai_chat_completions" || candidate.canonical_model !== undefined && typeof candidate.canonical_model !== "string") {
347055
+ return [];
347056
+ }
347057
+ candidates.push({
347058
+ model: candidate.model,
347059
+ ...typeof candidate.canonical_model === "string" ? { canonical_model: candidate.canonical_model } : {},
347060
+ client_protocol: protocol
347061
+ });
347062
+ }
347063
+ return candidates;
346992
347064
  }
346993
347065
  function specialistResolutionRequest(agentType, mode, parentModel, requestedModel) {
346994
347066
  if (agentType === "Advisor" || agentType === "Critic") {
@@ -347043,7 +347115,7 @@ async function resolveCapabilityModel(request, deps = {}) {
347043
347115
  if (!response.ok)
347044
347116
  return null;
347045
347117
  const value = await response.json();
347046
- return validResolution(value, request) ? value : null;
347118
+ return normalizeResolution(value, request);
347047
347119
  } catch {
347048
347120
  return null;
347049
347121
  }
@@ -347764,7 +347836,7 @@ function computeFingerprint(messageText, version4) {
347764
347836
  }
347765
347837
  function computeFingerprintFromMessages(messages) {
347766
347838
  const firstMessageText = extractFirstMessageText(messages);
347767
- return computeFingerprint(firstMessageText, { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
347839
+ return computeFingerprint(firstMessageText, { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
347768
347840
  }
347769
347841
  var FINGERPRINT_SALT = "59cf53e54c78";
347770
347842
  var init_fingerprint = () => {};
@@ -347813,7 +347885,7 @@ async function sideQuery(opts) {
347813
347885
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
347814
347886
  }
347815
347887
  const messageText = extractFirstUserMessageText(messages);
347816
- const fingerprint = computeFingerprint(messageText, { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
347888
+ const fingerprint = computeFingerprint(messageText, { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
347817
347889
  const attributionHeader = getAttributionHeader(fingerprint);
347818
347890
  const systemBlocks = [
347819
347891
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -395959,7 +396031,7 @@ async function initializeBetaTracing(resource) {
395959
396031
  });
395960
396032
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
395961
396033
  setLoggerProvider(loggerProvider);
395962
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
396034
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
395963
396035
  setEventLogger(eventLogger);
395964
396036
  process.on("beforeExit", async () => {
395965
396037
  await loggerProvider?.forceFlush();
@@ -395999,7 +396071,7 @@ async function initializeTelemetry() {
395999
396071
  const platform3 = getPlatform();
396000
396072
  const baseAttributes = {
396001
396073
  [import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
396002
- [import_semantic_conventions2.ATTR_SERVICE_VERSION]: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
396074
+ [import_semantic_conventions2.ATTR_SERVICE_VERSION]: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
396003
396075
  };
396004
396076
  if (platform3 === "wsl") {
396005
396077
  const wslVersion = getWslVersion();
@@ -396044,7 +396116,7 @@ async function initializeTelemetry() {
396044
396116
  } catch {}
396045
396117
  };
396046
396118
  registerCleanup(shutdownTelemetry2);
396047
- return meterProvider2.getMeter("com.anthropic.claude_code", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
396119
+ return meterProvider2.getMeter("com.anthropic.claude_code", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
396048
396120
  }
396049
396121
  const meterProvider = new import_sdk_metrics2.MeterProvider({
396050
396122
  resource,
@@ -396064,7 +396136,7 @@ async function initializeTelemetry() {
396064
396136
  });
396065
396137
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
396066
396138
  setLoggerProvider(loggerProvider);
396067
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
396139
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
396068
396140
  setEventLogger(eventLogger);
396069
396141
  logForDebugging("[3P telemetry] Event logger set successfully");
396070
396142
  process.on("beforeExit", async () => {
@@ -396126,7 +396198,7 @@ Current timeout: ${timeoutMs}ms
396126
396198
  }
396127
396199
  };
396128
396200
  registerCleanup(shutdownTelemetry);
396129
- return meterProvider.getMeter("com.anthropic.claude_code", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION);
396201
+ return meterProvider.getMeter("com.anthropic.claude_code", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION);
396130
396202
  }
396131
396203
  async function flushTelemetry() {
396132
396204
  const meterProvider = getMeterProvider();
@@ -396717,7 +396789,7 @@ async function installOrUpdateClaudePackage(channel2, specificVersion) {
396717
396789
  return "install_failed";
396718
396790
  }
396719
396791
  const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
396720
- const result = await execFileNoThrowWithCwd("npm", ["install", `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
396792
+ const result = await execFileNoThrowWithCwd("npm", ["install", `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
396721
396793
  if (result.code !== 0) {
396722
396794
  const error5 = new Error(`Failed to install Claude CLI package: ${result.stderr}`);
396723
396795
  logError(error5);
@@ -396860,14 +396932,14 @@ import { access as access2, writeFile as writeFile12 } from "fs/promises";
396860
396932
  import { homedir as homedir18 } from "os";
396861
396933
  import { join as join61 } from "path";
396862
396934
  async function assertMinVersion() {
396863
- if (process.env.SKIP_VERSION_CHECK === "1" || { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION.startsWith("0.0.0-dev") || !process.env.ANTHROPIC_VERSION_CHECK) {
396935
+ if (process.env.SKIP_VERSION_CHECK === "1" || { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION.startsWith("0.0.0-dev") || !process.env.ANTHROPIC_VERSION_CHECK) {
396864
396936
  return;
396865
396937
  }
396866
396938
  try {
396867
396939
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
396868
- if (versionConfig.minVersion && lt2({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, versionConfig.minVersion)) {
396940
+ if (versionConfig.minVersion && lt2({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, versionConfig.minVersion)) {
396869
396941
  console.error(`
396870
- It looks like your version of CCL (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}) needs an update.
396942
+ It looks like your version of CCL (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}) needs an update.
396871
396943
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
396872
396944
 
396873
396945
  To update, please run:
@@ -397027,7 +397099,7 @@ async function checkGlobalInstallPermissions() {
397027
397099
  }
397028
397100
  async function getLatestVersion(channel2) {
397029
397101
  const npmTag = channel2 === "stable" ? "stable" : "latest";
397030
- const result = await execFileNoThrowWithCwd("npm", ["view", `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
397102
+ const result = await execFileNoThrowWithCwd("npm", ["view", `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
397031
397103
  if (result.code !== 0) {
397032
397104
  logForDebugging(`npm view failed with code ${result.code}`);
397033
397105
  if (result.stderr) {
@@ -397043,7 +397115,7 @@ async function getLatestVersion(channel2) {
397043
397115
  return result.stdout.trim();
397044
397116
  }
397045
397117
  async function getNpmDistTags() {
397046
- const result = await execFileNoThrowWithCwd("npm", ["view", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
397118
+ const result = await execFileNoThrowWithCwd("npm", ["view", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
397047
397119
  if (result.code !== 0) {
397048
397120
  logForDebugging(`npm view dist-tags failed with code ${result.code}`);
397049
397121
  return { latest: null, stable: null };
@@ -397083,7 +397155,7 @@ async function installGlobalPackage(specificVersion) {
397083
397155
  logError(new AutoUpdaterError("Another process is currently installing an update"));
397084
397156
  logEvent("tengu_auto_updater_lock_contention", {
397085
397157
  pid: process.pid,
397086
- currentVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
397158
+ currentVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
397087
397159
  });
397088
397160
  return "in_progress";
397089
397161
  }
@@ -397092,7 +397164,7 @@ async function installGlobalPackage(specificVersion) {
397092
397164
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
397093
397165
  logError(new Error("Windows NPM detected in WSL environment"));
397094
397166
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
397095
- currentVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
397167
+ currentVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
397096
397168
  });
397097
397169
  console.error(`
397098
397170
  Error: Windows NPM detected in WSL
@@ -397111,7 +397183,7 @@ To fix this issue:
397111
397183
  if (!hasPermissions) {
397112
397184
  return "no_permissions";
397113
397185
  }
397114
- const packageSpec = specificVersion ? `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}@${specificVersion}` : { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL;
397186
+ const packageSpec = specificVersion ? `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}@${specificVersion}` : { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL;
397115
397187
  const packageManager = env4.isRunningWithBun() ? "bun" : "npm";
397116
397188
  const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() });
397117
397189
  if (installResult.code !== 0) {
@@ -397440,8 +397512,8 @@ async function detectMultipleInstallations() {
397440
397512
  installations.push({ type: "npm-local", path: localPath });
397441
397513
  }
397442
397514
  const packagesToCheck = ["@anthropic-ai/claude-code"];
397443
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL !== "@anthropic-ai/claude-code") {
397444
- packagesToCheck.push({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL);
397515
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL !== "@anthropic-ai/claude-code") {
397516
+ packagesToCheck.push({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL);
397445
397517
  }
397446
397518
  const npmResult = await execFileNoThrow("npm", [
397447
397519
  "-g",
@@ -397624,7 +397696,7 @@ function detectLinuxGlobPatternWarnings() {
397624
397696
  }
397625
397697
  async function getDoctorDiagnostic() {
397626
397698
  const installationType = await getCurrentInstallationType();
397627
- const version4 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION ? { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION : "unknown";
397699
+ const version4 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION ? { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION : "unknown";
397628
397700
  const installationPath = await getInstallationPath();
397629
397701
  const invokedBinary = getInvokedBinary();
397630
397702
  const multipleInstallations = await detectMultipleInstallations();
@@ -397636,8 +397708,8 @@ async function getDoctorDiagnostic() {
397636
397708
  for (const install of npmInstalls) {
397637
397709
  if (install.type === "npm-global") {
397638
397710
  let uninstallCmd = "npm -g uninstall @anthropic-ai/claude-code";
397639
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL !== "@anthropic-ai/claude-code") {
397640
- uninstallCmd += ` && npm -g uninstall ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}`;
397711
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL !== "@anthropic-ai/claude-code") {
397712
+ uninstallCmd += ` && npm -g uninstall ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}`;
397641
397713
  }
397642
397714
  warnings.push({
397643
397715
  issue: `Leftover npm global installation at ${install.path}`,
@@ -398963,7 +399035,7 @@ function getInstallationEnv() {
398963
399035
  return;
398964
399036
  }
398965
399037
  function getClaudeCodeVersion() {
398966
- return { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
399038
+ return { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
398967
399039
  }
398968
399040
  async function getInstalledVSCodeExtensionVersion(command) {
398969
399041
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -399520,7 +399592,7 @@ async function getLatestVersionFromArtifactory(tag = "latest") {
399520
399592
  const startTime2 = Date.now();
399521
399593
  const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
399522
399594
  "view",
399523
- `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL}@${tag}`,
399595
+ `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL}@${tag}`,
399524
399596
  "version",
399525
399597
  "--prefer-online",
399526
399598
  "--registry",
@@ -399544,7 +399616,7 @@ async function getLatestVersionFromArtifactory(tag = "latest") {
399544
399616
  latency_ms: latencyMs,
399545
399617
  source_npm: true
399546
399618
  });
399547
- logForDebugging(`npm view ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL}@${tag} version: ${stdout}`);
399619
+ logForDebugging(`npm view ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL}@${tag} version: ${stdout}`);
399548
399620
  const latestVersion = stdout.trim();
399549
399621
  return latestVersion;
399550
399622
  }
@@ -399600,7 +399672,7 @@ async function downloadVersionFromArtifactory(version4, stagingPath) {
399600
399672
  const fs11 = getFsImplementation();
399601
399673
  await fs11.rm(stagingPath, { recursive: true, force: true });
399602
399674
  const platform4 = getPlatform2();
399603
- const platformPackageName = `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL}-${platform4}`;
399675
+ const platformPackageName = `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL}-${platform4}`;
399604
399676
  logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version4}`);
399605
399677
  const {
399606
399678
  stdout: integrityOutput,
@@ -399629,7 +399701,7 @@ async function downloadVersionFromArtifactory(version4, stagingPath) {
399629
399701
  name: "claude-native-installer",
399630
399702
  version: "0.0.1",
399631
399703
  dependencies: {
399632
- [{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL]: version4
399704
+ [{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL]: version4
399633
399705
  }
399634
399706
  };
399635
399707
  const packageLock = {
@@ -399642,10 +399714,10 @@ async function downloadVersionFromArtifactory(version4, stagingPath) {
399642
399714
  name: "claude-native-installer",
399643
399715
  version: "0.0.1",
399644
399716
  dependencies: {
399645
- [{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL]: version4
399717
+ [{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL]: version4
399646
399718
  }
399647
399719
  },
399648
- [`node_modules/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL}`]: {
399720
+ [`node_modules/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL}`]: {
399649
399721
  version: version4,
399650
399722
  optionalDependencies: {
399651
399723
  [platformPackageName]: version4
@@ -399667,7 +399739,7 @@ async function downloadVersionFromArtifactory(version4, stagingPath) {
399667
399739
  if (result.code !== 0) {
399668
399740
  throw new Error(`npm ci failed with code ${result.code}: ${result.stderr}`);
399669
399741
  }
399670
- logForDebugging(`Successfully downloaded and verified ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.NATIVE_PACKAGE_URL}@${version4}`);
399742
+ logForDebugging(`Successfully downloaded and verified ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.NATIVE_PACKAGE_URL}@${version4}`);
399671
399743
  }
399672
399744
  function getStallTimeoutMs() {
399673
399745
  return Number(process.env.CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING) || DEFAULT_STALL_TIMEOUT_MS;
@@ -400330,8 +400402,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
400330
400402
  const maxVersion = await getMaxVersion();
400331
400403
  if (maxVersion && gt2(version4, maxVersion)) {
400332
400404
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version4} to ${maxVersion}`);
400333
- if (gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, maxVersion)) {
400334
- logForDebugging(`Native installer: current version ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
400405
+ if (gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, maxVersion)) {
400406
+ logForDebugging(`Native installer: current version ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
400335
400407
  logEvent("tengu_native_update_skipped_max_version", {
400336
400408
  latency_ms: Date.now() - startTime2,
400337
400409
  max_version: maxVersion,
@@ -400342,7 +400414,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
400342
400414
  version4 = maxVersion;
400343
400415
  }
400344
400416
  }
400345
- if (!forceReinstall && version4 === { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION && await versionIsAvailable(version4) && await isPossibleClaudeBinary(executablePath)) {
400417
+ if (!forceReinstall && version4 === { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION && await versionIsAvailable(version4) && await isPossibleClaudeBinary(executablePath)) {
400346
400418
  logForDebugging(`Found ${version4} at ${executablePath}, skipping install`);
400347
400419
  logEvent("tengu_native_update_complete", {
400348
400420
  latency_ms: Date.now() - startTime2,
@@ -401084,8 +401156,8 @@ async function cleanupNpmInstallations() {
401084
401156
  } else if (codePackageResult.error) {
401085
401157
  errors.push(codePackageResult.error);
401086
401158
  }
401087
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL !== "@anthropic-ai/claude-code") {
401088
- const macroPackageResult = await attemptNpmUninstall({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL);
401159
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL !== "@anthropic-ai/claude-code") {
401160
+ const macroPackageResult = await attemptNpmUninstall({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL);
401089
401161
  if (macroPackageResult.success) {
401090
401162
  removed++;
401091
401163
  if (macroPackageResult.warning) {
@@ -401154,7 +401226,7 @@ var init_allErrors = __esm(() => {
401154
401226
 
401155
401227
  // utils/status.tsx
401156
401228
  function buildSandboxProperties() {
401157
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant") {
401229
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant") {
401158
401230
  return [];
401159
401231
  }
401160
401232
  const isSandboxed = SandboxManager2.isSandboxingEnabled();
@@ -418469,7 +418541,7 @@ function SpinnerWithVerbInner({
418469
418541
  const messageColor = overrideColor ?? defaultColor;
418470
418542
  const shimmerColor = overrideShimmerColor ?? defaultShimmerColor;
418471
418543
  let ttftText = null;
418472
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && apiMetricsRef?.current && apiMetricsRef.current.length > 0) {
418544
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && apiMetricsRef?.current && apiMetricsRef.current.length > 0) {
418473
418545
  ttftText = computeTtftText(apiMetricsRef.current);
418474
418546
  }
418475
418547
  if (leaderIsIdle && hasRunningTeammates && !foregroundedTeammate) {
@@ -429493,7 +429565,7 @@ function getSearchOrReadInfo(progressMessage, tools, toolUseByID) {
429493
429565
  return null;
429494
429566
  }
429495
429567
  function processProgressMessages(messages, tools, isAgentRunning) {
429496
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant") {
429568
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant") {
429497
429569
  return messages.filter((m4) => hasProgressMessage(m4.data) && m4.data.message.type !== "user").map((m4) => ({
429498
429570
  type: "original",
429499
429571
  message: m4
@@ -429830,7 +429902,7 @@ function renderToolResultMessage(data, progressMessagesForMessage, {
429830
429902
  return /* @__PURE__ */ jsx_runtime109.jsxs(ThemedBox_default, {
429831
429903
  flexDirection: "column",
429832
429904
  children: [
429833
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime109.jsx(MessageResponse, {
429905
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime109.jsx(MessageResponse, {
429834
429906
  children: /* @__PURE__ */ jsx_runtime109.jsxs(ThemedText, {
429835
429907
  color: "warning",
429836
429908
  children: [
@@ -430080,7 +430152,7 @@ function renderToolUseRejectedMessage(_input, {
430080
430152
  const agentId = firstData && hasProgressMessage(firstData) ? firstData.agentId : undefined;
430081
430153
  return /* @__PURE__ */ jsx_runtime109.jsxs(jsx_runtime109.Fragment, {
430082
430154
  children: [
430083
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && agentId && /* @__PURE__ */ jsx_runtime109.jsx(MessageResponse, {
430155
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && agentId && /* @__PURE__ */ jsx_runtime109.jsx(MessageResponse, {
430084
430156
  children: /* @__PURE__ */ jsx_runtime109.jsxs(ThemedText, {
430085
430157
  color: "warning",
430086
430158
  children: [
@@ -430763,7 +430835,7 @@ async function executeForkedSlashCommand(command, args, context2, precedingInput
430763
430835
  }
430764
430836
  let resultText = extractResultText(agentMessages, "Command completed");
430765
430837
  logForDebugging(`Forked slash command /${command.name} completed with agent ${agentId}`);
430766
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
430838
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
430767
430839
  resultText = `[ANT-ONLY] API calls: ${getDisplayPath(getDumpPromptsPath(agentId))}
430768
430840
  ${resultText}`;
430769
430841
  }
@@ -430906,7 +430978,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
430906
430978
  logEvent("tengu_input_command", {
430907
430979
  ...eventData2,
430908
430980
  invocation_trigger: "user-slash",
430909
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && {
430981
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && {
430910
430982
  skill_name: commandName,
430911
430983
  ...returnedCommand.type === "prompt" && {
430912
430984
  skill_source: returnedCommand.source
@@ -430967,7 +431039,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
430967
431039
  logEvent("tengu_input_command", {
430968
431040
  ...eventData,
430969
431041
  invocation_trigger: "user-slash",
430970
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && {
431042
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && {
430971
431043
  skill_name: commandName,
430972
431044
  ...returnedCommand.type === "prompt" && {
430973
431045
  skill_source: returnedCommand.source
@@ -476181,7 +476253,7 @@ function truncateCommand(command) {
476181
476253
  function renderToolResultMessage11(output, _progressMessagesForMessage, {
476182
476254
  verbose
476183
476255
  }) {
476184
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
476256
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
476185
476257
  return null;
476186
476258
  }
476187
476259
  const rawCommand = output.command ?? "";
@@ -477884,7 +477956,7 @@ var init_TaskOutputTool = __esm(() => {
477884
477956
  return this.isReadOnly?.(_input) ?? false;
477885
477957
  },
477886
477958
  isEnabled() {
477887
- return { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant";
477959
+ return { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant";
477888
477960
  },
477889
477961
  isReadOnly(_input) {
477890
477962
  return true;
@@ -479150,6 +479222,33 @@ var init_TungstenTool = __esm(() => {
479150
479222
  });
479151
479223
  });
479152
479224
 
479225
+ // services/tools/interactionCompletion.ts
479226
+ function validateToolInteractionCompletion(tool, input) {
479227
+ const validator = tool.validateInteractionCompletion;
479228
+ return validator?.(input) ?? { result: true };
479229
+ }
479230
+ function interactionIncompleteDecision(result) {
479231
+ return {
479232
+ behavior: "deny",
479233
+ message: result.message,
479234
+ decisionReason: {
479235
+ type: "other",
479236
+ reason: "interactionIncomplete"
479237
+ }
479238
+ };
479239
+ }
479240
+ var INTERACTION_INCOMPLETE_MESSAGE = "No user answer was received. Do not treat this as a user choice. Continue only with explicit reversible assumptions, or explain the precise blocker if safe progress is impossible.", InteractionIncompleteError;
479241
+ var init_interactionCompletion = __esm(() => {
479242
+ InteractionIncompleteError = class InteractionIncompleteError extends Error {
479243
+ outcome;
479244
+ constructor(message = INTERACTION_INCOMPLETE_MESSAGE, outcome = "interaction_unavailable") {
479245
+ super(message);
479246
+ this.name = "InteractionIncompleteError";
479247
+ this.outcome = outcome;
479248
+ }
479249
+ };
479250
+ });
479251
+
479153
479252
  // tools/AskUserQuestionTool/AskUserQuestionTool.tsx
479154
479253
  import { z as z53 } from "zod/v4";
479155
479254
  function AskUserQuestionResultMessage(t0) {
@@ -479170,7 +479269,7 @@ function AskUserQuestionResultMessage(t0) {
479170
479269
  ]
479171
479270
  }),
479172
479271
  /* @__PURE__ */ jsx_runtime137.jsx(ThemedText, {
479173
- children: "User answered Claude's questions:"
479272
+ children: "User answered the questions:"
479174
479273
  })
479175
479274
  ]
479176
479275
  });
@@ -479234,6 +479333,7 @@ var init_AskUserQuestionTool = __esm(() => {
479234
479333
  init_PermissionMode();
479235
479334
  init_ink2();
479236
479335
  init_Tool();
479336
+ init_interactionCompletion();
479237
479337
  init_prompt8();
479238
479338
  import_compiler_runtime116 = __toESM(require_compiler_runtime(), 1);
479239
479339
  jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
@@ -479329,6 +479429,29 @@ var init_AskUserQuestionTool = __esm(() => {
479329
479429
  requiresUserInteraction() {
479330
479430
  return true;
479331
479431
  },
479432
+ validateInteractionCompletion(input) {
479433
+ const questions = Array.isArray(input.questions) ? input.questions : [];
479434
+ const expectedKeys = questions.flatMap((question) => typeof question?.question === "string" && question.question.length > 0 ? [question.question] : []);
479435
+ const answers = input.answers;
479436
+ if (expectedKeys.length === 0 || expectedKeys.length !== questions.length || !answers || typeof answers !== "object" || Array.isArray(answers)) {
479437
+ return {
479438
+ result: false,
479439
+ outcome: "interaction_unavailable",
479440
+ message: INTERACTION_INCOMPLETE_MESSAGE
479441
+ };
479442
+ }
479443
+ const actualKeys = Object.keys(answers);
479444
+ if (actualKeys.length !== expectedKeys.length || expectedKeys.some((key) => !Object.prototype.hasOwnProperty.call(answers, key)) || actualKeys.some((key) => !expectedKeys.includes(key)) || expectedKeys.some((key) => typeof answers[key] !== "string" || answers[key].trim().length === 0)) {
479445
+ return {
479446
+ result: false,
479447
+ outcome: "interaction_unavailable",
479448
+ message: INTERACTION_INCOMPLETE_MESSAGE
479449
+ };
479450
+ }
479451
+ return {
479452
+ result: true
479453
+ };
479454
+ },
479332
479455
  async validateInput({
479333
479456
  questions
479334
479457
  }) {
@@ -479396,13 +479519,22 @@ var init_AskUserQuestionTool = __esm(() => {
479396
479519
  },
479397
479520
  async call({
479398
479521
  questions,
479399
- answers = {},
479522
+ answers,
479400
479523
  annotations
479401
479524
  }, _context) {
479525
+ const completion = AskUserQuestionTool.validateInteractionCompletion?.({
479526
+ questions,
479527
+ answers,
479528
+ annotations
479529
+ });
479530
+ if (completion && !completion.result) {
479531
+ throw new InteractionIncompleteError(completion.message, completion.outcome);
479532
+ }
479533
+ const completedAnswers = answers;
479402
479534
  return {
479403
479535
  data: {
479404
479536
  questions,
479405
- answers,
479537
+ answers: completedAnswers,
479406
479538
  ...annotations && {
479407
479539
  annotations
479408
479540
  }
@@ -494319,6 +494451,623 @@ var init_prompt21 = __esm(() => {
494319
494451
  init_forkSubagent();
494320
494452
  });
494321
494453
 
494454
+ // services/api/gatewayTransport.ts
494455
+ function getCclGatewayUA(model) {
494456
+ return model ? `ccl/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} (${model})` : `ccl/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}`;
494457
+ }
494458
+ function parseGatewayContextCapabilityUnavailable(status, responseText) {
494459
+ if (status !== 422)
494460
+ return;
494461
+ let parsed;
494462
+ try {
494463
+ parsed = JSON.parse(responseText);
494464
+ } catch {
494465
+ return;
494466
+ }
494467
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
494468
+ return;
494469
+ }
494470
+ const error5 = parsed.error;
494471
+ if (typeof error5 !== "object" || error5 === null || Array.isArray(error5)) {
494472
+ return;
494473
+ }
494474
+ const fields = error5;
494475
+ if (fields.type !== "context_capability_unavailable" || !Number.isSafeInteger(fields.required_context_tokens) || fields.required_context_tokens <= 0) {
494476
+ return;
494477
+ }
494478
+ return new GatewayContextCapabilityUnavailableError(fields.required_context_tokens);
494479
+ }
494480
+ function parseGatewayAlternateDeploymentUnavailable(status, responseText) {
494481
+ if (status !== 409)
494482
+ return;
494483
+ let parsed;
494484
+ try {
494485
+ parsed = JSON.parse(responseText);
494486
+ } catch {
494487
+ return;
494488
+ }
494489
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
494490
+ return;
494491
+ }
494492
+ const error5 = parsed.error;
494493
+ if (typeof error5 !== "object" || error5 === null || Array.isArray(error5)) {
494494
+ return;
494495
+ }
494496
+ if (error5.type !== "alternate_deployment_unavailable") {
494497
+ return;
494498
+ }
494499
+ return new GatewayAlternateDeploymentUnavailableError;
494500
+ }
494501
+ function normalizeGatewayAvoidDeployment(value) {
494502
+ const trimmed = value?.trim();
494503
+ if (!trimmed || trimmed.length > 128)
494504
+ return;
494505
+ for (const character of trimmed) {
494506
+ const code = character.charCodeAt(0);
494507
+ const allowed = code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || character === "-" || character === "_" || character === "." || character === ":";
494508
+ if (!allowed)
494509
+ return;
494510
+ }
494511
+ return trimmed;
494512
+ }
494513
+ async function createGatewayStream(options) {
494514
+ const {
494515
+ url: url3,
494516
+ key,
494517
+ body,
494518
+ signal,
494519
+ tags,
494520
+ minimumContextTokens,
494521
+ avoidDeployment
494522
+ } = options;
494523
+ const normalizedAvoidDeployment = normalizeGatewayAvoidDeployment(avoidDeployment);
494524
+ let lastError;
494525
+ for (let attempt = 0;attempt <= GATEWAY_MAX_RETRIES; attempt++) {
494526
+ if (signal?.aborted)
494527
+ throw new APIUserAbortError;
494528
+ if (attempt > 0) {
494529
+ await new Promise((r3) => setTimeout(r3, GATEWAY_RETRY_DELAYS[attempt - 1]));
494530
+ }
494531
+ try {
494532
+ const response = await fetch(url3, {
494533
+ method: "POST",
494534
+ headers: {
494535
+ "Content-Type": "application/json",
494536
+ Authorization: `Bearer ${key}`,
494537
+ "User-Agent": getCclGatewayUA(body.model),
494538
+ ...tags ? { "x-litellm-tags": tags } : {},
494539
+ ...Number.isSafeInteger(minimumContextTokens) && (minimumContextTokens ?? 0) > 0 ? {
494540
+ "X-Margay-Min-Context-Tokens": String(minimumContextTokens)
494541
+ } : {},
494542
+ ...normalizedAvoidDeployment ? {
494543
+ "X-Margay-Avoid-Deployment": normalizedAvoidDeployment
494544
+ } : {}
494545
+ },
494546
+ body: JSON.stringify({ ...body, stream: true }),
494547
+ signal
494548
+ });
494549
+ if (response.status === 429 || response.status >= 500) {
494550
+ await response.body?.cancel().catch(() => {});
494551
+ lastError = response.status >= 500 ? new GatewayUpstreamUnavailableError(response.status) : new Error(`Gateway ${response.status}`);
494552
+ continue;
494553
+ }
494554
+ if (!response.ok) {
494555
+ const errorText = await response.text().catch(() => "");
494556
+ const alternateUnavailableError = parseGatewayAlternateDeploymentUnavailable(response.status, errorText);
494557
+ if (alternateUnavailableError)
494558
+ throw alternateUnavailableError;
494559
+ const contextCapabilityError = parseGatewayContextCapabilityUnavailable(response.status, errorText);
494560
+ if (contextCapabilityError)
494561
+ throw contextCapabilityError;
494562
+ throw new GatewayNonRetryableError(`Gateway ${response.status}: ${errorText}`);
494563
+ }
494564
+ return {
494565
+ stream: new GatewayStream(response, signal),
494566
+ response
494567
+ };
494568
+ } catch (e3) {
494569
+ if (signal?.aborted)
494570
+ throw new APIUserAbortError;
494571
+ if (e3 instanceof GatewayNonRetryableError)
494572
+ throw e3;
494573
+ lastError = e3;
494574
+ if (attempt === GATEWAY_MAX_RETRIES)
494575
+ throw lastError;
494576
+ }
494577
+ }
494578
+ throw lastError;
494579
+ }
494580
+ var GATEWAY_MAX_RETRIES = 2, GATEWAY_RETRY_DELAYS, GatewayNonRetryableError, GatewayContextCapabilityUnavailableError, GatewayAlternateDeploymentUnavailableError, GatewayUpstreamUnavailableError, GatewayStreamProtocolError, GatewayStream;
494581
+ var init_gatewayTransport = __esm(() => {
494582
+ init_sdk();
494583
+ GATEWAY_RETRY_DELAYS = [1000, 3000];
494584
+ GatewayNonRetryableError = class GatewayNonRetryableError extends Error {
494585
+ constructor(message) {
494586
+ super(message);
494587
+ this.name = "GatewayNonRetryableError";
494588
+ }
494589
+ };
494590
+ GatewayContextCapabilityUnavailableError = class GatewayContextCapabilityUnavailableError extends GatewayNonRetryableError {
494591
+ code = "context_capability_unavailable";
494592
+ requiredContextTokens;
494593
+ constructor(requiredContextTokens) {
494594
+ super("Gateway has no configured deployment with sufficient context capacity");
494595
+ this.name = "GatewayContextCapabilityUnavailableError";
494596
+ this.requiredContextTokens = requiredContextTokens;
494597
+ }
494598
+ };
494599
+ GatewayAlternateDeploymentUnavailableError = class GatewayAlternateDeploymentUnavailableError extends GatewayNonRetryableError {
494600
+ code = "alternate_deployment_unavailable";
494601
+ constructor() {
494602
+ super("Gateway has no alternate deployment for this model");
494603
+ this.name = "GatewayAlternateDeploymentUnavailableError";
494604
+ }
494605
+ };
494606
+ GatewayUpstreamUnavailableError = class GatewayUpstreamUnavailableError extends Error {
494607
+ code = "gateway_upstream_unavailable";
494608
+ status;
494609
+ constructor(status) {
494610
+ super(`Gateway upstream unavailable (HTTP ${status})`);
494611
+ this.name = "GatewayUpstreamUnavailableError";
494612
+ this.status = status;
494613
+ }
494614
+ };
494615
+ GatewayStreamProtocolError = class GatewayStreamProtocolError extends Error {
494616
+ code;
494617
+ lastEventType;
494618
+ partialUsage;
494619
+ constructor(code, message, details = {}) {
494620
+ super(message);
494621
+ this.name = "GatewayStreamProtocolError";
494622
+ this.code = code;
494623
+ this.lastEventType = details.lastEventType;
494624
+ this.partialUsage = details.partialUsage ?? {};
494625
+ }
494626
+ };
494627
+ GatewayStream = class GatewayStream {
494628
+ response;
494629
+ controller;
494630
+ constructor(response, abortSignal) {
494631
+ this.response = response;
494632
+ this.controller = new AbortController;
494633
+ if (abortSignal) {
494634
+ abortSignal.addEventListener("abort", () => this.controller.abort(), { once: true });
494635
+ }
494636
+ }
494637
+ async* [Symbol.asyncIterator]() {
494638
+ const reader = this.response.body.getReader();
494639
+ const decoder = new TextDecoder;
494640
+ let buffer = "";
494641
+ let yieldedAny = false;
494642
+ let rawSnippet = "";
494643
+ let terminalComplete = false;
494644
+ let lastEventType;
494645
+ const partialUsage = {};
494646
+ const protocolError = (code, message) => new GatewayStreamProtocolError(code, message, {
494647
+ lastEventType,
494648
+ partialUsage: { ...partialUsage }
494649
+ });
494650
+ const parseLine = (line) => {
494651
+ const trimmed = line.replace(/\r$/, "");
494652
+ if (!trimmed.startsWith("data:"))
494653
+ return null;
494654
+ const data = trimmed.slice(5).trim();
494655
+ if (!data)
494656
+ return null;
494657
+ if (data === "[DONE]")
494658
+ return "done";
494659
+ let event;
494660
+ try {
494661
+ event = JSON.parse(data);
494662
+ } catch {
494663
+ return null;
494664
+ }
494665
+ const typed = event;
494666
+ const type = typed.type;
494667
+ if (type === "ping") {
494668
+ yieldedAny = true;
494669
+ return null;
494670
+ }
494671
+ yieldedAny = true;
494672
+ if (type)
494673
+ lastEventType = type;
494674
+ const usage = type === "message_start" ? typed.message?.usage : typed.usage;
494675
+ if (usage) {
494676
+ for (const key of ["input_tokens", "output_tokens", "cache_read_input_tokens", "cache_creation_input_tokens"]) {
494677
+ if (typeof usage[key] === "number")
494678
+ partialUsage[key] = usage[key];
494679
+ }
494680
+ }
494681
+ if (type === "error") {
494682
+ const incomplete = typed.margay?.code === "incomplete_upstream_stream";
494683
+ throw protocolError(incomplete ? "incomplete_stream" : "upstream_stream_error", incomplete ? "Gateway upstream stream ended before message_stop" : "Gateway emitted a stream error event");
494684
+ }
494685
+ if (type === "message_stop")
494686
+ terminalComplete = true;
494687
+ return event;
494688
+ };
494689
+ const onAbort = () => {
494690
+ process.stderr.write(`[ccl-trace] {"target":"gateway-stream-abort","action":"cancel-pending-read"}
494691
+ `);
494692
+ reader.cancel().catch(() => {});
494693
+ };
494694
+ if (this.controller.signal.aborted)
494695
+ onAbort();
494696
+ else
494697
+ this.controller.signal.addEventListener("abort", onAbort, { once: true });
494698
+ try {
494699
+ while (true) {
494700
+ if (this.controller.signal.aborted) {
494701
+ return;
494702
+ }
494703
+ const { done, value } = await reader.read();
494704
+ if (done) {
494705
+ if (this.controller.signal.aborted)
494706
+ return;
494707
+ break;
494708
+ }
494709
+ const chunk = decoder.decode(value, { stream: true });
494710
+ if (rawSnippet.length < 500)
494711
+ rawSnippet += chunk.slice(0, 500 - rawSnippet.length);
494712
+ buffer += chunk;
494713
+ const lines = buffer.split(`
494714
+ `);
494715
+ buffer = lines.pop() ?? "";
494716
+ for (const line of lines) {
494717
+ const parsed = parseLine(line);
494718
+ if (parsed === "done") {
494719
+ if (!terminalComplete)
494720
+ throw protocolError("incomplete_stream", "Gateway stream sent [DONE] before message_stop");
494721
+ return;
494722
+ }
494723
+ if (parsed)
494724
+ yield parsed;
494725
+ }
494726
+ }
494727
+ buffer += decoder.decode();
494728
+ if (buffer.trim()) {
494729
+ const parsed = parseLine(buffer);
494730
+ if (parsed === "done") {
494731
+ if (!terminalComplete)
494732
+ throw protocolError("incomplete_stream", "Gateway stream sent [DONE] before message_stop");
494733
+ } else if (parsed) {
494734
+ yield parsed;
494735
+ }
494736
+ }
494737
+ if (!yieldedAny) {
494738
+ const ct2 = this.response.headers.get("content-type") ?? "unknown";
494739
+ throw new Error(`Gateway stream returned no SSE events (status=${this.response.status}, content-type=${ct2}, body=${rawSnippet.slice(0, 200)})`);
494740
+ }
494741
+ if (!terminalComplete) {
494742
+ throw protocolError("incomplete_stream", "Gateway stream ended before message_stop");
494743
+ }
494744
+ } finally {
494745
+ this.controller.signal.removeEventListener("abort", onAbort);
494746
+ try {
494747
+ await reader.cancel();
494748
+ } catch {}
494749
+ }
494750
+ }
494751
+ };
494752
+ });
494753
+
494754
+ // services/api/boundedInferenceTransport.ts
494755
+ async function runBoundedInference(request) {
494756
+ const fetchFn = request.fetchFn ?? fetch;
494757
+ const path16 = request.clientProtocol === "anthropic_messages" ? "/messages" : "/chat/completions";
494758
+ const base = request.gateway.url.replace(/\/+$/, "");
494759
+ const url3 = base.endsWith("/v1") ? `${base}${path16}` : `${base}/v1${path16}`;
494760
+ const response = await fetchFn(url3, {
494761
+ method: "POST",
494762
+ headers: {
494763
+ "Content-Type": "application/json",
494764
+ Authorization: `Bearer ${request.gateway.key}`,
494765
+ ...request.minimumContextTokens !== undefined ? { "X-Margay-Min-Context-Tokens": String(request.minimumContextTokens) } : {}
494766
+ },
494767
+ body: JSON.stringify(request.clientProtocol === "anthropic_messages" ? anthropicBody(request) : openAIBody(request)),
494768
+ signal: request.signal
494769
+ });
494770
+ if (!response.ok) {
494771
+ const body = await response.text().catch(() => "(no body)");
494772
+ const contextError = parseGatewayContextCapabilityUnavailable(response.status, body);
494773
+ if (contextError)
494774
+ throw contextError;
494775
+ if (response.status >= 500) {
494776
+ throw new GatewayUpstreamUnavailableError(response.status);
494777
+ }
494778
+ throw new Error(`Bounded inference failed: HTTP ${response.status} — ${body.slice(0, 200)}`);
494779
+ }
494780
+ if (!response.body) {
494781
+ throw new BoundedInferenceProtocolError("incomplete_stream", "Bounded inference response has no stream body");
494782
+ }
494783
+ observeGatewayContextResponse(request.model, response.headers);
494784
+ const parsed = request.clientProtocol === "anthropic_messages" ? await parseAnthropicStream(response.body) : await parseOpenAIStream(response.body);
494785
+ if (!parsed.text) {
494786
+ throw new BoundedInferenceProtocolError("empty_response", "Bounded inference returned no text");
494787
+ }
494788
+ return {
494789
+ text: parsed.text,
494790
+ requestedModel: response.headers.get("x-margay-requested-model") ?? request.model,
494791
+ resolvedModel: response.headers.get("x-margay-resolved-model") ?? request.model,
494792
+ servedModel: response.headers.get("x-margay-served-model") ?? parsed.model ?? request.model,
494793
+ ...request.canonicalModel ? { canonicalModel: request.canonicalModel } : {},
494794
+ clientProtocol: request.clientProtocol,
494795
+ terminalComplete: true,
494796
+ stopReason: parsed.stopReason,
494797
+ usage: parsed.usage
494798
+ };
494799
+ }
494800
+ function anthropicBody(request) {
494801
+ const content = [
494802
+ ...(request.images ?? []).map((image) => ({
494803
+ type: "image",
494804
+ source: { type: "base64", media_type: image.mediaType, data: image.base64 }
494805
+ })),
494806
+ { type: "text", text: request.prompt }
494807
+ ];
494808
+ const messages = request.conversation ?? [{ role: "user", content }];
494809
+ return {
494810
+ model: request.model,
494811
+ system: [{ type: "text", text: request.systemPrompt }],
494812
+ messages,
494813
+ max_tokens: request.maxOutputTokens,
494814
+ stream: true
494815
+ };
494816
+ }
494817
+ function openAIBody(request) {
494818
+ const content = [
494819
+ ...(request.images ?? []).map((image) => ({
494820
+ type: "image_url",
494821
+ image_url: { url: `data:${image.mediaType};base64,${image.base64}` }
494822
+ })),
494823
+ { type: "text", text: request.prompt }
494824
+ ];
494825
+ const messages = request.conversation ? request.conversation.map((message) => ({
494826
+ role: message.role,
494827
+ content: openAITextContent(message.content)
494828
+ })) : [{ role: "user", content }];
494829
+ return {
494830
+ model: request.model,
494831
+ messages: [
494832
+ { role: "system", content: request.systemPrompt },
494833
+ ...messages
494834
+ ],
494835
+ max_tokens: request.maxOutputTokens,
494836
+ stream: true,
494837
+ stream_options: { include_usage: true }
494838
+ };
494839
+ }
494840
+ function openAITextContent(content) {
494841
+ if (typeof content === "string")
494842
+ return content;
494843
+ if (!Array.isArray(content))
494844
+ return JSON.stringify(content);
494845
+ return content.map((block) => {
494846
+ if (typeof block === "object" && block !== null) {
494847
+ const value = block;
494848
+ if (value.type === "text" && typeof value.text === "string")
494849
+ return value.text;
494850
+ }
494851
+ return JSON.stringify(block);
494852
+ }).join(`
494853
+ `);
494854
+ }
494855
+ async function parseAnthropicStream(body) {
494856
+ const state = {
494857
+ text: [],
494858
+ model: undefined,
494859
+ stopReason: "",
494860
+ terminal: false,
494861
+ toolCall: false,
494862
+ usage: emptyUsage()
494863
+ };
494864
+ await forEachSseData(body, (data) => {
494865
+ if (data === "[DONE]")
494866
+ return;
494867
+ const event = parseEvent(data);
494868
+ if (event.type === "message_start") {
494869
+ state.model = stringOrUndefined(event.message?.model);
494870
+ readAnthropicUsage(state.usage, event.message?.usage);
494871
+ } else if (event.type === "content_block_start") {
494872
+ if (event.content_block?.type === "tool_use")
494873
+ state.toolCall = true;
494874
+ if (event.content_block?.type === "text" && typeof event.content_block.text === "string") {
494875
+ state.text.push(event.content_block.text);
494876
+ }
494877
+ } else if (event.type === "content_block_delta") {
494878
+ if (event.delta?.type === "text_delta" && typeof event.delta.text === "string") {
494879
+ state.text.push(event.delta.text);
494880
+ }
494881
+ } else if (event.type === "message_delta") {
494882
+ state.stopReason = stringOrUndefined(event.delta?.stop_reason) ?? state.stopReason;
494883
+ readAnthropicUsage(state.usage, event.usage);
494884
+ } else if (event.type === "message_stop") {
494885
+ state.terminal = true;
494886
+ }
494887
+ });
494888
+ if (state.toolCall) {
494889
+ throw new BoundedInferenceProtocolError("tool_call_returned", "Bounded Anthropic response returned tool_use");
494890
+ }
494891
+ if (!state.terminal) {
494892
+ throw new BoundedInferenceProtocolError("incomplete_stream", "Bounded Anthropic stream ended before message_stop");
494893
+ }
494894
+ return {
494895
+ text: state.text.join(""),
494896
+ ...state.model ? { model: state.model } : {},
494897
+ stopReason: state.stopReason || "end_turn",
494898
+ usage: state.usage
494899
+ };
494900
+ }
494901
+ async function parseOpenAIStream(body) {
494902
+ const state = {
494903
+ text: [],
494904
+ model: undefined,
494905
+ stopReason: "",
494906
+ done: false,
494907
+ toolCall: false,
494908
+ usage: emptyUsage()
494909
+ };
494910
+ await forEachSseData(body, (data) => {
494911
+ if (data === "[DONE]") {
494912
+ state.done = true;
494913
+ return;
494914
+ }
494915
+ const event = parseEvent(data);
494916
+ state.model = stringOrUndefined(event.model) ?? state.model;
494917
+ if (event.usage && typeof event.usage === "object") {
494918
+ state.usage.inputTokens = numberOrZero(event.usage.prompt_tokens);
494919
+ state.usage.outputTokens = numberOrZero(event.usage.completion_tokens);
494920
+ state.usage.cacheReadInputTokens = numberOrZero(event.usage.prompt_tokens_details?.cached_tokens);
494921
+ }
494922
+ const choices = Array.isArray(event.choices) ? event.choices : [];
494923
+ for (const choice of choices) {
494924
+ if (Array.isArray(choice?.delta?.tool_calls) && choice.delta.tool_calls.length > 0) {
494925
+ state.toolCall = true;
494926
+ }
494927
+ if (typeof choice?.delta?.content === "string")
494928
+ state.text.push(choice.delta.content);
494929
+ if (typeof choice?.finish_reason === "string")
494930
+ state.stopReason = choice.finish_reason;
494931
+ }
494932
+ });
494933
+ if (state.toolCall) {
494934
+ throw new BoundedInferenceProtocolError("tool_call_returned", "Bounded OpenAI response returned tool_calls");
494935
+ }
494936
+ if (!state.done || !state.stopReason) {
494937
+ throw new BoundedInferenceProtocolError("incomplete_stream", "Bounded OpenAI stream ended before finish_reason and [DONE]");
494938
+ }
494939
+ return {
494940
+ text: state.text.join(""),
494941
+ ...state.model ? { model: state.model } : {},
494942
+ stopReason: state.stopReason,
494943
+ usage: state.usage
494944
+ };
494945
+ }
494946
+ async function forEachSseData(body, visit2) {
494947
+ const reader = body.getReader();
494948
+ const decoder = new TextDecoder;
494949
+ let buffer = "";
494950
+ try {
494951
+ while (true) {
494952
+ const { done, value } = await reader.read();
494953
+ if (done)
494954
+ break;
494955
+ buffer += decoder.decode(value, { stream: true });
494956
+ const frames = buffer.split(`
494957
+
494958
+ `);
494959
+ buffer = frames.pop() ?? "";
494960
+ for (const frame of frames) {
494961
+ for (const line of frame.split(`
494962
+ `)) {
494963
+ if (line.startsWith("data:"))
494964
+ visit2(line.slice(5).trim());
494965
+ }
494966
+ }
494967
+ }
494968
+ buffer += decoder.decode();
494969
+ if (buffer.trim()) {
494970
+ for (const line of buffer.split(`
494971
+ `)) {
494972
+ if (line.startsWith("data:"))
494973
+ visit2(line.slice(5).trim());
494974
+ }
494975
+ }
494976
+ } finally {
494977
+ reader.releaseLock();
494978
+ }
494979
+ }
494980
+ function parseEvent(data) {
494981
+ try {
494982
+ return JSON.parse(data);
494983
+ } catch {
494984
+ throw new BoundedInferenceProtocolError("malformed_event", "Bounded inference stream contained malformed JSON");
494985
+ }
494986
+ }
494987
+ function emptyUsage() {
494988
+ return {
494989
+ inputTokens: 0,
494990
+ outputTokens: 0,
494991
+ cacheReadInputTokens: 0,
494992
+ cacheCreationInputTokens: 0
494993
+ };
494994
+ }
494995
+ function readAnthropicUsage(usage, raw) {
494996
+ if (!raw || typeof raw !== "object")
494997
+ return;
494998
+ if (raw.input_tokens !== undefined)
494999
+ usage.inputTokens = numberOrZero(raw.input_tokens);
495000
+ if (raw.output_tokens !== undefined)
495001
+ usage.outputTokens = numberOrZero(raw.output_tokens);
495002
+ if (raw.cache_read_input_tokens !== undefined) {
495003
+ usage.cacheReadInputTokens = numberOrZero(raw.cache_read_input_tokens);
495004
+ }
495005
+ if (raw.cache_creation_input_tokens !== undefined) {
495006
+ usage.cacheCreationInputTokens = numberOrZero(raw.cache_creation_input_tokens);
495007
+ }
495008
+ }
495009
+ function numberOrZero(value) {
495010
+ return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
495011
+ }
495012
+ function stringOrUndefined(value) {
495013
+ return typeof value === "string" && value.length > 0 ? value : undefined;
495014
+ }
495015
+ var BoundedInferenceProtocolError;
495016
+ var init_boundedInferenceTransport = __esm(() => {
495017
+ init_dynamicContextWindow();
495018
+ init_gatewayTransport();
495019
+ BoundedInferenceProtocolError = class BoundedInferenceProtocolError extends Error {
495020
+ code;
495021
+ constructor(code, message) {
495022
+ super(message);
495023
+ this.code = code;
495024
+ this.name = "BoundedInferenceProtocolError";
495025
+ }
495026
+ };
495027
+ });
495028
+
495029
+ // tools/AgentTool/runVisualSpecialist.ts
495030
+ async function runVisualSpecialistForAgentTool(input, context2, canUseTool, assistantMessage) {
495031
+ let imageIndex = 0;
495032
+ return runVisualSpecialist(input, {
495033
+ loadImage: async (path16) => {
495034
+ const fileInput = { file_path: path16 };
495035
+ const validation = await FileReadTool.validateInput(fileInput, context2);
495036
+ if (!validation.result)
495037
+ throw new Error(validation.message);
495038
+ const decision = await canUseTool(FileReadTool, fileInput, context2, assistantMessage, `visual_image_${imageIndex++}`);
495039
+ if (decision.behavior !== "allow") {
495040
+ throw new Error(`Read permission denied for visual image: ${path16}`);
495041
+ }
495042
+ const loaded = await FileReadTool.call(decision.updatedInput, context2, canUseTool, assistantMessage);
495043
+ if (loaded.data.type !== "image") {
495044
+ throw new Error(`visual-ui-analysis supports image files only: ${path16}`);
495045
+ }
495046
+ return {
495047
+ mediaType: loaded.data.file.type,
495048
+ base64: loaded.data.file.base64
495049
+ };
495050
+ },
495051
+ resolve: (request) => resolveCapabilityModel(request),
495052
+ infer: async (request) => {
495053
+ const gateway = getGatewayConfig();
495054
+ if (!gateway)
495055
+ throw new Error("Gateway is required for visual-ui-analysis");
495056
+ return runBoundedInference({ ...request, gateway });
495057
+ }
495058
+ });
495059
+ }
495060
+ function visualRoutingMode() {
495061
+ return getRoutingPriority();
495062
+ }
495063
+ var init_runVisualSpecialist = __esm(() => {
495064
+ init_providers();
495065
+ init_capabilityResolver();
495066
+ init_boundedInferenceTransport();
495067
+ init_intentClassifier();
495068
+ init_FileReadTool();
495069
+ });
495070
+
494322
495071
  // tools/AgentTool/AgentTool.tsx
494323
495072
  var exports_AgentTool = {};
494324
495073
  __export(exports_AgentTool, {
@@ -494389,6 +495138,7 @@ var init_AgentTool = __esm(() => {
494389
495138
  init_loadAgentsDir();
494390
495139
  init_prompt21();
494391
495140
  init_runAgent();
495141
+ init_runVisualSpecialist();
494392
495142
  init_UI();
494393
495143
  jsx_runtime149 = __toESM(require_jsx_runtime(), 1);
494394
495144
  proactiveModule2 = feature("PROACTIVE") || feature("KAIROS") ? __toCommonJS(exports_proactive) : null;
@@ -494397,6 +495147,7 @@ var init_AgentTool = __esm(() => {
494397
495147
  description: z76.string().describe("A short (3-5 word) description of the task"),
494398
495148
  prompt: z76.string().describe("The task for the agent to perform"),
494399
495149
  subagent_type: z76.string().optional().describe("The type of specialized agent to use for this task"),
495150
+ image_paths: z76.array(z76.string().trim().min(1)).min(1).max(20).optional().describe("Image paths for visual-ui-analysis only. The images are validated and preloaded before one bounded zero-tool model request."),
494400
495151
  model: z76.string().trim().min(1).optional().describe("Optional concrete model override or capability role. Use the exact role values 'pool:execution', 'pool:analysis', 'pool:planning', 'pool:debug', 'pool:bounded-worker', 'pool:advisor', 'pool:critic', 'pool:visual', or 'pool:compactor' to let CCL resolve a model from the selected quality/cost pool; these values are valid and must be passed verbatim. Advisor gives evidence-only action advice before a decision; Critic reviews an existing draft/result. A concrete model name ('deepseek-v4-pro', 'k3', …) bypasses pool resolution. If omitted, uses the agent definition's model or inherits from the parent."),
494401
495152
  run_in_background: z76.boolean().optional().describe("Set to true to run this agent in the background. You will be notified when it completes.")
494402
495153
  }));
@@ -494407,7 +495158,7 @@ var init_AgentTool = __esm(() => {
494407
495158
  mode: permissionModeSchema().optional().describe('Permission mode for spawned teammate (e.g., "plan" to require plan approval).')
494408
495159
  });
494409
495160
  return baseInputSchema().merge(multiAgentInputSchema).extend({
494410
- isolation: ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? z76.enum(["worktree", "remote"]) : z76.enum(["worktree"])).optional().describe({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? 'Isolation mode. "worktree" creates a temporary git worktree so the agent works on an isolated copy of the repo. "remote" launches the agent in a remote CCR environment (always runs in background).' : 'Isolation mode. "worktree" creates a temporary git worktree so the agent works on an isolated copy of the repo.'),
495161
+ isolation: ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? z76.enum(["worktree", "remote"]) : z76.enum(["worktree"])).optional().describe({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? 'Isolation mode. "worktree" creates a temporary git worktree so the agent works on an isolated copy of the repo. "remote" launches the agent in a remote CCR environment (always runs in background).' : 'Isolation mode. "worktree" creates a temporary git worktree so the agent works on an isolated copy of the repo.'),
494411
495162
  cwd: z76.string().optional().describe('Absolute path to run the agent in. Overrides the working directory for all filesystem and shell operations within this agent. Mutually exclusive with isolation: "worktree".')
494412
495163
  });
494413
495164
  });
@@ -494473,6 +495224,7 @@ var init_AgentTool = __esm(() => {
494473
495224
  async call({
494474
495225
  prompt,
494475
495226
  subagent_type,
495227
+ image_paths,
494476
495228
  description,
494477
495229
  model: modelParam,
494478
495230
  allowedTools: preAuthorizedTools,
@@ -494488,6 +495240,7 @@ var init_AgentTool = __esm(() => {
494488
495240
  }, toolUseContext, canUseTool, assistantMessage, onProgress) {
494489
495241
  const startTime2 = Date.now();
494490
495242
  const model = isCoordinatorMode() ? undefined : modelParam;
495243
+ assertVisualImagePaths(subagent_type ?? "", image_paths);
494491
495244
  if (subagent_type && isExternalAgentKind(subagent_type)) {
494492
495245
  const result = await runExternalAgent({
494493
495246
  kind: subagent_type,
@@ -494521,6 +495274,37 @@ var init_AgentTool = __esm(() => {
494521
495274
  };
494522
495275
  return { data: completed };
494523
495276
  }
495277
+ if (subagent_type === "visual-ui-analysis") {
495278
+ if (run_in_background || name2 || team_name || isolation || cwd2) {
495279
+ throw new Error("visual-ui-analysis is a synchronous one-shot specialist and cannot be backgrounded, named, teamed, or isolated");
495280
+ }
495281
+ const result = await runVisualSpecialistForAgentTool({
495282
+ prompt,
495283
+ imagePaths: image_paths,
495284
+ mode: visualRoutingMode(),
495285
+ signal: toolUseContext.abortController.signal
495286
+ }, toolUseContext, canUseTool, assistantMessage);
495287
+ const completed = {
495288
+ status: "completed",
495289
+ prompt,
495290
+ agentId: createAgentId(),
495291
+ agentType: subagent_type,
495292
+ content: [{ type: "text", text: result.text }],
495293
+ totalToolUseCount: 0,
495294
+ totalDurationMs: Date.now() - startTime2,
495295
+ totalTokens: result.usage.inputTokens + result.usage.outputTokens,
495296
+ usage: {
495297
+ input_tokens: result.usage.inputTokens,
495298
+ output_tokens: result.usage.outputTokens,
495299
+ cache_creation_input_tokens: result.usage.cacheCreationInputTokens,
495300
+ cache_read_input_tokens: result.usage.cacheReadInputTokens,
495301
+ server_tool_use: null,
495302
+ service_tier: null,
495303
+ cache_creation: null
495304
+ }
495305
+ };
495306
+ return { data: completed };
495307
+ }
494524
495308
  const appState = toolUseContext.getAppState();
494525
495309
  const permissionMode = appState.toolPermissionContext.mode;
494526
495310
  const rootSetAppState = toolUseContext.setAppStateForTasks ?? toolUseContext.setAppState;
@@ -494639,7 +495423,7 @@ var init_AgentTool = __esm(() => {
494639
495423
  is_fork: isForkPath
494640
495424
  });
494641
495425
  const effectiveIsolation = isolation ?? selectedAgent.isolation;
494642
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && effectiveIsolation === "remote") {
495426
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && effectiveIsolation === "remote") {
494643
495427
  const eligibility = await checkRemoteAgentEligibility();
494644
495428
  if (!eligibility.eligible) {
494645
495429
  const reasons = eligibility.errors.map(formatPreconditionError).join(`
@@ -494714,7 +495498,7 @@ ${reasons}`);
494714
495498
  });
494715
495499
  if (selectedAgent.memory) {
494716
495500
  logEvent("tengu_agent_memory_loaded", {
494717
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && {
495501
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && {
494718
495502
  agent_type: selectedAgent.agentType
494719
495503
  },
494720
495504
  scope: selectedAgent.memory,
@@ -495275,7 +496059,7 @@ ${finalMessage}`;
495275
496059
  },
495276
496060
  async checkPermissions(input, context2) {
495277
496061
  const appState = context2.getAppState();
495278
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && appState.toolPermissionContext.mode === "auto") {
496062
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && appState.toolPermissionContext.mode === "auto") {
495279
496063
  return {
495280
496064
  behavior: "passthrough",
495281
496065
  message: "Agent tool requires permission to spawn sub-agents."
@@ -500529,7 +501313,7 @@ async function resolveHookPermissionDecision(hookPermissionResult, tool, input,
500529
501313
  const requireCanUseTool = toolUseContext.requireCanUseTool;
500530
501314
  if (hookPermissionResult?.behavior === "allow") {
500531
501315
  const hookInput = hookPermissionResult.updatedInput ?? input;
500532
- const interactionSatisfied = requiresInteraction && hookPermissionResult.updatedInput !== undefined;
501316
+ const interactionSatisfied = requiresInteraction && hookPermissionResult.updatedInput !== undefined && validateToolInteractionCompletion(tool, hookInput).result;
500533
501317
  if (requiresInteraction && !interactionSatisfied || requireCanUseTool) {
500534
501318
  logForDebugging(`Hook approved tool use for ${tool.name}, but canUseTool is required`);
500535
501319
  return {
@@ -500721,6 +501505,7 @@ var init_toolHooks = __esm(() => {
500721
501505
  init_log();
500722
501506
  init_permissions2();
500723
501507
  init_toolErrors();
501508
+ init_interactionCompletion();
500724
501509
  init_utils4();
500725
501510
  });
500726
501511
 
@@ -501275,6 +502060,29 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
501275
502060
  if (permissionDecision.updatedInput !== undefined) {
501276
502061
  processedInput = permissionDecision.updatedInput;
501277
502062
  }
502063
+ const interactionCompletion = validateToolInteractionCompletion(tool, processedInput);
502064
+ if (!interactionCompletion.result) {
502065
+ logForDebugging(`${tool.name} interaction incomplete; tool execution skipped`);
502066
+ const decisionInfo2 = toolUseContext.toolDecisions?.get(toolUseID);
502067
+ endToolBlockedOnUserSpan("reject", decisionInfo2?.source || "unknown");
502068
+ endToolSpan();
502069
+ resultingMessages.push({
502070
+ message: createUserMessage({
502071
+ content: [
502072
+ {
502073
+ type: "tool_result",
502074
+ content: interactionCompletion.message,
502075
+ is_error: true,
502076
+ tool_use_id: toolUseID
502077
+ }
502078
+ ],
502079
+ toolUseResult: `Interaction incomplete: ${interactionCompletion.message}`,
502080
+ nonFatalToolError: true,
502081
+ sourceToolAssistantUUID: assistantMessage.uuid
502082
+ })
502083
+ });
502084
+ return resultingMessages;
502085
+ }
501278
502086
  const telemetryToolInput = extractToolInputForTelemetry(processedInput);
501279
502087
  let toolParameters = {};
501280
502088
  if (isToolDetailsLoggingEnabled()) {
@@ -501672,6 +502480,7 @@ var init_toolExecution = __esm(() => {
501672
502480
  init_toolSearch();
501673
502481
  init_client9();
501674
502482
  init_mcpStringUtils();
502483
+ init_interactionCompletion();
501675
502484
  init_utils4();
501676
502485
  init_toolHooks();
501677
502486
  });
@@ -504466,6 +505275,147 @@ var init_incompleteStreamRecovery = __esm(() => {
504466
505275
  };
504467
505276
  });
504468
505277
 
505278
+ // services/api/clientToolTurnBuffer.ts
505279
+ class ClientToolTurnBuffer {
505280
+ #messages = [];
505281
+ #sawClientTool = false;
505282
+ #hasInvalidInput = false;
505283
+ #hasPlaceholderInput = false;
505284
+ #clientToolCount = 0;
505285
+ add(message, inputs) {
505286
+ if (inputs.length === 0)
505287
+ return;
505288
+ this.#sawClientTool = true;
505289
+ this.#clientToolCount += inputs.length;
505290
+ if (inputs.some(({ status }) => status === "invalid_or_incomplete")) {
505291
+ this.#hasInvalidInput = true;
505292
+ }
505293
+ if (inputs.some(({ status }) => status === "placeholder")) {
505294
+ this.#hasPlaceholderInput = true;
505295
+ }
505296
+ this.#messages.push(message);
505297
+ }
505298
+ get hasClientToolUse() {
505299
+ return this.#sawClientTool;
505300
+ }
505301
+ get clientToolCount() {
505302
+ return this.#clientToolCount;
505303
+ }
505304
+ finalize(stopReason) {
505305
+ if (!this.#sawClientTool) {
505306
+ return {
505307
+ action: "release",
505308
+ code: null,
505309
+ messages: [],
505310
+ toolExecuted: false,
505311
+ clientToolCount: 0
505312
+ };
505313
+ }
505314
+ let code = null;
505315
+ if (stopReason === "max_tokens" || stopReason === "model_context_window_exceeded") {
505316
+ code = "max_output_tokens_during_tool_call";
505317
+ } else if (this.#hasInvalidInput || this.#hasPlaceholderInput) {
505318
+ code = "invalid_or_incomplete_tool_input";
505319
+ } else if (stopReason !== "tool_use") {
505320
+ code = "tool_use_stop_reason_mismatch";
505321
+ }
505322
+ if (code) {
505323
+ return {
505324
+ action: "discard",
505325
+ code,
505326
+ messages: [],
505327
+ toolExecuted: false,
505328
+ clientToolCount: this.#clientToolCount
505329
+ };
505330
+ }
505331
+ return {
505332
+ action: "release",
505333
+ code: null,
505334
+ messages: [...this.#messages],
505335
+ toolExecuted: false,
505336
+ clientToolCount: this.#clientToolCount
505337
+ };
505338
+ }
505339
+ }
505340
+ var ClientToolProtocolTurnError;
505341
+ var init_clientToolTurnBuffer = __esm(() => {
505342
+ ClientToolProtocolTurnError = class ClientToolProtocolTurnError extends Error {
505343
+ code;
505344
+ observedStopReason;
505345
+ clientToolCount;
505346
+ toolExecuted = false;
505347
+ requestId;
505348
+ upstreamRequestId;
505349
+ servedModel;
505350
+ servedDeployment;
505351
+ partialUsage;
505352
+ constructor({
505353
+ code,
505354
+ observedStopReason,
505355
+ clientToolCount,
505356
+ requestId,
505357
+ upstreamRequestId,
505358
+ servedModel,
505359
+ servedDeployment,
505360
+ partialUsage = {}
505361
+ }) {
505362
+ super("Client tool turn had an incompatible terminal protocol");
505363
+ this.name = "ClientToolProtocolTurnError";
505364
+ this.code = code;
505365
+ this.observedStopReason = observedStopReason ?? null;
505366
+ this.clientToolCount = clientToolCount;
505367
+ this.requestId = requestId;
505368
+ this.upstreamRequestId = upstreamRequestId;
505369
+ this.servedModel = servedModel;
505370
+ this.servedDeployment = servedDeployment;
505371
+ this.partialUsage = { ...partialUsage };
505372
+ }
505373
+ };
505374
+ });
505375
+
505376
+ // services/api/clientToolProtocolRecovery.ts
505377
+ function initialClientToolProtocolRecoveryState() {
505378
+ return {
505379
+ sameModelRetryUsed: false,
505380
+ heterogeneousFallbackUsed: false
505381
+ };
505382
+ }
505383
+ function decideClientToolProtocolRecovery({
505384
+ error: error5,
505385
+ state,
505386
+ currentModel,
505387
+ fallbackModel,
505388
+ toolStates
505389
+ }) {
505390
+ if (error5.toolExecuted || toolStates.length > 0) {
505391
+ return { action: "fail_side_effect_observed" };
505392
+ }
505393
+ const servedDeployment = error5.servedDeployment?.trim();
505394
+ if (!state.sameModelRetryUsed && servedDeployment) {
505395
+ return {
505396
+ action: "retry_same_model",
505397
+ avoidDeployment: servedDeployment,
505398
+ nextState: {
505399
+ ...state,
505400
+ sameModelRetryUsed: true
505401
+ }
505402
+ };
505403
+ }
505404
+ const heterogeneousModel = fallbackModel?.trim();
505405
+ if (!state.heterogeneousFallbackUsed && heterogeneousModel && heterogeneousModel !== currentModel) {
505406
+ return {
505407
+ action: "retry_heterogeneous",
505408
+ model: heterogeneousModel,
505409
+ nextState: {
505410
+ ...state,
505411
+ sameModelRetryUsed: true,
505412
+ heterogeneousFallbackUsed: true
505413
+ }
505414
+ };
505415
+ }
505416
+ return { action: "fail_exhausted" };
505417
+ }
505418
+
504469
505419
  // query/classifierFallback.ts
504470
505420
  function resolveClassifierFallbackModel() {
504471
505421
  return getDefaultSonnetModel();
@@ -505417,6 +506367,9 @@ async function* queryLoop(params, consumedCommandUuids) {
505417
506367
  }
505418
506368
  let attemptWithFallback = true;
505419
506369
  let incompleteStreamRetryCount = 0;
506370
+ let clientToolProtocolRecoveryState = initialClientToolProtocolRecoveryState();
506371
+ let avoidGatewayDeployment;
506372
+ let lastClientToolProtocolError;
505420
506373
  let endpointOverrides = {};
505421
506374
  let currentEndpointName = toolUseContext.getAppState().currentEndpoint;
505422
506375
  if (currentEndpointName) {
@@ -505464,6 +506417,7 @@ async function* queryLoop(params, consumedCommandUuids) {
505464
506417
  queryTracking,
505465
506418
  effortValue: appState.effortValue,
505466
506419
  advisorModel: appState.advisorModel,
506420
+ ...avoidGatewayDeployment && { avoidGatewayDeployment },
505467
506421
  skipCacheWrite,
505468
506422
  agentId: toolUseContext.agentId,
505469
506423
  addNotification: toolUseContext.addNotification,
@@ -505596,6 +506550,111 @@ async function* queryLoop(params, consumedCommandUuids) {
505596
506550
  }
505597
506551
  }
505598
506552
  } catch (innerError) {
506553
+ if (innerError instanceof ClientToolProtocolTurnError) {
506554
+ lastClientToolProtocolError = innerError;
506555
+ const toolStates = streamingToolExecutor?.getSafeStateSnapshot() ?? [];
506556
+ const decision = decideClientToolProtocolRecovery({
506557
+ error: innerError,
506558
+ state: clientToolProtocolRecoveryState,
506559
+ currentModel,
506560
+ fallbackModel,
506561
+ toolStates
506562
+ });
506563
+ logEvent("tengu_client_tool_protocol_recovery", {
506564
+ action: decision.action,
506565
+ code: innerError.code,
506566
+ stop_reason: innerError.observedStopReason ?? "missing",
506567
+ client_tool_count: innerError.clientToolCount,
506568
+ tool_executed: false,
506569
+ request_id: innerError.requestId ?? "unknown",
506570
+ upstream_request_id: innerError.upstreamRequestId ?? "unknown",
506571
+ served_model: innerError.servedModel ?? "unknown",
506572
+ served_deployment: innerError.servedDeployment ?? "unknown"
506573
+ });
506574
+ if (decision.action === "retry_same_model" || decision.action === "retry_heterogeneous") {
506575
+ const tombstones = resetIncompleteStreamAttempt({
506576
+ assistantMessages,
506577
+ toolResults,
506578
+ toolUseBlocks,
506579
+ discardExecutor: streamingToolExecutor ? () => streamingToolExecutor?.discard() : undefined
506580
+ });
506581
+ for (const tombstone of tombstones)
506582
+ yield tombstone;
506583
+ needsFollowUp = false;
506584
+ streamingToolExecutor = useStreamingToolExecution ? new StreamingToolExecutor(toolUseContext.options.tools, canUseTool, toolUseContext) : null;
506585
+ clientToolProtocolRecoveryState = decision.nextState;
506586
+ if (decision.action === "retry_same_model") {
506587
+ avoidGatewayDeployment = decision.avoidDeployment;
506588
+ } else {
506589
+ avoidGatewayDeployment = undefined;
506590
+ currentModel = decision.model;
506591
+ toolUseContext.options.mainLoopModel = decision.model;
506592
+ if (process.env.USER_TYPE === "ant") {
506593
+ messagesForQuery = stripSignatureBlocks(messagesForQuery);
506594
+ }
506595
+ }
506596
+ attemptWithFallback = true;
506597
+ continue;
506598
+ }
506599
+ const sideEffectObserved = decision.action === "fail_side_effect_observed";
506600
+ yield createAssistantAPIErrorMessage({
506601
+ content: sideEffectObserved ? "A client tool may already have started, so Margay stopped automatic replay to avoid a duplicate side effect. Review the last tool result and retry only if it is safe." : "The model and available fallbacks returned an inconsistent client-tool turn. No tool from those responses was executed. Retry with another model or provider to continue safely.",
506602
+ apiError: "tool_use_protocol_error",
506603
+ error: "server_error",
506604
+ errorDetails: innerError.code
506605
+ });
506606
+ streamingToolExecutor?.dispose();
506607
+ return { reason: "model_error", error: innerError };
506608
+ }
506609
+ if (innerError instanceof GatewayAlternateDeploymentUnavailableError && lastClientToolProtocolError) {
506610
+ const decision = decideClientToolProtocolRecovery({
506611
+ error: lastClientToolProtocolError,
506612
+ state: clientToolProtocolRecoveryState,
506613
+ currentModel,
506614
+ fallbackModel,
506615
+ toolStates: streamingToolExecutor?.getSafeStateSnapshot() ?? []
506616
+ });
506617
+ logEvent("tengu_client_tool_protocol_recovery", {
506618
+ action: decision.action,
506619
+ code: innerError.code,
506620
+ stop_reason: lastClientToolProtocolError.observedStopReason ?? "missing",
506621
+ client_tool_count: lastClientToolProtocolError.clientToolCount,
506622
+ tool_executed: false,
506623
+ request_id: lastClientToolProtocolError.requestId ?? "unknown",
506624
+ upstream_request_id: lastClientToolProtocolError.upstreamRequestId ?? "unknown",
506625
+ served_model: lastClientToolProtocolError.servedModel ?? "unknown",
506626
+ served_deployment: lastClientToolProtocolError.servedDeployment ?? "unknown"
506627
+ });
506628
+ if (decision.action === "retry_heterogeneous") {
506629
+ const tombstones = resetIncompleteStreamAttempt({
506630
+ assistantMessages,
506631
+ toolResults,
506632
+ toolUseBlocks,
506633
+ discardExecutor: streamingToolExecutor ? () => streamingToolExecutor?.discard() : undefined
506634
+ });
506635
+ for (const tombstone of tombstones)
506636
+ yield tombstone;
506637
+ needsFollowUp = false;
506638
+ streamingToolExecutor = useStreamingToolExecution ? new StreamingToolExecutor(toolUseContext.options.tools, canUseTool, toolUseContext) : null;
506639
+ clientToolProtocolRecoveryState = decision.nextState;
506640
+ avoidGatewayDeployment = undefined;
506641
+ currentModel = decision.model;
506642
+ toolUseContext.options.mainLoopModel = decision.model;
506643
+ if (process.env.USER_TYPE === "ant") {
506644
+ messagesForQuery = stripSignatureBlocks(messagesForQuery);
506645
+ }
506646
+ attemptWithFallback = true;
506647
+ continue;
506648
+ }
506649
+ yield createAssistantAPIErrorMessage({
506650
+ content: "The model returned an inconsistent client-tool turn and no same-model alternate deployment was available. No tool was executed. Configure a heterogeneous fallback or retry with another model.",
506651
+ apiError: "tool_use_protocol_error",
506652
+ error: "server_error",
506653
+ errorDetails: innerError.code
506654
+ });
506655
+ streamingToolExecutor?.dispose();
506656
+ return { reason: "model_error", error: innerError };
506657
+ }
505599
506658
  if (innerError instanceof IncompleteModelTurnError) {
505600
506659
  const facts = {
505601
506660
  ...innerError.facts,
@@ -506311,6 +507370,8 @@ var init_query3 = __esm(() => {
506311
507370
  init_state();
506312
507371
  init_tokenBudget2();
506313
507372
  init_incompleteStreamRecovery();
507373
+ init_clientToolTurnBuffer();
507374
+ init_gatewayTransport();
506314
507375
  init_classifierFallback();
506315
507376
  init_classifierFallback();
506316
507377
  contextCollapse = feature("CONTEXT_COLLAPSE") ? __toCommonJS(exports_contextCollapse) : null;
@@ -506392,9 +507453,9 @@ function getAnthropicEnvMetadata() {
506392
507453
  };
506393
507454
  }
506394
507455
  function getBuildAgeMinutes() {
506395
- if (!{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.BUILD_TIME)
507456
+ if (!{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.BUILD_TIME)
506396
507457
  return;
506397
- const buildTime = new Date({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.BUILD_TIME).getTime();
507458
+ const buildTime = new Date({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.BUILD_TIME).getTime();
506398
507459
  if (isNaN(buildTime))
506399
507460
  return;
506400
507461
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -507116,251 +508177,6 @@ var init_types9 = __esm(() => {
507116
508177
  ];
507117
508178
  });
507118
508179
 
507119
- // services/api/gatewayTransport.ts
507120
- function getCclGatewayUA(model) {
507121
- return model ? `ccl/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} (${model})` : `ccl/${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}`;
507122
- }
507123
- function parseGatewayContextCapabilityUnavailable(status, responseText) {
507124
- if (status !== 422)
507125
- return;
507126
- let parsed;
507127
- try {
507128
- parsed = JSON.parse(responseText);
507129
- } catch {
507130
- return;
507131
- }
507132
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
507133
- return;
507134
- }
507135
- const error5 = parsed.error;
507136
- if (typeof error5 !== "object" || error5 === null || Array.isArray(error5)) {
507137
- return;
507138
- }
507139
- const fields = error5;
507140
- if (fields.type !== "context_capability_unavailable" || !Number.isSafeInteger(fields.required_context_tokens) || fields.required_context_tokens <= 0) {
507141
- return;
507142
- }
507143
- return new GatewayContextCapabilityUnavailableError(fields.required_context_tokens);
507144
- }
507145
- async function createGatewayStream(options) {
507146
- const { url: url3, key, body, signal, tags, minimumContextTokens } = options;
507147
- let lastError;
507148
- for (let attempt = 0;attempt <= GATEWAY_MAX_RETRIES; attempt++) {
507149
- if (signal?.aborted)
507150
- throw new APIUserAbortError;
507151
- if (attempt > 0) {
507152
- await new Promise((r3) => setTimeout(r3, GATEWAY_RETRY_DELAYS[attempt - 1]));
507153
- }
507154
- try {
507155
- const response = await fetch(url3, {
507156
- method: "POST",
507157
- headers: {
507158
- "Content-Type": "application/json",
507159
- Authorization: `Bearer ${key}`,
507160
- "User-Agent": getCclGatewayUA(body.model),
507161
- ...tags ? { "x-litellm-tags": tags } : {},
507162
- ...Number.isSafeInteger(minimumContextTokens) && (minimumContextTokens ?? 0) > 0 ? {
507163
- "X-Margay-Min-Context-Tokens": String(minimumContextTokens)
507164
- } : {}
507165
- },
507166
- body: JSON.stringify({ ...body, stream: true }),
507167
- signal
507168
- });
507169
- if (response.status === 429 || response.status >= 500) {
507170
- await response.body?.cancel().catch(() => {});
507171
- lastError = response.status >= 500 ? new GatewayUpstreamUnavailableError(response.status) : new Error(`Gateway ${response.status}`);
507172
- continue;
507173
- }
507174
- if (!response.ok) {
507175
- const errorText = await response.text().catch(() => "");
507176
- const contextCapabilityError = parseGatewayContextCapabilityUnavailable(response.status, errorText);
507177
- if (contextCapabilityError)
507178
- throw contextCapabilityError;
507179
- throw new GatewayNonRetryableError(`Gateway ${response.status}: ${errorText}`);
507180
- }
507181
- return {
507182
- stream: new GatewayStream(response, signal),
507183
- response
507184
- };
507185
- } catch (e3) {
507186
- if (signal?.aborted)
507187
- throw new APIUserAbortError;
507188
- if (e3 instanceof GatewayNonRetryableError)
507189
- throw e3;
507190
- lastError = e3;
507191
- if (attempt === GATEWAY_MAX_RETRIES)
507192
- throw lastError;
507193
- }
507194
- }
507195
- throw lastError;
507196
- }
507197
- var GATEWAY_MAX_RETRIES = 2, GATEWAY_RETRY_DELAYS, GatewayNonRetryableError, GatewayContextCapabilityUnavailableError, GatewayUpstreamUnavailableError, GatewayStreamProtocolError, GatewayStream;
507198
- var init_gatewayTransport = __esm(() => {
507199
- init_sdk();
507200
- GATEWAY_RETRY_DELAYS = [1000, 3000];
507201
- GatewayNonRetryableError = class GatewayNonRetryableError extends Error {
507202
- constructor(message) {
507203
- super(message);
507204
- this.name = "GatewayNonRetryableError";
507205
- }
507206
- };
507207
- GatewayContextCapabilityUnavailableError = class GatewayContextCapabilityUnavailableError extends GatewayNonRetryableError {
507208
- code = "context_capability_unavailable";
507209
- requiredContextTokens;
507210
- constructor(requiredContextTokens) {
507211
- super("Gateway has no configured deployment with sufficient context capacity");
507212
- this.name = "GatewayContextCapabilityUnavailableError";
507213
- this.requiredContextTokens = requiredContextTokens;
507214
- }
507215
- };
507216
- GatewayUpstreamUnavailableError = class GatewayUpstreamUnavailableError extends Error {
507217
- code = "gateway_upstream_unavailable";
507218
- status;
507219
- constructor(status) {
507220
- super(`Gateway upstream unavailable (HTTP ${status})`);
507221
- this.name = "GatewayUpstreamUnavailableError";
507222
- this.status = status;
507223
- }
507224
- };
507225
- GatewayStreamProtocolError = class GatewayStreamProtocolError extends Error {
507226
- code;
507227
- lastEventType;
507228
- partialUsage;
507229
- constructor(code, message, details = {}) {
507230
- super(message);
507231
- this.name = "GatewayStreamProtocolError";
507232
- this.code = code;
507233
- this.lastEventType = details.lastEventType;
507234
- this.partialUsage = details.partialUsage ?? {};
507235
- }
507236
- };
507237
- GatewayStream = class GatewayStream {
507238
- response;
507239
- controller;
507240
- constructor(response, abortSignal) {
507241
- this.response = response;
507242
- this.controller = new AbortController;
507243
- if (abortSignal) {
507244
- abortSignal.addEventListener("abort", () => this.controller.abort(), { once: true });
507245
- }
507246
- }
507247
- async* [Symbol.asyncIterator]() {
507248
- const reader = this.response.body.getReader();
507249
- const decoder = new TextDecoder;
507250
- let buffer = "";
507251
- let yieldedAny = false;
507252
- let rawSnippet = "";
507253
- let terminalComplete = false;
507254
- let lastEventType;
507255
- const partialUsage = {};
507256
- const protocolError = (code, message) => new GatewayStreamProtocolError(code, message, {
507257
- lastEventType,
507258
- partialUsage: { ...partialUsage }
507259
- });
507260
- const parseLine = (line) => {
507261
- const trimmed = line.replace(/\r$/, "");
507262
- if (!trimmed.startsWith("data:"))
507263
- return null;
507264
- const data = trimmed.slice(5).trim();
507265
- if (!data)
507266
- return null;
507267
- if (data === "[DONE]")
507268
- return "done";
507269
- let event;
507270
- try {
507271
- event = JSON.parse(data);
507272
- } catch {
507273
- return null;
507274
- }
507275
- const typed = event;
507276
- const type = typed.type;
507277
- if (type === "ping") {
507278
- yieldedAny = true;
507279
- return null;
507280
- }
507281
- yieldedAny = true;
507282
- if (type)
507283
- lastEventType = type;
507284
- const usage = type === "message_start" ? typed.message?.usage : typed.usage;
507285
- if (usage) {
507286
- for (const key of ["input_tokens", "output_tokens", "cache_read_input_tokens", "cache_creation_input_tokens"]) {
507287
- if (typeof usage[key] === "number")
507288
- partialUsage[key] = usage[key];
507289
- }
507290
- }
507291
- if (type === "error") {
507292
- const incomplete = typed.margay?.code === "incomplete_upstream_stream";
507293
- throw protocolError(incomplete ? "incomplete_stream" : "upstream_stream_error", incomplete ? "Gateway upstream stream ended before message_stop" : "Gateway emitted a stream error event");
507294
- }
507295
- if (type === "message_stop")
507296
- terminalComplete = true;
507297
- return event;
507298
- };
507299
- const onAbort = () => {
507300
- process.stderr.write(`[ccl-trace] {"target":"gateway-stream-abort","action":"cancel-pending-read"}
507301
- `);
507302
- reader.cancel().catch(() => {});
507303
- };
507304
- if (this.controller.signal.aborted)
507305
- onAbort();
507306
- else
507307
- this.controller.signal.addEventListener("abort", onAbort, { once: true });
507308
- try {
507309
- while (true) {
507310
- if (this.controller.signal.aborted) {
507311
- return;
507312
- }
507313
- const { done, value } = await reader.read();
507314
- if (done) {
507315
- if (this.controller.signal.aborted)
507316
- return;
507317
- break;
507318
- }
507319
- const chunk = decoder.decode(value, { stream: true });
507320
- if (rawSnippet.length < 500)
507321
- rawSnippet += chunk.slice(0, 500 - rawSnippet.length);
507322
- buffer += chunk;
507323
- const lines = buffer.split(`
507324
- `);
507325
- buffer = lines.pop() ?? "";
507326
- for (const line of lines) {
507327
- const parsed = parseLine(line);
507328
- if (parsed === "done") {
507329
- if (!terminalComplete)
507330
- throw protocolError("incomplete_stream", "Gateway stream sent [DONE] before message_stop");
507331
- return;
507332
- }
507333
- if (parsed)
507334
- yield parsed;
507335
- }
507336
- }
507337
- buffer += decoder.decode();
507338
- if (buffer.trim()) {
507339
- const parsed = parseLine(buffer);
507340
- if (parsed === "done") {
507341
- if (!terminalComplete)
507342
- throw protocolError("incomplete_stream", "Gateway stream sent [DONE] before message_stop");
507343
- } else if (parsed) {
507344
- yield parsed;
507345
- }
507346
- }
507347
- if (!yieldedAny) {
507348
- const ct2 = this.response.headers.get("content-type") ?? "unknown";
507349
- throw new Error(`Gateway stream returned no SSE events (status=${this.response.status}, content-type=${ct2}, body=${rawSnippet.slice(0, 200)})`);
507350
- }
507351
- if (!terminalComplete) {
507352
- throw protocolError("incomplete_stream", "Gateway stream ended before message_stop");
507353
- }
507354
- } finally {
507355
- this.controller.signal.removeEventListener("abort", onAbort);
507356
- try {
507357
- await reader.cancel();
507358
- } catch {}
507359
- }
507360
- }
507361
- };
507362
- });
507363
-
507364
508180
  // services/compact/thirdPartyCompactTransport.ts
507365
508181
  import { randomUUID as randomUUID27 } from "crypto";
507366
508182
  async function resolve3PCompactCredentials(compactApiKey, compactBaseUrl, isNonInteractiveSession) {
@@ -507379,6 +508195,9 @@ async function resolve3PCompactCredentials(compactApiKey, compactBaseUrl, isNonI
507379
508195
  return { apiKey: key, baseUrl };
507380
508196
  }
507381
508197
  async function stream3PCompactDirect(options) {
508198
+ if (options.clientProtocol === "openai_chat_completions") {
508199
+ return streamOpenAICompactDirect(options);
508200
+ }
507382
508201
  const { credentials, model, messages, systemPrompt, maxOutputTokens, signal } = options;
507383
508202
  const apiMessages = messages.map((m4) => ({
507384
508203
  role: m4.message?.role ?? (m4.type === "user" ? "user" : "assistant"),
@@ -507592,6 +508411,46 @@ async function stream3PCompactDirect(options) {
507592
508411
  };
507593
508412
  return assistantMessage;
507594
508413
  }
508414
+ async function streamOpenAICompactDirect(options) {
508415
+ const conversation = options.messages.map((message) => ({
508416
+ role: message.message?.role ?? (message.type === "user" ? "user" : "assistant"),
508417
+ content: message.message?.content
508418
+ }));
508419
+ const result = await runBoundedInference({
508420
+ gateway: {
508421
+ url: options.credentials.baseUrl,
508422
+ key: options.credentials.apiKey
508423
+ },
508424
+ model: options.model,
508425
+ clientProtocol: "openai_chat_completions",
508426
+ systemPrompt: options.systemPrompt,
508427
+ prompt: "",
508428
+ conversation,
508429
+ maxOutputTokens: options.maxOutputTokens,
508430
+ ...options.minimumContextTokens !== undefined ? { minimumContextTokens: options.minimumContextTokens } : {},
508431
+ signal: options.signal
508432
+ });
508433
+ options.setStreamMode?.("responding");
508434
+ options.setResponseLength?.(() => result.text.length);
508435
+ return {
508436
+ type: "assistant",
508437
+ message: {
508438
+ role: "assistant",
508439
+ model: result.servedModel,
508440
+ stop_reason: result.stopReason,
508441
+ content: [{ type: "text", text: result.text }],
508442
+ usage: {
508443
+ input_tokens: result.usage.inputTokens,
508444
+ output_tokens: result.usage.outputTokens,
508445
+ cache_read_input_tokens: result.usage.cacheReadInputTokens,
508446
+ cache_creation_input_tokens: result.usage.cacheCreationInputTokens
508447
+ }
508448
+ },
508449
+ uuid: randomUUID27(),
508450
+ timestamp: new Date().toISOString(),
508451
+ transportIntegrity: "complete"
508452
+ };
508453
+ }
507595
508454
  var init_thirdPartyCompactTransport = __esm(() => {
507596
508455
  init_auth2();
507597
508456
  init_auth2();
@@ -507600,10 +508459,11 @@ var init_thirdPartyCompactTransport = __esm(() => {
507600
508459
  init_proxy();
507601
508460
  init_dynamicContextWindow();
507602
508461
  init_gatewayTransport();
508462
+ init_boundedInferenceTransport();
507603
508463
  });
507604
508464
 
507605
508465
  // services/compact/compactorCandidates.ts
507606
- async function resolveGatewayCompactorCandidates({
508466
+ async function resolveGatewayCompactorRouteCandidates({
507607
508467
  minimumContextTokens,
507608
508468
  resolve: resolve30 = resolveCapabilityModel
507609
508469
  }) {
@@ -507613,10 +508473,17 @@ async function resolveGatewayCompactorCandidates({
507613
508473
  requirements: { min_context_tokens: minimumContextTokens }
507614
508474
  });
507615
508475
  if (!resolution)
507616
- return [...DEFAULT_GATEWAY_COMPACTOR_CANDIDATES];
507617
- const eligible2 = new Set(resolution.eligible_models);
507618
- const candidates = DEFAULT_GATEWAY_COMPACTOR_CANDIDATES.filter((model) => eligible2.has(model));
507619
- return candidates.length > 0 ? candidates : [...DEFAULT_GATEWAY_COMPACTOR_CANDIDATES];
508476
+ return DEFAULT_GATEWAY_COMPACTOR_ROUTES.map((candidate) => ({ ...candidate }));
508477
+ const eligible2 = new Map(resolution.eligible_candidates.map((candidate) => [candidate.model, candidate]));
508478
+ const candidates = DEFAULT_GATEWAY_COMPACTOR_CANDIDATES.flatMap((model) => {
508479
+ const candidate = eligible2.get(model);
508480
+ return candidate ? [{
508481
+ model,
508482
+ ...candidate.canonical_model ? { canonicalModel: candidate.canonical_model } : {},
508483
+ clientProtocol: candidate.client_protocol
508484
+ }] : [];
508485
+ });
508486
+ return candidates.length > 0 ? candidates : DEFAULT_GATEWAY_COMPACTOR_ROUTES.map((candidate) => ({ ...candidate }));
507620
508487
  }
507621
508488
  function candidateForCompactorAttempt(candidates, zeroBasedAttempt) {
507622
508489
  if (!Number.isSafeInteger(zeroBasedAttempt) || zeroBasedAttempt < 0) {
@@ -507637,16 +508504,24 @@ function compactorCandidateFallbackReason(error5) {
507637
508504
  if (error5 instanceof GatewayStreamProtocolError && error5.code === "incomplete_stream") {
507638
508505
  return "incomplete_stream";
507639
508506
  }
508507
+ if (error5 instanceof BoundedInferenceProtocolError && error5.code === "incomplete_stream") {
508508
+ return "incomplete_stream";
508509
+ }
507640
508510
  return;
507641
508511
  }
507642
- var DEFAULT_GATEWAY_COMPACTOR_CANDIDATES;
508512
+ var DEFAULT_GATEWAY_COMPACTOR_CANDIDATES, DEFAULT_GATEWAY_COMPACTOR_ROUTES;
507643
508513
  var init_compactorCandidates = __esm(() => {
507644
508514
  init_capabilityResolver();
507645
508515
  init_gatewayTransport();
508516
+ init_boundedInferenceTransport();
507646
508517
  DEFAULT_GATEWAY_COMPACTOR_CANDIDATES = [
507647
508518
  "deepseek-v4-flash",
507648
508519
  "deepseek-v4-pro"
507649
508520
  ];
508521
+ DEFAULT_GATEWAY_COMPACTOR_ROUTES = DEFAULT_GATEWAY_COMPACTOR_CANDIDATES.map((model) => ({
508522
+ model,
508523
+ clientProtocol: "anthropic_messages"
508524
+ }));
507650
508525
  });
507651
508526
 
507652
508527
  // services/internalLogging.ts
@@ -507710,11 +508585,21 @@ function getCompactProviderConfig() {
507710
508585
  const apiKey = process.env.CCL_COMPACT_API_KEY;
507711
508586
  const baseUrl = process.env.CCL_COMPACT_BASE_URL;
507712
508587
  const model = process.env.CCL_COMPACT_MODEL;
507713
- if (!apiKey && !baseUrl && !model) {
508588
+ const protocol = process.env.CCL_COMPACT_PROTOCOL;
508589
+ if (!apiKey && !baseUrl && !model && !protocol) {
507714
508590
  return null;
507715
508591
  }
508592
+ if (protocol !== undefined && protocol !== "anthropic_messages" && protocol !== "openai_chat_completions") {
508593
+ throw new Error("CCL_COMPACT_PROTOCOL must be anthropic_messages or openai_chat_completions");
508594
+ }
507716
508595
  const isFirstParty = isAnthropicFirstPartyHost(baseUrl ?? process.env.ANTHROPIC_BASE_URL);
507717
- return { apiKey, baseUrl, model, isFirstParty };
508596
+ return {
508597
+ apiKey,
508598
+ baseUrl,
508599
+ model,
508600
+ clientProtocol: protocol ?? "anthropic_messages",
508601
+ isFirstParty
508602
+ };
507718
508603
  }
507719
508604
  var init_compactProvider = __esm(() => {
507720
508605
  init_providers();
@@ -508836,10 +509721,10 @@ async function streamCompactSummary({
508836
509721
  const { getGatewayConfig: getGatewayConfig2 } = await Promise.resolve().then(() => (init_providers(), exports_providers));
508837
509722
  const gateway = getGatewayConfig2();
508838
509723
  if (gateway) {
508839
- gatewayCompactorCandidates = await resolveGatewayCompactorCandidates({
509724
+ gatewayCompactorCandidates = await resolveGatewayCompactorRouteCandidates({
508840
509725
  minimumContextTokens: preCompactTokenCount
508841
509726
  });
508842
- compactModel = gatewayCompactorCandidates[0] ?? "deepseek-v4-flash";
509727
+ compactModel = gatewayCompactorCandidates[0]?.model ?? "deepseek-v4-flash";
508843
509728
  compactBaseUrl = gateway.url;
508844
509729
  compactApiKey = gateway.key;
508845
509730
  compactIsFirstParty = false;
@@ -508917,7 +509802,8 @@ async function streamCompactSummary({
508917
509802
  const retryEnabled = getFeatureValue_CACHED_MAY_BE_STALE("tengu_compact_streaming_retry", false);
508918
509803
  const maxAttempts = gatewayCompactorCandidates?.length ?? Math.max(retryEnabled ? MAX_COMPACT_STREAMING_RETRIES : 1, 2);
508919
509804
  for (let attempt = 1;attempt <= maxAttempts; attempt++) {
508920
- const activeCompactModel = gatewayCompactorCandidates ? candidateForCompactorAttempt(gatewayCompactorCandidates, attempt - 1) : compactModel;
509805
+ const activeCompactCandidate = gatewayCompactorCandidates ? candidateForCompactorAttempt(gatewayCompactorCandidates, attempt - 1) : undefined;
509806
+ const activeCompactModel = activeCompactCandidate?.model ?? compactModel;
508921
509807
  if (!activeCompactModel)
508922
509808
  break;
508923
509809
  let hasStartedStreaming = false;
@@ -508949,6 +509835,7 @@ async function streamCompactSummary({
508949
509835
  compactResponse = await stream3PCompactDirect({
508950
509836
  credentials: creds,
508951
509837
  model: activeCompactModel,
509838
+ clientProtocol: activeCompactCandidate?.clientProtocol ?? compactProvider?.clientProtocol ?? "anthropic_messages",
508952
509839
  messages: normalizedMessages,
508953
509840
  systemPrompt: compactSystemPrompt,
508954
509841
  maxOutputTokens: Math.min(COMPACT_MAX_OUTPUT_TOKENS, getMaxOutputTokensForModel(activeCompactModel)),
@@ -520196,6 +521083,7 @@ __export(exports_messages4, {
520196
521083
  prepareUserContent: () => prepareUserContent,
520197
521084
  normalizeMessagesForAPI: () => normalizeMessagesForAPI,
520198
521085
  normalizeMessages: () => normalizeMessages,
521086
+ normalizeContentFromAPIWithStatus: () => normalizeContentFromAPIWithStatus,
520199
521087
  normalizeContentFromAPI: () => normalizeContentFromAPI,
520200
521088
  normalizeAttachmentForAPI: () => normalizeAttachmentForAPI,
520201
521089
  mergeUserMessagesAndToolResults: () => mergeUserMessagesAndToolResults,
@@ -521667,30 +522555,41 @@ function mergeUserContentBlocks(a2, b3) {
521667
522555
  }
521668
522556
  return [...a2.slice(0, -1), smooshed, ...toolResults];
521669
522557
  }
521670
- function normalizeContentFromAPI(contentBlocks, tools, agentId) {
522558
+ function normalizeContentFromAPIWithStatus(contentBlocks, tools, agentId) {
521671
522559
  if (!contentBlocks) {
521672
- return [];
522560
+ return { content: [], clientToolInputs: [] };
521673
522561
  }
521674
- return contentBlocks.map((contentBlock) => {
522562
+ const clientToolInputs = [];
522563
+ const content = contentBlocks.map((contentBlock) => {
521675
522564
  switch (contentBlock.type) {
521676
522565
  case "tool_use": {
521677
522566
  if (typeof contentBlock.input !== "string" && !isObject3(contentBlock.input)) {
521678
522567
  throw new Error("Tool use input must be a string or object");
521679
522568
  }
521680
522569
  let normalizedInput;
522570
+ let status;
521681
522571
  if (typeof contentBlock.input === "string") {
521682
- const parsed = safeParseJSON(contentBlock.input);
521683
- if (parsed === null && contentBlock.input.length > 0) {
522572
+ if (contentBlock.input.length === 0) {
522573
+ status = "placeholder";
522574
+ normalizedInput = {};
522575
+ } else {
522576
+ const parsed = safeParseJSON(contentBlock.input);
522577
+ if (parsed === null) {
522578
+ status = "invalid_or_incomplete";
522579
+ normalizedInput = INVALID_TOOL_INPUT_PLACEHOLDER;
522580
+ } else {
522581
+ status = "valid";
522582
+ normalizedInput = parsed;
522583
+ }
522584
+ }
522585
+ if (status === "invalid_or_incomplete") {
521684
522586
  logEvent("tengu_tool_input_json_parse_fail", {
521685
522587
  toolName: sanitizeToolNameForAnalytics(contentBlock.name),
521686
522588
  inputLen: contentBlock.input.length
521687
522589
  });
521688
- if (process.env.USER_TYPE === "ant") {
521689
- logForDebugging(`tool input JSON parse fail: ${contentBlock.input.slice(0, 200)}`, { level: "warn" });
521690
- }
521691
522590
  }
521692
- normalizedInput = parsed ?? {};
521693
522591
  } else {
522592
+ status = "valid";
521694
522593
  normalizedInput = contentBlock.input;
521695
522594
  }
521696
522595
  if (typeof normalizedInput === "object" && normalizedInput !== null) {
@@ -521703,6 +522602,7 @@ function normalizeContentFromAPI(contentBlocks, tools, agentId) {
521703
522602
  }
521704
522603
  }
521705
522604
  }
522605
+ clientToolInputs.push({ id: contentBlock.id, status });
521706
522606
  return {
521707
522607
  ...contentBlock,
521708
522608
  input: normalizedInput
@@ -521730,6 +522630,10 @@ function normalizeContentFromAPI(contentBlocks, tools, agentId) {
521730
522630
  }
521731
522631
  }
521732
522632
  });
522633
+ return { content, clientToolInputs };
522634
+ }
522635
+ function normalizeContentFromAPI(contentBlocks, tools, agentId) {
522636
+ return normalizeContentFromAPIWithStatus(contentBlocks, tools, agentId).content;
521733
522637
  }
521734
522638
  function isEmptyMessageText(text) {
521735
522639
  return stripPromptXMLTags(text).trim() === "" || text.trim() === NO_CONTENT_MESSAGE;
@@ -523644,7 +524548,7 @@ Note: The user's next message may contain a correction or preference. Pay close
523644
524548
  `, PLAN_REJECTION_PREFIX = `The agent proposed a plan that was rejected by the user. The user chose to stay in plan mode rather than proceed with implementation.
523645
524549
 
523646
524550
  Rejected plan:
523647
- `, DENIAL_WORKAROUND_GUIDANCE, NO_RESPONSE_REQUESTED = "No response requested.", SYNTHETIC_TOOL_RESULT_PLACEHOLDER = "[Tool result missing due to internal error]", AUTO_MODE_REJECTION_PREFIX = "Permission for this action has been denied. Reason: ", SYNTHETIC_MODEL = "<synthetic>", SYNTHETIC_MESSAGES, EMPTY_LOOKUPS, EMPTY_STRING_SET, STRIPPED_TAGS_RE, PLAN_PHASE4_CONTROL = `### Phase 4: Final Plan
524551
+ `, DENIAL_WORKAROUND_GUIDANCE, NO_RESPONSE_REQUESTED = "No response requested.", SYNTHETIC_TOOL_RESULT_PLACEHOLDER = "[Tool result missing due to internal error]", AUTO_MODE_REJECTION_PREFIX = "Permission for this action has been denied. Reason: ", SYNTHETIC_MODEL = "<synthetic>", SYNTHETIC_MESSAGES, EMPTY_LOOKUPS, EMPTY_STRING_SET, INVALID_TOOL_INPUT_PLACEHOLDER = "[invalid or incomplete tool input omitted]", STRIPPED_TAGS_RE, PLAN_PHASE4_CONTROL = `### Phase 4: Final Plan
523648
524552
  Goal: Write your final plan to the plan file (the only file you can edit).
523649
524553
  - Begin with a **Context** section: explain why this change is being made — the problem or need it addresses, what prompted it, and the intended outcome
523650
524554
  - Include only your recommended approach, not all alternatives
@@ -529429,7 +530333,7 @@ async function getMcpHeadersFromHelper(serverName, config) {
529429
530333
  if ("scope" in config && isMcpServerFromProjectOrLocalSettings(config) && !getIsNonInteractiveSession()) {
529430
530334
  const hasTrust = checkHasTrustDialogAccepted();
529431
530335
  if (!hasTrust) {
529432
- const error5 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.FEEDBACK_CHANNEL}.`);
530336
+ const error5 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.FEEDBACK_CHANNEL}.`);
529433
530337
  logAntError("MCP headersHelper invoked before trust check", error5);
529434
530338
  logEvent("tengu_mcp_headersHelper_missing_trust", {});
529435
530339
  return null;
@@ -530960,7 +531864,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
530960
531864
  const client4 = new Client({
530961
531865
  name: "claude-code",
530962
531866
  title: "CCL",
530963
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION ?? "unknown",
531867
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION ?? "unknown",
530964
531868
  description: "Anthropic's agentic coding tool",
530965
531869
  websiteUrl: PRODUCT_URL
530966
531870
  }, {
@@ -531311,7 +532215,7 @@ var init_client9 = __esm(() => {
531311
532215
  const client4 = new Client({
531312
532216
  name: "claude-code",
531313
532217
  title: "CCL",
531314
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION ?? "unknown",
532218
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION ?? "unknown",
531315
532219
  description: "Anthropic's agentic coding tool",
531316
532220
  websiteUrl: PRODUCT_URL
531317
532221
  }, {
@@ -533659,6 +534563,60 @@ ${deferredToolList}
533659
534563
  let isGatewayChannel = false;
533660
534564
  let streamOpenToolUseCount = 0;
533661
534565
  let streamOpenContentBlockCount = 0;
534566
+ const clientToolTurnBuffer = new ClientToolTurnBuffer;
534567
+ let clientToolTurnFinalized = false;
534568
+ let clientToolStreamBuffering = false;
534569
+ const bufferedClientToolStreamEvents = [];
534570
+ let releasedClientToolMessages = [];
534571
+ const responseHeader = (name2) => {
534572
+ const value = streamResponse?.headers.get(name2);
534573
+ return value?.trim() || undefined;
534574
+ };
534575
+ const createClientToolProtocolTurnError = (decision) => new ClientToolProtocolTurnError({
534576
+ code: decision.code,
534577
+ observedStopReason: stopReason,
534578
+ clientToolCount: decision.clientToolCount,
534579
+ requestId: responseHeader("X-Margay-Request-Id") ?? streamRequestId ?? undefined,
534580
+ upstreamRequestId: responseHeader("X-Margay-Upstream-Request-Id") ?? streamRequestId ?? undefined,
534581
+ servedModel: responseHeader("X-Margay-Served-Model"),
534582
+ servedDeployment: responseHeader("X-Margay-Served-Deployment"),
534583
+ partialUsage: usage
534584
+ });
534585
+ const createCompleteResponseMessage = (result, requestId) => {
534586
+ const normalized = normalizeContentFromAPIWithStatus(result.content, tools, options.agentId);
534587
+ const message = {
534588
+ message: {
534589
+ ...result,
534590
+ content: normalized.content
534591
+ },
534592
+ requestId,
534593
+ type: "assistant",
534594
+ uuid: randomUUID33(),
534595
+ timestamp: new Date().toISOString(),
534596
+ ...process.env.USER_TYPE === "ant" && research !== undefined && {
534597
+ research
534598
+ },
534599
+ ...advisorModel && {
534600
+ advisorModel
534601
+ }
534602
+ };
534603
+ if (normalized.clientToolInputs.length === 0)
534604
+ return message;
534605
+ const buffer = new ClientToolTurnBuffer;
534606
+ buffer.add(message, normalized.clientToolInputs);
534607
+ const decision = buffer.finalize(result.stop_reason);
534608
+ if (decision.action === "discard") {
534609
+ throw new ClientToolProtocolTurnError({
534610
+ code: decision.code,
534611
+ observedStopReason: result.stop_reason,
534612
+ clientToolCount: decision.clientToolCount,
534613
+ requestId,
534614
+ upstreamRequestId: requestId,
534615
+ partialUsage: result.usage
534616
+ });
534617
+ }
534618
+ return message;
534619
+ };
533662
534620
  const createIncompleteModelTurnError = ({
533663
534621
  partialUsage = usage,
533664
534622
  lastEventType
@@ -533782,6 +534740,7 @@ ${deferredToolList}
533782
534740
  body: gatewayBody,
533783
534741
  signal: gwSignal,
533784
534742
  tags: traceTags(gwSpan.trace_id, gwSpan.span_id),
534743
+ avoidDeployment: options.avoidGatewayDeployment,
533785
534744
  minimumContextTokens: tokenCountWithEstimation(messagesForAPI) + (typeof gatewayBody.max_tokens === "number" ? gatewayBody.max_tokens : 0)
533786
534745
  });
533787
534746
  clearTimeout(gwTimeout);
@@ -533790,6 +534749,9 @@ ${deferredToolList}
533790
534749
  } catch (gwErr) {
533791
534750
  clearTimeout(gwTimeout);
533792
534751
  logSpan({ ...gwSpan, latency_ms: Date.now() - gwSpanStart, status: "error" });
534752
+ if (gwErr instanceof GatewayAlternateDeploymentUnavailableError) {
534753
+ throw gwErr;
534754
+ }
533793
534755
  const reason = gwErr?.message ?? "unknown error";
533794
534756
  routeGatewayError(gwErr, signal, gatewayForChannel.url, reason, { markFailure: markFailure2, markDown: markDown2 });
533795
534757
  if (isAbortError5(gwErr, signal))
@@ -533942,6 +534904,7 @@ ${deferredToolList}
533942
534904
  streamOpenContentBlockCount++;
533943
534905
  switch (part.content_block.type) {
533944
534906
  case "tool_use":
534907
+ clientToolStreamBuffering = true;
533945
534908
  contentBlocks[part.index] = {
533946
534909
  ...part.content_block,
533947
534910
  input: ""
@@ -534099,10 +535062,11 @@ ${deferredToolList}
534099
535062
  });
534100
535063
  throw new Error("Message not found");
534101
535064
  }
535065
+ const normalized = normalizeContentFromAPIWithStatus([contentBlock], tools, options.agentId);
534102
535066
  const m4 = {
534103
535067
  message: {
534104
535068
  ...partialMessage,
534105
- content: normalizeContentFromAPI([contentBlock], tools, options.agentId)
535069
+ content: normalized.content
534106
535070
  },
534107
535071
  requestId: streamRequestId ?? undefined,
534108
535072
  type: "assistant",
@@ -534111,6 +535075,10 @@ ${deferredToolList}
534111
535075
  ...process.env.USER_TYPE === "ant" && research !== undefined && { research },
534112
535076
  ...advisorModel && { advisorModel }
534113
535077
  };
535078
+ if (normalized.clientToolInputs.length > 0) {
535079
+ clientToolTurnBuffer.add(m4, normalized.clientToolInputs);
535080
+ break;
535081
+ }
534114
535082
  newMessages.push(m4);
534115
535083
  yield m4;
534116
535084
  break;
@@ -534141,7 +535109,7 @@ ${deferredToolList}
534141
535109
  if (refusalMessage) {
534142
535110
  yield refusalMessage;
534143
535111
  }
534144
- if (stopReason === "max_tokens") {
535112
+ if (stopReason === "max_tokens" && !clientToolTurnBuffer.hasClientToolUse) {
534145
535113
  logEvent("tengu_max_tokens_reached", {
534146
535114
  max_tokens: maxOutputTokens
534147
535115
  });
@@ -534151,7 +535119,7 @@ ${deferredToolList}
534151
535119
  error: "max_output_tokens"
534152
535120
  });
534153
535121
  }
534154
- if (stopReason === "model_context_window_exceeded") {
535122
+ if (stopReason === "model_context_window_exceeded" && !clientToolTurnBuffer.hasClientToolUse) {
534155
535123
  logEvent("tengu_context_window_exceeded", {
534156
535124
  max_tokens: maxOutputTokens,
534157
535125
  output_tokens: usage.output_tokens
@@ -534164,8 +535132,25 @@ ${deferredToolList}
534164
535132
  }
534165
535133
  break;
534166
535134
  }
534167
- case "message_stop":
535135
+ case "message_stop": {
535136
+ if (clientToolTurnBuffer.hasClientToolUse && !clientToolTurnFinalized) {
535137
+ clientToolTurnFinalized = true;
535138
+ const decision = clientToolTurnBuffer.finalize(stopReason);
535139
+ if (decision.action === "discard") {
535140
+ throw createClientToolProtocolTurnError(decision);
535141
+ }
535142
+ for (const buffered of decision.messages) {
535143
+ buffered.message.usage = usage;
535144
+ buffered.message.stop_reason = stopReason;
535145
+ if (process.env.USER_TYPE === "ant" && research !== undefined) {
535146
+ buffered.research = research;
535147
+ }
535148
+ newMessages.push(buffered);
535149
+ releasedClientToolMessages.push(buffered);
535150
+ }
535151
+ }
534168
535152
  break;
535153
+ }
534169
535154
  }
534170
535155
  let yieldPart = part;
534171
535156
  if (part.type === "content_block_delta" && "delta" in part && part.delta.type === "text_delta") {
@@ -534191,15 +535176,38 @@ ${deferredToolList}
534191
535176
  }
534192
535177
  }
534193
535178
  }
534194
- if (yieldPart) {
534195
- yield {
534196
- type: "stream_event",
534197
- event: yieldPart,
534198
- ...part.type === "message_start" ? { ttftMs } : undefined
534199
- };
535179
+ const streamEvent = yieldPart ? {
535180
+ type: "stream_event",
535181
+ event: yieldPart,
535182
+ ...part.type === "message_start" ? { ttftMs } : undefined
535183
+ } : undefined;
535184
+ if (clientToolStreamBuffering && part.type !== "message_stop") {
535185
+ if (streamEvent)
535186
+ bufferedClientToolStreamEvents.push(streamEvent);
535187
+ continue;
535188
+ }
535189
+ if (clientToolStreamBuffering && part.type === "message_stop") {
535190
+ for (const bufferedEvent of bufferedClientToolStreamEvents) {
535191
+ yield bufferedEvent;
535192
+ }
535193
+ for (const bufferedMessage of releasedClientToolMessages) {
535194
+ yield bufferedMessage;
535195
+ }
535196
+ bufferedClientToolStreamEvents.length = 0;
535197
+ releasedClientToolMessages = [];
535198
+ clientToolStreamBuffering = false;
535199
+ }
535200
+ if (streamEvent) {
535201
+ yield streamEvent;
534200
535202
  }
534201
535203
  }
534202
535204
  clearStreamIdleTimers();
535205
+ if (clientToolTurnBuffer.hasClientToolUse && !clientToolTurnFinalized) {
535206
+ throw createClientToolProtocolTurnError({
535207
+ code: "client_tool_turn_incomplete",
535208
+ clientToolCount: clientToolTurnBuffer.clientToolCount
535209
+ });
535210
+ }
534203
535211
  if (streamIdleAborted) {
534204
535212
  const exitDelayMs = streamWatchdogFiredAt !== null ? Math.round(performance.now() - streamWatchdogFiredAt) : -1;
534205
535213
  logForDiagnosticsNoPII("info", "cli_stream_loop_exited_after_watchdog_clean");
@@ -534241,6 +535249,9 @@ ${deferredToolList}
534241
535249
  }
534242
535250
  } catch (streamingError) {
534243
535251
  clearStreamIdleTimers();
535252
+ if (streamingError instanceof ClientToolProtocolTurnError) {
535253
+ throw streamingError;
535254
+ }
534244
535255
  if (streamIdleAborted && streamWatchdogFiredAt !== null) {
534245
535256
  const exitDelayMs = Math.round(performance.now() - streamWatchdogFiredAt);
534246
535257
  logForDiagnosticsNoPII("info", "cli_stream_loop_exited_after_watchdog_error");
@@ -534326,22 +535337,7 @@ ${deferredToolList}
534326
535337
  attemptNumber = attempt;
534327
535338
  maxOutputTokens = tokens;
534328
535339
  }, (params) => captureAPIRequest(params, options.querySource), streamRequestId);
534329
- const m4 = {
534330
- message: {
534331
- ...result,
534332
- content: normalizeContentFromAPI(result.content, tools, options.agentId)
534333
- },
534334
- requestId: streamRequestId ?? undefined,
534335
- type: "assistant",
534336
- uuid: randomUUID33(),
534337
- timestamp: new Date().toISOString(),
534338
- ...process.env.USER_TYPE === "ant" && research !== undefined && {
534339
- research
534340
- },
534341
- ...advisorModel && {
534342
- advisorModel
534343
- }
534344
- };
535340
+ const m4 = createCompleteResponseMessage(result, streamRequestId ?? undefined);
534345
535341
  newMessages.push(m4);
534346
535342
  fallbackMessage = m4;
534347
535343
  yield m4;
@@ -534349,6 +535345,12 @@ ${deferredToolList}
534349
535345
  clearStreamIdleTimers();
534350
535346
  }
534351
535347
  } catch (errorFromRetry) {
535348
+ if (errorFromRetry instanceof ClientToolProtocolTurnError) {
535349
+ throw errorFromRetry;
535350
+ }
535351
+ const alternateDeploymentError = errorFromRetry instanceof GatewayAlternateDeploymentUnavailableError ? errorFromRetry : errorFromRetry instanceof CannotRetryError && errorFromRetry.originalError instanceof GatewayAlternateDeploymentUnavailableError ? errorFromRetry.originalError : undefined;
535352
+ if (alternateDeploymentError)
535353
+ throw alternateDeploymentError;
534352
535354
  if (errorFromRetry instanceof IncompleteModelTurnError) {
534353
535355
  throw errorFromRetry;
534354
535356
  }
@@ -534395,18 +535397,7 @@ ${deferredToolList}
534395
535397
  attemptNumber = attempt;
534396
535398
  maxOutputTokens = tokens;
534397
535399
  }, (params) => captureAPIRequest(params, options.querySource), failedRequestId);
534398
- const m4 = {
534399
- message: {
534400
- ...result,
534401
- content: normalizeContentFromAPI(result.content, tools, options.agentId)
534402
- },
534403
- requestId: streamRequestId ?? undefined,
534404
- type: "assistant",
534405
- uuid: randomUUID33(),
534406
- timestamp: new Date().toISOString(),
534407
- ...process.env.USER_TYPE === "ant" && research !== undefined && { research },
534408
- ...advisorModel && { advisorModel }
534409
- };
535400
+ const m4 = createCompleteResponseMessage(result, streamRequestId ?? undefined);
534410
535401
  newMessages.push(m4);
534411
535402
  fallbackMessage = m4;
534412
535403
  yield m4;
@@ -534928,6 +535919,7 @@ var init_claude = __esm(() => {
534928
535919
  init_apiMicrocompact();
534929
535920
  init_gatewayTransport();
534930
535921
  init_incompleteStreamRecovery();
535922
+ init_clientToolTurnBuffer();
534931
535923
  init_error();
534932
535924
  init_state();
534933
535925
  init_betas();
@@ -536316,7 +537308,7 @@ async function hasPermissionsToUseToolInner(tool, input, context2) {
536316
537308
  if (toolPermissionResult?.behavior === "deny") {
536317
537309
  return toolPermissionResult;
536318
537310
  }
536319
- if (!shouldBypassPermissions && tool.requiresUserInteraction?.() && toolPermissionResult?.behavior === "ask") {
537311
+ if (tool.validateInteractionCompletion !== undefined && toolPermissionResult?.behavior === "ask") {
536320
537312
  return toolPermissionResult;
536321
537313
  }
536322
537314
  if (!shouldBypassPermissions && toolPermissionResult?.behavior === "ask" && toolPermissionResult.decisionReason?.type === "rule" && toolPermissionResult.decisionReason.rule.ruleBehavior === "ask") {
@@ -538401,7 +539393,7 @@ async function setupTerminal(theme) {
538401
539393
  return current;
538402
539394
  });
538403
539395
  maybeMarkProjectOnboardingComplete();
538404
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
539396
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
538405
539397
  result += await setupShellCompletion(theme);
538406
539398
  }
538407
539399
  return result;
@@ -542891,7 +543883,7 @@ function Feedback({
542891
543883
  platform: env4.platform,
542892
543884
  gitRepo: envInfo.isGit,
542893
543885
  terminal: env4.terminal,
542894
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
543886
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
542895
543887
  transcript: normalizeMessagesForAPI(messages),
542896
543888
  errors: sanitizedErrors,
542897
543889
  lastApiRequest: getLastAPIRequest(),
@@ -543083,7 +544075,7 @@ function Feedback({
543083
544075
  ", ",
543084
544076
  env4.terminal,
543085
544077
  ", v",
543086
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
544078
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
543087
544079
  ]
543088
544080
  })
543089
544081
  ]
@@ -543189,7 +544181,7 @@ ${sanitizedDescription}
543189
544181
  ` + `**Environment Info**
543190
544182
  ` + `- Platform: ${env4.platform}
543191
544183
  ` + `- Terminal: ${env4.terminal}
543192
- ` + `- Version: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION || "unknown"}
544184
+ ` + `- Version: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION || "unknown"}
543193
544185
  ` + `- Feedback ID: ${feedbackId}
543194
544186
  ` + `
543195
544187
  **Errors**
@@ -543381,7 +544373,7 @@ var init_Feedback = __esm(() => {
543381
544373
  init_TextInput();
543382
544374
  import_react95 = __toESM(require_react(), 1);
543383
544375
  jsx_runtime168 = __toESM(require_jsx_runtime(), 1);
543384
- GITHUB_ISSUES_REPO_URL = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? "https://github.com/anthropics/claude-cli-internal/issues" : "https://github.com/anthropics/claude-code/issues";
544376
+ GITHUB_ISSUES_REPO_URL = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? "https://github.com/anthropics/claude-cli-internal/issues" : "https://github.com/anthropics/claude-code/issues";
543385
544377
  });
543386
544378
 
543387
544379
  // commands/feedback/feedback.tsx
@@ -546384,7 +547376,7 @@ function buildPrimarySection() {
546384
547376
  });
546385
547377
  return [{
546386
547378
  label: "Version",
546387
- value: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
547379
+ value: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
546388
547380
  }, {
546389
547381
  label: "Session name",
546390
547382
  value: nameValue
@@ -549024,7 +550016,7 @@ function Config({
549024
550016
  });
549025
550017
  }
549026
550018
  }] : [],
549027
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? [{
550019
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? [{
549028
550020
  id: "speculationEnabled",
549029
550021
  label: "Speculative execution",
549030
550022
  value: globalConfig.speculationEnabled ?? true,
@@ -550305,7 +551297,7 @@ function Config({
550305
551297
  }
550306
551298
  })
550307
551299
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime183.jsx(ChannelDowngradeDialog, {
550308
- currentVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
551300
+ currentVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
550309
551301
  onChoice: (choice) => {
550310
551302
  setShowSubmenu(null);
550311
551303
  setTabsHidden(false);
@@ -550317,7 +551309,7 @@ function Config({
550317
551309
  autoUpdatesChannel: "stable"
550318
551310
  };
550319
551311
  if (choice === "stay") {
550320
- newSettings.minimumVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
551312
+ newSettings.minimumVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
550321
551313
  }
550322
551314
  updateSettingsForSource("userSettings", newSettings);
550323
551315
  setSettingsData((prev_27) => ({
@@ -558391,7 +559383,7 @@ function HelpV2(t0) {
558391
559383
  let t6;
558392
559384
  if ($3[31] !== tabs) {
558393
559385
  t6 = /* @__PURE__ */ jsx_runtime210.jsx(Tabs, {
558394
- title: `CCL v${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}`,
559386
+ title: `CCL v${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}`,
558395
559387
  color: "professionalBlue",
558396
559388
  defaultTab: "general",
558397
559389
  children: tabs
@@ -578062,7 +579054,7 @@ async function call28(onDone, _context, args) {
578062
579054
  });
578063
579055
  }
578064
579056
  }
578065
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
579057
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
578066
579058
  return /* @__PURE__ */ jsx_runtime249.jsx(PluginSettings, {
578067
579059
  onComplete: onDone,
578068
579060
  args: ["manage"],
@@ -582909,9 +583901,9 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
582909
583901
  return [];
582910
583902
  }
582911
583903
  }
582912
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
583904
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
582913
583905
  if (process.env.USER_TYPE === "ant") {
582914
- const changelog = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION_CHANGELOG;
583906
+ const changelog = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION_CHANGELOG;
582915
583907
  if (changelog) {
582916
583908
  const commits = changelog.trim().split(`
582917
583909
  `).filter(Boolean);
@@ -582936,9 +583928,9 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { USER_TYP
582936
583928
  releaseNotes
582937
583929
  };
582938
583930
  }
582939
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
583931
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
582940
583932
  if (process.env.USER_TYPE === "ant") {
582941
- const changelog = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION_CHANGELOG;
583933
+ const changelog = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION_CHANGELOG;
582942
583934
  if (changelog) {
582943
583935
  const commits = changelog.trim().split(`
582944
583936
  `).filter(Boolean);
@@ -584120,7 +585112,7 @@ function getRecentActivitySync() {
584120
585112
  return cachedActivity;
584121
585113
  }
584122
585114
  function getLogoDisplayData() {
584123
- const version4 = process.env.DEMO_VERSION ?? { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
585115
+ const version4 = process.env.DEMO_VERSION ?? { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
584124
585116
  const serverUrl = getDirectConnectServerUrl();
584125
585117
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
584126
585118
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -584152,7 +585144,7 @@ function formatModelAndBilling(modelName, billingType, availableWidth) {
584152
585144
  }
584153
585145
  function getRecentReleaseNotesSync(maxItems) {
584154
585146
  if (process.env.USER_TYPE === "ant") {
584155
- const changelog2 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION_CHANGELOG;
585147
+ const changelog2 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION_CHANGELOG;
584156
585148
  if (changelog2) {
584157
585149
  const commits = changelog2.trim().split(`
584158
585150
  `).filter(Boolean);
@@ -584898,7 +585890,7 @@ function createRecentActivityFeed(activities) {
584898
585890
  }
584899
585891
  function createWhatsNewFeed(releaseNotes2) {
584900
585892
  const lines = releaseNotes2.map((note) => {
584901
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
585893
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
584902
585894
  const match = note.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);
584903
585895
  if (match) {
584904
585896
  return {
@@ -584911,9 +585903,9 @@ function createWhatsNewFeed(releaseNotes2) {
584911
585903
  text: note
584912
585904
  };
584913
585905
  });
584914
- const emptyMessage = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? "Unable to fetch latest claude-cli-internal commits" : "Check the CCL changelog for updates";
585906
+ const emptyMessage = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? "Unable to fetch latest claude-cli-internal commits" : "Check the CCL changelog for updates";
584915
585907
  return {
584916
- title: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? "What's new [ANT-ONLY: Latest CC commits]" : "What's new",
585908
+ title: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? "What's new [ANT-ONLY: Latest CC commits]" : "What's new",
584917
585909
  lines,
584918
585910
  footer: lines.length > 0 ? "/release-notes for more" : undefined,
584919
585911
  emptyMessage
@@ -585708,7 +586700,7 @@ function LogoV2() {
585708
586700
  if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
585709
586701
  t22 = () => {
585710
586702
  const currentConfig = getGlobalConfig();
585711
- if (currentConfig.lastReleaseNotesSeen === { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
586703
+ if (currentConfig.lastReleaseNotesSeen === { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
585712
586704
  return;
585713
586705
  }
585714
586706
  saveGlobalConfig(_temp329);
@@ -586384,12 +587376,12 @@ function LogoV2() {
586384
587376
  return t41;
586385
587377
  }
586386
587378
  function _temp329(current) {
586387
- if (current.lastReleaseNotesSeen === { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
587379
+ if (current.lastReleaseNotesSeen === { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
586388
587380
  return current;
586389
587381
  }
586390
587382
  return {
586391
587383
  ...current,
586392
- lastReleaseNotesSeen: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
587384
+ lastReleaseNotesSeen: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
586393
587385
  };
586394
587386
  }
586395
587387
  function _temp246(s_0) {
@@ -594290,13 +595282,13 @@ var init_ultraplan = __esm(() => {
594290
595282
  ULTRAPLAN_TIMEOUT_MS = 30 * 60 * 1000;
594291
595283
  _rawPrompt = require_prompt();
594292
595284
  DEFAULT_INSTRUCTIONS = (typeof _rawPrompt === "string" ? _rawPrompt : _rawPrompt.default).trimEnd();
594293
- ULTRAPLAN_INSTRUCTIONS = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && process.env.ULTRAPLAN_PROMPT_FILE ? readFileSync19(process.env.ULTRAPLAN_PROMPT_FILE, "utf8").trimEnd() : DEFAULT_INSTRUCTIONS;
595285
+ ULTRAPLAN_INSTRUCTIONS = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && process.env.ULTRAPLAN_PROMPT_FILE ? readFileSync19(process.env.ULTRAPLAN_PROMPT_FILE, "utf8").trimEnd() : DEFAULT_INSTRUCTIONS;
594294
595286
  ultraplan_default = {
594295
595287
  type: "local-jsx",
594296
595288
  name: "ultraplan",
594297
595289
  description: `~10–30 min · CCL on the web drafts an advanced plan you can edit and approve. See ${CCR_TERMS_URL2}`,
594298
595290
  argumentHint: "<prompt>",
594299
- isEnabled: () => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }).USER_TYPE === "ant",
595291
+ isEnabled: () => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }).USER_TYPE === "ant",
594300
595292
  load: () => Promise.resolve({
594301
595293
  call: call37
594302
595294
  })
@@ -594407,7 +595399,7 @@ function shouldHideTasksFooter(tasks, showSpinnerTree) {
594407
595399
  return false;
594408
595400
  let hasVisibleTask = false;
594409
595401
  for (const t3 of Object.values(tasks)) {
594410
- if (!isBackgroundTask(t3) || { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && isPanelAgentTask(t3)) {
595402
+ if (!isBackgroundTask(t3) || { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && isPanelAgentTask(t3)) {
594411
595403
  continue;
594412
595404
  }
594413
595405
  hasVisibleTask = true;
@@ -600493,8 +601485,8 @@ async function getEnvLessBridgeConfig() {
600493
601485
  }
600494
601486
  async function checkEnvLessBridgeMinVersion() {
600495
601487
  const cfg = await getEnvLessBridgeConfig();
600496
- if (cfg.min_version && lt2({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, cfg.min_version)) {
600497
- return `Your version of CCL (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}) is too old for Remote Control.
601488
+ if (cfg.min_version && lt2({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, cfg.min_version)) {
601489
+ return `Your version of CCL (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}) is too old for Remote Control.
600498
601490
  Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
600499
601491
  }
600500
601492
  return null;
@@ -602869,10 +603861,10 @@ import { execa as execa14 } from "execa";
602869
603861
  import { readFile as readFile51 } from "fs/promises";
602870
603862
  import { join as join139 } from "path";
602871
603863
  function getMarketplaceName() {
602872
- return { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
603864
+ return { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
602873
603865
  }
602874
603866
  function getMarketplaceRepo() {
602875
- return { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_REPO : OFFICIAL_MARKETPLACE_REPO;
603867
+ return { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_REPO : OFFICIAL_MARKETPLACE_REPO;
602876
603868
  }
602877
603869
  function getPluginId() {
602878
603870
  return `thinkback@${getMarketplaceName()}`;
@@ -610625,7 +611617,7 @@ function getToolBuckets() {
610625
611617
  },
610626
611618
  EXECUTION: {
610627
611619
  name: "Execution tools",
610628
- toolNames: new Set([BashTool.name, { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? TungstenTool.name : undefined].filter((n2) => n2 !== undefined))
611620
+ toolNames: new Set([BashTool.name, { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? TungstenTool.name : undefined].filter((n2) => n2 !== undefined))
610629
611621
  },
610630
611622
  MCP: {
610631
611623
  name: "MCP tools",
@@ -616275,7 +617267,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
616275
617267
  smapsRollup,
616276
617268
  platform: process.platform,
616277
617269
  nodeVersion: process.version,
616278
- ccVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
617270
+ ccVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
616279
617271
  };
616280
617272
  }
616281
617273
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -616862,7 +617854,7 @@ var init_bridge_kick = __esm(() => {
616862
617854
  var call61 = async () => {
616863
617855
  return {
616864
617856
  type: "text",
616865
- value: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.BUILD_TIME ? `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} (built ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.BUILD_TIME})` : { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
617857
+ value: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.BUILD_TIME ? `${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} (built ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.BUILD_TIME})` : { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
616866
617858
  };
616867
617859
  }, version4, version_default;
616868
617860
  var init_version = __esm(() => {
@@ -623926,7 +624918,7 @@ function OverviewTab({
623926
624918
  })
623927
624919
  ]
623928
624920
  }),
623929
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && stats.totalSpeculationTimeSavedMs > 0 && /* @__PURE__ */ jsx_runtime367.jsx(ThemedBox_default, {
624921
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && stats.totalSpeculationTimeSavedMs > 0 && /* @__PURE__ */ jsx_runtime367.jsx(ThemedBox_default, {
623930
624922
  flexDirection: "row",
623931
624923
  gap: 4,
623932
624924
  children: /* @__PURE__ */ jsx_runtime367.jsx(ThemedBox_default, {
@@ -624600,7 +625592,7 @@ function renderOverviewToAnsi(stats) {
624600
625592
  const activeDaysVal = `${stats.activeDays}/${stats.totalDays}`;
624601
625593
  const peakHourVal = stats.peakActivityHour !== null ? `${stats.peakActivityHour}:00-${stats.peakActivityHour + 1}:00` : "N/A";
624602
625594
  lines.push(row("Active days", activeDaysVal, "Peak hour", peakHourVal));
624603
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && stats.totalSpeculationTimeSavedMs > 0) {
625595
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && stats.totalSpeculationTimeSavedMs > 0) {
624604
625596
  const label = "Speculation saved:".padEnd(COL1_LABEL_WIDTH);
624605
625597
  lines.push(label + h3(formatDuration(stats.totalSpeculationTimeSavedMs)));
624606
625598
  }
@@ -626384,7 +627376,7 @@ function generateHtmlReport(data, insights) {
626384
627376
  </html>`;
626385
627377
  }
626386
627378
  function buildExportData(data, insights, facets, remoteStats) {
626387
- const version5 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
627379
+ const version5 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
626388
627380
  const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
626389
627381
  const facets_summary = {
626390
627382
  total: facets.size,
@@ -630649,7 +631641,7 @@ var init_sessionStorage = __esm(() => {
630649
631641
  init_settings2();
630650
631642
  init_slowOperations();
630651
631643
  init_uuid();
630652
- VERSION7 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
631644
+ VERSION7 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
630653
631645
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
630654
631646
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
630655
631647
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -631867,7 +632859,7 @@ var init_filesystem = __esm(() => {
631867
632859
  });
631868
632860
  getBundledSkillsRoot = memoize64(function getBundledSkillsRoot2() {
631869
632861
  const nonce = randomBytes19(16).toString("hex");
631870
- return join155(getClaudeTempDir(), "bundled-skills", { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, nonce);
632862
+ return join155(getClaudeTempDir(), "bundled-skills", { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, nonce);
631871
632863
  });
631872
632864
  getResolvedWorkingDirPaths = memoize64(getPathsForPermissionCheck);
631873
632865
  });
@@ -637182,7 +638174,7 @@ function getSimpleDoingTasksSection() {
637182
638174
  ];
637183
638175
  const userHelpSubitems = [
637184
638176
  `/help: Get help with using CCL`,
637185
- `To give feedback, users should ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.ISSUES_EXPLAINER}`
638177
+ `To give feedback, users should ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.ISSUES_EXPLAINER}`
637186
638178
  ];
637187
638179
  const items = [
637188
638180
  `The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.`,
@@ -638496,7 +639488,7 @@ function createBridgeLogger(options) {
638496
639488
  connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
638497
639489
  regenerateQr(connectUrl);
638498
639490
  if (verbose) {
638499
- write(source_default.dim(`Remote Control`) + ` v${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}
639491
+ write(source_default.dim(`Remote Control`) + ` v${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}
638500
639492
  `);
638501
639493
  }
638502
639494
  if (verbose) {
@@ -639469,7 +640461,7 @@ function appendToLog(path21, message) {
639469
640461
  cwd: getFsImplementation().cwd(),
639470
640462
  userType: process.env.USER_TYPE,
639471
640463
  sessionId: getSessionId(),
639472
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
640464
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
639473
640465
  };
639474
640466
  getLogWriter(path21).write(messageWithTimestamp);
639475
640467
  }
@@ -640739,7 +641731,7 @@ Spawn mode for this project:
640739
641731
  const api = createBridgeApiClient({
640740
641732
  baseUrl,
640741
641733
  getAccessToken: getBridgeAccessToken2,
640742
- runnerVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
641734
+ runnerVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
640743
641735
  onDebug: logForDebugging,
640744
641736
  onAuth401: handleOAuth401Error2,
640745
641737
  getTrustedDeviceToken
@@ -640977,7 +641969,7 @@ async function runBridgeHeadless(opts, signal) {
640977
641969
  const api = createBridgeApiClient({
640978
641970
  baseUrl,
640979
641971
  getAccessToken: opts.getAccessToken,
640980
- runnerVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
641972
+ runnerVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
640981
641973
  onDebug: log2,
640982
641974
  onAuth401: opts.onAuth401,
640983
641975
  getTrustedDeviceToken
@@ -645337,6 +646329,15 @@ var init_useLogMessages = __esm(() => {
645337
646329
  });
645338
646330
 
645339
646331
  // bridge/bridgePermissionCallbacks.ts
646332
+ function dispatchBridgePermissionResponse(pending2, requestId, response) {
646333
+ const handler = pending2.get(requestId);
646334
+ if (!handler)
646335
+ return false;
646336
+ const consumed = handler(response) !== false;
646337
+ if (consumed)
646338
+ pending2.delete(requestId);
646339
+ return consumed;
646340
+ }
645340
646341
  function isBridgePermissionResponse(value) {
645341
646342
  if (!value || typeof value !== "object")
645342
646343
  return false;
@@ -645409,7 +646410,7 @@ function buildSystemInitMessage(inputs) {
645409
646410
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
645410
646411
  apiKeySource: getAnthropicApiKeyWithSource().source,
645411
646412
  betas: getSdkBetas(),
645412
- claude_code_version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
646413
+ claude_code_version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
645413
646414
  output_style: outputStyle2,
645414
646415
  agents: inputs.agents.map((agent) => agent.agentType),
645415
646416
  skills: inputs.skills.filter((s3) => s3.userInvocable !== false).map((skill) => skill.name),
@@ -647703,7 +648704,7 @@ async function initBridgeCore(params) {
647703
648704
  const rawApi = createBridgeApiClient({
647704
648705
  baseUrl,
647705
648706
  getAccessToken,
647706
- runnerVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
648707
+ runnerVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
647707
648708
  onDebug: logForDebugging,
647708
648709
  onAuth401,
647709
648710
  getTrustedDeviceToken
@@ -649917,10 +650918,9 @@ function useReplBridge(messages, setMessages, abortControllerRef, commands, main
649917
650918
  logForDebugging(`[bridge:repl] No handler for control_response request_id=${requestId}`);
649918
650919
  return;
649919
650920
  }
649920
- pendingPermissionHandlers.delete(requestId);
649921
650921
  const inner = msg_0.response;
649922
650922
  if (inner.subtype === "success" && inner.response && isBridgePermissionResponse(inner.response)) {
649923
- handler(inner.response);
650923
+ dispatchBridgePermissionResponse(pendingPermissionHandlers, requestId, inner.response);
649924
650924
  }
649925
650925
  };
649926
650926
  if (teardownPromiseRef.current) {
@@ -650386,7 +651386,7 @@ function MessageSelector({
650386
651386
  ...summarizeInputProps,
650387
651387
  onChange: setSummarizeFromFeedback
650388
651388
  });
650389
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
651389
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
650390
651390
  baseOptions.push({
650391
651391
  value: "summarize_up_to",
650392
651392
  label: "Summarize up to here",
@@ -653612,7 +654612,7 @@ function AskUserQuestionPermissionRequestBody(t0) {
653612
654612
  const isInSubmitView = currentQuestionIndex === (questions?.length || 0);
653613
654613
  let t11;
653614
654614
  if ($3[22] !== answers || $3[23] !== questions) {
653615
- t11 = questions?.every((q_0) => q_0?.question && !!answers[q_0.question]) ?? false;
654615
+ t11 = questions?.every((q_0) => q_0?.question && typeof answers[q_0.question] === "string" && answers[q_0.question].trim().length > 0) ?? false;
653616
654616
  $3[22] = answers;
653617
654617
  $3[23] = questions;
653618
654618
  $3[24] = t11;
@@ -653764,11 +654764,15 @@ ${questionsWithAnswers_0}`;
653764
654764
  }
653765
654765
  const updatedInput = {
653766
654766
  ...toolUseConfirm.input,
654767
+ questions,
653767
654768
  answers: answersToSubmit,
653768
654769
  ...Object.keys(annotations).length > 0 && {
653769
654770
  annotations
653770
654771
  }
653771
654772
  };
654773
+ const completion = AskUserQuestionTool.validateInteractionCompletion?.(updatedInput);
654774
+ if (completion && !completion.result)
654775
+ return;
653772
654776
  const contentBlocks = await convertImagesToBlocks(allImageAttachments);
653773
654777
  onDone();
653774
654778
  toolUseConfirm.onAllow(updatedInput, [], undefined, contentBlocks && contentBlocks.length > 0 ? contentBlocks : undefined);
@@ -657880,7 +658884,7 @@ function bashToolUseOptions({
657880
658884
  }
657881
658885
  }
657882
658886
  const editablePrefixShown = options.some((o2) => o2.value === "yes-prefix-edited");
657883
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && !editablePrefixShown && isClassifierPermissionsEnabled() && onClassifierDescriptionChange && !initialClassifierDescriptionEmpty && !descriptionAlreadyExists(classifierDescription ?? "", existingAllowDescriptions) && decisionReason?.type !== "classifier") {
658887
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && !editablePrefixShown && isClassifierPermissionsEnabled() && onClassifierDescriptionChange && !initialClassifierDescriptionEmpty && !descriptionAlreadyExists(classifierDescription ?? "", existingAllowDescriptions) && decisionReason?.type !== "classifier") {
657884
658888
  options.push({
657885
658889
  type: "input",
657886
658890
  label: "Yes, and don’t ask again for",
@@ -665487,7 +666491,7 @@ var init_CompanionSprite = __esm(() => {
665487
666491
 
665488
666492
  // buddy/useBuddyNotification.tsx
665489
666493
  function isBuddyTeaserWindow() {
665490
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant")
666494
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant")
665491
666495
  return true;
665492
666496
  const d2 = new Date;
665493
666497
  return d2.getFullYear() === 2026 && d2.getMonth() === 3 && d2.getDate() <= 7;
@@ -665623,7 +666627,7 @@ var init_useVoiceEnabled = __esm(() => {
665623
666627
  function getSemverPart(version5) {
665624
666628
  return `${import_semver14.major(version5, { loose: true })}.${import_semver14.minor(version5, { loose: true })}.${import_semver14.patch(version5, { loose: true })}`;
665625
666629
  }
665626
- function useUpdateNotification(updatedVersion, initialVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
666630
+ function useUpdateNotification(updatedVersion, initialVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
665627
666631
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react232.useState(() => getSemverPart(initialVersion));
665628
666632
  if (!updatedVersion) {
665629
666633
  return null;
@@ -665663,7 +666667,7 @@ function AutoUpdater({
665663
666667
  return;
665664
666668
  }
665665
666669
  if (false) {}
665666
- const currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
666670
+ const currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
665667
666671
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
665668
666672
  let latestVersion = await getLatestVersion(channel2);
665669
666673
  const isDisabled = isAutoUpdaterDisabled();
@@ -665799,7 +666803,7 @@ function AutoUpdater({
665799
666803
  " ",
665800
666804
  /* @__PURE__ */ jsx_runtime413.jsx(ThemedText, {
665801
666805
  bold: true,
665802
- children: hasLocalInstall ? `cd ~/.ccl/local && npm update ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}` : `npm i -g ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}`
666806
+ children: hasLocalInstall ? `cd ~/.ccl/local && npm update ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}` : `npm i -g ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}`
665803
666807
  })
665804
666808
  ]
665805
666809
  })
@@ -665876,12 +666880,12 @@ function NativeAutoUpdater({
665876
666880
  logEvent("tengu_native_auto_updater_start", {});
665877
666881
  try {
665878
666882
  const maxVersion = await getMaxVersion();
665879
- if (maxVersion && gt2({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, maxVersion)) {
666883
+ if (maxVersion && gt2({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, maxVersion)) {
665880
666884
  const msg = await getMaxVersionMessage();
665881
666885
  setMaxVersionIssue(msg ?? "affects your version");
665882
666886
  }
665883
666887
  const result = await installLatest(channel2);
665884
- const currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION;
666888
+ const currentVersion = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION;
665885
666889
  const latencyMs = Date.now() - startTime2;
665886
666890
  if (result.lockFailed) {
665887
666891
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -665977,7 +666981,7 @@ function NativeAutoUpdater({
665977
666981
  })
665978
666982
  ]
665979
666983
  }),
665980
- maxVersionIssue && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime414.jsxs(ThemedText, {
666984
+ maxVersionIssue && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime414.jsxs(ThemedText, {
665981
666985
  color: "warning",
665982
666986
  children: [
665983
666987
  "⚠ Known issue: ",
@@ -666031,17 +667035,17 @@ function PackageManagerAutoUpdater(t0) {
666031
667035
  const maxVersion = await getMaxVersion();
666032
667036
  if (maxVersion && latest && gt2(latest, maxVersion)) {
666033
667037
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
666034
- if (gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, maxVersion)) {
666035
- logForDebugging(`PackageManagerAutoUpdater: current version ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
667038
+ if (gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, maxVersion)) {
667039
+ logForDebugging(`PackageManagerAutoUpdater: current version ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
666036
667040
  setUpdateAvailable(false);
666037
667041
  return;
666038
667042
  }
666039
667043
  latest = maxVersion;
666040
667044
  }
666041
- const hasUpdate = latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, latest) && !shouldSkipVersion(latest);
667045
+ const hasUpdate = latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, latest) && !shouldSkipVersion(latest);
666042
667046
  setUpdateAvailable(!!hasUpdate);
666043
667047
  if (hasUpdate) {
666044
- logForDebugging(`PackageManagerAutoUpdater: Update available ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} -> ${latest}`);
667048
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} -> ${latest}`);
666045
667049
  }
666046
667050
  };
666047
667051
  $3[0] = t1;
@@ -666075,7 +667079,7 @@ function PackageManagerAutoUpdater(t0) {
666075
667079
  wrap: "truncate",
666076
667080
  children: [
666077
667081
  "currentVersion: ",
666078
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
667082
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
666079
667083
  ]
666080
667084
  });
666081
667085
  $3[3] = verbose;
@@ -666326,7 +667330,7 @@ var init_useMemoryUsage = __esm(() => {
666326
667330
 
666327
667331
  // components/MemoryUsageIndicator.tsx
666328
667332
  function MemoryUsageIndicator() {
666329
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant") {
667333
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant") {
666330
667334
  return null;
666331
667335
  }
666332
667336
  const memoryUsage = useMemoryUsage();
@@ -676020,7 +677024,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
676020
677024
  project_dir: getOriginalCwd(),
676021
677025
  added_dirs: addedDirs
676022
677026
  },
676023
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
677027
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
676024
677028
  output_style: {
676025
677029
  name: outputStyleName
676026
677030
  },
@@ -677377,7 +678381,7 @@ function ModeIndicator({
677377
678381
  const expandedView = useAppState((s_3) => s_3.expandedView);
677378
678382
  const showSpinnerTree = expandedView === "teammates";
677379
678383
  const prStatus = usePrStatus(isLoading, isPrStatusEnabled());
677380
- const hasTmuxSession = useAppState((s_4) => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }).USER_TYPE === "ant" && s_4.tungstenActiveSession !== undefined);
678384
+ const hasTmuxSession = useAppState((s_4) => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }).USER_TYPE === "ant" && s_4.tungstenActiveSession !== undefined);
677381
678385
  const nextTickAt = import_react259.useSyncExternalStore(proactiveModule6?.subscribeToProactiveChanges ?? NO_OP_SUBSCRIBE, proactiveModule6?.getNextTickAt ?? NULL, NULL);
677382
678386
  const voiceEnabled = runtimeVoiceFeature() ? useVoiceEnabled() : false;
677383
678387
  const voiceState = runtimeVoiceFeature() ? useVoiceState((s_5) => s_5.voiceState) : "idle";
@@ -677386,7 +678390,7 @@ function ModeIndicator({
677386
678390
  const selGetState = useSelection().getState;
677387
678391
  const hasNextTick = nextTickAt !== null;
677388
678392
  const isCoordinator = feature("COORDINATOR_MODE") ? coordinatorModule?.isCoordinatorMode() === true : false;
677389
- const runningTaskCount = import_react259.useMemo(() => count(Object.values(tasks2), (t3) => isBackgroundTask(t3) && !({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && isPanelAgentTask(t3))), [tasks2]);
678393
+ const runningTaskCount = import_react259.useMemo(() => count(Object.values(tasks2), (t3) => isBackgroundTask(t3) && !({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && isPanelAgentTask(t3))), [tasks2]);
677390
678394
  const tasksV2 = useTasksV2();
677391
678395
  const hasTaskItems = tasksV2 !== undefined && tasksV2.length > 0;
677392
678396
  const escShortcut = useShortcutDisplay("chat:cancel", "Chat", "esc").toLowerCase();
@@ -677464,7 +678468,7 @@ function ModeIndicator({
677464
678468
  ]
677465
678469
  })
677466
678470
  }, "remote")] : [],
677467
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && hasTmuxSession ? [/* @__PURE__ */ jsx_runtime440.jsx(TungstenPill, {
678471
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && hasTmuxSession ? [/* @__PURE__ */ jsx_runtime440.jsx(TungstenPill, {
677468
678472
  selected: tmuxSelected
677469
678473
  }, "tmux")] : [],
677470
678474
  ...isAgentSwarmsEnabled() && hasTeams ? [/* @__PURE__ */ jsx_runtime440.jsx(TeamStatus, {
@@ -677515,7 +678519,7 @@ function ModeIndicator({
677515
678519
  ]
677516
678520
  });
677517
678521
  }
677518
- const hasCoordinatorTasks = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && getVisibleAgentTasks(tasks2).length > 0;
678522
+ const hasCoordinatorTasks = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && getVisibleAgentTasks(tasks2).length > 0;
677519
678523
  const tasksPart = hasBackgroundTasks && !hasTeammatePills && !shouldHideTasksFooter(tasks2, showSpinnerTree) ? /* @__PURE__ */ jsx_runtime440.jsx(BackgroundTaskStatus, {
677520
678524
  tasksSelected,
677521
678525
  isViewingTeammate,
@@ -677823,7 +678827,7 @@ function PromptInputFooter({
677823
678827
  isInputWrapped,
677824
678828
  isNarrow
677825
678829
  }),
677826
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && isUndercover() && /* @__PURE__ */ jsx_runtime441.jsx(ThemedText, {
678830
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && isUndercover() && /* @__PURE__ */ jsx_runtime441.jsx(ThemedText, {
677827
678831
  dimColor: true,
677828
678832
  children: "undercover"
677829
678833
  }),
@@ -677834,7 +678838,7 @@ function PromptInputFooter({
677834
678838
  })
677835
678839
  ]
677836
678840
  }),
677837
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime441.jsx(CoordinatorTaskPanel, {})
678841
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime441.jsx(CoordinatorTaskPanel, {})
677838
678842
  ]
677839
678843
  });
677840
678844
  }
@@ -678595,8 +679599,8 @@ function PromptInput({
678595
679599
  const replBridgeExplicit = useAppState((s3) => s3.replBridgeExplicit);
678596
679600
  const replBridgeReconnecting = useAppState((s3) => s3.replBridgeReconnecting);
678597
679601
  const bridgeFooterVisible = replBridgeConnected && (replBridgeExplicit || replBridgeReconnecting);
678598
- const hasTungstenSession = useAppState((s3) => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }).USER_TYPE === "ant" && s3.tungstenActiveSession !== undefined);
678599
- const tmuxFooterVisible = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && hasTungstenSession;
679602
+ const hasTungstenSession = useAppState((s3) => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }).USER_TYPE === "ant" && s3.tungstenActiveSession !== undefined);
679603
+ const tmuxFooterVisible = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && hasTungstenSession;
678600
679604
  const bagelFooterVisible = useAppState((s3) => false);
678601
679605
  const teamContext = useAppState((s3) => s3.teamContext);
678602
679606
  const queuedCommands = useCommandQueue();
@@ -678662,7 +679666,7 @@ function PromptInput({
678662
679666
  };
678663
679667
  }), [setAppState]);
678664
679668
  const coordinatorTaskCount = useCoordinatorTaskCount();
678665
- const hasBgTaskPill = import_react265.useMemo(() => Object.values(tasks2).some((t3) => isBackgroundTask(t3) && !({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && isPanelAgentTask(t3))), [tasks2]);
679669
+ const hasBgTaskPill = import_react265.useMemo(() => Object.values(tasks2).some((t3) => isBackgroundTask(t3) && !({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && isPanelAgentTask(t3))), [tasks2]);
678666
679670
  const minCoordinatorIndex = hasBgTaskPill ? -1 : 0;
678667
679671
  import_react265.useEffect(() => {
678668
679672
  if (coordinatorTaskIndex >= coordinatorTaskCount) {
@@ -678715,7 +679719,7 @@ function PromptInput({
678715
679719
  }];
678716
679720
  }, [teamContext]);
678717
679721
  const runningTaskCount = import_react265.useMemo(() => count(Object.values(tasks2), (t3) => t3.status === "running"), [tasks2]);
678718
- const tasksFooterVisible = (runningTaskCount > 0 || { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && coordinatorTaskCount > 0) && !shouldHideTasksFooter(tasks2, showSpinnerTree);
679722
+ const tasksFooterVisible = (runningTaskCount > 0 || { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && coordinatorTaskCount > 0) && !shouldHideTasksFooter(tasks2, showSpinnerTree);
678719
679723
  const teamsFooterVisible = cachedTeams.length > 0;
678720
679724
  const footerItems = import_react265.useMemo(() => [tasksFooterVisible && "tasks", tmuxFooterVisible && "tmux", bagelFooterVisible && "bagel", teamsFooterVisible && "teams", bridgeFooterVisible && "bridge", companionFooterVisible && "companion"].filter(Boolean), [tasksFooterVisible, tmuxFooterVisible, bagelFooterVisible, teamsFooterVisible, bridgeFooterVisible, companionFooterVisible]);
678721
679725
  const rawFooterSelection = useAppState((s3) => s3.footerSelection);
@@ -679721,14 +680725,14 @@ function PromptInput({
679721
680725
  });
679722
680726
  useKeybindings({
679723
680727
  "footer:up": () => {
679724
- if (tasksSelected && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && coordinatorTaskCount > 0 && coordinatorTaskIndex > minCoordinatorIndex) {
680728
+ if (tasksSelected && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && coordinatorTaskCount > 0 && coordinatorTaskIndex > minCoordinatorIndex) {
679725
680729
  setCoordinatorTaskIndex((prev) => prev - 1);
679726
680730
  return;
679727
680731
  }
679728
680732
  navigateFooter(-1, true);
679729
680733
  },
679730
680734
  "footer:down": () => {
679731
- if (tasksSelected && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && coordinatorTaskCount > 0) {
680735
+ if (tasksSelected && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && coordinatorTaskCount > 0) {
679732
680736
  if (coordinatorTaskIndex < coordinatorTaskCount - 1) {
679733
680737
  setCoordinatorTaskIndex((prev) => prev + 1);
679734
680738
  }
@@ -679790,7 +680794,7 @@ function PromptInput({
679790
680794
  }
679791
680795
  break;
679792
680796
  case "tmux":
679793
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
680797
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
679794
680798
  setAppState((prev) => prev.tungstenPanelAutoHidden ? {
679795
680799
  ...prev,
679796
680800
  tungstenPanelAutoHidden: false
@@ -693153,6 +694157,9 @@ function createPermissionContext(tool, input, toolUseContext, assistantMessage,
693153
694157
  const decision = hookResult.permissionRequestResult;
693154
694158
  if (decision.behavior === "allow") {
693155
694159
  const finalInput = decision.updatedInput ?? updatedInput ?? input;
694160
+ if (!validateToolInteractionCompletion(tool, finalInput).result) {
694161
+ return null;
694162
+ }
693156
694163
  return await this.handleHookAllow(finalInput, decision.updatedPermissions ?? [], permissionPromptStartTimeMs);
693157
694164
  } else if (decision.behavior === "deny") {
693158
694165
  this.logDecision({ decision: "reject", source: { type: "hook" } }, { permissionPromptStartTimeMs });
@@ -693241,6 +694248,7 @@ var init_PermissionContext = __esm(() => {
693241
694248
  init_bashPermissions();
693242
694249
  init_classifierApprovals();
693243
694250
  init_debug();
694251
+ init_interactionCompletion();
693244
694252
  init_hooks5();
693245
694253
  init_messages7();
693246
694254
  init_PermissionUpdate();
@@ -693319,6 +694327,9 @@ function handleInteractivePermission(params, resolve41) {
693319
694327
  resolveOnce(ctx.cancelAndAbort(undefined, true));
693320
694328
  },
693321
694329
  async onAllow(updatedInput, permissionUpdates, feedback2, contentBlocks) {
694330
+ if (!validateToolInteractionCompletion(ctx.tool, updatedInput).result) {
694331
+ return;
694332
+ }
693322
694333
  if (!claim())
693323
694334
  return;
693324
694335
  if (bridgeCallbacks && bridgeRequestId) {
@@ -693354,6 +694365,10 @@ function handleInteractivePermission(params, resolve41) {
693354
694365
  return;
693355
694366
  const freshResult = await hasPermissionsToUseTool(ctx.tool, ctx.input, ctx.toolUseContext, ctx.assistantMessage, ctx.toolUseID);
693356
694367
  if (freshResult.behavior === "allow") {
694368
+ const freshInput = freshResult.updatedInput ?? ctx.input;
694369
+ if (!validateToolInteractionCompletion(ctx.tool, freshInput).result) {
694370
+ return;
694371
+ }
693357
694372
  if (!claim())
693358
694373
  return;
693359
694374
  if (bridgeCallbacks && bridgeRequestId) {
@@ -693362,7 +694377,7 @@ function handleInteractivePermission(params, resolve41) {
693362
694377
  channelUnsubscribe?.();
693363
694378
  ctx.removeFromQueue();
693364
694379
  ctx.logDecision({ decision: "accept", source: "config" });
693365
- resolveOnce(ctx.buildAllow(freshResult.updatedInput ?? ctx.input));
694380
+ resolveOnce(ctx.buildAllow(freshInput));
693366
694381
  }
693367
694382
  }
693368
694383
  });
@@ -693370,8 +694385,12 @@ function handleInteractivePermission(params, resolve41) {
693370
694385
  bridgeCallbacks.sendRequest(bridgeRequestId, ctx.tool.name, displayInput, ctx.toolUseID, description, result.suggestions, result.blockedPath);
693371
694386
  const signal = ctx.toolUseContext.abortController.signal;
693372
694387
  const unsubscribe = bridgeCallbacks.onResponse(bridgeRequestId, (response) => {
694388
+ const responseInput = response.updatedInput ?? displayInput;
694389
+ if (response.behavior === "allow" && !validateToolInteractionCompletion(ctx.tool, responseInput).result) {
694390
+ return false;
694391
+ }
693373
694392
  if (!claim())
693374
- return;
694393
+ return true;
693375
694394
  signal.removeEventListener("abort", unsubscribe);
693376
694395
  clearClassifierChecking(ctx.toolUseID);
693377
694396
  clearClassifierIndicator();
@@ -693388,7 +694407,7 @@ function handleInteractivePermission(params, resolve41) {
693388
694407
  permanent: !!response.updatedPermissions?.length
693389
694408
  }
693390
694409
  }, { permissionPromptStartTimeMs });
693391
- resolveOnce(ctx.buildAllow(response.updatedInput ?? displayInput));
694410
+ resolveOnce(ctx.buildAllow(responseInput));
693392
694411
  } else {
693393
694412
  ctx.logDecision({
693394
694413
  decision: "reject",
@@ -693399,6 +694418,7 @@ function handleInteractivePermission(params, resolve41) {
693399
694418
  }, { permissionPromptStartTimeMs });
693400
694419
  resolveOnce(ctx.cancelAndAbort(response.message));
693401
694420
  }
694421
+ return true;
693402
694422
  });
693403
694423
  signal.addEventListener("abort", unsubscribe, { once: true });
693404
694424
  }
@@ -693463,8 +694483,9 @@ function handleInteractivePermission(params, resolve41) {
693463
694483
  return;
693464
694484
  const currentAppState = ctx.toolUseContext.getAppState();
693465
694485
  const hookDecision = await ctx.runHooks(currentAppState.toolPermissionContext.mode, result.suggestions, result.updatedInput, permissionPromptStartTimeMs);
693466
- if (!hookDecision || !claim())
694486
+ if (!hookDecision || hookDecision.behavior === "allow" && !validateToolInteractionCompletion(ctx.tool, hookDecision.updatedInput ?? displayInput).result || !claim()) {
693467
694487
  return;
694488
+ }
693468
694489
  if (bridgeCallbacks && bridgeRequestId) {
693469
694490
  bridgeCallbacks.cancelRequest(bridgeRequestId);
693470
694491
  }
@@ -693543,6 +694564,7 @@ var init_interactiveHandler = __esm(() => {
693543
694564
  init_bashPermissions();
693544
694565
  init_classifierApprovals();
693545
694566
  init_errors();
694567
+ init_interactionCompletion();
693546
694568
  init_permissions2();
693547
694569
  init_PermissionContext();
693548
694570
  });
@@ -695462,6 +696484,34 @@ var init_useIdeSelection = __esm(() => {
695462
696484
  }));
695463
696485
  });
695464
696486
 
696487
+ // services/tools/interactionPolicy.ts
696488
+ function parseInteractionMode(value) {
696489
+ if (value === undefined)
696490
+ return "local";
696491
+ if (INTERACTION_MODES.some((mode) => mode === value)) {
696492
+ return value;
696493
+ }
696494
+ throw new Error(`Invalid interaction mode: ${String(value)}. Expected local, remote, or unattended.`);
696495
+ }
696496
+ function filterToolsForInteractionMode(tools, mode) {
696497
+ if (mode !== "unattended")
696498
+ return [...tools];
696499
+ return tools.filter((tool) => tool.validateInteractionCompletion === undefined);
696500
+ }
696501
+ function appendInteractionGuidance(existing, mode) {
696502
+ if (mode !== "unattended")
696503
+ return existing;
696504
+ if (existing?.includes(UNATTENDED_INTERACTION_GUIDANCE))
696505
+ return existing;
696506
+ return existing ? `${existing}
696507
+
696508
+ ${UNATTENDED_INTERACTION_GUIDANCE}` : UNATTENDED_INTERACTION_GUIDANCE;
696509
+ }
696510
+ var INTERACTION_MODES, UNATTENDED_INTERACTION_GUIDANCE = "This session is unattended. Do not ask the user an interactive question. Continue with safe, reversible assumptions when possible. If required information or authority is unavailable, explain the precise blocker and the user action needed; do not fabricate an answer or silently stop.";
696511
+ var init_interactionPolicy = __esm(() => {
696512
+ INTERACTION_MODES = ["local", "remote", "unattended"];
696513
+ });
696514
+
695465
696515
  // utils/asciicast.ts
695466
696516
  var exports_asciicast = {};
695467
696517
  __export(exports_asciicast, {
@@ -697704,7 +698754,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
697704
698754
  } catch {}
697705
698755
  const data = {
697706
698756
  trigger,
697707
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
698757
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
697708
698758
  platform: process.platform,
697709
698759
  transcript,
697710
698760
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -698140,7 +699190,7 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, {
698140
699190
  });
698141
699191
  }, []);
698142
699192
  const shouldShowTranscriptPrompt = import_react299.useCallback((selected_0) => {
698143
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant") {
699193
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant") {
698144
699194
  return false;
698145
699195
  }
698146
699196
  if (selected_0 !== "bad" && selected_0 !== "good") {
@@ -700670,6 +701720,14 @@ function permissionPromptToolResultToPermissionDecision(result, tool, input, too
700670
701720
  toolResult: result
700671
701721
  };
700672
701722
  if (result.behavior === "allow") {
701723
+ const updatedInput = Object.keys(result.updatedInput).length > 0 ? result.updatedInput : input;
701724
+ const completion = validateToolInteractionCompletion(tool, updatedInput);
701725
+ if (!completion.result) {
701726
+ return {
701727
+ ...interactionIncompleteDecision(completion),
701728
+ toolUseID: result.toolUseID
701729
+ };
701730
+ }
700673
701731
  const updatedPermissions = result.updatedPermissions;
700674
701732
  if (updatedPermissions) {
700675
701733
  toolUseContext.setAppState((prev) => ({
@@ -700678,7 +701736,6 @@ function permissionPromptToolResultToPermissionDecision(result, tool, input, too
700678
701736
  }));
700679
701737
  persistPermissionUpdates(updatedPermissions);
700680
701738
  }
700681
- const updatedInput = Object.keys(result.updatedInput).length > 0 ? result.updatedInput : input;
700682
701739
  return {
700683
701740
  ...result,
700684
701741
  updatedInput,
@@ -700698,6 +701755,7 @@ var init_PermissionPromptToolResultSchema = __esm(() => {
700698
701755
  init_debug();
700699
701756
  init_PermissionUpdate();
700700
701757
  init_PermissionUpdateSchema();
701758
+ init_interactionCompletion();
700701
701759
  inputSchema49 = lazySchema(() => z108.object({
700702
701760
  tool_name: z108.string().describe("The name of the tool requesting permission"),
700703
701761
  input: z108.record(z108.string(), z108.unknown()).describe("The input for the tool"),
@@ -701068,7 +702126,7 @@ class StructuredIO {
701068
702126
  const onParentAbort = () => hookAbortController.abort();
701069
702127
  parentSignal.addEventListener("abort", onParentAbort, { once: true });
701070
702128
  try {
701071
- const hookPromise = executePermissionRequestHooksForSDK(tool.name, toolUseID, input, toolUseContext, permissionSuggestions).then((decision) => ({ source: "hook", decision }));
702129
+ const hookPromise = executePermissionRequestHooksForSDK(tool, toolUseID, input, toolUseContext, permissionSuggestions).then((decision) => ({ source: "hook", decision }));
701072
702130
  const requestId = randomUUID62();
701073
702131
  onPermissionPrompt?.(buildRequiresActionDetails(tool, input, toolUseID, requestId));
701074
702132
  const sdkPromise = this.sendRequest({
@@ -701173,15 +702231,19 @@ function exitWithMessage(message) {
701173
702231
  console.error(message);
701174
702232
  process.exit(1);
701175
702233
  }
701176
- async function executePermissionRequestHooksForSDK(toolName, toolUseID, input, toolUseContext, suggestions) {
702234
+ async function executePermissionRequestHooksForSDK(tool, toolUseID, input, toolUseContext, suggestions) {
701177
702235
  const appState = toolUseContext.getAppState();
701178
702236
  const permissionMode = appState.toolPermissionContext.mode;
701179
- const hookGenerator = executePermissionRequestHooks(toolName, toolUseID, input, toolUseContext, permissionMode, suggestions, toolUseContext.abortController.signal);
702237
+ const hookGenerator = executePermissionRequestHooks(tool.name, toolUseID, input, toolUseContext, permissionMode, suggestions, toolUseContext.abortController.signal);
701180
702238
  for await (const hookResult of hookGenerator) {
701181
702239
  if (hookResult.permissionRequestResult && (hookResult.permissionRequestResult.behavior === "allow" || hookResult.permissionRequestResult.behavior === "deny")) {
701182
702240
  const decision = hookResult.permissionRequestResult;
701183
702241
  if (decision.behavior === "allow") {
701184
702242
  const finalInput = decision.updatedInput || input;
702243
+ const completion = validateToolInteractionCompletion(tool, finalInput);
702244
+ if (!completion.result) {
702245
+ return interactionIncompleteDecision(completion);
702246
+ }
701185
702247
  const permissionUpdates = decision.updatedPermissions ?? [];
701186
702248
  if (permissionUpdates.length > 0) {
701187
702249
  persistPermissionUpdates(permissionUpdates);
@@ -701225,6 +702287,7 @@ var init_structuredIO = __esm(() => {
701225
702287
  init_errors();
701226
702288
  init_PermissionPromptToolResultSchema();
701227
702289
  init_permissions2();
702290
+ init_interactionCompletion();
701228
702291
  init_slowOperations();
701229
702292
  init_hooks5();
701230
702293
  init_PermissionUpdate();
@@ -704343,7 +705406,7 @@ function AutoRunIssueNotification(t0) {
704343
705406
  return t6;
704344
705407
  }
704345
705408
  function shouldAutoRunIssue(reason) {
704346
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant") {
705409
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant") {
704347
705410
  return false;
704348
705411
  }
704349
705412
  switch (reason) {
@@ -704356,7 +705419,7 @@ function shouldAutoRunIssue(reason) {
704356
705419
  }
704357
705420
  }
704358
705421
  function getAutoRunCommand(reason) {
704359
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && reason === "feedback_survey_good") {
705422
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && reason === "feedback_survey_good") {
704360
705423
  return "/good-claude";
704361
705424
  }
704362
705425
  return "/issue";
@@ -704497,7 +705560,7 @@ var init_useIssueFlagBanner = __esm(() => {
704497
705560
 
704498
705561
  // components/DevBar.tsx
704499
705562
  function shouldShowDevBar() {
704500
- return { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant";
705563
+ return { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant";
704501
705564
  }
704502
705565
  function DevBar() {
704503
705566
  const $3 = import_compiler_runtime368.c(5);
@@ -706348,6 +707411,7 @@ function REPL({
706348
707411
  strictMcpConfig = false,
706349
707412
  systemPrompt: customSystemPrompt,
706350
707413
  appendSystemPrompt,
707414
+ interactionMode = "local",
706351
707415
  onBeforeQuery,
706352
707416
  onTurnComplete,
706353
707417
  disabled = false,
@@ -706361,7 +707425,7 @@ function REPL({
706361
707425
  }) {
706362
707426
  const isRemoteSession = !!remoteSessionConfig;
706363
707427
  const titleDisabled = import_react324.useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE), []);
706364
- const moreRightEnabled = import_react324.useMemo(() => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }).USER_TYPE === "ant" && isEnvTruthy(process.env.CLAUDE_MORERIGHT), []);
707428
+ const moreRightEnabled = import_react324.useMemo(() => ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }).USER_TYPE === "ant" && isEnvTruthy(process.env.CLAUDE_MORERIGHT), []);
706365
707429
  const disableVirtualScroll = import_react324.useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL), []);
706366
707430
  const disableMessageActions = runtimeFeature11("MESSAGE_ACTIONS") ? import_react324.useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_MESSAGE_ACTIONS), []) : false;
706367
707431
  import_react324.useEffect(() => {
@@ -706424,7 +707488,7 @@ function REPL({
706424
707488
  useSkillsChange(isRemoteSession ? undefined : getProjectRoot(), setLocalCommands);
706425
707489
  const proactiveActive = React157.useSyncExternalStore(proactiveModule8?.subscribeToProactiveChanges ?? PROACTIVE_NO_OP_SUBSCRIBE, proactiveModule8?.isProactiveActive ?? PROACTIVE_FALSE);
706426
707490
  const isBriefOnly = useAppState((s3) => s3.isBriefOnly);
706427
- const localTools = import_react324.useMemo(() => getTools(toolPermissionContext), [toolPermissionContext, proactiveActive, isBriefOnly]);
707491
+ const localTools = import_react324.useMemo(() => filterToolsForInteractionMode(getTools(toolPermissionContext), interactionMode), [toolPermissionContext, proactiveActive, isBriefOnly, interactionMode]);
706428
707492
  useKickOffCheckAndDisableBypassPermissionsIfNeeded();
706429
707493
  useKickOffCheckAndDisableAutoModeIfNeeded();
706430
707494
  const [dynamicMcpConfig, setDynamicMcpConfig] = import_react324.useState(initialDynamicMcpConfig);
@@ -706449,7 +707513,7 @@ function REPL({
706449
707513
  const [ideInstallationStatus, setIDEInstallationStatus] = import_react324.useState(null);
706450
707514
  const [showIdeOnboarding, setShowIdeOnboarding] = import_react324.useState(false);
706451
707515
  const [showModelSwitchCallout, setShowModelSwitchCallout] = import_react324.useState(() => {
706452
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
707516
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
706453
707517
  return shouldShowAntModelSwitch();
706454
707518
  }
706455
707519
  return false;
@@ -706611,7 +707675,7 @@ function REPL({
706611
707675
  }, []);
706612
707676
  const [showUndercoverCallout, setShowUndercoverCallout] = import_react324.useState(false);
706613
707677
  import_react324.useEffect(() => {
706614
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
707678
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
706615
707679
  (async () => {
706616
707680
  const {
706617
707681
  isInternalModelRepo: isInternalModelRepo2
@@ -707228,9 +708292,9 @@ function REPL({
707228
708292
  return "ultraplan-launch";
707229
708293
  if (allowDialogsWithAnimation && showIdeOnboarding)
707230
708294
  return "ide-onboarding";
707231
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && allowDialogsWithAnimation && showModelSwitchCallout)
708295
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && allowDialogsWithAnimation && showModelSwitchCallout)
707232
708296
  return "model-switch";
707233
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && allowDialogsWithAnimation && showUndercoverCallout)
708297
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && allowDialogsWithAnimation && showUndercoverCallout)
707234
708298
  return "undercover-callout";
707235
708299
  if (allowDialogsWithAnimation && showEffortCallout)
707236
708300
  return "effort-callout";
@@ -707495,7 +708559,7 @@ Error: sandbox required but unavailable: ${reason}
707495
708559
  const computeTools = () => {
707496
708560
  const state2 = store.getState();
707497
708561
  const assembled = assembleToolPool(state2.toolPermissionContext, state2.mcp.tools);
707498
- const merged = mergeAndFilterTools(combinedInitialTools, assembled, state2.toolPermissionContext.mode);
708562
+ const merged = filterToolsForInteractionMode(mergeAndFilterTools(combinedInitialTools, assembled, state2.toolPermissionContext.mode), interactionMode);
707499
708563
  if (!mainThreadAgentDefinition)
707500
708564
  return merged;
707501
708565
  return resolveAgentTools(mainThreadAgentDefinition, merged, false, true).resolvedTools;
@@ -707571,7 +708635,7 @@ Error: sandbox required but unavailable: ${reason}
707571
708635
  dynamicSkillDirTriggers: new Set,
707572
708636
  discoveredSkillNames: discoveredSkillNamesRef.current,
707573
708637
  setResponseLength,
707574
- pushApiMetricsEntry: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? (ttftMs) => {
708638
+ pushApiMetricsEntry: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? (ttftMs) => {
707575
708639
  const now = Date.now();
707576
708640
  const baseline = responseLengthRef.current;
707577
708641
  apiMetricsRef2.current.push({
@@ -707611,7 +708675,7 @@ Error: sandbox required but unavailable: ${reason}
707611
708675
  byteBudgetReplayState: byteBudgetReplayStateRef.current,
707612
708676
  persistContentReplacements: true
707613
708677
  };
707614
- }, [commands, combinedInitialTools, mainThreadAgentDefinition, debug5, initialMcpClients, ideInstallationStatus, dynamicMcpConfig, theme2, allowedAgentTypes, store, setAppState, reverify, addNotification, setMessages, onChangeDynamicMcpConfig, resume3, requestPrompt, disabled, customSystemPrompt, appendSystemPrompt, setConversationId]);
708678
+ }, [commands, combinedInitialTools, mainThreadAgentDefinition, debug5, initialMcpClients, ideInstallationStatus, dynamicMcpConfig, theme2, allowedAgentTypes, store, setAppState, reverify, addNotification, setMessages, onChangeDynamicMcpConfig, resume3, requestPrompt, disabled, customSystemPrompt, appendSystemPrompt, interactionMode, setConversationId]);
707615
708679
  const handleBackgroundQuery = import_react324.useCallback(() => {
707616
708680
  abortController?.abort("background");
707617
708681
  const removedNotifications = removeByFilter((cmd) => cmd.mode === "task-notification");
@@ -707842,7 +708906,7 @@ Error: sandbox required but unavailable: ${reason}
707842
708906
  }));
707843
708907
  }
707844
708908
  queryCheckpoint("query_end");
707845
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && apiMetricsRef2.current.length > 0) {
708909
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && apiMetricsRef2.current.length > 0) {
707846
708910
  const entries = apiMetricsRef2.current;
707847
708911
  const ttfts = entries.map((e3) => e3.ttftMs);
707848
708912
  const otpsValues = entries.map((e3) => {
@@ -707928,7 +708992,7 @@ Error: sandbox required but unavailable: ${reason}
707928
708992
  resetLoadingState();
707929
708993
  await mrOnTurnComplete(messagesRef.current, abortController2.signal.aborted);
707930
708994
  sendBridgeResultRef.current();
707931
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && !abortController2.signal.aborted) {
708995
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && !abortController2.signal.aborted) {
707932
708996
  setAppState((prev) => {
707933
708997
  if (prev.tungstenActiveSession === undefined)
707934
708998
  return prev;
@@ -708009,7 +709073,7 @@ Error: sandbox required but unavailable: ${reason}
708009
709073
  setPlanSlug(getSessionId(), oldPlanSlug);
708010
709074
  }
708011
709075
  }
708012
- const shouldStorePlanForVerification = initialMsg.message.planContent && { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && isEnvTruthy(undefined);
709076
+ const shouldStorePlanForVerification = initialMsg.message.planContent && { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && isEnvTruthy(undefined);
708013
709077
  setAppState((prev) => {
708014
709078
  let updatedToolPermissionContext = initialMsg.mode ? applyPermissionUpdates(prev.toolPermissionContext, buildPermissionUpdates(initialMsg.mode, initialMsg.allowedPrompts)) : prev.toolPermissionContext;
708015
709079
  if (feature("TRANSCRIPT_CLASSIFIER") && initialMsg.mode === "auto") {
@@ -708408,7 +709472,7 @@ Error: sandbox required but unavailable: ${reason}
708408
709472
  setAutoRunIssueReason(null);
708409
709473
  }, []);
708410
709474
  const handleSurveyRequestFeedback = import_react324.useCallback(() => {
708411
- const command9 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? "/issue" : "/feedback";
709475
+ const command9 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? "/issue" : "/feedback";
708412
709476
  onSubmit(command9, {
708413
709477
  setCursorOffset: () => {},
708414
709478
  clearBuffer: () => {},
@@ -708777,7 +709841,7 @@ ${fileList}`);
708777
709841
  assistantMode: scheduledTasksAssistantMode,
708778
709842
  setMessages
708779
709843
  });
708780
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
709844
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
708781
709845
  useTaskListWatcher({
708782
709846
  taskListId,
708783
709847
  isLoading,
@@ -708855,7 +709919,7 @@ Note: ctrl + z now suspends CCL, ctrl + _ undoes input.
708855
709919
  return total === 1 ? `${customMessage}…` : `${customMessage}… ${completedCount}/${total}`;
708856
709920
  }
708857
709921
  const hookType = currentHooks[0]?.data.hookEvent === "SubagentStop" ? "subagent stop" : "stop";
708858
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
709922
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
708859
709923
  const cmd = currentHooks[completedCount]?.data.command;
708860
709924
  const label = cmd ? ` '${truncateToWidth(cmd, 40)}'` : "";
708861
709925
  return total === 1 ? `running ${hookType} hook${label}` : `running ${hookType} hook${label}… ${completedCount}/${total}`;
@@ -709237,7 +710301,7 @@ Note: ctrl + z now suspends CCL, ctrl + _ undoes input.
709237
710301
  width: "100%",
709238
710302
  children: toolJSX.jsx
709239
710303
  }),
709240
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime475.jsx(TungstenLiveMonitor, {}),
710304
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime475.jsx(TungstenLiveMonitor, {}),
709241
710305
  feature("WEB_BROWSER_TOOL") ? WebBrowserPanelModule && /* @__PURE__ */ jsx_runtime475.jsx(WebBrowserPanelModule.WebBrowserPanel, {}) : null,
709242
710306
  /* @__PURE__ */ jsx_runtime475.jsx(ThemedBox_default, {
709243
710307
  flexGrow: 1
@@ -709496,7 +710560,7 @@ Note: ctrl + z now suspends CCL, ctrl + _ undoes input.
709496
710560
  onDone: () => setShowIdeOnboarding(false),
709497
710561
  installationStatus: ideInstallationStatus
709498
710562
  }),
709499
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && focusedInputDialog === "model-switch" && AntModelSwitchCallout26 && /* @__PURE__ */ jsx_runtime475.jsx(AntModelSwitchCallout26, {
710563
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && focusedInputDialog === "model-switch" && AntModelSwitchCallout26 && /* @__PURE__ */ jsx_runtime475.jsx(AntModelSwitchCallout26, {
709500
710564
  onDone: (selection, modelAlias) => {
709501
710565
  setShowModelSwitchCallout(false);
709502
710566
  if (selection === "switch" && modelAlias) {
@@ -709508,7 +710572,7 @@ Note: ctrl + z now suspends CCL, ctrl + _ undoes input.
709508
710572
  }
709509
710573
  }
709510
710574
  }),
709511
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && focusedInputDialog === "undercover-callout" && UndercoverAutoCallout26 && /* @__PURE__ */ jsx_runtime475.jsx(UndercoverAutoCallout26, {
710575
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && focusedInputDialog === "undercover-callout" && UndercoverAutoCallout26 && /* @__PURE__ */ jsx_runtime475.jsx(UndercoverAutoCallout26, {
709512
710576
  onDone: () => setShowUndercoverCallout(false)
709513
710577
  }),
709514
710578
  focusedInputDialog === "effort-callout" && /* @__PURE__ */ jsx_runtime475.jsx(EffortCallout, {
@@ -709642,7 +710706,7 @@ Note: ctrl + z now suspends CCL, ctrl + _ undoes input.
709642
710706
  inputValue,
709643
710707
  setInputValue
709644
710708
  }),
709645
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && skillImprovementSurvey.suggestion && /* @__PURE__ */ jsx_runtime475.jsx(SkillImprovementSurvey, {
710709
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && skillImprovementSurvey.suggestion && /* @__PURE__ */ jsx_runtime475.jsx(SkillImprovementSurvey, {
709646
710710
  isOpen: skillImprovementSurvey.isOpen,
709647
710711
  skillName: skillImprovementSurvey.suggestion.skillName,
709648
710712
  updates: skillImprovementSurvey.suggestion.updates,
@@ -709777,7 +710841,7 @@ Note: ctrl + z now suspends CCL, ctrl + _ undoes input.
709777
710841
  setMessageSelectorPreselect(undefined);
709778
710842
  }
709779
710843
  }),
709780
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime475.jsx(DevBar, {})
710844
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && /* @__PURE__ */ jsx_runtime475.jsx(DevBar, {})
709781
710845
  ]
709782
710846
  }),
709783
710847
  feature("BUDDY") && !(companionNarrow && isFullscreenEnvEnabled()) && companionVisible ? /* @__PURE__ */ jsx_runtime475.jsx(CompanionSprite, {}) : null
@@ -709908,6 +710972,7 @@ var init_REPL = __esm(() => {
709908
710972
  init_hooks5();
709909
710973
  init_useIdeSelection();
709910
710974
  init_tools2();
710975
+ init_interactionPolicy();
709911
710976
  init_agentToolUtils();
709912
710977
  init_resumeAgent();
709913
710978
  init_useMainLoopModel();
@@ -710010,17 +711075,17 @@ var init_REPL = __esm(() => {
710010
711075
  resetAnchor: () => {}
710011
711076
  });
710012
711077
  VoiceKeybindingHandler27 = runtimeVoiceFeature() ? (init_useVoiceIntegration(), __toCommonJS(exports_useVoiceIntegration)).VoiceKeybindingHandler : () => null;
710013
- useFrustrationDetection27 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? __toCommonJS(exports_useFrustrationDetection).useFrustrationDetection : () => ({
711078
+ useFrustrationDetection27 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? __toCommonJS(exports_useFrustrationDetection).useFrustrationDetection : () => ({
710014
711079
  state: "closed",
710015
711080
  handleTranscriptSelect: () => {}
710016
711081
  });
710017
- useAntOrgWarningNotification27 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? __toCommonJS(exports_useAntOrgWarningNotification).useAntOrgWarningNotification : () => {};
711082
+ useAntOrgWarningNotification27 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? __toCommonJS(exports_useAntOrgWarningNotification).useAntOrgWarningNotification : () => {};
710018
711083
  getCoordinatorUserContext27 = feature("COORDINATOR_MODE") ? (init_coordinatorMode(), __toCommonJS(exports_coordinatorMode)).getCoordinatorUserContext : () => ({});
710019
711084
  proactiveModule8 = feature("PROACTIVE") || feature("KAIROS") ? __toCommonJS(exports_proactive) : null;
710020
711085
  useProactive26 = feature("PROACTIVE") || feature("KAIROS") ? (init_useProactive(), __toCommonJS(exports_useProactive)).useProactive : null;
710021
- AntModelSwitchCallout26 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? (init_AntModelSwitchCallout(), __toCommonJS(exports_AntModelSwitchCallout)).AntModelSwitchCallout : null;
710022
- shouldShowAntModelSwitch = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? (init_AntModelSwitchCallout(), __toCommonJS(exports_AntModelSwitchCallout)).shouldShowModelSwitchCallout : () => false;
710023
- UndercoverAutoCallout26 = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? (init_UndercoverAutoCallout(), __toCommonJS(exports_UndercoverAutoCallout)).UndercoverAutoCallout : null;
711086
+ AntModelSwitchCallout26 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? (init_AntModelSwitchCallout(), __toCommonJS(exports_AntModelSwitchCallout)).AntModelSwitchCallout : null;
711087
+ shouldShowAntModelSwitch = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? (init_AntModelSwitchCallout(), __toCommonJS(exports_AntModelSwitchCallout)).shouldShowModelSwitchCallout : () => false;
711088
+ UndercoverAutoCallout26 = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? (init_UndercoverAutoCallout(), __toCommonJS(exports_UndercoverAutoCallout)).UndercoverAutoCallout : null;
710024
711089
  WebBrowserPanelModule = feature("WEB_BROWSER_TOOL") ? __toCommonJS(exports_WebBrowserPanel) : null;
710025
711090
  EMPTY_MCP_CLIENTS2 = [];
710026
711091
  HISTORY_STUB = {
@@ -713022,7 +714087,7 @@ function WelcomeV2() {
713022
714087
  dimColor: true,
713023
714088
  children: [
713024
714089
  "v",
713025
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
714090
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
713026
714091
  " "
713027
714092
  ]
713028
714093
  })
@@ -713221,7 +714286,7 @@ function WelcomeV2() {
713221
714286
  dimColor: true,
713222
714287
  children: [
713223
714288
  "v",
713224
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
714289
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
713225
714290
  " "
713226
714291
  ]
713227
714292
  })
@@ -713447,7 +714512,7 @@ function AppleTerminalWelcomeV2(t0) {
713447
714512
  dimColor: true,
713448
714513
  children: [
713449
714514
  "v",
713450
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
714515
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
713451
714516
  " "
713452
714517
  ]
713453
714518
  });
@@ -713665,7 +714730,7 @@ function AppleTerminalWelcomeV2(t0) {
713665
714730
  dimColor: true,
713666
714731
  children: [
713667
714732
  "v",
713668
- { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
714733
+ { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
713669
714734
  " "
713670
714735
  ]
713671
714736
  });
@@ -715332,7 +716397,7 @@ function completeOnboarding() {
715332
716397
  saveGlobalConfig((current) => ({
715333
716398
  ...current,
715334
716399
  hasCompletedOnboarding: true,
715335
- lastOnboardingVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
716400
+ lastOnboardingVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
715336
716401
  }));
715337
716402
  }
715338
716403
  function showDialog(root, renderer) {
@@ -725554,7 +726619,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
725554
726619
  allTools = [...allTools, syntheticOutputResult.tool];
725555
726620
  }
725556
726621
  }
725557
- return allTools;
726622
+ return filterToolsForInteractionMode(allTools, options.interactionMode);
725558
726623
  };
725559
726624
  let bridgeHandle = null;
725560
726625
  let bridgeLastForwardedIndex = 0;
@@ -727991,6 +729056,7 @@ var init_print = __esm(() => {
727991
729056
  init_uuid();
727992
729057
  init_generators();
727993
729058
  init_QueryEngine();
729059
+ init_interactionPolicy();
727994
729060
  init_fileStateCache();
727995
729061
  init_path();
727996
729062
  init_queryHelpers();
@@ -729016,7 +730082,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
729016
730082
  setCwd(cwd3);
729017
730083
  const server = new Server({
729018
730084
  name: "claude/tengu",
729019
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION
730085
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION
729020
730086
  }, {
729021
730087
  capabilities: {
729022
730088
  tools: {}
@@ -730821,7 +731887,7 @@ __export(exports_update, {
730821
731887
  });
730822
731888
  async function update() {
730823
731889
  logEvent("tengu_update_check", {});
730824
- writeToStdout(`Current version: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION}
731890
+ writeToStdout(`Current version: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION}
730825
731891
  `);
730826
731892
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
730827
731893
  writeToStdout(`Checking for updates to ${channel2} version...
@@ -730896,8 +731962,8 @@ async function update() {
730896
731962
  writeToStdout(`CCL is managed by Homebrew.
730897
731963
  `);
730898
731964
  const latest = await getLatestVersion(channel2);
730899
- if (latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, latest)) {
730900
- writeToStdout(`Update available: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} → ${latest}
731965
+ if (latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, latest)) {
731966
+ writeToStdout(`Update available: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} → ${latest}
730901
731967
  `);
730902
731968
  writeToStdout(`
730903
731969
  `);
@@ -730913,8 +731979,8 @@ async function update() {
730913
731979
  writeToStdout(`CCL is managed by winget.
730914
731980
  `);
730915
731981
  const latest = await getLatestVersion(channel2);
730916
- if (latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, latest)) {
730917
- writeToStdout(`Update available: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} → ${latest}
731982
+ if (latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, latest)) {
731983
+ writeToStdout(`Update available: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} → ${latest}
730918
731984
  `);
730919
731985
  writeToStdout(`
730920
731986
  `);
@@ -730930,8 +731996,8 @@ async function update() {
730930
731996
  writeToStdout(`CCL is managed by apk.
730931
731997
  `);
730932
731998
  const latest = await getLatestVersion(channel2);
730933
- if (latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION, latest)) {
730934
- writeToStdout(`Update available: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} → ${latest}
731999
+ if (latest && !gte({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION, latest)) {
732000
+ writeToStdout(`Update available: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} → ${latest}
730935
732001
  `);
730936
732002
  writeToStdout(`
730937
732003
  `);
@@ -730996,11 +732062,11 @@ async function update() {
730996
732062
  `);
730997
732063
  await gracefulShutdown(1);
730998
732064
  }
730999
- if (result.latestVersion === { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
731000
- writeToStdout(source_default.green(`CCL is up to date (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION})`) + `
732065
+ if (result.latestVersion === { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
732066
+ writeToStdout(source_default.green(`CCL is up to date (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION})`) + `
731001
732067
  `);
731002
732068
  } else {
731003
- writeToStdout(source_default.green(`Successfully updated from ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} to version ${result.latestVersion}`) + `
732069
+ writeToStdout(source_default.green(`Successfully updated from ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} to version ${result.latestVersion}`) + `
731004
732070
  `);
731005
732071
  await regenerateCompletionCache();
731006
732072
  }
@@ -731019,9 +732085,9 @@ async function update() {
731019
732085
  await removeInstalledSymlink();
731020
732086
  }
731021
732087
  logForDebugging("update: Checking npm registry for latest version");
731022
- logForDebugging(`update: Package URL: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}`);
732088
+ logForDebugging(`update: Package URL: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}`);
731023
732089
  const npmTag = channel2 === "stable" ? "stable" : "latest";
731024
- const npmCommand = `npm view ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}@${npmTag} version`;
732090
+ const npmCommand = `npm view ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}@${npmTag} version`;
731025
732091
  logForDebugging(`update: Running: ${npmCommand}`);
731026
732092
  const latestVersion = await getLatestVersion(channel2);
731027
732093
  logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
@@ -731041,7 +732107,7 @@ async function update() {
731041
732107
  `);
731042
732108
  process.stderr.write(` • Corporate proxy/firewall blocking npm
731043
732109
  `);
731044
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL && !{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL.startsWith("@anthropic")) {
732110
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL && !{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL.startsWith("@anthropic")) {
731045
732111
  process.stderr.write(` • Internal/development build not published to npm
731046
732112
  `);
731047
732113
  }
@@ -731053,19 +732119,19 @@ async function update() {
731053
732119
  `);
731054
732120
  process.stderr.write(` • Run with --debug flag for more details
731055
732121
  `);
731056
- const packageName = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@anthropic-ai/claude-cli" : "@anthropic-ai/claude-code");
732122
+ const packageName = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@anthropic-ai/claude-cli" : "@anthropic-ai/claude-code");
731057
732123
  process.stderr.write(` • Manually check: npm view ${packageName} version
731058
732124
  `);
731059
732125
  process.stderr.write(` • Check if you need to login: npm whoami
731060
732126
  `);
731061
732127
  await gracefulShutdown(1);
731062
732128
  }
731063
- if (latestVersion === { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION) {
731064
- writeToStdout(source_default.green(`CCL is up to date (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION})`) + `
732129
+ if (latestVersion === { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION) {
732130
+ writeToStdout(source_default.green(`CCL is up to date (${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION})`) + `
731065
732131
  `);
731066
732132
  await gracefulShutdown(0);
731067
732133
  }
731068
- writeToStdout(`New version available: ${latestVersion} (current: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION})
732134
+ writeToStdout(`New version available: ${latestVersion} (current: ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION})
731069
732135
  `);
731070
732136
  writeToStdout(`Installing update...
731071
732137
  `);
@@ -731110,7 +732176,7 @@ async function update() {
731110
732176
  logForDebugging(`update: Installation status: ${status2}`);
731111
732177
  switch (status2) {
731112
732178
  case "success":
731113
- writeToStdout(source_default.green(`Successfully updated from ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} to version ${latestVersion}`) + `
732179
+ writeToStdout(source_default.green(`Successfully updated from ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} to version ${latestVersion}`) + `
731114
732180
  `);
731115
732181
  await regenerateCompletionCache();
731116
732182
  break;
@@ -731120,7 +732186,7 @@ async function update() {
731120
732186
  if (useLocalUpdate) {
731121
732187
  process.stderr.write(`Try manually updating with:
731122
732188
  `);
731123
- process.stderr.write(` cd ~/.claude/local && npm update ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}
732189
+ process.stderr.write(` cd ~/.claude/local && npm update ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}
731124
732190
  `);
731125
732191
  } else {
731126
732192
  process.stderr.write(`Try running with sudo or fix npm permissions
@@ -731136,7 +732202,7 @@ async function update() {
731136
732202
  if (useLocalUpdate) {
731137
732203
  process.stderr.write(`Try manually updating with:
731138
732204
  `);
731139
- process.stderr.write(` cd ~/.claude/local && npm update ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.PACKAGE_URL}
732205
+ process.stderr.write(` cd ~/.claude/local && npm update ${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.PACKAGE_URL}
731140
732206
  `);
731141
732207
  } else {
731142
732208
  process.stderr.write(`Or consider using native installation with: margay install
@@ -731323,7 +732389,7 @@ function runMigrations() {
731323
732389
  if (feature("TRANSCRIPT_CLASSIFIER")) {
731324
732390
  resetAutoModeOptInForDefaultOffer();
731325
732391
  }
731326
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
732392
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
731327
732393
  migrateFennecToOpus();
731328
732394
  }
731329
732395
  saveGlobalConfig((prev) => prev.migrationVersion === CURRENT_MIGRATION_VERSION ? prev : {
@@ -731370,7 +732436,7 @@ function startDeferredPrefetches() {
731370
732436
  if (!isBareMode()) {
731371
732437
  skillChangeDetector.initialize();
731372
732438
  }
731373
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
732439
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
731374
732440
  Promise.resolve().then(() => exports_eventLoopStallDetector).then((m4) => m4.startEventLoopStallDetector());
731375
732441
  }
731376
732442
  }
@@ -731734,7 +732800,7 @@ async function run() {
731734
732800
  }
731735
732801
  profileCheckpoint("preAction_after_settings_sync");
731736
732802
  });
731737
- program2.name("margay").description(`Margay - starts an interactive session by default, use -p/--print for non-interactive output`).argument("[prompt]", "Your prompt", String).helpOption("-h, --help", "Display help for command").option("-d, --debug [filter]", 'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")', (_value) => {
732803
+ program2.name("margay").description(`Margay - starts an interactive session by default, use -p/--print for non-interactive output`).argument("[prompt]", "Your prompt", String).helpOption("-h, --help", "Display help for command").addOption(new Option("--interaction-mode <mode>", "User interaction policy for this session").choices([...INTERACTION_MODES]).default("local")).option("-d, --debug [filter]", 'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")', (_value) => {
731738
732804
  return true;
731739
732805
  }).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Write debug logs to a specific file path (implicitly enables debug mode)", () => true).option("--verbose", "Override verbose mode setting from config", () => true).option("-p, --print", "Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when CCL is run with the -p mode. Only use this flag in directories you trust.", () => true).option("--bare", "Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CCL.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CCL.md dirs), --mcp-config, --settings, --agents, --plugin-dir.", () => true).addOption(new Option("--init", "Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new Option("--init-only", "Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new Option("--maintenance", "Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new Option("--output-format <format>", 'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text", "json", "stream-json"])).addOption(new Option("--json-schema <schema>", 'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events", "Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)", () => true).option("--include-partial-messages", "Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)", () => true).addOption(new Option("--input-format <format>", 'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text", "stream-json"])).option("--mcp-debug", "[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)", () => true).option("--dangerously-skip-permissions", "Bypass all permission checks. Recommended only for sandboxes with no internet access.", () => true).option("--allow-dangerously-skip-permissions", "Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.", () => true).addOption(new Option("--thinking <mode>", "Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled", "adaptive", "disabled"]).hideHelp()).addOption(new Option("--max-thinking-tokens <tokens>", "[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-turns <turns>", "Maximum number of agentic turns in non-interactive mode (only works with --print). Default 70; use 0 for unlimited. Also settable via CCL_PRINT_MAX_TURNS env.").argParser(Number)).addOption(new Option("--max-budget-usd <amount>", "Maximum dollar amount to spend on API calls (only works with --print)").argParser((value) => {
731740
732806
  const amount = Number(value);
@@ -731866,9 +732932,9 @@ async function run() {
731866
732932
  const initOnly = options.initOnly ?? false;
731867
732933
  const maintenance = options.maintenance ?? false;
731868
732934
  const disableSlashCommands = options.disableSlashCommands || false;
731869
- const tasksOption = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && options.tasks;
732935
+ const tasksOption = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && options.tasks;
731870
732936
  const taskListId = tasksOption ? typeof tasksOption === "string" ? tasksOption : DEFAULT_TASKS_MODE_TASK_LIST_ID : undefined;
731871
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && taskListId) {
732937
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && taskListId) {
731872
732938
  process.env.CLAUDE_CODE_TASK_LIST_ID = taskListId;
731873
732939
  }
731874
732940
  const worktreeOption = isWorktreeModeEnabled() ? options.worktree : undefined;
@@ -731990,6 +733056,7 @@ ${getTmuxInstallInstructions2()}
731990
733056
  fileDownloadPromise = downloadSessionFiles(files2, config2);
731991
733057
  }
731992
733058
  }
733059
+ const interactionMode = parseInteractionMode(options.interactionMode);
731993
733060
  const isNonInteractiveSession = getIsNonInteractiveSession();
731994
733061
  if (fallbackModel && options.model && fallbackModel === options.model) {
731995
733062
  process.stderr.write(source_default.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
@@ -732153,7 +733220,7 @@ ${formattedErrors}
732153
733220
  }
732154
733221
  const chromeOpts = options;
732155
733222
  setChromeFlagOverride(chromeOpts.chrome);
732156
- const enableClaudeInChrome = shouldEnableClaudeInChrome(chromeOpts.chrome) && ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" || isClaudeAISubscriber());
733223
+ const enableClaudeInChrome = shouldEnableClaudeInChrome(chromeOpts.chrome) && ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" || isClaudeAISubscriber());
732157
733224
  const autoEnableClaudeInChrome = !enableClaudeInChrome && shouldAutoEnableClaudeInChrome();
732158
733225
  if (enableClaudeInChrome) {
732159
733226
  const platform6 = getPlatform();
@@ -732326,7 +733393,7 @@ ${hint}` : hint;
732326
733393
  dangerousPermissions,
732327
733394
  overlyBroadBashPermissions
732328
733395
  } = initResult;
732329
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && overlyBroadBashPermissions.length > 0) {
733396
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && overlyBroadBashPermissions.length > 0) {
732330
733397
  for (const permission of overlyBroadBashPermissions) {
732331
733398
  logForDebugging(`Ignoring overly broad shell permission ${permission.ruleDisplay} from ${permission.sourceDisplay}`);
732332
733399
  }
@@ -732393,12 +733460,12 @@ ${hint}` : hint;
732393
733460
  let inputPrompt = await getInputPrompt(effectivePrompt, inputFormat ?? "text");
732394
733461
  profileCheckpoint("action_after_input_prompt");
732395
733462
  maybeActivateProactive(options);
732396
- let tools = getTools(toolPermissionContext);
733463
+ let tools = filterToolsForInteractionMode(getTools(toolPermissionContext), interactionMode);
732397
733464
  if (feature("COORDINATOR_MODE") && isEnvTruthy(process.env.CLAUDE_CODE_COORDINATOR_MODE)) {
732398
733465
  const {
732399
733466
  applyCoordinatorToolFilter: applyCoordinatorToolFilter2
732400
733467
  } = await Promise.resolve().then(() => (init_toolPool(), exports_toolPool));
732401
- tools = applyCoordinatorToolFilter2(tools);
733468
+ tools = [...applyCoordinatorToolFilter2(tools)];
732402
733469
  }
732403
733470
  profileCheckpoint("action_tools_loaded");
732404
733471
  let jsonSchema;
@@ -732458,7 +733525,7 @@ ${hint}` : hint;
732458
733525
  cacheSessionTitle(sessionNameArg);
732459
733526
  }
732460
733527
  const explicitModel = options.model || process.env.ANTHROPIC_MODEL;
732461
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && explicitModel && explicitModel !== "default" && !hasGrowthBookEnvOverride("tengu_ant_model_override") && getGlobalConfig().cachedGrowthBookFeatures?.["tengu_ant_model_override"] == null) {
733528
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && explicitModel && explicitModel !== "default" && !hasGrowthBookEnvOverride("tengu_ant_model_override") && getGlobalConfig().cachedGrowthBookFeatures?.["tengu_ant_model_override"] == null) {
732462
733529
  await initializeGrowthBook();
732463
733530
  }
732464
733531
  const userSpecifiedModel = options.model === "default" ? getDefaultMainLoopModel() : options.model;
@@ -732579,7 +733646,7 @@ ${inputPrompt}` : mainThreadAgentDefinition.initialPrompt;
732579
733646
  }
732580
733647
  if (customAgent.memory) {
732581
733648
  logEvent("tengu_agent_memory_loaded", {
732582
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" && {
733649
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" && {
732583
733650
  agent_type: customAgent.agentType
732584
733651
  },
732585
733652
  scope: customAgent.memory,
@@ -732627,6 +733694,7 @@ ${proactivePrompt}` : proactivePrompt;
732627
733694
 
732628
733695
  ${assistantAddendum}` : assistantAddendum;
732629
733696
  }
733697
+ appendSystemPrompt = appendInteractionGuidance(appendSystemPrompt, interactionMode);
732630
733698
  let root;
732631
733699
  let getFpsMetrics;
732632
733700
  let stats2;
@@ -732634,7 +733702,7 @@ ${assistantAddendum}` : assistantAddendum;
732634
733702
  const ctx = getRenderContext(false);
732635
733703
  getFpsMetrics = ctx.getFpsMetrics;
732636
733704
  stats2 = ctx.stats;
732637
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
733705
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
732638
733706
  installAsciicastRecorder();
732639
733707
  }
732640
733708
  const {
@@ -732822,7 +733890,7 @@ ${inputPrompt}` : mergePrompt;
732822
733890
  }
732823
733891
  }
732824
733892
  logForDiagnosticsNoPII("info", "started", {
732825
- version: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
733893
+ version: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
732826
733894
  is_native_binary: isInBundledMode()
732827
733895
  });
732828
733896
  registerCleanup(async () => {
@@ -733055,7 +734123,7 @@ ${inputPrompt}` : mergePrompt;
733055
734123
  if (!isBareMode()) {
733056
734124
  startDeferredPrefetches();
733057
734125
  Promise.resolve().then(() => (init_backgroundHousekeeping(), exports_backgroundHousekeeping)).then((m4) => m4.startBackgroundHousekeeping());
733058
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
734126
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
733059
734127
  Promise.resolve().then(() => exports_sdkHeapDumpMonitor).then((m4) => m4.startSdkMemoryMonitor());
733060
734128
  }
733061
734129
  }
@@ -733094,7 +734162,8 @@ ${inputPrompt}` : mergePrompt;
733094
734162
  agent: agentCli,
733095
734163
  workload: options.workload,
733096
734164
  setupTrigger: setupTrigger ?? undefined,
733097
- sessionStartHooksPromise
734165
+ sessionStartHooksPromise,
734166
+ interactionMode
733098
734167
  });
733099
734168
  return;
733100
734169
  }
@@ -733267,7 +734336,7 @@ ${inputPrompt}` : mergePrompt;
733267
734336
  logStartupTelemetry();
733268
734337
  logSessionTelemetry();
733269
734338
  });
733270
- const sessionUploaderPromise = { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? Promise.resolve().then(() => exports_sessionDataUploader) : null;
734339
+ const sessionUploaderPromise = { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? Promise.resolve().then(() => exports_sessionDataUploader) : null;
733271
734340
  const uploaderReady = sessionUploaderPromise ? sessionUploaderPromise.then((mod4) => mod4.createSessionTurnUploader()).catch(() => null) : null;
733272
734341
  const sessionConfig = {
733273
734342
  debug: debug5 || debugToStderr,
@@ -733281,6 +734350,7 @@ ${inputPrompt}` : mergePrompt;
733281
734350
  strictMcpConfig,
733282
734351
  systemPrompt,
733283
734352
  appendSystemPrompt,
734353
+ interactionMode,
733284
734354
  taskListId,
733285
734355
  thinkingConfig,
733286
734356
  ...uploaderReady && {
@@ -733410,7 +734480,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
733410
734480
  sshSession = await createSSHSession2({
733411
734481
  host: _pendingSSH.host,
733412
734482
  cwd: _pendingSSH.cwd,
733413
- localVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION,
734483
+ localVersion: { USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION,
733414
734484
  permissionMode: _pendingSSH.permissionMode,
733415
734485
  dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
733416
734486
  extraCliArgs: _pendingSSH.extraCliArgs
@@ -733712,7 +734782,7 @@ Usage: margay --remote "your task description"`, () => gracefulShutdown(1));
733712
734782
  }
733713
734783
  }
733714
734784
  }
733715
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
734785
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
733716
734786
  if (options.resume && typeof options.resume === "string" && !maybeSessionId) {
733717
734787
  const {
733718
734788
  parseCcshareId: parseCcshareId2,
@@ -733915,13 +734985,13 @@ Usage: margay --remote "your task description"`, () => gracefulShutdown(1));
733915
734985
  pendingHookMessages
733916
734986
  }, renderAndRun);
733917
734987
  }
733918
- }).version(`${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} (CCL)`, "-v, --version", "Output the version number");
734988
+ }).version(`${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} (CCL)`, "-v, --version", "Output the version number");
733919
734989
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
733920
734990
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
733921
734991
  if (canUserConfigureAdvisor()) {
733922
734992
  program2.addOption(new Option("--advisor <model>", "Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());
733923
734993
  }
733924
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
734994
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
733925
734995
  program2.addOption(new Option("--delegate-permissions", "[ANT-ONLY] Alias for --permission-mode auto.").implies({
733926
734996
  permissionMode: "auto"
733927
734997
  }));
@@ -734325,7 +735395,7 @@ Omit sessionId to discover and pick from available sessions.
734325
735395
  } = await Promise.resolve().then(() => (init_update(), exports_update));
734326
735396
  await update2();
734327
735397
  });
734328
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
735398
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
734329
735399
  program2.command("up").description('[ANT-ONLY] Initialize or upgrade the local dev environment using the "# claude up" section of the nearest CCL.md').action(async () => {
734330
735400
  const {
734331
735401
  up: up2
@@ -734333,7 +735403,7 @@ Omit sessionId to discover and pick from available sessions.
734333
735403
  await up2();
734334
735404
  });
734335
735405
  }
734336
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
735406
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
734337
735407
  program2.command("rollback [target]").description(`[ANT-ONLY] Roll back to a previous release
734338
735408
 
734339
735409
  Examples:
@@ -734352,7 +735422,7 @@ Examples:
734352
735422
  } = await Promise.resolve().then(() => (init_util(), exports_util));
734353
735423
  await installHandler2(target, options);
734354
735424
  });
734355
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
735425
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
734356
735426
  const validateLogId = (value) => {
734357
735427
  const maybeSessionId = validateUuid2(value);
734358
735428
  if (maybeSessionId)
@@ -734382,7 +735452,7 @@ Examples:
734382
735452
  } = await Promise.resolve().then(() => exports_ant);
734383
735453
  await exportHandler2(source, outputFile);
734384
735454
  });
734385
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant") {
735455
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant") {
734386
735456
  const taskCmd = program2.command("task").description("[ANT-ONLY] Manage task list tasks");
734387
735457
  taskCmd.command("create <subject>").description("Create a new task").option("-d, --description <text>", "Task description").option("-l, --list <id>", 'Task list ID (defaults to "tasklist")').action(async (subject, opts) => {
734388
735458
  const {
@@ -734492,7 +735562,7 @@ async function logTenguInit({
734492
735562
  assistantActivationPath
734493
735563
  },
734494
735564
  autoUpdatesChannel: getInitialSettings().autoUpdatesChannel ?? "latest",
734495
- ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE === "ant" ? (() => {
735565
+ ...{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE === "ant" ? (() => {
734496
735566
  const cwd5 = getCwd();
734497
735567
  const gitRoot = findGitRoot(cwd5);
734498
735568
  const rp = gitRoot ? relative39(gitRoot, cwd5) || "." : undefined;
@@ -734579,6 +735649,7 @@ var init_main2 = __esm(() => {
734579
735649
  init_workflow_run();
734580
735650
  init_cwdGlobal();
734581
735651
  init_tools2();
735652
+ init_interactionPolicy();
734582
735653
  init_advisor();
734583
735654
  init_agentSwarmsEnabled();
734584
735655
  init_asciicast();
@@ -734714,7 +735785,7 @@ var init_main2 = __esm(() => {
734714
735785
  kairosGate = feature("KAIROS") ? __toCommonJS(exports_gate) : null;
734715
735786
  autoModeStateModule7 = feature("TRANSCRIPT_CLASSIFIER") ? __toCommonJS(exports_autoModeState) : null;
734716
735787
  profileCheckpoint("main_tsx_imports_loaded");
734717
- if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.USER_TYPE !== "ant" && isBeingDebugged()) {
735788
+ if ({ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.USER_TYPE !== "ant" && isBeingDebugged()) {
734718
735789
  process.exit(1);
734719
735790
  }
734720
735791
  _pendingConnect = feature("DIRECT_CONNECT") ? {
@@ -734821,7 +735892,7 @@ if (feature("ABLATION_BASELINE") && process.env.CLAUDE_CODE_ABLATION_BASELINE) {
734821
735892
  async function main2() {
734822
735893
  const args = process.argv.slice(2);
734823
735894
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
734824
- console.log(`${{ USER_TYPE: "external", VERSION: "1.3.5-rc.6", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-08-27T13:53:11.177Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.6" }.VERSION} (Margay)`);
735895
+ console.log(`${{ USER_TYPE: "external", VERSION: "1.3.5-rc.8", PACKAGE_URL: "@margay/ccl-core", BUILD_TIMESTAMP: "2026-09-02T05:11:29.580Z", ISSUES_EXPLAINER: "", VERSION_CHANGELOG: "", NATIVE_PACKAGE_URL: "", CLAUDE_VERSION: "1.3.5-rc.8" }.VERSION} (Margay)`);
734825
735896
  return;
734826
735897
  }
734827
735898
  const {