@costrict/csc 4.2.10 → 4.2.12-beat1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -36297,6 +36297,7 @@ var init_ui_messages = __esm(() => {
36297
36297
  "messages.tokenWarning": "Approaching token limit ({used}/{max})",
36298
36298
  "messages.loadingHistory": "Loading conversation history...",
36299
36299
  "messages.noHistory": "No conversation history found",
36300
+ "messages.emergencyTruncated": "The conversation exceeded the model context limit, so I truncated the oldest messages to keep the most recent context. If you need earlier details, run /compact to create a summary, or /clear to start a new session.",
36300
36301
  "messages.sessionRestored": "Session restored: {name}",
36301
36302
  "messages.querySent": "Query sent, waiting for response...",
36302
36303
  "messages.streamComplete": "Response complete ({tokens} tokens)",
@@ -36395,6 +36396,7 @@ var init_ui_common = __esm(() => {
36395
36396
  "settings.config.saved.message": "Set {key} to {value}",
36396
36397
  "settings.config.saved.enabled": "Enabled",
36397
36398
  "settings.config.saved.disabled": "Disabled",
36399
+ "settings.config.saved.askUserQuestionAutoSelect": "{action} first-option auto-select for questions",
36398
36400
  "settings.config.saved.customApiKey": "{action} custom API key",
36399
36401
  "settings.config.saved.theme": "Set theme to {value}",
36400
36402
  "settings.config.saved.notifications": "Set notifications to {value}",
@@ -37370,6 +37372,7 @@ var init_ui_common = __esm(() => {
37370
37372
  "settings.copy.on.select": "Copy on select",
37371
37373
  "settings.default.english": "Default english",
37372
37374
  "settings.default.permission.mode": "Default permission mode",
37375
+ "settings.askUserQuestion.autoSelect": "Auto-select first question option",
37373
37376
  "settings.editor.mode": "Editor mode",
37374
37377
  "settings.fast.mode": "Fast mode",
37375
37378
  "settings.language": "Language",
@@ -40027,7 +40030,7 @@ var init_ui_components = __esm(() => {
40027
40030
  "components.retry": "Retry",
40028
40031
  "components.retrying": "Retrying",
40029
40032
  "components.retrying.in": "Retrying in",
40030
- "components.retrying.in.detail": "Retrying in {seconds} second(s) (attempt {attempt}/{max})",
40033
+ "components.retrying.in.detail": "Retrying in {seconds}s ({attempt}/{max})",
40031
40034
  "components.retrying.timeout.hint": " \xB7 API_TIMEOUT_MS={timeout}ms, try increasing it",
40032
40035
  "components.review.the.requested.local.action.before.continuing": "Review the requested local action before continuing",
40033
40036
  "components.reviewing": "Reviewing",
@@ -40824,6 +40827,7 @@ var init_ui_messages2 = __esm(() => {
40824
40827
  "messages.exportSuccess": "\u5DF2\u5BFC\u51FA\u5230 {path}",
40825
40828
  "messages.loadingHistory": "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD\u5386\u53F2...",
40826
40829
  "messages.noHistory": "\u672A\u627E\u5230\u5BF9\u8BDD\u5386\u53F2",
40830
+ "messages.emergencyTruncated": "\u5BF9\u8BDD\u5DF2\u8D85\u51FA\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\uFF0C\u6211\u5DF2\u622A\u65AD\u6700\u65E7\u7684\u6D88\u606F\u4EE5\u4FDD\u7559\u6700\u65B0\u4E0A\u4E0B\u6587\u3002\u5982\u9700\u67E5\u770B\u4E4B\u524D\u7684\u5185\u5BB9\uFF0C\u8BF7\u8FD0\u884C /compact \u751F\u6210\u6458\u8981\uFF0C\u6216\u8FD0\u884C /clear \u5F00\u59CB\u65B0\u4F1A\u8BDD\u3002",
40827
40831
  "messages.pressAnyKey": "\u6309\u4EFB\u610F\u952E\u7EE7\u7EED\u2026",
40828
40832
  "messages.unknownError": "\u672A\u77E5\u9519\u8BEF",
40829
40833
  "messages.querySent": "\u67E5\u8BE2\u5DF2\u53D1\u9001\uFF0C\u7B49\u5F85\u54CD\u5E94...",
@@ -40910,6 +40914,7 @@ var init_ui_common2 = __esm(() => {
40910
40914
  "settings.config.saved.message": "\u5DF2\u8BBE\u7F6E {key} \u4E3A {value}",
40911
40915
  "settings.config.saved.enabled": "\u5DF2\u542F\u7528",
40912
40916
  "settings.config.saved.disabled": "\u5DF2\u7981\u7528",
40917
+ "settings.config.saved.askUserQuestionAutoSelect": "{action}\u95EE\u9898\u9996\u4E2A\u9009\u9879\u81EA\u52A8\u9009\u62E9",
40913
40918
  "settings.config.saved.customApiKey": "{action}\u81EA\u5B9A\u4E49 API \u5BC6\u94A5",
40914
40919
  "settings.config.saved.theme": "\u5DF2\u8BBE\u7F6E\u4E3B\u9898\u4E3A {value}",
40915
40920
  "settings.config.saved.notifications": "\u5DF2\u8BBE\u7F6E\u901A\u77E5\u4E3A {value}",
@@ -41885,6 +41890,7 @@ var init_ui_common2 = __esm(() => {
41885
41890
  "settings.copy.on.select": "\u9009\u4E2D\u5373\u590D\u5236",
41886
41891
  "settings.default.english": "\u9ED8\u8BA4\u82F1\u6587",
41887
41892
  "settings.default.permission.mode": "\u9ED8\u8BA4\u6743\u9650\u6A21\u5F0F",
41893
+ "settings.askUserQuestion.autoSelect": "\u81EA\u52A8\u9009\u62E9\u95EE\u9898\u7684\u9996\u4E2A\u9009\u9879",
41888
41894
  "settings.editor.mode": "\u7F16\u8F91\u5668\u6A21\u5F0F",
41889
41895
  "settings.fast.mode": "\u5FEB\u901F\u6A21\u5F0F",
41890
41896
  "settings.language": "\u8BED\u8A00",
@@ -44539,7 +44545,7 @@ var init_ui_components2 = __esm(() => {
44539
44545
  "components.retry": "\u91CD\u8BD5",
44540
44546
  "components.retrying": "\u91CD\u8BD5\u4E2D",
44541
44547
  "components.retrying.in": "\u5C06\u5728\u4EE5\u4E0B\u65F6\u95F4\u540E\u91CD\u8BD5",
44542
- "components.retrying.in.detail": "\u5C06\u5728 {seconds} \u79D2\u540E\u91CD\u8BD5\uFF08\u7B2C {attempt}/{max} \u6B21\uFF09",
44548
+ "components.retrying.in.detail": "\u5C06\u5728 {seconds} \u79D2\u540E\u91CD\u8BD5\uFF08{attempt}/{max}\uFF09",
44543
44549
  "components.retrying.timeout.hint": " \xB7 API_TIMEOUT_MS={timeout}ms\uFF0C\u8BF7\u5C1D\u8BD5\u589E\u5927\u8D85\u65F6\u65F6\u95F4",
44544
44550
  "components.review.the.requested.local.action.before.continuing": "\u7EE7\u7EED\u524D\u8BF7\u5BA1\u67E5\u8BF7\u6C42\u7684\u672C\u5730\u64CD\u4F5C",
44545
44551
  "components.reviewing": "\u5BA1\u67E5\u4E2D",
@@ -63706,8 +63712,8 @@ function getClientVersion() {
63706
63712
  if (cached)
63707
63713
  return cached;
63708
63714
  try {
63709
- if ("4.2.10") {
63710
- cached = "4.2.10";
63715
+ if ("4.2.12-beat1") {
63716
+ cached = "4.2.12-beat1";
63711
63717
  return cached;
63712
63718
  }
63713
63719
  } catch {}
@@ -93309,7 +93315,8 @@ var init_types2 = __esm(() => {
93309
93315
  ...{
93310
93316
  defaultView: exports_external.enum(["chat", "transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")
93311
93317
  },
93312
- askUserQuestionTimeoutSeconds: exports_external.number().int().nonnegative().optional().describe("Timeout in seconds before the first option is auto-selected in AskUserQuestion dialogs (default: 600). Set to 0 to immediately select the first option without showing the dialog."),
93318
+ askUserQuestionAutoSelectEnabled: exports_external.boolean().optional().describe("Whether AskUserQuestion auto-selects the first option after a timeout (default: enabled). When false, AskUserQuestion never auto-selects first options and askUserQuestionTimeoutSeconds is ignored."),
93319
+ askUserQuestionTimeoutSeconds: exports_external.number().int().nonnegative().optional().describe("Timeout in seconds before the first option is auto-selected in AskUserQuestion dialogs when askUserQuestionAutoSelectEnabled is not false (default: 600). Set to 0 to immediately select the first option without showing the dialog."),
93313
93320
  prefersReducedMotion: exports_external.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),
93314
93321
  autoMemoryEnabled: exports_external.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),
93315
93322
  autoMemoryDirectory: exports_external.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .costrict/settings.json) for security. When unset, defaults to ~/.costrict/projects/<sanitized-cwd>/memory/."),
@@ -138240,7 +138247,30 @@ class AwsAuthStatusManager {
138240
138247
  var init_awsAuthStatusManager = () => {};
138241
138248
 
138242
138249
  // src/constants/betas.ts
138243
- var CLAUDE_CODE_20250219_BETA_HEADER = "claude-code-20250219", INTERLEAVED_THINKING_BETA_HEADER = "interleaved-thinking-2025-05-14", CONTEXT_1M_BETA_HEADER = "context-1m-2025-08-07", CONTEXT_MANAGEMENT_BETA_HEADER = "context-management-2025-06-27", STRUCTURED_OUTPUTS_BETA_HEADER = "structured-outputs-2025-12-15", WEB_SEARCH_BETA_HEADER = "web-search-2025-03-05", SEARCH_EXTRA_TOOLS_BETA_HEADER_3P = "tool-search-tool-2025-10-19", EFFORT_BETA_HEADER = "effort-2025-11-24", TASK_BUDGETS_BETA_HEADER = "task-budgets-2026-03-13", PROMPT_CACHING_SCOPE_BETA_HEADER = "prompt-caching-scope-2026-01-05", FAST_MODE_BETA_HEADER = "fast-mode-2026-02-01", REDACT_THINKING_BETA_HEADER = "redact-thinking-2026-02-12", TOKEN_EFFICIENT_TOOLS_BETA_HEADER = "token-efficient-tools-2026-03-28", AFK_MODE_BETA_HEADER = "afk-mode-2026-01-31", CLI_INTERNAL_BETA_HEADER, ADVISOR_BETA_HEADER = "advisor-tool-2026-03-01", BEDROCK_EXTRA_PARAMS_HEADERS, VERTEX_COUNT_TOKENS_ALLOWED_BETAS;
138250
+ var exports_betas = {};
138251
+ __export(exports_betas, {
138252
+ WEB_SEARCH_BETA_HEADER: () => WEB_SEARCH_BETA_HEADER,
138253
+ VERTEX_COUNT_TOKENS_ALLOWED_BETAS: () => VERTEX_COUNT_TOKENS_ALLOWED_BETAS,
138254
+ TOKEN_EFFICIENT_TOOLS_BETA_HEADER: () => TOKEN_EFFICIENT_TOOLS_BETA_HEADER,
138255
+ TASK_BUDGETS_BETA_HEADER: () => TASK_BUDGETS_BETA_HEADER,
138256
+ STRUCTURED_OUTPUTS_BETA_HEADER: () => STRUCTURED_OUTPUTS_BETA_HEADER,
138257
+ SEARCH_EXTRA_TOOLS_BETA_HEADER_3P: () => SEARCH_EXTRA_TOOLS_BETA_HEADER_3P,
138258
+ SEARCH_EXTRA_TOOLS_BETA_HEADER_1P: () => SEARCH_EXTRA_TOOLS_BETA_HEADER_1P,
138259
+ REDACT_THINKING_BETA_HEADER: () => REDACT_THINKING_BETA_HEADER,
138260
+ PROMPT_CACHING_SCOPE_BETA_HEADER: () => PROMPT_CACHING_SCOPE_BETA_HEADER,
138261
+ INTERLEAVED_THINKING_BETA_HEADER: () => INTERLEAVED_THINKING_BETA_HEADER,
138262
+ FAST_MODE_BETA_HEADER: () => FAST_MODE_BETA_HEADER,
138263
+ EFFORT_BETA_HEADER: () => EFFORT_BETA_HEADER,
138264
+ CONTEXT_MANAGEMENT_BETA_HEADER: () => CONTEXT_MANAGEMENT_BETA_HEADER,
138265
+ CONTEXT_1M_BETA_HEADER: () => CONTEXT_1M_BETA_HEADER,
138266
+ CLI_INTERNAL_BETA_HEADER: () => CLI_INTERNAL_BETA_HEADER,
138267
+ CLAUDE_CODE_20250219_BETA_HEADER: () => CLAUDE_CODE_20250219_BETA_HEADER,
138268
+ CACHE_EDITING_BETA_HEADER: () => CACHE_EDITING_BETA_HEADER,
138269
+ BEDROCK_EXTRA_PARAMS_HEADERS: () => BEDROCK_EXTRA_PARAMS_HEADERS,
138270
+ AFK_MODE_BETA_HEADER: () => AFK_MODE_BETA_HEADER,
138271
+ ADVISOR_BETA_HEADER: () => ADVISOR_BETA_HEADER
138272
+ });
138273
+ var CLAUDE_CODE_20250219_BETA_HEADER = "claude-code-20250219", INTERLEAVED_THINKING_BETA_HEADER = "interleaved-thinking-2025-05-14", CONTEXT_1M_BETA_HEADER = "context-1m-2025-08-07", CONTEXT_MANAGEMENT_BETA_HEADER = "context-management-2025-06-27", STRUCTURED_OUTPUTS_BETA_HEADER = "structured-outputs-2025-12-15", WEB_SEARCH_BETA_HEADER = "web-search-2025-03-05", SEARCH_EXTRA_TOOLS_BETA_HEADER_1P = "advanced-tool-use-2025-11-20", SEARCH_EXTRA_TOOLS_BETA_HEADER_3P = "tool-search-tool-2025-10-19", EFFORT_BETA_HEADER = "effort-2025-11-24", TASK_BUDGETS_BETA_HEADER = "task-budgets-2026-03-13", PROMPT_CACHING_SCOPE_BETA_HEADER = "prompt-caching-scope-2026-01-05", FAST_MODE_BETA_HEADER = "fast-mode-2026-02-01", REDACT_THINKING_BETA_HEADER = "redact-thinking-2026-02-12", TOKEN_EFFICIENT_TOOLS_BETA_HEADER = "token-efficient-tools-2026-03-28", AFK_MODE_BETA_HEADER = "afk-mode-2026-01-31", CLI_INTERNAL_BETA_HEADER, ADVISOR_BETA_HEADER = "advisor-tool-2026-03-01", BEDROCK_EXTRA_PARAMS_HEADERS, VERTEX_COUNT_TOKENS_ALLOWED_BETAS, CACHE_EDITING_BETA_HEADER;
138244
138274
  var init_betas = __esm(() => {
138245
138275
  CLI_INTERNAL_BETA_HEADER = process.env.USER_TYPE === "sf" ? "cli-internal-2026-02-09" : "";
138246
138276
  BEDROCK_EXTRA_PARAMS_HEADERS = new Set([
@@ -138253,6 +138283,7 @@ var init_betas = __esm(() => {
138253
138283
  INTERLEAVED_THINKING_BETA_HEADER,
138254
138284
  CONTEXT_MANAGEMENT_BETA_HEADER
138255
138285
  ]);
138286
+ CACHE_EDITING_BETA_HEADER = process.env.COSTRICT_CACHE_EDITING_BETA_HEADER ?? process.env.CLAUDE_CACHE_EDITING_BETA_HEADER ?? process.env.CLAUDE_CODE_CACHE_EDITING_BETA_HEADER ?? "";
138256
138287
  });
138257
138288
 
138258
138289
  // src/utils/model/sfModels.ts
@@ -138845,7 +138876,7 @@ async function fetchCoStrictModels(baseUrl, accessToken) {
138845
138876
  headers: {
138846
138877
  Authorization: `Bearer ${accessToken}`,
138847
138878
  Accept: "application/json",
138848
- "User-Agent": `csc/${"4.2.10"}`
138879
+ "User-Agent": `csc/${"4.2.12-beat1"}`
138849
138880
  },
138850
138881
  signal: controller.signal
138851
138882
  });
@@ -187678,7 +187709,7 @@ var init_auth7 = __esm(() => {
187678
187709
 
187679
187710
  // src/utils/userAgent.ts
187680
187711
  function getClaudeCodeUserAgent() {
187681
- return `costrict/${"4.2.10"}`;
187712
+ return `costrict/${"4.2.12-beat1"}`;
187682
187713
  }
187683
187714
 
187684
187715
  // src/utils/workloadContext.ts
@@ -187700,7 +187731,7 @@ function getUserAgent() {
187700
187731
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
187701
187732
  const workload = getWorkload();
187702
187733
  const workloadSuffix = workload ? `, workload/${workload}` : "";
187703
- return `csc/${"4.2.10"}`;
187734
+ return `csc/${"4.2.12-beat1"}`;
187704
187735
  }
187705
187736
  function getMCPUserAgent() {
187706
187737
  const parts = [];
@@ -187714,7 +187745,7 @@ function getMCPUserAgent() {
187714
187745
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
187715
187746
  }
187716
187747
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
187717
- return `csc/${"4.2.10"}${suffix}`;
187748
+ return `csc/${"4.2.12-beat1"}${suffix}`;
187718
187749
  }
187719
187750
  function getWebFetchUserAgent() {
187720
187751
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -187834,7 +187865,7 @@ var init_user = __esm(() => {
187834
187865
  deviceId,
187835
187866
  sessionId: getSessionId(),
187836
187867
  email: getEmail(),
187837
- appVersion: "4.2.10",
187868
+ appVersion: "4.2.12-beat1",
187838
187869
  platform: getHostPlatformForAnalytics(),
187839
187870
  organizationUuid,
187840
187871
  accountUuid,
@@ -198915,7 +198946,7 @@ var init_metadata = __esm(() => {
198915
198946
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
198916
198947
  WHITESPACE_REGEX = /\s+/;
198917
198948
  getVersionBase = memoize_default(() => {
198918
- const match = "4.2.10".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
198949
+ const match = "4.2.12-beat1".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
198919
198950
  return match ? match[0] : undefined;
198920
198951
  });
198921
198952
  buildEnvContext = memoize_default(async () => {
@@ -198955,9 +198986,9 @@ var init_metadata = __esm(() => {
198955
198986
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
198956
198987
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
198957
198988
  isClaudeAiAuth: isClaudeAISubscriber(),
198958
- version: "4.2.10",
198989
+ version: "4.2.12-beat1",
198959
198990
  versionBase: getVersionBase(),
198960
- buildTime: "2026-07-07T11:49:19.693Z",
198991
+ buildTime: "2026-07-13T01:43:36.376Z",
198961
198992
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
198962
198993
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
198963
198994
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -199628,7 +199659,7 @@ function initialize1PEventLogging() {
199628
199659
  const platform3 = getPlatform();
199629
199660
  const attributes = {
199630
199661
  [import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
199631
- [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.10"
199662
+ [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.12-beat1"
199632
199663
  };
199633
199664
  if (platform3 === "wsl") {
199634
199665
  const wslVersion = getWslVersion();
@@ -199655,7 +199686,7 @@ function initialize1PEventLogging() {
199655
199686
  })
199656
199687
  ]
199657
199688
  });
199658
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.10");
199689
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.12-beat1");
199659
199690
  }
199660
199691
  async function reinitialize1PEventLoggingIfConfigChanged() {
199661
199692
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -281862,7 +281893,107 @@ var init_timeBasedMCConfig = __esm(() => {
281862
281893
  };
281863
281894
  });
281864
281895
 
281896
+ // src/services/compact/cachedMicrocompact.ts
281897
+ var exports_cachedMicrocompact = {};
281898
+ __export(exports_cachedMicrocompact, {
281899
+ resetCachedMCState: () => resetCachedMCState,
281900
+ registerToolResult: () => registerToolResult,
281901
+ registerToolMessage: () => registerToolMessage,
281902
+ markToolsSentToAPI: () => markToolsSentToAPI,
281903
+ isModelSupportedForCacheEditing: () => isModelSupportedForCacheEditing,
281904
+ isCachedMicrocompactEnabled: () => isCachedMicrocompactEnabled,
281905
+ getToolResultsToDelete: () => getToolResultsToDelete,
281906
+ getCachedMCConfig: () => getCachedMCConfig,
281907
+ createCachedMCState: () => createCachedMCState,
281908
+ createCacheEditsBlock: () => createCacheEditsBlock
281909
+ });
281910
+ function isCachedMicrocompactEnabled() {
281911
+ const disable2 = process.env.COSTRICT_DISABLE_CACHED_MICROCOMPACT ?? process.env.CLAUDE_DISABLE_CACHED_MICROCOMPACT ?? process.env.CLAUDE_CODE_DISABLE_CACHED_MICROCOMPACT;
281912
+ if (disable2 === "1" || disable2?.toLowerCase() === "true") {
281913
+ return false;
281914
+ }
281915
+ const enable2 = process.env.COSTRICT_CACHED_MICROCOMPACT ?? process.env.CLAUDE_CACHED_MICROCOMPACT ?? process.env.CLAUDE_CODE_CACHED_MICROCOMPACT;
281916
+ if (enable2 !== undefined) {
281917
+ return enable2 === "1" || enable2.toLowerCase() === "true";
281918
+ }
281919
+ return CACHE_EDITING_BETA_HEADER.length > 0;
281920
+ }
281921
+ function isModelSupportedForCacheEditing(model) {
281922
+ return /claude-[a-z]+-4[-\d]/.test(model);
281923
+ }
281924
+ function getCachedMCConfig() {
281925
+ return { triggerThreshold: TRIGGER_THRESHOLD, keepRecent: KEEP_RECENT };
281926
+ }
281927
+ function createCachedMCState() {
281928
+ return {
281929
+ registeredTools: new Set,
281930
+ toolOrder: [],
281931
+ deletedRefs: new Set,
281932
+ pinnedEdits: [],
281933
+ toolsSentToAPI: false
281934
+ };
281935
+ }
281936
+ function markToolsSentToAPI(state3) {
281937
+ state3.toolsSentToAPI = true;
281938
+ }
281939
+ function resetCachedMCState(state3) {
281940
+ state3.registeredTools.clear();
281941
+ state3.toolOrder = [];
281942
+ state3.deletedRefs.clear();
281943
+ state3.pinnedEdits = [];
281944
+ state3.toolsSentToAPI = false;
281945
+ }
281946
+ function registerToolResult(state3, toolId) {
281947
+ if (!state3.registeredTools.has(toolId)) {
281948
+ state3.registeredTools.add(toolId);
281949
+ state3.toolOrder.push(toolId);
281950
+ }
281951
+ }
281952
+ function registerToolMessage(state3, groupIds) {
281953
+ for (const id of groupIds) {
281954
+ registerToolResult(state3, id);
281955
+ }
281956
+ }
281957
+ function getToolResultsToDelete(state3) {
281958
+ const { triggerThreshold, keepRecent } = getCachedMCConfig();
281959
+ const active = state3.toolOrder.filter((id) => !state3.deletedRefs.has(id));
281960
+ if (active.length <= triggerThreshold)
281961
+ return [];
281962
+ const toDelete = active.slice(0, active.length - keepRecent);
281963
+ return toDelete;
281964
+ }
281965
+ function createCacheEditsBlock(_state, toolIds) {
281966
+ if (toolIds.length === 0)
281967
+ return null;
281968
+ return {
281969
+ type: "cache_edits",
281970
+ edits: toolIds.map((id) => ({
281971
+ type: "delete_tool_result",
281972
+ tool_use_id: id
281973
+ }))
281974
+ };
281975
+ }
281976
+ var TRIGGER_THRESHOLD = 10, KEEP_RECENT = 5;
281977
+ var init_cachedMicrocompact = __esm(() => {
281978
+ init_betas();
281979
+ });
281980
+
281865
281981
  // src/services/compact/microCompact.ts
281982
+ async function getCachedMCModule() {
281983
+ if (!cachedMCModule) {
281984
+ cachedMCModule = await Promise.resolve().then(() => (init_cachedMicrocompact(), exports_cachedMicrocompact));
281985
+ }
281986
+ return cachedMCModule;
281987
+ }
281988
+ function ensureCachedMCState() {
281989
+ if (!cachedMCState && cachedMCModule) {
281990
+ cachedMCState = cachedMCModule.createCachedMCState();
281991
+ }
281992
+ if (!cachedMCState) {
281993
+ throw new Error("cachedMCState not initialized \u2014 getCachedMCModule() must be called first");
281994
+ }
281995
+ return cachedMCState;
281996
+ }
281866
281997
  function consumePendingCacheEdits() {
281867
281998
  const edits = pendingCacheEdits;
281868
281999
  pendingCacheEdits = null;
@@ -281879,6 +282010,11 @@ function pinCacheEdits(userMessageIndex, block) {
281879
282010
  cachedMCState.pinnedEdits.push({ userMessageIndex, block });
281880
282011
  }
281881
282012
  }
282013
+ function markToolsSentToAPIState() {
282014
+ if (cachedMCState && cachedMCModule) {
282015
+ cachedMCModule.markToolsSentToAPI(cachedMCState);
282016
+ }
282017
+ }
281882
282018
  function resetMicrocompactState() {
281883
282019
  if (cachedMCState && cachedMCModule) {
281884
282020
  cachedMCModule.resetCachedMCState(cachedMCState);
@@ -281952,7 +282088,125 @@ async function microcompactMessages(messages, toolUseContext, querySource) {
281952
282088
  if (timeBasedResult) {
281953
282089
  return timeBasedResult;
281954
282090
  }
281955
- if (false) {}
282091
+ if (true) {
282092
+ const mod2 = await getCachedMCModule();
282093
+ const model = toolUseContext?.options.mainLoopModel ?? getMainLoopModel();
282094
+ if (mod2.isCachedMicrocompactEnabled() && mod2.isModelSupportedForCacheEditing(model) && isMainThreadSource(querySource)) {
282095
+ return await cachedMicrocompactPath(messages, querySource);
282096
+ }
282097
+ }
282098
+ return legacyMicrocompactPath(messages, querySource);
282099
+ }
282100
+ function getLegacyMicrocompactConfig() {
282101
+ const trigger = process.env.COSTRICT_LEGACY_MC_TRIGGER_TOKENS ?? process.env.CLAUDE_CODE_LEGACY_MC_TRIGGER_TOKENS;
282102
+ const keep = process.env.COSTRICT_LEGACY_MC_KEEP_RECENT ?? process.env.CLAUDE_CODE_LEGACY_MC_KEEP_RECENT;
282103
+ return {
282104
+ triggerTokens: trigger ? parseInt(trigger, 10) : LEGACY_MC_TRIGGER_TOKENS,
282105
+ keepRecent: keep ? parseInt(keep, 10) : LEGACY_MC_KEEP_RECENT
282106
+ };
282107
+ }
282108
+ function legacyMicrocompactPath(messages, _querySource) {
282109
+ const config7 = getLegacyMicrocompactConfig();
282110
+ const estimatedTokens = estimateMessageTokens(messages);
282111
+ if (estimatedTokens < config7.triggerTokens) {
282112
+ return { messages };
282113
+ }
282114
+ const compactableIds = collectCompactableToolIds(messages);
282115
+ if (compactableIds.length === 0) {
282116
+ return { messages };
282117
+ }
282118
+ const keepRecent = Math.max(1, config7.keepRecent);
282119
+ const keepSet = new Set(compactableIds.slice(-keepRecent));
282120
+ const clearSet = new Set(compactableIds.filter((id) => !keepSet.has(id)));
282121
+ if (clearSet.size === 0) {
282122
+ return { messages };
282123
+ }
282124
+ let tokensSaved = 0;
282125
+ const result = messages.map((message) => {
282126
+ if (message.type !== "user" || !Array.isArray(message.message.content)) {
282127
+ return message;
282128
+ }
282129
+ let touched = false;
282130
+ const newContent = message.message.content.map((block) => {
282131
+ if (block.type === "tool_result" && clearSet.has(block.tool_use_id) && block.content !== TIME_BASED_MC_CLEARED_MESSAGE) {
282132
+ tokensSaved += calculateToolResultTokens(block);
282133
+ touched = true;
282134
+ return { ...block, content: TIME_BASED_MC_CLEARED_MESSAGE };
282135
+ }
282136
+ return block;
282137
+ });
282138
+ if (!touched)
282139
+ return message;
282140
+ return {
282141
+ ...message,
282142
+ message: { ...message.message, content: newContent }
282143
+ };
282144
+ });
282145
+ logEvent("tengu_legacy_microcompact", {
282146
+ estimatedTokens,
282147
+ triggerTokens: config7.triggerTokens,
282148
+ toolsCleared: clearSet.size,
282149
+ toolsKept: keepSet.size,
282150
+ tokensSaved,
282151
+ querySource: _querySource ?? "unknown"
282152
+ });
282153
+ logForDebugging(`[LEGACY MC] estimated=${estimatedTokens} > ${config7.triggerTokens}, cleared ${clearSet.size} tool results (~${tokensSaved} tokens), kept last ${keepSet.size}`);
282154
+ suppressCompactWarning();
282155
+ return {
282156
+ messages: result,
282157
+ clearedToolUseIds: [...clearSet],
282158
+ tokensFreed: tokensSaved
282159
+ };
282160
+ }
282161
+ async function cachedMicrocompactPath(messages, querySource) {
282162
+ const mod2 = await getCachedMCModule();
282163
+ const state3 = ensureCachedMCState();
282164
+ const config7 = mod2.getCachedMCConfig();
282165
+ const compactableToolIds = new Set(collectCompactableToolIds(messages));
282166
+ for (const message of messages) {
282167
+ if (message.type === "user" && Array.isArray(message.message.content)) {
282168
+ const groupIds = [];
282169
+ for (const block of message.message.content) {
282170
+ if (block.type === "tool_result" && compactableToolIds.has(block.tool_use_id) && !state3.registeredTools.has(block.tool_use_id)) {
282171
+ mod2.registerToolResult(state3, block.tool_use_id);
282172
+ groupIds.push(block.tool_use_id);
282173
+ }
282174
+ }
282175
+ mod2.registerToolMessage(state3, groupIds);
282176
+ }
282177
+ }
282178
+ const toolsToDelete = mod2.getToolResultsToDelete(state3);
282179
+ if (toolsToDelete.length > 0) {
282180
+ const cacheEdits = mod2.createCacheEditsBlock(state3, toolsToDelete);
282181
+ if (cacheEdits) {
282182
+ pendingCacheEdits = cacheEdits;
282183
+ }
282184
+ logForDebugging(`Cached MC deleting ${toolsToDelete.length} tool(s): ${toolsToDelete.join(", ")}`);
282185
+ logEvent("tengu_cached_microcompact", {
282186
+ toolsDeleted: toolsToDelete.length,
282187
+ deletedToolIds: toolsToDelete.join(","),
282188
+ activeToolCount: state3.toolOrder.length - state3.deletedRefs.size,
282189
+ triggerType: "auto",
282190
+ threshold: config7.triggerThreshold,
282191
+ keepRecent: config7.keepRecent
282192
+ });
282193
+ suppressCompactWarning();
282194
+ if (true) {
282195
+ notifyCacheDeletion(querySource ?? "repl_main_thread");
282196
+ }
282197
+ const lastAsst = messages.findLast((m2) => m2.type === "assistant");
282198
+ const baseline = lastAsst?.type === "assistant" ? lastAsst.message.usage?.cache_deleted_input_tokens ?? 0 : 0;
282199
+ return {
282200
+ messages,
282201
+ compactionInfo: {
282202
+ pendingCacheEdits: {
282203
+ trigger: "auto",
282204
+ deletedToolIds: toolsToDelete,
282205
+ baselineCacheDeletedTokens: baseline
282206
+ }
282207
+ }
282208
+ };
282209
+ }
281956
282210
  return { messages };
281957
282211
  }
281958
282212
  function evaluateTimeBasedTrigger(messages, querySource) {
@@ -282021,9 +282275,13 @@ function maybeTimeBasedMicrocompact(messages, querySource) {
282021
282275
  if (querySource) {
282022
282276
  notifyCacheDeletion(querySource);
282023
282277
  }
282024
- return { messages: result, clearedToolUseIds: [...clearSet] };
282278
+ return {
282279
+ messages: result,
282280
+ clearedToolUseIds: [...clearSet],
282281
+ tokensFreed: tokensSaved
282282
+ };
282025
282283
  }
282026
- var TIME_BASED_MC_CLEARED_MESSAGE = "[Old tool result content cleared]", IMAGE_MAX_TOKEN_SIZE = 2000, COMPACTABLE_TOOLS, cachedMCModule = null, cachedMCState = null, pendingCacheEdits = null;
282284
+ var TIME_BASED_MC_CLEARED_MESSAGE = "[Old tool result content cleared]", IMAGE_MAX_TOKEN_SIZE = 2000, COMPACTABLE_TOOLS, cachedMCModule = null, cachedMCState = null, pendingCacheEdits = null, LEGACY_MC_TRIGGER_TOKENS = 80000, LEGACY_MC_KEEP_RECENT = 5;
282027
282285
  var init_microCompact = __esm(() => {
282028
282286
  init_prompt3();
282029
282287
  init_prompt4();
@@ -397238,7 +397496,7 @@ function getTelemetryAttributes() {
397238
397496
  attributes["session.id"] = sessionId;
397239
397497
  }
397240
397498
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
397241
- attributes["app.version"] = "4.2.10";
397499
+ attributes["app.version"] = "4.2.12-beat1";
397242
397500
  }
397243
397501
  const oauthAccount = getOauthAccountInfo();
397244
397502
  if (oauthAccount) {
@@ -429693,7 +429951,7 @@ function initLangfuse() {
429693
429951
  flushInterval: parseInt(process.env.LANGFUSE_FLUSH_INTERVAL ?? "10", 10),
429694
429952
  mask: maskFn,
429695
429953
  environment: process.env.LANGFUSE_TRACING_ENVIRONMENT ?? "development",
429696
- release: "4.2.10",
429954
+ release: "4.2.12-beat1",
429697
429955
  exportMode: process.env.LANGFUSE_EXPORT_MODE ?? "batched",
429698
429956
  timeout: parseInt(process.env.LANGFUSE_TIMEOUT ?? "5", 10)
429699
429957
  });
@@ -431777,6 +432035,13 @@ function notifyTasksUpdated() {
431777
432035
  tasksUpdated.emit();
431778
432036
  } catch {}
431779
432037
  }
432038
+ function isUserVisibleTask(task) {
432039
+ return task.metadata?._internal !== true;
432040
+ }
432041
+ function areAllUserVisibleTasksCompleted(tasks) {
432042
+ const userVisibleTasks = tasks.filter(isUserVisibleTask);
432043
+ return userVisibleTasks.length > 0 && userVisibleTasks.every((task) => task.status === "completed");
432044
+ }
431780
432045
  function getHighWaterMarkPath(taskListId) {
431781
432046
  return join53(getTasksDir(taskListId), HIGH_WATER_MARK_FILE);
431782
432047
  }
@@ -467929,7 +468194,7 @@ function initSentry() {
467929
468194
  }
467930
468195
  init3({
467931
468196
  dsn,
467932
- release: typeof MACRO !== "undefined" ? "4.2.10" : undefined,
468197
+ release: typeof MACRO !== "undefined" ? "4.2.12-beat1" : undefined,
467933
468198
  environment: typeof BUILD_ENV !== "undefined" ? BUILD_ENV : "production",
467934
468199
  maxBreadcrumbs: 20,
467935
468200
  sampleRate: 1,
@@ -495820,7 +496085,7 @@ async function initializeBetaTracing(resource) {
495820
496085
  });
495821
496086
  import_api_logs5.logs.setGlobalLoggerProvider(loggerProvider);
495822
496087
  setLoggerProvider(loggerProvider);
495823
- const eventLogger = import_api_logs5.logs.getLogger("com.anthropic.claude_code.events", "4.2.10");
496088
+ const eventLogger = import_api_logs5.logs.getLogger("com.anthropic.claude_code.events", "4.2.12-beat1");
495824
496089
  setEventLogger(eventLogger);
495825
496090
  process.on("beforeExit", async () => {
495826
496091
  await loggerProvider?.forceFlush();
@@ -495860,7 +496125,7 @@ async function initializeTelemetry() {
495860
496125
  const platform5 = getPlatform();
495861
496126
  const baseAttributes = {
495862
496127
  [import_semantic_conventions14.ATTR_SERVICE_NAME]: "claude-code",
495863
- [import_semantic_conventions14.ATTR_SERVICE_VERSION]: "4.2.10"
496128
+ [import_semantic_conventions14.ATTR_SERVICE_VERSION]: "4.2.12-beat1"
495864
496129
  };
495865
496130
  if (platform5 === "wsl") {
495866
496131
  const wslVersion = getWslVersion();
@@ -495905,7 +496170,7 @@ async function initializeTelemetry() {
495905
496170
  } catch {}
495906
496171
  };
495907
496172
  registerCleanup(shutdownTelemetry2);
495908
- return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.10");
496173
+ return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.12-beat1");
495909
496174
  }
495910
496175
  const meterProvider = new import_sdk_metrics2.MeterProvider({
495911
496176
  resource,
@@ -495925,7 +496190,7 @@ async function initializeTelemetry() {
495925
496190
  });
495926
496191
  import_api_logs5.logs.setGlobalLoggerProvider(loggerProvider);
495927
496192
  setLoggerProvider(loggerProvider);
495928
- const eventLogger = import_api_logs5.logs.getLogger("com.anthropic.claude_code.events", "4.2.10");
496193
+ const eventLogger = import_api_logs5.logs.getLogger("com.anthropic.claude_code.events", "4.2.12-beat1");
495929
496194
  setEventLogger(eventLogger);
495930
496195
  logForDebugging("[3P telemetry] Event logger set successfully");
495931
496196
  process.on("beforeExit", async () => {
@@ -495987,7 +496252,7 @@ Current timeout: ${timeoutMs}ms
495987
496252
  }
495988
496253
  };
495989
496254
  registerCleanup(shutdownTelemetry);
495990
- return meterProvider.getMeter("com.anthropic.claude_code", "4.2.10");
496255
+ return meterProvider.getMeter("com.anthropic.claude_code", "4.2.12-beat1");
495991
496256
  }
495992
496257
  async function flushTelemetry() {
495993
496258
  const meterProvider = getMeterProvider();
@@ -497046,7 +497311,7 @@ async function installGlobalPackage(specificVersion) {
497046
497311
  logError3(new AutoUpdaterError("Another process is currently installing an update"));
497047
497312
  logEvent("tengu_auto_updater_lock_contention", {
497048
497313
  pid: process.pid,
497049
- currentVersion: "4.2.10"
497314
+ currentVersion: "4.2.12-beat1"
497050
497315
  });
497051
497316
  return { status: "in_progress" };
497052
497317
  }
@@ -497055,7 +497320,7 @@ async function installGlobalPackage(specificVersion) {
497055
497320
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
497056
497321
  logError3(new Error("Windows NPM detected in WSL environment"));
497057
497322
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
497058
- currentVersion: "4.2.10"
497323
+ currentVersion: "4.2.12-beat1"
497059
497324
  });
497060
497325
  return {
497061
497326
  status: "install_failed",
@@ -497601,7 +497866,7 @@ function detectLinuxGlobPatternWarnings() {
497601
497866
  }
497602
497867
  async function getDoctorDiagnostic() {
497603
497868
  const installationType = await getCurrentInstallationType();
497604
- const version7 = typeof MACRO !== "undefined" ? "4.2.10" : "unknown";
497869
+ const version7 = typeof MACRO !== "undefined" ? "4.2.12-beat1" : "unknown";
497605
497870
  const installationPath = await getInstallationPath();
497606
497871
  const invokedBinary = getInvokedBinary();
497607
497872
  const multipleInstallations = await detectMultipleInstallations();
@@ -535757,7 +536022,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
535757
536022
  const client8 = new Client3({
535758
536023
  name: "claude-code",
535759
536024
  title: "CoStrict",
535760
- version: "4.2.10",
536025
+ version: "4.2.12-beat1",
535761
536026
  description: "CoStrict agentic coding tool",
535762
536027
  websiteUrl: PRODUCT_URL
535763
536028
  }, {
@@ -536128,7 +536393,7 @@ var init_client17 = __esm(() => {
536128
536393
  const client8 = new Client3({
536129
536394
  name: "claude-code",
536130
536395
  title: "CoStrict",
536131
- version: "4.2.10",
536396
+ version: "4.2.12-beat1",
536132
536397
  description: "CoStrict agentic coding tool",
536133
536398
  websiteUrl: PRODUCT_URL
536134
536399
  }, {
@@ -537506,7 +537771,7 @@ function getInstallationEnv() {
537506
537771
  return;
537507
537772
  }
537508
537773
  function getClaudeCodeVersion() {
537509
- return "4.2.10";
537774
+ return "4.2.12-beat1";
537510
537775
  }
537511
537776
  async function getInstalledVSCodeExtensionVersion(command4) {
537512
537777
  const { stdout } = await execFileNoThrow2(command4, ["--list-extensions", "--show-versions"], {
@@ -538870,8 +539135,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
538870
539135
  const maxVersion = await getMaxVersion();
538871
539136
  if (maxVersion && gt(version8, maxVersion)) {
538872
539137
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version8} to ${maxVersion}`);
538873
- if (gte2("4.2.10", maxVersion)) {
538874
- logForDebugging(`Native installer: current version ${"4.2.10"} is already at or above maxVersion ${maxVersion}, skipping update`);
539138
+ if (gte2("4.2.12-beat1", maxVersion)) {
539139
+ logForDebugging(`Native installer: current version ${"4.2.12-beat1"} is already at or above maxVersion ${maxVersion}, skipping update`);
538875
539140
  logEvent("tengu_native_update_skipped_max_version", {
538876
539141
  latency_ms: Date.now() - startTime2,
538877
539142
  max_version: maxVersion,
@@ -538882,7 +539147,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
538882
539147
  version8 = maxVersion;
538883
539148
  }
538884
539149
  }
538885
- if (!forceReinstall && version8 === "4.2.10" && await versionIsAvailable(version8) && await isPossibleClaudeBinary(executablePath)) {
539150
+ if (!forceReinstall && version8 === "4.2.12-beat1" && await versionIsAvailable(version8) && await isPossibleClaudeBinary(executablePath)) {
538886
539151
  logForDebugging(`Found ${version8} at ${executablePath}, skipping install`);
538887
539152
  logEvent("tengu_native_update_complete", {
538888
539153
  latency_ms: Date.now() - startTime2,
@@ -550389,7 +550654,7 @@ class TasksV2Store {
550389
550654
  #fetch = async () => {
550390
550655
  const taskListId = getTaskListId();
550391
550656
  this.#rewatch(getTasksDir(taskListId));
550392
- const current2 = (await listTasks(taskListId)).filter((t2) => !t2.metadata?._internal);
550657
+ const current2 = (await listTasks(taskListId)).filter(isUserVisibleTask);
550393
550658
  this.#tasks = current2;
550394
550659
  const hasIncomplete = current2.some((t2) => t2.status !== "completed");
550395
550660
  if (hasIncomplete || current2.length === 0) {
@@ -550415,8 +550680,7 @@ class TasksV2Store {
550415
550680
  if (currentId !== scheduledForTaskListId)
550416
550681
  return;
550417
550682
  listTasks(currentId).then(async (tasksToCheck) => {
550418
- const allStillCompleted = tasksToCheck.length > 0 && tasksToCheck.every((t2) => t2.status === "completed");
550419
- if (allStillCompleted) {
550683
+ if (areAllUserVisibleTasksCompleted(tasksToCheck)) {
550420
550684
  await resetTaskList(currentId);
550421
550685
  this.#tasks = [];
550422
550686
  this.#hidden = true;
@@ -564051,21 +564315,22 @@ function SystemAPIErrorMessage({
564051
564315
  color: "error",
564052
564316
  children: [
564053
564317
  errorPrefix,
564054
- truncated ? formatted.slice(0, MAX_API_ERROR_CHARS2) + "\u2026" : formatted
564318
+ truncated ? formatted.slice(0, MAX_API_ERROR_CHARS2) + "\u2026" : formatted,
564319
+ " \xB7 ",
564320
+ /* @__PURE__ */ jsx_runtime110.jsxs(ThemedText, {
564321
+ dimColor: true,
564322
+ children: [
564323
+ t("components.retrying.in.detail", {
564324
+ seconds: String(retryInSecondsLive),
564325
+ attempt: String(_retryAttempt),
564326
+ max: String(_maxRetries)
564327
+ }),
564328
+ process.env.API_TIMEOUT_MS ? t("components.retrying.timeout.hint", { timeout: process.env.API_TIMEOUT_MS }) : ""
564329
+ ]
564330
+ })
564055
564331
  ]
564056
564332
  }),
564057
- truncated && /* @__PURE__ */ jsx_runtime110.jsx(CtrlOToExpand, {}),
564058
- /* @__PURE__ */ jsx_runtime110.jsxs(ThemedText, {
564059
- dimColor: true,
564060
- children: [
564061
- t("components.retrying.in.detail", {
564062
- seconds: String(retryInSecondsLive),
564063
- attempt: String(_retryAttempt),
564064
- max: String(_maxRetries)
564065
- }),
564066
- process.env.API_TIMEOUT_MS ? t("components.retrying.timeout.hint", { timeout: process.env.API_TIMEOUT_MS }) : ""
564067
- ]
564068
- })
564333
+ truncated && /* @__PURE__ */ jsx_runtime110.jsx(CtrlOToExpand, {})
564069
564334
  ]
564070
564335
  })
564071
564336
  });
@@ -626491,7 +626756,7 @@ var init_TaskListTool = __esm(() => {
626491
626756
  },
626492
626757
  async call() {
626493
626758
  const taskListId = getTaskListId();
626494
- const allTasks = (await listTasks(taskListId)).filter((t2) => !t2.metadata?._internal);
626759
+ const allTasks = (await listTasks(taskListId)).filter(isUserVisibleTask);
626495
626760
  const resolvedTaskIds = new Set(allTasks.filter((t2) => t2.status === "completed").map((t2) => t2.id));
626496
626761
  const tasks = allTasks.map((task) => ({
626497
626762
  id: task.id,
@@ -647284,7 +647549,8 @@ async function* queryLoop(params, consumedCommandUuids) {
647284
647549
  queryCheckpoint("query_microcompact_start");
647285
647550
  const microcompactResult = await deps.microcompact(messagesForQuery, toolUseContext, querySource);
647286
647551
  messagesForQuery = microcompactResult.messages;
647287
- const pendingCacheEdits2 = undefined;
647552
+ const microcompactTokensFreed = microcompactResult.tokensFreed ?? 0;
647553
+ const pendingCacheEdits2 = microcompactResult.compactionInfo?.pendingCacheEdits;
647288
647554
  queryCheckpoint("query_microcompact_end");
647289
647555
  if (false) {}
647290
647556
  const fullSystemPrompt = asSystemPrompt(appendSystemContext(systemPrompt2, systemContext));
@@ -647295,7 +647561,7 @@ async function* queryLoop(params, consumedCommandUuids) {
647295
647561
  systemContext,
647296
647562
  toolUseContext,
647297
647563
  forkContextMessages: messagesForQuery
647298
- }, querySource, tracking, snipTokensFreed);
647564
+ }, querySource, tracking, snipTokensFreed, microcompactTokensFreed);
647299
647565
  queryCheckpoint("query_autocompact_end");
647300
647566
  if (compactionResult) {
647301
647567
  const {
@@ -647360,11 +647626,9 @@ async function* queryLoop(params, consumedCommandUuids) {
647360
647626
  });
647361
647627
  queryCheckpoint("query_setup_end");
647362
647628
  const dumpPromptsFetch = config10.gates.isSf ? createDumpPromptsFetch(toolUseContext.agentId ?? config10.sessionId) : undefined;
647363
- let collapseOwnsIt = false;
647364
- if (false) {}
647365
647629
  const mediaRecoveryEnabled = reactiveCompact?.isReactiveCompactEnabled() ?? false;
647366
- if (!compactionResult && querySource !== "compact" && querySource !== "session_memory" && !(reactiveCompact?.isReactiveCompactEnabled() && isAutoCompactEnabled()) && !collapseOwnsIt) {
647367
- const { isAtBlockingLimit } = calculateTokenWarningState(tokenCountWithEstimation(messagesForQuery) - snipTokensFreed, toolUseContext.options.mainLoopModel);
647630
+ if (!compactionResult && querySource !== "compact" && querySource !== "session_memory" && !(reactiveCompact?.isReactiveCompactEnabled() && isAutoCompactEnabled())) {
647631
+ const { isAtBlockingLimit } = calculateTokenWarningState(tokenCountWithEstimation(messagesForQuery) - snipTokensFreed - microcompactTokensFreed, toolUseContext.options.mainLoopModel);
647368
647632
  if (isAtBlockingLimit) {
647369
647633
  yield createAssistantAPIErrorMessage({
647370
647634
  content: PROMPT_TOO_LONG_ERROR_MESSAGE,
@@ -647519,7 +647783,15 @@ async function* queryLoop(params, consumedCommandUuids) {
647519
647783
  if (lastAssistant) {
647520
647784
  uploadSessionTurn(getSessionId(), String(lastAssistant.uuid));
647521
647785
  }
647522
- if (false) {}
647786
+ if (pendingCacheEdits2) {
647787
+ const lastAssistant2 = assistantMessages.at(-1);
647788
+ const usage2 = lastAssistant2?.message.usage;
647789
+ const cumulativeDeleted = usage2 ? usage2.cache_deleted_input_tokens ?? 0 : 0;
647790
+ const deletedTokens = Math.max(0, cumulativeDeleted - pendingCacheEdits2.baselineCacheDeletedTokens);
647791
+ if (deletedTokens > 0) {
647792
+ yield createMicrocompactBoundaryMessage(pendingCacheEdits2.trigger, 0, deletedTokens, pendingCacheEdits2.deletedToolIds, []);
647793
+ }
647794
+ }
647523
647795
  } catch (innerError) {
647524
647796
  if (innerError instanceof FallbackTriggeredError && fallbackModel) {
647525
647797
  currentModel = fallbackModel;
@@ -647650,6 +647922,34 @@ async function* queryLoop(params, consumedCommandUuids) {
647650
647922
  state3 = next3;
647651
647923
  continue;
647652
647924
  }
647925
+ if (isWithheld413) {
647926
+ const truncated = truncateHeadForPTLRetry(messagesForQuery, lastMessage);
647927
+ if (truncated && truncated.length < messagesForQuery.length) {
647928
+ logEvent("tengu_emergency_truncate", {
647929
+ originalMessageCount: messagesForQuery.length,
647930
+ truncatedMessageCount: truncated.length,
647931
+ querySource
647932
+ });
647933
+ const truncateNotice = createUserMessage({
647934
+ content: t("messages.emergencyTruncated"),
647935
+ isMeta: true
647936
+ });
647937
+ const next3 = {
647938
+ messages: [truncateNotice, ...truncated],
647939
+ toolUseContext,
647940
+ autoCompactTracking: undefined,
647941
+ maxOutputTokensRecoveryCount,
647942
+ hasAttemptedReactiveCompact,
647943
+ maxOutputTokensOverride: undefined,
647944
+ pendingToolUseSummary: undefined,
647945
+ stopHookActive: undefined,
647946
+ turnCount,
647947
+ transition: { reason: "emergency_truncate_retry" }
647948
+ };
647949
+ state3 = next3;
647950
+ continue;
647951
+ }
647952
+ }
647653
647953
  yield lastMessage;
647654
647954
  executeStopFailureHooks(lastMessage, toolUseContext);
647655
647955
  return { reason: isWithheldMedia ? "image_error" : "prompt_too_long" };
@@ -648070,6 +648370,7 @@ async function* queryLoop(params, consumedCommandUuids) {
648070
648370
  }
648071
648371
  var reactiveCompact, skillPrefetch, searchExtraToolsPrefetch, _jobClassifier, snipModule, taskSummaryModule, MAX_OUTPUT_TOKENS_RECOVERY_LIMIT = 3, MISSING_TOOL_USE_RECOVERY_MESSAGE = "Your previous response ended with stop_reason=tool_use but did not include a tool_use block. Continue by issuing the missing tool call now. If the user asked to update task state, call TaskUpdate with the appropriate taskId and status; do not just describe the action.", COSTRICT_TASK_TOOL_USE_RECOVERY_MESSAGE = "Your previous response ended with stop_reason=tool_use but did not include a tool_use block. Continue by issuing the missing tool call now. For task checklist updates in CoStrict, call update_todo_list with the complete markdown checklist using [ ], [-], and [x] markers; do not just describe the action.", MISSING_TOOL_USE_FAILURE_MESSAGE = "Model response error: the model indicated it wanted to call a tool, but no tool call was provided after retry. The requested action did not run.", TASK_TOOL_USE_FAILURE_MESSAGE = "Task tool call failed: the model ended with stop_reason=tool_use but did not provide the required task tool call. The requested task action did not run.", COSTRICT_TASK_TOOL_USE_FAILURE_MESSAGE = "Task checklist update failed: the model ended with stop_reason=tool_use but did not call update_todo_list. The requested task action did not run.", TASK_TOOL_NAMES;
648072
648372
  var init_query4 = __esm(() => {
648373
+ init_locales2();
648073
648374
  init_withRetry();
648074
648375
  init_autoCompact();
648075
648376
  init_compact();
@@ -650332,11 +650633,20 @@ function getEffectiveContextWindowSize(model) {
650332
650633
  return contextWindow - reservedTokensForSummary;
650333
650634
  }
650334
650635
  function getAutocompactBufferTokens(model) {
650636
+ const envOverride = process.env.COSTRICT_AUTO_COMPACT_BUFFER_TOKENS ?? process.env.CLAUDE_CODE_AUTO_COMPACT_BUFFER_TOKENS;
650637
+ if (envOverride) {
650638
+ const parsed = parseInt(envOverride, 10);
650639
+ if (!isNaN(parsed) && parsed > 0) {
650640
+ return parsed;
650641
+ }
650642
+ }
650335
650643
  const effectiveWindow = getEffectiveContextWindowSize(model);
650336
650644
  if (effectiveWindow >= 800000)
650337
- return 50000;
650645
+ return 80000;
650338
650646
  if (effectiveWindow >= 400000)
650339
- return 30000;
650647
+ return 60000;
650648
+ if (effectiveWindow >= 200000)
650649
+ return 40000;
650340
650650
  return AUTOCOMPACT_BUFFER_TOKENS;
650341
650651
  }
650342
650652
  function getAutoCompactThreshold(model) {
@@ -650385,7 +650695,7 @@ function isAutoCompactEnabled() {
650385
650695
  const userConfig = getGlobalConfig();
650386
650696
  return userConfig.autoCompactEnabled ?? true;
650387
650697
  }
650388
- async function shouldAutoCompact(messages, model, querySource, snipTokensFreed = 0) {
650698
+ async function shouldAutoCompact(messages, model, querySource, snipTokensFreed = 0, microcompactTokensFreed = 0) {
650389
650699
  if (querySource === "session_memory" || querySource === "compact") {
650390
650700
  return false;
650391
650701
  }
@@ -650398,15 +650708,25 @@ async function shouldAutoCompact(messages, model, querySource, snipTokensFreed =
650398
650708
  return false;
650399
650709
  }
650400
650710
  }
650401
- if (false) {}
650402
- const tokenCount = tokenCountWithEstimation(messages) - snipTokensFreed;
650711
+ const multiplierEnv = process.env.COSTRICT_AUTOCOMPACT_ESTIMATE_MULTIPLIER ?? process.env.CLAUDE_CODE_AUTOCOMPACT_ESTIMATE_MULTIPLIER;
650712
+ const multiplier = (() => {
650713
+ if (multiplierEnv !== undefined) {
650714
+ const parsed = parseFloat(multiplierEnv);
650715
+ if (!Number.isNaN(parsed) && parsed >= 1) {
650716
+ return parsed;
650717
+ }
650718
+ }
650719
+ return 1.1;
650720
+ })();
650721
+ const estimatedTokenCount = Math.ceil(tokenCountWithEstimation(messages) * multiplier);
650722
+ const tokenCount = estimatedTokenCount - snipTokensFreed - microcompactTokensFreed;
650403
650723
  const threshold = getAutoCompactThreshold(model);
650404
650724
  const effectiveWindow = getEffectiveContextWindowSize(model);
650405
- logForDebugging(`autocompact: tokens=${tokenCount} threshold=${threshold} effectiveWindow=${effectiveWindow}${snipTokensFreed > 0 ? ` snipFreed=${snipTokensFreed}` : ""}`);
650725
+ logForDebugging(`autocompact: tokens=${tokenCount} (raw=${tokenCountWithEstimation(messages)}) threshold=${threshold} effectiveWindow=${effectiveWindow}${snipTokensFreed > 0 ? ` snipFreed=${snipTokensFreed}` : ""}${microcompactTokensFreed > 0 ? ` microcompactFreed=${microcompactTokensFreed}` : ""}${multiplier !== 1.1 ? ` multiplier=${multiplier}` : ""}`);
650406
650726
  const { isAboveAutoCompactThreshold } = calculateTokenWarningState(tokenCount, model);
650407
650727
  return isAboveAutoCompactThreshold;
650408
650728
  }
650409
- async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, querySource, tracking, snipTokensFreed) {
650729
+ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, querySource, tracking, snipTokensFreed, microcompactTokensFreed) {
650410
650730
  if (isEnvTruthy(process.env.DISABLE_COMPACT)) {
650411
650731
  return { wasCompacted: false };
650412
650732
  }
@@ -650418,7 +650738,7 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
650418
650738
  return { wasCompacted: false };
650419
650739
  }
650420
650740
  const model = toolUseContext.options.mainLoopModel;
650421
- const shouldCompact = await shouldAutoCompact(messages, model, querySource, snipTokensFreed);
650741
+ const shouldCompact = await shouldAutoCompact(messages, model, querySource, snipTokensFreed, microcompactTokensFreed);
650422
650742
  if (!shouldCompact) {
650423
650743
  return { wasCompacted: false };
650424
650744
  }
@@ -650466,7 +650786,7 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
650466
650786
  return { wasCompacted: false, consecutiveFailures: nextFailures };
650467
650787
  }
650468
650788
  }
650469
- var MAX_OUTPUT_TOKENS_FOR_SUMMARY = 20000, AUTOCOMPACT_BUFFER_TOKENS = 25000, WARNING_THRESHOLD_BUFFER_TOKENS = 20000, ERROR_THRESHOLD_BUFFER_TOKENS = 20000, MANUAL_COMPACT_BUFFER_TOKENS = 1e4, MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES = 3, MAX_CONSECUTIVE_AUTOCOMPACT_COMPACTIONS = 2;
650789
+ var MAX_OUTPUT_TOKENS_FOR_SUMMARY = 20000, AUTOCOMPACT_BUFFER_TOKENS = 35000, WARNING_THRESHOLD_BUFFER_TOKENS = 20000, ERROR_THRESHOLD_BUFFER_TOKENS = 20000, MANUAL_COMPACT_BUFFER_TOKENS = 1e4, MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES = 3, MAX_CONSECUTIVE_AUTOCOMPACT_COMPACTIONS = 2;
650470
650790
  var init_autoCompact = __esm(() => {
650471
650791
  init_state();
650472
650792
  init_state();
@@ -663931,6 +664251,25 @@ function createCompactBoundaryMessage(trigger, preTokens, lastPreCompactMessageU
663931
664251
  }
663932
664252
  };
663933
664253
  }
664254
+ function createMicrocompactBoundaryMessage(trigger, preTokens, tokensSaved, compactedToolIds, clearedAttachmentUUIDs) {
664255
+ logForDebugging(`[microcompact] saved ~${formatTokens(tokensSaved)} tokens (cleared ${compactedToolIds.length} tool results)`);
664256
+ return {
664257
+ type: "system",
664258
+ subtype: "microcompact_boundary",
664259
+ content: "Context microcompacted",
664260
+ isMeta: false,
664261
+ timestamp: new Date().toISOString(),
664262
+ uuid: randomUUID40(),
664263
+ level: "info",
664264
+ microcompactMetadata: {
664265
+ trigger,
664266
+ preTokens,
664267
+ tokensSaved,
664268
+ compactedToolIds,
664269
+ clearedAttachmentUUIDs
664270
+ }
664271
+ };
664272
+ }
663934
664273
  function createSystemAPIErrorMessage(error99, retryInMs, retryAttempt, maxRetries) {
663935
664274
  return {
663936
664275
  type: "system",
@@ -663945,6 +664284,22 @@ function createSystemAPIErrorMessage(error99, retryInMs, retryAttempt, maxRetrie
663945
664284
  uuid: randomUUID40()
663946
664285
  };
663947
664286
  }
664287
+ function replaceOrAppendApiErrorMessage(messages, newMessage) {
664288
+ for (let i6 = messages.length - 1;i6 >= 0; i6--) {
664289
+ const message2 = messages[i6];
664290
+ if (message2.type !== "system")
664291
+ break;
664292
+ const subtype = message2.subtype;
664293
+ if (subtype === "api_error") {
664294
+ const copy = messages.slice();
664295
+ copy[i6] = newMessage;
664296
+ return copy;
664297
+ }
664298
+ if (subtype !== undefined)
664299
+ break;
664300
+ }
664301
+ return [...messages, newMessage];
664302
+ }
663948
664303
  function isCompactBoundaryMessage(message2) {
663949
664304
  return message2?.type === "system" && message2.subtype === "compact_boundary";
663950
664305
  }
@@ -666175,6 +666530,38 @@ var init_shouldUseSandbox = __esm(() => {
666175
666530
  init_bashPermissions();
666176
666531
  });
666177
666532
 
666533
+ // src/utils/askUserQuestionAutoSelect.ts
666534
+ function isAskUserQuestionAutoSelectEnabled(settings) {
666535
+ return settings.askUserQuestionAutoSelectEnabled ?? true;
666536
+ }
666537
+ function getAskUserQuestionAutoSelectTimeoutSeconds(settings) {
666538
+ return settings.askUserQuestionTimeoutSeconds ?? DEFAULT_ASK_USER_QUESTION_AUTO_SELECT_TIMEOUT_SECONDS;
666539
+ }
666540
+ function buildAskUserQuestionAutoAnswers(questions) {
666541
+ const autoAnswers = {};
666542
+ if (!Array.isArray(questions))
666543
+ return autoAnswers;
666544
+ for (const question of questions) {
666545
+ if (!question || typeof question !== "object")
666546
+ continue;
666547
+ const questionRecord = question;
666548
+ const questionText = questionRecord.question;
666549
+ const options = questionRecord.options;
666550
+ if (typeof questionText !== "string" || !Array.isArray(options) || options.length === 0) {
666551
+ continue;
666552
+ }
666553
+ const firstOption = options[0];
666554
+ if (!firstOption || typeof firstOption !== "object")
666555
+ continue;
666556
+ const label = firstOption.label;
666557
+ if (typeof label !== "string")
666558
+ continue;
666559
+ autoAnswers[questionText] = label;
666560
+ }
666561
+ return autoAnswers;
666562
+ }
666563
+ var DEFAULT_ASK_USER_QUESTION_AUTO_SELECT_TIMEOUT_SECONDS = 600;
666564
+
666178
666565
  // src/utils/permissions/classifierDecision.ts
666179
666566
  var exports_classifierDecision = {};
666180
666567
  __export(exports_classifierDecision, {
@@ -666560,23 +666947,15 @@ async function hasPermissionsToUseToolInner(tool, input4, context25) {
666560
666947
  if (tool.requiresUserInteraction?.() && toolPermissionResult?.behavior === "ask") {
666561
666948
  if (appState.toolPermissionContext.shouldAvoidPermissionPrompts && tool.name === ASK_USER_QUESTION_TOOL_NAME) {
666562
666949
  const settings = getInitialSettings();
666563
- const AUTO_SELECT_TIMEOUT_S = settings.askUserQuestionTimeoutSeconds ?? 600;
666564
- const questionsRaw = parsedInput.questions;
666950
+ const autoSelectEnabled = isAskUserQuestionAutoSelectEnabled(settings);
666951
+ const autoSelectTimeoutSeconds = getAskUserQuestionAutoSelectTimeoutSeconds(settings);
666952
+ if (!autoSelectEnabled) {
666953
+ logForDebugging("[AskUserQuestion] headless auto-select disabled; returning ask decision for hook/auto-deny handling");
666954
+ return toolPermissionResult;
666955
+ }
666565
666956
  const baseInput = toolPermissionResult.updatedInput ?? parsedInput;
666566
- const buildAutoAnswers = () => {
666567
- const autoAnswers2 = {};
666568
- if (!Array.isArray(questionsRaw))
666569
- return autoAnswers2;
666570
- for (const q3 of questionsRaw) {
666571
- if (q3 && typeof q3 === "object" && typeof q3.question === "string" && Array.isArray(q3.options) && q3.options.length > 0) {
666572
- const qObj = q3;
666573
- autoAnswers2[qObj.question] = qObj.options[0].label;
666574
- }
666575
- }
666576
- return autoAnswers2;
666577
- };
666578
- if (AUTO_SELECT_TIMEOUT_S === 0) {
666579
- const autoAnswers2 = buildAutoAnswers();
666957
+ if (autoSelectTimeoutSeconds === 0) {
666958
+ const autoAnswers2 = buildAskUserQuestionAutoAnswers(parsedInput.questions);
666580
666959
  logForDebugging(`[AskUserQuestion] headless immediate auto-select (askUserQuestionTimeoutSeconds=0): ${jsonStringify(autoAnswers2)}`);
666581
666960
  return {
666582
666961
  behavior: "allow",
@@ -666587,13 +666966,13 @@ async function hasPermissionsToUseToolInner(tool, input4, context25) {
666587
666966
  }
666588
666967
  };
666589
666968
  }
666590
- logForDebugging(`[AskUserQuestion] headless mode: waiting ${AUTO_SELECT_TIMEOUT_S}s before auto-selecting first options`);
666591
- await new Promise((resolve47) => setTimeout(resolve47, AUTO_SELECT_TIMEOUT_S * 1000));
666969
+ logForDebugging(`[AskUserQuestion] headless mode: waiting ${autoSelectTimeoutSeconds}s before auto-selecting first options`);
666970
+ await new Promise((resolve47) => setTimeout(resolve47, autoSelectTimeoutSeconds * 1000));
666592
666971
  if (context25.abortController.signal.aborted) {
666593
666972
  throw new AbortError;
666594
666973
  }
666595
- const autoAnswers = buildAutoAnswers();
666596
- logForDebugging(`[AskUserQuestion] headless auto-select after ${AUTO_SELECT_TIMEOUT_S}s timeout: ${jsonStringify(autoAnswers)}`);
666974
+ const autoAnswers = buildAskUserQuestionAutoAnswers(parsedInput.questions);
666975
+ logForDebugging(`[AskUserQuestion] headless auto-select after ${autoSelectTimeoutSeconds}s timeout: ${jsonStringify(autoAnswers)}`);
666597
666976
  return {
666598
666977
  behavior: "allow",
666599
666978
  updatedInput: { ...baseInput, answers: autoAnswers },
@@ -673249,7 +673628,7 @@ function Feedback({
673249
673628
  platform: env4.platform,
673250
673629
  gitRepo: envInfo.isGit,
673251
673630
  terminal: env4.terminal,
673252
- version: "4.2.10",
673631
+ version: "4.2.12-beat1",
673253
673632
  transcript: normalizeMessagesForAPI(messages),
673254
673633
  errors: sanitizedErrors,
673255
673634
  lastApiRequest: getLastAPIRequest(),
@@ -673432,7 +673811,7 @@ function Feedback({
673432
673811
  ", ",
673433
673812
  env4.terminal,
673434
673813
  ", v",
673435
- "4.2.10"
673814
+ "4.2.12-beat1"
673436
673815
  ]
673437
673816
  })
673438
673817
  ]
@@ -673529,7 +673908,7 @@ ${sanitizedDescription}
673529
673908
  ` + `**Environment Info**
673530
673909
  ` + `- Platform: ${env4.platform}
673531
673910
  ` + `- Terminal: ${env4.terminal}
673532
- ` + `- Version: ${"4.2.10"}
673911
+ ` + `- Version: ${"4.2.12-beat1"}
673533
673912
  ` + `- Feedback ID: ${feedbackId}
673534
673913
  ` + `
673535
673914
  **Errors**
@@ -675765,7 +676144,7 @@ function buildPrimarySection() {
675765
676144
  children: t("settings.status.renameHint")
675766
676145
  });
675767
676146
  return [
675768
- { label: t("settings.status.version"), value: "4.2.10" },
676147
+ { label: t("settings.status.version"), value: "4.2.12-beat1" },
675769
676148
  { label: t("settings.status.sessionName"), value: nameValue },
675770
676149
  { label: t("settings.status.sessionId"), value: sessionId },
675771
676150
  { label: t("settings.status.cwd"), value: getCwd() },
@@ -677459,6 +677838,35 @@ function Config({
677459
677838
  });
677460
677839
  }
677461
677840
  },
677841
+ {
677842
+ id: "askUserQuestionAutoSelectEnabled",
677843
+ label: t("settings.askUserQuestion.autoSelect"),
677844
+ value: settingsData?.askUserQuestionAutoSelectEnabled ?? true,
677845
+ type: "boolean",
677846
+ onChange(askUserQuestionAutoSelectEnabled) {
677847
+ const result = updateSettingsForSource("localSettings", {
677848
+ askUserQuestionAutoSelectEnabled
677849
+ });
677850
+ if (result.error) {
677851
+ logError3(result.error);
677852
+ return;
677853
+ }
677854
+ setSettingsData((prev) => ({
677855
+ ...prev,
677856
+ askUserQuestionAutoSelectEnabled
677857
+ }));
677858
+ setAppState((prev) => ({
677859
+ ...prev,
677860
+ settings: {
677861
+ ...prev.settings,
677862
+ askUserQuestionAutoSelectEnabled
677863
+ }
677864
+ }));
677865
+ logEvent("tengu_ask_user_question_auto_select_setting_changed", {
677866
+ enabled: askUserQuestionAutoSelectEnabled
677867
+ });
677868
+ }
677869
+ },
677462
677870
  ...showAutoInDefaultModePicker ? [
677463
677871
  {
677464
677872
  id: "useAutoModeDuringPlan",
@@ -678047,6 +678455,11 @@ function Config({
678047
678455
  });
678048
678456
  formattedChanges.push(remoteLabel);
678049
678457
  }
678458
+ const askUserQuestionAutoSelectEnabled = settingsData?.askUserQuestionAutoSelectEnabled ?? true;
678459
+ if (askUserQuestionAutoSelectEnabled !== (initialSettingsData.current?.askUserQuestionAutoSelectEnabled ?? true)) {
678460
+ const action2 = askUserQuestionAutoSelectEnabled ? t("settings.config.saved.enabled") : t("settings.config.saved.disabled");
678461
+ formattedChanges.push(t("settings.config.saved.askUserQuestionAutoSelect", { action: action2 }));
678462
+ }
678050
678463
  if (settingsData?.autoUpdatesChannel !== initialSettingsData.current?.autoUpdatesChannel) {
678051
678464
  formattedChanges.push(t("settings.config.saved.autoUpdateChannel", {
678052
678465
  value: source_default.bold(settingsData?.autoUpdatesChannel ?? "latest")
@@ -678065,6 +678478,7 @@ function Config({
678065
678478
  mainLoopModel,
678066
678479
  currentOutputStyle,
678067
678480
  currentLanguage,
678481
+ settingsData?.askUserQuestionAutoSelectEnabled,
678068
678482
  settingsData?.autoUpdatesChannel,
678069
678483
  isFastModeEnabled() ? settingsData?.fastMode : undefined,
678070
678484
  onClose
@@ -678078,6 +678492,7 @@ function Config({
678078
678492
  updateSettingsForSource("localSettings", {
678079
678493
  spinnerTipsEnabled: il?.spinnerTipsEnabled,
678080
678494
  prefersReducedMotion: il?.prefersReducedMotion,
678495
+ askUserQuestionAutoSelectEnabled: il?.askUserQuestionAutoSelectEnabled,
678081
678496
  defaultView: il?.defaultView,
678082
678497
  outputStyle: il?.outputStyle
678083
678498
  });
@@ -678587,7 +679002,7 @@ function Config({
678587
679002
  }
678588
679003
  })
678589
679004
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime190.jsx(ChannelDowngradeDialog, {
678590
- currentVersion: "4.2.10",
679005
+ currentVersion: "4.2.12-beat1",
678591
679006
  onChoice: (choice) => {
678592
679007
  setShowSubmenu(null);
678593
679008
  setTabsHidden(false);
@@ -678599,7 +679014,7 @@ function Config({
678599
679014
  autoUpdatesChannel: "stable"
678600
679015
  };
678601
679016
  if (choice === "stay") {
678602
- newSettings.minimumVersion = "4.2.10";
679017
+ newSettings.minimumVersion = "4.2.12-beat1";
678603
679018
  }
678604
679019
  updateSettingsForSource("userSettings", newSettings);
678605
679020
  setSettingsData((prev) => ({
@@ -684068,7 +684483,7 @@ function HelpV2({ onClose, commands: commands7 }) {
684068
684483
  color: "professionalBlue",
684069
684484
  children: [
684070
684485
  /* @__PURE__ */ jsx_runtime217.jsx(Tabs, {
684071
- title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.10"}`,
684486
+ title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.12-beat1"}`,
684072
684487
  color: "professionalBlue",
684073
684488
  defaultTab: "general",
684074
684489
  children: tabs
@@ -774644,7 +775059,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
774644
775059
  return [];
774645
775060
  }
774646
775061
  }
774647
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.10") {
775062
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.12-beat1") {
774648
775063
  if (process.env.USER_TYPE === "sf") {
774649
775064
  const changelog = "";
774650
775065
  if (changelog) {
@@ -774671,7 +775086,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.10")
774671
775086
  releaseNotes
774672
775087
  };
774673
775088
  }
774674
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.10") {
775089
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.12-beat1") {
774675
775090
  if (process.env.USER_TYPE === "sf") {
774676
775091
  const changelog = "";
774677
775092
  if (changelog) {
@@ -777432,7 +777847,7 @@ function isNotLoggedIn() {
777432
777847
  return true;
777433
777848
  }
777434
777849
  function getLogoDisplayData() {
777435
- const version8 = process.env.DEMO_VERSION ?? "4.2.10";
777850
+ const version8 = process.env.DEMO_VERSION ?? "4.2.12-beat1";
777436
777851
  const serverUrl = getDirectConnectServerUrl();
777437
777852
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
777438
777853
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -778010,7 +778425,7 @@ var init_MatrixMessageLine = __esm(() => {
778010
778425
  // src/components/matrix-tactical/MatrixWelcome.tsx
778011
778426
  import { basename as basename47 } from "path";
778012
778427
  function MatrixWelcome({
778013
- version: version8 = "4.2.10",
778428
+ version: version8 = "4.2.12-beat1",
778014
778429
  projectName,
778015
778430
  cwd: cwd2,
778016
778431
  modelDisplayName,
@@ -778645,13 +779060,13 @@ function LogoV2() {
778645
779060
  const { hasReleaseNotes } = checkForReleaseNotesSync(config11.lastReleaseNotesSeen);
778646
779061
  import_react167.useEffect(() => {
778647
779062
  const currentConfig = getGlobalConfig();
778648
- if (currentConfig.lastReleaseNotesSeen === "4.2.10") {
779063
+ if (currentConfig.lastReleaseNotesSeen === "4.2.12-beat1") {
778649
779064
  return;
778650
779065
  }
778651
779066
  saveGlobalConfig((current2) => {
778652
- if (current2.lastReleaseNotesSeen === "4.2.10")
779067
+ if (current2.lastReleaseNotesSeen === "4.2.12-beat1")
778653
779068
  return current2;
778654
- return { ...current2, lastReleaseNotesSeen: "4.2.10" };
779069
+ return { ...current2, lastReleaseNotesSeen: "4.2.12-beat1" };
778655
779070
  });
778656
779071
  if (showOnboarding) {
778657
779072
  incrementProjectOnboardingSeenCount();
@@ -800596,7 +801011,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
800596
801011
  smapsRollup,
800597
801012
  platform: process.platform,
800598
801013
  nodeVersion: process.version,
800599
- ccVersion: "4.2.10"
801014
+ ccVersion: "4.2.12-beat1"
800600
801015
  };
800601
801016
  }
800602
801017
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -800712,7 +801127,7 @@ var init_mock_limits = __esm(() => {
800712
801127
  var call54 = async () => {
800713
801128
  return {
800714
801129
  type: "text",
800715
- value: `${"4.2.10"} (built ${"2026-07-07T11:49:19.693Z"})`
801130
+ value: `${"4.2.12-beat1"} (built ${"2026-07-13T01:43:36.376Z"})`
800716
801131
  };
800717
801132
  }, version8, version_default;
800718
801133
  var init_version2 = __esm(() => {
@@ -807130,12 +807545,60 @@ var init_tag2 = __esm(() => {
807130
807545
  function isRecord5(value) {
807131
807546
  return value !== null && typeof value === "object" && !Array.isArray(value);
807132
807547
  }
807548
+ function isCoStrictGatewayErrorBody(body) {
807549
+ return isRecord5(body) && Array.isArray(body.error) && body.error.length > 0 && isRecord5(body.error[0]) && typeof body.error[0].ApiError === "string";
807550
+ }
807551
+ async function peekGatewayErrorBody(response3) {
807552
+ const reader = response3.body?.getReader();
807553
+ if (!reader)
807554
+ return null;
807555
+ const decoder = new TextDecoder;
807556
+ let buffer = "";
807557
+ const MAX_BYTES = 4096;
807558
+ try {
807559
+ while (buffer.length < MAX_BYTES) {
807560
+ const { done, value } = await reader.read();
807561
+ if (done)
807562
+ break;
807563
+ buffer += decoder.decode(value, { stream: true });
807564
+ const blankLineIndex = buffer.indexOf(`
807565
+
807566
+ `);
807567
+ if (blankLineIndex !== -1) {
807568
+ buffer = buffer.slice(0, blankLineIndex);
807569
+ break;
807570
+ }
807571
+ }
807572
+ } finally {
807573
+ reader.cancel().catch(() => {});
807574
+ }
807575
+ const trimmed = buffer.trimStart();
807576
+ if (!trimmed.startsWith("{"))
807577
+ return null;
807578
+ try {
807579
+ const parsed = JSON.parse(trimmed);
807580
+ if (isCoStrictGatewayErrorBody(parsed)) {
807581
+ return parsed;
807582
+ }
807583
+ } catch {}
807584
+ return null;
807585
+ }
807133
807586
  async function normalizeGatewayErrorResponse(response3) {
807134
807587
  if (response3.status >= 400) {
807135
807588
  return response3;
807136
807589
  }
807137
807590
  const contentType = response3.headers.get("content-type") ?? "";
807138
807591
  if (contentType.includes("text/event-stream")) {
807592
+ const errorBody = await peekGatewayErrorBody(response3.clone());
807593
+ if (errorBody) {
807594
+ const headers = new Headers(response3.headers);
807595
+ headers.set("content-type", "application/json");
807596
+ return new Response(response3.body, {
807597
+ status: 503,
807598
+ statusText: "CoStrict Gateway Error",
807599
+ headers
807600
+ });
807601
+ }
807139
807602
  return response3;
807140
807603
  }
807141
807604
  let body;
@@ -807144,11 +807607,13 @@ async function normalizeGatewayErrorResponse(response3) {
807144
807607
  } catch {
807145
807608
  return response3;
807146
807609
  }
807147
- if (isRecord5(body) && Array.isArray(body.error) && body.error.length > 0 && isRecord5(body.error[0]) && typeof body.error[0].ApiError === "string") {
807610
+ if (isCoStrictGatewayErrorBody(body)) {
807611
+ const headers = new Headers(response3.headers);
807612
+ headers.set("content-type", "application/json");
807148
807613
  return new Response(response3.body, {
807149
807614
  status: 503,
807150
807615
  statusText: "CoStrict Gateway Error",
807151
- headers: response3.headers
807616
+ headers
807152
807617
  });
807153
807618
  }
807154
807619
  return response3;
@@ -808290,7 +808755,7 @@ function TabContent({
808290
808755
  ]
808291
808756
  }),
808292
808757
  item.hasUpdate && /* @__PURE__ */ jsx_runtime359.jsxs(ThemedText, {
808293
- color: "yellow",
808758
+ color: "ansi:yellow",
808294
808759
  children: [
808295
808760
  " \u2191 ",
808296
808761
  item.localVersion ?? "?",
@@ -817541,7 +818006,7 @@ function generateHtmlReport(data, insights) {
817541
818006
  </html>`;
817542
818007
  }
817543
818008
  function buildExportData(data, insights, facets, remoteStats) {
817544
- const version9 = typeof MACRO !== "undefined" ? "4.2.10" : "unknown";
818009
+ const version9 = typeof MACRO !== "undefined" ? "4.2.12-beat1" : "unknown";
817545
818010
  const remote_hosts_collected = remoteStats?.hosts.filter((h5) => h5.sessionCount > 0).map((h5) => h5.name);
817546
818011
  const facets_summary = {
817547
818012
  total: facets.size,
@@ -821855,7 +822320,7 @@ var init_sessionStorage = __esm(() => {
821855
822320
  init_settings2();
821856
822321
  init_slowOperations();
821857
822322
  init_uuid();
821858
- VERSION10 = typeof MACRO !== "undefined" ? "4.2.10" : "unknown";
822323
+ VERSION10 = typeof MACRO !== "undefined" ? "4.2.12-beat1" : "unknown";
821859
822324
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
821860
822325
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
821861
822326
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -823196,7 +823661,7 @@ var init_filesystem = __esm(() => {
823196
823661
  });
823197
823662
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
823198
823663
  const nonce = randomBytes24(16).toString("hex");
823199
- return join195(getCostrictTempDir(), "bundled-skills", "4.2.10", nonce);
823664
+ return join195(getCostrictTempDir(), "bundled-skills", "4.2.12-beat1", nonce);
823200
823665
  });
823201
823666
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
823202
823667
  });
@@ -828481,6 +828946,14 @@ var init_worktree = __esm(() => {
828481
828946
  // src/constants/cyberRiskInstruction.ts
828482
828947
  var CYBER_RISK_INSTRUCTION = `IMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.`;
828483
828948
 
828949
+ // src/services/compact/cachedMCConfig.ts
828950
+ var exports_cachedMCConfig = {};
828951
+ __export(exports_cachedMCConfig, {
828952
+ getCachedMCConfig: () => getCachedMCConfig2
828953
+ });
828954
+ var getCachedMCConfig2 = () => ({});
828955
+ var init_cachedMCConfig = () => {};
828956
+
828484
828957
  // src/constants/prompts.ts
828485
828958
  import { type as osType2, version as osVersion, release as osRelease2 } from "os";
828486
828959
  function getHooksSection() {
@@ -828867,7 +829340,7 @@ Only use \`/tmp\` if the user explicitly requests it.
828867
829340
  The scratchpad directory is session-specific, isolated from the user's project, and can be used freely without permission prompts.`;
828868
829341
  }
828869
829342
  function getFunctionResultClearingSection(model) {
828870
- if (true) {
829343
+ if (!getCachedMCConfigForFRC) {
828871
829344
  return null;
828872
829345
  }
828873
829346
  const config11 = getCachedMCConfigForFRC();
@@ -828948,7 +829421,7 @@ The user context may include a \`terminalFocus\` field indicating whether the us
828948
829421
 
828949
829422
  ${BRIEF_PROACTIVE_SECTION2}` : ""}`;
828950
829423
  }
828951
- var getCachedMCConfigForFRC = null, proactiveModule5, BRIEF_PROACTIVE_SECTION2, _briefToolModule, briefToolModule, DISCOVER_SKILLS_TOOL_NAME2, skillSearchFeatureCheck, CLAUDE_CODE_DOCS_MAP_URL2, SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__", FRONTIER_MODEL_NAME = "Claude Opus 4.7", CLAUDE_LATEST_MODEL_IDS, DEFAULT_AGENT_PROMPT = `You are an agent for CoStrict. Given the user's message, you should use the tools available to complete the task. Complete the task fully\u2014don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings \u2014 the caller will relay this to the user, so it only needs the essentials.`, SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.`;
829424
+ var getCachedMCConfigForFRC, proactiveModule5, BRIEF_PROACTIVE_SECTION2, _briefToolModule, briefToolModule, DISCOVER_SKILLS_TOOL_NAME2, skillSearchFeatureCheck, CLAUDE_CODE_DOCS_MAP_URL2, SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__", FRONTIER_MODEL_NAME = "Claude Opus 4.7", CLAUDE_LATEST_MODEL_IDS, DEFAULT_AGENT_PROMPT = `You are an agent for CoStrict. Given the user's message, you should use the tools available to complete the task. Complete the task fully\u2014don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings \u2014 the caller will relay this to the user, so it only needs the essentials.`, SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.`;
828952
829425
  var init_prompts6 = __esm(() => {
828953
829426
  init_env();
828954
829427
  init_git();
@@ -828983,6 +829456,7 @@ var init_prompts6 = __esm(() => {
828983
829456
  init_undercover();
828984
829457
  init_sfModels();
828985
829458
  init_mcpInstructionsDelta();
829459
+ getCachedMCConfigForFRC = (init_cachedMCConfig(), __toCommonJS(exports_cachedMCConfig)).getCachedMCConfig;
828986
829460
  proactiveModule5 = (init_proactive(), __toCommonJS(exports_proactive));
828987
829461
  BRIEF_PROACTIVE_SECTION2 = (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_PROACTIVE_SECTION;
828988
829462
  _briefToolModule = (init_BriefTool(), __toCommonJS(exports_BriefTool));
@@ -829453,7 +829927,7 @@ function computeFingerprint(messageText, version9) {
829453
829927
  }
829454
829928
  function computeFingerprintFromMessages(messages) {
829455
829929
  const firstMessageText = extractFirstMessageText(messages);
829456
- return computeFingerprint(firstMessageText, "4.2.10");
829930
+ return computeFingerprint(firstMessageText, "4.2.12-beat1");
829457
829931
  }
829458
829932
  var FINGERPRINT_SALT = "59cf53e54c78";
829459
829933
  var init_fingerprint = () => {};
@@ -829863,7 +830337,7 @@ function getAnthropicEnvMetadata() {
829863
830337
  function getBuildAgeMinutes() {
829864
830338
  if (false)
829865
830339
  ;
829866
- const buildTime = new Date("2026-07-07T11:49:19.693Z").getTime();
830340
+ const buildTime = new Date("2026-07-13T01:43:36.376Z").getTime();
829867
830341
  if (isNaN(buildTime))
829868
830342
  return;
829869
830343
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -830096,7 +830570,9 @@ function logAPISuccess({
830096
830570
  connectorTextBlockCount
830097
830571
  } : {},
830098
830572
  fastMode,
830099
- ...{},
830573
+ ...(usage2.cache_deleted_input_tokens ?? 0) > 0 ? {
830574
+ cacheDeletedInputTokens: usage2.cache_deleted_input_tokens
830575
+ } : {},
830100
830576
  ...previousRequestId ? {
830101
830577
  previousRequestId
830102
830578
  } : {},
@@ -833686,7 +834162,21 @@ async function* queryModel(messages, systemPrompt2, thinkingConfig, tools, signa
833686
834162
  }
833687
834163
  let cachedMCEnabled = false;
833688
834164
  let cacheEditingBetaHeader = "";
833689
- if (false) {}
834165
+ if (true) {
834166
+ const {
834167
+ isCachedMicrocompactEnabled: isCachedMicrocompactEnabled2,
834168
+ isModelSupportedForCacheEditing: isModelSupportedForCacheEditing2,
834169
+ getCachedMCConfig: getCachedMCConfig3
834170
+ } = await Promise.resolve().then(() => (init_cachedMicrocompact(), exports_cachedMicrocompact));
834171
+ const betas2 = await Promise.resolve().then(() => (init_betas(), exports_betas));
834172
+ cacheEditingBetaHeader = betas2.CACHE_EDITING_BETA_HEADER;
834173
+ const featureEnabled = isCachedMicrocompactEnabled2();
834174
+ const modelSupported = isModelSupportedForCacheEditing2(options.model);
834175
+ const headerAvailable = !!cacheEditingBetaHeader;
834176
+ cachedMCEnabled = featureEnabled && modelSupported && headerAvailable;
834177
+ const config11 = getCachedMCConfig3();
834178
+ logForDebugging(`Cached MC gate: enabled=${featureEnabled} modelSupported=${modelSupported} headerAvailable=${headerAvailable} model=${options.model} supportedModels=${jsonStringify(config11.supportedModels)}`);
834179
+ }
833690
834180
  const useGlobalCacheFeature = shouldUseGlobalCacheScope();
833691
834181
  const needsToolBasedCacheMarker = useGlobalCacheFeature && filteredTools.some((t2) => t2.isMcp === true);
833692
834182
  if (useGlobalCacheFeature && !betas.includes(PROMPT_CACHING_SCOPE_BETA_HEADER)) {
@@ -833828,7 +834318,12 @@ To invoke any tool listed above, use ExecuteExtraTool with {"tool_name": "<name>
833828
834318
  setFastModeHeaderLatched(true);
833829
834319
  }
833830
834320
  let cacheEditingHeaderLatched = getCacheEditingHeaderLatched() === true;
833831
- if (false) {}
834321
+ if (true) {
834322
+ if (!cacheEditingHeaderLatched && cachedMCEnabled && getAPIProvider() === "firstParty" && options.querySource === "repl_main_thread") {
834323
+ cacheEditingHeaderLatched = true;
834324
+ setCacheEditingHeaderLatched(true);
834325
+ }
834326
+ }
833832
834327
  const effort = resolveAppliedEffort(options.model, options.effortValue);
833833
834328
  if (true) {
833834
834329
  const toolsForCacheDetection = allTools.filter((t2) => !(("defer_loading" in t2) && t2.defer_loading));
@@ -834345,7 +834840,10 @@ To invoke any tool listed above, use ExecuteExtraTool with {"tool_name": "<name>
834345
834840
  max_tokens: maxOutputTokens
834346
834841
  });
834347
834842
  yield createAssistantAPIErrorMessage({
834348
- content: t("errors.claude.outputTokenExceeded", { prefix: API_ERROR_MESSAGE_PREFIX, maxTokens: String(maxOutputTokens) }),
834843
+ content: t("errors.claude.outputTokenExceeded", {
834844
+ prefix: API_ERROR_MESSAGE_PREFIX,
834845
+ maxTokens: String(maxOutputTokens)
834846
+ }),
834349
834847
  apiError: "max_output_tokens",
834350
834848
  error: "max_output_tokens"
834351
834849
  });
@@ -834356,7 +834854,9 @@ To invoke any tool listed above, use ExecuteExtraTool with {"tool_name": "<name>
834356
834854
  output_tokens: usage2.output_tokens
834357
834855
  });
834358
834856
  yield createAssistantAPIErrorMessage({
834359
- content: t("errors.claude.contextWindowLimit", { prefix: API_ERROR_MESSAGE_PREFIX }),
834857
+ content: t("errors.claude.contextWindowLimit", {
834858
+ prefix: API_ERROR_MESSAGE_PREFIX
834859
+ }),
834360
834860
  apiError: "max_output_tokens",
834361
834861
  error: "max_output_tokens"
834362
834862
  });
@@ -834438,7 +834938,9 @@ To invoke any tool listed above, use ExecuteExtraTool with {"tool_name": "<name>
834438
834938
  throw streamingError;
834439
834939
  } else {
834440
834940
  logForDebugging(`Streaming timeout (SDK abort): ${streamingError.message}`, { level: "error" });
834441
- throw new APIConnectionTimeoutError({ message: t("errors.claude.requestTimedOut") });
834941
+ throw new APIConnectionTimeoutError({
834942
+ message: t("errors.claude.requestTimedOut")
834943
+ });
834442
834944
  }
834443
834945
  }
834444
834946
  const disableFallback = isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK) || getFeatureValue_CACHED_MAY_BE_STALE("tengu_disable_streaming_to_non_streaming_fallback", false);
@@ -834663,7 +835165,9 @@ To invoke any tool listed above, use ExecuteExtraTool with {"tool_name": "<name>
834663
835165
  costUSD += addToTotalSessionCost(fallbackCost, fallbackUsage, options.model);
834664
835166
  }
834665
835167
  }
834666
- if (false) {}
835168
+ if (cachedMCEnabled) {
835169
+ markToolsSentToAPIState();
835170
+ }
834667
835171
  if (streamRequestId && !getAgentContext() && (options.querySource.startsWith("repl_main_thread") || options.querySource === "sdk")) {
834668
835172
  setLastMainRequestId(streamRequestId);
834669
835173
  }
@@ -834745,7 +835249,9 @@ function updateUsage(usage2, partUsage) {
834745
835249
  ephemeral_1h_input_tokens: partUsage.cache_creation?.ephemeral_1h_input_tokens ?? usage2.cache_creation.ephemeral_1h_input_tokens,
834746
835250
  ephemeral_5m_input_tokens: partUsage.cache_creation?.ephemeral_5m_input_tokens ?? usage2.cache_creation.ephemeral_5m_input_tokens
834747
835251
  },
834748
- ...{},
835252
+ ...{
835253
+ cache_deleted_input_tokens: partUsage.cache_deleted_input_tokens != null && partUsage.cache_deleted_input_tokens > 0 ? partUsage.cache_deleted_input_tokens : usage2.cache_deleted_input_tokens ?? 0
835254
+ },
834749
835255
  inference_geo: usage2.inference_geo,
834750
835256
  iterations: partUsage.iterations ?? usage2.iterations,
834751
835257
  speed: partUsage.speed ?? usage2.speed
@@ -834766,7 +835272,9 @@ function accumulateUsage(totalUsage, messageUsage) {
834766
835272
  ephemeral_1h_input_tokens: totalUsage.cache_creation.ephemeral_1h_input_tokens + messageUsage.cache_creation.ephemeral_1h_input_tokens,
834767
835273
  ephemeral_5m_input_tokens: totalUsage.cache_creation.ephemeral_5m_input_tokens + messageUsage.cache_creation.ephemeral_5m_input_tokens
834768
835274
  },
834769
- ...{},
835275
+ ...{
835276
+ cache_deleted_input_tokens: (totalUsage.cache_deleted_input_tokens ?? 0) + (messageUsage.cache_deleted_input_tokens ?? 0)
835277
+ },
834770
835278
  inference_geo: messageUsage.inference_geo,
834771
835279
  iterations: messageUsage.iterations,
834772
835280
  speed: messageUsage.speed
@@ -835214,7 +835722,7 @@ async function sideQuery(opts) {
835214
835722
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
835215
835723
  }
835216
835724
  const messageText = extractFirstUserMessageText(messages);
835217
- const fingerprint = computeFingerprint(messageText, "4.2.10");
835725
+ const fingerprint = computeFingerprint(messageText, "4.2.12-beat1");
835218
835726
  const attributionHeader = getAttributionHeader(fingerprint);
835219
835727
  const systemBlocks = [
835220
835728
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -838589,7 +839097,7 @@ function buildSystemInitMessage(inputs) {
838589
839097
  slash_commands: inputs.commands.filter((c7) => c7.userInvocable !== false).map((c7) => c7.name),
838590
839098
  apiKeySource: getAnthropicApiKeyWithSource().source,
838591
839099
  betas: getSdkBetas(),
838592
- claude_code_version: "4.2.10",
839100
+ claude_code_version: "4.2.12-beat1",
838593
839101
  output_style: outputStyle2,
838594
839102
  agents: inputs.agents.map((agent) => agent.agentType),
838595
839103
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -840289,8 +840797,9 @@ function markdownEscape(text2) {
840289
840797
  }
840290
840798
  var IS_ROOT, ALLOW_BYPASS, PERMISSION_MODE_ALIASES, MAX_TITLE_LENGTH = 256;
840291
840799
  var init_utils27 = __esm(() => {
840800
+ init_env();
840292
840801
  IS_ROOT = typeof process.geteuid === "function" ? process.geteuid() === 0 : typeof process.getuid === "function" ? process.getuid() === 0 : false;
840293
- ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX;
840802
+ ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX || env4.isWslEnvironment();
840294
840803
  PERMISSION_MODE_ALIASES = {
840295
840804
  auto: "auto",
840296
840805
  default: "default",
@@ -842131,7 +842640,7 @@ function appendToLog(path51, message2) {
842131
842640
  cwd: getFsImplementation().cwd(),
842132
842641
  userType: process.env.USER_TYPE,
842133
842642
  sessionId: getSessionId(),
842134
- version: "4.2.10"
842643
+ version: "4.2.12-beat1"
842135
842644
  };
842136
842645
  getLogWriter(path51).write(messageWithTimestamp);
842137
842646
  }
@@ -848291,34 +848800,33 @@ ${questionsWithAnswers}`;
848291
848800
  isInPlanMode,
848292
848801
  allImageAttachments
848293
848802
  ]);
848294
- const AUTO_SELECT_TIMEOUT_S = settings.askUserQuestionTimeoutSeconds ?? 600;
848295
- const [autoSelectSecondsLeft, setAutoSelectSecondsLeft] = import_react236.useState(AUTO_SELECT_TIMEOUT_S);
848803
+ const autoSelectEnabled = isAskUserQuestionAutoSelectEnabled(settings);
848804
+ const autoSelectTimeoutSeconds = getAskUserQuestionAutoSelectTimeoutSeconds(settings);
848805
+ const [autoSelectSecondsLeft, setAutoSelectSecondsLeft] = import_react236.useState(autoSelectEnabled ? autoSelectTimeoutSeconds : undefined);
848296
848806
  import_react236.useEffect(() => {
848297
- if (AUTO_SELECT_TIMEOUT_S !== 0)
848807
+ if (!autoSelectEnabled || autoSelectTimeoutSeconds !== 0)
848298
848808
  return;
848299
- const autoAnswers = {};
848300
- for (const q3 of questions) {
848301
- if (q3.options.length > 0) {
848302
- autoAnswers[q3.question] = q3.options[0].label;
848303
- }
848304
- }
848809
+ const autoAnswers = buildAskUserQuestionAutoAnswers(questions);
848305
848810
  submitAnswers(autoAnswers).catch(logError3);
848306
848811
  }, []);
848307
848812
  import_react236.useEffect(() => {
848308
- if (AUTO_SELECT_TIMEOUT_S === 0)
848813
+ if (!autoSelectEnabled || autoSelectTimeoutSeconds === 0) {
848814
+ setAutoSelectSecondsLeft(undefined);
848309
848815
  return;
848310
- setAutoSelectSecondsLeft(AUTO_SELECT_TIMEOUT_S);
848816
+ }
848817
+ setAutoSelectSecondsLeft(autoSelectTimeoutSeconds);
848311
848818
  const submitTimer = setTimeout(() => {
848312
848819
  const autoAnswers = { ...answers };
848313
- for (const q3 of questions) {
848314
- if (!autoAnswers[q3.question] && q3.options.length > 0) {
848315
- autoAnswers[q3.question] = q3.options[0].label;
848820
+ const defaultAutoAnswers = buildAskUserQuestionAutoAnswers(questions);
848821
+ for (const [question, label] of Object.entries(defaultAutoAnswers)) {
848822
+ if (!autoAnswers[question]) {
848823
+ autoAnswers[question] = label;
848316
848824
  }
848317
848825
  }
848318
848826
  submitAnswers(autoAnswers).catch(logError3);
848319
- }, AUTO_SELECT_TIMEOUT_S * 1000);
848827
+ }, autoSelectTimeoutSeconds * 1000);
848320
848828
  const countdownInterval = setInterval(() => {
848321
- setAutoSelectSecondsLeft((s) => Math.max(0, s - 1));
848829
+ setAutoSelectSecondsLeft((s) => s === undefined ? s : Math.max(0, s - 1));
848322
848830
  }, 1000);
848323
848831
  return () => {
848324
848832
  clearTimeout(submitTimer);
@@ -858345,23 +858853,92 @@ var init_shellCompletion = __esm(() => {
858345
858853
  });
858346
858854
 
858347
858855
  // src/utils/suggestions/commandSuggestions.ts
858856
+ function getSearchAliases(values4) {
858857
+ const aliases = new Set;
858858
+ for (const value of values4) {
858859
+ const normalizedValue = value.trim().toLowerCase();
858860
+ if (!normalizedValue) {
858861
+ continue;
858862
+ }
858863
+ aliases.add(normalizedValue);
858864
+ const compactValue = normalizedValue.replace(SEPARATORS, "");
858865
+ if (compactValue) {
858866
+ aliases.add(compactValue);
858867
+ }
858868
+ }
858869
+ return [...aliases];
858870
+ }
858871
+ function getPluginNamespace(commandName) {
858872
+ const separatorIndex = commandName.indexOf(":");
858873
+ return separatorIndex > 0 ? commandName.slice(0, separatorIndex) : undefined;
858874
+ }
858875
+ function getAliasMatch(queryAliases, aliases) {
858876
+ let prefixLength;
858877
+ for (const alias2 of aliases) {
858878
+ if (queryAliases.includes(alias2)) {
858879
+ return { exact: true, prefixLength: alias2.length };
858880
+ }
858881
+ if (queryAliases.some((queryAlias) => alias2.startsWith(queryAlias)) && (prefixLength === undefined || alias2.length < prefixLength)) {
858882
+ prefixLength = alias2.length;
858883
+ }
858884
+ }
858885
+ return { exact: false, prefixLength };
858886
+ }
858887
+ function getCommandSearchMatch(queryAliases, item) {
858888
+ const nameMatch = getAliasMatch(queryAliases, item.commandNameKey);
858889
+ const aliasMatch = getAliasMatch(queryAliases, item.aliasKey ?? []);
858890
+ const canonicalMatch = getAliasMatch(queryAliases, item.canonicalNameKey ?? []);
858891
+ const pluginOwnerMatch = getAliasMatch(queryAliases, item.pluginOwnerKey ?? []);
858892
+ if (nameMatch.exact)
858893
+ return { rank: 0, prefixLength: undefined };
858894
+ if (aliasMatch.exact)
858895
+ return { rank: 1, prefixLength: undefined };
858896
+ if (canonicalMatch.exact)
858897
+ return { rank: 2, prefixLength: undefined };
858898
+ if (pluginOwnerMatch.exact)
858899
+ return { rank: 3, prefixLength: undefined };
858900
+ if (nameMatch.prefixLength !== undefined) {
858901
+ return { rank: 4, prefixLength: nameMatch.prefixLength };
858902
+ }
858903
+ if (aliasMatch.prefixLength !== undefined) {
858904
+ return { rank: 5, prefixLength: aliasMatch.prefixLength };
858905
+ }
858906
+ if (canonicalMatch.prefixLength !== undefined) {
858907
+ return { rank: 6, prefixLength: canonicalMatch.prefixLength };
858908
+ }
858909
+ if (pluginOwnerMatch.prefixLength !== undefined) {
858910
+ return { rank: 7, prefixLength: pluginOwnerMatch.prefixLength };
858911
+ }
858912
+ return { rank: 8, prefixLength: undefined };
858913
+ }
858348
858914
  function getCommandFuse(commands7) {
858349
858915
  if (fuseCache?.commands === commands7) {
858350
858916
  return fuseCache.fuse;
858351
858917
  }
858352
858918
  const commandData = commands7.filter((cmd) => !cmd.isHidden).map((cmd) => {
858353
858919
  const commandName = getCommandName(cmd);
858920
+ const commandNameKey = getSearchAliases([commandName]);
858921
+ const aliasKey = cmd.aliases ? getSearchAliases(cmd.aliases) : undefined;
858354
858922
  const displayParts = commandName.split(SEPARATORS).filter(Boolean);
858355
858923
  const nameParts = cmd.name !== commandName ? cmd.name.split(SEPARATORS).filter(Boolean) : [];
858356
858924
  const allParts = [
858357
858925
  ...new Set([...displayParts, ...nameParts])
858358
858926
  ];
858927
+ const isPluginPromptCommand = cmd.type === "prompt" && cmd.source === "plugin";
858928
+ const canonicalNameKey = isPluginPromptCommand ? getSearchAliases([cmd.name]) : undefined;
858929
+ const pluginOwnerKey = isPluginPromptCommand ? getSearchAliases([
858930
+ getPluginNamespace(cmd.name) ?? "",
858931
+ cmd.pluginInfo?.pluginManifest.name ?? ""
858932
+ ]) : undefined;
858359
858933
  return {
858360
858934
  descriptionKey: (cmd.description ?? "").split(" ").map((word) => cleanWord(word)).filter(Boolean),
858361
858935
  partKey: allParts.length > 1 ? allParts : undefined,
858362
858936
  commandName,
858937
+ commandNameKey,
858363
858938
  command: cmd,
858364
- aliasKey: cmd.aliases
858939
+ aliasKey,
858940
+ canonicalNameKey,
858941
+ pluginOwnerKey
858365
858942
  };
858366
858943
  });
858367
858944
  const fuse = new Fuse(commandData, {
@@ -858382,6 +858959,14 @@ function getCommandFuse(commands7) {
858382
858959
  name: "aliasKey",
858383
858960
  weight: 2
858384
858961
  },
858962
+ {
858963
+ name: "canonicalNameKey",
858964
+ weight: 1.5
858965
+ },
858966
+ {
858967
+ name: "pluginOwnerKey",
858968
+ weight: 1.25
858969
+ },
858385
858970
  {
858386
858971
  name: "descriptionKey",
858387
858972
  weight: 0.5
@@ -858546,46 +859131,19 @@ function generateCommandSuggestions(input4, commands7) {
858546
859131
  }
858547
859132
  const fuse = getCommandFuse(commands7);
858548
859133
  const searchResults = fuse.search(query3);
859134
+ const queryAliases = getSearchAliases([query3]);
858549
859135
  const withMeta = searchResults.map((r4) => {
858550
- const name3 = r4.item.commandName.toLowerCase();
858551
- const aliases = r4.item.aliasKey?.map((alias2) => alias2.toLowerCase()) ?? [];
859136
+ const match = getCommandSearchMatch(queryAliases, r4.item);
858552
859137
  const usage2 = r4.item.command.type === "prompt" ? getSkillUsageScore(getCommandName(r4.item.command)) : 0;
858553
- return { r: r4, name: name3, aliases, usage: usage2 };
859138
+ return { r: r4, match, usage: usage2 };
858554
859139
  });
858555
859140
  const sortedResults = withMeta.sort((a5, b6) => {
858556
- const aName = a5.name;
858557
- const bName = b6.name;
858558
- const aAliases = a5.aliases;
858559
- const bAliases = b6.aliases;
858560
- const aExactName = aName === query3;
858561
- const bExactName = bName === query3;
858562
- if (aExactName && !bExactName)
858563
- return -1;
858564
- if (bExactName && !aExactName)
858565
- return 1;
858566
- const aExactAlias = aAliases.some((alias2) => alias2 === query3);
858567
- const bExactAlias = bAliases.some((alias2) => alias2 === query3);
858568
- if (aExactAlias && !bExactAlias)
858569
- return -1;
858570
- if (bExactAlias && !aExactAlias)
858571
- return 1;
858572
- const aPrefixName = aName.startsWith(query3);
858573
- const bPrefixName = bName.startsWith(query3);
858574
- if (aPrefixName && !bPrefixName)
858575
- return -1;
858576
- if (bPrefixName && !aPrefixName)
858577
- return 1;
858578
- if (aPrefixName && bPrefixName && aName.length !== bName.length) {
858579
- return aName.length - bName.length;
859141
+ const rankDiff = a5.match.rank - b6.match.rank;
859142
+ if (rankDiff !== 0) {
859143
+ return rankDiff;
858580
859144
  }
858581
- const aPrefixAlias = aAliases.find((alias2) => alias2.startsWith(query3));
858582
- const bPrefixAlias = bAliases.find((alias2) => alias2.startsWith(query3));
858583
- if (aPrefixAlias && !bPrefixAlias)
858584
- return -1;
858585
- if (bPrefixAlias && !aPrefixAlias)
858586
- return 1;
858587
- if (aPrefixAlias && bPrefixAlias && aPrefixAlias.length !== bPrefixAlias.length) {
858588
- return aPrefixAlias.length - bPrefixAlias.length;
859145
+ if (a5.match.prefixLength !== undefined && b6.match.prefixLength !== undefined && a5.match.prefixLength !== b6.match.prefixLength) {
859146
+ return a5.match.prefixLength - b6.match.prefixLength;
858589
859147
  }
858590
859148
  const scoreDiff = (a5.r.score ?? 0) - (b6.r.score ?? 0);
858591
859149
  if (Math.abs(scoreDiff) > 0.1) {
@@ -862933,7 +863491,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
862933
863491
  project_dir: getOriginalCwd(),
862934
863492
  added_dirs: addedDirs
862935
863493
  },
862936
- version: "4.2.10",
863494
+ version: "4.2.12-beat1",
862937
863495
  output_style: {
862938
863496
  name: outputStyleName
862939
863497
  },
@@ -881488,7 +882046,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
881488
882046
  } catch {}
881489
882047
  const data = {
881490
882048
  trigger,
881491
- version: "4.2.10",
882049
+ version: "4.2.12-beat1",
881492
882050
  platform: process.platform,
881493
882051
  transcript,
881494
882052
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -882743,7 +883301,7 @@ function getReleaseType(current2, latest) {
882743
883301
  return "patch";
882744
883302
  }
882745
883303
  async function checkNewAutoUpdate(callbacks) {
882746
- const currentVersion = "4.2.10";
883304
+ const currentVersion = "4.2.12-beat1";
882747
883305
  logForDebugging(`[newAutoUpdater] checking, current: ${currentVersion}`);
882748
883306
  if (isNewAutoUpdaterDisabled()) {
882749
883307
  return { action: "skip", currentVersion, latestVersion: null };
@@ -889948,10 +890506,7 @@ function REPL({
889948
890506
  return;
889949
890507
  worktreeTipShownRef.current = true;
889950
890508
  const secs = Math.round(wt.creationDurationMs / 1000);
889951
- setMessages((prev) => [
889952
- ...prev,
889953
- createSystemMessage(t("repl.worktreeCreationSlow", { secs: String(secs) }), "info")
889954
- ]);
890509
+ setMessages((prev) => [...prev, createSystemMessage(t("repl.worktreeCreationSlow", { secs: String(secs) }), "info")]);
889955
890510
  }, [setMessages]);
889956
890511
  const onlySleepToolActive = import_react356.useMemo(() => {
889957
890512
  const lastAssistant = messages.findLast((m3) => m3.type === "assistant");
@@ -890601,6 +891156,8 @@ ${t("repl.sandboxRequired", { reason })}
890601
891156
  }
890602
891157
  return [...oldMessages, newMessage];
890603
891158
  });
891159
+ } else if (newMessage.type === "system" && newMessage.subtype === "api_error") {
891160
+ setMessages((oldMessages) => replaceOrAppendApiErrorMessage(oldMessages, newMessage));
890604
891161
  } else {
890605
891162
  setMessages((oldMessages) => [...oldMessages, newMessage]);
890606
891163
  }
@@ -892697,10 +893254,7 @@ ${t("repl.suspended")}
892697
893254
  const compactMessages = getMessagesAfterCompactBoundary(messages);
892698
893255
  const messageIndex = compactMessages.indexOf(message2);
892699
893256
  if (messageIndex === -1) {
892700
- setMessages((prev) => [
892701
- ...prev,
892702
- createSystemMessage(t("repl.messageSniped"), "warning")
892703
- ]);
893257
+ setMessages((prev) => [...prev, createSystemMessage(t("repl.messageSniped"), "warning")]);
892704
893258
  return;
892705
893259
  }
892706
893260
  const newAbortController = createAbortController();
@@ -893619,7 +894173,7 @@ function WelcomeV2() {
893619
894173
  dimColor: true,
893620
894174
  children: [
893621
894175
  "v",
893622
- "4.2.10",
894176
+ "4.2.12-beat1",
893623
894177
  " "
893624
894178
  ]
893625
894179
  })
@@ -893685,7 +894239,7 @@ function WelcomeV2() {
893685
894239
  dimColor: true,
893686
894240
  children: [
893687
894241
  "v",
893688
- "4.2.10",
894242
+ "4.2.12-beat1",
893689
894243
  " "
893690
894244
  ]
893691
894245
  })
@@ -893787,7 +894341,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
893787
894341
  dimColor: true,
893788
894342
  children: [
893789
894343
  "v",
893790
- "4.2.10",
894344
+ "4.2.12-beat1",
893791
894345
  " "
893792
894346
  ]
893793
894347
  })
@@ -893853,7 +894407,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
893853
894407
  dimColor: true,
893854
894408
  children: [
893855
894409
  "v",
893856
- "4.2.10",
894410
+ "4.2.12-beat1",
893857
894411
  " "
893858
894412
  ]
893859
894413
  })
@@ -894793,7 +895347,7 @@ function completeOnboarding() {
894793
895347
  saveGlobalConfig((current2) => ({
894794
895348
  ...current2,
894795
895349
  hasCompletedOnboarding: true,
894796
- lastOnboardingVersion: "4.2.10"
895350
+ lastOnboardingVersion: "4.2.12-beat1"
894797
895351
  }));
894798
895352
  }
894799
895353
  function showDialog(root6, renderer) {
@@ -901522,7 +902076,7 @@ To attach: ${source_default.bold(`tmux attach -t ${tmuxSessionName}`)}`));
901522
902076
  }
901523
902077
  }
901524
902078
  if (permissionMode === "bypassPermissions" || allowDangerouslySkipPermissions) {
901525
- if (process.platform !== "win32" && typeof process.getuid === "function" && process.getuid() === 0 && process.env.IS_SANDBOX !== "1" && !isEnvTruthy(process.env.CLAUDE_CODE_BUBBLEWRAP)) {
902079
+ if (process.platform !== "win32" && typeof process.getuid === "function" && process.getuid() === 0 && process.env.IS_SANDBOX !== "1" && !isEnvTruthy(process.env.CLAUDE_CODE_BUBBLEWRAP) && !env4.isWslEnvironment()) {
901526
902080
  console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`);
901527
902081
  process.exit(1);
901528
902082
  }
@@ -908623,7 +909177,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
908623
909177
  setCwd(cwd3);
908624
909178
  const server2 = new Server({
908625
909179
  name: "claude/tengu",
908626
- version: "4.2.10"
909180
+ version: "4.2.12-beat1"
908627
909181
  }, {
908628
909182
  capabilities: {
908629
909183
  tools: {}
@@ -910902,7 +911456,7 @@ function createHealthRoutes(sessionManager) {
910902
911456
  const uptime2 = process.uptime() * 1000;
910903
911457
  return c7.json({
910904
911458
  status: "ok",
910905
- version: "4.2.10",
911459
+ version: "4.2.12-beat1",
910906
911460
  uptime_ms: Math.round(uptime2),
910907
911461
  active_sessions: sessionManager.getActiveCount()
910908
911462
  });
@@ -911172,7 +911726,7 @@ function getMacroDefines() {
911172
911726
  commit = execSync3("git rev-parse --short HEAD", { encoding: "utf-8", cwd: __dirname }).trim();
911173
911727
  } catch {}
911174
911728
  return {
911175
- "MACRO.VERSION": JSON.stringify("4.2.10"),
911729
+ "MACRO.VERSION": JSON.stringify("4.2.12-beat1"),
911176
911730
  "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
911177
911731
  "MACRO.COMMIT": JSON.stringify(commit),
911178
911732
  "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),
@@ -911209,6 +911763,7 @@ var init_defines = __esm(() => {
911209
911763
  "WORKFLOW_SCRIPTS",
911210
911764
  "HISTORY_SNIP",
911211
911765
  "REACTIVE_COMPACT",
911766
+ "CACHED_MICROCOMPACT",
911212
911767
  "MONITOR_TOOL",
911213
911768
  "KAIROS",
911214
911769
  "BG_SESSIONS",
@@ -917790,7 +918345,7 @@ __export(exports_update, {
917790
918345
  });
917791
918346
  async function update() {
917792
918347
  logEvent("tengu_update_check", {});
917793
- writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.10"}
918348
+ writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.12-beat1"}
917794
918349
  `);
917795
918350
  const channel5 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
917796
918351
  writeToStdout(`${t("cli.update.checkingUpdates", { channel: channel5 }, "Checking for updates to {channel} version...")}
@@ -917865,8 +918420,8 @@ async function update() {
917865
918420
  writeToStdout(`${t("cli.update.managedByHomebrew", "CoStrict is managed by Homebrew.")}
917866
918421
  `);
917867
918422
  const latest = await getLatestVersion(channel5);
917868
- if (latest && !gte2("4.2.10", latest)) {
917869
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.10", latest }, "Update available: {current} \u2192 {latest}")}
918423
+ if (latest && !gte2("4.2.12-beat1", latest)) {
918424
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.12-beat1", latest }, "Update available: {current} \u2192 {latest}")}
917870
918425
  `);
917871
918426
  writeToStdout(`
917872
918427
  `);
@@ -917882,8 +918437,8 @@ async function update() {
917882
918437
  writeToStdout(`${t("cli.update.managedByWinget", "CoStrict is managed by winget.")}
917883
918438
  `);
917884
918439
  const latest = await getLatestVersion(channel5);
917885
- if (latest && !gte2("4.2.10", latest)) {
917886
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.10", latest }, "Update available: {current} \u2192 {latest}")}
918440
+ if (latest && !gte2("4.2.12-beat1", latest)) {
918441
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.12-beat1", latest }, "Update available: {current} \u2192 {latest}")}
917887
918442
  `);
917888
918443
  writeToStdout(`
917889
918444
  `);
@@ -917899,8 +918454,8 @@ async function update() {
917899
918454
  writeToStdout(`${t("cli.update.managedByApk", "CoStrict is managed by apk.")}
917900
918455
  `);
917901
918456
  const latest = await getLatestVersion(channel5);
917902
- if (latest && !gte2("4.2.10", latest)) {
917903
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.10", latest }, "Update available: {current} \u2192 {latest}")}
918457
+ if (latest && !gte2("4.2.12-beat1", latest)) {
918458
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.12-beat1", latest }, "Update available: {current} \u2192 {latest}")}
917904
918459
  `);
917905
918460
  writeToStdout(`
917906
918461
  `);
@@ -917965,11 +918520,11 @@ async function update() {
917965
918520
  `);
917966
918521
  await gracefulShutdown(1);
917967
918522
  }
917968
- if (result2.latestVersion === "4.2.10") {
917969
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.10" }, "CoStrict is up to date ({version})")) + `
918523
+ if (result2.latestVersion === "4.2.12-beat1") {
918524
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.12-beat1" }, "CoStrict is up to date ({version})")) + `
917970
918525
  `);
917971
918526
  } else {
917972
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.10", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
918527
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.12-beat1", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
917973
918528
  `);
917974
918529
  regenerateCompletionCache();
917975
918530
  }
@@ -918029,12 +918584,12 @@ async function update() {
918029
918584
  `);
918030
918585
  await gracefulShutdown(1);
918031
918586
  }
918032
- if (latestVersion === "4.2.10") {
918033
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.10" }, "CoStrict is up to date ({version})")) + `
918587
+ if (latestVersion === "4.2.12-beat1") {
918588
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.12-beat1" }, "CoStrict is up to date ({version})")) + `
918034
918589
  `);
918035
918590
  await gracefulShutdown(0);
918036
918591
  }
918037
- writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.10" }, "New version available: {latest} (current: {current})")}
918592
+ writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.12-beat1" }, "New version available: {latest} (current: {current})")}
918038
918593
  `);
918039
918594
  writeToStdout(`${t("cli.update.installing", "Installing update...")}
918040
918595
  `);
@@ -918079,7 +918634,7 @@ async function update() {
918079
918634
  logForDebugging(`update: Installation status: ${result.status}`);
918080
918635
  switch (result.status) {
918081
918636
  case "success":
918082
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.10", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
918637
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.12-beat1", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
918083
918638
  `);
918084
918639
  regenerateCompletionCache();
918085
918640
  break;
@@ -920299,7 +920854,7 @@ ${assistantAddendum}` : assistantAddendum;
920299
920854
  }
920300
920855
  }
920301
920856
  logForDiagnosticsNoPII("info", "started", {
920302
- version: "4.2.10",
920857
+ version: "4.2.12-beat1",
920303
920858
  is_native_binary: isInBundledMode()
920304
920859
  });
920305
920860
  registerCleanup(async () => {
@@ -920780,7 +921335,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
920780
921335
  sshSession = await createSSHSession2({
920781
921336
  host: _pendingSSH.host,
920782
921337
  cwd: _pendingSSH.cwd,
920783
- localVersion: "4.2.10",
921338
+ localVersion: "4.2.12-beat1",
920784
921339
  permissionMode: _pendingSSH.permissionMode,
920785
921340
  dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
920786
921341
  extraCliArgs: _pendingSSH.extraCliArgs,
@@ -921252,7 +921807,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
921252
921807
  pendingHookMessages
921253
921808
  }, renderAndRun);
921254
921809
  }
921255
- }).version("4.2.10 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
921810
+ }).version("4.2.12-beat1 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
921256
921811
  program2.addOption(new Option("-w, --worktree [name]", cliDesc("cli.option.worktree", "Create a new git worktree for this session (optionally specify a name)")).hideHelp());
921257
921812
  program2.addOption(new Option("--tmux", cliDesc("cli.option.tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.")).hideHelp());
921258
921813
  if (canUserConfigureAdvisor()) {
@@ -921967,10 +922522,10 @@ if (process.env.CLAUDE_CODE_REMOTE === "true") {
921967
922522
  async function main2() {
921968
922523
  const args = process.argv.slice(2);
921969
922524
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
921970
- const d4 = new Date("2026-07-07T11:49:19.693Z");
922525
+ const d4 = new Date("2026-07-13T01:43:36.376Z");
921971
922526
  const p2 = (n3) => String(n3).padStart(2, "0");
921972
922527
  const buildTime = `${d4.getFullYear()}/${p2(d4.getMonth() + 1)}/${p2(d4.getDate())} ${p2(d4.getHours())}:${p2(d4.getMinutes())}:${p2(d4.getSeconds())}`;
921973
- console.log(`${"4.2.10"} (commit: ${"a88db980e"}, built: ${buildTime})`);
922528
+ console.log(`${"4.2.12-beat1"} (commit: ${"9c74db60a"}, built: ${buildTime})`);
921974
922529
  return;
921975
922530
  }
921976
922531
  const { terminateBatchWorker: terminateBatchWorker2 } = await Promise.resolve().then(() => (init_spawn(), exports_spawn));
@@ -922117,5 +922672,5 @@ async function main2() {
922117
922672
  }
922118
922673
  main2();
922119
922674
 
922120
- //# debugId=D7E46C1BD21A39D464756E2164756E21
922675
+ //# debugId=D98E09F823510B3C64756E2164756E21
922121
922676
  //# sourceMappingURL=cli.js.map