@rayu-dev/rayu-cli 1.2.20 → 1.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/rayu.js +614 -317
  2. package/package.json +2 -1
package/dist/rayu.js CHANGED
@@ -147971,7 +147971,7 @@ var init_auth = __esm(() => {
147971
147971
 
147972
147972
  // src/utils/userAgent.ts
147973
147973
  function getRayuUserAgent() {
147974
- return `rayu/${"1.2.20"}`;
147974
+ return `rayu/${"1.2.22"}`;
147975
147975
  }
147976
147976
  var getClaudeCodeUserAgent;
147977
147977
  var init_userAgent = __esm(() => {
@@ -147997,7 +147997,7 @@ function getUserAgent() {
147997
147997
  const clientApp = process.env.RAYU_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}` : "";
147998
147998
  const workload = getWorkload();
147999
147999
  const workloadSuffix = workload ? `, workload/${workload}` : "";
148000
- return `rayu/${"1.2.20"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
148000
+ return `rayu/${"1.2.22"} (${"external"}, ${process.env.RAYU_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
148001
148001
  }
148002
148002
  function getMCPUserAgent() {
148003
148003
  const parts = [];
@@ -148011,7 +148011,7 @@ function getMCPUserAgent() {
148011
148011
  parts.push(`client-app/${process.env.RAYU_AGENT_SDK_CLIENT_APP}`);
148012
148012
  }
148013
148013
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
148014
- return `rayu/${"1.2.20"}${suffix}`;
148014
+ return `rayu/${"1.2.22"}${suffix}`;
148015
148015
  }
148016
148016
  function getWebFetchUserAgent() {
148017
148017
  return `Rayu-User (${getRayuUserAgent()})`;
@@ -148134,7 +148134,7 @@ var init_user = __esm(() => {
148134
148134
  deviceId,
148135
148135
  sessionId: getSessionId(),
148136
148136
  email: getEmail(),
148137
- appVersion: "1.2.20",
148137
+ appVersion: "1.2.22",
148138
148138
  platform: getHostPlatformForAnalytics(),
148139
148139
  organizationUuid,
148140
148140
  accountUuid,
@@ -181204,7 +181204,7 @@ var init_metadata = __esm(() => {
181204
181204
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
181205
181205
  WHITESPACE_REGEX = /\s+/;
181206
181206
  getVersionBase = memoize_default(() => {
181207
- const match = "1.2.20".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
181207
+ const match = "1.2.22".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
181208
181208
  return match ? match[0] : undefined;
181209
181209
  });
181210
181210
  buildEnvContext = memoize_default(async () => {
@@ -181243,7 +181243,7 @@ var init_metadata = __esm(() => {
181243
181243
  },
181244
181244
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
181245
181245
  isRayuAction: isEnvTruthy(process.env.RAYU_ACTION),
181246
- version: "1.2.20",
181246
+ version: "1.2.22",
181247
181247
  versionBase: getVersionBase(),
181248
181248
  buildTime: "",
181249
181249
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
@@ -181857,7 +181857,7 @@ function initialize1PEventLogging() {
181857
181857
  const platform2 = getPlatform();
181858
181858
  const attributes = {
181859
181859
  [import_semantic_conventions.ATTR_SERVICE_NAME]: "rayu",
181860
- [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.2.20"
181860
+ [import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.2.22"
181861
181861
  };
181862
181862
  if (platform2 === "wsl") {
181863
181863
  const wslVersion = getWslVersion();
@@ -181884,7 +181884,7 @@ function initialize1PEventLogging() {
181884
181884
  })
181885
181885
  ]
181886
181886
  });
181887
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("io.rayu.events", "1.2.20");
181887
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("io.rayu.events", "1.2.22");
181888
181888
  }
181889
181889
  async function reinitialize1PEventLoggingIfConfigChanged() {
181890
181890
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -213098,7 +213098,7 @@ var init_theme = __esm(() => {
213098
213098
  briefLabelYou: "rgb(37,99,235)",
213099
213099
  briefLabelClaude: "rgb(255,153,51)",
213100
213100
  rainbow_red: "rgb(235,95,87)",
213101
- rainbow_orange: "rgb(245,139,87)",
213101
+ rainbow_orange: "rgb(100, 172, 7)",
213102
213102
  rainbow_yellow: "rgb(250,195,95)",
213103
213103
  rainbow_green: "rgb(145,200,130)",
213104
213104
  rainbow_blue: "rgb(130,170,220)",
@@ -217800,7 +217800,7 @@ function getAttributionHeader(fingerprint) {
217800
217800
  if (!isAttributionHeaderEnabled()) {
217801
217801
  return "";
217802
217802
  }
217803
- const version2 = `${"1.2.20"}.${fingerprint}`;
217803
+ const version2 = `${"1.2.22"}.${fingerprint}`;
217804
217804
  const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
217805
217805
  const cch = "";
217806
217806
  const workload = getWorkload();
@@ -252786,9 +252786,7 @@ var init_pluginDirectories = __esm(() => {
252786
252786
 
252787
252787
  // src/utils/thinking.ts
252788
252788
  function isUltrathinkEnabled() {
252789
- if (true) {
252790
- return false;
252791
- }
252789
+ if (false) {}
252792
252790
  return getFeatureValue_CACHED_MAY_BE_STALE("tengu_turtle_carbon", true);
252793
252791
  }
252794
252792
  function hasUltrathinkKeyword(text2) {
@@ -252817,6 +252815,9 @@ function modelSupportsThinking(model) {
252817
252815
  if (supported3P !== undefined) {
252818
252816
  return supported3P;
252819
252817
  }
252818
+ if (isOpenAICompatibleActive() || isRayuNonAnthropicActive()) {
252819
+ return true;
252820
+ }
252820
252821
  if (false) {}
252821
252822
  const canonical = getCanonicalName(model);
252822
252823
  const provider = getAPIProvider();
@@ -252830,6 +252831,9 @@ function modelSupportsAdaptiveThinking(model) {
252830
252831
  if (supported3P !== undefined) {
252831
252832
  return supported3P;
252832
252833
  }
252834
+ if (isOpenAICompatibleActive() || isRayuNonAnthropicActive()) {
252835
+ return true;
252836
+ }
252833
252837
  const canonical = getCanonicalName(model);
252834
252838
  if (canonical.includes("opus-4-6") || canonical.includes("sonnet-4-6")) {
252835
252839
  return true;
@@ -269828,7 +269832,9 @@ Use the literal string \`VERDICT: \` followed by exactly one of \`PASS\`, \`FAIL
269828
269832
 
269829
269833
  // src/tools/AgentTool/builtInAgents.ts
269830
269834
  function areExplorePlanAgentsEnabled() {
269831
- if (false) {}
269835
+ if (true) {
269836
+ return getFeatureValue_CACHED_MAY_BE_STALE("tengu_amber_stoat", true);
269837
+ }
269832
269838
  return false;
269833
269839
  }
269834
269840
  function getBuiltInAgents() {
@@ -272727,6 +272733,54 @@ var init_vscodeSdkMcp = __esm(() => {
272727
272733
  }));
272728
272734
  });
272729
272735
 
272736
+ // src/utils/abortController.ts
272737
+ import { setMaxListeners as setMaxListeners2 } from "events";
272738
+ function isUserInitiatedAbort(reason) {
272739
+ if (reason instanceof Error)
272740
+ return false;
272741
+ if (typeof reason === "string" && SYSTEM_ABORT_REASONS.has(reason)) {
272742
+ return false;
272743
+ }
272744
+ return true;
272745
+ }
272746
+ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
272747
+ const controller = new AbortController;
272748
+ setMaxListeners2(maxListeners, controller.signal);
272749
+ return controller;
272750
+ }
272751
+ function propagateAbort(weakChild) {
272752
+ const parent = this.deref();
272753
+ weakChild.deref()?.abort(parent?.signal.reason);
272754
+ }
272755
+ function removeAbortHandler(weakHandler) {
272756
+ const parent = this.deref();
272757
+ const handler = weakHandler.deref();
272758
+ if (parent && handler) {
272759
+ parent.signal.removeEventListener("abort", handler);
272760
+ }
272761
+ }
272762
+ function createChildAbortController(parent, maxListeners) {
272763
+ const child = createAbortController(maxListeners);
272764
+ if (parent.signal.aborted) {
272765
+ child.abort(parent.signal.reason);
272766
+ return child;
272767
+ }
272768
+ const weakChild = new WeakRef(child);
272769
+ const weakParent = new WeakRef(parent);
272770
+ const handler = propagateAbort.bind(weakParent, weakChild);
272771
+ parent.signal.addEventListener("abort", handler, { once: true });
272772
+ child.signal.addEventListener("abort", removeAbortHandler.bind(weakParent, new WeakRef(handler)), { once: true });
272773
+ return child;
272774
+ }
272775
+ var SYSTEM_ABORT_REASONS, DEFAULT_MAX_LISTENERS = 50;
272776
+ var init_abortController = __esm(() => {
272777
+ SYSTEM_ABORT_REASONS = new Set([
272778
+ "sibling_error",
272779
+ "streaming_fallback",
272780
+ "background"
272781
+ ]);
272782
+ });
272783
+
272730
272784
  // src/services/api/withRetry.ts
272731
272785
  function shouldRetry529(querySource) {
272732
272786
  return querySource === undefined || FOREGROUND_529_RETRY_SOURCES.has(querySource);
@@ -291829,6 +291883,15 @@ var init_systemPrompt = __esm(() => {
291829
291883
  });
291830
291884
 
291831
291885
  // src/utils/analyzeContext.ts
291886
+ async function countOrEstimate(messages, tools, fallbackText) {
291887
+ const result = await countTokensWithFallback(messages, tools);
291888
+ return result ?? roughTokenCountEstimation(fallbackText);
291889
+ }
291890
+ function reconcileContextUsage(opts) {
291891
+ const used = opts.totalFromAPI ?? opts.actualUsage;
291892
+ const freeTokens = Math.max(0, opts.contextWindow - used - opts.reservedTokens);
291893
+ return { usedForGrid: used, freeTokens, finalTotalTokens: used };
291894
+ }
291832
291895
  async function countTokensWithFallback(messages, tools) {
291833
291896
  try {
291834
291897
  const result = await countMessagesTokensWithAPI(messages, tools);
@@ -291864,7 +291927,10 @@ async function countToolDefinitionTokens(tools, getToolPermissionContext, agentI
291864
291927
  const toolNames = tools.map((t2) => t2.name).join(", ");
291865
291928
  logForDebugging(`countToolDefinitionTokens returned ${result} for ${tools.length} tools: ${toolNames.slice(0, 100)}${toolNames.length > 100 ? "..." : ""}`);
291866
291929
  }
291867
- return result ?? 0;
291930
+ if (result === null) {
291931
+ return roughTokenCountEstimation(jsonStringify(toolSchemas));
291932
+ }
291933
+ return result;
291868
291934
  }
291869
291935
  function extractSectionName(content) {
291870
291936
  const headingMatch = content.match(/^#+\s+(.+)$/m);
@@ -291884,7 +291950,7 @@ async function countSystemTokens(effectiveSystemPrompt) {
291884
291950
  if (namedEntries.length < 1) {
291885
291951
  return { systemPromptTokens: 0, systemPromptSections: [] };
291886
291952
  }
291887
- const systemTokenCounts = await Promise.all(namedEntries.map(({ content }) => countTokensWithFallback([{ role: "user", content }], [])));
291953
+ const systemTokenCounts = await Promise.all(namedEntries.map(({ content }) => countOrEstimate([{ role: "user", content }], [], content)));
291888
291954
  const systemPromptSections = namedEntries.map((entry, i4) => ({
291889
291955
  name: entry.name,
291890
291956
  tokens: systemTokenCounts[i4] || 0
@@ -291906,7 +291972,7 @@ async function countMemoryFileTokens() {
291906
291972
  };
291907
291973
  }
291908
291974
  const claudeMdTokenCounts = await Promise.all(memoryFilesData.map(async (file2) => {
291909
- const tokens = await countTokensWithFallback([{ role: "user", content: file2.content }], []);
291975
+ const tokens = await countOrEstimate([{ role: "user", content: file2.content }], [], file2.content);
291910
291976
  return { file: file2, tokens: tokens || 0 };
291911
291977
  }));
291912
291978
  for (const { file: file2, tokens } of claudeMdTokenCounts) {
@@ -292097,12 +292163,12 @@ async function countCustomAgentTokens(agentDefinitions) {
292097
292163
  const customAgents = agentDefinitions.activeAgents.filter((a2) => a2.source !== "built-in");
292098
292164
  const agentDetails = [];
292099
292165
  let agentTokens = 0;
292100
- const tokenCounts = await Promise.all(customAgents.map((agent) => countTokensWithFallback([
292166
+ const tokenCounts = await Promise.all(customAgents.map((agent) => countOrEstimate([
292101
292167
  {
292102
292168
  role: "user",
292103
292169
  content: [agent.agentType, agent.whenToUse].join(" ")
292104
292170
  }
292105
- ], [])));
292171
+ ], [], [agent.agentType, agent.whenToUse].join(" "))));
292106
292172
  for (const [i4, agent] of customAgents.entries()) {
292107
292173
  const tokens = tokenCounts[i4] || 0;
292108
292174
  agentTokens += tokens || 0;
@@ -292198,7 +292264,8 @@ async function approximateMessageTokens(messages) {
292198
292264
  }
292199
292265
  return _2.message;
292200
292266
  }), []);
292201
- breakdown.totalTokens = approximateMessageTokens2 ?? 0;
292267
+ const roughMessageSum = breakdown.userMessageTokens + breakdown.assistantMessageTokens + breakdown.toolCallTokens + breakdown.toolResultTokens + breakdown.attachmentTokens;
292268
+ breakdown.totalTokens = approximateMessageTokens2 ?? roughMessageSum;
292202
292269
  return breakdown;
292203
292270
  }
292204
292271
  async function analyzeContextUsage(messages, model, getToolPermissionContext, tools, agentDefinitions, terminalWidth, toolUseContext, mainThreadAgentDefinition, originalMessages) {
@@ -292332,16 +292399,19 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to
292332
292399
  color: "inactive"
292333
292400
  });
292334
292401
  }
292335
- const freeTokens = Math.max(0, contextWindow - actualUsage - reservedTokens);
292402
+ const apiUsage = getCurrentUsage(originalMessages ?? messages);
292403
+ const totalFromAPI = apiUsage ? apiUsage.input_tokens + apiUsage.cache_creation_input_tokens + apiUsage.cache_read_input_tokens : null;
292404
+ const { freeTokens, finalTotalTokens } = reconcileContextUsage({
292405
+ contextWindow,
292406
+ actualUsage,
292407
+ totalFromAPI,
292408
+ reservedTokens
292409
+ });
292336
292410
  cats.push({
292337
292411
  name: "Free space",
292338
292412
  tokens: freeTokens,
292339
292413
  color: "promptBorder"
292340
292414
  });
292341
- const totalIncludingReserved = actualUsage;
292342
- const apiUsage = getCurrentUsage(originalMessages ?? messages);
292343
- const totalFromAPI = apiUsage ? apiUsage.input_tokens + apiUsage.cache_creation_input_tokens + apiUsage.cache_read_input_tokens : null;
292344
- const finalTotalTokens = totalFromAPI ?? totalIncludingReserved;
292345
292415
  const isNarrowScreen = terminalWidth && terminalWidth < 80;
292346
292416
  const GRID_WIDTH = contextWindow >= 1e6 ? isNarrowScreen ? 5 : 20 : isNarrowScreen ? 5 : 10;
292347
292417
  const GRID_HEIGHT = contextWindow >= 1e6 ? 10 : isNarrowScreen ? 5 : 10;
@@ -302248,7 +302318,7 @@ function getTelemetryAttributes() {
302248
302318
  attributes["session.id"] = sessionId;
302249
302319
  }
302250
302320
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
302251
- attributes["app.version"] = "1.2.20";
302321
+ attributes["app.version"] = "1.2.22";
302252
302322
  }
302253
302323
  const oauthAccount = getOauthAccountInfo();
302254
302324
  if (oauthAccount) {
@@ -303852,40 +303922,6 @@ var init_dumpPrompts = __esm(() => {
303852
303922
  dumpState = new Map;
303853
303923
  });
303854
303924
 
303855
- // src/utils/abortController.ts
303856
- import { setMaxListeners as setMaxListeners2 } from "events";
303857
- function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
303858
- const controller = new AbortController;
303859
- setMaxListeners2(maxListeners, controller.signal);
303860
- return controller;
303861
- }
303862
- function propagateAbort(weakChild) {
303863
- const parent = this.deref();
303864
- weakChild.deref()?.abort(parent?.signal.reason);
303865
- }
303866
- function removeAbortHandler(weakHandler) {
303867
- const parent = this.deref();
303868
- const handler = weakHandler.deref();
303869
- if (parent && handler) {
303870
- parent.signal.removeEventListener("abort", handler);
303871
- }
303872
- }
303873
- function createChildAbortController(parent, maxListeners) {
303874
- const child = createAbortController(maxListeners);
303875
- if (parent.signal.aborted) {
303876
- child.abort(parent.signal.reason);
303877
- return child;
303878
- }
303879
- const weakChild = new WeakRef(child);
303880
- const weakParent = new WeakRef(parent);
303881
- const handler = propagateAbort.bind(weakParent, weakChild);
303882
- parent.signal.addEventListener("abort", handler, { once: true });
303883
- child.signal.addEventListener("abort", removeAbortHandler.bind(weakParent, new WeakRef(handler)), { once: true });
303884
- return child;
303885
- }
303886
- var DEFAULT_MAX_LISTENERS = 50;
303887
- var init_abortController = () => {};
303888
-
303889
303925
  // node_modules/cli-highlight/node_modules/highlight.js/lib/core.js
303890
303926
  var require_core = __commonJS((exports, module) => {
303891
303927
  function deepFreeze(obj) {
@@ -412640,7 +412676,7 @@ function getInstallationEnv() {
412640
412676
  return;
412641
412677
  }
412642
412678
  function getClaudeCodeVersion() {
412643
- return "1.2.20";
412679
+ return "1.2.22";
412644
412680
  }
412645
412681
  async function getInstalledVSCodeExtensionVersion(command) {
412646
412682
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -417878,7 +417914,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
417878
417914
  const client4 = new Client({
417879
417915
  name: "claude-code",
417880
417916
  title: "RAYU",
417881
- version: "1.2.20",
417917
+ version: "1.2.22",
417882
417918
  description: "Anthropic's agentic coding tool",
417883
417919
  websiteUrl: PRODUCT_URL
417884
417920
  }, {
@@ -418195,7 +418231,7 @@ var init_client7 = __esm(() => {
418195
418231
  const client4 = new Client({
418196
418232
  name: "claude-code",
418197
418233
  title: "RAYU",
418198
- version: "1.2.20",
418234
+ version: "1.2.22",
418199
418235
  description: "Anthropic's agentic coding tool",
418200
418236
  websiteUrl: PRODUCT_URL
418201
418237
  }, {
@@ -432972,7 +433008,7 @@ function computeFingerprint(messageText, version2) {
432972
433008
  }
432973
433009
  function computeFingerprintFromMessages(messages) {
432974
433010
  const firstMessageText = extractFirstMessageText(messages);
432975
- return computeFingerprint(firstMessageText, "1.2.20");
433011
+ return computeFingerprint(firstMessageText, "1.2.22");
432976
433012
  }
432977
433013
  var FINGERPRINT_SALT = "59cf53e54c78";
432978
433014
  var init_fingerprint = () => {};
@@ -433014,7 +433050,7 @@ async function sideQuery(opts) {
433014
433050
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
433015
433051
  }
433016
433052
  const messageText = extractFirstUserMessageText(messages);
433017
- const fingerprint = computeFingerprint(messageText, "1.2.20");
433053
+ const fingerprint = computeFingerprint(messageText, "1.2.22");
433018
433054
  const attributionHeader = getAttributionHeader(fingerprint);
433019
433055
  const systemBlocks = [
433020
433056
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -458612,7 +458648,23 @@ function SpinnerWithVerbInner({
458612
458648
  const showBtwTip = tipsEnabled && elapsedSnapshot > 30000 && !getGlobalConfig().btwUseCount;
458613
458649
  const effectiveTip = contextTipsActive ? undefined : showClearTip && !nextTask ? "Use /clear to start fresh when switching topics and free up context" : showBtwTip && !nextTask ? "Use /btw to ask a quick side question without interrupting Claude's current work" : spinnerTip;
458614
458650
  let budgetText = null;
458615
- if (false) {}
458651
+ if (true) {
458652
+ const budget = getCurrentTurnTokenBudget();
458653
+ if (budget !== null && budget > 0) {
458654
+ const tokens = getTurnOutputTokens();
458655
+ if (tokens >= budget) {
458656
+ budgetText = `Target: ${formatNumber(tokens)} used (${formatNumber(budget)} min ${figures_default.tick})`;
458657
+ } else {
458658
+ const pct = Math.round(tokens / budget * 100);
458659
+ const remaining = budget - tokens;
458660
+ const rate = elapsedSnapshot > 5000 && tokens >= 2000 ? tokens / elapsedSnapshot : 0;
458661
+ const eta = rate > 0 ? ` · ~${formatDuration(remaining / rate, {
458662
+ mostSignificantOnly: true
458663
+ })}` : "";
458664
+ budgetText = `Target: ${formatNumber(tokens)} / ${formatNumber(budget)} (${pct}%)${eta}`;
458665
+ }
458666
+ }
458667
+ }
458616
458668
  return /* @__PURE__ */ jsx_dev_runtime123.jsxDEV(ThemedBox_default, {
458617
458669
  flexDirection: "column",
458618
458670
  width: "100%",
@@ -458854,6 +458906,7 @@ var init_Spinner2 = __esm(() => {
458854
458906
  init_model();
458855
458907
  init_selectors();
458856
458908
  init_figures2();
458909
+ init_figures();
458857
458910
  init_state();
458858
458911
  init_TeammateSpinnerTree();
458859
458912
  init_ink2();
@@ -498005,7 +498058,7 @@ class StreamingToolExecutor {
498005
498058
  if (this.toolUseContext.abortController.signal.reason === "interrupt") {
498006
498059
  return this.getToolInterruptBehavior(tool) === "cancel" ? "user_interrupted" : null;
498007
498060
  }
498008
- return "user_interrupted";
498061
+ return isUserInitiatedAbort(this.toolUseContext.abortController.signal.reason) ? "user_interrupted" : "sibling_error";
498009
498062
  }
498010
498063
  return null;
498011
498064
  }
@@ -499441,13 +499494,110 @@ var init_deps = __esm(() => {
499441
499494
  });
499442
499495
 
499443
499496
  // src/utils/tokenBudget.ts
499444
- var VERBOSE_RE, VERBOSE_RE_G;
499497
+ function parseBudgetMatch(value, suffix) {
499498
+ return parseFloat(value) * MULTIPLIERS[suffix.toLowerCase()];
499499
+ }
499500
+ function parseTokenBudget(text2) {
499501
+ const startMatch = text2.match(SHORTHAND_START_RE);
499502
+ if (startMatch)
499503
+ return parseBudgetMatch(startMatch[1], startMatch[2]);
499504
+ const endMatch = text2.match(SHORTHAND_END_RE);
499505
+ if (endMatch)
499506
+ return parseBudgetMatch(endMatch[1], endMatch[2]);
499507
+ const verboseMatch = text2.match(VERBOSE_RE);
499508
+ if (verboseMatch)
499509
+ return parseBudgetMatch(verboseMatch[1], verboseMatch[2]);
499510
+ return null;
499511
+ }
499512
+ function findTokenBudgetPositions(text2) {
499513
+ const positions = [];
499514
+ const startMatch = text2.match(SHORTHAND_START_RE);
499515
+ if (startMatch) {
499516
+ const offset = startMatch.index + startMatch[0].length - startMatch[0].trimStart().length;
499517
+ positions.push({
499518
+ start: offset,
499519
+ end: startMatch.index + startMatch[0].length
499520
+ });
499521
+ }
499522
+ const endMatch = text2.match(SHORTHAND_END_RE);
499523
+ if (endMatch) {
499524
+ const endStart = endMatch.index + 1;
499525
+ const alreadyCovered = positions.some((p) => endStart >= p.start && endStart < p.end);
499526
+ if (!alreadyCovered) {
499527
+ positions.push({
499528
+ start: endStart,
499529
+ end: endMatch.index + endMatch[0].length
499530
+ });
499531
+ }
499532
+ }
499533
+ for (const match of text2.matchAll(VERBOSE_RE_G)) {
499534
+ positions.push({ start: match.index, end: match.index + match[0].length });
499535
+ }
499536
+ return positions;
499537
+ }
499538
+ function getBudgetContinuationMessage(pct, turnTokens, budget) {
499539
+ const fmt = (n2) => new Intl.NumberFormat("en-US").format(n2);
499540
+ return `Stopped at ${pct}% of token target (${fmt(turnTokens)} / ${fmt(budget)}). Keep working — do not summarize.`;
499541
+ }
499542
+ var SHORTHAND_START_RE, SHORTHAND_END_RE, VERBOSE_RE, VERBOSE_RE_G, MULTIPLIERS;
499445
499543
  var init_tokenBudget = __esm(() => {
499544
+ SHORTHAND_START_RE = /^\s*\+(\d+(?:\.\d+)?)\s*(k|m|b)\b/i;
499545
+ SHORTHAND_END_RE = /\s\+(\d+(?:\.\d+)?)\s*(k|m|b)\s*[.!?]?\s*$/i;
499446
499546
  VERBOSE_RE = /\b(?:use|spend)\s+(\d+(?:\.\d+)?)\s*(k|m|b)\s*tokens?\b/i;
499447
499547
  VERBOSE_RE_G = new RegExp(VERBOSE_RE.source, "gi");
499548
+ MULTIPLIERS = {
499549
+ k: 1000,
499550
+ m: 1e6,
499551
+ b: 1e9
499552
+ };
499448
499553
  });
499449
499554
 
499450
499555
  // src/query/tokenBudget.ts
499556
+ function createBudgetTracker() {
499557
+ return {
499558
+ continuationCount: 0,
499559
+ lastDeltaTokens: 0,
499560
+ lastGlobalTurnTokens: 0,
499561
+ startedAt: Date.now()
499562
+ };
499563
+ }
499564
+ function checkTokenBudget(tracker, agentId, budget, globalTurnTokens) {
499565
+ if (agentId || budget === null || budget <= 0) {
499566
+ return { action: "stop", completionEvent: null };
499567
+ }
499568
+ const turnTokens = globalTurnTokens;
499569
+ const pct = Math.round(turnTokens / budget * 100);
499570
+ const deltaSinceLastCheck = globalTurnTokens - tracker.lastGlobalTurnTokens;
499571
+ const isDiminishing = tracker.continuationCount >= 3 && deltaSinceLastCheck < DIMINISHING_THRESHOLD && tracker.lastDeltaTokens < DIMINISHING_THRESHOLD;
499572
+ if (!isDiminishing && turnTokens < budget * COMPLETION_THRESHOLD) {
499573
+ tracker.continuationCount++;
499574
+ tracker.lastDeltaTokens = deltaSinceLastCheck;
499575
+ tracker.lastGlobalTurnTokens = globalTurnTokens;
499576
+ return {
499577
+ action: "continue",
499578
+ nudgeMessage: getBudgetContinuationMessage(pct, turnTokens, budget),
499579
+ continuationCount: tracker.continuationCount,
499580
+ pct,
499581
+ turnTokens,
499582
+ budget
499583
+ };
499584
+ }
499585
+ if (isDiminishing || tracker.continuationCount > 0) {
499586
+ return {
499587
+ action: "stop",
499588
+ completionEvent: {
499589
+ continuationCount: tracker.continuationCount,
499590
+ pct,
499591
+ turnTokens,
499592
+ budget,
499593
+ diminishingReturns: isDiminishing,
499594
+ durationMs: Date.now() - tracker.startedAt
499595
+ }
499596
+ };
499597
+ }
499598
+ return { action: "stop", completionEvent: null };
499599
+ }
499600
+ var COMPLETION_THRESHOLD = 0.9, DIMINISHING_THRESHOLD = 500;
499451
499601
  var init_tokenBudget2 = __esm(() => {
499452
499602
  init_tokenBudget();
499453
499603
  });
@@ -499509,7 +499659,7 @@ async function* queryLoop(params, consumedCommandUuids) {
499509
499659
  pendingToolUseSummary: undefined,
499510
499660
  transition: undefined
499511
499661
  };
499512
- const budgetTracker = null;
499662
+ const budgetTracker = createBudgetTracker();
499513
499663
  let taskBudgetRemaining = undefined;
499514
499664
  const config4 = buildQueryConfig();
499515
499665
  const pendingMemoryPrefetch = __using(__stack, startRelevantMemoryPrefetch(state.messages, state.toolUseContext), 0);
@@ -499838,6 +499988,8 @@ async function* queryLoop(params, consumedCommandUuids) {
499838
499988
  executePostSamplingHooks([...messagesForQuery, ...assistantMessages], systemPrompt, userContext, systemContext, toolUseContext, querySource);
499839
499989
  }
499840
499990
  if (toolUseContext.abortController.signal.aborted) {
499991
+ const abortReason = toolUseContext.abortController.signal.reason;
499992
+ const userInitiated = isUserInitiatedAbort(abortReason);
499841
499993
  if (streamingToolExecutor) {
499842
499994
  for await (const update of streamingToolExecutor.getRemainingResults()) {
499843
499995
  if (update.message) {
@@ -499845,10 +499997,10 @@ async function* queryLoop(params, consumedCommandUuids) {
499845
499997
  }
499846
499998
  }
499847
499999
  } else {
499848
- yield* yieldMissingToolResultBlocks(assistantMessages, "Interrupted by user");
500000
+ yield* yieldMissingToolResultBlocks(assistantMessages, userInitiated ? "Interrupted by user" : "Tool execution was cancelled (a parallel tool failed or timed out)");
499849
500001
  }
499850
500002
  if (false) {}
499851
- if (toolUseContext.abortController.signal.reason !== "interrupt") {
500003
+ if (abortReason !== "interrupt" && userInitiated) {
499852
500004
  yield createUserInterruptionMessage({
499853
500005
  toolUse: false
499854
500006
  });
@@ -499988,7 +500140,43 @@ async function* queryLoop(params, consumedCommandUuids) {
499988
500140
  state = next2;
499989
500141
  continue;
499990
500142
  }
499991
- if (false) {}
500143
+ if (true) {
500144
+ const decision = checkTokenBudget(budgetTracker, toolUseContext.agentId, getCurrentTurnTokenBudget(), getTurnOutputTokens());
500145
+ if (decision.action === "continue") {
500146
+ incrementBudgetContinuationCount();
500147
+ logForDebugging(`Token budget continuation #${decision.continuationCount}: ${decision.pct}% (${decision.turnTokens.toLocaleString()} / ${decision.budget.toLocaleString()})`);
500148
+ state = {
500149
+ messages: [
500150
+ ...messagesForQuery,
500151
+ ...assistantMessages,
500152
+ createUserMessage({
500153
+ content: decision.nudgeMessage,
500154
+ isMeta: true
500155
+ })
500156
+ ],
500157
+ toolUseContext,
500158
+ autoCompactTracking: tracking,
500159
+ maxOutputTokensRecoveryCount: 0,
500160
+ hasAttemptedReactiveCompact: false,
500161
+ maxOutputTokensOverride: undefined,
500162
+ pendingToolUseSummary: undefined,
500163
+ stopHookActive: undefined,
500164
+ turnCount,
500165
+ transition: { reason: "token_budget_continuation" }
500166
+ };
500167
+ continue;
500168
+ }
500169
+ if (decision.completionEvent) {
500170
+ if (decision.completionEvent.diminishingReturns) {
500171
+ logForDebugging(`Token budget early stop: diminishing returns at ${decision.completionEvent.pct}%`);
500172
+ }
500173
+ logEvent("tengu_token_budget_completed", {
500174
+ ...decision.completionEvent,
500175
+ queryChainId: queryChainIdForAnalytics,
500176
+ queryDepth: queryTracking.depth
500177
+ });
500178
+ }
500179
+ }
499992
500180
  return { reason: "completed" };
499993
500181
  }
499994
500182
  let shouldPreventContinuation = false;
@@ -500192,6 +500380,7 @@ async function* queryLoop(params, consumedCommandUuids) {
500192
500380
  }
500193
500381
  var reactiveCompact = null, skillPrefetch = null, MAX_OUTPUT_TOKENS_RECOVERY_LIMIT = 3;
500194
500382
  var init_query3 = __esm(() => {
500383
+ init_abortController();
500195
500384
  init_withRetry();
500196
500385
  init_autoCompact();
500197
500386
  init_compact();
@@ -512818,7 +513007,20 @@ function getTokenUsageAttachment(messages, model) {
512818
513007
  ];
512819
513008
  }
512820
513009
  function getOutputTokenUsageAttachment() {
512821
- if (false) {}
513010
+ if (true) {
513011
+ const budget = getCurrentTurnTokenBudget();
513012
+ if (budget === null || budget <= 0) {
513013
+ return [];
513014
+ }
513015
+ return [
513016
+ {
513017
+ type: "output_token_usage",
513018
+ turn: getTurnOutputTokens(),
513019
+ session: getTotalOutputTokens(),
513020
+ budget
513021
+ }
513022
+ ];
513023
+ }
512822
513024
  return [];
512823
513025
  }
512824
513026
  function getMaxBudgetUsdAttachment(maxBudgetUsd) {
@@ -518286,7 +518488,9 @@ Date: ${getSessionStartDate()}`
518286
518488
  systemPromptSection("frc", () => getFunctionResultClearingSection(model)),
518287
518489
  systemPromptSection("summarize_tool_results", () => SUMMARIZE_TOOL_RESULTS_SECTION),
518288
518490
  ...[],
518289
- ...[],
518491
+ ...[
518492
+ systemPromptSection("token_budget", () => 'When the user specifies a token target (e.g., "+500k", "spend 2M tokens", "use 1B tokens"), your output token count will be shown each turn. Keep working until you approach the target — plan your work to fill it productively. The target is a hard minimum, not a suggestion. If you stop early, the system will automatically continue you.')
518493
+ ],
518290
518494
  ...[]
518291
518495
  ];
518292
518496
  const resolvedDynamicSections = await resolveSystemPromptSections(dynamicSections);
@@ -527808,7 +528012,7 @@ function Feedback({
527808
528012
  platform: env4.platform,
527809
528013
  gitRepo: envInfo.isGit,
527810
528014
  terminal: env4.terminal,
527811
- version: "1.2.20",
528015
+ version: "1.2.22",
527812
528016
  transcript: normalizeMessagesForAPI(messages),
527813
528017
  errors: sanitizedErrors,
527814
528018
  lastApiRequest: getLastAPIRequest(),
@@ -528000,7 +528204,7 @@ function Feedback({
528000
528204
  ", ",
528001
528205
  env4.terminal,
528002
528206
  ", v",
528003
- "1.2.20"
528207
+ "1.2.22"
528004
528208
  ]
528005
528209
  }, undefined, true, undefined, this)
528006
528210
  ]
@@ -528106,7 +528310,7 @@ ${sanitizedDescription}
528106
528310
  ` + `**Environment Info**
528107
528311
  ` + `- Platform: ${env4.platform}
528108
528312
  ` + `- Terminal: ${env4.terminal}
528109
- ` + `- Version: ${"1.2.20"}
528313
+ ` + `- Version: ${"1.2.22"}
528110
528314
  ` + `- Feedback ID: ${feedbackId}
528111
528315
  ` + `
528112
528316
  **Errors**
@@ -530945,9 +531149,9 @@ async function assertMinVersion() {
530945
531149
  if (false) {}
530946
531150
  try {
530947
531151
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
530948
- if (versionConfig.minVersion && lt("1.2.20", versionConfig.minVersion)) {
531152
+ if (versionConfig.minVersion && lt("1.2.22", versionConfig.minVersion)) {
530949
531153
  console.error(`
530950
- It looks like your version of RAYU (${"1.2.20"}) needs an update.
531154
+ It looks like your version of RAYU (${"1.2.22"}) needs an update.
530951
531155
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
530952
531156
 
530953
531157
  To update, please run:
@@ -531146,7 +531350,7 @@ async function installGlobalPackage(specificVersion) {
531146
531350
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
531147
531351
  logEvent("tengu_auto_updater_lock_contention", {
531148
531352
  pid: process.pid,
531149
- currentVersion: "1.2.20"
531353
+ currentVersion: "1.2.22"
531150
531354
  });
531151
531355
  return "in_progress";
531152
531356
  }
@@ -531155,7 +531359,7 @@ async function installGlobalPackage(specificVersion) {
531155
531359
  if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
531156
531360
  logError2(new Error("Windows NPM detected in WSL environment"));
531157
531361
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
531158
- currentVersion: "1.2.20"
531362
+ currentVersion: "1.2.22"
531159
531363
  });
531160
531364
  console.error(`
531161
531365
  Error: Windows NPM detected in WSL
@@ -531690,7 +531894,7 @@ function detectLinuxGlobPatternWarnings() {
531690
531894
  }
531691
531895
  async function getDoctorDiagnostic() {
531692
531896
  const installationType = await getCurrentInstallationType();
531693
- const version2 = typeof MACRO !== "undefined" ? "1.2.20" : "unknown";
531897
+ const version2 = typeof MACRO !== "undefined" ? "1.2.22" : "unknown";
531694
531898
  const installationPath = await getInstallationPath();
531695
531899
  const invokedBinary = getInvokedBinary();
531696
531900
  const multipleInstallations = await detectMultipleInstallations();
@@ -532485,8 +532689,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
532485
532689
  const maxVersion = await getMaxVersion();
532486
532690
  if (maxVersion && gt(version2, maxVersion)) {
532487
532691
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
532488
- if (gte("1.2.20", maxVersion)) {
532489
- logForDebugging(`Native installer: current version ${"1.2.20"} is already at or above maxVersion ${maxVersion}, skipping update`);
532692
+ if (gte("1.2.22", maxVersion)) {
532693
+ logForDebugging(`Native installer: current version ${"1.2.22"} is already at or above maxVersion ${maxVersion}, skipping update`);
532490
532694
  logEvent("tengu_native_update_skipped_max_version", {
532491
532695
  latency_ms: Date.now() - startTime,
532492
532696
  max_version: maxVersion,
@@ -532497,7 +532701,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
532497
532701
  version2 = maxVersion;
532498
532702
  }
532499
532703
  }
532500
- if (!forceReinstall && version2 === "1.2.20" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
532704
+ if (!forceReinstall && version2 === "1.2.22" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
532501
532705
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
532502
532706
  logEvent("tengu_native_update_complete", {
532503
532707
  latency_ms: Date.now() - startTime,
@@ -533693,7 +533897,7 @@ function buildPrimarySection() {
533693
533897
  }, undefined, false, undefined, this);
533694
533898
  return [{
533695
533899
  label: "Version",
533696
- value: "1.2.20"
533900
+ value: "1.2.22"
533697
533901
  }, {
533698
533902
  label: "Session name",
533699
533903
  value: nameValue
@@ -537384,7 +537588,7 @@ function Config({
537384
537588
  }
537385
537589
  }, undefined, false, undefined, this)
537386
537590
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime170.jsxDEV(ChannelDowngradeDialog, {
537387
- currentVersion: "1.2.20",
537591
+ currentVersion: "1.2.22",
537388
537592
  onChoice: (choice) => {
537389
537593
  setShowSubmenu(null);
537390
537594
  setTabsHidden(false);
@@ -537396,7 +537600,7 @@ function Config({
537396
537600
  autoUpdatesChannel: "stable"
537397
537601
  };
537398
537602
  if (choice === "stay") {
537399
- newSettings.minimumVersion = "1.2.20";
537603
+ newSettings.minimumVersion = "1.2.22";
537400
537604
  }
537401
537605
  updateSettingsForSource("userSettings", newSettings);
537402
537606
  setSettingsData((prev_27) => ({
@@ -545456,7 +545660,7 @@ function HelpV2(t0) {
545456
545660
  let t6;
545457
545661
  if ($3[31] !== tabs) {
545458
545662
  t6 = /* @__PURE__ */ jsx_dev_runtime197.jsxDEV(Tabs, {
545459
- title: `Rayu-CLI v${"1.2.20"}`,
545663
+ title: `Rayu-CLI v${"1.2.22"}`,
545460
545664
  color: "professionalBlue",
545461
545665
  defaultTab: "general",
545462
545666
  children: tabs
@@ -565420,7 +565624,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
565420
565624
  }
565421
565625
  return [];
565422
565626
  }
565423
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.2.20") {
565627
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.2.22") {
565424
565628
  if (false) {}
565425
565629
  const cachedChangelog = await getStoredChangelog();
565426
565630
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -565433,7 +565637,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.2.20")
565433
565637
  releaseNotes
565434
565638
  };
565435
565639
  }
565436
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.2.20") {
565640
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.2.22") {
565437
565641
  if (false) {}
565438
565642
  const releaseNotes = getRecentReleaseNotes(currentVersion, lastSeenVersion);
565439
565643
  return {
@@ -565561,7 +565765,7 @@ function getRecentActivitySync() {
565561
565765
  return cachedActivity;
565562
565766
  }
565563
565767
  function getLogoDisplayData() {
565564
- const version2 = process.env.DEMO_VERSION ?? "1.2.20";
565768
+ const version2 = process.env.DEMO_VERSION ?? "1.2.22";
565565
565769
  const serverUrl = getDirectConnectServerUrl();
565566
565770
  const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
565567
565771
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -566842,7 +567046,7 @@ function LogoV2() {
566842
567046
  if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
566843
567047
  t2 = () => {
566844
567048
  const currentConfig = getGlobalConfig();
566845
- if (currentConfig.lastReleaseNotesSeen === "1.2.20") {
567049
+ if (currentConfig.lastReleaseNotesSeen === "1.2.22") {
566846
567050
  return;
566847
567051
  }
566848
567052
  saveGlobalConfig(_temp327);
@@ -567518,12 +567722,12 @@ function LogoV2() {
567518
567722
  return t41;
567519
567723
  }
567520
567724
  function _temp327(current) {
567521
- if (current.lastReleaseNotesSeen === "1.2.20") {
567725
+ if (current.lastReleaseNotesSeen === "1.2.22") {
567522
567726
  return current;
567523
567727
  }
567524
567728
  return {
567525
567729
  ...current,
567526
- lastReleaseNotesSeen: "1.2.20"
567730
+ lastReleaseNotesSeen: "1.2.22"
567527
567731
  };
567528
567732
  }
567529
567733
  function _temp241(s_0) {
@@ -574033,6 +574237,82 @@ var init_review = __esm(() => {
574033
574237
  review_default = review;
574034
574238
  });
574035
574239
 
574240
+ // src/commands/ultraplan-local/index.ts
574241
+ var command6, ultraplan_local_default;
574242
+ var init_ultraplan_local = __esm(() => {
574243
+ command6 = {
574244
+ type: "prompt",
574245
+ name: "ultraplan",
574246
+ description: "Deep multi-agent planning: explore in parallel, weigh approaches, produce a step-by-step plan for approval — runs locally on your provider",
574247
+ argumentHint: "[task description]",
574248
+ contentLength: 0,
574249
+ progressMessage: "running deep multi-agent planning",
574250
+ source: "builtin",
574251
+ async getPromptForCommand(args) {
574252
+ const task = (args ?? "").trim();
574253
+ const taskLine = task ? `The task to plan:
574254
+
574255
+ ${task}` : "Plan the current task / the request just discussed in this conversation.";
574256
+ return [
574257
+ {
574258
+ type: "text",
574259
+ text: `You are now in ULTRAPLAN mode — extended, multi-agent planning. Produce a thorough, well-researched plan. Do NOT write or edit any code yet; planning only.
574260
+
574261
+ ${taskLine}
574262
+
574263
+ ## How to ultraplan
574264
+ 1. Decompose the problem and decide what needs investigating. Identify the unknowns: existing code/conventions to follow, constraints, integration points, risks.
574265
+ 2. Investigate IN PARALLEL. In a SINGLE message, dispatch multiple subagents via the Agent tool to explore different angles concurrently — prefer the Explore agent (and the general-purpose agent) for codebase research, and any relevant specialists (PA for architecture, SEC for security-sensitive work, DB/BE/FE/MOB/DO for their domains). If the Explore agent is unavailable, use general-purpose agents. Give each a focused question; do the domain research via subagents rather than doing it all yourself.
574266
+ 3. Synthesize the findings into a clear picture of the current state and the target state.
574267
+ 4. Consider MULTIPLE approaches. Lay out at least the leading 1–2 viable options with explicit tradeoffs (complexity, risk, blast radius, reversibility), then recommend one and say why.
574268
+ 5. Produce a concrete, step-by-step implementation plan: ordered tasks, the files/modules each touches, how each step will be verified (build/tests), and any open questions or assumptions.
574269
+ 6. Present the plan for approval using ExitPlanMode (do not start implementing until the user approves).
574270
+
574271
+ Begin by stating the decomposition and your Wave 1 parallel exploration dispatch.`
574272
+ }
574273
+ ];
574274
+ }
574275
+ };
574276
+ ultraplan_local_default = command6;
574277
+ });
574278
+
574279
+ // src/commands/ultrareview-local/index.ts
574280
+ var command7, ultrareview_local_default;
574281
+ var init_ultrareview_local = __esm(() => {
574282
+ command7 = {
574283
+ type: "prompt",
574284
+ name: "ultrareview",
574285
+ description: "Deep bug-hunt on your branch: parallel review subagents find and verify bugs — runs locally on your provider",
574286
+ argumentHint: "[PR number, or empty for current branch]",
574287
+ contentLength: 0,
574288
+ progressMessage: "running deep multi-agent bug-hunt",
574289
+ source: "builtin",
574290
+ async getPromptForCommand(args) {
574291
+ const pr = (args ?? "").trim();
574292
+ const scopeLine = pr ? `Review pull request #${pr}: get its diff with \`gh pr diff ${pr}\` (and \`gh pr view ${pr}\` for context).` : "Review the current branch: determine the diff against the base branch (try `git merge-base HEAD origin/main` / `origin/master`, falling back to `main`/`master`); also include uncommitted changes via `git diff` and `git diff --staged`.";
574293
+ return [
574294
+ {
574295
+ type: "text",
574296
+ text: `You are now in ULTRAREVIEW mode — a deep, multi-agent bug-hunt. Find real, verified bugs in the changed code. This is a review only: do NOT modify code.
574297
+
574298
+ ## Scope
574299
+ ${scopeLine}
574300
+ First establish exactly which files and hunks changed before reviewing.
574301
+
574302
+ ## How to ultrareview
574303
+ 1. Gather the diff and the list of changed files/areas. Briefly group them by concern.
574304
+ 2. Hunt IN PARALLEL. In a SINGLE message, dispatch multiple subagents via the Agent tool to review different areas/concerns concurrently. Cover: correctness & logic errors, edge cases & error handling, security (use the SEC specialist for auth/input-handling/secrets), performance, and test coverage gaps. Use the Explore / general-purpose agents to trace how changed code is actually used elsewhere.
574305
+ 3. VERIFY every candidate bug before reporting it: trace the actual code path, check callers/usages, and confirm it's a genuine defect — discard false positives and anything that's merely stylistic.
574306
+ 4. Report a single prioritized list. For each finding: severity (critical / high / medium / low), \`file:line\`, a concise explanation of the bug and how it triggers, and a concrete suggested fix. If you found no verified bugs, say so plainly rather than inventing issues.
574307
+
574308
+ Begin by gathering the diff, then state your parallel review dispatch.`
574309
+ }
574310
+ ];
574311
+ }
574312
+ };
574313
+ ultrareview_local_default = command7;
574314
+ });
574315
+
574036
574316
  // src/commands/generate-image.ts
