@costrict/csc 4.2.28 → 4.2.29

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
@@ -2577,8 +2577,8 @@ function getClientVersion() {
2577
2577
  if (cached)
2578
2578
  return cached;
2579
2579
  try {
2580
- if ("4.2.28") {
2581
- cached = "4.2.28";
2580
+ if ("4.2.29") {
2581
+ cached = "4.2.29";
2582
2582
  return cached;
2583
2583
  }
2584
2584
  } catch {}
@@ -222655,7 +222655,7 @@ async function fetchCoStrictModels(baseUrl, accessToken) {
222655
222655
  headers: {
222656
222656
  Authorization: `Bearer ${accessToken}`,
222657
222657
  Accept: "application/json",
222658
- "User-Agent": `csc/${"4.2.28"}`
222658
+ "User-Agent": `csc/${"4.2.29"}`
222659
222659
  },
222660
222660
  signal: controller.signal
222661
222661
  });
@@ -224695,7 +224695,7 @@ var init_auth7 = __esm(() => {
224695
224695
 
224696
224696
  // src/utils/userAgent.ts
224697
224697
  function getClaudeCodeUserAgent() {
224698
- return `costrict/${"4.2.28"}`;
224698
+ return `costrict/${"4.2.29"}`;
224699
224699
  }
224700
224700
 
224701
224701
  // src/utils/workloadContext.ts
@@ -224717,7 +224717,7 @@ function getUserAgent() {
224717
224717
  const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
224718
224718
  const workload = getWorkload();
224719
224719
  const workloadSuffix = workload ? `, workload/${workload}` : "";
224720
- return `csc/${"4.2.28"}`;
224720
+ return `csc/${"4.2.29"}`;
224721
224721
  }
224722
224722
  function getMCPUserAgent() {
224723
224723
  const parts = [];
@@ -224731,7 +224731,7 @@ function getMCPUserAgent() {
224731
224731
  parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
224732
224732
  }
224733
224733
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
224734
- return `csc/${"4.2.28"}${suffix}`;
224734
+ return `csc/${"4.2.29"}${suffix}`;
224735
224735
  }
224736
224736
  function getWebFetchUserAgent() {
224737
224737
  return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
@@ -224851,7 +224851,7 @@ var init_user = __esm(() => {
224851
224851
  deviceId,
224852
224852
  sessionId: getSessionId(),
224853
224853
  email: getEmail(),
224854
- appVersion: "4.2.28",
224854
+ appVersion: "4.2.29",
224855
224855
  platform: getHostPlatformForAnalytics(),
224856
224856
  organizationUuid,
224857
224857
  accountUuid,
@@ -235899,7 +235899,7 @@ var init_metadata = __esm(() => {
235899
235899
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
235900
235900
  WHITESPACE_REGEX = /\s+/;
235901
235901
  getVersionBase = memoize_default(() => {
235902
- const match = "4.2.28".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
235902
+ const match = "4.2.29".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
235903
235903
  return match ? match[0] : undefined;
235904
235904
  });
235905
235905
  buildEnvContext = memoize_default(async () => {
@@ -235939,9 +235939,9 @@ var init_metadata = __esm(() => {
235939
235939
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
235940
235940
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
235941
235941
  isClaudeAiAuth: isClaudeAISubscriber(),
235942
- version: "4.2.28",
235942
+ version: "4.2.29",
235943
235943
  versionBase: getVersionBase(),
235944
- buildTime: "2026-08-18T11:01:08.201Z",
235944
+ buildTime: "2026-08-24T01:42:33.096Z",
235945
235945
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
235946
235946
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
235947
235947
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -236612,7 +236612,7 @@ function initialize1PEventLogging() {
236612
236612
  const platform3 = getPlatform();
236613
236613
  const attributes = {
236614
236614
  [import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
236615
- [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.28"
236615
+ [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.29"
236616
236616
  };
236617
236617
  if (platform3 === "wsl") {
236618
236618
  const wslVersion = getWslVersion();
@@ -236639,7 +236639,7 @@ function initialize1PEventLogging() {
236639
236639
  })
236640
236640
  ]
236641
236641
  });
236642
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.28");
236642
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.29");
236643
236643
  }
236644
236644
  async function reinitialize1PEventLoggingIfConfigChanged() {
236645
236645
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -318296,6 +318296,7 @@ var init_tools3 = __esm(() => {
318296
318296
  SKILL_TOOL_NAME,
318297
318297
  SYNTHETIC_OUTPUT_TOOL_NAME,
318298
318298
  SEARCH_EXTRA_TOOLS_TOOL_NAME,
318299
+ EXECUTE_TOOL_NAME,
318299
318300
  ENTER_WORKTREE_TOOL_NAME,
318300
318301
  EXIT_WORKTREE_TOOL_NAME
318301
318302
  ]);
@@ -324849,7 +324850,7 @@ function clearSearchExtraToolsDescriptionCache() {
324849
324850
  getToolDescriptionMemoized.cache.clear?.();
324850
324851
  cachedDeferredToolNames = null;
324851
324852
  }
324852
- function buildSearchResult(matches, query3, totalDeferredTools, pendingMcpServers, alreadyLoaded, details) {
324853
+ function buildSearchResult(matches, query3, totalDeferredTools, pendingMcpServers, alreadyLoaded, details, executorAvailable) {
324853
324854
  return {
324854
324855
  data: {
324855
324856
  matches,
@@ -324857,7 +324858,8 @@ function buildSearchResult(matches, query3, totalDeferredTools, pendingMcpServer
324857
324858
  total_deferred_tools: totalDeferredTools,
324858
324859
  ...pendingMcpServers && pendingMcpServers.length > 0 ? { pending_mcp_servers: pendingMcpServers } : {},
324859
324860
  ...alreadyLoaded && alreadyLoaded.length > 0 ? { already_loaded: alreadyLoaded } : {},
324860
- ...details && details.length > 0 ? { details } : {}
324861
+ ...details && details.length > 0 ? { details } : {},
324862
+ ...executorAvailable !== undefined ? { executorAvailable } : {}
324861
324863
  }
324862
324864
  };
324863
324865
  }
@@ -324981,7 +324983,8 @@ var init_SearchExtraToolsTool = __esm(() => {
324981
324983
  description: exports_external.string(),
324982
324984
  score: exports_external.number(),
324983
324985
  inputSchema: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
324984
- })).optional()
324986
+ })).optional(),
324987
+ executorAvailable: exports_external.boolean().optional()
324985
324988
  }));
324986
324989
  getToolDescriptionMemoized = memoize_default(async (toolName, tools) => {
324987
324990
  const tool = findToolByName(tools, toolName);
@@ -325030,6 +325033,7 @@ var init_SearchExtraToolsTool = __esm(() => {
325030
325033
  const { query: query3, max_results = 5 } = input;
325031
325034
  const deferredTools = tools.filter(isDeferredTool);
325032
325035
  maybeInvalidateCache(deferredTools);
325036
+ const executorAvailable = findToolByName(tools, EXECUTE_TOOL_NAME) !== undefined;
325033
325037
  function getPendingServerNames() {
325034
325038
  const appState = getAppState();
325035
325039
  const pending = appState.mcp.clients.filter((c10) => c10.type === "pending");
@@ -325069,7 +325073,7 @@ var init_SearchExtraToolsTool = __esm(() => {
325069
325073
  logForDebugging(`SearchExtraToolsTool: select failed \u2014 none found: ${missing.join(", ")}`);
325070
325074
  logSearchOutcome([], "select");
325071
325075
  const pendingServers = getPendingServerNames();
325072
- return buildSearchResult([], query3, deferredTools.length, pendingServers);
325076
+ return buildSearchResult([], query3, deferredTools.length, pendingServers, undefined, undefined, executorAvailable);
325073
325077
  }
325074
325078
  if (missing.length > 0) {
325075
325079
  logForDebugging(`SearchExtraToolsTool: partial select \u2014 found: ${found.join(", ")}, missing: ${missing.join(", ")}`);
@@ -325088,7 +325092,7 @@ var init_SearchExtraToolsTool = __esm(() => {
325088
325092
  } : {}
325089
325093
  };
325090
325094
  }));
325091
- return buildSearchResult(found, query3, deferredTools.length, undefined, alreadyLoaded2.length > 0 ? alreadyLoaded2 : undefined, details);
325095
+ return buildSearchResult(found, query3, deferredTools.length, undefined, alreadyLoaded2.length > 0 ? alreadyLoaded2 : undefined, details, executorAvailable);
325092
325096
  }
325093
325097
  const discoverMatch = query3.match(/^discover:(.+)$/i);
325094
325098
  if (discoverMatch) {
@@ -325102,7 +325106,7 @@ var init_SearchExtraToolsTool = __esm(() => {
325102
325106
  ...r7.inputSchema ? { inputSchema: r7.inputSchema } : {}
325103
325107
  }));
325104
325108
  logSearchOutcome(tfIdfResults2.map((r7) => r7.name), "keyword");
325105
- return buildSearchResult(tfIdfResults2.map((r7) => r7.name), query3, deferredTools.length, undefined, undefined, details);
325109
+ return buildSearchResult(tfIdfResults2.map((r7) => r7.name), query3, deferredTools.length, undefined, undefined, details, executorAvailable);
325106
325110
  }
325107
325111
  const deferredToolNames = new Set(deferredTools.map((t2) => t2.name));
325108
325112
  const [keywordMatches, index2] = await Promise.all([
@@ -325136,9 +325140,9 @@ var init_SearchExtraToolsTool = __esm(() => {
325136
325140
  logSearchOutcome(matches, "keyword");
325137
325141
  if (matches.length === 0) {
325138
325142
  const pendingServers = getPendingServerNames();
325139
- return buildSearchResult(matches, query3, deferredTools.length, pendingServers);
325143
+ return buildSearchResult(matches, query3, deferredTools.length, pendingServers, undefined, undefined, executorAvailable);
325140
325144
  }
325141
- return buildSearchResult(matches, query3, deferredTools.length, undefined, alreadyLoaded.length > 0 ? alreadyLoaded : undefined, mcpDetails.length > 0 ? mcpDetails : undefined);
325145
+ return buildSearchResult(matches, query3, deferredTools.length, undefined, alreadyLoaded.length > 0 ? alreadyLoaded : undefined, mcpDetails.length > 0 ? mcpDetails : undefined, executorAvailable);
325142
325146
  },
325143
325147
  renderToolUseMessage(input) {
325144
325148
  if (!input.query)
@@ -325178,13 +325182,16 @@ Schema: ${renderSchema(d7.inputSchema)}`;
325178
325182
  return line;
325179
325183
  });
325180
325184
  const title = isDiscover ? `Found ${lines2.length} tool(s) matching your query:` : `Found ${lines2.length} deferred tool(s):`;
325185
+ const tail = content.executorAvailable === false ? `
325186
+
325187
+ ExecuteExtraTool is not available in your current tool list, so these deferred tools cannot be invoked here. Do not attempt to call them \u2014 proceed without them.` : `
325188
+
325189
+ Use ExecuteExtraTool with {"tool_name": "<name>", "params": {...}} to invoke any of these deferred tools, preserving the parameter types shown in its schema.`;
325181
325190
  const text3 = `${title}
325182
325191
 
325183
325192
  ` + lines2.join(`
325184
325193
 
325185
- `) + `
325186
-
325187
- Use ExecuteExtraTool with {"tool_name": "<name>", "params": {...}} to invoke any of these deferred tools, preserving the parameter types shown in its schema.`;
325194
+ `) + tail;
325188
325195
  return {
325189
325196
  type: "tool_result",
325190
325197
  tool_use_id: toolUseID,
@@ -325205,8 +325212,9 @@ Use ExecuteExtraTool with {"tool_name": "<name>", "params": {...}} to invoke any
325205
325212
  parts.push(`Already loaded as core tool(s): ${alreadyLoadedNames.join(", ")}. Call these directly using your normal tool interface \u2014 do NOT use ExecuteExtraTool for them.`);
325206
325213
  }
325207
325214
  if (deferredNames.length > 0) {
325215
+ const deferredTail = content.executorAvailable === false ? `However, ExecuteExtraTool is not available in your current tool list, so they cannot be invoked here. Do not attempt to call them \u2014 proceed without them.` : `Use ExecuteExtraTool with {"tool_name": "<name>", "params": {...}} to invoke any of these deferred tools.`;
325208
325216
  parts.push(`Found ${deferredNames.length} deferred tool(s): ${deferredNames.join(", ")}.` + `
325209
- Use ExecuteExtraTool with {"tool_name": "<name>", "params": {...}} to invoke any of these deferred tools.`);
325217
+ ${deferredTail}`);
325210
325218
  }
325211
325219
  const text2 = parts.join(`
325212
325220
  `);
@@ -326717,12 +326725,14 @@ async function* adaptOpenAIStreamToAnthropic(stream6, model) {
326717
326725
  const choice = chunk.choices?.[0];
326718
326726
  const delta = choice?.delta;
326719
326727
  if (chunk.usage) {
326720
- inputTokens = chunk.usage.prompt_tokens ?? inputTokens;
326721
- outputTokens = chunk.usage.completion_tokens ?? outputTokens;
326722
326728
  const details = chunk.usage.prompt_tokens_details;
326723
326729
  if (details?.cached_tokens != null) {
326724
326730
  cachedReadTokens = details.cached_tokens;
326725
326731
  }
326732
+ if (chunk.usage.prompt_tokens != null) {
326733
+ inputTokens = Math.max(chunk.usage.prompt_tokens - cachedReadTokens, 0);
326734
+ }
326735
+ outputTokens = chunk.usage.completion_tokens ?? outputTokens;
326726
326736
  }
326727
326737
  if (!started) {
326728
326738
  started = true;
@@ -435563,7 +435573,7 @@ function getTelemetryAttributes() {
435563
435573
  attributes["session.id"] = sessionId;
435564
435574
  }
435565
435575
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
435566
- attributes["app.version"] = "4.2.28";
435576
+ attributes["app.version"] = "4.2.29";
435567
435577
  }
435568
435578
  const oauthAccount = getOauthAccountInfo();
435569
435579
  if (oauthAccount) {
@@ -469083,7 +469093,7 @@ function initLangfuse() {
469083
469093
  flushInterval: parseInt(process.env.LANGFUSE_FLUSH_INTERVAL ?? "10", 10),
469084
469094
  mask: maskFn,
469085
469095
  environment: process.env.LANGFUSE_TRACING_ENVIRONMENT ?? "development",
469086
- release: "4.2.28",
469096
+ release: "4.2.29",
469087
469097
  exportMode: process.env.LANGFUSE_EXPORT_MODE ?? "batched",
469088
469098
  timeout: parseInt(process.env.LANGFUSE_TIMEOUT ?? "5", 10)
469089
469099
  });
@@ -500880,7 +500890,7 @@ function initSentry() {
500880
500890
  }
500881
500891
  init3({
500882
500892
  dsn,
500883
- release: typeof MACRO !== "undefined" ? "4.2.28" : undefined,
500893
+ release: typeof MACRO !== "undefined" ? "4.2.29" : undefined,
500884
500894
  environment: typeof BUILD_ENV !== "undefined" ? BUILD_ENV : "production",
500885
500895
  maxBreadcrumbs: 20,
500886
500896
  sampleRate: 1,
@@ -528777,7 +528787,7 @@ async function initializeBetaTracing(resource) {
528777
528787
  });
528778
528788
  logs.setGlobalLoggerProvider(loggerProvider);
528779
528789
  setLoggerProvider(loggerProvider);
528780
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.28");
528790
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.29");
528781
528791
  setEventLogger(eventLogger);
528782
528792
  process.on("beforeExit", async () => {
528783
528793
  await loggerProvider?.forceFlush();
@@ -528817,7 +528827,7 @@ async function initializeTelemetry() {
528817
528827
  const platform5 = getPlatform();
528818
528828
  const baseAttributes = {
528819
528829
  [import_semantic_conventions29.ATTR_SERVICE_NAME]: "claude-code",
528820
- [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.28"
528830
+ [import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.29"
528821
528831
  };
528822
528832
  if (platform5 === "wsl") {
528823
528833
  const wslVersion = getWslVersion();
@@ -528862,7 +528872,7 @@ async function initializeTelemetry() {
528862
528872
  } catch {}
528863
528873
  };
528864
528874
  registerCleanup(shutdownTelemetry2);
528865
- return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.28");
528875
+ return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.29");
528866
528876
  }
528867
528877
  const meterProvider = new import_sdk_metrics2.MeterProvider({
528868
528878
  resource,
@@ -528882,7 +528892,7 @@ async function initializeTelemetry() {
528882
528892
  });
528883
528893
  logs.setGlobalLoggerProvider(loggerProvider);
528884
528894
  setLoggerProvider(loggerProvider);
528885
- const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.28");
528895
+ const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.29");
528886
528896
  setEventLogger(eventLogger);
528887
528897
  logForDebugging("[3P telemetry] Event logger set successfully");
528888
528898
  process.on("beforeExit", async () => {
@@ -528944,7 +528954,7 @@ Current timeout: ${timeoutMs}ms
528944
528954
  }
528945
528955
  };
528946
528956
  registerCleanup(shutdownTelemetry);
528947
- return meterProvider.getMeter("com.anthropic.claude_code", "4.2.28");
528957
+ return meterProvider.getMeter("com.anthropic.claude_code", "4.2.29");
528948
528958
  }
528949
528959
  async function flushTelemetry() {
528950
528960
  const meterProvider = getMeterProvider();
@@ -530003,7 +530013,7 @@ async function installGlobalPackage(specificVersion) {
530003
530013
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
530004
530014
  logEvent("tengu_auto_updater_lock_contention", {
530005
530015
  pid: process.pid,
530006
- currentVersion: "4.2.28"
530016
+ currentVersion: "4.2.29"
530007
530017
  });
530008
530018
  return { status: "in_progress" };
530009
530019
  }
@@ -530012,7 +530022,7 @@ async function installGlobalPackage(specificVersion) {
530012
530022
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
530013
530023
  logError2(new Error("Windows NPM detected in WSL environment"));
530014
530024
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
530015
- currentVersion: "4.2.28"
530025
+ currentVersion: "4.2.29"
530016
530026
  });
530017
530027
  return {
530018
530028
  status: "install_failed",
@@ -530558,7 +530568,7 @@ function detectLinuxGlobPatternWarnings() {
530558
530568
  }
530559
530569
  async function getDoctorDiagnostic() {
530560
530570
  const installationType = await getCurrentInstallationType();
530561
- const version9 = typeof MACRO !== "undefined" ? "4.2.28" : "unknown";
530571
+ const version9 = typeof MACRO !== "undefined" ? "4.2.29" : "unknown";
530562
530572
  const installationPath = await getInstallationPath();
530563
530573
  const invokedBinary = getInvokedBinary();
530564
530574
  const multipleInstallations = await detectMultipleInstallations();
@@ -568745,7 +568755,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
568745
568755
  const client10 = new Client3({
568746
568756
  name: "claude-code",
568747
568757
  title: "CoStrict",
568748
- version: "4.2.28",
568758
+ version: "4.2.29",
568749
568759
  description: "CoStrict agentic coding tool",
568750
568760
  websiteUrl: PRODUCT_URL
568751
568761
  }, {
@@ -569116,7 +569126,7 @@ var init_client18 = __esm(() => {
569116
569126
  const client10 = new Client3({
569117
569127
  name: "claude-code",
569118
569128
  title: "CoStrict",
569119
- version: "4.2.28",
569129
+ version: "4.2.29",
569120
569130
  description: "CoStrict agentic coding tool",
569121
569131
  websiteUrl: PRODUCT_URL
569122
569132
  }, {
@@ -570506,7 +570516,7 @@ function getInstallationEnv() {
570506
570516
  return;
570507
570517
  }
570508
570518
  function getClaudeCodeVersion() {
570509
- return "4.2.28";
570519
+ return "4.2.29";
570510
570520
  }
570511
570521
  async function getInstalledVSCodeExtensionVersion(command4) {
570512
570522
  const { stdout } = await execFileNoThrow(command4, ["--list-extensions", "--show-versions"], {
@@ -571870,8 +571880,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
571870
571880
  const maxVersion = await getMaxVersion();
571871
571881
  if (maxVersion && gt(version10, maxVersion)) {
571872
571882
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version10} to ${maxVersion}`);
571873
- if (gte2("4.2.28", maxVersion)) {
571874
- logForDebugging(`Native installer: current version ${"4.2.28"} is already at or above maxVersion ${maxVersion}, skipping update`);
571883
+ if (gte2("4.2.29", maxVersion)) {
571884
+ logForDebugging(`Native installer: current version ${"4.2.29"} is already at or above maxVersion ${maxVersion}, skipping update`);
571875
571885
  logEvent("tengu_native_update_skipped_max_version", {
571876
571886
  latency_ms: Date.now() - startTime2,
571877
571887
  max_version: maxVersion,
@@ -571882,7 +571892,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
571882
571892
  version10 = maxVersion;
571883
571893
  }
571884
571894
  }
571885
- if (!forceReinstall && version10 === "4.2.28" && await versionIsAvailable(version10) && await isPossibleClaudeBinary(executablePath)) {
571895
+ if (!forceReinstall && version10 === "4.2.29" && await versionIsAvailable(version10) && await isPossibleClaudeBinary(executablePath)) {
571886
571896
  logForDebugging(`Found ${version10} at ${executablePath}, skipping install`);
571887
571897
  logEvent("tengu_native_update_complete", {
571888
571898
  latency_ms: Date.now() - startTime2,
@@ -683155,7 +683165,7 @@ async function* queryLoop(params, consumedCommandUuids) {
683155
683165
  }
683156
683166
  let withheld = false;
683157
683167
  if (false) {}
683158
- if (reactiveCompact?.isWithheldPromptTooLong(message2)) {
683168
+ if (querySource !== "compact" && querySource !== "session_memory" && reactiveCompact?.isWithheldPromptTooLong(message2)) {
683159
683169
  withheld = true;
683160
683170
  }
683161
683171
  if (mediaRecoveryEnabled && reactiveCompact?.isWithheldMediaSizeError(message2)) {
@@ -683291,7 +683301,7 @@ async function* queryLoop(params, consumedCommandUuids) {
683291
683301
  }
683292
683302
  if (!needsFollowUp) {
683293
683303
  const lastMessage = assistantMessages.at(-1);
683294
- const isWithheld413 = lastMessage?.type === "assistant" && lastMessage.isApiErrorMessage && isPromptTooLongMessage(lastMessage);
683304
+ const isWithheld413 = querySource !== "compact" && querySource !== "session_memory" && lastMessage?.type === "assistant" && lastMessage.isApiErrorMessage && isPromptTooLongMessage(lastMessage);
683295
683305
  const isWithheldMedia = mediaRecoveryEnabled && reactiveCompact?.isWithheldMediaSizeError(lastMessage);
683296
683306
  if (isWithheld413) {
683297
683307
  if (false) {}
@@ -686144,6 +686154,9 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
686144
686154
  if (isEnvTruthy(process.env.DISABLE_COMPACT)) {
686145
686155
  return { wasCompacted: false };
686146
686156
  }
686157
+ if (querySource === "compact" || querySource === "session_memory") {
686158
+ return { wasCompacted: false };
686159
+ }
686147
686160
  if (tracking?.consecutiveFailures !== undefined && tracking.consecutiveFailures >= MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES) {
686148
686161
  return { wasCompacted: false };
686149
686162
  }
@@ -700426,16 +700439,25 @@ var init_messages9 = __esm(() => {
700426
700439
  STRIPPED_TAGS_RE = /<(commit_analysis|context|function_analysis|pr_analysis)>.*?<\/\1>\n?/gs;
700427
700440
  });
700428
700441
 
700429
- // src/services/api/errors.ts
700430
- function startsWithApiErrorPrefix(text2) {
700431
- return text2.startsWith(API_ERROR_MESSAGE_PREFIX) || text2.startsWith(`Please run /login \xB7 ${API_ERROR_MESSAGE_PREFIX}`) || text2.startsWith(`Failed to authenticate. ${API_ERROR_MESSAGE_PREFIX}`) || text2.startsWith("CoStrict API Error") || text2.startsWith("Output truncated") || text2.startsWith("Model response error") || text2.startsWith("Task tool call failed") || text2.startsWith("Task checklist update failed");
700432
- }
700442
+ // src/services/api/promptTooLong.ts
700433
700443
  function isPromptTooLongErrorText(message2) {
700434
700444
  const lower = message2.toLowerCase();
700435
700445
  if (lower.includes("prompt is too long"))
700436
700446
  return true;
700437
700447
  return lower.includes("maximum context length") && lower.includes("token") && (lower.includes("requested") || lower.includes("exceeds") || lower.includes("reduce"));
700438
700448
  }
700449
+ function normalizePromptTooLongText(text2) {
700450
+ if (text2.startsWith(PROMPT_TOO_LONG_ERROR_MESSAGE)) {
700451
+ return text2;
700452
+ }
700453
+ return isPromptTooLongErrorText(text2) ? PROMPT_TOO_LONG_ERROR_MESSAGE : text2;
700454
+ }
700455
+ var PROMPT_TOO_LONG_ERROR_MESSAGE = "Prompt is too long";
700456
+
700457
+ // src/services/api/errors.ts
700458
+ function startsWithApiErrorPrefix(text2) {
700459
+ return text2.startsWith(API_ERROR_MESSAGE_PREFIX) || text2.startsWith(`Please run /login \xB7 ${API_ERROR_MESSAGE_PREFIX}`) || text2.startsWith(`Failed to authenticate. ${API_ERROR_MESSAGE_PREFIX}`) || text2.startsWith("CoStrict API Error") || text2.startsWith("Output truncated") || text2.startsWith("Model response error") || text2.startsWith("Task tool call failed") || text2.startsWith("Task checklist update failed");
700460
+ }
700439
700461
  function isPromptTooLongMessage(msg) {
700440
700462
  if (!msg.isApiErrorMessage) {
700441
700463
  return false;
@@ -701059,7 +701081,7 @@ function getErrorMessageIfRefusal(stopReason, model) {
701059
701081
  error: "invalid_request"
701060
701082
  });
701061
701083
  }
701062
- var API_ERROR_MESSAGE_PREFIX = "API Error", PROMPT_TOO_LONG_ERROR_MESSAGE = "Prompt is too long", CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE = "Credit balance is too low", INVALID_API_KEY_ERROR_MESSAGE = "Not logged in \xB7 Please run /login", INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL = "Invalid API key \xB7 Fix external API key", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH = "Your COSTRICT_API_KEY belongs to a disabled organization \xB7 Unset the environment variable to use your subscription instead", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY = "Your COSTRICT_API_KEY belongs to a disabled organization \xB7 Update or unset the environment variable", TOKEN_REVOKED_ERROR_MESSAGE = "OAuth token revoked \xB7 Please run /login", CCR_AUTH_ERROR_MESSAGE = "Authentication error \xB7 This may be a temporary network issue, please try again", REPEATED_529_ERROR_MESSAGE = "Repeated 529 Overloaded errors", CUSTOM_OFF_SWITCH_MESSAGE = "Opus is experiencing high load, please use /model to switch to Sonnet", API_TIMEOUT_ERROR_MESSAGE = "Request timed out", OAUTH_ORG_NOT_ALLOWED_ERROR_MESSAGE = "Your account does not have access to CoStrict. Please run /login.";
701084
+ var API_ERROR_MESSAGE_PREFIX = "API Error", CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE = "Credit balance is too low", INVALID_API_KEY_ERROR_MESSAGE = "Not logged in \xB7 Please run /login", INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL = "Invalid API key \xB7 Fix external API key", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH = "Your COSTRICT_API_KEY belongs to a disabled organization \xB7 Unset the environment variable to use your subscription instead", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY = "Your COSTRICT_API_KEY belongs to a disabled organization \xB7 Update or unset the environment variable", TOKEN_REVOKED_ERROR_MESSAGE = "OAuth token revoked \xB7 Please run /login", CCR_AUTH_ERROR_MESSAGE = "Authentication error \xB7 This may be a temporary network issue, please try again", REPEATED_529_ERROR_MESSAGE = "Repeated 529 Overloaded errors", CUSTOM_OFF_SWITCH_MESSAGE = "Opus is experiencing high load, please use /model to switch to Sonnet", API_TIMEOUT_ERROR_MESSAGE = "Request timed out", OAUTH_ORG_NOT_ALLOWED_ERROR_MESSAGE = "Your account does not have access to CoStrict. Please run /login.";
701063
701085
  var init_errors19 = __esm(() => {
701064
701086
  init_sdk();
701065
701087
  init_betas();
@@ -702217,6 +702239,28 @@ function getDenyRuleForTool(context40, tool) {
702217
702239
  function getAskRuleForTool(context40, tool) {
702218
702240
  return getAskRules(context40).find((rule) => toolMatchesRule(tool, rule)) || null;
702219
702241
  }
702242
+ function getProxyTargetRule(context40, tool, input4) {
702243
+ if (tool.name !== EXECUTE_TOOL_NAME) {
702244
+ return null;
702245
+ }
702246
+ const targetName = input4.tool_name;
702247
+ if (typeof targetName !== "string" || targetName === "") {
702248
+ return null;
702249
+ }
702250
+ if (targetName === EXECUTE_TOOL_NAME) {
702251
+ return null;
702252
+ }
702253
+ const target = { name: targetName };
702254
+ const denyRule = getDenyRuleForTool(context40, target);
702255
+ if (denyRule) {
702256
+ return { kind: "deny", rule: denyRule, targetName };
702257
+ }
702258
+ const allowRule = toolAlwaysAllowedRule(context40, target);
702259
+ if (allowRule) {
702260
+ return { kind: "allow", rule: allowRule, targetName };
702261
+ }
702262
+ return null;
702263
+ }
702220
702264
  function getDenyRuleForAgent(context40, agentToolName, agentType) {
702221
702265
  return getDenyRules(context40).find((rule) => rule.ruleValue.toolName === agentToolName && rule.ruleValue.ruleContent === agentType) || null;
702222
702266
  }
@@ -702365,6 +702409,17 @@ async function checkRuleBasedPermissions(tool, input4, context40) {
702365
702409
  message: `Permission to use ${tool.name} has been denied.`
702366
702410
  };
702367
702411
  }
702412
+ const proxyRule = getProxyTargetRule(appState.toolPermissionContext, tool, input4);
702413
+ if (proxyRule?.kind === "deny") {
702414
+ return {
702415
+ behavior: "deny",
702416
+ decisionReason: {
702417
+ type: "rule",
702418
+ rule: proxyRule.rule
702419
+ },
702420
+ message: `Permission to use ${proxyRule.targetName} has been denied.`
702421
+ };
702422
+ }
702368
702423
  const askRule = getAskRuleForTool(appState.toolPermissionContext, tool);
702369
702424
  if (askRule) {
702370
702425
  const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME && SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input4);
@@ -702420,6 +702475,17 @@ async function hasPermissionsToUseToolInner(tool, input4, context40) {
702420
702475
  message: `Permission to use ${tool.name} has been denied.`
702421
702476
  };
702422
702477
  }
702478
+ const proxyTargetRule = getProxyTargetRule(appState.toolPermissionContext, tool, input4);
702479
+ if (proxyTargetRule?.kind === "deny") {
702480
+ return {
702481
+ behavior: "deny",
702482
+ decisionReason: {
702483
+ type: "rule",
702484
+ rule: proxyTargetRule.rule
702485
+ },
702486
+ message: `Permission to use ${proxyTargetRule.targetName} has been denied.`
702487
+ };
702488
+ }
702423
702489
  const askRule = getAskRuleForTool(appState.toolPermissionContext, tool);
702424
702490
  if (askRule) {
702425
702491
  const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME && SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input4);
@@ -702509,7 +702575,7 @@ async function hasPermissionsToUseToolInner(tool, input4, context40) {
702509
702575
  }
702510
702576
  };
702511
702577
  }
702512
- const alwaysAllowedRule = toolAlwaysAllowedRule(appState.toolPermissionContext, tool);
702578
+ const alwaysAllowedRule = toolAlwaysAllowedRule(appState.toolPermissionContext, tool) || (proxyTargetRule?.kind === "allow" ? proxyTargetRule.rule : null);
702513
702579
  if (alwaysAllowedRule) {
702514
702580
  return {
702515
702581
  behavior: "allow",
@@ -709985,7 +710051,7 @@ function Feedback({
709985
710051
  platform: env4.platform,
709986
710052
  gitRepo: envInfo.isGit,
709987
710053
  terminal: env4.terminal,
709988
- version: "4.2.28",
710054
+ version: "4.2.29",
709989
710055
  transcript: normalizeMessagesForAPI(messages),
709990
710056
  errors: sanitizedErrors,
709991
710057
  lastApiRequest: getLastAPIRequest(),
@@ -710168,7 +710234,7 @@ function Feedback({
710168
710234
  ", ",
710169
710235
  env4.terminal,
710170
710236
  ", v",
710171
- "4.2.28"
710237
+ "4.2.29"
710172
710238
  ]
710173
710239
  })
710174
710240
  ]
@@ -710265,7 +710331,7 @@ ${sanitizedDescription}
710265
710331
  ` + `**Environment Info**
710266
710332
  ` + `- Platform: ${env4.platform}
710267
710333
  ` + `- Terminal: ${env4.terminal}
710268
- ` + `- Version: ${"4.2.28"}
710334
+ ` + `- Version: ${"4.2.29"}
710269
710335
  ` + `- Feedback ID: ${feedbackId}
710270
710336
  ` + `
710271
710337
  **Errors**
@@ -712504,7 +712570,7 @@ function buildPrimarySection() {
712504
712570
  children: t("settings.status.renameHint")
712505
712571
  });
712506
712572
  return [
712507
- { label: t("settings.status.version"), value: "4.2.28" },
712573
+ { label: t("settings.status.version"), value: "4.2.29" },
712508
712574
  { label: t("settings.status.sessionName"), value: nameValue },
712509
712575
  { label: t("settings.status.sessionId"), value: sessionId },
712510
712576
  { label: t("settings.status.cwd"), value: getCwd() },
@@ -715365,7 +715431,7 @@ function Config({
715365
715431
  }
715366
715432
  })
715367
715433
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime191.jsx(ChannelDowngradeDialog, {
715368
- currentVersion: "4.2.28",
715434
+ currentVersion: "4.2.29",
715369
715435
  onChoice: (choice) => {
715370
715436
  setShowSubmenu(null);
715371
715437
  setTabsHidden(false);
@@ -715377,7 +715443,7 @@ function Config({
715377
715443
  autoUpdatesChannel: "stable"
715378
715444
  };
715379
715445
  if (choice === "stay") {
715380
- newSettings.minimumVersion = "4.2.28";
715446
+ newSettings.minimumVersion = "4.2.29";
715381
715447
  }
715382
715448
  updateSettingsForSource("userSettings", newSettings);
715383
715449
  setSettingsData((prev) => ({
@@ -720846,7 +720912,7 @@ function HelpV2({ onClose, commands: commands11 }) {
720846
720912
  color: "professionalBlue",
720847
720913
  children: [
720848
720914
  /* @__PURE__ */ jsx_runtime218.jsx(Tabs, {
720849
- title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.28"}`,
720915
+ title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.29"}`,
720850
720916
  color: "professionalBlue",
720851
720917
  defaultTab: "general",
720852
720918
  children: tabs
@@ -743908,7 +743974,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
743908
743974
  return [];
743909
743975
  }
743910
743976
  }
743911
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.28") {
743977
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.29") {
743912
743978
  if (process.env.USER_TYPE === "sf") {
743913
743979
  const changelog = "";
743914
743980
  if (changelog) {
@@ -743935,7 +744001,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.28")
743935
744001
  releaseNotes
743936
744002
  };
743937
744003
  }
743938
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.28") {
744004
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.29") {
743939
744005
  if (process.env.USER_TYPE === "sf") {
743940
744006
  const changelog = "";
743941
744007
  if (changelog) {
@@ -746448,7 +746514,7 @@ function isNotLoggedIn() {
746448
746514
  return true;
746449
746515
  }
746450
746516
  function getLogoDisplayData() {
746451
- const version10 = process.env.DEMO_VERSION ?? "4.2.28";
746517
+ const version10 = process.env.DEMO_VERSION ?? "4.2.29";
746452
746518
  const serverUrl = getDirectConnectServerUrl();
746453
746519
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
746454
746520
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -747026,7 +747092,7 @@ var init_MatrixMessageLine = __esm(() => {
747026
747092
  // src/components/matrix-tactical/MatrixWelcome.tsx
747027
747093
  import { basename as basename47 } from "path";
747028
747094
  function MatrixWelcome({
747029
- version: version10 = "4.2.28",
747095
+ version: version10 = "4.2.29",
747030
747096
  projectName,
747031
747097
  cwd: cwd2,
747032
747098
  modelDisplayName,
@@ -747661,13 +747727,13 @@ function LogoV2() {
747661
747727
  const { hasReleaseNotes } = checkForReleaseNotesSync(config13.lastReleaseNotesSeen);
747662
747728
  import_react167.useEffect(() => {
747663
747729
  const currentConfig = getGlobalConfig();
747664
- if (currentConfig.lastReleaseNotesSeen === "4.2.28") {
747730
+ if (currentConfig.lastReleaseNotesSeen === "4.2.29") {
747665
747731
  return;
747666
747732
  }
747667
747733
  saveGlobalConfig((current2) => {
747668
- if (current2.lastReleaseNotesSeen === "4.2.28")
747734
+ if (current2.lastReleaseNotesSeen === "4.2.29")
747669
747735
  return current2;
747670
- return { ...current2, lastReleaseNotesSeen: "4.2.28" };
747736
+ return { ...current2, lastReleaseNotesSeen: "4.2.29" };
747671
747737
  });
747672
747738
  if (showOnboarding) {
747673
747739
  incrementProjectOnboardingSeenCount();
@@ -770197,7 +770263,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
770197
770263
  smapsRollup,
770198
770264
  platform: process.platform,
770199
770265
  nodeVersion: process.version,
770200
- ccVersion: "4.2.28"
770266
+ ccVersion: "4.2.29"
770201
770267
  };
770202
770268
  }
770203
770269
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -770313,7 +770379,7 @@ var init_mock_limits = __esm(() => {
770313
770379
  var call55 = async () => {
770314
770380
  return {
770315
770381
  type: "text",
770316
- value: `${"4.2.28"} (built ${"2026-08-18T11:01:08.201Z"})`
770382
+ value: `${"4.2.29"} (built ${"2026-08-24T01:42:33.096Z"})`
770317
770383
  };
770318
770384
  }, version10, version_default;
770319
770385
  var init_version2 = __esm(() => {
@@ -788459,7 +788525,7 @@ function generateHtmlReport(data, insights) {
788459
788525
  </html>`;
788460
788526
  }
788461
788527
  function buildExportData(data, insights, facets, remoteStats) {
788462
- const version11 = typeof MACRO !== "undefined" ? "4.2.28" : "unknown";
788528
+ const version11 = typeof MACRO !== "undefined" ? "4.2.29" : "unknown";
788463
788529
  const remote_hosts_collected = remoteStats?.hosts.filter((h8) => h8.sessionCount > 0).map((h8) => h8.name);
788464
788530
  const facets_summary = {
788465
788531
  total: facets.size,
@@ -792909,7 +792975,7 @@ var init_sessionStorage = __esm(() => {
792909
792975
  init_settings2();
792910
792976
  init_slowOperations();
792911
792977
  init_uuid();
792912
- VERSION11 = typeof MACRO !== "undefined" ? "4.2.28" : "unknown";
792978
+ VERSION11 = typeof MACRO !== "undefined" ? "4.2.29" : "unknown";
792913
792979
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
792914
792980
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
792915
792981
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -794250,7 +794316,7 @@ var init_filesystem = __esm(() => {
794250
794316
  });
794251
794317
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
794252
794318
  const nonce = randomBytes24(16).toString("hex");
794253
- return join204(getCostrictTempDir(), "bundled-skills", "4.2.28", nonce);
794319
+ return join204(getCostrictTempDir(), "bundled-skills", "4.2.29", nonce);
794254
794320
  });
794255
794321
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
794256
794322
  });
@@ -800520,7 +800586,7 @@ function computeFingerprint(messageText, version11) {
800520
800586
  }
800521
800587
  function computeFingerprintFromMessages(messages) {
800522
800588
  const firstMessageText = extractFirstMessageText(messages);
800523
- return computeFingerprint(firstMessageText, "4.2.28");
800589
+ return computeFingerprint(firstMessageText, "4.2.29");
800524
800590
  }
800525
800591
  var FINGERPRINT_SALT = "59cf53e54c78";
800526
800592
  var init_fingerprint = () => {};
@@ -800930,7 +800996,7 @@ function getAnthropicEnvMetadata() {
800930
800996
  function getBuildAgeMinutes() {
800931
800997
  if (false)
800932
800998
  ;
800933
- const buildTime = new Date("2026-08-18T11:01:08.201Z").getTime();
800999
+ const buildTime = new Date("2026-08-24T01:42:33.096Z").getTime();
800934
801000
  if (isNaN(buildTime))
800935
801001
  return;
800936
801002
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -802706,9 +802772,10 @@ async function* queryModelOpenAI(messages, systemPrompt2, tools, signal, options
802706
802772
  const errorMessage2 = error100 instanceof Error ? error100.message : String(error100);
802707
802773
  logForDebugging(`[OpenAI] Error: ${errorMessage2}`, { level: "error" });
802708
802774
  yield createAssistantAPIErrorMessage({
802709
- content: `API Error: ${errorMessage2}`,
802775
+ content: normalizePromptTooLongText(`API Error: ${errorMessage2}`),
802710
802776
  apiError: "api_error",
802711
- error: error100 instanceof Error ? error100 : new Error(String(error100))
802777
+ error: error100 instanceof Error ? error100 : new Error(String(error100)),
802778
+ errorDetails: errorMessage2
802712
802779
  });
802713
802780
  }
802714
802781
  }
@@ -804318,9 +804385,10 @@ async function* queryModelCoStrict(messages, systemPrompt2, tools, signal, optio
804318
804385
  const errorMsg = error100 instanceof Error ? error100.message : String(error100);
804319
804386
  logForDebugging(`[CoStrict] Error: ${errorMsg}`, { level: "error" });
804320
804387
  yield createAssistantAPIErrorMessage({
804321
- content: isNonMultimodalModelError(errorMsg) ? "CoStrict API Error: The current model does not support image input. Switch to a multimodal or vision-capable model and try again." : `CoStrict API Error: ${errorMsg}`,
804388
+ content: isNonMultimodalModelError(errorMsg) ? "CoStrict API Error: The current model does not support image input. Switch to a multimodal or vision-capable model and try again." : normalizePromptTooLongText(`CoStrict API Error: ${errorMsg}`),
804322
804389
  apiError: isNonMultimodalModelError(errorMsg) ? "non_multimodal_model" : "api_error",
804323
- error: mapErrorToSDKError(error100)
804390
+ error: mapErrorToSDKError(error100),
804391
+ errorDetails: errorMsg
804324
804392
  });
804325
804393
  }
804326
804394
  }
@@ -806498,7 +806566,7 @@ async function sideQuery(opts) {
806498
806566
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
806499
806567
  }
806500
806568
  const messageText = extractFirstUserMessageText(messages);
806501
- const fingerprint = computeFingerprint(messageText, "4.2.28");
806569
+ const fingerprint = computeFingerprint(messageText, "4.2.29");
806502
806570
  const attributionHeader = getAttributionHeader(fingerprint);
806503
806571
  const systemBlocks = [
806504
806572
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -809894,7 +809962,7 @@ function buildSystemInitMessage(inputs) {
809894
809962
  slash_commands: inputs.commands.filter((c10) => c10.userInvocable !== false).map((c10) => c10.name),
809895
809963
  apiKeySource: getAnthropicApiKeyWithSource().source,
809896
809964
  betas: getSdkBetas(),
809897
- claude_code_version: "4.2.28",
809965
+ claude_code_version: "4.2.29",
809898
809966
  output_style: outputStyle2,
809899
809967
  agents: inputs.agents.map((agent) => agent.agentType),
809900
809968
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -813438,7 +813506,7 @@ function appendToLog(path58, message2) {
813438
813506
  cwd: getFsImplementation().cwd(),
813439
813507
  userType: process.env.USER_TYPE,
813440
813508
  sessionId: getSessionId(),
813441
- version: "4.2.28"
813509
+ version: "4.2.29"
813442
813510
  };
813443
813511
  getLogWriter(path58).write(messageWithTimestamp);
813444
813512
  }
@@ -834499,7 +834567,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
834499
834567
  project_dir: getOriginalCwd(),
834500
834568
  added_dirs: addedDirs
834501
834569
  },
834502
- version: "4.2.28",
834570
+ version: "4.2.29",
834503
834571
  output_style: {
834504
834572
  name: outputStyleName
834505
834573
  },
@@ -853128,7 +853196,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
853128
853196
  } catch {}
853129
853197
  const data = {
853130
853198
  trigger,
853131
- version: "4.2.28",
853199
+ version: "4.2.29",
853132
853200
  platform: process.platform,
853133
853201
  transcript,
853134
853202
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -854383,7 +854451,7 @@ function getReleaseType(current2, latest) {
854383
854451
  return "patch";
854384
854452
  }
854385
854453
  async function checkNewAutoUpdate(callbacks) {
854386
- const currentVersion = "4.2.28";
854454
+ const currentVersion = "4.2.29";
854387
854455
  logForDebugging(`[newAutoUpdater] checking, current: ${currentVersion}`);
854388
854456
  if (isNewAutoUpdaterDisabled()) {
854389
854457
  return { action: "skip", currentVersion, latestVersion: null };
@@ -866638,7 +866706,7 @@ function WelcomeV2() {
866638
866706
  dimColor: true,
866639
866707
  children: [
866640
866708
  "v",
866641
- "4.2.28",
866709
+ "4.2.29",
866642
866710
  " "
866643
866711
  ]
866644
866712
  })
@@ -866704,7 +866772,7 @@ function WelcomeV2() {
866704
866772
  dimColor: true,
866705
866773
  children: [
866706
866774
  "v",
866707
- "4.2.28",
866775
+ "4.2.29",
866708
866776
  " "
866709
866777
  ]
866710
866778
  })
@@ -866806,7 +866874,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
866806
866874
  dimColor: true,
866807
866875
  children: [
866808
866876
  "v",
866809
- "4.2.28",
866877
+ "4.2.29",
866810
866878
  " "
866811
866879
  ]
866812
866880
  })
@@ -866872,7 +866940,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
866872
866940
  dimColor: true,
866873
866941
  children: [
866874
866942
  "v",
866875
- "4.2.28",
866943
+ "4.2.29",
866876
866944
  " "
866877
866945
  ]
866878
866946
  })
@@ -867812,7 +867880,7 @@ function completeOnboarding() {
867812
867880
  saveGlobalConfig((current2) => ({
867813
867881
  ...current2,
867814
867882
  hasCompletedOnboarding: true,
867815
- lastOnboardingVersion: "4.2.28"
867883
+ lastOnboardingVersion: "4.2.29"
867816
867884
  }));
867817
867885
  }
867818
867886
  function showDialog(root9, renderer) {
@@ -882941,7 +883009,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
882941
883009
  setCwd(cwd3);
882942
883010
  const server2 = new Server({
882943
883011
  name: "claude/tengu",
882944
- version: "4.2.28"
883012
+ version: "4.2.29"
882945
883013
  }, {
882946
883014
  capabilities: {
882947
883015
  tools: {}
@@ -885226,7 +885294,7 @@ function createHealthRoutes(sessionManager) {
885226
885294
  const uptime2 = process.uptime() * 1000;
885227
885295
  return c10.json({
885228
885296
  status: "ok",
885229
- version: "4.2.28",
885297
+ version: "4.2.29",
885230
885298
  uptime_ms: Math.round(uptime2),
885231
885299
  active_sessions: sessionManager.getActiveCount()
885232
885300
  });
@@ -885498,7 +885566,7 @@ function getMacroDefines() {
885498
885566
  commit = execSync3("git rev-parse --short HEAD", { encoding: "utf-8", cwd: __dirname }).trim();
885499
885567
  } catch {}
885500
885568
  return {
885501
- "MACRO.VERSION": JSON.stringify("4.2.28"),
885569
+ "MACRO.VERSION": JSON.stringify("4.2.29"),
885502
885570
  "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
885503
885571
  "MACRO.COMMIT": JSON.stringify(commit),
885504
885572
  "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),
@@ -892566,7 +892634,7 @@ __export(exports_update, {
892566
892634
  });
892567
892635
  async function update() {
892568
892636
  logEvent("tengu_update_check", {});
892569
- writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.28"}
892637
+ writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.29"}
892570
892638
  `);
892571
892639
  const channel5 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
892572
892640
  writeToStdout(`${t("cli.update.checkingUpdates", { channel: channel5 }, "Checking for updates to {channel} version...")}
@@ -892641,8 +892709,8 @@ async function update() {
892641
892709
  writeToStdout(`${t("cli.update.managedByHomebrew", "CoStrict is managed by Homebrew.")}
892642
892710
  `);
892643
892711
  const latest = await getLatestVersion(channel5);
892644
- if (latest && !gte2("4.2.28", latest)) {
892645
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.28", latest }, "Update available: {current} \u2192 {latest}")}
892712
+ if (latest && !gte2("4.2.29", latest)) {
892713
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.29", latest }, "Update available: {current} \u2192 {latest}")}
892646
892714
  `);
892647
892715
  writeToStdout(`
892648
892716
  `);
@@ -892658,8 +892726,8 @@ async function update() {
892658
892726
  writeToStdout(`${t("cli.update.managedByWinget", "CoStrict is managed by winget.")}
892659
892727
  `);
892660
892728
  const latest = await getLatestVersion(channel5);
892661
- if (latest && !gte2("4.2.28", latest)) {
892662
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.28", latest }, "Update available: {current} \u2192 {latest}")}
892729
+ if (latest && !gte2("4.2.29", latest)) {
892730
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.29", latest }, "Update available: {current} \u2192 {latest}")}
892663
892731
  `);
892664
892732
  writeToStdout(`
892665
892733
  `);
@@ -892675,8 +892743,8 @@ async function update() {
892675
892743
  writeToStdout(`${t("cli.update.managedByApk", "CoStrict is managed by apk.")}
892676
892744
  `);
892677
892745
  const latest = await getLatestVersion(channel5);
892678
- if (latest && !gte2("4.2.28", latest)) {
892679
- writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.28", latest }, "Update available: {current} \u2192 {latest}")}
892746
+ if (latest && !gte2("4.2.29", latest)) {
892747
+ writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.29", latest }, "Update available: {current} \u2192 {latest}")}
892680
892748
  `);
892681
892749
  writeToStdout(`
892682
892750
  `);
@@ -892741,11 +892809,11 @@ async function update() {
892741
892809
  `);
892742
892810
  await gracefulShutdown(1);
892743
892811
  }
892744
- if (result2.latestVersion === "4.2.28") {
892745
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.28" }, "CoStrict is up to date ({version})")) + `
892812
+ if (result2.latestVersion === "4.2.29") {
892813
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.29" }, "CoStrict is up to date ({version})")) + `
892746
892814
  `);
892747
892815
  } else {
892748
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.28", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
892816
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.29", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
892749
892817
  `);
892750
892818
  regenerateCompletionCache();
892751
892819
  }
@@ -892805,12 +892873,12 @@ async function update() {
892805
892873
  `);
892806
892874
  await gracefulShutdown(1);
892807
892875
  }
892808
- if (latestVersion === "4.2.28") {
892809
- writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.28" }, "CoStrict is up to date ({version})")) + `
892876
+ if (latestVersion === "4.2.29") {
892877
+ writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.29" }, "CoStrict is up to date ({version})")) + `
892810
892878
  `);
892811
892879
  await gracefulShutdown(0);
892812
892880
  }
892813
- writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.28" }, "New version available: {latest} (current: {current})")}
892881
+ writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.29" }, "New version available: {latest} (current: {current})")}
892814
892882
  `);
892815
892883
  writeToStdout(`${t("cli.update.installing", "Installing update...")}
892816
892884
  `);
@@ -892855,7 +892923,7 @@ async function update() {
892855
892923
  logForDebugging(`update: Installation status: ${result.status}`);
892856
892924
  switch (result.status) {
892857
892925
  case "success":
892858
- writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.28", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
892926
+ writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.29", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
892859
892927
  `);
892860
892928
  regenerateCompletionCache();
892861
892929
  break;
@@ -895059,7 +895127,7 @@ ${assistantAddendum}` : assistantAddendum;
895059
895127
  }
895060
895128
  }
895061
895129
  logForDiagnosticsNoPII("info", "started", {
895062
- version: "4.2.28",
895130
+ version: "4.2.29",
895063
895131
  is_native_binary: isInBundledMode()
895064
895132
  });
895065
895133
  registerCleanup(async () => {
@@ -895550,7 +895618,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
895550
895618
  sshSession = await createSSHSession2({
895551
895619
  host: _pendingSSH.host,
895552
895620
  cwd: _pendingSSH.cwd,
895553
- localVersion: "4.2.28",
895621
+ localVersion: "4.2.29",
895554
895622
  permissionMode: _pendingSSH.permissionMode,
895555
895623
  dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
895556
895624
  extraCliArgs: _pendingSSH.extraCliArgs,
@@ -896019,7 +896087,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
896019
896087
  pendingHookMessages
896020
896088
  }, renderAndRun);
896021
896089
  }
896022
- }).version("4.2.28 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
896090
+ }).version("4.2.29 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
896023
896091
  program2.addOption(new Option("-w, --worktree [name]", cliDesc("cli.option.worktree", "Create a new git worktree for this session (optionally specify a name)")).hideHelp());
896024
896092
  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());
896025
896093
  if (canUserConfigureAdvisor()) {
@@ -896762,10 +896830,10 @@ if (process.env.CLAUDE_CODE_REMOTE === "true") {
896762
896830
  async function main2() {
896763
896831
  const args = process.argv.slice(2);
896764
896832
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
896765
- const d7 = new Date("2026-08-18T11:01:08.201Z");
896833
+ const d7 = new Date("2026-08-24T01:42:33.096Z");
896766
896834
  const p2 = (n3) => String(n3).padStart(2, "0");
896767
896835
  const buildTime = `${d7.getFullYear()}/${p2(d7.getMonth() + 1)}/${p2(d7.getDate())} ${p2(d7.getHours())}:${p2(d7.getMinutes())}:${p2(d7.getSeconds())}`;
896768
- console.log(`${"4.2.28"} (commit: ${"b8db0d23a"}, built: ${buildTime})`);
896836
+ console.log(`${"4.2.29"} (commit: ${"47a51c48a"}, built: ${buildTime})`);
896769
896837
  return;
896770
896838
  }
896771
896839
  if (args[0] === "git-credential") {
@@ -896946,5 +897014,5 @@ async function main2() {
896946
897014
  }
896947
897015
  main2();
896948
897016
 
896949
- //# debugId=37B6B1EB0B1A78C264756E2164756E21
897017
+ //# debugId=D200B00F02B08BED64756E2164756E21
896950
897018
 
@@ -736,8 +736,8 @@ function getClientVersion() {
736
736
  if (cached)
737
737
  return cached;
738
738
  try {
739
- if ("4.2.28") {
740
- cached = "4.2.28";
739
+ if ("4.2.29") {
740
+ cached = "4.2.29";
741
741
  return cached;
742
742
  }
743
743
  } catch {}
@@ -138570,7 +138570,7 @@ var init_user = __esm(() => {
138570
138570
  deviceId,
138571
138571
  sessionId: getSessionId(),
138572
138572
  email: getEmail(),
138573
- appVersion: "4.2.28",
138573
+ appVersion: "4.2.29",
138574
138574
  platform: getHostPlatformForAnalytics(),
138575
138575
  organizationUuid,
138576
138576
  accountUuid,
@@ -138857,7 +138857,7 @@ var init_metadata = __esm(() => {
138857
138857
  "sed"
138858
138858
  ]);
138859
138859
  getVersionBase = memoize_default(() => {
138860
- const match = "4.2.28".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
138860
+ const match = "4.2.29".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
138861
138861
  return match ? match[0] : undefined;
138862
138862
  });
138863
138863
  buildEnvContext = memoize_default(async () => {
@@ -138897,9 +138897,9 @@ var init_metadata = __esm(() => {
138897
138897
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
138898
138898
  isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
138899
138899
  isClaudeAiAuth: isClaudeAISubscriber(),
138900
- version: "4.2.28",
138900
+ version: "4.2.29",
138901
138901
  versionBase: getVersionBase(),
138902
- buildTime: "2026-08-18T11:01:10.342Z",
138902
+ buildTime: "2026-08-24T01:42:34.935Z",
138903
138903
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
138904
138904
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
138905
138905
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -143237,5 +143237,5 @@ export {
143237
143237
  isParentHeartbeatValid
143238
143238
  };
143239
143239
 
143240
- //# debugId=06C0F8C85F4ECBE064756E2164756E21
143240
+ //# debugId=ADEDB9641343B30B64756E2164756E21
143241
143241
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@costrict/csc",
3
- "version": "4.2.28",
3
+ "version": "4.2.29",
4
4
  "description": "costrict",
5
5
  "type": "module",
6
6
  "author": "costrict",
@@ -36,7 +36,7 @@
36
36
  "scripts/postinstall.cjs",
37
37
  "scripts/run-parallel.mjs",
38
38
  "scripts/setup-chrome-mcp.mjs",
39
- "scripts/install-cosknow.mjs"
39
+ "scripts/cleanup-cosknow.mjs"
40
40
  ],
41
41
  "scripts": {
42
42
  "build": "bun run build.ts",
@@ -74,7 +74,7 @@
74
74
  "test": "bun test",
75
75
  "check:unused": "knip-bun",
76
76
  "health": "bun run scripts/health-check.ts",
77
- "postinstall": "node scripts/run-parallel.mjs scripts/postinstall.cjs scripts/setup-chrome-mcp.mjs scripts/install-cosknow.mjs",
77
+ "postinstall": "node scripts/run-parallel.mjs scripts/postinstall.cjs scripts/setup-chrome-mcp.mjs scripts/cleanup-cosknow.mjs",
78
78
  "docs:dev": "npx mintlify dev",
79
79
  "typecheck": "tsc --noEmit",
80
80
  "rcs": "bun run scripts/rcs.ts",
@@ -0,0 +1,150 @@
1
+ import { existsSync, readFileSync } from 'node:fs'
2
+ import { readdir, rm } from 'node:fs/promises'
3
+ import { homedir } from 'node:os'
4
+ import { join } from 'node:path'
5
+
6
+ // 清理 csc postinstall 时期安装的 CosKnow kb 命令(v1 集成产物)。
7
+ // 现在不再自动安装 cosknow,此脚本负责把历史遗留的文件移除。
8
+ // 清理范围覆盖两个可能的 commands 目录:
9
+ // - ~/.claude/commands/ (v1 安装器当时的写入位置)
10
+ // - ~/.costrict/commands/ (品牌合规后的主配置目录)
11
+ // 每个目录内的删除范围:
12
+ // 1. .cosknow-manifest.json 中 files 列出的所有文件(权威依据)
13
+ // 2. 兜底:commands 目录下所有 kb-*.md(manifest 缺失或未列出时)
14
+ // 3. linter/kb-linter.js、prompts/ 子目录(v1 includeResources 复制产物)
15
+ // 4. .cosknow-manifest.json 本身
16
+ // 注意:不清理 ~/.costrict/cosknow/ 下的运行数据目录(statusline 等)。
17
+ // 任何失败都是非致命的:warn 后 exit 0,绝不影响 csc 安装/更新。
18
+
19
+ const MANIFEST_FILE = '.cosknow-manifest.json'
20
+ const TARGET_DIRS = [
21
+ join(homedir(), '.claude', 'commands'),
22
+ join(homedir(), '.costrict', 'commands'),
23
+ ]
24
+
25
+ function log(msg) {
26
+ console.log(`[cosknow-cleanup] ${msg}`)
27
+ }
28
+
29
+ function warn(msg) {
30
+ console.warn(`[cosknow-cleanup] ${msg}`)
31
+ }
32
+
33
+ // 1. 按 manifest 删除
34
+ async function deleteFromManifest(commandsDir) {
35
+ const manifestPath = join(commandsDir, MANIFEST_FILE)
36
+ if (!existsSync(manifestPath)) {
37
+ return 0
38
+ }
39
+
40
+ let manifest
41
+ try {
42
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))
43
+ } catch (e) {
44
+ warn(`invalid manifest at ${manifestPath}, skipping manifest-based cleanup: ${e.message}`)
45
+ return 0
46
+ }
47
+
48
+ let deleted = 0
49
+ for (const filePath of manifest.files ?? []) {
50
+ if (existsSync(filePath)) {
51
+ try {
52
+ await rm(filePath)
53
+ deleted++
54
+ } catch (e) {
55
+ warn(`failed to remove ${filePath}: ${e.message}`)
56
+ }
57
+ }
58
+ }
59
+ return deleted
60
+ }
61
+
62
+ // 2. 兜底:删除 commands 目录下所有 kb-*.md
63
+ async function deleteKbCommands(commandsDir) {
64
+ let entries
65
+ try {
66
+ entries = await readdir(commandsDir)
67
+ } catch {
68
+ return 0 // commands 目录不存在,无需清理
69
+ }
70
+
71
+ let deleted = 0
72
+ for (const entry of entries) {
73
+ if (!entry.startsWith('kb-') || !entry.endsWith('.md')) {
74
+ continue
75
+ }
76
+ const filePath = join(commandsDir, entry)
77
+ try {
78
+ await rm(filePath)
79
+ deleted++
80
+ } catch (e) {
81
+ warn(`failed to remove ${filePath}: ${e.message}`)
82
+ }
83
+ }
84
+ return deleted
85
+ }
86
+
87
+ // 3. 删除 v1 复制到 commands/ 下的资源文件
88
+ async function deleteResources(commandsDir) {
89
+ const linterPath = join(commandsDir, 'linter', 'kb-linter.js')
90
+ if (existsSync(linterPath)) {
91
+ try {
92
+ await rm(linterPath)
93
+ log(`removed ${linterPath}`)
94
+ } catch (e) {
95
+ warn(`failed to remove ${linterPath}: ${e.message}`)
96
+ }
97
+ }
98
+
99
+ // 若 linter/ 目录是 cosknow 创建的(删掉 kb-linter.js 后为空),一并移除
100
+ const linterDir = join(commandsDir, 'linter')
101
+ if (existsSync(linterDir)) {
102
+ try {
103
+ const remaining = await readdir(linterDir)
104
+ if (remaining.length === 0) {
105
+ await rm(linterDir, { recursive: true, force: true })
106
+ log(`removed empty dir ${linterDir}`)
107
+ }
108
+ } catch (e) {
109
+ warn(`failed to inspect ${linterDir}: ${e.message}`)
110
+ }
111
+ }
112
+
113
+ const promptsDir = join(commandsDir, 'prompts')
114
+ if (existsSync(promptsDir)) {
115
+ try {
116
+ await rm(promptsDir, { recursive: true, force: true })
117
+ log(`removed ${promptsDir}`)
118
+ } catch (e) {
119
+ warn(`failed to remove ${promptsDir}: ${e.message}`)
120
+ }
121
+ }
122
+ }
123
+
124
+ // 4. 删除 manifest 本身
125
+ async function deleteManifest(commandsDir) {
126
+ const manifestPath = join(commandsDir, MANIFEST_FILE)
127
+ if (existsSync(manifestPath)) {
128
+ try {
129
+ await rm(manifestPath)
130
+ log(`removed ${manifestPath}`)
131
+ } catch (e) {
132
+ warn(`failed to remove ${manifestPath}: ${e.message}`)
133
+ }
134
+ }
135
+ }
136
+
137
+ let totalRemoved = 0
138
+
139
+ for (const commandsDir of TARGET_DIRS) {
140
+ totalRemoved += await deleteFromManifest(commandsDir)
141
+ totalRemoved += await deleteKbCommands(commandsDir)
142
+ await deleteResources(commandsDir)
143
+ await deleteManifest(commandsDir)
144
+ }
145
+
146
+ if (totalRemoved > 0) {
147
+ log(`removed ${totalRemoved} CosKnow command file(s)`)
148
+ } else {
149
+ log('no CosKnow commands found, nothing to clean')
150
+ }
@@ -1,34 +0,0 @@
1
- import { spawnSync, execSync } from 'node:child_process'
2
- import { join } from 'node:path'
3
- import { pathToFileURL } from 'node:url'
4
-
5
- // 全局安装最新版
6
- spawnSync('npm', ['install', '-g', '@costrict/cosknow@latest'], {
7
- stdio: 'inherit',
8
- shell: true,
9
- })
10
-
11
- // 获取全局 node_modules 路径
12
- let globalPrefix
13
- try {
14
- globalPrefix = execSync('npm root -g', { encoding: 'utf8' }).trim()
15
- } catch {
16
- console.warn('[cosknow] cannot determine global npm root, skipping')
17
- process.exit(0)
18
- }
19
-
20
- let install
21
- try {
22
- const mod = await import(pathToFileURL(join(globalPrefix, '@costrict', 'cosknow', 'dist', 'index.js')).href)
23
- install = mod.install
24
- } catch {
25
- console.warn('[cosknow] package not available, skipping command installation')
26
- process.exit(0)
27
- }
28
-
29
- try {
30
- await install({ target: 'claude-commands' })
31
- console.log('[cosknow] commands installed to ~/.claude/commands/')
32
- } catch (e) {
33
- console.warn('[cosknow] install failed (non-fatal):', e.message)
34
- }