@costrict/csc 4.2.32 → 4.2.34

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
@@ -31759,8 +31759,8 @@ function getClientVersion() {
31759
31759
  if (cached)
31760
31760
  return cached;
31761
31761
  try {
31762
- if ("4.2.32") {
31763
- cached = "4.2.32";
31762
+ if ("4.2.33") {
31763
+ cached = "4.2.33";
31764
31764
  return cached;
31765
31765
  }
31766
31766
  } catch {}
@@ -99677,8 +99677,8 @@ var init_types2 = __esm(() => {
99677
99677
  ...{
99678
99678
  defaultView: exports_external.enum(["chat", "transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")
99679
99679
  },
99680
- 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."),
99681
- 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."),
99680
+ askUserQuestionAutoSelectEnabled: exports_external.boolean().optional().describe("Whether AskUserQuestion auto-selects the first option after a timeout (default: disabled). When false or unset, AskUserQuestion never auto-selects first options and askUserQuestionTimeoutSeconds is ignored."),
99681
+ askUserQuestionTimeoutSeconds: exports_external.number().int().nonnegative().optional().describe("Timeout in seconds before the first option is auto-selected in AskUserQuestion dialogs (default: 600). Only takes effect when askUserQuestionAutoSelectEnabled is explicitly set to true. Set to 0 to immediately select the first option without showing the dialog."),
99682
99682
  prefersReducedMotion: exports_external.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),
99683
99683
  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."),
99684
99684
  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/."),
@@ -224319,7 +224319,7 @@ async function fetchCoStrictModels(baseUrl, accessToken) {
224319
224319
  headers: {
224320
224320
  Authorization: `Bearer ${accessToken}`,
224321
224321
  Accept: "application/json",
224322
- "User-Agent": `csc/${"4.2.32"}`
224322
+ "User-Agent": `csc/${"4.2.33"}`
224323
224323
  },
224324
224324
  signal: controller.signal
224325
224325
  });
@@ -226359,7 +226359,7 @@ var init_auth7 = __esm(() => {
226359
226359
 
226360
226360
  // src/utils/userAgent.ts
226361
226361
  function getClaudeCodeUserAgent() {
226362
- return `costrict/${"4.2.32"}`;
226362
+ return `costrict/${"4.2.33"}`;
226363
226363
  }
226364
226364
 
226365
226365
  // src/utils/workloadContext.ts
@@ -226381,7 +226381,7 @@ function getUserAgent() {
226381
226381
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
226382
226382
  const workload = getWorkload();
226383
226383
  const workloadSuffix = workload ? `, workload/${workload}` : "";
226384
- return `csc/${"4.2.32"}`;
226384
+ return `csc/${"4.2.33"}`;
226385
226385
  }
226386
226386
  function getMCPUserAgent() {
226387
226387
  const parts = [];
@@ -226395,7 +226395,7 @@ function getMCPUserAgent() {
226395
226395
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
226396
226396
  }
226397
226397
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
226398
- return `csc/${"4.2.32"}${suffix}`;
226398
+ return `csc/${"4.2.33"}${suffix}`;
226399
226399
  }
226400
226400
  function getWebFetchUserAgent() {
226401
226401
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -226515,7 +226515,7 @@ var init_user = __esm(() => {
226515
226515
  deviceId,
226516
226516
  sessionId: getSessionId(),
226517
226517
  email: getEmail(),
226518
- appVersion: "4.2.32",
226518
+ appVersion: "4.2.33",
226519
226519
  platform: getHostPlatformForAnalytics(),
226520
226520
  organizationUuid,
226521
226521
  accountUuid,
@@ -237563,7 +237563,7 @@ var init_metadata = __esm(() => {
237563
237563
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
237564
237564
  WHITESPACE_REGEX = /\s+/;
237565
237565
  getVersionBase = memoize_default(() => {
237566
- const match = "4.2.32".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
237566
+ const match = "4.2.33".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
237567
237567
  return match ? match[0] : undefined;
237568
237568
  });
237569
237569
  buildEnvContext = memoize_default(async () => {
@@ -237603,9 +237603,9 @@ var init_metadata = __esm(() => {
237603
237603
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
237604
237604
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
237605
237605
  isClaudeAiAuth: isClaudeAISubscriber(),
237606
- version: "4.2.32",
237606
+ version: "4.2.33",
237607
237607
  versionBase: getVersionBase(),
237608
- buildTime: "2026-09-01T08:57:00.502Z",
237608
+ buildTime: "2026-09-03T05:24:39.995Z",
237609
237609
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
237610
237610
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
237611
237611
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -238276,7 +238276,7 @@ function initialize1PEventLogging() {
238276
238276
  const platform3 = getPlatform();
238277
238277
  const attributes = {
238278
238278
  [import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
238279
- [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.32"
238279
+ [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.33"
238280
238280
  };
238281
238281
  if (platform3 === "wsl") {
238282
238282
  const wslVersion = getWslVersion();
@@ -238303,7 +238303,7 @@ function initialize1PEventLogging() {
238303
238303
  })
238304
238304
  ]
238305
238305
  });
238306
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.32");
238306
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.33");
238307
238307
  }
238308
238308
  async function reinitialize1PEventLoggingIfConfigChanged() {
238309
238309
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -306313,8 +306313,17 @@ async function* adaptOpenAIStreamToAnthropic(stream7, model) {
306313
306313
  if (!delta)
306314
306314
  continue;
306315
306315
  const reasoningContent = extractReasoning(delta);
306316
- if (reasoningContent != null) {
306316
+ const isEmptyReasoningNoise = reasoningContent === "" && openBlockIndices.size > 0;
306317
+ if (reasoningContent != null && !isEmptyReasoningNoise) {
306317
306318
  if (!thinkingBlockOpen) {
306319
+ if (textBlockOpen) {
306320
+ yield {
306321
+ type: "content_block_stop",
306322
+ index: currentContentIndex
306323
+ };
306324
+ openBlockIndices.delete(currentContentIndex);
306325
+ textBlockOpen = false;
306326
+ }
306318
306327
  currentContentIndex++;
306319
306328
  thinkingBlockOpen = true;
306320
306329
  openBlockIndices.add(currentContentIndex);
@@ -354066,7 +354075,7 @@ function getTelemetryAttributes() {
354066
354075
  attributes["session.id"] = sessionId;
354067
354076
  }
354068
354077
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
354069
- attributes["app.version"] = "4.2.32";
354078
+ attributes["app.version"] = "4.2.33";
354070
354079
  }
354071
354080
  const oauthAccount = getOauthAccountInfo();
354072
354081
  if (oauthAccount) {
@@ -469192,7 +469201,7 @@ function getInstallationEnv() {
469192
469201
  return;
469193
469202
  }
469194
469203
  function getClaudeCodeVersion() {
469195
- return "4.2.32";
469204
+ return "4.2.33";
469196
469205
  }
469197
469206
  async function getInstalledVSCodeExtensionVersion(command4) {
469198
469207
  const { stdout } = await execFileNoThrow(command4, ["--list-extensions", "--show-versions"], {
@@ -522832,7 +522841,7 @@ function initLangfuse() {
522832
522841
  flushInterval: parseInt(process.env.LANGFUSE_FLUSH_INTERVAL ?? "10", 10),
522833
522842
  mask: maskFn,
522834
522843
  environment: process.env.LANGFUSE_TRACING_ENVIRONMENT ?? "development",
522835
- release: "4.2.32",
522844
+ release: "4.2.33",
522836
522845
  exportMode: process.env.LANGFUSE_EXPORT_MODE ?? "batched",
522837
522846
  timeout: parseInt(process.env.LANGFUSE_TIMEOUT ?? "5", 10)
522838
522847
  });
@@ -523391,7 +523400,7 @@ function computeFingerprint(messageText2, version11) {
523391
523400
  }
523392
523401
  function computeFingerprintFromMessages(messages) {
523393
523402
  const firstMessageText = extractFirstMessageText(messages);
523394
- return computeFingerprint(firstMessageText, "4.2.32");
523403
+ return computeFingerprint(firstMessageText, "4.2.33");
523395
523404
  }
523396
523405
  var FINGERPRINT_SALT = "59cf53e54c78";
523397
523406
  var init_fingerprint = () => {};
@@ -523941,7 +523950,7 @@ async function sideQuery(opts) {
523941
523950
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
523942
523951
  }
523943
523952
  const messageText2 = extractFirstUserMessageText(messages);
523944
- const fingerprint = computeFingerprint(messageText2, "4.2.32");
523953
+ const fingerprint = computeFingerprint(messageText2, "4.2.33");
523945
523954
  const attributionHeader = getAttributionHeader(fingerprint);
523946
523955
  const systemBlocks = [
523947
523956
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -525367,7 +525376,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
525367
525376
  const client10 = new Client({
525368
525377
  name: "claude-code",
525369
525378
  title: "CoStrict",
525370
- version: "4.2.32",
525379
+ version: "4.2.33",
525371
525380
  description: "CoStrict agentic coding tool",
525372
525381
  websiteUrl: PRODUCT_URL
525373
525382
  }, {
@@ -525738,7 +525747,7 @@ var init_client17 = __esm(() => {
525738
525747
  const client10 = new Client({
525739
525748
  name: "claude-code",
525740
525749
  title: "CoStrict",
525741
- version: "4.2.32",
525750
+ version: "4.2.33",
525742
525751
  description: "CoStrict agentic coding tool",
525743
525752
  websiteUrl: PRODUCT_URL
525744
525753
  }, {
@@ -595157,6 +595166,17 @@ async function listTasks(taskListId) {
595157
595166
  const results = await Promise.all(taskIds.map((id) => getTask(taskListId, id)));
595158
595167
  return results.filter((t2) => t2 !== null);
595159
595168
  }
595169
+ async function deleteIncompleteAgentTasks(taskListId, agentId) {
595170
+ const tasks = await listTasks(taskListId);
595171
+ const incomplete = tasks.filter((t2) => t2.owner === agentId && t2.status !== "completed");
595172
+ let deleted = 0;
595173
+ for (const task of incomplete) {
595174
+ if (await deleteTask(taskListId, task.id)) {
595175
+ deleted++;
595176
+ }
595177
+ }
595178
+ return deleted;
595179
+ }
595160
595180
  async function blockTask(taskListId, fromTaskId, toTaskId) {
595161
595181
  const [fromTask, toTask] = await Promise.all([
595162
595182
  getTask(taskListId, fromTaskId),
@@ -624622,7 +624642,7 @@ function initSentry() {
624622
624642
  }
624623
624643
  init3({
624624
624644
  dsn,
624625
- release: typeof MACRO !== "undefined" ? "4.2.32" : undefined,
624645
+ release: typeof MACRO !== "undefined" ? "4.2.33" : undefined,
624626
624646
  environment: typeof BUILD_ENV !== "undefined" ? BUILD_ENV : "production",
624627
624647
  maxBreadcrumbs: 20,
624628
624648
  sampleRate: 1,
@@ -652271,7 +652291,7 @@ async function initializeBetaTracing(resource) {
652271
652291
  });
652272
652292
  logs.setGlobalLoggerProvider(loggerProvider);
652273
652293
  setLoggerProvider(loggerProvider);
652274
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.32");
652294
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.33");
652275
652295
  setEventLogger(eventLogger);
652276
652296
  process.on("beforeExit", async () => {
652277
652297
  await loggerProvider?.forceFlush();
@@ -652311,7 +652331,7 @@ async function initializeTelemetry() {
652311
652331
  const platform10 = getPlatform();
652312
652332
  const baseAttributes = {
652313
652333
  [import_semantic_conventions29.ATTR_SERVICE_NAME]: "claude-code",
652314
- [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.32"
652334
+ [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.33"
652315
652335
  };
652316
652336
  if (platform10 === "wsl") {
652317
652337
  const wslVersion = getWslVersion();
@@ -652356,7 +652376,7 @@ async function initializeTelemetry() {
652356
652376
  } catch {}
652357
652377
  };
652358
652378
  registerCleanup(shutdownTelemetry2);
652359
- return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.32");
652379
+ return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.33");
652360
652380
  }
652361
652381
  const meterProvider = new import_sdk_metrics2.MeterProvider({
652362
652382
  resource,
@@ -652376,7 +652396,7 @@ async function initializeTelemetry() {
652376
652396
  });
652377
652397
  logs.setGlobalLoggerProvider(loggerProvider);
652378
652398
  setLoggerProvider(loggerProvider);
652379
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.32");
652399
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.33");
652380
652400
  setEventLogger(eventLogger);
652381
652401
  logForDebugging("[3P telemetry] Event logger set successfully");
652382
652402
  process.on("beforeExit", async () => {
@@ -652438,7 +652458,7 @@ Current timeout: ${timeoutMs}ms
652438
652458
  }
652439
652459
  };
652440
652460
  registerCleanup(shutdownTelemetry);
652441
- return meterProvider.getMeter("com.anthropic.claude_code", "4.2.32");
652461
+ return meterProvider.getMeter("com.anthropic.claude_code", "4.2.33");
652442
652462
  }
652443
652463
  async function flushTelemetry() {
652444
652464
  const meterProvider = getMeterProvider();
@@ -653408,7 +653428,7 @@ async function installGlobalPackage(specificVersion) {
653408
653428
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
653409
653429
  logEvent("tengu_auto_updater_lock_contention", {
653410
653430
  pid: process.pid,
653411
- currentVersion: "4.2.32"
653431
+ currentVersion: "4.2.33"
653412
653432
  });
653413
653433
  return { status: "in_progress" };
653414
653434
  }
@@ -653417,7 +653437,7 @@ async function installGlobalPackage(specificVersion) {
653417
653437
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
653418
653438
  logError2(new Error("Windows NPM detected in WSL environment"));
653419
653439
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
653420
- currentVersion: "4.2.32"
653440
+ currentVersion: "4.2.33"
653421
653441
  });
653422
653442
  return {
653423
653443
  status: "install_failed",
@@ -653963,7 +653983,7 @@ function detectLinuxGlobPatternWarnings() {
653963
653983
  }
653964
653984
  async function getDoctorDiagnostic() {
653965
653985
  const installationType = await getCurrentInstallationType();
653966
- const version11 = typeof MACRO !== "undefined" ? "4.2.32" : "unknown";
653986
+ const version11 = typeof MACRO !== "undefined" ? "4.2.33" : "unknown";
653967
653987
  const installationPath = await getInstallationPath();
653968
653988
  const invokedBinary = getInvokedBinary();
653969
653989
  const multipleInstallations = await detectMultipleInstallations();
@@ -654905,8 +654925,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
654905
654925
  const maxVersion = await getMaxVersion();
654906
654926
  if (maxVersion && gt(version11, maxVersion)) {
654907
654927
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version11} to ${maxVersion}`);
654908
- if (gte2("4.2.32", maxVersion)) {
654909
- logForDebugging(`Native installer: current version ${"4.2.32"} is already at or above maxVersion ${maxVersion}, skipping update`);
654928
+ if (gte2("4.2.33", maxVersion)) {
654929
+ logForDebugging(`Native installer: current version ${"4.2.33"} is already at or above maxVersion ${maxVersion}, skipping update`);
654910
654930
  logEvent("tengu_native_update_skipped_max_version", {
654911
654931
  latency_ms: Date.now() - startTime2,
654912
654932
  max_version: maxVersion,
@@ -654917,7 +654937,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
654917
654937
  version11 = maxVersion;
654918
654938
  }
654919
654939
  }
654920
- if (!forceReinstall && version11 === "4.2.32" && await versionIsAvailable(version11) && await isPossibleClaudeBinary(executablePath)) {
654940
+ if (!forceReinstall && version11 === "4.2.33" && await versionIsAvailable(version11) && await isPossibleClaudeBinary(executablePath)) {
654921
654941
  logForDebugging(`Found ${version11} at ${executablePath}, skipping install`);
654922
654942
  logEvent("tengu_native_update_complete", {
654923
654943
  latency_ms: Date.now() - startTime2,
@@ -683149,6 +683169,7 @@ async function* runAgent({
683149
683169
  return { ...prev, todos };
683150
683170
  });
683151
683171
  killShellTasksForAgent(agentId, toolUseContext.getAppState, rootSetAppState);
683172
+ await deleteIncompleteAgentTasks(getTaskListId(), agentId).catch(() => {});
683152
683173
  if (true) {
683153
683174
  const mcpMod = (init_MonitorMcpTask(), __toCommonJS(exports_MonitorMcpTask));
683154
683175
  mcpMod.killMonitorMcpTasksForAgent(agentId, toolUseContext.getAppState, rootSetAppState);
@@ -683213,6 +683234,7 @@ var init_runAgent = __esm(() => {
683213
683234
  init_providers();
683214
683235
  init_langfuse();
683215
683236
  init_sessionStorage();
683237
+ init_tasks();
683216
683238
  init_pluginOnlyPolicy();
683217
683239
  init_systemPromptType();
683218
683240
  init_perfettoTracing();
@@ -727541,7 +727563,7 @@ var init_TaskCreateTool = __esm(() => {
727541
727563
  description,
727542
727564
  activeForm,
727543
727565
  status: "pending",
727544
- owner: undefined,
727566
+ owner: context40?.agentId,
727545
727567
  blocks: [],
727546
727568
  blockedBy: [],
727547
727569
  metadata: metadata2
@@ -758554,7 +758576,7 @@ function seedDirFor(installLocation) {
758554
758576
  return getPluginSeedDirs().find((d7) => installLocation === d7 || installLocation.startsWith(d7 + sep31));
758555
758577
  }
758556
758578
  function getPluginGitTimeoutMs() {
758557
- const envValue = process.env.CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS;
758579
+ const envValue = getCostrictEnv("PLUGIN_GIT_TIMEOUT_MS");
758558
758580
  if (envValue) {
758559
758581
  const parsed = parseInt(envValue, 10);
758560
758582
  if (!isNaN(parsed) && parsed > 0) {
@@ -763972,7 +763994,7 @@ function getAnthropicEnvMetadata() {
763972
763994
  function getBuildAgeMinutes() {
763973
763995
  if (false)
763974
763996
  ;
763975
- const buildTime = new Date("2026-09-01T08:57:00.502Z").getTime();
763997
+ const buildTime = new Date("2026-09-03T05:24:39.995Z").getTime();
763976
763998
  if (isNaN(buildTime))
763977
763999
  return;
763978
764000
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -766893,7 +766915,109 @@ async function* executeCoStrictNonStreamingRequest(client10, requestBody, option
766893
766915
  }
766894
766916
  return e7.value;
766895
766917
  }
766896
- async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue) {
766918
+ function isPrefillContinueEnabled() {
766919
+ return process.env.COSTRICT_PREFILL_CONTINUE !== "0";
766920
+ }
766921
+ function buildCanonicalToolCallText(name3, rawArgs) {
766922
+ return `{"name": ${JSON.stringify(name3)}, "arguments": ${rawArgs}`;
766923
+ }
766924
+ function buildPrefillText(textBlocks, toolName, rawArgs) {
766925
+ const textPart = textBlocks.length > 0 ? `${textBlocks.join(`
766926
+ `)}
766927
+ ` : "";
766928
+ return textPart + buildCanonicalToolCallText(toolName, rawArgs);
766929
+ }
766930
+ function buildPrefillRequestBody(ctx, prefillText) {
766931
+ const body = { ...ctx.baseRequestBody };
766932
+ const assistantMsg = {
766933
+ role: "assistant",
766934
+ content: prefillText
766935
+ };
766936
+ if (ctx.prefixConfig?.position === "assistant") {
766937
+ Object.assign(assistantMsg, ctx.prefixConfig.params);
766938
+ } else {
766939
+ Object.assign(body, ctx.prefixConfig?.params ?? {});
766940
+ }
766941
+ body.messages = [...ctx.openaiMessages, assistantMsg];
766942
+ return body;
766943
+ }
766944
+ function buildRecoveryRequestBody(ctx, truncatedAssistantText, userInstruction) {
766945
+ return {
766946
+ ...ctx.baseRequestBody,
766947
+ messages: [
766948
+ ...ctx.openaiMessages,
766949
+ { role: "assistant", content: truncatedAssistantText },
766950
+ { role: "user", content: userInstruction }
766951
+ ]
766952
+ };
766953
+ }
766954
+ function buildRecoveryInstruction(toolName, argsString) {
766955
+ const partial4 = tryParsePartialToolInput(argsString);
766956
+ const filePath = partial4 && typeof partial4.file_path === "string" ? partial4.file_path : undefined;
766957
+ const content = partial4 && typeof partial4.content === "string" ? partial4.content : undefined;
766958
+ const size = content?.length ?? argsString.length;
766959
+ const executed = toolName === "Write" && filePath ? "nothing was executed \u2014 the file does not exist on disk yet" : "nothing was executed (no side effects occurred)";
766960
+ const lines2 = [
766961
+ `Your ${toolName} tool call${filePath ? ` to \`${filePath}\`` : ""} was truncated by the output token limit after ~${size} chars of content \u2014 ${executed}.`,
766962
+ "Do not repeat the full call in a single response.",
766963
+ toolName === "Write" ? "Instead, call Write with only the first portion of the file, then append the rest with FileEditTool in follow-up calls." : "Instead, split the remaining work into smaller calls.",
766964
+ content ? `Your truncated content ended with: ${JSON.stringify(content.slice(-120))}` : ""
766965
+ ].filter(Boolean);
766966
+ return lines2.join(" ");
766967
+ }
766968
+ function createBoundaryScanner(initialArgs) {
766969
+ const scanner = {
766970
+ depth: 1,
766971
+ inString: false,
766972
+ escaped: false,
766973
+ closed: false
766974
+ };
766975
+ feedBoundaryScanner(scanner, initialArgs);
766976
+ return scanner;
766977
+ }
766978
+ function feedBoundaryScanner(scanner, chunk) {
766979
+ if (scanner.closed)
766980
+ return 0;
766981
+ let consumed = 0;
766982
+ for (let i10 = 0;i10 < chunk.length; i10++) {
766983
+ const ch2 = chunk[i10];
766984
+ if (scanner.inString) {
766985
+ if (scanner.escaped) {
766986
+ scanner.escaped = false;
766987
+ } else if (ch2 === "\\") {
766988
+ scanner.escaped = true;
766989
+ } else if (ch2 === '"') {
766990
+ scanner.inString = false;
766991
+ }
766992
+ } else {
766993
+ if (ch2 === '"') {
766994
+ scanner.inString = true;
766995
+ } else if (ch2 === "{") {
766996
+ scanner.depth++;
766997
+ } else if (ch2 === "}") {
766998
+ scanner.depth--;
766999
+ if (scanner.depth === 0) {
767000
+ scanner.closed = true;
767001
+ return consumed;
767002
+ }
767003
+ }
767004
+ }
767005
+ consumed++;
767006
+ }
767007
+ return consumed;
767008
+ }
767009
+ function cloneScanner(scanner) {
767010
+ return { ...scanner };
767011
+ }
767012
+ function isParseableJSON(s) {
767013
+ try {
767014
+ JSON.parse(s);
767015
+ return true;
767016
+ } catch {
767017
+ return false;
767018
+ }
767019
+ }
767020
+ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue, continuation) {
766897
767021
  const contentBlocks2 = {};
766898
767022
  const toolCallStates = new Map;
766899
767023
  let partialMessage;
@@ -766907,6 +767031,23 @@ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, optio
766907
767031
  };
766908
767032
  let ttftMs = 0;
766909
767033
  const start = Date.now();
767034
+ let mode = "initial";
767035
+ let l1Rounds = 0;
767036
+ let l1Failures = 0;
767037
+ let dangling = null;
767038
+ let danglingIndex = -1;
767039
+ let textBlocksForPrefix = [];
767040
+ let scanner = null;
767041
+ let roundStartRawInput = "";
767042
+ let roundStartScanner = null;
767043
+ let roundStopReason = null;
767044
+ let roundUsage = null;
767045
+ let roundSawMessageStop = false;
767046
+ let pendingMessageDeltaEvent = null;
767047
+ let closedThisRound = false;
767048
+ let diverged = false;
767049
+ let l2IndexOffset = 0;
767050
+ const signal = continuation?.signal;
766910
767051
  const finalizeToolCallStates = () => {
766911
767052
  for (const state3 of toolCallStates.values()) {
766912
767053
  try {
@@ -766962,106 +767103,362 @@ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, optio
766962
767103
  }
766963
767104
  return outputs;
766964
767105
  };
767106
+ const addToUsage = (u6) => {
767107
+ if (!u6)
767108
+ return;
767109
+ usage2 = {
767110
+ input_tokens: usage2.input_tokens + (Number(u6.input_tokens) || 0),
767111
+ output_tokens: usage2.output_tokens + (Number(u6.output_tokens) || 0),
767112
+ cache_creation_input_tokens: usage2.cache_creation_input_tokens + (Number(u6.cache_creation_input_tokens) || 0),
767113
+ cache_read_input_tokens: usage2.cache_read_input_tokens + (Number(u6.cache_read_input_tokens) || 0)
767114
+ };
767115
+ };
767116
+ const collectTextBlocks = () => Object.keys(contentBlocks2).sort((a8, b9) => Number(a8) - Number(b9)).map((k9) => contentBlocks2[Number(k9)]).filter((b9) => b9?.type === "text" && typeof b9.text === "string" && b9.text.length > 0).map((b9) => b9.text);
767117
+ const maxBlockIndex = () => {
767118
+ const keys6 = Object.keys(contentBlocks2);
767119
+ return keys6.length === 0 ? -1 : Math.max(...keys6.map(Number));
767120
+ };
767121
+ const finalizeAndStop = function* (finalStopReason) {
767122
+ stopReason = finalStopReason;
767123
+ if (mode !== "initial") {
767124
+ yield {
767125
+ type: "stream_event",
767126
+ event: {
767127
+ type: "message_delta",
767128
+ delta: { stop_reason: finalStopReason, stop_sequence: null },
767129
+ usage: usage2
767130
+ }
767131
+ };
767132
+ } else if (pendingMessageDeltaEvent) {
767133
+ yield {
767134
+ type: "stream_event",
767135
+ event: pendingMessageDeltaEvent
767136
+ };
767137
+ }
767138
+ if (partialMessage) {
767139
+ finalizeToolCallStates();
767140
+ for (const output of assembleFinalAssistantOutputs2()) {
767141
+ yield output;
767142
+ }
767143
+ partialMessage = null;
767144
+ toolCallStates.clear();
767145
+ }
767146
+ if (roundSawMessageStop) {
767147
+ yield { type: "stream_event", event: { type: "message_stop" } };
767148
+ }
767149
+ if (roundSawMessageStop && usage2.input_tokens + usage2.output_tokens > 0) {
767150
+ try {
767151
+ const costUSD = calculateUSDCost(costrictModel, usage2);
767152
+ addToTotalSessionCost(costUSD, usage2, options.model);
767153
+ } catch (err3) {
767154
+ logForDebugging(`[costrict] cost accounting skipped: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767155
+ }
767156
+ }
767157
+ };
767158
+ const createContinuationStream = async (body) => {
767159
+ if (!continuation)
767160
+ throw new Error("missing continuation context");
767161
+ const stream7 = await continuation.client.chat.completions.create(body, { signal });
767162
+ return adaptOpenAIStreamToAnthropic(stream7, costrictModel);
767163
+ };
767164
+ const enterL2 = async () => {
767165
+ if (!continuation || !dangling)
767166
+ return null;
767167
+ logForDebugging(`[prefill-continue] tier=L2 entering recovery round (tool=${dangling.name}, chars=${dangling.rawInput.length})`, { level: "info" });
767168
+ mode = "l2";
767169
+ l2IndexOffset = maxBlockIndex() + 1;
767170
+ const truncatedText = buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput);
767171
+ const body = buildRecoveryRequestBody(continuation, truncatedText, buildRecoveryInstruction(dangling.name, dangling.rawInput));
767172
+ try {
767173
+ return await createContinuationStream(body);
767174
+ } catch (err3) {
767175
+ logForDebugging(`[prefill-continue] tier=L2 request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767176
+ return null;
767177
+ }
767178
+ };
766965
767179
  try {
766966
- for await (const event of adaptedStream) {
766967
- switch (event.type) {
766968
- case "message_start": {
766969
- partialMessage = event.message;
766970
- hasProducedOutput = true;
766971
- ttftMs = Date.now() - start;
766972
- if (event.message?.usage) {
766973
- usage2 = { ...usage2, ...event.message.usage };
767180
+ let activeStream = adaptedStream;
767181
+ rounds:
767182
+ while (true) {
767183
+ roundStopReason = null;
767184
+ roundUsage = null;
767185
+ roundSawMessageStop = false;
767186
+ pendingMessageDeltaEvent = null;
767187
+ closedThisRound = false;
767188
+ diverged = false;
767189
+ if (mode === "prefill" && dangling && scanner) {
767190
+ roundStartRawInput = dangling.rawInput;
767191
+ roundStartScanner = cloneScanner(scanner);
767192
+ }
767193
+ let roundError;
767194
+ try {
767195
+ for await (const rawEvent of activeStream) {
767196
+ const event = rawEvent;
767197
+ if (mode === "prefill") {
767198
+ if (event.type === "message_start" || event.type === "content_block_start" || event.type === "content_block_stop") {
767199
+ continue;
767200
+ }
767201
+ if (event.type === "message_delta") {
767202
+ if (event.usage)
767203
+ roundUsage = {
767204
+ ...roundUsage ?? {},
767205
+ ...event.usage
767206
+ };
767207
+ if (event.delta?.stop_reason != null) {
767208
+ roundStopReason = event.delta.stop_reason;
767209
+ }
767210
+ continue;
767211
+ }
767212
+ if (event.type === "message_stop") {
767213
+ roundSawMessageStop = true;
767214
+ continue;
767215
+ }
767216
+ if (event.type === "content_block_delta") {
767217
+ const delta = event.delta;
767218
+ if (delta?.type === "thinking_delta" || delta?.type === "signature_delta") {
767219
+ continue;
767220
+ }
767221
+ if (delta?.type !== "text_delta") {
767222
+ diverged = true;
767223
+ continue;
767224
+ }
767225
+ if (!scanner || scanner.closed)
767226
+ continue;
767227
+ const text2 = String(delta.text ?? "");
767228
+ if (!text2)
767229
+ continue;
767230
+ const consumed = feedBoundaryScanner(scanner, text2);
767231
+ if (scanner.closed)
767232
+ closedThisRound = true;
767233
+ if (consumed === 0)
767234
+ continue;
767235
+ event.index = danglingIndex;
767236
+ event.delta = {
767237
+ type: "input_json_delta",
767238
+ partial_json: text2.slice(0, consumed)
767239
+ };
767240
+ }
767241
+ } else if (mode === "l2") {
767242
+ if (event.type === "message_start")
767243
+ continue;
767244
+ if (event.type === "message_delta") {
767245
+ if (event.usage)
767246
+ roundUsage = {
767247
+ ...roundUsage ?? {},
767248
+ ...event.usage
767249
+ };
767250
+ if (event.delta?.stop_reason != null) {
767251
+ roundStopReason = event.delta.stop_reason;
767252
+ }
767253
+ continue;
767254
+ }
767255
+ if (event.type === "message_stop") {
767256
+ roundSawMessageStop = true;
767257
+ continue;
767258
+ }
767259
+ if (typeof event.index === "number") {
767260
+ event.index += l2IndexOffset;
767261
+ }
767262
+ }
767263
+ switch (event.type) {
767264
+ case "message_start": {
767265
+ partialMessage = event.message;
767266
+ hasProducedOutput = true;
767267
+ ttftMs = Date.now() - start;
767268
+ if (event.message?.usage) {
767269
+ usage2 = { ...usage2, ...event.message.usage };
767270
+ }
767271
+ break;
767272
+ }
767273
+ case "content_block_start": {
767274
+ const idx = event.index;
767275
+ const cb = event.content_block;
767276
+ if (cb.type === "tool_use") {
767277
+ contentBlocks2[idx] = { ...cb, input: "" };
767278
+ toolCallStates.set(idx, {
767279
+ index: idx,
767280
+ id: String(cb.id ?? ""),
767281
+ name: typeof cb.name === "string" ? cb.name : "",
767282
+ rawInput: ""
767283
+ });
767284
+ } else if (cb.type === "text") {
767285
+ contentBlocks2[idx] = { ...cb, text: "" };
767286
+ } else if (cb.type === "thinking") {
767287
+ contentBlocks2[idx] = { ...cb, thinking: "", signature: "" };
767288
+ } else {
767289
+ contentBlocks2[idx] = { ...cb };
767290
+ }
767291
+ break;
767292
+ }
767293
+ case "content_block_delta": {
767294
+ const idx = event.index;
767295
+ const delta = event.delta;
767296
+ const block2 = contentBlocks2[idx];
767297
+ if (!block2)
767298
+ break;
767299
+ if (delta.type === "text_delta") {
767300
+ block2.text = (block2.text || "") + delta.text;
767301
+ } else if (delta.type === "input_json_delta") {
767302
+ const fragment = String(delta.partial_json ?? "");
767303
+ block2.input = (block2.input || "") + fragment;
767304
+ const state3 = toolCallStates.get(idx);
767305
+ if (state3) {
767306
+ state3.rawInput += fragment;
767307
+ const partialInput = tryParsePartialToolInput(state3.rawInput);
767308
+ if (partialInput) {
767309
+ state3.partialInput = partialInput;
767310
+ delta.parsed_tool_input = partialInput;
767311
+ }
767312
+ }
767313
+ } else if (delta.type === "thinking_delta") {
767314
+ block2.thinking = (block2.thinking || "") + delta.thinking;
767315
+ } else if (delta.type === "signature_delta") {
767316
+ block2.signature = delta.signature;
767317
+ }
767318
+ break;
767319
+ }
767320
+ case "content_block_stop": {
767321
+ break;
767322
+ }
767323
+ case "message_delta": {
767324
+ const deltaUsage = event.usage;
767325
+ if (deltaUsage)
767326
+ usage2 = { ...usage2, ...deltaUsage };
767327
+ if (event.delta?.stop_reason != null) {
767328
+ stopReason = event.delta.stop_reason;
767329
+ }
767330
+ break;
767331
+ }
767332
+ case "message_stop": {
767333
+ break;
767334
+ }
767335
+ }
767336
+ if (event.type === "message_delta") {
767337
+ pendingMessageDeltaEvent = event;
767338
+ continue;
767339
+ }
767340
+ if (event.type === "message_stop") {
767341
+ roundSawMessageStop = true;
767342
+ continue;
767343
+ }
767344
+ yield {
767345
+ type: "stream_event",
767346
+ event,
767347
+ ...event.type === "message_start" && mode === "initial" ? { ttftMs } : undefined
767348
+ };
766974
767349
  }
766975
- break;
766976
- }
766977
- case "content_block_start": {
766978
- const idx = event.index;
766979
- const cb = event.content_block;
766980
- if (cb.type === "tool_use") {
766981
- contentBlocks2[idx] = { ...cb, input: "" };
766982
- toolCallStates.set(idx, {
766983
- index: idx,
766984
- id: String(cb.id ?? ""),
766985
- name: typeof cb.name === "string" ? cb.name : "",
766986
- rawInput: ""
766987
- });
766988
- } else if (cb.type === "text") {
766989
- contentBlocks2[idx] = { ...cb, text: "" };
766990
- } else if (cb.type === "thinking") {
766991
- contentBlocks2[idx] = { ...cb, thinking: "", signature: "" };
766992
- } else {
766993
- contentBlocks2[idx] = { ...cb };
767350
+ } catch (error100) {
767351
+ const isAbort = signal?.aborted === true || error100?.constructor?.name === "APIUserAbortError";
767352
+ if (isAbort || mode === "initial") {
767353
+ throw error100;
766994
767354
  }
766995
- break;
766996
- }
766997
- case "content_block_delta": {
766998
- const idx = event.index;
766999
- const delta = event.delta;
767000
- const block2 = contentBlocks2[idx];
767001
- if (!block2)
767002
- break;
767003
- if (delta.type === "text_delta") {
767004
- block2.text = (block2.text || "") + delta.text;
767005
- } else if (delta.type === "input_json_delta") {
767006
- const fragment = String(delta.partial_json ?? "");
767007
- block2.input = (block2.input || "") + fragment;
767008
- const state3 = toolCallStates.get(idx);
767009
- if (state3) {
767010
- state3.rawInput += fragment;
767011
- const partialInput = tryParsePartialToolInput(state3.rawInput);
767012
- if (partialInput) {
767013
- state3.partialInput = partialInput;
767014
- delta.parsed_tool_input = partialInput;
767355
+ roundError = error100;
767356
+ }
767357
+ if (mode !== "initial") {
767358
+ addToUsage(roundUsage);
767359
+ }
767360
+ if (mode === "initial") {
767361
+ const danglings = [...toolCallStates.values()].filter((s) => s.rawInput.length > 0 && !isParseableJSON(s.rawInput));
767362
+ const shouldContinue = continuation?.enabled === true && stopReason === "max_tokens" && partialMessage !== null && danglings.length === 1 && danglings[0].rawInput.length < MAX_STITCHED_CHARS && signal?.aborted !== true;
767363
+ if (shouldContinue && continuation && danglings[0]) {
767364
+ dangling = danglings[0];
767365
+ danglingIndex = dangling.index;
767366
+ textBlocksForPrefix = collectTextBlocks();
767367
+ if (continuation.prefixConfig) {
767368
+ mode = "prefill";
767369
+ scanner = createBoundaryScanner(dangling.rawInput);
767370
+ const body = buildPrefillRequestBody(continuation, buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput));
767371
+ l1Rounds++;
767372
+ try {
767373
+ activeStream = await createContinuationStream(body);
767374
+ continue rounds;
767375
+ } catch (err3) {
767376
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767015
767377
  }
767016
767378
  }
767017
- } else if (delta.type === "thinking_delta") {
767018
- block2.thinking = (block2.thinking || "") + delta.thinking;
767019
- } else if (delta.type === "signature_delta") {
767020
- block2.signature = delta.signature;
767379
+ const l2Stream = await enterL2();
767380
+ if (l2Stream) {
767381
+ activeStream = l2Stream;
767382
+ continue rounds;
767383
+ }
767384
+ yield* finalizeAndStop("max_tokens");
767385
+ return hasProducedOutput;
767021
767386
  }
767022
- break;
767387
+ yield* finalizeAndStop(stopReason);
767388
+ return hasProducedOutput;
767023
767389
  }
767024
- case "content_block_stop": {
767025
- break;
767026
- }
767027
- case "message_delta": {
767028
- const deltaUsage = event.usage;
767029
- if (deltaUsage)
767030
- usage2 = { ...usage2, ...deltaUsage };
767031
- if (event.delta?.stop_reason != null) {
767032
- stopReason = event.delta.stop_reason;
767390
+ if (mode === "prefill" && dangling && scanner) {
767391
+ if (closedThisRound) {
767392
+ let valid = false;
767393
+ try {
767394
+ const parsed = JSON.parse(dangling.rawInput);
767395
+ valid = isPlainRecord(parsed) && !(dangling.name === "Write" && (typeof parsed.file_path !== "string" || !parsed.file_path || typeof parsed.content !== "string"));
767396
+ } catch {
767397
+ valid = false;
767398
+ }
767399
+ if (valid) {
767400
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} closed and valid, done`, { level: "info" });
767401
+ yield* finalizeAndStop("tool_use");
767402
+ return hasProducedOutput;
767403
+ }
767404
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} closed but invalid JSON`, { level: "warn" });
767405
+ dangling.rawInput = roundStartRawInput;
767406
+ const danglingBlock = contentBlocks2[danglingIndex];
767407
+ if (danglingBlock)
767408
+ danglingBlock.input = roundStartRawInput;
767409
+ Object.assign(scanner, roundStartScanner);
767410
+ l1Failures++;
767411
+ } else if (roundStopReason === "max_tokens" && roundError === undefined && !diverged) {
767412
+ if (l1Rounds < MAX_PREFILL_ROUNDS && dangling.rawInput.length < MAX_STITCHED_CHARS && signal?.aborted !== true) {
767413
+ const body = buildPrefillRequestBody(continuation, buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput));
767414
+ l1Rounds++;
767415
+ try {
767416
+ activeStream = await createContinuationStream(body);
767417
+ continue rounds;
767418
+ } catch (err3) {
767419
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767420
+ }
767421
+ l1Failures++;
767422
+ } else {
767423
+ logForDebugging(`[prefill-continue] tier=L1 rounds/chars budget exhausted (round=${l1Rounds}, chars=${dangling.rawInput.length})`, { level: "warn" });
767424
+ l1Failures = 2;
767425
+ }
767426
+ } else {
767427
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} divergence (finish=${roundStopReason ?? "none"}, error=${roundError !== undefined}, diverged=${diverged})`, { level: "warn" });
767428
+ dangling.rawInput = roundStartRawInput;
767429
+ const danglingBlock = contentBlocks2[danglingIndex];
767430
+ if (danglingBlock)
767431
+ danglingBlock.input = roundStartRawInput;
767432
+ Object.assign(scanner, roundStartScanner);
767433
+ l1Failures++;
767434
+ }
767435
+ if (l1Failures <= 1 && l1Rounds < MAX_PREFILL_ROUNDS && signal?.aborted !== true && continuation) {
767436
+ const body = buildPrefillRequestBody(continuation, buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput));
767437
+ l1Rounds++;
767438
+ try {
767439
+ activeStream = await createContinuationStream(body);
767440
+ continue rounds;
767441
+ } catch (err3) {
767442
+ logForDebugging(`[prefill-continue] tier=L1 retry request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767443
+ }
767033
767444
  }
767034
- break;
767445
+ const l2Stream = await enterL2();
767446
+ if (l2Stream) {
767447
+ activeStream = l2Stream;
767448
+ continue rounds;
767449
+ }
767450
+ yield* finalizeAndStop("max_tokens");
767451
+ return hasProducedOutput;
767035
767452
  }
767036
- case "message_stop": {
767037
- if (partialMessage) {
767038
- finalizeToolCallStates();
767039
- for (const output of assembleFinalAssistantOutputs2()) {
767040
- yield output;
767041
- }
767042
- partialMessage = null;
767043
- toolCallStates.clear();
767453
+ if (mode === "l2") {
767454
+ const l2Ok = roundError === undefined && roundSawMessageStop && roundStopReason != null && roundStopReason !== "max_tokens";
767455
+ if (!l2Ok) {
767456
+ logForDebugging(`[prefill-continue] tier=L2 truncated/failed (finish=${roundStopReason ?? "none"}, error=${roundError !== undefined}), falling back to legacy recovery`, { level: "warn" });
767044
767457
  }
767045
- break;
767458
+ yield* finalizeAndStop(l2Ok ? roundStopReason : "max_tokens");
767459
+ return hasProducedOutput;
767046
767460
  }
767047
767461
  }
767048
- if (event.type === "message_stop" && usage2.input_tokens + usage2.output_tokens > 0) {
767049
- const costUSD = calculateUSDCost(costrictModel, usage2);
767050
- addToTotalSessionCost(costUSD, usage2, options.model);
767051
- }
767052
- yield {
767053
- type: "stream_event",
767054
- event,
767055
- ...event.type === "message_start" ? { ttftMs } : undefined
767056
- };
767057
- }
767058
- if (partialMessage) {
767059
- finalizeToolCallStates();
767060
- for (const output of assembleFinalAssistantOutputs2()) {
767061
- yield output;
767062
- }
767063
- }
767064
- return hasProducedOutput;
767065
767462
  } catch (error100) {
767066
767463
  if (error100 instanceof Error) {
767067
767464
  error100.__streamProducedOutput = hasProducedOutput;
@@ -767165,6 +767562,22 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767165
767562
  };
767166
767563
  let streamAttempts = 0;
767167
767564
  let lastStreamError;
767565
+ const prefixCfg = modelInfo?.prefixCompletion;
767566
+ const prefixParams = prefixCfg && isPlainRecord(prefixCfg) && isPlainRecord(prefixCfg.params) ? prefixCfg.params : undefined;
767567
+ const continuation = {
767568
+ enabled: isPrefillContinueEnabled(),
767569
+ ...prefixCfg?.enable === true && prefixParams !== undefined && Object.keys(prefixParams).length > 0 && {
767570
+ prefixConfig: {
767571
+ enable: true,
767572
+ position: prefixCfg.position === "assistant" ? "assistant" : "top",
767573
+ params: prefixParams
767574
+ }
767575
+ },
767576
+ openaiMessages,
767577
+ baseRequestBody: requestBody,
767578
+ client: client10,
767579
+ signal
767580
+ };
767168
767581
  while (streamAttempts < MAX_STREAM_RECONNECT_ATTEMPTS2) {
767169
767582
  streamAttempts++;
767170
767583
  const retryGenerator = withRetry(() => Promise.resolve(client10), async (c10, _attempt, _context) => {
@@ -767191,7 +767604,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767191
767604
  stream7 = e7.value;
767192
767605
  const adaptedStream = adaptOpenAIStreamToAnthropic(stream7, costrictModel);
767193
767606
  try {
767194
- const producedOutput = yield* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue);
767607
+ const producedOutput = yield* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue, continuation);
767195
767608
  if (!producedOutput && streamAttempts < MAX_STREAM_RECONNECT_ATTEMPTS2) {
767196
767609
  yield createSystemAPIErrorMessage(new APIError(503, {}, "Stream completed without producing output", new Headers), 0, streamAttempts, MAX_STREAM_RECONNECT_ATTEMPTS2);
767197
767610
  logForDebugging(`[CoStrict] Stream completed without producing output (attempt ${streamAttempts}/${MAX_STREAM_RECONNECT_ATTEMPTS2}), reconnecting`, { level: "warn" });
@@ -767213,7 +767626,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767213
767626
  const nonStreamingBody = toNonStreamingOpenAIRequestBody(requestBody);
767214
767627
  const completion = yield* executeCoStrictNonStreamingRequest(client10, nonStreamingBody, options, signal);
767215
767628
  const fallbackStream = adaptOpenAICompletionToAnthropicStream(completion);
767216
- yield* consumeCoStrictStream(fallbackStream, costrictModel, tools, options, maxTokensValue);
767629
+ yield* consumeCoStrictStream(fallbackStream, costrictModel, tools, options, maxTokensValue, continuation);
767217
767630
  return;
767218
767631
  } catch (fallbackError) {
767219
767632
  logForDebugging(`[CoStrict] Non-streaming fallback also failed: ${fallbackError instanceof Error ? fallbackError.message : String(fallbackError)}`, { level: "error" });
@@ -767237,7 +767650,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767237
767650
  });
767238
767651
  }
767239
767652
  }
767240
- var import_partial_json, MAX_STREAM_RECONNECT_ATTEMPTS2 = 3;
767653
+ var import_partial_json, MAX_STREAM_RECONNECT_ATTEMPTS2 = 3, MAX_PREFILL_ROUNDS = 4, MAX_STITCHED_CHARS = 2000000;
767241
767654
  var init_provider3 = __esm(() => {
767242
767655
  init_openai();
767243
767656
  init_sdk();
@@ -770081,7 +770494,7 @@ var init_shouldUseSandbox = __esm(() => {
770081
770494
 
770082
770495
  // src/utils/askUserQuestionAutoSelect.ts
770083
770496
  function isAskUserQuestionAutoSelectEnabled(settings) {
770084
- return settings.askUserQuestionAutoSelectEnabled ?? true;
770497
+ return settings.askUserQuestionAutoSelectEnabled ?? false;
770085
770498
  }
770086
770499
  function getAskUserQuestionAutoSelectTimeoutSeconds(settings) {
770087
770500
  return settings.askUserQuestionTimeoutSeconds ?? DEFAULT_ASK_USER_QUESTION_AUTO_SELECT_TIMEOUT_SECONDS;
@@ -778071,7 +778484,7 @@ function Feedback({
778071
778484
  platform: env4.platform,
778072
778485
  gitRepo: envInfo.isGit,
778073
778486
  terminal: env4.terminal,
778074
- version: "4.2.32",
778487
+ version: "4.2.33",
778075
778488
  transcript: normalizeMessagesForAPI(messages),
778076
778489
  errors: sanitizedErrors,
778077
778490
  lastApiRequest: getLastAPIRequest(),
@@ -778254,7 +778667,7 @@ function Feedback({
778254
778667
  ", ",
778255
778668
  env4.terminal,
778256
778669
  ", v",
778257
- "4.2.32"
778670
+ "4.2.33"
778258
778671
  ]
778259
778672
  })
778260
778673
  ]
@@ -778351,7 +778764,7 @@ ${sanitizedDescription}
778351
778764
  ` + `**Environment Info**
778352
778765
  ` + `- Platform: ${env4.platform}
778353
778766
  ` + `- Terminal: ${env4.terminal}
778354
- ` + `- Version: ${"4.2.32"}
778767
+ ` + `- Version: ${"4.2.33"}
778355
778768
  ` + `- Feedback ID: ${feedbackId}
778356
778769
  ` + `
778357
778770
  **Errors**
@@ -780590,7 +781003,7 @@ function buildPrimarySection() {
780590
781003
  children: t("settings.status.renameHint")
780591
781004
  });
780592
781005
  return [
780593
- { label: t("settings.status.version"), value: "4.2.32" },
781006
+ { label: t("settings.status.version"), value: "4.2.33" },
780594
781007
  { label: t("settings.status.sessionName"), value: nameValue },
780595
781008
  { label: t("settings.status.sessionId"), value: sessionId },
780596
781009
  { label: t("settings.status.cwd"), value: getCwd() },
@@ -782306,7 +782719,7 @@ function Config({
782306
782719
  {
782307
782720
  id: "askUserQuestionAutoSelectEnabled",
782308
782721
  label: t("settings.askUserQuestion.autoSelect"),
782309
- value: settingsData?.askUserQuestionAutoSelectEnabled ?? true,
782722
+ value: settingsData?.askUserQuestionAutoSelectEnabled ?? false,
782310
782723
  type: "boolean",
782311
782724
  onChange(askUserQuestionAutoSelectEnabled) {
782312
782725
  const result = updateSettingsForSource("userSettings", {
@@ -782920,8 +783333,8 @@ function Config({
782920
783333
  });
782921
783334
  formattedChanges.push(remoteLabel);
782922
783335
  }
782923
- const askUserQuestionAutoSelectEnabled = settingsData?.askUserQuestionAutoSelectEnabled ?? true;
782924
- if (askUserQuestionAutoSelectEnabled !== (initialSettingsData.current?.askUserQuestionAutoSelectEnabled ?? true)) {
783336
+ const askUserQuestionAutoSelectEnabled = settingsData?.askUserQuestionAutoSelectEnabled ?? false;
783337
+ if (askUserQuestionAutoSelectEnabled !== (initialSettingsData.current?.askUserQuestionAutoSelectEnabled ?? false)) {
782925
783338
  const action2 = askUserQuestionAutoSelectEnabled ? t("settings.config.saved.enabled") : t("settings.config.saved.disabled");
782926
783339
  formattedChanges.push(t("settings.config.saved.askUserQuestionAutoSelect", { action: action2 }));
782927
783340
  }
@@ -783468,7 +783881,7 @@ function Config({
783468
783881
  }
783469
783882
  })
783470
783883
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime192.jsx(ChannelDowngradeDialog, {
783471
- currentVersion: "4.2.32",
783884
+ currentVersion: "4.2.33",
783472
783885
  onChoice: (choice) => {
783473
783886
  setShowSubmenu(null);
783474
783887
  setTabsHidden(false);
@@ -783480,7 +783893,7 @@ function Config({
783480
783893
  autoUpdatesChannel: "stable"
783481
783894
  };
783482
783895
  if (choice === "stay") {
783483
- newSettings.minimumVersion = "4.2.32";
783896
+ newSettings.minimumVersion = "4.2.33";
783484
783897
  }
783485
783898
  updateSettingsForSource("userSettings", newSettings);
783486
783899
  setSettingsData((prev) => ({
@@ -788949,7 +789362,7 @@ function HelpV2({ onClose, commands: commands11 }) {
788949
789362
  color: "professionalBlue",
788950
789363
  children: [
788951
789364
  /* @__PURE__ */ jsx_runtime219.jsx(Tabs, {
788952
- title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.32"}`,
789365
+ title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.33"}`,
788953
789366
  color: "professionalBlue",
788954
789367
  defaultTab: "general",
788955
789368
  children: tabs
@@ -811664,7 +812077,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
811664
812077
  return [];
811665
812078
  }
811666
812079
  }
811667
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.32") {
812080
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.33") {
811668
812081
  if (process.env.USER_TYPE === "sf") {
811669
812082
  const changelog = "";
811670
812083
  if (changelog) {
@@ -811691,7 +812104,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.32")
811691
812104
  releaseNotes
811692
812105
  };
811693
812106
  }
811694
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.32") {
812107
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.33") {
811695
812108
  if (process.env.USER_TYPE === "sf") {
811696
812109
  const changelog = "";
811697
812110
  if (changelog) {
@@ -814204,7 +814617,7 @@ function isNotLoggedIn() {
814204
814617
  return true;
814205
814618
  }
814206
814619
  function getLogoDisplayData() {
814207
- const version11 = process.env.DEMO_VERSION ?? "4.2.32";
814620
+ const version11 = process.env.DEMO_VERSION ?? "4.2.33";
814208
814621
  const serverUrl = getDirectConnectServerUrl();
814209
814622
  const displayPath2 = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
814210
814623
  const cwd2 = serverUrl ? `${displayPath2} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath2;
@@ -814782,7 +815195,7 @@ var init_MatrixMessageLine = __esm(() => {
814782
815195
  // src/components/matrix-tactical/MatrixWelcome.tsx
814783
815196
  import { basename as basename48 } from "path";
814784
815197
  function MatrixWelcome({
814785
- version: version11 = "4.2.32",
815198
+ version: version11 = "4.2.33",
814786
815199
  projectName,
814787
815200
  cwd: cwd2,
814788
815201
  modelDisplayName,
@@ -815417,13 +815830,13 @@ function LogoV2() {
815417
815830
  const { hasReleaseNotes } = checkForReleaseNotesSync(config13.lastReleaseNotesSeen);
815418
815831
  import_react167.useEffect(() => {
815419
815832
  const currentConfig = getGlobalConfig();
815420
- if (currentConfig.lastReleaseNotesSeen === "4.2.32") {
815833
+ if (currentConfig.lastReleaseNotesSeen === "4.2.33") {
815421
815834
  return;
815422
815835
  }
815423
815836
  saveGlobalConfig((current2) => {
815424
- if (current2.lastReleaseNotesSeen === "4.2.32")
815837
+ if (current2.lastReleaseNotesSeen === "4.2.33")
815425
815838
  return current2;
815426
- return { ...current2, lastReleaseNotesSeen: "4.2.32" };
815839
+ return { ...current2, lastReleaseNotesSeen: "4.2.33" };
815427
815840
  });
815428
815841
  if (showOnboarding) {
815429
815842
  incrementProjectOnboardingSeenCount();
@@ -838988,7 +839401,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
838988
839401
  smapsRollup,
838989
839402
  platform: process.platform,
838990
839403
  nodeVersion: process.version,
838991
- ccVersion: "4.2.32"
839404
+ ccVersion: "4.2.33"
838992
839405
  };
838993
839406
  }
838994
839407
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -839104,7 +839517,7 @@ var init_mock_limits = __esm(() => {
839104
839517
  var call56 = async () => {
839105
839518
  return {
839106
839519
  type: "text",
839107
- value: `${"4.2.32"} (built ${"2026-09-01T08:57:00.502Z"})`
839520
+ value: `${"4.2.33"} (built ${"2026-09-03T05:24:39.995Z"})`
839108
839521
  };
839109
839522
  }, version11, version_default;
839110
839523
  var init_version2 = __esm(() => {
@@ -858983,7 +859396,7 @@ function generateHtmlReport(data, insights) {
858983
859396
  </html>`;
858984
859397
  }
858985
859398
  function buildExportData(data, insights, facets, remoteStats) {
858986
- const version12 = typeof MACRO !== "undefined" ? "4.2.32" : "unknown";
859399
+ const version12 = typeof MACRO !== "undefined" ? "4.2.33" : "unknown";
858987
859400
  const remote_hosts_collected = remoteStats?.hosts.filter((h8) => h8.sessionCount > 0).map((h8) => h8.name);
858988
859401
  const facets_summary = {
858989
859402
  total: facets.size,
@@ -863475,7 +863888,7 @@ var init_sessionStorage = __esm(() => {
863475
863888
  init_settings2();
863476
863889
  init_slowOperations();
863477
863890
  init_uuid();
863478
- VERSION11 = typeof MACRO !== "undefined" ? "4.2.32" : "unknown";
863891
+ VERSION11 = typeof MACRO !== "undefined" ? "4.2.33" : "unknown";
863479
863892
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
863480
863893
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
863481
863894
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -864816,7 +865229,7 @@ var init_filesystem = __esm(() => {
864816
865229
  });
864817
865230
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
864818
865231
  const nonce = randomBytes24(16).toString("hex");
864819
- return join219(getCostrictTempDir(), "bundled-skills", "4.2.32", nonce);
865232
+ return join219(getCostrictTempDir(), "bundled-skills", "4.2.33", nonce);
864820
865233
  });
864821
865234
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
864822
865235
  });
@@ -876314,7 +876727,7 @@ function buildSystemInitMessage(inputs) {
876314
876727
  slash_commands: inputs.commands.filter((c10) => c10.userInvocable !== false).map((c10) => c10.name),
876315
876728
  apiKeySource: getAnthropicApiKeyWithSource().source,
876316
876729
  betas: getSdkBetas(),
876317
- claude_code_version: "4.2.32",
876730
+ claude_code_version: "4.2.33",
876318
876731
  output_style: outputStyle2,
876319
876732
  agents: inputs.agents.map((agent) => agent.agentType),
876320
876733
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -879858,7 +880271,7 @@ function appendToLog(path63, message2) {
879858
880271
  cwd: getFsImplementation().cwd(),
879859
880272
  userType: process.env.USER_TYPE,
879860
880273
  sessionId: getSessionId(),
879861
- version: "4.2.32"
880274
+ version: "4.2.33"
879862
880275
  };
879863
880276
  getLogWriter(path63).write(messageWithTimestamp);
879864
880277
  }
@@ -900919,7 +901332,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
900919
901332
  project_dir: getOriginalCwd(),
900920
901333
  added_dirs: addedDirs
900921
901334
  },
900922
- version: "4.2.32",
901335
+ version: "4.2.33",
900923
901336
  output_style: {
900924
901337
  name: outputStyleName
900925
901338
  },
@@ -919535,7 +919948,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
919535
919948
  } catch {}
919536
919949
  const data = {
919537
919950
  trigger,
919538
- version: "4.2.32",
919951
+ version: "4.2.33",
919539
919952
  platform: process.platform,
919540
919953
  transcript,
919541
919954
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -920790,7 +921203,7 @@ function getReleaseType(current2, latest) {
920790
921203
  return "patch";
920791
921204
  }
920792
921205
  async function checkNewAutoUpdate(callbacks) {
920793
- const currentVersion = "4.2.32";
921206
+ const currentVersion = "4.2.33";
920794
921207
  logForDebugging(`[newAutoUpdater] checking, current: ${currentVersion}`);
920795
921208
  if (isNewAutoUpdaterDisabled()) {
920796
921209
  return { action: "skip", currentVersion, latestVersion: null };
@@ -933047,7 +933460,7 @@ function WelcomeV2() {
933047
933460
  dimColor: true,
933048
933461
  children: [
933049
933462
  "v",
933050
- "4.2.32",
933463
+ "4.2.33",
933051
933464
  " "
933052
933465
  ]
933053
933466
  })
@@ -933113,7 +933526,7 @@ function WelcomeV2() {
933113
933526
  dimColor: true,
933114
933527
  children: [
933115
933528
  "v",
933116
- "4.2.32",
933529
+ "4.2.33",
933117
933530
  " "
933118
933531
  ]
933119
933532
  })
@@ -933215,7 +933628,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
933215
933628
  dimColor: true,
933216
933629
  children: [
933217
933630
  "v",
933218
- "4.2.32",
933631
+ "4.2.33",
933219
933632
  " "
933220
933633
  ]
933221
933634
  })
@@ -933281,7 +933694,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
933281
933694
  dimColor: true,
933282
933695
  children: [
933283
933696
  "v",
933284
- "4.2.32",
933697
+ "4.2.33",
933285
933698
  " "
933286
933699
  ]
933287
933700
  })
@@ -934221,7 +934634,7 @@ function completeOnboarding() {
934221
934634
  saveGlobalConfig((current2) => ({
934222
934635
  ...current2,
934223
934636
  hasCompletedOnboarding: true,
934224
- lastOnboardingVersion: "4.2.32"
934637
+ lastOnboardingVersion: "4.2.33"
934225
934638
  }));
934226
934639
  }
934227
934640
  function showDialog(root9, renderer) {
@@ -950648,7 +951061,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
950648
951061
  setCwd(cwd3);
950649
951062
  const server2 = new Server({
950650
951063
  name: "claude/tengu",
950651
- version: "4.2.32"
951064
+ version: "4.2.33"
950652
951065
  }, {
950653
951066
  capabilities: {
950654
951067
  tools: {}
@@ -952933,7 +953346,7 @@ function createHealthRoutes(sessionManager) {
952933
953346
  const uptime2 = process.uptime() * 1000;
952934
953347
  return c10.json({
952935
953348
  status: "ok",
952936
- version: "4.2.32",
953349
+ version: "4.2.33",
952937
953350
  uptime_ms: Math.round(uptime2),
952938
953351
  active_sessions: sessionManager.getActiveCount()
952939
953352
  });
@@ -953205,7 +953618,7 @@ function getMacroDefines() {
953205
953618
  commit = execSync3("git rev-parse --short HEAD", { encoding: "utf-8", cwd: __dirname }).trim();
953206
953619
  } catch {}
953207
953620
  return {
953208
- "MACRO.VERSION": JSON.stringify("4.2.32"),
953621
+ "MACRO.VERSION": JSON.stringify("4.2.33"),
953209
953622
  "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
953210
953623
  "MACRO.COMMIT": JSON.stringify(commit),
953211
953624
  "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),
@@ -960274,7 +960687,7 @@ __export(exports_update, {
960274
960687
  });
960275
960688
  async function update() {
960276
960689
  logEvent("tengu_update_check", {});
960277
- writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.32"}
960690
+ writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.33"}
960278
960691
  `);
960279
960692
  const channel5 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
960280
960693
  writeToStdout(`${t("cli.update.checkingUpdates", { channel: channel5 }, "Checking for updates to {channel} version...")}
@@ -960349,8 +960762,8 @@ async function update() {
960349
960762
  writeToStdout(`${t("cli.update.managedByHomebrew", "CoStrict is managed by Homebrew.")}
960350
960763
  `);
960351
960764
  const latest = await getLatestVersion(channel5);
960352
- if (latest && !gte2("4.2.32", latest)) {
960353
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.32", latest }, "Update available: {current} \u2192 {latest}")}
960765
+ if (latest && !gte2("4.2.33", latest)) {
960766
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.33", latest }, "Update available: {current} \u2192 {latest}")}
960354
960767
  `);
960355
960768
  writeToStdout(`
960356
960769
  `);
@@ -960366,8 +960779,8 @@ async function update() {
960366
960779
  writeToStdout(`${t("cli.update.managedByWinget", "CoStrict is managed by winget.")}
960367
960780
  `);
960368
960781
  const latest = await getLatestVersion(channel5);
960369
- if (latest && !gte2("4.2.32", latest)) {
960370
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.32", latest }, "Update available: {current} \u2192 {latest}")}
960782
+ if (latest && !gte2("4.2.33", latest)) {
960783
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.33", latest }, "Update available: {current} \u2192 {latest}")}
960371
960784
  `);
960372
960785
  writeToStdout(`
960373
960786
  `);
@@ -960383,8 +960796,8 @@ async function update() {
960383
960796
  writeToStdout(`${t("cli.update.managedByApk", "CoStrict is managed by apk.")}
960384
960797
  `);
960385
960798
  const latest = await getLatestVersion(channel5);
960386
- if (latest && !gte2("4.2.32", latest)) {
960387
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.32", latest }, "Update available: {current} \u2192 {latest}")}
960799
+ if (latest && !gte2("4.2.33", latest)) {
960800
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.33", latest }, "Update available: {current} \u2192 {latest}")}
960388
960801
  `);
960389
960802
  writeToStdout(`
960390
960803
  `);
@@ -960449,11 +960862,11 @@ async function update() {
960449
960862
  `);
960450
960863
  await gracefulShutdown(1);
960451
960864
  }
960452
- if (result2.latestVersion === "4.2.32") {
960453
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.32" }, "CoStrict is up to date ({version})")) + `
960865
+ if (result2.latestVersion === "4.2.33") {
960866
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.33" }, "CoStrict is up to date ({version})")) + `
960454
960867
  `);
960455
960868
  } else {
960456
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.32", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960869
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.33", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960457
960870
  `);
960458
960871
  regenerateCompletionCache();
960459
960872
  }
@@ -960513,12 +960926,12 @@ async function update() {
960513
960926
  `);
960514
960927
  await gracefulShutdown(1);
960515
960928
  }
960516
- if (latestVersion === "4.2.32") {
960517
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.32" }, "CoStrict is up to date ({version})")) + `
960929
+ if (latestVersion === "4.2.33") {
960930
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.33" }, "CoStrict is up to date ({version})")) + `
960518
960931
  `);
960519
960932
  await gracefulShutdown(0);
960520
960933
  }
960521
- writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.32" }, "New version available: {latest} (current: {current})")}
960934
+ writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.33" }, "New version available: {latest} (current: {current})")}
960522
960935
  `);
960523
960936
  writeToStdout(`${t("cli.update.installing", "Installing update...")}
960524
960937
  `);
@@ -960563,7 +960976,7 @@ async function update() {
960563
960976
  logForDebugging(`update: Installation status: ${result.status}`);
960564
960977
  switch (result.status) {
960565
960978
  case "success":
960566
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.32", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960979
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.33", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960567
960980
  `);
960568
960981
  regenerateCompletionCache();
960569
960982
  break;
@@ -962774,7 +963187,7 @@ ${assistantAddendum}` : assistantAddendum;
962774
963187
  }
962775
963188
  }
962776
963189
  logForDiagnosticsNoPII("info", "started", {
962777
- version: "4.2.32",
963190
+ version: "4.2.33",
962778
963191
  is_native_binary: isInBundledMode()
962779
963192
  });
962780
963193
  registerCleanup(async () => {
@@ -963265,7 +963678,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
963265
963678
  sshSession = await createSSHSession2({
963266
963679
  host: _pendingSSH.host,
963267
963680
  cwd: _pendingSSH.cwd,
963268
- localVersion: "4.2.32",
963681
+ localVersion: "4.2.33",
963269
963682
  permissionMode: _pendingSSH.permissionMode,
963270
963683
  dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
963271
963684
  extraCliArgs: _pendingSSH.extraCliArgs,
@@ -963734,7 +964147,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
963734
964147
  pendingHookMessages
963735
964148
  }, renderAndRun);
963736
964149
  }
963737
- }).version("4.2.32 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
964150
+ }).version("4.2.33 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
963738
964151
  program2.addOption(new Option("-w, --worktree [name]", cliDesc("cli.option.worktree", "Create a new git worktree for this session (optionally specify a name)")).hideHelp());
963739
964152
  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());
963740
964153
  if (canUserConfigureAdvisor()) {
@@ -964502,10 +964915,10 @@ function getCouncilArgs(args) {
964502
964915
  async function main2() {
964503
964916
  const args = process.argv.slice(2);
964504
964917
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
964505
- const d7 = new Date("2026-09-01T08:57:00.502Z");
964918
+ const d7 = new Date("2026-09-03T05:24:39.995Z");
964506
964919
  const p2 = (n3) => String(n3).padStart(2, "0");
964507
964920
  const buildTime = `${d7.getFullYear()}/${p2(d7.getMonth() + 1)}/${p2(d7.getDate())} ${p2(d7.getHours())}:${p2(d7.getMinutes())}:${p2(d7.getSeconds())}`;
964508
- console.log(`${"4.2.32"} (commit: ${"ede1a8017"}, built: ${buildTime})`);
964921
+ console.log(`${"4.2.33"} (commit: ${"d44b896fc"}, built: ${buildTime})`);
964509
964922
  return;
964510
964923
  }
964511
964924
  if (true) {
@@ -964704,5 +965117,5 @@ async function main2() {
964704
965117
  }
964705
965118
  main2();
964706
965119
 
964707
- //# debugId=762977BB961DE13464756E2164756E21
965120
+ //# debugId=43E6CBA08D54E9EA64756E2164756E21
964708
965121