574037
574317
  var generateImage2, generate_image_default;
574038
574318
  var init_generate_image = __esm(() => {
@@ -580546,16 +580826,16 @@ var init_vim = __esm(() => {
580546
580826
  });
580547
580827
 
580548
580828
  // src/commands/vim/index.ts
580549
- var command6, vim_default;
580829
+ var command8, vim_default;
580550
580830
  var init_vim2 = __esm(() => {
580551
- command6 = {
580831
+ command8 = {
580552
580832
  name: "vim",
580553
580833
  description: "Toggle between Vim and Normal editing modes",
580554
580834
  supportsNonInteractive: false,
580555
580835
  type: "local",
580556
580836
  load: () => Promise.resolve().then(() => (init_vim(), exports_vim))
580557
580837
  };
580558
- vim_default = command6;
580838
+ vim_default = command8;
580559
580839
  });
580560
580840
 
580561
580841
  // src/commands/thinkback/thinkback.tsx
@@ -592192,7 +592472,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
592192
592472
  smapsRollup,
592193
592473
  platform: process.platform,
592194
592474
  nodeVersion: process.version,
592195
- ccVersion: "1.2.20"
592475
+ ccVersion: "1.2.22"
592196
592476
  };
592197
592477
  }
592198
592478
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -592720,7 +593000,7 @@ var init_bridge_kick = __esm(() => {
592720
593000
  var call47 = async () => {
592721
593001
  return {
592722
593002
  type: "text",
592723
- value: "1.2.20"
593003
+ value: "1.2.22"
592724
593004
  };
592725
593005
  }, version2, version_default;
592726
593006
  var init_version = __esm(() => {
@@ -593958,11 +594238,11 @@ var init_sandbox_toggle = __esm(() => {
593958
594238
  });
593959
594239
 
593960
594240
  // src/commands/sandbox-toggle/index.ts
593961
- var command7, sandbox_toggle_default;
594241
+ var command9, sandbox_toggle_default;
593962
594242
  var init_sandbox_toggle2 = __esm(() => {
593963
594243
  init_figures();
593964
594244
  init_sandbox_adapter();
593965
- command7 = {
594245
+ command9 = {
593966
594246
  name: "sandbox",
593967
594247
  get description() {
593968
594248
  const currentlyEnabled = SandboxManager2.isSandboxingEnabled();
@@ -593994,7 +594274,7 @@ var init_sandbox_toggle2 = __esm(() => {
593994
594274
  type: "local-jsx",
593995
594275
  load: () => Promise.resolve().then(() => (init_sandbox_toggle(), exports_sandbox_toggle))
593996
594276
  };
593997
- sandbox_toggle_default = command7;
594277
+ sandbox_toggle_default = command9;
593998
594278
  });
593999
594279
 
594000
594280
  // src/commands/contactMe/contactMe.ts
@@ -594151,7 +594431,7 @@ function registerBundledSkill(definition) {
594151
594431
  return prependBaseDir(blocks, extractedDir);
594152
594432
  };
594153
594433
  }
594154
- const command8 = {
594434
+ const command10 = {
594155
594435
  type: "prompt",
594156
594436
  name: definition.name,
594157
594437
  description: definition.description,
@@ -594175,7 +594455,7 @@ function registerBundledSkill(definition) {
594175
594455
  progressMessage: "running",
594176
594456
  getPromptForCommand
594177
594457
  };
594178
- bundledSkills.push(command8);
594458
+ bundledSkills.push(command10);
594179
594459
  }
594180
594460
  function getBundledSkills() {
594181
594461
  return [...bundledSkills];
@@ -600188,10 +600468,10 @@ function extractToolStats(log3) {
600188
600468
  `) + 1;
600189
600469
  }
600190
600470
  }
600191
- const command8 = input.command || "";
600192
- if (command8.includes("git commit"))
600471
+ const command10 = input.command || "";
600472
+ if (command10.includes("git commit"))
600193
600473
  gitCommits++;
600194
- if (command8.includes("git push"))
600474
+ if (command10.includes("git push"))
600195
600475
  gitPushes++;
600196
600476
  }
600197
600477
  }
@@ -601547,7 +601827,7 @@ function generateHtmlReport(data, insights) {
601547
601827
  </html>`;
601548
601828
  }
601549
601829
  function buildExportData(data, insights, facets, remoteStats) {
601550
- const version3 = typeof MACRO !== "undefined" ? "1.2.20" : "unknown";
601830
+ const version3 = typeof MACRO !== "undefined" ? "1.2.22" : "unknown";
601551
601831
  const remote_hosts_collected = remoteStats?.hosts.filter((h3) => h3.sessionCount > 0).map((h3) => h3.name);
601552
601832
  const facets_summary = {
601553
601833
  total: facets.size,
@@ -602238,14 +602518,14 @@ function hasCommand(commandName, commands) {
602238
602518
  return findCommand(commandName, commands) !== undefined;
602239
602519
  }
602240
602520
  function getCommand(commandName, commands) {
602241
- const command8 = findCommand(commandName, commands);
602242
- if (!command8) {
602521
+ const command10 = findCommand(commandName, commands);
602522
+ if (!command10) {
602243
602523
  throw ReferenceError(`Command ${commandName} not found. Available commands: ${commands.map((_2) => {
602244
602524
  const name = getCommandName(_2);
602245
602525
  return _2.aliases ? `${name} (aliases: ${_2.aliases.join(", ")})` : name;
602246
602526
  }).sort((a2, b3) => a2.localeCompare(b3)).join(", ")}`);
602247
602527
  }
602248
- return command8;
602528
+ return command10;
602249
602529
  }
602250
602530
  function formatDescriptionWithSource(cmd) {
602251
602531
  if (cmd.type !== "prompt") {
@@ -602307,6 +602587,8 @@ var init_commands2 = __esm(() => {
602307
602587
  init_review_detial2();
602308
602588
  init_resume2();
602309
602589
  init_review();
602590
+ init_ultraplan_local();
602591
+ init_ultrareview_local();
602310
602592
  init_generate_image();
602311
602593
  init_image_editor();
602312
602594
  init_image_video();
@@ -602461,7 +602743,8 @@ var init_commands2 = __esm(() => {
602461
602743
  theme_default,
602462
602744
  feedback_default,
602463
602745
  review_default,
602464
- ultrareview,
602746
+ ultraplan_local_default,
602747
+ ultrareview_local_default,
602465
602748
  generate_image_default,
602466
602749
  image_editor_default,
602467
602750
  image_video_default,
@@ -605476,7 +605759,7 @@ var init_sessionStorage = __esm(() => {
605476
605759
  init_settings2();
605477
605760
  init_slowOperations();
605478
605761
  init_uuid();
605479
- VERSION6 = typeof MACRO !== "undefined" ? "1.2.20" : "unknown";
605762
+ VERSION6 = typeof MACRO !== "undefined" ? "1.2.22" : "unknown";
605480
605763
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
605481
605764
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
605482
605765
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -606695,7 +606978,7 @@ var init_filesystem = __esm(() => {
606695
606978
  });
606696
606979
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
606697
606980
  const nonce = randomBytes18(16).toString("hex");
606698
- return join150(getClaudeTempDir(), "bundled-skills", "1.2.20", nonce);
606981
+ return join150(getClaudeTempDir(), "bundled-skills", "1.2.22", nonce);
606699
606982
  });
606700
606983
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
606701
606984
  });
@@ -608141,7 +608424,7 @@ function executeInBackground({
608141
608424
  asyncResponse,
608142
608425
  hookEvent,
608143
608426
  hookName,
608144
- command: command8,
608427
+ command: command10,
608145
608428
  asyncRewake,
608146
608429
  pluginId
608147
608430
  }) {
@@ -608179,7 +608462,7 @@ function executeInBackground({
608179
608462
  asyncResponse,
608180
608463
  hookEvent,
608181
608464
  hookName,
608182
- command: command8,
608465
+ command: command10,
608183
608466
  shellCommand,
608184
608467
  pluginId
608185
608468
  });
@@ -608296,7 +608579,7 @@ function parseHttpHookOutput(body) {
608296
608579
  }
608297
608580
  function processHookJSONOutput({
608298
608581
  json: json2,
608299
- command: command8,
608582
+ command: command10,
608300
608583
  hookName,
608301
608584
  toolUseID,
608302
608585
  hookEvent,
@@ -608323,7 +608606,7 @@ function processHookJSONOutput({
608323
608606
  result.permissionBehavior = "deny";
608324
608607
  result.blockingError = {
608325
608608
  blockingError: json2.reason || "Blocked by hook",
608326
- command: command8
608609
+ command: command10
608327
608610
  };
608328
608611
  break;
608329
608612
  default:
@@ -608342,7 +608625,7 @@ function processHookJSONOutput({
608342
608625
  result.permissionBehavior = "deny";
608343
608626
  result.blockingError = {
608344
608627
  blockingError: json2.reason || "Blocked by hook",
608345
- command: command8
608628
+ command: command10
608346
608629
  };
608347
608630
  break;
608348
608631
  case "ask":
@@ -608370,7 +608653,7 @@ function processHookJSONOutput({
608370
608653
  result.permissionBehavior = "deny";
608371
608654
  result.blockingError = {
608372
608655
  blockingError: json2.hookSpecificOutput.permissionDecisionReason || json2.reason || "Blocked by hook",
608373
- command: command8
608656
+ command: command10
608374
608657
  };
608375
608658
  break;
608376
608659
  case "ask":
@@ -608430,7 +608713,7 @@ function processHookJSONOutput({
608430
608713
  if (json2.hookSpecificOutput.action === "decline") {
608431
608714
  result.blockingError = {
608432
608715
  blockingError: json2.reason || "Elicitation denied by hook",
608433
- command: command8
608716
+ command: command10
608434
608717
  };
608435
608718
  }
608436
608719
  }
@@ -608444,7 +608727,7 @@ function processHookJSONOutput({
608444
608727
  if (json2.hookSpecificOutput.action === "decline") {
608445
608728
  result.blockingError = {
608446
608729
  blockingError: json2.reason || "Elicitation result blocked by hook",
608447
- command: command8
608730
+ command: command10
608448
608731
  };
608449
608732
  }
608450
608733
  }
@@ -608468,7 +608751,7 @@ function processHookJSONOutput({
608468
608751
  stdout,
608469
608752
  stderr,
608470
608753
  exitCode,
608471
- command: command8,
608754
+ command: command10,
608472
608755
  durationMs
608473
608756
  })
608474
608757
  };
@@ -608483,29 +608766,29 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
608483
608766
  const isPowerShell = shellType === "powershell";
608484
608767
  const toHookPath = isWindows2 && !isPowerShell ? (p) => windowsPathToPosixPath(p) : (p) => p;
608485
608768
  const projectDir = getProjectRoot();
608486
- let command8 = hook.command;
608769
+ let command10 = hook.command;
608487
608770
  let pluginOpts;
608488
608771
  if (pluginRoot) {
608489
608772
  if (!await pathExists(pluginRoot)) {
608490
608773
  throw new Error(`Plugin directory does not exist: ${pluginRoot}` + (pluginId ? ` (${pluginId} — run /plugin to reinstall)` : ""));
608491
608774
  }
608492
608775
  const rootPath = toHookPath(pluginRoot);
608493
- command8 = command8.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, () => rootPath);
608776
+ command10 = command10.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, () => rootPath);
608494
608777
  if (pluginId) {
608495
608778
  const dataPath = toHookPath(getPluginDataDir(pluginId));
608496
- command8 = command8.replace(/\$\{CLAUDE_PLUGIN_DATA\}/g, () => dataPath);
608779
+ command10 = command10.replace(/\$\{CLAUDE_PLUGIN_DATA\}/g, () => dataPath);
608497
608780
  }
608498
608781
  if (pluginId) {
608499
608782
  pluginOpts = loadPluginOptions(pluginId);
608500
- command8 = substituteUserConfigVariables(command8, pluginOpts);
608783
+ command10 = substituteUserConfigVariables(command10, pluginOpts);
608501
608784
  }
608502
608785
  }
608503
- if (isWindows2 && !isPowerShell && command8.trim().match(/\.sh(\s|$|")/)) {
608504
- if (!command8.trim().startsWith("bash ")) {
608505
- command8 = `bash ${command8}`;
608786
+ if (isWindows2 && !isPowerShell && command10.trim().match(/\.sh(\s|$|")/)) {
608787
+ if (!command10.trim().startsWith("bash ")) {
608788
+ command10 = `bash ${command10}`;
608506
608789
  }
608507
608790
  }
608508
- const finalCommand = !isPowerShell && process.env.CLAUDE_CODE_SHELL_PREFIX ? formatShellPrefixCommand(process.env.CLAUDE_CODE_SHELL_PREFIX, command8) : command8;
608791
+ const finalCommand = !isPowerShell && process.env.CLAUDE_CODE_SHELL_PREFIX ? formatShellPrefixCommand(process.env.CLAUDE_CODE_SHELL_PREFIX, command10) : command10;
608509
608792
  const hookTimeoutMs = hook.timeout ? hook.timeout * 1000 : TOOL_HOOK_EXECUTION_TIMEOUT_MS;
608510
608793
  const envVars = {
608511
608794
  ...subprocessEnv(),
@@ -611810,7 +612093,7 @@ __export(exports_update, {
611810
612093
  import { execFileSync as execFileSync3 } from "node:child_process";
611811
612094
  import { homedir as homedir33 } from "os";
611812
612095
  async function update() {
611813
- writeToStdout(`Current version: ${"1.2.20"}
612096
+ writeToStdout(`Current version: ${"1.2.22"}
611814
612097
  `);
611815
612098
  const isBundled = isInBundledMode();
611816
612099
  if (isBundled) {
@@ -611836,13 +612119,13 @@ Manual check: npm view ${"@rayu-dev/rayu-cli"} version
611836
612119
  process.exit(1);
611837
612120
  return;
611838
612121
  }
611839
- if (latestVersion === "1.2.20") {
612122
+ if (latestVersion === "1.2.22") {
611840
612123
  writeToStdout(source_default.green(`
611841
- Rayu CLI is up to date (${"1.2.20"})
612124
+ Rayu CLI is up to date (${"1.2.22"})
611842
612125
  `));
611843
612126
  process.exit(0);
611844
612127
  }
611845
- writeToStdout(`New version available: ${latestVersion} (current: ${"1.2.20"})
612128
+ writeToStdout(`New version available: ${latestVersion} (current: ${"1.2.22"})
611846
612129
  `);
611847
612130
  writeToStdout(`Installing update...
611848
612131
 
@@ -611866,7 +612149,7 @@ Try manually:
611866
612149
  return;
611867
612150
  }
611868
612151
  writeToStdout(source_default.green(`
611869
- Successfully updated from ${"1.2.20"} to ${latestVersion}
612152
+ Successfully updated from ${"1.2.22"} to ${latestVersion}
611870
612153
  `));
611871
612154
  process.exit(0);
611872
612155
  }
@@ -611880,14 +612163,14 @@ async function updateNativeBinary() {
611880
612163
  } catch {
611881
612164
  latestVersion = "";
611882
612165
  }
611883
- if (latestVersion && latestVersion === "1.2.20") {
612166
+ if (latestVersion && latestVersion === "1.2.22") {
611884
612167
  writeToStdout(source_default.green(`
611885
- Rayu CLI is up to date (1.2.20)
612168
+ Rayu CLI is up to date (1.2.22)
611886
612169
  `));
611887
612170
  process.exit(0);
611888
612171
  }
611889
612172
  if (latestVersion) {
611890
- writeToStdout(`New version available: ${latestVersion} (current: 1.2.20)
612173
+ writeToStdout(`New version available: ${latestVersion} (current: 1.2.22)
611891
612174
  `);
611892
612175
  }
611893
612176
  writeToStdout(`Downloading and installing update...
@@ -611902,13 +612185,13 @@ Rayu CLI is up to date (1.2.20)
611902
612185
  return;
611903
612186
  }
611904
612187
  writeToStdout(source_default.green(`
611905
- Rayu CLI is up to date (1.2.20)
612188
+ Rayu CLI is up to date (1.2.22)
611906
612189
  `));
611907
612190
  process.exit(0);
611908
612191
  }
611909
612192
  const updatedTo = result.latestVersion ?? latestVersion ?? "latest";
611910
612193
  writeToStdout(source_default.green(`
611911
- Successfully updated from 1.2.20 to ${updatedTo}
612194
+ Successfully updated from 1.2.22 to ${updatedTo}
611912
612195
  `));
611913
612196
  writeToStdout(`Restart your terminal to use the new version.
611914
612197
  `);
@@ -611939,7 +612222,7 @@ __export(exports_uninstall, {
611939
612222
  import { execFileSync as execFileSync4 } from "node:child_process";
611940
612223
  import { homedir as homedir34 } from "os";
611941
612224
  async function uninstall() {
611942
- writeToStdout(`Uninstalling Rayu CLI (${"1.2.20"})...
612225
+ writeToStdout(`Uninstalling Rayu CLI (${"1.2.22"})...
611943
612226
  `);
611944
612227
  writeToStdout(`Running: npm uninstall -g ${"@rayu-dev/rayu-cli"}
611945
612228
 
@@ -611962,7 +612245,7 @@ Try running manually:
611962
612245
  process.exit(1);
611963
612246
  }
611964
612247
  writeToStdout(source_default.green(`
611965
- Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.2.20"}
612248
+ Successfully uninstalled ${"@rayu-dev/rayu-cli"} ${"1.2.22"}
611966
612249
  `));
611967
612250
  writeToStdout(`Thanks for using Rayu CLI!
611968
612251
  `);
@@ -612014,7 +612297,7 @@ function showFirstRunWelcome() {
612014
612297
  `);
612015
612298
  try {
612016
612299
  mkdirSync13(getRayuConfigHomeDir(), { recursive: true });
612017
- writeFileSync15(markerPath(), "1.2.20", "utf8");
612300
+ writeFileSync15(markerPath(), "1.2.22", "utf8");
612018
612301
  } catch {}
612019
612302
  }
612020
612303
  var init_firstRun = __esm(() => {
@@ -612208,8 +612491,8 @@ var require_help = __commonJS((exports) => {
612208
612491
  return argument.name();
612209
612492
  }
612210
612493
  longestSubcommandTermLength(cmd, helper) {
612211
- return helper.visibleCommands(cmd).reduce((max2, command8) => {
612212
- return Math.max(max2, helper.subcommandTerm(command8).length);
612494
+ return helper.visibleCommands(cmd).reduce((max2, command10) => {
612495
+ return Math.max(max2, helper.subcommandTerm(command10).length);
612213
612496
  }, 0);
612214
612497
  }
612215
612498
  longestOptionTermLength(cmd, helper) {
@@ -612673,8 +612956,8 @@ var require_command = __commonJS((exports) => {
612673
612956
  }
612674
612957
  _getCommandAndAncestors() {
612675
612958
  const result = [];
612676
- for (let command8 = this;command8; command8 = command8.parent) {
612677
- result.push(command8);
612959
+ for (let command10 = this;command10; command10 = command10.parent) {
612960
+ result.push(command10);
612678
612961
  }
612679
612962
  return result;
612680
612963
  }
@@ -612884,17 +613167,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
612884
613167
  }
612885
613168
  this.options.push(option);
612886
613169
  }
612887
- _registerCommand(command8) {
613170
+ _registerCommand(command10) {
612888
613171
  const knownBy = (cmd) => {
612889
613172
  return [cmd.name()].concat(cmd.aliases());
612890
613173
  };
612891
- const alreadyUsed = knownBy(command8).find((name) => this._findCommand(name));
613174
+ const alreadyUsed = knownBy(command10).find((name) => this._findCommand(name));
612892
613175
  if (alreadyUsed) {
612893
613176
  const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|");
612894
- const newCmd = knownBy(command8).join("|");
613177
+ const newCmd = knownBy(command10).join("|");
612895
613178
  throw new Error(`cannot add command '${newCmd}' as already have command '${existingCmd}'`);
612896
613179
  }
612897
- this.commands.push(command8);
613180
+ this.commands.push(command10);
612898
613181
  }
612899
613182
  addOption(option) {
612900
613183
  this._registerOption(option);
@@ -613586,12 +613869,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
613586
613869
  let suggestion = "";
613587
613870
  if (flag.startsWith("--") && this._showSuggestionAfterError) {
613588
613871
  let candidateFlags = [];
613589
- let command8 = this;
613872
+ let command10 = this;
613590
613873
  do {
613591
- const moreFlags = command8.createHelp().visibleOptions(command8).filter((option) => option.long).map((option) => option.long);
613874
+ const moreFlags = command10.createHelp().visibleOptions(command10).filter((option) => option.long).map((option) => option.long);
613592
613875
  candidateFlags = candidateFlags.concat(moreFlags);
613593
- command8 = command8.parent;
613594
- } while (command8 && !command8._enablePositionalOptions);
613876
+ command10 = command10.parent;
613877
+ } while (command10 && !command10._enablePositionalOptions);
613595
613878
  suggestion = suggestSimilar(flag, candidateFlags);
613596
613879
  }
613597
613880
  const message = `error: unknown option '${flag}'${suggestion}`;
@@ -613611,10 +613894,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
613611
613894
  let suggestion = "";
613612
613895
  if (this._showSuggestionAfterError) {
613613
613896
  const candidateNames = [];
613614
- this.createHelp().visibleCommands(this).forEach((command8) => {
613615
- candidateNames.push(command8.name());
613616
- if (command8.alias())
613617
- candidateNames.push(command8.alias());
613897
+ this.createHelp().visibleCommands(this).forEach((command10) => {
613898
+ candidateNames.push(command10.name());
613899
+ if (command10.alias())
613900
+ candidateNames.push(command10.alias());
613618
613901
  });
613619
613902
  suggestion = suggestSimilar(unknownName, candidateNames);
613620
613903
  }
@@ -613655,18 +613938,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
613655
613938
  alias(alias) {
613656
613939
  if (alias === undefined)
613657
613940
  return this._aliases[0];
613658
- let command8 = this;
613941
+ let command10 = this;
613659
613942
  if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
613660
- command8 = this.commands[this.commands.length - 1];
613943
+ command10 = this.commands[this.commands.length - 1];
613661
613944
  }
613662
- if (alias === command8._name)
613945
+ if (alias === command10._name)
613663
613946
  throw new Error("Command alias can't be the same as its name");
613664
613947
  const matchingCommand = this.parent?._findCommand(alias);
613665
613948
  if (matchingCommand) {
613666
613949
  const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|");
613667
613950
  throw new Error(`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`);
613668
613951
  }
613669
- command8._aliases.push(alias);
613952
+ command10._aliases.push(alias);
613670
613953
  return this;
613671
613954
  }
613672
613955
  aliases(aliases) {
@@ -613730,7 +614013,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
613730
614013
  contextOptions = undefined;
613731
614014
  }
613732
614015
  const context2 = this._getHelpContext(contextOptions);
613733
- this._getCommandAndAncestors().reverse().forEach((command8) => command8.emit("beforeAllHelp", context2));
614016
+ this._getCommandAndAncestors().reverse().forEach((command10) => command10.emit("beforeAllHelp", context2));
613734
614017
  this.emit("beforeHelp", context2);
613735
614018
  let helpInformation = this.helpInformation(context2);
613736
614019
  if (deprecatedCallback) {
@@ -613744,7 +614027,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
613744
614027
  this.emit(this._getHelpOption().long);
613745
614028
  }
613746
614029
  this.emit("afterHelp", context2);
613747
- this._getCommandAndAncestors().forEach((command8) => command8.emit("afterAllHelp", context2));
614030
+ this._getCommandAndAncestors().forEach((command10) => command10.emit("afterAllHelp", context2));
613748
614031
  }
613749
614032
  helpOption(flags, description) {
613750
614033
  if (typeof flags === "boolean") {
@@ -623857,7 +624140,7 @@ async function initializeBetaTracing(resource) {
623857
624140
  });
623858
624141
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
623859
624142
  setLoggerProvider(loggerProvider);
623860
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.2.20");
624143
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.2.22");
623861
624144
  setEventLogger(eventLogger);
623862
624145
  process.on("beforeExit", async () => {
623863
624146
  await loggerProvider?.forceFlush();
@@ -623897,7 +624180,7 @@ async function initializeTelemetry() {
623897
624180
  const platform4 = getPlatform();
623898
624181
  const baseAttributes = {
623899
624182
  [import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
623900
- [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.2.20"
624183
+ [import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.2.22"
623901
624184
  };
623902
624185
  if (platform4 === "wsl") {
623903
624186
  const wslVersion = getWslVersion();
@@ -623942,7 +624225,7 @@ async function initializeTelemetry() {
623942
624225
  } catch {}
623943
624226
  };
623944
624227
  registerCleanup(shutdownTelemetry2);
623945
- return meterProvider2.getMeter("com.anthropic.claude_code", "1.2.20");
624228
+ return meterProvider2.getMeter("com.anthropic.claude_code", "1.2.22");
623946
624229
  }
623947
624230
  const meterProvider = new import_sdk_metrics2.MeterProvider({
623948
624231
  resource,
@@ -623962,7 +624245,7 @@ async function initializeTelemetry() {
623962
624245
  });
623963
624246
  import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
623964
624247
  setLoggerProvider(loggerProvider);
623965
- const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.2.20");
624248
+ const eventLogger = import_api_logs.logs.getLogger("com.anthropic.claude_code.events", "1.2.22");
623966
624249
  setEventLogger(eventLogger);
623967
624250
  logForDebugging("[3P telemetry] Event logger set successfully");
623968
624251
  process.on("beforeExit", async () => {
@@ -624024,7 +624307,7 @@ Current timeout: ${timeoutMs}ms
624024
624307
  }
624025
624308
  };
624026
624309
  registerCleanup(shutdownTelemetry);
624027
- return meterProvider.getMeter("com.anthropic.claude_code", "1.2.20");
624310
+ return meterProvider.getMeter("com.anthropic.claude_code", "1.2.22");
624028
624311
  }
624029
624312
  async function flushTelemetry() {
624030
624313
  const meterProvider = getMeterProvider();
@@ -625537,7 +625820,7 @@ function buildSystemInitMessage(inputs) {
625537
625820
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
625538
625821
  apiKeySource: getAnthropicApiKeyWithSource().source,
625539
625822
  betas: getSdkBetas(),
625540
- claude_code_version: "1.2.20",
625823
+ claude_code_version: "1.2.22",
625541
625824
  output_style: outputStyle2,
625542
625825
  agents: inputs.agents.map((agent) => agent.agentType),
625543
625826
  skills: inputs.skills.filter((s2) => s2.userInvocable !== false).map((skill) => skill.name),
@@ -630666,9 +630949,9 @@ var init_AskUserQuestionPermissionRequest = __esm(() => {
630666
630949
  });
630667
630950
 
630668
630951
  // src/tools/BashTool/destructiveCommandWarning.ts
630669
- function getDestructiveCommandWarning(command8) {
630952
+ function getDestructiveCommandWarning(command10) {
630670
630953
  for (const { pattern, warning } of DESTRUCTIVE_PATTERNS) {
630671
- if (pattern.test(command8)) {
630954
+ if (pattern.test(command10)) {
630672
630955
  return warning;
630673
630956
  }
630674
630957
  }
@@ -630779,9 +631062,9 @@ function findFirstSubcommand(args, spec) {
630779
631062
  }
630780
631063
  return;
630781
631064
  }
630782
- async function buildPrefix(command8, args, spec) {
630783
- const maxDepth = await calculateDepth(command8, args, spec);
630784
- const parts = [command8];
631065
+ async function buildPrefix(command10, args, spec) {
631066
+ const maxDepth = await calculateDepth(command10, args, spec);
631067
+ const parts = [command10];
630785
631068
  const hasSubcommands = !!spec?.subcommands?.length;
630786
631069
  let foundSubcommand = false;
630787
631070
  for (let i4 = 0;i4 < args.length; i4++) {
@@ -630789,7 +631072,7 @@ async function buildPrefix(command8, args, spec) {
630789
631072
  if (!arg || parts.length >= maxDepth)
630790
631073
  break;
630791
631074
  if (arg.startsWith("-")) {
630792
- if (arg === "-c" && ["python", "python3"].includes(command8.toLowerCase()))
631075
+ if (arg === "-c" && ["python", "python3"].includes(command10.toLowerCase()))
630793
631076
  break;
630794
631077
  if (spec?.options) {
630795
631078
  const option = spec.options.find((opt) => Array.isArray(opt.name) ? opt.name.includes(arg) : opt.name === arg);
@@ -630814,9 +631097,9 @@ async function buildPrefix(command8, args, spec) {
630814
631097
  }
630815
631098
  return parts.join(" ");
630816
631099
  }
630817
- async function calculateDepth(command8, args, spec) {
631100
+ async function calculateDepth(command10, args, spec) {
630818
631101
  const firstSubcommand = findFirstSubcommand(args, spec);
630819
- const commandLower = command8.toLowerCase();
631102
+ const commandLower = command10.toLowerCase();
630820
631103
  const key2 = firstSubcommand ? `${commandLower} ${firstSubcommand.toLowerCase()}` : commandLower;
630821
631104
  if (DEPTH_RULES[key2])
630822
631105
  return DEPTH_RULES[key2];
@@ -631131,15 +631414,15 @@ var init_specs = __esm(() => {
631131
631414
  });
631132
631415
 
631133
631416
  // src/utils/bash/registry.ts
631134
- async function loadFigSpec(command8) {
631135
- if (!command8 || command8.includes("/") || command8.includes("\\"))
631417
+ async function loadFigSpec(command10) {
631418
+ if (!command10 || command10.includes("/") || command10.includes("\\"))
631136
631419
  return null;
631137
- if (command8.includes(".."))
631420
+ if (command10.includes(".."))
631138
631421
  return null;
631139
- if (command8.startsWith("-") && command8 !== "-")
631422
+ if (command10.startsWith("-") && command10 !== "-")
631140
631423
  return null;
631141
631424
  try {
631142
- const module = await import(`@withfig/autocomplete/build/${command8}.js`);
631425
+ const module = await import(`@withfig/autocomplete/build/${command10}.js`);
631143
631426
  return module.default || module;
631144
631427
  } catch {
631145
631428
  return null;
@@ -631149,10 +631432,10 @@ var getCommandSpec;
631149
631432
  var init_registry2 = __esm(() => {
631150
631433
  init_memoize2();
631151
631434
  init_specs();
631152
- getCommandSpec = memoizeWithLRU(async (command8) => {
631153
- const spec = specs_default.find((s2) => s2.name === command8) || await loadFigSpec(command8) || null;
631435
+ getCommandSpec = memoizeWithLRU(async (command10) => {
631436
+ const spec = specs_default.find((s2) => s2.name === command10) || await loadFigSpec(command10) || null;
631154
631437
  return spec;
631155
- }, (command8) => command8);
631438
+ }, (command10) => command10);
631156
631439
  });
631157
631440
 
631158
631441
  // src/utils/bash/prefix.ts
@@ -631161,10 +631444,10 @@ function isKnownSubcommand2(arg, spec) {
631161
631444
  return false;
631162
631445
  return spec.subcommands.some((sub) => Array.isArray(sub.name) ? sub.name.includes(arg) : sub.name === arg);
631163
631446
  }
631164
- async function getCommandPrefixStatic(command8, recursionDepth = 0, wrapperCount = 0) {
631447
+ async function getCommandPrefixStatic(command10, recursionDepth = 0, wrapperCount = 0) {
631165
631448
  if (wrapperCount > 2 || recursionDepth > 10)
631166
631449
  return null;
631167
- const parsed = await parseCommand2(command8);
631450
+ const parsed = await parseCommand2(command10);
631168
631451
  if (!parsed)
631169
631452
  return null;
631170
631453
  if (!parsed.commandNode) {
@@ -631187,12 +631470,12 @@ async function getCommandPrefixStatic(command8, recursionDepth = 0, wrapperCount
631187
631470
  const envPrefix = envVars.length ? `${envVars.join(" ")} ` : "";
631188
631471
  return { commandPrefix: prefix ? envPrefix + prefix : null };
631189
631472
  }
631190
- async function handleWrapper(command8, args, recursionDepth, wrapperCount) {
631191
- const spec = await getCommandSpec(command8);
631473
+ async function handleWrapper(command10, args, recursionDepth, wrapperCount) {
631474
+ const spec = await getCommandSpec(command10);
631192
631475
  if (spec?.args) {
631193
631476
  const commandArgIndex = toArray4(spec.args).findIndex((arg) => arg?.isCommand);
631194
631477
  if (commandArgIndex !== -1) {
631195
- const parts = [command8];
631478
+ const parts = [command10];
631196
631479
  for (let i4 = 0;i4 < args.length && i4 <= commandArgIndex; i4++) {
631197
631480
  if (i4 === commandArgIndex) {
631198
631481
  const result2 = await getCommandPrefixStatic(args.slice(i4).join(" "), recursionDepth + 1, wrapperCount + 1);
@@ -631209,14 +631492,14 @@ async function handleWrapper(command8, args, recursionDepth, wrapperCount) {
631209
631492
  }
631210
631493
  const wrapped = args.find((arg) => !arg.startsWith("-") && !NUMERIC.test(arg) && !ENV_VAR.test(arg));
631211
631494
  if (!wrapped)
631212
- return command8;
631495
+ return command10;
631213
631496
  const result = await getCommandPrefixStatic(args.slice(args.indexOf(wrapped)).join(" "), recursionDepth + 1, wrapperCount + 1);
631214
- return !result?.commandPrefix ? null : `${command8} ${result.commandPrefix}`;
631497
+ return !result?.commandPrefix ? null : `${command10} ${result.commandPrefix}`;
631215
631498
  }
631216
- async function getCompoundCommandPrefixesStatic(command8, excludeSubcommand) {
631217
- const subcommands = splitCommand_DEPRECATED(command8);
631499
+ async function getCompoundCommandPrefixesStatic(command10, excludeSubcommand) {
631500
+ const subcommands = splitCommand_DEPRECATED(command10);
631218
631501
  if (subcommands.length <= 1) {
631219
- const result = await getCommandPrefixStatic(command8);
631502
+ const result = await getCommandPrefixStatic(command10);
631220
631503
  return result?.commandPrefix ? [result.commandPrefix] : [];
631221
631504
  }
631222
631505
  const prefixes = [];
@@ -634214,8 +634497,8 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
634214
634497
  const shellCommands = [...new Set(shellRules.flatMap((rule) => {
634215
634498
  if (!rule.ruleContent)
634216
634499
  return [];
634217
- const command8 = permissionRuleExtractPrefix2(rule.ruleContent) ?? rule.ruleContent;
634218
- return commandTransform ? commandTransform(command8) : command8;
634500
+ const command10 = permissionRuleExtractPrefix2(rule.ruleContent) ?? rule.ruleContent;
634501
+ return commandTransform ? commandTransform(command10) : command10;
634219
634502
  }))];
634220
634503
  const hasDirectories = directories.length > 0;
634221
634504
  const hasReadPaths = readPaths.length > 0;
@@ -634330,12 +634613,12 @@ var init_shellPermissionHelpers = __esm(() => {
634330
634613
  });
634331
634614
 
634332
634615
  // src/components/permissions/BashPermissionRequest/bashToolUseOptions.tsx
634333
- function stripBashRedirections(command8) {
634616
+ function stripBashRedirections(command10) {
634334
634617
  const {
634335
634618
  commandWithoutRedirections,
634336
634619
  redirections
634337
- } = extractOutputRedirections(command8);
634338
- return redirections.length > 0 ? commandWithoutRedirections : command8;
634620
+ } = extractOutputRedirections(command10);
634621
+ return redirections.length > 0 ? commandWithoutRedirections : command10;
634339
634622
  }
634340
634623
  function bashToolUseOptions({
634341
634624
  suggestions = [],
@@ -634428,21 +634711,21 @@ function BashPermissionRequest(props) {
634428
634711
  verbose,
634429
634712
  workerBadge
634430
634713
  } = props;
634431
- let command8;
634714
+ let command10;
634432
634715
  let description;
634433
634716
  let t0;
634434
634717
  if ($3[0] !== toolUseConfirm.input) {
634435
634718
  ({
634436
- command: command8,
634719
+ command: command10,
634437
634720
  description
634438
634721
  } = BashTool.inputSchema.parse(toolUseConfirm.input));
634439
- t0 = parseSedEditCommand(command8);
634722
+ t0 = parseSedEditCommand(command10);
634440
634723
  $3[0] = toolUseConfirm.input;
634441
- $3[1] = command8;
634724
+ $3[1] = command10;
634442
634725
  $3[2] = description;
634443
634726
  $3[3] = t0;
634444
634727
  } else {
634445
- command8 = $3[1];
634728
+ command10 = $3[1];
634446
634729
  description = $3[2];
634447
634730
  t0 = $3[3];
634448
634731
  }
@@ -634473,7 +634756,7 @@ function BashPermissionRequest(props) {
634473
634756
  return t12;
634474
634757
  }
634475
634758
  let t1;
634476
- if ($3[12] !== command8 || $3[13] !== description || $3[14] !== onDone || $3[15] !== onReject || $3[16] !== toolUseConfirm || $3[17] !== toolUseContext || $3[18] !== verbose || $3[19] !== workerBadge) {
634759
+ if ($3[12] !== command10 || $3[13] !== description || $3[14] !== onDone || $3[15] !== onReject || $3[16] !== toolUseConfirm || $3[17] !== toolUseContext || $3[18] !== verbose || $3[19] !== workerBadge) {
634477
634760
  t1 = /* @__PURE__ */ jsx_dev_runtime366.jsxDEV(BashPermissionRequestInner, {
634478
634761
  toolUseConfirm,
634479
634762
  toolUseContext,
@@ -634481,10 +634764,10 @@ function BashPermissionRequest(props) {
634481
634764
  onReject,
634482
634765
  verbose,
634483
634766
  workerBadge,
634484
- command: command8,
634767
+ command: command10,
634485
634768
  description
634486
634769
  }, undefined, false, undefined, this);
634487
- $3[12] = command8;
634770
+ $3[12] = command10;
634488
634771
  $3[13] = description;
634489
634772
  $3[14] = onDone;
634490
634773
  $3[15] = onReject;
@@ -634505,7 +634788,7 @@ function BashPermissionRequestInner({
634505
634788
  onReject,
634506
634789
  verbose: _verbose,
634507
634790
  workerBadge,
634508
- command: command8,
634791
+ command: command10,
634509
634792
  description
634510
634793
  }) {
634511
634794
  const [theme2] = useTheme();
@@ -634542,27 +634825,27 @@ function BashPermissionRequestInner({
634542
634825
  if (!isClassifierPermissionsEnabled())
634543
634826
  return;
634544
634827
  const abortController = new AbortController;
634545
- generateGenericDescription(command8, description, abortController.signal).then((generic) => {
634828
+ generateGenericDescription(command10, description, abortController.signal).then((generic) => {
634546
634829
  if (generic && !abortController.signal.aborted) {
634547
634830
  setClassifierDescription(generic);
634548
634831
  setInitialClassifierDescriptionEmpty(false);
634549
634832
  }
634550
634833
  }).catch(() => {});
634551
634834
  return () => abortController.abort();
634552
- }, [command8, description]);
634835
+ }, [command10, description]);
634553
634836
  const isCompound = toolUseConfirm.permissionResult.decisionReason?.type === "subcommandResults";
634554
634837
  const [editablePrefix, setEditablePrefix] = import_react205.useState(() => {
634555
634838
  if (isCompound) {
634556
634839
  const backendBashRules = extractRules("suggestions" in toolUseConfirm.permissionResult ? toolUseConfirm.permissionResult.suggestions : undefined).filter((r2) => r2.toolName === BashTool.name && r2.ruleContent);
634557
634840
  return backendBashRules.length === 1 ? backendBashRules[0].ruleContent : undefined;
634558
634841
  }
634559
- const two = getSimpleCommandPrefix(command8);
634842
+ const two = getSimpleCommandPrefix(command10);
634560
634843
  if (two)
634561
634844
  return `${two}:*`;
634562
- const one = getFirstWordPrefix(command8);
634845
+ const one = getFirstWordPrefix(command10);
634563
634846
  if (one)
634564
634847
  return `${one}:*`;
634565
- return command8;
634848
+ return command10;
634566
634849
  });
634567
634850
  const hasUserEditedPrefix = import_react205.useRef(false);
634568
634851
  const onEditablePrefixChange = import_react205.useCallback((value) => {
@@ -634573,7 +634856,7 @@ function BashPermissionRequestInner({
634573
634856
  if (isCompound)
634574
634857
  return;
634575
634858
  let cancelled = false;
634576
- getCompoundCommandPrefixesStatic(command8, (subcmd) => BashTool.isReadOnly({
634859
+ getCompoundCommandPrefixesStatic(command10, (subcmd) => BashTool.isReadOnly({
634577
634860
  command: subcmd
634578
634861
  })).then((prefixes) => {
634579
634862
  if (cancelled || hasUserEditedPrefix.current)
@@ -634585,14 +634868,14 @@ function BashPermissionRequestInner({
634585
634868
  return () => {
634586
634869
  cancelled = true;
634587
634870
  };
634588
- }, [command8, isCompound]);
634871
+ }, [command10, isCompound]);
634589
634872
  const [classifierWasChecking] = import_react205.useState(false);
634590
634873
  const {
634591
634874
  destructiveWarning: destructiveWarning_0,
634592
634875
  sandboxingEnabled: sandboxingEnabled_0,
634593
634876
  isSandboxed: isSandboxed_0
634594
634877
  } = import_react205.useMemo(() => {
634595
- const destructiveWarning = getFeatureValue_CACHED_MAY_BE_STALE("tengu_destructive_command_warning", false) ? getDestructiveCommandWarning(command8) : null;
634878
+ const destructiveWarning = getFeatureValue_CACHED_MAY_BE_STALE("tengu_destructive_command_warning", false) ? getDestructiveCommandWarning(command10) : null;
634596
634879
  const sandboxingEnabled = SandboxManager2.isSandboxingEnabled();
634597
634880
  const isSandboxed = sandboxingEnabled && shouldUseSandbox(toolUseConfirm.input);
634598
634881
  return {
@@ -634600,7 +634883,7 @@ function BashPermissionRequestInner({
634600
634883
  sandboxingEnabled,
634601
634884
  isSandboxed
634602
634885
  };
634603
- }, [command8, toolUseConfirm.input]);
634886
+ }, [command10, toolUseConfirm.input]);
634604
634887
  const unaryEvent = import_react205.useMemo(() => ({
634605
634888
  completion_type: "tool_use_single",
634606
634889
  language_name: "none"
@@ -634718,7 +635001,7 @@ function BashPermissionRequestInner({
634718
635001
  /* @__PURE__ */ jsx_dev_runtime366.jsxDEV(ThemedText, {
634719
635002
  dimColor: explainerState.visible,
634720
635003
  children: BashTool.renderToolUseMessage({
634721
- command: command8,
635004
+ command: command10,
634722
635005
  description
634723
635006
  }, {
634724
635007
  theme: theme2,
@@ -637628,9 +637911,9 @@ var init_NotebookEditPermissionRequest = __esm(() => {
637628
637911
  });
637629
637912
 
637630
637913
  // src/tools/PowerShellTool/destructiveCommandWarning.ts
637631
- function getDestructiveCommandWarning2(command8) {
637914
+ function getDestructiveCommandWarning2(command10) {
637632
637915
  for (const { pattern, warning } of DESTRUCTIVE_PATTERNS2) {
637633
- if (pattern.test(command8)) {
637916
+ if (pattern.test(command10)) {
637634
637917
  return warning;
637635
637918
  }
637636
637919
  }
@@ -637759,8 +638042,8 @@ async function extractPrefixFromElement(cmd) {
637759
638042
  }
637760
638043
  return prefix;
637761
638044
  }
637762
- async function getCompoundCommandPrefixesStatic2(command8, excludeSubcommand) {
637763
- const parsed = await parsePowerShellCommandCached(command8);
638045
+ async function getCompoundCommandPrefixesStatic2(command10, excludeSubcommand) {
638046
+ const parsed = await parsePowerShellCommandCached(command10);
637764
638047
  if (!parsed.valid) {
637765
638048
  return [];
637766
638049
  }
@@ -637917,7 +638200,7 @@ function PowerShellPermissionRequest(props) {
637917
638200
  workerBadge
637918
638201
  } = props;
637919
638202
  const {
637920
- command: command8,
638203
+ command: command10,
637921
638204
  description
637922
638205
  } = PowerShellTool.inputSchema.parse(toolUseConfirm.input);
637923
638206
  const [theme2] = useTheme();
@@ -637946,14 +638229,14 @@ function PowerShellPermissionRequest(props) {
637946
638229
  onReject,
637947
638230
  explainerVisible: explainerState.visible
637948
638231
  });
637949
- const destructiveWarning = getFeatureValue_CACHED_MAY_BE_STALE("tengu_destructive_command_warning", false) ? getDestructiveCommandWarning2(command8) : null;
638232
+ const destructiveWarning = getFeatureValue_CACHED_MAY_BE_STALE("tengu_destructive_command_warning", false) ? getDestructiveCommandWarning2(command10) : null;
637950
638233
  const [showPermissionDebug, setShowPermissionDebug] = import_react209.useState(false);
637951
- const [editablePrefix, setEditablePrefix] = import_react209.useState(command8.includes(`
637952
- `) ? undefined : command8);
638234
+ const [editablePrefix, setEditablePrefix] = import_react209.useState(command10.includes(`
638235
+ `) ? undefined : command10);
637953
638236
  const hasUserEditedPrefix = import_react209.useRef(false);
637954
638237
  import_react209.useEffect(() => {
637955
638238
  let cancelled = false;
637956
- getCompoundCommandPrefixesStatic2(command8, (element) => isAllowlistedCommand(element, element.text)).then((prefixes) => {
638239
+ getCompoundCommandPrefixesStatic2(command10, (element) => isAllowlistedCommand(element, element.text)).then((prefixes) => {
637957
638240
  if (cancelled || hasUserEditedPrefix.current)
637958
638241
  return;
637959
638242
  if (prefixes.length > 0) {
@@ -637963,7 +638246,7 @@ function PowerShellPermissionRequest(props) {
637963
638246
  return () => {
637964
638247
  cancelled = true;
637965
638248
  };
637966
- }, [command8]);
638249
+ }, [command10]);
637967
638250
  const onEditablePrefixChange = import_react209.useCallback((value) => {
637968
638251
  hasUserEditedPrefix.current = true;
637969
638252
  setEditablePrefix(value);
@@ -638068,7 +638351,7 @@ function PowerShellPermissionRequest(props) {
638068
638351
  /* @__PURE__ */ jsx_dev_runtime377.jsxDEV(ThemedText, {
638069
638352
  dimColor: explainerState.visible,
638070
638353
  children: PowerShellTool.renderToolUseMessage({
638071
- command: command8,
638354
+ command: command10,
638072
638355
  description
638073
638356
  }, {
638074
638357
  theme: theme2,
@@ -641746,7 +642029,7 @@ var init_useVoiceEnabled = __esm(() => {
641746
642029
  function getSemverPart(version3) {
641747
642030
  return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
641748
642031
  }
641749
- function useUpdateNotification(updatedVersion, initialVersion = "1.2.20") {
642032
+ function useUpdateNotification(updatedVersion, initialVersion = "1.2.22") {
641750
642033
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react218.useState(() => getSemverPart(initialVersion));
641751
642034
  if (!updatedVersion) {
641752
642035
  return null;
@@ -641786,7 +642069,7 @@ function AutoUpdater({
641786
642069
  return;
641787
642070
  }
641788
642071
  if (false) {}
641789
- const currentVersion = "1.2.20";
642072
+ const currentVersion = "1.2.22";
641790
642073
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
641791
642074
  let latestVersion = await getLatestVersion(channel);
641792
642075
  const isDisabled = isAutoUpdaterDisabled();
@@ -641999,12 +642282,12 @@ function NativeAutoUpdater({
641999
642282
  logEvent("tengu_native_auto_updater_start", {});
642000
642283
  try {
642001
642284
  const maxVersion = await getMaxVersion();
642002
- if (maxVersion && gt("1.2.20", maxVersion)) {
642285
+ if (maxVersion && gt("1.2.22", maxVersion)) {
642003
642286
  const msg = await getMaxVersionMessage();
642004
642287
  setMaxVersionIssue(msg ?? "affects your version");
642005
642288
  }
642006
642289
  const result = await installLatest(channel);
642007
- const currentVersion = "1.2.20";
642290
+ const currentVersion = "1.2.22";
642008
642291
  const latencyMs = Date.now() - startTime;
642009
642292
  if (result.lockFailed) {
642010
642293
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -642141,17 +642424,17 @@ function PackageManagerAutoUpdater(t0) {
642141
642424
  const maxVersion = await getMaxVersion();
642142
642425
  if (maxVersion && latest && gt(latest, maxVersion)) {
642143
642426
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
642144
- if (gte("1.2.20", maxVersion)) {
642145
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.2.20"} is already at or above maxVersion ${maxVersion}, skipping update`);
642427
+ if (gte("1.2.22", maxVersion)) {
642428
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.2.22"} is already at or above maxVersion ${maxVersion}, skipping update`);
642146
642429
  setUpdateAvailable(false);
642147
642430
  return;
642148
642431
  }
642149
642432
  latest = maxVersion;
642150
642433
  }
642151
- const hasUpdate = latest && !gte("1.2.20", latest) && !shouldSkipVersion(latest);
642434
+ const hasUpdate = latest && !gte("1.2.22", latest) && !shouldSkipVersion(latest);
642152
642435
  setUpdateAvailable(!!hasUpdate);
642153
642436
  if (hasUpdate) {
642154
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.2.20"} -> ${latest}`);
642437
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.2.22"} -> ${latest}`);
642155
642438
  }
642156
642439
  };
642157
642440
  $3[0] = t1;
@@ -642185,7 +642468,7 @@ function PackageManagerAutoUpdater(t0) {
642185
642468
  wrap: "truncate",
642186
642469
  children: [
642187
642470
  "currentVersion: ",
642188
- "1.2.20"
642471
+ "1.2.22"
642189
642472
  ]
642190
642473
  }, undefined, true, undefined, this);
642191
642474
  $3[3] = verbose;
@@ -643683,15 +643966,15 @@ function getZshCompletionCommand(prefix, completionType) {
643683
643966
  }
643684
643967
  }
643685
643968
  async function getCompletionsForShell(shellType, prefix, completionType, abortSignal) {
643686
- let command8;
643969
+ let command10;
643687
643970
  if (shellType === "bash") {
643688
- command8 = getBashCompletionCommand(prefix, completionType);
643971
+ command10 = getBashCompletionCommand(prefix, completionType);
643689
643972
  } else if (shellType === "zsh") {
643690
- command8 = getZshCompletionCommand(prefix, completionType);
643973
+ command10 = getZshCompletionCommand(prefix, completionType);
643691
643974
  } else {
643692
643975
  return [];
643693
643976
  }
643694
- const shellCommand = await exec3(command8, abortSignal, "bash", {
643977
+ const shellCommand = await exec3(command10, abortSignal, "bash", {
643695
643978
  timeout: SHELL_COMPLETION_TIMEOUT_MS
643696
643979
  });
643697
643980
  const result = await shellCommand.result;
@@ -645798,8 +646081,8 @@ function hasCommandArgs(input) {
645798
646081
  return false;
645799
646082
  return true;
645800
646083
  }
645801
- function formatCommand(command8) {
645802
- return `/${command8} `;
646084
+ function formatCommand(command10) {
646085
+ return `/${command10} `;
645803
646086
  }
645804
646087
  function getCommandId2(cmd) {
645805
646088
  const commandName = getCommandName(cmd);
@@ -646007,10 +646290,10 @@ async function getShellHistoryCommands() {
646007
646290
  try {
646008
646291
  for await (const entry of getHistory()) {
646009
646292
  if (entry.display && entry.display.startsWith("!")) {
646010
- const command8 = entry.display.slice(1).trim();
646011
- if (command8 && !seen.has(command8)) {
646012
- seen.add(command8);
646013
- commands.push(command8);
646293
+ const command10 = entry.display.slice(1).trim();
646294
+ if (command10 && !seen.has(command10)) {
646295
+ seen.add(command10);
646296
+ commands.push(command10);
646014
646297
  }
646015
646298
  }
646016
646299
  if (commands.length >= 50) {
@@ -646024,15 +646307,15 @@ async function getShellHistoryCommands() {
646024
646307
  shellHistoryCacheTimestamp = now2;
646025
646308
  return commands;
646026
646309
  }
646027
- function prependToShellHistoryCache(command8) {
646310
+ function prependToShellHistoryCache(command10) {
646028
646311
  if (!shellHistoryCache) {
646029
646312
  return;
646030
646313
  }
646031
- const idx = shellHistoryCache.indexOf(command8);
646314
+ const idx = shellHistoryCache.indexOf(command10);
646032
646315
  if (idx !== -1) {
646033
646316
  shellHistoryCache.splice(idx, 1);
646034
646317
  }
646035
- shellHistoryCache.unshift(command8);
646318
+ shellHistoryCache.unshift(command10);
646036
646319
  }
646037
646320
  async function getShellHistoryCompletion(input) {
646038
646321
  if (!input || input.length < 2) {
@@ -646043,11 +646326,11 @@ async function getShellHistoryCompletion(input) {
646043
646326
  return null;
646044
646327
  }
646045
646328
  const commands = await getShellHistoryCommands();
646046
- for (const command8 of commands) {
646047
- if (command8.startsWith(input) && command8 !== input) {
646329
+ for (const command10 of commands) {
646330
+ if (command10.startsWith(input) && command10 !== input) {
646048
646331
  return {
646049
- fullCommand: command8,
646050
- suffix: command8.slice(input.length)
646332
+ fullCommand: command10,
646333
+ suffix: command10.slice(input.length)
646051
646334
  };
646052
646335
  }
646053
646336
  }
@@ -650351,7 +650634,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
650351
650634
  project_dir: getOriginalCwd(),
650352
650635
  added_dirs: addedDirs
650353
650636
  },
650354
- version: "1.2.20",
650637
+ version: "1.2.22",
650355
650638
  output_style: {
650356
650639
  name: outputStyleName
650357
650640
  },
@@ -653005,7 +653288,7 @@ function PromptInput({
653005
653288
  return hasCommand(commandName, commands);
653006
653289
  });
653007
653290
  }, [displayedValue, commands]);
653008
- const tokenBudgetTriggers = import_react251.useMemo(() => [], [displayedValue]);
653291
+ const tokenBudgetTriggers = import_react251.useMemo(() => findTokenBudgetPositions(displayedValue), [displayedValue]);
653009
653292
  const knownChannelsVersion2 = import_react251.useSyncExternalStore(subscribeKnownChannels, getKnownChannelsVersion);
653010
653293
  const slackChannelTriggers = import_react251.useMemo(() => hasSlackMcpServer(store.getState().mcp.clients) ? findSlackChannelPositions(displayedValue) : [], [displayedValue, knownChannelsVersion2]);
653011
653294
  const memberMentionHighlights = import_react251.useMemo(() => {
@@ -661721,7 +662004,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
661721
662004
  } catch {}
661722
662005
  const data = {
661723
662006
  trigger,
661724
- version: "1.2.20",
662007
+ version: "1.2.22",
661725
662008
  platform: process.platform,
661726
662009
  transcript,
661727
662010
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -666042,12 +666325,12 @@ var init_useLspInitializationNotification = __esm(() => {
666042
666325
  });
666043
666326
 
666044
666327
  // src/utils/binaryCheck.ts
666045
- async function isBinaryInstalled(command8) {
666046
- if (!command8 || !command8.trim()) {
666328
+ async function isBinaryInstalled(command10) {
666329
+ if (!command10 || !command10.trim()) {
666047
666330
  logForDebugging("[binaryCheck] Empty command provided, returning false");
666048
666331
  return false;
666049
666332
  }
666050
- const trimmedCommand = command8.trim();
666333
+ const trimmedCommand = command10.trim();
666051
666334
  const cached3 = binaryCache.get(trimmedCommand);
666052
666335
  if (cached3 !== undefined) {
666053
666336
  logForDebugging(`[binaryCheck] Cache hit for '${trimmedCommand}': ${cached3}`);
@@ -666100,13 +666383,13 @@ function isRecord2(value) {
666100
666383
  }
666101
666384
  function extractFromServerConfigRecord(serverConfigs) {
666102
666385
  const extensions = new Set;
666103
- let command8 = null;
666386
+ let command10 = null;
666104
666387
  for (const [_serverName, config5] of Object.entries(serverConfigs)) {
666105
666388
  if (!isRecord2(config5)) {
666106
666389
  continue;
666107
666390
  }
666108
- if (!command8 && typeof config5.command === "string") {
666109
- command8 = config5.command;
666391
+ if (!command10 && typeof config5.command === "string") {
666392
+ command10 = config5.command;
666110
666393
  }
666111
666394
  const extMapping = config5.extensionToLanguage;
666112
666395
  if (isRecord2(extMapping)) {
@@ -666115,10 +666398,10 @@ function extractFromServerConfigRecord(serverConfigs) {
666115
666398
  }
666116
666399
  }
666117
666400
  }
666118
- if (!command8 || extensions.size === 0) {
666401
+ if (!command10 || extensions.size === 0) {
666119
666402
  return null;
666120
666403
  }
666121
- return { extensions, command: command8 };
666404
+ return { extensions, command: command10 };
666122
666405
  }
666123
666406
  async function getLspPluginsFromMarketplaces() {
666124
666407
  const result = new Map;
@@ -668415,8 +668698,8 @@ function isSessionContainerCompatible(messages) {
668415
668698
  }
668416
668699
  if (toolName2 === BASH_TOOL_NAME) {
668417
668700
  const input = block.input;
668418
- const command8 = input?.command || "";
668419
- if (EXTERNAL_COMMAND_PATTERNS.some((p) => p.test(command8))) {
668701
+ const command10 = input?.command || "";
668702
+ if (EXTERNAL_COMMAND_PATTERNS.some((p) => p.test(command10))) {
668420
668703
  return false;
668421
668704
  }
668422
668705
  }
@@ -670311,7 +670594,9 @@ function REPL({
670311
670594
  })]);
670312
670595
  }
670313
670596
  resetLoadingState();
670314
- if (false) {}
670597
+ if (true) {
670598
+ snapshotOutputTokensForTurn(null);
670599
+ }
670315
670600
  if (focusedInputDialog === "tool-permission") {
670316
670601
  toolUseConfirmQueue[0]?.onAbort();
670317
670602
  setToolUseConfirmQueue([]);
@@ -670819,7 +671104,10 @@ Error: sandbox required but unavailable: ${reason}
670819
671104
  resetTimingRefs();
670820
671105
  setMessages((oldMessages) => [...oldMessages, ...newMessages]);
670821
671106
  responseLengthRef.current = 0;
670822
- if (false) {}
671107
+ if (true) {
671108
+ const parsedBudget = input ? parseTokenBudget(input) : null;
671109
+ snapshotOutputTokensForTurn(parsedBudget ?? getCurrentTurnTokenBudget());
671110
+ }
670823
671111
  apiMetricsRef2.current = [];
670824
671112
  setStreamingToolUses([]);
670825
671113
  setStreamingText(null);
@@ -670849,7 +671137,16 @@ Error: sandbox required but unavailable: ${reason}
670849
671137
  sendBridgeResultRef.current();
670850
671138
  if (false) {}
670851
671139
  let budgetInfo;
670852
- if (false) {}
671140
+ if (true) {
671141
+ if (getCurrentTurnTokenBudget() !== null && getCurrentTurnTokenBudget() > 0 && !abortController2.signal.aborted) {
671142
+ budgetInfo = {
671143
+ tokens: getTurnOutputTokens(),
671144
+ limit: getCurrentTurnTokenBudget(),
671145
+ nudges: getBudgetContinuationCount()
671146
+ };
671147
+ }
671148
+ snapshotOutputTokensForTurn(null);
671149
+ }
670853
671150
  const turnDurationMs = Date.now() - loadingStartTimeRef.current - totalPausedMsRef.current;
670854
671151
  if ((turnDurationMs > 30000 || budgetInfo !== undefined) && !abortController2.signal.aborted && !proactiveActive) {
670855
671152
  const hasRunningSwarmAgents = getAllInProcessTeammateTasks(store.getState().tasks).some((t2) => t2.status === "running");
@@ -671276,22 +671573,22 @@ Error: sandbox required but unavailable: ${reason}
671276
671573
  helpers4.clearBuffer();
671277
671574
  }, [setAppState, setInputValue, getToolUseContext, canUseTool, mainLoopModel, addNotification]);
671278
671575
  const handleAutoRunIssue = import_react310.useCallback(() => {
671279
- const command8 = autoRunIssueReason ? getAutoRunCommand(autoRunIssueReason) : "/issue";
671576
+ const command10 = autoRunIssueReason ? getAutoRunCommand(autoRunIssueReason) : "/issue";
671280
671577
  setAutoRunIssueReason(null);
671281
- onSubmit(command8, {
671578
+ onSubmit(command10, {
671282
671579
  setCursorOffset: () => {},
671283
671580
  clearBuffer: () => {},
671284
671581
  resetHistory: () => {}
671285
671582
  }).catch((err2) => {
671286
- logForDebugging(`Auto-run ${command8} failed: ${errorMessage(err2)}`);
671583
+ logForDebugging(`Auto-run ${command10} failed: ${errorMessage(err2)}`);
671287
671584
  });
671288
671585
  }, [onSubmit, autoRunIssueReason]);
671289
671586
  const handleCancelAutoRunIssue = import_react310.useCallback(() => {
671290
671587
  setAutoRunIssueReason(null);
671291
671588
  }, []);
671292
671589
  const handleSurveyRequestFeedback = import_react310.useCallback(() => {
671293
- const command8 = "/feedback";
671294
- onSubmit(command8, {
671590
+ const command10 = "/feedback";
671591
+ onSubmit(command10, {
671295
671592
  setCursorOffset: () => {},
671296
671593
  clearBuffer: () => {},
671297
671594
  resetHistory: () => {}
@@ -673756,7 +674053,7 @@ function WelcomeV2() {
673756
674053
  dimColor: true,
673757
674054
  children: [
673758
674055
  "v",
673759
- "1.2.20"
674056
+ "1.2.22"
673760
674057
  ]
673761
674058
  }, undefined, true, undefined, this)
673762
674059
  ]
@@ -674600,8 +674897,8 @@ function _temp439(command_0) {
674600
674897
  function _temp355(tool_0) {
674601
674898
  return tool_0 === BASH_TOOL_NAME || tool_0.startsWith(BASH_TOOL_NAME + "(");
674602
674899
  }
674603
- function _temp290(command8) {
674604
- return command8.type === "prompt" && command8.loadedFrom === "commands_DEPRECATED" && (command8.source === "projectSettings" || command8.source === "localSettings") && command8.allowedTools?.some(_temp234);
674900
+ function _temp290(command10) {
674901
+ return command10.type === "prompt" && command10.loadedFrom === "commands_DEPRECATED" && (command10.source === "projectSettings" || command10.source === "localSettings") && command10.allowedTools?.some(_temp234);
674605
674902
  }
674606
674903
  function _temp234(tool) {
674607
674904
  return tool === BASH_TOOL_NAME || tool.startsWith(BASH_TOOL_NAME + "(");
@@ -675473,7 +675770,7 @@ function completeOnboarding() {
675473
675770
  saveGlobalConfig((current) => ({
675474
675771
  ...current,
675475
675772
  hasCompletedOnboarding: true,
675476
- lastOnboardingVersion: "1.2.20"
675773
+ lastOnboardingVersion: "1.2.22"
675477
675774
  }));
675478
675775
  }
675479
675776
  function showDialog(root2, renderer) {
@@ -676909,7 +677206,7 @@ function _temp295() {
676909
677206
  function CrossProjectMessage(t0) {
676910
677207
  const $3 = import_compiler_runtime359.c(8);
676911
677208
  const {
676912
- command: command8
677209
+ command: command10
676913
677210
  } = t0;
676914
677211
  let t1;
676915
677212
  if ($3[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -676938,7 +677235,7 @@ function CrossProjectMessage(t0) {
676938
677235
  t3 = $3[2];
676939
677236
  }
676940
677237
  let t4;
676941
- if ($3[3] !== command8) {
677238
+ if ($3[3] !== command10) {
676942
677239
  t4 = /* @__PURE__ */ jsx_dev_runtime467.jsxDEV(ThemedBox_default, {
676943
677240
  flexDirection: "column",
676944
677241
  children: [
@@ -676946,12 +677243,12 @@ function CrossProjectMessage(t0) {
676946
677243
  /* @__PURE__ */ jsx_dev_runtime467.jsxDEV(ThemedText, {
676947
677244
  children: [
676948
677245
  " ",
676949
- command8
677246
+ command10
676950
677247
  ]
676951
677248
  }, undefined, true, undefined, this)
676952
677249
  ]
676953
677250
  }, undefined, true, undefined, this);
676954
- $3[3] = command8;
677251
+ $3[3] = command10;
676955
677252
  $3[4] = t4;
676956
677253
  } else {
676957
677254
  t4 = $3[4];
@@ -677080,9 +677377,9 @@ var init_dialogLaunchers = __esm(() => {
677080
677377
  function initBuiltinPlugins() {}
677081
677378
 
677082
677379
  // src/services/plugins/pluginCliCommands.ts
677083
- function handlePluginCommandError(error54, command8, plugin2) {
677380
+ function handlePluginCommandError(error54, command10, plugin2) {
677084
677381
  logError2(error54);
677085
- const operation = plugin2 ? `${command8} plugin "${plugin2}"` : command8 === "disable-all" ? "disable all plugins" : `${command8} plugins`;
677382
+ const operation = plugin2 ? `${command10} plugin "${plugin2}"` : command10 === "disable-all" ? "disable all plugins" : `${command10} plugins`;
677086
677383
  console.error(`${figures_default.cross} Failed to ${operation}: ${errorMessage(error54)}`);
677087
677384
  const telemetryFields = plugin2 ? (() => {
677088
677385
  const { name, marketplace } = parsePluginIdentifier(plugin2);
@@ -677095,7 +677392,7 @@ function handlePluginCommandError(error54, command8, plugin2) {
677095
677392
  };
677096
677393
  })() : {};
677097
677394
  logEvent("tengu_plugin_command_failed", {
677098
- command: command8,
677395
+ command: command10,
677099
677396
  error_category: classifyPluginCommandError(error54),
677100
677397
  ...telemetryFields
677101
677398
  });
@@ -679773,7 +680070,7 @@ function appendToLog(path30, message) {
679773
680070
  cwd: getFsImplementation().cwd(),
679774
680071
  userType: "external",
679775
680072
  sessionId: getSessionId(),
679776
- version: "1.2.20"
680073
+ version: "1.2.22"
679777
680074
  };
679778
680075
  getLogWriter(path30).write(messageWithTimestamp);
679779
680076
  }
@@ -683877,8 +684174,8 @@ async function getEnvLessBridgeConfig() {
683877
684174
  }
683878
684175
  async function checkEnvLessBridgeMinVersion() {
683879
684176
  const cfg = await getEnvLessBridgeConfig();
683880
- if (cfg.min_version && lt("1.2.20", cfg.min_version)) {
683881
- return `Your version of RAYU (${"1.2.20"}) is too old for Remote Control.
684177
+ if (cfg.min_version && lt("1.2.22", cfg.min_version)) {
684178
+ return `Your version of RAYU (${"1.2.22"}) is too old for Remote Control.
683882
684179
  Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
683883
684180
  }
683884
684181
  return null;
@@ -684352,7 +684649,7 @@ async function initBridgeCore(params) {
684352
684649
  const rawApi = createBridgeApiClient({
684353
684650
  baseUrl,
684354
684651
  getAccessToken,
684355
- runnerVersion: "1.2.20",
684652
+ runnerVersion: "1.2.22",
684356
684653
  onDebug: logForDebugging,
684357
684654
  onAuth401,
684358
684655
  getTrustedDeviceToken
@@ -686933,30 +687230,30 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
686933
687230
  }
686934
687231
  const isMainThread = (cmd) => cmd.agentId === undefined;
686935
687232
  try {
686936
- let command8;
687233
+ let command10;
686937
687234
  let waitingForAgents = false;
686938
687235
  const drainCommandQueue = async () => {
686939
- while (command8 = dequeue(isMainThread)) {
686940
- if (command8.mode !== "prompt" && command8.mode !== "orphaned-permission" && command8.mode !== "task-notification") {
687236
+ while (command10 = dequeue(isMainThread)) {
687237
+ if (command10.mode !== "prompt" && command10.mode !== "orphaned-permission" && command10.mode !== "task-notification") {
686941
687238
  throw new Error("only prompt commands are supported in streaming mode");
686942
687239
  }
686943
- const batch = [command8];
686944
- if (command8.mode === "prompt") {
686945
- while (canBatchWith(command8, peek(isMainThread))) {
687240
+ const batch = [command10];
687241
+ if (command10.mode === "prompt") {
687242
+ while (canBatchWith(command10, peek(isMainThread))) {
686946
687243
  batch.push(dequeue(isMainThread));
686947
687244
  }
686948
687245
  if (batch.length > 1) {
686949
- command8 = {
686950
- ...command8,
687246
+ command10 = {
687247
+ ...command10,
686951
687248
  value: joinPromptValues(batch.map((c4) => c4.value)),
686952
- uuid: batch.findLast((c4) => c4.uuid)?.uuid ?? command8.uuid
687249
+ uuid: batch.findLast((c4) => c4.uuid)?.uuid ?? command10.uuid
686953
687250
  };
686954
687251
  }
686955
687252
  }
686956
687253
  const batchUuids = batch.map((c4) => c4.uuid).filter((u4) => u4 !== undefined);
686957
687254
  if (options.replayUserMessages && batch.length > 1) {
686958
687255
  for (const c4 of batch) {
686959
- if (c4.uuid && c4.uuid !== command8.uuid) {
687256
+ if (c4.uuid && c4.uuid !== command10.uuid) {
686960
687257
  output.enqueue({
686961
687258
  type: "user",
686962
687259
  message: { role: "user", content: c4.value },
@@ -686982,8 +687279,8 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
686982
687279
  for (const uuid8 of batchUuids) {
686983
687280
  notifyCommandLifecycle(uuid8, "started");
686984
687281
  }
686985
- if (command8.mode === "task-notification") {
686986
- const notificationText = typeof command8.value === "string" ? command8.value : "";
687282
+ if (command10.mode === "task-notification") {
687283
+ const notificationText = typeof command10.value === "string" ? command10.value : "";
686987
687284
  const taskIdMatch = notificationText.match(/<task-id>([^<]+)<\/task-id>/);
686988
687285
  const toolUseIdMatch = notificationText.match(/<tool-use-id>([^<]+)<\/tool-use-id>/);
686989
687286
  const outputFileMatch = notificationText.match(/<output-file>([^<]+)<\/output-file>/);
@@ -687016,8 +687313,8 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
687016
687313
  });
687017
687314
  }
687018
687315
  }
687019
- const input = command8.value;
687020
- if (structuredIO instanceof RemoteIO && command8.mode === "prompt") {
687316
+ const input = command10.value;
687317
+ if (structuredIO instanceof RemoteIO && command10.mode === "prompt") {
687021
687318
  logEvent("tengu_bridge_message_received", {
687022
687319
  is_repl: false
687023
687320
  });
@@ -687027,7 +687324,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
687027
687324
  suggestionState.pendingSuggestion = null;
687028
687325
  suggestionState.pendingLastEmittedEntry = null;
687029
687326
  if (suggestionState.lastEmitted) {
687030
- if (command8.mode === "prompt") {
687327
+ if (command10.mode === "prompt") {
687031
687328
  const inputText = typeof input === "string" ? input : input.find((b3) => b3.type === "text")?.text;
687032
687329
  if (typeof inputText === "string") {
687033
687330
  logSuggestionOutcome(suggestionState.lastEmitted.text, inputText, suggestionState.lastEmitted.emittedAt, suggestionState.lastEmitted.promptId, suggestionState.lastEmitted.generationRequestId);
@@ -687039,7 +687336,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
687039
687336
  const turnStartTime = undefined;
687040
687337
  headlessProfilerCheckpoint("before_ask");
687041
687338
  startQueryProfile();
687042
- const cmd = command8;
687339
+ const cmd = command10;
687043
687340
  await runWithWorkload(cmd.workload ?? options.workload, async () => {
687044
687341
  for await (const message of ask({
687045
687342
  commands: uniqBy_default([...currentCommands, ...appState.mcp.commands], "name"),
@@ -689714,7 +690011,7 @@ async function startMCPServer(cwd3, debug4, verbose) {
689714
690011
  setCwd(cwd3);
689715
690012
  const server = new Server({
689716
690013
  name: "claude/tengu",
689717
- version: "1.2.20"
690014
+ version: "1.2.22"
689718
690015
  }, {
689719
690016
  capabilities: {
689720
690017
  tools: {}
@@ -692240,7 +692537,7 @@ ${customInstructions}` : customInstructions;
692240
692537
  }
692241
692538
  }
692242
692539
  logForDiagnosticsNoPII("info", "started", {
692243
- version: "1.2.20",
692540
+ version: "1.2.22",
692244
692541
  is_native_binary: isInBundledMode()
692245
692542
  });
692246
692543
  registerCleanup(async () => {
@@ -692325,7 +692622,7 @@ ${customInstructions}` : customInstructions;
692325
692622
  `);
692326
692623
  process.exit(1);
692327
692624
  }
692328
- const commandsHeadless = disableSlashCommands ? [] : commands.filter((command8) => command8.type === "prompt" && !command8.disableNonInteractive || command8.type === "local" && command8.supportsNonInteractive);
692625
+ const commandsHeadless = disableSlashCommands ? [] : commands.filter((command10) => command10.type === "prompt" && !command10.disableNonInteractive || command10.type === "local" && command10.supportsNonInteractive);
692329
692626
  const defaultState = getDefaultAppState();
692330
692627
  const headlessInitialState = {
692331
692628
  ...defaultState,
@@ -692958,7 +693255,7 @@ Usage: rayu --remote "your task description"`, () => gracefulShutdown(1));
692958
693255
  pendingHookMessages
692959
693256
  }, renderAndRun);
692960
693257
  }
692961
- }).version("1.2.20 (Rayu-CLI)", "-v, --version", "Output the version number");
693258
+ }).version("1.2.22 (Rayu-CLI)", "-v, --version", "Output the version number");
692962
693259
  program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
692963
693260
  program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
692964
693261
  if (canUserConfigureAdvisor()) {
@@ -693424,7 +693721,7 @@ if (false) {}
693424
693721
  async function main2() {
693425
693722
  const args = process.argv.slice(2);
693426
693723
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
693427
- console.log(`${"1.2.20"} (Rayu-CLI)`);
693724
+ console.log(`${"1.2.22"} (Rayu-CLI)`);
693428
693725
  return;
693429
693726
  }
693430
693727
  const {