@costrict/csc 4.2.32 → 4.2.33

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-02T08:06:33.927Z",
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) {
@@ -354066,7 +354066,7 @@ function getTelemetryAttributes() {
354066
354066
  attributes["session.id"] = sessionId;
354067
354067
  }
354068
354068
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
354069
- attributes["app.version"] = "4.2.32";
354069
+ attributes["app.version"] = "4.2.33";
354070
354070
  }
354071
354071
  const oauthAccount = getOauthAccountInfo();
354072
354072
  if (oauthAccount) {
@@ -469192,7 +469192,7 @@ function getInstallationEnv() {
469192
469192
  return;
469193
469193
  }
469194
469194
  function getClaudeCodeVersion() {
469195
- return "4.2.32";
469195
+ return "4.2.33";
469196
469196
  }
469197
469197
  async function getInstalledVSCodeExtensionVersion(command4) {
469198
469198
  const { stdout } = await execFileNoThrow(command4, ["--list-extensions", "--show-versions"], {
@@ -522832,7 +522832,7 @@ function initLangfuse() {
522832
522832
  flushInterval: parseInt(process.env.LANGFUSE_FLUSH_INTERVAL ?? "10", 10),
522833
522833
  mask: maskFn,
522834
522834
  environment: process.env.LANGFUSE_TRACING_ENVIRONMENT ?? "development",
522835
- release: "4.2.32",
522835
+ release: "4.2.33",
522836
522836
  exportMode: process.env.LANGFUSE_EXPORT_MODE ?? "batched",
522837
522837
  timeout: parseInt(process.env.LANGFUSE_TIMEOUT ?? "5", 10)
522838
522838
  });
@@ -523391,7 +523391,7 @@ function computeFingerprint(messageText2, version11) {
523391
523391
  }
523392
523392
  function computeFingerprintFromMessages(messages) {
523393
523393
  const firstMessageText = extractFirstMessageText(messages);
523394
- return computeFingerprint(firstMessageText, "4.2.32");
523394
+ return computeFingerprint(firstMessageText, "4.2.33");
523395
523395
  }
523396
523396
  var FINGERPRINT_SALT = "59cf53e54c78";
523397
523397
  var init_fingerprint = () => {};
@@ -523941,7 +523941,7 @@ async function sideQuery(opts) {
523941
523941
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
523942
523942
  }
523943
523943
  const messageText2 = extractFirstUserMessageText(messages);
523944
- const fingerprint = computeFingerprint(messageText2, "4.2.32");
523944
+ const fingerprint = computeFingerprint(messageText2, "4.2.33");
523945
523945
  const attributionHeader = getAttributionHeader(fingerprint);
523946
523946
  const systemBlocks = [
523947
523947
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -525367,7 +525367,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
525367
525367
  const client10 = new Client({
525368
525368
  name: "claude-code",
525369
525369
  title: "CoStrict",
525370
- version: "4.2.32",
525370
+ version: "4.2.33",
525371
525371
  description: "CoStrict agentic coding tool",
525372
525372
  websiteUrl: PRODUCT_URL
525373
525373
  }, {
@@ -525738,7 +525738,7 @@ var init_client17 = __esm(() => {
525738
525738
  const client10 = new Client({
525739
525739
  name: "claude-code",
525740
525740
  title: "CoStrict",
525741
- version: "4.2.32",
525741
+ version: "4.2.33",
525742
525742
  description: "CoStrict agentic coding tool",
525743
525743
  websiteUrl: PRODUCT_URL
525744
525744
  }, {
@@ -595157,6 +595157,17 @@ async function listTasks(taskListId) {
595157
595157
  const results = await Promise.all(taskIds.map((id) => getTask(taskListId, id)));
595158
595158
  return results.filter((t2) => t2 !== null);
595159
595159
  }
595160
+ async function deleteIncompleteAgentTasks(taskListId, agentId) {
595161
+ const tasks = await listTasks(taskListId);
595162
+ const incomplete = tasks.filter((t2) => t2.owner === agentId && t2.status !== "completed");
595163
+ let deleted = 0;
595164
+ for (const task of incomplete) {
595165
+ if (await deleteTask(taskListId, task.id)) {
595166
+ deleted++;
595167
+ }
595168
+ }
595169
+ return deleted;
595170
+ }
595160
595171
  async function blockTask(taskListId, fromTaskId, toTaskId) {
595161
595172
  const [fromTask, toTask] = await Promise.all([
595162
595173
  getTask(taskListId, fromTaskId),
@@ -624622,7 +624633,7 @@ function initSentry() {
624622
624633
  }
624623
624634
  init3({
624624
624635
  dsn,
624625
- release: typeof MACRO !== "undefined" ? "4.2.32" : undefined,
624636
+ release: typeof MACRO !== "undefined" ? "4.2.33" : undefined,
624626
624637
  environment: typeof BUILD_ENV !== "undefined" ? BUILD_ENV : "production",
624627
624638
  maxBreadcrumbs: 20,
624628
624639
  sampleRate: 1,
@@ -652271,7 +652282,7 @@ async function initializeBetaTracing(resource) {
652271
652282
  });
652272
652283
  logs.setGlobalLoggerProvider(loggerProvider);
652273
652284
  setLoggerProvider(loggerProvider);
652274
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.32");
652285
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.33");
652275
652286
  setEventLogger(eventLogger);
652276
652287
  process.on("beforeExit", async () => {
652277
652288
  await loggerProvider?.forceFlush();
@@ -652311,7 +652322,7 @@ async function initializeTelemetry() {
652311
652322
  const platform10 = getPlatform();
652312
652323
  const baseAttributes = {
652313
652324
  [import_semantic_conventions29.ATTR_SERVICE_NAME]: "claude-code",
652314
- [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.32"
652325
+ [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.33"
652315
652326
  };
652316
652327
  if (platform10 === "wsl") {
652317
652328
  const wslVersion = getWslVersion();
@@ -652356,7 +652367,7 @@ async function initializeTelemetry() {
652356
652367
  } catch {}
652357
652368
  };
652358
652369
  registerCleanup(shutdownTelemetry2);
652359
- return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.32");
652370
+ return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.33");
652360
652371
  }
652361
652372
  const meterProvider = new import_sdk_metrics2.MeterProvider({
652362
652373
  resource,
@@ -652376,7 +652387,7 @@ async function initializeTelemetry() {
652376
652387
  });
652377
652388
  logs.setGlobalLoggerProvider(loggerProvider);
652378
652389
  setLoggerProvider(loggerProvider);
652379
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.32");
652390
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.33");
652380
652391
  setEventLogger(eventLogger);
652381
652392
  logForDebugging("[3P telemetry] Event logger set successfully");
652382
652393
  process.on("beforeExit", async () => {
@@ -652438,7 +652449,7 @@ Current timeout: ${timeoutMs}ms
652438
652449
  }
652439
652450
  };
652440
652451
  registerCleanup(shutdownTelemetry);
652441
- return meterProvider.getMeter("com.anthropic.claude_code", "4.2.32");
652452
+ return meterProvider.getMeter("com.anthropic.claude_code", "4.2.33");
652442
652453
  }
652443
652454
  async function flushTelemetry() {
652444
652455
  const meterProvider = getMeterProvider();
@@ -653408,7 +653419,7 @@ async function installGlobalPackage(specificVersion) {
653408
653419
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
653409
653420
  logEvent("tengu_auto_updater_lock_contention", {
653410
653421
  pid: process.pid,
653411
- currentVersion: "4.2.32"
653422
+ currentVersion: "4.2.33"
653412
653423
  });
653413
653424
  return { status: "in_progress" };
653414
653425
  }
@@ -653417,7 +653428,7 @@ async function installGlobalPackage(specificVersion) {
653417
653428
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
653418
653429
  logError2(new Error("Windows NPM detected in WSL environment"));
653419
653430
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
653420
- currentVersion: "4.2.32"
653431
+ currentVersion: "4.2.33"
653421
653432
  });
653422
653433
  return {
653423
653434
  status: "install_failed",
@@ -653963,7 +653974,7 @@ function detectLinuxGlobPatternWarnings() {
653963
653974
  }
653964
653975
  async function getDoctorDiagnostic() {
653965
653976
  const installationType = await getCurrentInstallationType();
653966
- const version11 = typeof MACRO !== "undefined" ? "4.2.32" : "unknown";
653977
+ const version11 = typeof MACRO !== "undefined" ? "4.2.33" : "unknown";
653967
653978
  const installationPath = await getInstallationPath();
653968
653979
  const invokedBinary = getInvokedBinary();
653969
653980
  const multipleInstallations = await detectMultipleInstallations();
@@ -654905,8 +654916,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
654905
654916
  const maxVersion = await getMaxVersion();
654906
654917
  if (maxVersion && gt(version11, maxVersion)) {
654907
654918
  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`);
654919
+ if (gte2("4.2.33", maxVersion)) {
654920
+ logForDebugging(`Native installer: current version ${"4.2.33"} is already at or above maxVersion ${maxVersion}, skipping update`);
654910
654921
  logEvent("tengu_native_update_skipped_max_version", {
654911
654922
  latency_ms: Date.now() - startTime2,
654912
654923
  max_version: maxVersion,
@@ -654917,7 +654928,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
654917
654928
  version11 = maxVersion;
654918
654929
  }
654919
654930
  }
654920
- if (!forceReinstall && version11 === "4.2.32" && await versionIsAvailable(version11) && await isPossibleClaudeBinary(executablePath)) {
654931
+ if (!forceReinstall && version11 === "4.2.33" && await versionIsAvailable(version11) && await isPossibleClaudeBinary(executablePath)) {
654921
654932
  logForDebugging(`Found ${version11} at ${executablePath}, skipping install`);
654922
654933
  logEvent("tengu_native_update_complete", {
654923
654934
  latency_ms: Date.now() - startTime2,
@@ -683149,6 +683160,7 @@ async function* runAgent({
683149
683160
  return { ...prev, todos };
683150
683161
  });
683151
683162
  killShellTasksForAgent(agentId, toolUseContext.getAppState, rootSetAppState);
683163
+ await deleteIncompleteAgentTasks(getTaskListId(), agentId).catch(() => {});
683152
683164
  if (true) {
683153
683165
  const mcpMod = (init_MonitorMcpTask(), __toCommonJS(exports_MonitorMcpTask));
683154
683166
  mcpMod.killMonitorMcpTasksForAgent(agentId, toolUseContext.getAppState, rootSetAppState);
@@ -683213,6 +683225,7 @@ var init_runAgent = __esm(() => {
683213
683225
  init_providers();
683214
683226
  init_langfuse();
683215
683227
  init_sessionStorage();
683228
+ init_tasks();
683216
683229
  init_pluginOnlyPolicy();
683217
683230
  init_systemPromptType();
683218
683231
  init_perfettoTracing();
@@ -727541,7 +727554,7 @@ var init_TaskCreateTool = __esm(() => {
727541
727554
  description,
727542
727555
  activeForm,
727543
727556
  status: "pending",
727544
- owner: undefined,
727557
+ owner: context40?.agentId,
727545
727558
  blocks: [],
727546
727559
  blockedBy: [],
727547
727560
  metadata: metadata2
@@ -758554,7 +758567,7 @@ function seedDirFor(installLocation) {
758554
758567
  return getPluginSeedDirs().find((d7) => installLocation === d7 || installLocation.startsWith(d7 + sep31));
758555
758568
  }
758556
758569
  function getPluginGitTimeoutMs() {
758557
- const envValue = process.env.CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS;
758570
+ const envValue = getCostrictEnv("PLUGIN_GIT_TIMEOUT_MS");
758558
758571
  if (envValue) {
758559
758572
  const parsed = parseInt(envValue, 10);
758560
758573
  if (!isNaN(parsed) && parsed > 0) {
@@ -763972,7 +763985,7 @@ function getAnthropicEnvMetadata() {
763972
763985
  function getBuildAgeMinutes() {
763973
763986
  if (false)
763974
763987
  ;
763975
- const buildTime = new Date("2026-09-01T08:57:00.502Z").getTime();
763988
+ const buildTime = new Date("2026-09-02T08:06:33.927Z").getTime();
763976
763989
  if (isNaN(buildTime))
763977
763990
  return;
763978
763991
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -766893,7 +766906,109 @@ async function* executeCoStrictNonStreamingRequest(client10, requestBody, option
766893
766906
  }
766894
766907
  return e7.value;
766895
766908
  }
766896
- async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue) {
766909
+ function isPrefillContinueEnabled() {
766910
+ return process.env.COSTRICT_PREFILL_CONTINUE !== "0";
766911
+ }
766912
+ function buildCanonicalToolCallText(name3, rawArgs) {
766913
+ return `{"name": ${JSON.stringify(name3)}, "arguments": ${rawArgs}`;
766914
+ }
766915
+ function buildPrefillText(textBlocks, toolName, rawArgs) {
766916
+ const textPart = textBlocks.length > 0 ? `${textBlocks.join(`
766917
+ `)}
766918
+ ` : "";
766919
+ return textPart + buildCanonicalToolCallText(toolName, rawArgs);
766920
+ }
766921
+ function buildPrefillRequestBody(ctx, prefillText) {
766922
+ const body = { ...ctx.baseRequestBody };
766923
+ const assistantMsg = {
766924
+ role: "assistant",
766925
+ content: prefillText
766926
+ };
766927
+ if (ctx.prefixConfig?.position === "assistant") {
766928
+ Object.assign(assistantMsg, ctx.prefixConfig.params);
766929
+ } else {
766930
+ Object.assign(body, ctx.prefixConfig?.params ?? {});
766931
+ }
766932
+ body.messages = [...ctx.openaiMessages, assistantMsg];
766933
+ return body;
766934
+ }
766935
+ function buildRecoveryRequestBody(ctx, truncatedAssistantText, userInstruction) {
766936
+ return {
766937
+ ...ctx.baseRequestBody,
766938
+ messages: [
766939
+ ...ctx.openaiMessages,
766940
+ { role: "assistant", content: truncatedAssistantText },
766941
+ { role: "user", content: userInstruction }
766942
+ ]
766943
+ };
766944
+ }
766945
+ function buildRecoveryInstruction(toolName, argsString) {
766946
+ const partial4 = tryParsePartialToolInput(argsString);
766947
+ const filePath = partial4 && typeof partial4.file_path === "string" ? partial4.file_path : undefined;
766948
+ const content = partial4 && typeof partial4.content === "string" ? partial4.content : undefined;
766949
+ const size = content?.length ?? argsString.length;
766950
+ const executed = toolName === "Write" && filePath ? "nothing was executed \u2014 the file does not exist on disk yet" : "nothing was executed (no side effects occurred)";
766951
+ const lines2 = [
766952
+ `Your ${toolName} tool call${filePath ? ` to \`${filePath}\`` : ""} was truncated by the output token limit after ~${size} chars of content \u2014 ${executed}.`,
766953
+ "Do not repeat the full call in a single response.",
766954
+ 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.",
766955
+ content ? `Your truncated content ended with: ${JSON.stringify(content.slice(-120))}` : ""
766956
+ ].filter(Boolean);
766957
+ return lines2.join(" ");
766958
+ }
766959
+ function createBoundaryScanner(initialArgs) {
766960
+ const scanner = {
766961
+ depth: 1,
766962
+ inString: false,
766963
+ escaped: false,
766964
+ closed: false
766965
+ };
766966
+ feedBoundaryScanner(scanner, initialArgs);
766967
+ return scanner;
766968
+ }
766969
+ function feedBoundaryScanner(scanner, chunk) {
766970
+ if (scanner.closed)
766971
+ return 0;
766972
+ let consumed = 0;
766973
+ for (let i10 = 0;i10 < chunk.length; i10++) {
766974
+ const ch2 = chunk[i10];
766975
+ if (scanner.inString) {
766976
+ if (scanner.escaped) {
766977
+ scanner.escaped = false;
766978
+ } else if (ch2 === "\\") {
766979
+ scanner.escaped = true;
766980
+ } else if (ch2 === '"') {
766981
+ scanner.inString = false;
766982
+ }
766983
+ } else {
766984
+ if (ch2 === '"') {
766985
+ scanner.inString = true;
766986
+ } else if (ch2 === "{") {
766987
+ scanner.depth++;
766988
+ } else if (ch2 === "}") {
766989
+ scanner.depth--;
766990
+ if (scanner.depth === 0) {
766991
+ scanner.closed = true;
766992
+ return consumed;
766993
+ }
766994
+ }
766995
+ }
766996
+ consumed++;
766997
+ }
766998
+ return consumed;
766999
+ }
767000
+ function cloneScanner(scanner) {
767001
+ return { ...scanner };
767002
+ }
767003
+ function isParseableJSON(s) {
767004
+ try {
767005
+ JSON.parse(s);
767006
+ return true;
767007
+ } catch {
767008
+ return false;
767009
+ }
767010
+ }
767011
+ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue, continuation) {
766897
767012
  const contentBlocks2 = {};
766898
767013
  const toolCallStates = new Map;
766899
767014
  let partialMessage;
@@ -766907,6 +767022,23 @@ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, optio
766907
767022
  };
766908
767023
  let ttftMs = 0;
766909
767024
  const start = Date.now();
767025
+ let mode = "initial";
767026
+ let l1Rounds = 0;
767027
+ let l1Failures = 0;
767028
+ let dangling = null;
767029
+ let danglingIndex = -1;
767030
+ let textBlocksForPrefix = [];
767031
+ let scanner = null;
767032
+ let roundStartRawInput = "";
767033
+ let roundStartScanner = null;
767034
+ let roundStopReason = null;
767035
+ let roundUsage = null;
767036
+ let roundSawMessageStop = false;
767037
+ let pendingMessageDeltaEvent = null;
767038
+ let closedThisRound = false;
767039
+ let diverged = false;
767040
+ let l2IndexOffset = 0;
767041
+ const signal = continuation?.signal;
766910
767042
  const finalizeToolCallStates = () => {
766911
767043
  for (const state3 of toolCallStates.values()) {
766912
767044
  try {
@@ -766962,106 +767094,362 @@ async function* consumeCoStrictStream(adaptedStream, costrictModel, tools, optio
766962
767094
  }
766963
767095
  return outputs;
766964
767096
  };
767097
+ const addToUsage = (u6) => {
767098
+ if (!u6)
767099
+ return;
767100
+ usage2 = {
767101
+ input_tokens: usage2.input_tokens + (Number(u6.input_tokens) || 0),
767102
+ output_tokens: usage2.output_tokens + (Number(u6.output_tokens) || 0),
767103
+ cache_creation_input_tokens: usage2.cache_creation_input_tokens + (Number(u6.cache_creation_input_tokens) || 0),
767104
+ cache_read_input_tokens: usage2.cache_read_input_tokens + (Number(u6.cache_read_input_tokens) || 0)
767105
+ };
767106
+ };
767107
+ 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);
767108
+ const maxBlockIndex = () => {
767109
+ const keys6 = Object.keys(contentBlocks2);
767110
+ return keys6.length === 0 ? -1 : Math.max(...keys6.map(Number));
767111
+ };
767112
+ const finalizeAndStop = function* (finalStopReason) {
767113
+ stopReason = finalStopReason;
767114
+ if (mode !== "initial") {
767115
+ yield {
767116
+ type: "stream_event",
767117
+ event: {
767118
+ type: "message_delta",
767119
+ delta: { stop_reason: finalStopReason, stop_sequence: null },
767120
+ usage: usage2
767121
+ }
767122
+ };
767123
+ } else if (pendingMessageDeltaEvent) {
767124
+ yield {
767125
+ type: "stream_event",
767126
+ event: pendingMessageDeltaEvent
767127
+ };
767128
+ }
767129
+ if (partialMessage) {
767130
+ finalizeToolCallStates();
767131
+ for (const output of assembleFinalAssistantOutputs2()) {
767132
+ yield output;
767133
+ }
767134
+ partialMessage = null;
767135
+ toolCallStates.clear();
767136
+ }
767137
+ if (roundSawMessageStop) {
767138
+ yield { type: "stream_event", event: { type: "message_stop" } };
767139
+ }
767140
+ if (roundSawMessageStop && usage2.input_tokens + usage2.output_tokens > 0) {
767141
+ try {
767142
+ const costUSD = calculateUSDCost(costrictModel, usage2);
767143
+ addToTotalSessionCost(costUSD, usage2, options.model);
767144
+ } catch (err3) {
767145
+ logForDebugging(`[costrict] cost accounting skipped: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767146
+ }
767147
+ }
767148
+ };
767149
+ const createContinuationStream = async (body) => {
767150
+ if (!continuation)
767151
+ throw new Error("missing continuation context");
767152
+ const stream7 = await continuation.client.chat.completions.create(body, { signal });
767153
+ return adaptOpenAIStreamToAnthropic(stream7, costrictModel);
767154
+ };
767155
+ const enterL2 = async () => {
767156
+ if (!continuation || !dangling)
767157
+ return null;
767158
+ logForDebugging(`[prefill-continue] tier=L2 entering recovery round (tool=${dangling.name}, chars=${dangling.rawInput.length})`, { level: "info" });
767159
+ mode = "l2";
767160
+ l2IndexOffset = maxBlockIndex() + 1;
767161
+ const truncatedText = buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput);
767162
+ const body = buildRecoveryRequestBody(continuation, truncatedText, buildRecoveryInstruction(dangling.name, dangling.rawInput));
767163
+ try {
767164
+ return await createContinuationStream(body);
767165
+ } catch (err3) {
767166
+ logForDebugging(`[prefill-continue] tier=L2 request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767167
+ return null;
767168
+ }
767169
+ };
766965
767170
  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 };
767171
+ let activeStream = adaptedStream;
767172
+ rounds:
767173
+ while (true) {
767174
+ roundStopReason = null;
767175
+ roundUsage = null;
767176
+ roundSawMessageStop = false;
767177
+ pendingMessageDeltaEvent = null;
767178
+ closedThisRound = false;
767179
+ diverged = false;
767180
+ if (mode === "prefill" && dangling && scanner) {
767181
+ roundStartRawInput = dangling.rawInput;
767182
+ roundStartScanner = cloneScanner(scanner);
767183
+ }
767184
+ let roundError;
767185
+ try {
767186
+ for await (const rawEvent of activeStream) {
767187
+ const event = rawEvent;
767188
+ if (mode === "prefill") {
767189
+ if (event.type === "message_start" || event.type === "content_block_start" || event.type === "content_block_stop") {
767190
+ continue;
767191
+ }
767192
+ if (event.type === "message_delta") {
767193
+ if (event.usage)
767194
+ roundUsage = {
767195
+ ...roundUsage ?? {},
767196
+ ...event.usage
767197
+ };
767198
+ if (event.delta?.stop_reason != null) {
767199
+ roundStopReason = event.delta.stop_reason;
767200
+ }
767201
+ continue;
767202
+ }
767203
+ if (event.type === "message_stop") {
767204
+ roundSawMessageStop = true;
767205
+ continue;
767206
+ }
767207
+ if (event.type === "content_block_delta") {
767208
+ const delta = event.delta;
767209
+ if (delta?.type === "thinking_delta" || delta?.type === "signature_delta") {
767210
+ continue;
767211
+ }
767212
+ if (delta?.type !== "text_delta") {
767213
+ diverged = true;
767214
+ continue;
767215
+ }
767216
+ if (!scanner || scanner.closed)
767217
+ continue;
767218
+ const text2 = String(delta.text ?? "");
767219
+ if (!text2)
767220
+ continue;
767221
+ const consumed = feedBoundaryScanner(scanner, text2);
767222
+ if (scanner.closed)
767223
+ closedThisRound = true;
767224
+ if (consumed === 0)
767225
+ continue;
767226
+ event.index = danglingIndex;
767227
+ event.delta = {
767228
+ type: "input_json_delta",
767229
+ partial_json: text2.slice(0, consumed)
767230
+ };
767231
+ }
767232
+ } else if (mode === "l2") {
767233
+ if (event.type === "message_start")
767234
+ continue;
767235
+ if (event.type === "message_delta") {
767236
+ if (event.usage)
767237
+ roundUsage = {
767238
+ ...roundUsage ?? {},
767239
+ ...event.usage
767240
+ };
767241
+ if (event.delta?.stop_reason != null) {
767242
+ roundStopReason = event.delta.stop_reason;
767243
+ }
767244
+ continue;
767245
+ }
767246
+ if (event.type === "message_stop") {
767247
+ roundSawMessageStop = true;
767248
+ continue;
767249
+ }
767250
+ if (typeof event.index === "number") {
767251
+ event.index += l2IndexOffset;
767252
+ }
767253
+ }
767254
+ switch (event.type) {
767255
+ case "message_start": {
767256
+ partialMessage = event.message;
767257
+ hasProducedOutput = true;
767258
+ ttftMs = Date.now() - start;
767259
+ if (event.message?.usage) {
767260
+ usage2 = { ...usage2, ...event.message.usage };
767261
+ }
767262
+ break;
767263
+ }
767264
+ case "content_block_start": {
767265
+ const idx = event.index;
767266
+ const cb = event.content_block;
767267
+ if (cb.type === "tool_use") {
767268
+ contentBlocks2[idx] = { ...cb, input: "" };
767269
+ toolCallStates.set(idx, {
767270
+ index: idx,
767271
+ id: String(cb.id ?? ""),
767272
+ name: typeof cb.name === "string" ? cb.name : "",
767273
+ rawInput: ""
767274
+ });
767275
+ } else if (cb.type === "text") {
767276
+ contentBlocks2[idx] = { ...cb, text: "" };
767277
+ } else if (cb.type === "thinking") {
767278
+ contentBlocks2[idx] = { ...cb, thinking: "", signature: "" };
767279
+ } else {
767280
+ contentBlocks2[idx] = { ...cb };
767281
+ }
767282
+ break;
767283
+ }
767284
+ case "content_block_delta": {
767285
+ const idx = event.index;
767286
+ const delta = event.delta;
767287
+ const block2 = contentBlocks2[idx];
767288
+ if (!block2)
767289
+ break;
767290
+ if (delta.type === "text_delta") {
767291
+ block2.text = (block2.text || "") + delta.text;
767292
+ } else if (delta.type === "input_json_delta") {
767293
+ const fragment = String(delta.partial_json ?? "");
767294
+ block2.input = (block2.input || "") + fragment;
767295
+ const state3 = toolCallStates.get(idx);
767296
+ if (state3) {
767297
+ state3.rawInput += fragment;
767298
+ const partialInput = tryParsePartialToolInput(state3.rawInput);
767299
+ if (partialInput) {
767300
+ state3.partialInput = partialInput;
767301
+ delta.parsed_tool_input = partialInput;
767302
+ }
767303
+ }
767304
+ } else if (delta.type === "thinking_delta") {
767305
+ block2.thinking = (block2.thinking || "") + delta.thinking;
767306
+ } else if (delta.type === "signature_delta") {
767307
+ block2.signature = delta.signature;
767308
+ }
767309
+ break;
767310
+ }
767311
+ case "content_block_stop": {
767312
+ break;
767313
+ }
767314
+ case "message_delta": {
767315
+ const deltaUsage = event.usage;
767316
+ if (deltaUsage)
767317
+ usage2 = { ...usage2, ...deltaUsage };
767318
+ if (event.delta?.stop_reason != null) {
767319
+ stopReason = event.delta.stop_reason;
767320
+ }
767321
+ break;
767322
+ }
767323
+ case "message_stop": {
767324
+ break;
767325
+ }
767326
+ }
767327
+ if (event.type === "message_delta") {
767328
+ pendingMessageDeltaEvent = event;
767329
+ continue;
767330
+ }
767331
+ if (event.type === "message_stop") {
767332
+ roundSawMessageStop = true;
767333
+ continue;
767334
+ }
767335
+ yield {
767336
+ type: "stream_event",
767337
+ event,
767338
+ ...event.type === "message_start" && mode === "initial" ? { ttftMs } : undefined
767339
+ };
766974
767340
  }
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 };
767341
+ } catch (error100) {
767342
+ const isAbort = signal?.aborted === true || error100?.constructor?.name === "APIUserAbortError";
767343
+ if (isAbort || mode === "initial") {
767344
+ throw error100;
766994
767345
  }
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;
767346
+ roundError = error100;
767347
+ }
767348
+ if (mode !== "initial") {
767349
+ addToUsage(roundUsage);
767350
+ }
767351
+ if (mode === "initial") {
767352
+ const danglings = [...toolCallStates.values()].filter((s) => s.rawInput.length > 0 && !isParseableJSON(s.rawInput));
767353
+ const shouldContinue = continuation?.enabled === true && stopReason === "max_tokens" && partialMessage !== null && danglings.length === 1 && danglings[0].rawInput.length < MAX_STITCHED_CHARS && signal?.aborted !== true;
767354
+ if (shouldContinue && continuation && danglings[0]) {
767355
+ dangling = danglings[0];
767356
+ danglingIndex = dangling.index;
767357
+ textBlocksForPrefix = collectTextBlocks();
767358
+ if (continuation.prefixConfig) {
767359
+ mode = "prefill";
767360
+ scanner = createBoundaryScanner(dangling.rawInput);
767361
+ const body = buildPrefillRequestBody(continuation, buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput));
767362
+ l1Rounds++;
767363
+ try {
767364
+ activeStream = await createContinuationStream(body);
767365
+ continue rounds;
767366
+ } catch (err3) {
767367
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767015
767368
  }
767016
767369
  }
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;
767370
+ const l2Stream = await enterL2();
767371
+ if (l2Stream) {
767372
+ activeStream = l2Stream;
767373
+ continue rounds;
767374
+ }
767375
+ yield* finalizeAndStop("max_tokens");
767376
+ return hasProducedOutput;
767021
767377
  }
767022
- break;
767378
+ yield* finalizeAndStop(stopReason);
767379
+ return hasProducedOutput;
767023
767380
  }
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;
767381
+ if (mode === "prefill" && dangling && scanner) {
767382
+ if (closedThisRound) {
767383
+ let valid = false;
767384
+ try {
767385
+ const parsed = JSON.parse(dangling.rawInput);
767386
+ valid = isPlainRecord(parsed) && !(dangling.name === "Write" && (typeof parsed.file_path !== "string" || !parsed.file_path || typeof parsed.content !== "string"));
767387
+ } catch {
767388
+ valid = false;
767389
+ }
767390
+ if (valid) {
767391
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} closed and valid, done`, { level: "info" });
767392
+ yield* finalizeAndStop("tool_use");
767393
+ return hasProducedOutput;
767394
+ }
767395
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} closed but invalid JSON`, { level: "warn" });
767396
+ dangling.rawInput = roundStartRawInput;
767397
+ const danglingBlock = contentBlocks2[danglingIndex];
767398
+ if (danglingBlock)
767399
+ danglingBlock.input = roundStartRawInput;
767400
+ Object.assign(scanner, roundStartScanner);
767401
+ l1Failures++;
767402
+ } else if (roundStopReason === "max_tokens" && roundError === undefined && !diverged) {
767403
+ if (l1Rounds < MAX_PREFILL_ROUNDS && dangling.rawInput.length < MAX_STITCHED_CHARS && signal?.aborted !== true) {
767404
+ const body = buildPrefillRequestBody(continuation, buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput));
767405
+ l1Rounds++;
767406
+ try {
767407
+ activeStream = await createContinuationStream(body);
767408
+ continue rounds;
767409
+ } catch (err3) {
767410
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767411
+ }
767412
+ l1Failures++;
767413
+ } else {
767414
+ logForDebugging(`[prefill-continue] tier=L1 rounds/chars budget exhausted (round=${l1Rounds}, chars=${dangling.rawInput.length})`, { level: "warn" });
767415
+ l1Failures = 2;
767416
+ }
767417
+ } else {
767418
+ logForDebugging(`[prefill-continue] tier=L1 round=${l1Rounds} divergence (finish=${roundStopReason ?? "none"}, error=${roundError !== undefined}, diverged=${diverged})`, { level: "warn" });
767419
+ dangling.rawInput = roundStartRawInput;
767420
+ const danglingBlock = contentBlocks2[danglingIndex];
767421
+ if (danglingBlock)
767422
+ danglingBlock.input = roundStartRawInput;
767423
+ Object.assign(scanner, roundStartScanner);
767424
+ l1Failures++;
767425
+ }
767426
+ if (l1Failures <= 1 && l1Rounds < MAX_PREFILL_ROUNDS && signal?.aborted !== true && continuation) {
767427
+ const body = buildPrefillRequestBody(continuation, buildPrefillText(textBlocksForPrefix, dangling.name, dangling.rawInput));
767428
+ l1Rounds++;
767429
+ try {
767430
+ activeStream = await createContinuationStream(body);
767431
+ continue rounds;
767432
+ } catch (err3) {
767433
+ logForDebugging(`[prefill-continue] tier=L1 retry request failed: ${err3 instanceof Error ? err3.message : String(err3)}`, { level: "warn" });
767434
+ }
767033
767435
  }
767034
- break;
767436
+ const l2Stream = await enterL2();
767437
+ if (l2Stream) {
767438
+ activeStream = l2Stream;
767439
+ continue rounds;
767440
+ }
767441
+ yield* finalizeAndStop("max_tokens");
767442
+ return hasProducedOutput;
767035
767443
  }
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();
767444
+ if (mode === "l2") {
767445
+ const l2Ok = roundError === undefined && roundSawMessageStop && roundStopReason != null && roundStopReason !== "max_tokens";
767446
+ if (!l2Ok) {
767447
+ logForDebugging(`[prefill-continue] tier=L2 truncated/failed (finish=${roundStopReason ?? "none"}, error=${roundError !== undefined}), falling back to legacy recovery`, { level: "warn" });
767044
767448
  }
767045
- break;
767449
+ yield* finalizeAndStop(l2Ok ? roundStopReason : "max_tokens");
767450
+ return hasProducedOutput;
767046
767451
  }
767047
767452
  }
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
767453
  } catch (error100) {
767066
767454
  if (error100 instanceof Error) {
767067
767455
  error100.__streamProducedOutput = hasProducedOutput;
@@ -767165,6 +767553,22 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767165
767553
  };
767166
767554
  let streamAttempts = 0;
767167
767555
  let lastStreamError;
767556
+ const prefixCfg = modelInfo?.prefixCompletion;
767557
+ const prefixParams = prefixCfg && isPlainRecord(prefixCfg) && isPlainRecord(prefixCfg.params) ? prefixCfg.params : undefined;
767558
+ const continuation = {
767559
+ enabled: isPrefillContinueEnabled(),
767560
+ ...prefixCfg?.enable === true && prefixParams !== undefined && Object.keys(prefixParams).length > 0 && {
767561
+ prefixConfig: {
767562
+ enable: true,
767563
+ position: prefixCfg.position === "assistant" ? "assistant" : "top",
767564
+ params: prefixParams
767565
+ }
767566
+ },
767567
+ openaiMessages,
767568
+ baseRequestBody: requestBody,
767569
+ client: client10,
767570
+ signal
767571
+ };
767168
767572
  while (streamAttempts < MAX_STREAM_RECONNECT_ATTEMPTS2) {
767169
767573
  streamAttempts++;
767170
767574
  const retryGenerator = withRetry(() => Promise.resolve(client10), async (c10, _attempt, _context) => {
@@ -767191,7 +767595,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767191
767595
  stream7 = e7.value;
767192
767596
  const adaptedStream = adaptOpenAIStreamToAnthropic(stream7, costrictModel);
767193
767597
  try {
767194
- const producedOutput = yield* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue);
767598
+ const producedOutput = yield* consumeCoStrictStream(adaptedStream, costrictModel, tools, options, maxTokensValue, continuation);
767195
767599
  if (!producedOutput && streamAttempts < MAX_STREAM_RECONNECT_ATTEMPTS2) {
767196
767600
  yield createSystemAPIErrorMessage(new APIError(503, {}, "Stream completed without producing output", new Headers), 0, streamAttempts, MAX_STREAM_RECONNECT_ATTEMPTS2);
767197
767601
  logForDebugging(`[CoStrict] Stream completed without producing output (attempt ${streamAttempts}/${MAX_STREAM_RECONNECT_ATTEMPTS2}), reconnecting`, { level: "warn" });
@@ -767213,7 +767617,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767213
767617
  const nonStreamingBody = toNonStreamingOpenAIRequestBody(requestBody);
767214
767618
  const completion = yield* executeCoStrictNonStreamingRequest(client10, nonStreamingBody, options, signal);
767215
767619
  const fallbackStream = adaptOpenAICompletionToAnthropicStream(completion);
767216
- yield* consumeCoStrictStream(fallbackStream, costrictModel, tools, options, maxTokensValue);
767620
+ yield* consumeCoStrictStream(fallbackStream, costrictModel, tools, options, maxTokensValue, continuation);
767217
767621
  return;
767218
767622
  } catch (fallbackError) {
767219
767623
  logForDebugging(`[CoStrict] Non-streaming fallback also failed: ${fallbackError instanceof Error ? fallbackError.message : String(fallbackError)}`, { level: "error" });
@@ -767237,7 +767641,7 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
767237
767641
  });
767238
767642
  }
767239
767643
  }
767240
- var import_partial_json, MAX_STREAM_RECONNECT_ATTEMPTS2 = 3;
767644
+ var import_partial_json, MAX_STREAM_RECONNECT_ATTEMPTS2 = 3, MAX_PREFILL_ROUNDS = 4, MAX_STITCHED_CHARS = 2000000;
767241
767645
  var init_provider3 = __esm(() => {
767242
767646
  init_openai();
767243
767647
  init_sdk();
@@ -770081,7 +770485,7 @@ var init_shouldUseSandbox = __esm(() => {
770081
770485
 
770082
770486
  // src/utils/askUserQuestionAutoSelect.ts
770083
770487
  function isAskUserQuestionAutoSelectEnabled(settings) {
770084
- return settings.askUserQuestionAutoSelectEnabled ?? true;
770488
+ return settings.askUserQuestionAutoSelectEnabled ?? false;
770085
770489
  }
770086
770490
  function getAskUserQuestionAutoSelectTimeoutSeconds(settings) {
770087
770491
  return settings.askUserQuestionTimeoutSeconds ?? DEFAULT_ASK_USER_QUESTION_AUTO_SELECT_TIMEOUT_SECONDS;
@@ -778071,7 +778475,7 @@ function Feedback({
778071
778475
  platform: env4.platform,
778072
778476
  gitRepo: envInfo.isGit,
778073
778477
  terminal: env4.terminal,
778074
- version: "4.2.32",
778478
+ version: "4.2.33",
778075
778479
  transcript: normalizeMessagesForAPI(messages),
778076
778480
  errors: sanitizedErrors,
778077
778481
  lastApiRequest: getLastAPIRequest(),
@@ -778254,7 +778658,7 @@ function Feedback({
778254
778658
  ", ",
778255
778659
  env4.terminal,
778256
778660
  ", v",
778257
- "4.2.32"
778661
+ "4.2.33"
778258
778662
  ]
778259
778663
  })
778260
778664
  ]
@@ -778351,7 +778755,7 @@ ${sanitizedDescription}
778351
778755
  ` + `**Environment Info**
778352
778756
  ` + `- Platform: ${env4.platform}
778353
778757
  ` + `- Terminal: ${env4.terminal}
778354
- ` + `- Version: ${"4.2.32"}
778758
+ ` + `- Version: ${"4.2.33"}
778355
778759
  ` + `- Feedback ID: ${feedbackId}
778356
778760
  ` + `
778357
778761
  **Errors**
@@ -780590,7 +780994,7 @@ function buildPrimarySection() {
780590
780994
  children: t("settings.status.renameHint")
780591
780995
  });
780592
780996
  return [
780593
- { label: t("settings.status.version"), value: "4.2.32" },
780997
+ { label: t("settings.status.version"), value: "4.2.33" },
780594
780998
  { label: t("settings.status.sessionName"), value: nameValue },
780595
780999
  { label: t("settings.status.sessionId"), value: sessionId },
780596
781000
  { label: t("settings.status.cwd"), value: getCwd() },
@@ -782306,7 +782710,7 @@ function Config({
782306
782710
  {
782307
782711
  id: "askUserQuestionAutoSelectEnabled",
782308
782712
  label: t("settings.askUserQuestion.autoSelect"),
782309
- value: settingsData?.askUserQuestionAutoSelectEnabled ?? true,
782713
+ value: settingsData?.askUserQuestionAutoSelectEnabled ?? false,
782310
782714
  type: "boolean",
782311
782715
  onChange(askUserQuestionAutoSelectEnabled) {
782312
782716
  const result = updateSettingsForSource("userSettings", {
@@ -782920,8 +783324,8 @@ function Config({
782920
783324
  });
782921
783325
  formattedChanges.push(remoteLabel);
782922
783326
  }
782923
- const askUserQuestionAutoSelectEnabled = settingsData?.askUserQuestionAutoSelectEnabled ?? true;
782924
- if (askUserQuestionAutoSelectEnabled !== (initialSettingsData.current?.askUserQuestionAutoSelectEnabled ?? true)) {
783327
+ const askUserQuestionAutoSelectEnabled = settingsData?.askUserQuestionAutoSelectEnabled ?? false;
783328
+ if (askUserQuestionAutoSelectEnabled !== (initialSettingsData.current?.askUserQuestionAutoSelectEnabled ?? false)) {
782925
783329
  const action2 = askUserQuestionAutoSelectEnabled ? t("settings.config.saved.enabled") : t("settings.config.saved.disabled");
782926
783330
  formattedChanges.push(t("settings.config.saved.askUserQuestionAutoSelect", { action: action2 }));
782927
783331
  }
@@ -783468,7 +783872,7 @@ function Config({
783468
783872
  }
783469
783873
  })
783470
783874
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime192.jsx(ChannelDowngradeDialog, {
783471
- currentVersion: "4.2.32",
783875
+ currentVersion: "4.2.33",
783472
783876
  onChoice: (choice) => {
783473
783877
  setShowSubmenu(null);
783474
783878
  setTabsHidden(false);
@@ -783480,7 +783884,7 @@ function Config({
783480
783884
  autoUpdatesChannel: "stable"
783481
783885
  };
783482
783886
  if (choice === "stay") {
783483
- newSettings.minimumVersion = "4.2.32";
783887
+ newSettings.minimumVersion = "4.2.33";
783484
783888
  }
783485
783889
  updateSettingsForSource("userSettings", newSettings);
783486
783890
  setSettingsData((prev) => ({
@@ -788949,7 +789353,7 @@ function HelpV2({ onClose, commands: commands11 }) {
788949
789353
  color: "professionalBlue",
788950
789354
  children: [
788951
789355
  /* @__PURE__ */ jsx_runtime219.jsx(Tabs, {
788952
- title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.32"}`,
789356
+ title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.33"}`,
788953
789357
  color: "professionalBlue",
788954
789358
  defaultTab: "general",
788955
789359
  children: tabs
@@ -811664,7 +812068,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
811664
812068
  return [];
811665
812069
  }
811666
812070
  }
811667
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.32") {
812071
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.33") {
811668
812072
  if (process.env.USER_TYPE === "sf") {
811669
812073
  const changelog = "";
811670
812074
  if (changelog) {
@@ -811691,7 +812095,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.32")
811691
812095
  releaseNotes
811692
812096
  };
811693
812097
  }
811694
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.32") {
812098
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.33") {
811695
812099
  if (process.env.USER_TYPE === "sf") {
811696
812100
  const changelog = "";
811697
812101
  if (changelog) {
@@ -814204,7 +814608,7 @@ function isNotLoggedIn() {
814204
814608
  return true;
814205
814609
  }
814206
814610
  function getLogoDisplayData() {
814207
- const version11 = process.env.DEMO_VERSION ?? "4.2.32";
814611
+ const version11 = process.env.DEMO_VERSION ?? "4.2.33";
814208
814612
  const serverUrl = getDirectConnectServerUrl();
814209
814613
  const displayPath2 = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
814210
814614
  const cwd2 = serverUrl ? `${displayPath2} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath2;
@@ -814782,7 +815186,7 @@ var init_MatrixMessageLine = __esm(() => {
814782
815186
  // src/components/matrix-tactical/MatrixWelcome.tsx
814783
815187
  import { basename as basename48 } from "path";
814784
815188
  function MatrixWelcome({
814785
- version: version11 = "4.2.32",
815189
+ version: version11 = "4.2.33",
814786
815190
  projectName,
814787
815191
  cwd: cwd2,
814788
815192
  modelDisplayName,
@@ -815417,13 +815821,13 @@ function LogoV2() {
815417
815821
  const { hasReleaseNotes } = checkForReleaseNotesSync(config13.lastReleaseNotesSeen);
815418
815822
  import_react167.useEffect(() => {
815419
815823
  const currentConfig = getGlobalConfig();
815420
- if (currentConfig.lastReleaseNotesSeen === "4.2.32") {
815824
+ if (currentConfig.lastReleaseNotesSeen === "4.2.33") {
815421
815825
  return;
815422
815826
  }
815423
815827
  saveGlobalConfig((current2) => {
815424
- if (current2.lastReleaseNotesSeen === "4.2.32")
815828
+ if (current2.lastReleaseNotesSeen === "4.2.33")
815425
815829
  return current2;
815426
- return { ...current2, lastReleaseNotesSeen: "4.2.32" };
815830
+ return { ...current2, lastReleaseNotesSeen: "4.2.33" };
815427
815831
  });
815428
815832
  if (showOnboarding) {
815429
815833
  incrementProjectOnboardingSeenCount();
@@ -838988,7 +839392,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
838988
839392
  smapsRollup,
838989
839393
  platform: process.platform,
838990
839394
  nodeVersion: process.version,
838991
- ccVersion: "4.2.32"
839395
+ ccVersion: "4.2.33"
838992
839396
  };
838993
839397
  }
838994
839398
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -839104,7 +839508,7 @@ var init_mock_limits = __esm(() => {
839104
839508
  var call56 = async () => {
839105
839509
  return {
839106
839510
  type: "text",
839107
- value: `${"4.2.32"} (built ${"2026-09-01T08:57:00.502Z"})`
839511
+ value: `${"4.2.33"} (built ${"2026-09-02T08:06:33.927Z"})`
839108
839512
  };
839109
839513
  }, version11, version_default;
839110
839514
  var init_version2 = __esm(() => {
@@ -858983,7 +859387,7 @@ function generateHtmlReport(data, insights) {
858983
859387
  </html>`;
858984
859388
  }
858985
859389
  function buildExportData(data, insights, facets, remoteStats) {
858986
- const version12 = typeof MACRO !== "undefined" ? "4.2.32" : "unknown";
859390
+ const version12 = typeof MACRO !== "undefined" ? "4.2.33" : "unknown";
858987
859391
  const remote_hosts_collected = remoteStats?.hosts.filter((h8) => h8.sessionCount > 0).map((h8) => h8.name);
858988
859392
  const facets_summary = {
858989
859393
  total: facets.size,
@@ -863475,7 +863879,7 @@ var init_sessionStorage = __esm(() => {
863475
863879
  init_settings2();
863476
863880
  init_slowOperations();
863477
863881
  init_uuid();
863478
- VERSION11 = typeof MACRO !== "undefined" ? "4.2.32" : "unknown";
863882
+ VERSION11 = typeof MACRO !== "undefined" ? "4.2.33" : "unknown";
863479
863883
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
863480
863884
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
863481
863885
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -864816,7 +865220,7 @@ var init_filesystem = __esm(() => {
864816
865220
  });
864817
865221
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
864818
865222
  const nonce = randomBytes24(16).toString("hex");
864819
- return join219(getCostrictTempDir(), "bundled-skills", "4.2.32", nonce);
865223
+ return join219(getCostrictTempDir(), "bundled-skills", "4.2.33", nonce);
864820
865224
  });
864821
865225
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
864822
865226
  });
@@ -876314,7 +876718,7 @@ function buildSystemInitMessage(inputs) {
876314
876718
  slash_commands: inputs.commands.filter((c10) => c10.userInvocable !== false).map((c10) => c10.name),
876315
876719
  apiKeySource: getAnthropicApiKeyWithSource().source,
876316
876720
  betas: getSdkBetas(),
876317
- claude_code_version: "4.2.32",
876721
+ claude_code_version: "4.2.33",
876318
876722
  output_style: outputStyle2,
876319
876723
  agents: inputs.agents.map((agent) => agent.agentType),
876320
876724
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -879858,7 +880262,7 @@ function appendToLog(path63, message2) {
879858
880262
  cwd: getFsImplementation().cwd(),
879859
880263
  userType: process.env.USER_TYPE,
879860
880264
  sessionId: getSessionId(),
879861
- version: "4.2.32"
880265
+ version: "4.2.33"
879862
880266
  };
879863
880267
  getLogWriter(path63).write(messageWithTimestamp);
879864
880268
  }
@@ -900919,7 +901323,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
900919
901323
  project_dir: getOriginalCwd(),
900920
901324
  added_dirs: addedDirs
900921
901325
  },
900922
- version: "4.2.32",
901326
+ version: "4.2.33",
900923
901327
  output_style: {
900924
901328
  name: outputStyleName
900925
901329
  },
@@ -919535,7 +919939,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
919535
919939
  } catch {}
919536
919940
  const data = {
919537
919941
  trigger,
919538
- version: "4.2.32",
919942
+ version: "4.2.33",
919539
919943
  platform: process.platform,
919540
919944
  transcript,
919541
919945
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -920790,7 +921194,7 @@ function getReleaseType(current2, latest) {
920790
921194
  return "patch";
920791
921195
  }
920792
921196
  async function checkNewAutoUpdate(callbacks) {
920793
- const currentVersion = "4.2.32";
921197
+ const currentVersion = "4.2.33";
920794
921198
  logForDebugging(`[newAutoUpdater] checking, current: ${currentVersion}`);
920795
921199
  if (isNewAutoUpdaterDisabled()) {
920796
921200
  return { action: "skip", currentVersion, latestVersion: null };
@@ -933047,7 +933451,7 @@ function WelcomeV2() {
933047
933451
  dimColor: true,
933048
933452
  children: [
933049
933453
  "v",
933050
- "4.2.32",
933454
+ "4.2.33",
933051
933455
  " "
933052
933456
  ]
933053
933457
  })
@@ -933113,7 +933517,7 @@ function WelcomeV2() {
933113
933517
  dimColor: true,
933114
933518
  children: [
933115
933519
  "v",
933116
- "4.2.32",
933520
+ "4.2.33",
933117
933521
  " "
933118
933522
  ]
933119
933523
  })
@@ -933215,7 +933619,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
933215
933619
  dimColor: true,
933216
933620
  children: [
933217
933621
  "v",
933218
- "4.2.32",
933622
+ "4.2.33",
933219
933623
  " "
933220
933624
  ]
933221
933625
  })
@@ -933281,7 +933685,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
933281
933685
  dimColor: true,
933282
933686
  children: [
933283
933687
  "v",
933284
- "4.2.32",
933688
+ "4.2.33",
933285
933689
  " "
933286
933690
  ]
933287
933691
  })
@@ -934221,7 +934625,7 @@ function completeOnboarding() {
934221
934625
  saveGlobalConfig((current2) => ({
934222
934626
  ...current2,
934223
934627
  hasCompletedOnboarding: true,
934224
- lastOnboardingVersion: "4.2.32"
934628
+ lastOnboardingVersion: "4.2.33"
934225
934629
  }));
934226
934630
  }
934227
934631
  function showDialog(root9, renderer) {
@@ -950648,7 +951052,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
950648
951052
  setCwd(cwd3);
950649
951053
  const server2 = new Server({
950650
951054
  name: "claude/tengu",
950651
- version: "4.2.32"
951055
+ version: "4.2.33"
950652
951056
  }, {
950653
951057
  capabilities: {
950654
951058
  tools: {}
@@ -952933,7 +953337,7 @@ function createHealthRoutes(sessionManager) {
952933
953337
  const uptime2 = process.uptime() * 1000;
952934
953338
  return c10.json({
952935
953339
  status: "ok",
952936
- version: "4.2.32",
953340
+ version: "4.2.33",
952937
953341
  uptime_ms: Math.round(uptime2),
952938
953342
  active_sessions: sessionManager.getActiveCount()
952939
953343
  });
@@ -953205,7 +953609,7 @@ function getMacroDefines() {
953205
953609
  commit = execSync3("git rev-parse --short HEAD", { encoding: "utf-8", cwd: __dirname }).trim();
953206
953610
  } catch {}
953207
953611
  return {
953208
- "MACRO.VERSION": JSON.stringify("4.2.32"),
953612
+ "MACRO.VERSION": JSON.stringify("4.2.33"),
953209
953613
  "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
953210
953614
  "MACRO.COMMIT": JSON.stringify(commit),
953211
953615
  "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),
@@ -960274,7 +960678,7 @@ __export(exports_update, {
960274
960678
  });
960275
960679
  async function update() {
960276
960680
  logEvent("tengu_update_check", {});
960277
- writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.32"}
960681
+ writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.33"}
960278
960682
  `);
960279
960683
  const channel5 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
960280
960684
  writeToStdout(`${t("cli.update.checkingUpdates", { channel: channel5 }, "Checking for updates to {channel} version...")}
@@ -960349,8 +960753,8 @@ async function update() {
960349
960753
  writeToStdout(`${t("cli.update.managedByHomebrew", "CoStrict is managed by Homebrew.")}
960350
960754
  `);
960351
960755
  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}")}
960756
+ if (latest && !gte2("4.2.33", latest)) {
960757
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.33", latest }, "Update available: {current} \u2192 {latest}")}
960354
960758
  `);
960355
960759
  writeToStdout(`
960356
960760
  `);
@@ -960366,8 +960770,8 @@ async function update() {
960366
960770
  writeToStdout(`${t("cli.update.managedByWinget", "CoStrict is managed by winget.")}
960367
960771
  `);
960368
960772
  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}")}
960773
+ if (latest && !gte2("4.2.33", latest)) {
960774
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.33", latest }, "Update available: {current} \u2192 {latest}")}
960371
960775
  `);
960372
960776
  writeToStdout(`
960373
960777
  `);
@@ -960383,8 +960787,8 @@ async function update() {
960383
960787
  writeToStdout(`${t("cli.update.managedByApk", "CoStrict is managed by apk.")}
960384
960788
  `);
960385
960789
  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}")}
960790
+ if (latest && !gte2("4.2.33", latest)) {
960791
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.33", latest }, "Update available: {current} \u2192 {latest}")}
960388
960792
  `);
960389
960793
  writeToStdout(`
960390
960794
  `);
@@ -960449,11 +960853,11 @@ async function update() {
960449
960853
  `);
960450
960854
  await gracefulShutdown(1);
960451
960855
  }
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})")) + `
960856
+ if (result2.latestVersion === "4.2.33") {
960857
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.33" }, "CoStrict is up to date ({version})")) + `
960454
960858
  `);
960455
960859
  } 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}")) + `
960860
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.33", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960457
960861
  `);
960458
960862
  regenerateCompletionCache();
960459
960863
  }
@@ -960513,12 +960917,12 @@ async function update() {
960513
960917
  `);
960514
960918
  await gracefulShutdown(1);
960515
960919
  }
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})")) + `
960920
+ if (latestVersion === "4.2.33") {
960921
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.33" }, "CoStrict is up to date ({version})")) + `
960518
960922
  `);
960519
960923
  await gracefulShutdown(0);
960520
960924
  }
960521
- writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.32" }, "New version available: {latest} (current: {current})")}
960925
+ writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.33" }, "New version available: {latest} (current: {current})")}
960522
960926
  `);
960523
960927
  writeToStdout(`${t("cli.update.installing", "Installing update...")}
960524
960928
  `);
@@ -960563,7 +960967,7 @@ async function update() {
960563
960967
  logForDebugging(`update: Installation status: ${result.status}`);
960564
960968
  switch (result.status) {
960565
960969
  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}")) + `
960970
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.33", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
960567
960971
  `);
960568
960972
  regenerateCompletionCache();
960569
960973
  break;
@@ -962774,7 +963178,7 @@ ${assistantAddendum}` : assistantAddendum;
962774
963178
  }
962775
963179
  }
962776
963180
  logForDiagnosticsNoPII("info", "started", {
962777
- version: "4.2.32",
963181
+ version: "4.2.33",
962778
963182
  is_native_binary: isInBundledMode()
962779
963183
  });
962780
963184
  registerCleanup(async () => {
@@ -963265,7 +963669,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
963265
963669
  sshSession = await createSSHSession2({
963266
963670
  host: _pendingSSH.host,
963267
963671
  cwd: _pendingSSH.cwd,
963268
- localVersion: "4.2.32",
963672
+ localVersion: "4.2.33",
963269
963673
  permissionMode: _pendingSSH.permissionMode,
963270
963674
  dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
963271
963675
  extraCliArgs: _pendingSSH.extraCliArgs,
@@ -963734,7 +964138,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
963734
964138
  pendingHookMessages
963735
964139
  }, renderAndRun);
963736
964140
  }
963737
- }).version("4.2.32 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
964141
+ }).version("4.2.33 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
963738
964142
  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
964143
  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
964144
  if (canUserConfigureAdvisor()) {
@@ -964502,10 +964906,10 @@ function getCouncilArgs(args) {
964502
964906
  async function main2() {
964503
964907
  const args = process.argv.slice(2);
964504
964908
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
964505
- const d7 = new Date("2026-09-01T08:57:00.502Z");
964909
+ const d7 = new Date("2026-09-02T08:06:33.927Z");
964506
964910
  const p2 = (n3) => String(n3).padStart(2, "0");
964507
964911
  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})`);
964912
+ console.log(`${"4.2.33"} (commit: ${"844e26c1f"}, built: ${buildTime})`);
964509
964913
  return;
964510
964914
  }
964511
964915
  if (true) {
@@ -964704,5 +965108,5 @@ async function main2() {
964704
965108
  }
964705
965109
  main2();
964706
965110
 
964707
- //# debugId=762977BB961DE13464756E2164756E21
965111
+ //# debugId=ED1B42ACCE65670B64756E2164756E21
964708
965112