@verboo/code 0.15.15 → 0.15.16

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/cli.mjs +439 -225
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -118686,7 +118686,7 @@ function getClaudeCodeUserAgent() {
118686
118686
  return `claude-code/${"99.0.0"}`;
118687
118687
  }
118688
118688
  function getVerbooCodeUserAgent() {
118689
- const version2 = "0.15.15";
118689
+ const version2 = "0.15.16";
118690
118690
  return `verboo-code/${version2}`;
118691
118691
  }
118692
118692
 
@@ -152397,19 +152397,26 @@ function toolMatchesName(tool, name) {
152397
152397
  function findToolByName(tools, name) {
152398
152398
  return tools.find((t) => toolMatchesName(t, name));
152399
152399
  }
152400
- function findToolByNameOrUniquePrefix(tools, name) {
152401
- const exactMatch = findToolByName(tools, name);
152402
- if (exactMatch)
152403
- return exactMatch;
152400
+ function resolveToolNameByUniquePrefix(toolNames, name) {
152401
+ const uniqueToolNames = [...new Set(toolNames)];
152402
+ if (uniqueToolNames.includes(name))
152403
+ return name;
152404
152404
  if (name.length < 3 || name.startsWith("mcp__"))
152405
152405
  return;
152406
- const prefixMatches = tools.filter((tool) => tool.name.startsWith(name));
152407
- const oneCharacterCompletions = prefixMatches.filter((tool) => tool.name.length === name.length + 1);
152406
+ const prefixMatches = uniqueToolNames.filter((toolName) => toolName.startsWith(name));
152407
+ const oneCharacterCompletions = prefixMatches.filter((toolName) => toolName.length === name.length + 1);
152408
152408
  if (oneCharacterCompletions.length === 1) {
152409
152409
  return oneCharacterCompletions[0];
152410
152410
  }
152411
152411
  return prefixMatches.length === 1 ? prefixMatches[0] : undefined;
152412
152412
  }
152413
+ function findToolByNameOrUniquePrefix(tools, name) {
152414
+ const exactMatch = findToolByName(tools, name);
152415
+ if (exactMatch)
152416
+ return exactMatch;
152417
+ const resolvedName = resolveToolNameByUniquePrefix(tools.map((tool) => tool.name), name);
152418
+ return resolvedName ? tools.find((tool) => tool.name === resolvedName) : undefined;
152419
+ }
152413
152420
  function buildTool(def) {
152414
152421
  return {
152415
152422
  ...TOOL_DEFAULTS,
@@ -193263,7 +193270,7 @@ async function collectCodexCompletedResponse(response, signal) {
193263
193270
  }
193264
193271
  return completedResponse;
193265
193272
  }
193266
- async function* codexStreamToAnthropic(response, model2, signal) {
193273
+ async function* codexStreamToAnthropic(response, model2, signal, advertisedToolNames = []) {
193267
193274
  const messageId = makeMessageId();
193268
193275
  const toolBlocksByItemId = new Map;
193269
193276
  let activeTextBlockIndex = null;
@@ -193301,6 +193308,107 @@ async function* codexStreamToAnthropic(response, model2, signal) {
193301
193308
  content_block: { type: "text", text: "" }
193302
193309
  };
193303
193310
  };
193311
+ const findToolBlockEntry = (item) => {
193312
+ for (const candidate of [item.id, item.call_id]) {
193313
+ if (candidate == null)
193314
+ continue;
193315
+ const itemId = String(candidate);
193316
+ const toolBlock = toolBlocksByItemId.get(itemId);
193317
+ if (toolBlock)
193318
+ return [itemId, toolBlock];
193319
+ }
193320
+ return;
193321
+ };
193322
+ const toolNameMayBeIncomplete = (name) => Boolean(name) && !advertisedToolNames.includes(name) && advertisedToolNames.some((toolName) => toolName.startsWith(name));
193323
+ const canonicalizeFinalToolName = (toolBlock) => {
193324
+ const resolvedName = resolveToolNameByUniquePrefix(advertisedToolNames, toolBlock.name);
193325
+ if (resolvedName)
193326
+ toolBlock.name = resolvedName;
193327
+ };
193328
+ const applyFinalToolItem = (toolBlock, item) => {
193329
+ if (typeof item.name === "string" && item.name) {
193330
+ toolBlock.name = item.name;
193331
+ }
193332
+ if (typeof item.arguments === "string" && (!toolBlock.hasStarted || item.arguments.startsWith(toolBlock.argumentsBuffer))) {
193333
+ toolBlock.argumentsBuffer = item.arguments;
193334
+ }
193335
+ canonicalizeFinalToolName(toolBlock);
193336
+ };
193337
+ const emitPendingToolArguments = async function* (toolBlock) {
193338
+ if (!toolBlock.hasStarted || toolBlock.emittedArgumentsLength >= toolBlock.argumentsBuffer.length) {
193339
+ return;
193340
+ }
193341
+ yield {
193342
+ type: "content_block_delta",
193343
+ index: toolBlock.index,
193344
+ delta: {
193345
+ type: "input_json_delta",
193346
+ partial_json: toolBlock.argumentsBuffer.slice(toolBlock.emittedArgumentsLength)
193347
+ }
193348
+ };
193349
+ toolBlock.emittedArgumentsLength = toolBlock.argumentsBuffer.length;
193350
+ };
193351
+ const startToolBlock = async function* (toolBlock, force = false) {
193352
+ if (toolBlock.hasStarted)
193353
+ return;
193354
+ if (!force && (!toolBlock.name || toolNameMayBeIncomplete(toolBlock.name))) {
193355
+ return;
193356
+ }
193357
+ if (force)
193358
+ canonicalizeFinalToolName(toolBlock);
193359
+ toolBlock.hasStarted = true;
193360
+ toolBlock.startedName = toolBlock.name || "tool";
193361
+ yield {
193362
+ type: "content_block_start",
193363
+ index: toolBlock.index,
193364
+ content_block: {
193365
+ type: "tool_use",
193366
+ id: toolBlock.toolUseId,
193367
+ name: toolBlock.startedName,
193368
+ input: {}
193369
+ }
193370
+ };
193371
+ yield* emitPendingToolArguments(toolBlock);
193372
+ };
193373
+ const flushToolBlocks = async function* (force = false) {
193374
+ const orderedBlocks = [...toolBlocksByItemId.values()].sort((a2, b) => a2.index - b.index);
193375
+ for (const toolBlock of orderedBlocks) {
193376
+ if (toolBlock.hasStopped)
193377
+ continue;
193378
+ if (!toolBlock.hasStarted) {
193379
+ yield* startToolBlock(toolBlock, force || toolBlock.isDone);
193380
+ if (!toolBlock.hasStarted)
193381
+ break;
193382
+ }
193383
+ if (toolBlock.isDone && toolBlock.startedName !== (toolBlock.name || "tool")) {
193384
+ toolBlock.startedName = toolBlock.name || "tool";
193385
+ yield {
193386
+ type: "content_block_start",
193387
+ index: toolBlock.index,
193388
+ content_block: {
193389
+ type: "tool_use",
193390
+ id: toolBlock.toolUseId,
193391
+ name: toolBlock.startedName,
193392
+ input: {}
193393
+ }
193394
+ };
193395
+ }
193396
+ yield* emitPendingToolArguments(toolBlock);
193397
+ if (toolBlock.isDone) {
193398
+ yield {
193399
+ type: "content_block_stop",
193400
+ index: toolBlock.index
193401
+ };
193402
+ toolBlock.hasStopped = true;
193403
+ }
193404
+ }
193405
+ };
193406
+ const removeStoppedToolBlocks = () => {
193407
+ for (const [itemId, toolBlock] of toolBlocksByItemId) {
193408
+ if (toolBlock.hasStopped)
193409
+ toolBlocksByItemId.delete(itemId);
193410
+ }
193411
+ };
193304
193412
  yield {
193305
193413
  type: "message_start",
193306
193414
  message: {
@@ -193322,31 +193430,19 @@ async function* codexStreamToAnthropic(response, model2, signal) {
193322
193430
  yield* closeActiveTextBlock();
193323
193431
  const blockIndex = nextContentBlockIndex++;
193324
193432
  const toolUseId = item.call_id ?? item.id ?? `call_${blockIndex}`;
193325
- toolBlocksByItemId.set(String(item.id ?? toolUseId), {
193433
+ const toolBlock = {
193326
193434
  index: blockIndex,
193327
- toolUseId
193328
- });
193329
- sawToolUse = true;
193330
- yield {
193331
- type: "content_block_start",
193332
- index: blockIndex,
193333
- content_block: {
193334
- type: "tool_use",
193335
- id: toolUseId,
193336
- name: item.name ?? "tool",
193337
- input: {}
193338
- }
193435
+ toolUseId,
193436
+ name: typeof item.name === "string" ? item.name : "",
193437
+ argumentsBuffer: typeof item.arguments === "string" ? item.arguments : "",
193438
+ emittedArgumentsLength: 0,
193439
+ hasStarted: false,
193440
+ isDone: false,
193441
+ hasStopped: false
193339
193442
  };
193340
- if (item.arguments) {
193341
- yield {
193342
- type: "content_block_delta",
193343
- index: blockIndex,
193344
- delta: {
193345
- type: "input_json_delta",
193346
- partial_json: item.arguments
193347
- }
193348
- };
193349
- }
193443
+ toolBlocksByItemId.set(String(item.id ?? toolUseId), toolBlock);
193444
+ sawToolUse = true;
193445
+ yield* flushToolBlocks();
193350
193446
  }
193351
193447
  continue;
193352
193448
  }
@@ -193376,27 +193472,23 @@ async function* codexStreamToAnthropic(response, model2, signal) {
193376
193472
  if (event.event === "response.function_call_arguments.delta") {
193377
193473
  const toolBlock = toolBlocksByItemId.get(String(payload.item_id ?? ""));
193378
193474
  if (toolBlock) {
193379
- yield {
193380
- type: "content_block_delta",
193381
- index: toolBlock.index,
193382
- delta: {
193383
- type: "input_json_delta",
193384
- partial_json: payload.delta ?? ""
193385
- }
193386
- };
193475
+ if (typeof payload.delta === "string") {
193476
+ toolBlock.argumentsBuffer += payload.delta;
193477
+ }
193478
+ yield* flushToolBlocks();
193387
193479
  }
193388
193480
  continue;
193389
193481
  }
193390
193482
  if (event.event === "response.output_item.done") {
193391
193483
  const item = payload.item;
193392
193484
  if (item?.type === "function_call") {
193393
- const toolBlock = toolBlocksByItemId.get(String(item.id ?? ""));
193394
- if (toolBlock) {
193395
- yield {
193396
- type: "content_block_stop",
193397
- index: toolBlock.index
193398
- };
193399
- toolBlocksByItemId.delete(String(item.id));
193485
+ const toolBlockEntry = findToolBlockEntry(item);
193486
+ if (toolBlockEntry) {
193487
+ const [, toolBlock] = toolBlockEntry;
193488
+ applyFinalToolItem(toolBlock, item);
193489
+ toolBlock.isDone = true;
193490
+ yield* flushToolBlocks();
193491
+ removeStoppedToolBlocks();
193400
193492
  }
193401
193493
  } else if (item?.type === "message") {
193402
193494
  yield* closeActiveTextBlock();
@@ -193413,12 +193505,20 @@ async function* codexStreamToAnthropic(response, model2, signal) {
193413
193505
  }
193414
193506
  }
193415
193507
  yield* closeActiveTextBlock();
193508
+ const finalOutput = Array.isArray(finalResponse?.output) ? finalResponse.output : [];
193509
+ for (const item of finalOutput) {
193510
+ if (item?.type !== "function_call")
193511
+ continue;
193512
+ const toolBlockEntry = findToolBlockEntry(item);
193513
+ if (!toolBlockEntry)
193514
+ continue;
193515
+ applyFinalToolItem(toolBlockEntry[1], item);
193516
+ }
193416
193517
  for (const toolBlock of toolBlocksByItemId.values()) {
193417
- yield {
193418
- type: "content_block_stop",
193419
- index: toolBlock.index
193420
- };
193518
+ toolBlock.isDone = true;
193421
193519
  }
193520
+ yield* flushToolBlocks(true);
193521
+ removeStoppedToolBlocks();
193422
193522
  yield {
193423
193523
  type: "message_delta",
193424
193524
  delta: {
@@ -193429,7 +193529,7 @@ async function* codexStreamToAnthropic(response, model2, signal) {
193429
193529
  };
193430
193530
  yield { type: "message_stop" };
193431
193531
  }
193432
- function convertCodexResponseToAnthropicMessage(data, model2) {
193532
+ function convertCodexResponseToAnthropicMessage(data, model2, advertisedToolNames = []) {
193433
193533
  const content = [];
193434
193534
  const output = Array.isArray(data.output) ? data.output : [];
193435
193535
  for (const item of output) {
@@ -193445,6 +193545,7 @@ function convertCodexResponseToAnthropicMessage(data, model2) {
193445
193545
  continue;
193446
193546
  }
193447
193547
  if (item?.type === "function_call") {
193548
+ const toolName = resolveToolNameByUniquePrefix(advertisedToolNames, item.name ?? "") ?? item.name ?? "tool";
193448
193549
  let input;
193449
193550
  try {
193450
193551
  input = JSON.parse(item.arguments ?? "{}");
@@ -193454,7 +193555,7 @@ function convertCodexResponseToAnthropicMessage(data, model2) {
193454
193555
  content.push({
193455
193556
  type: "tool_use",
193456
193557
  id: item.call_id ?? item.id ?? makeMessageId(),
193457
- name: item.name ?? "tool",
193558
+ name: toolName,
193458
193559
  input
193459
193560
  });
193460
193561
  }
@@ -193472,6 +193573,7 @@ function convertCodexResponseToAnthropicMessage(data, model2) {
193472
193573
  }
193473
193574
  var init_codexShim = __esm(() => {
193474
193575
  init_sdk();
193576
+ init_Tool();
193475
193577
  init_cacheMetrics();
193476
193578
  init_compressToolHistory();
193477
193579
  init_fetchWithProxyRetry();
@@ -194735,6 +194837,16 @@ function repairPossiblyTruncatedObjectJson(raw) {
194735
194837
  return null;
194736
194838
  }
194737
194839
  }
194840
+ function mergeStreamedToolName(current, fragment) {
194841
+ if (!fragment)
194842
+ return current;
194843
+ if (!current || fragment.startsWith(current))
194844
+ return fragment;
194845
+ return current + fragment;
194846
+ }
194847
+ function getAdvertisedToolNames(params) {
194848
+ return (params.tools ?? []).flatMap((tool) => typeof tool.name === "string" && tool.name && tool.name !== "ToolSearchTool" ? [tool.name] : []);
194849
+ }
194738
194850
  function setOpenAIShimRouterStatusHandler(fn) {
194739
194851
  if (routerStatusHandler && activeWarmingHints.size > 0) {
194740
194852
  routerStatusHandler(null);
@@ -194800,7 +194912,7 @@ function createWarmingHintController(signal) {
194800
194912
  }
194801
194913
  return { schedule, showNow, resolve: resolve19 };
194802
194914
  }
194803
- async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
194915
+ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint, advertisedToolNames = []) {
194804
194916
  const messageId = makeMessageId2();
194805
194917
  let contentBlockIndex = 0;
194806
194918
  const activeToolCalls = new Map;
@@ -194888,6 +195000,74 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
194888
195000
  contentBlockIndex++;
194889
195001
  hasEmittedContentStart = false;
194890
195002
  };
195003
+ const toolNameMayBeIncomplete = (name) => Boolean(name) && !advertisedToolNames.includes(name) && advertisedToolNames.some((toolName) => toolName.startsWith(name));
195004
+ const canonicalizeFinalToolName = (toolCall) => {
195005
+ const resolvedName = resolveToolNameByUniquePrefix(advertisedToolNames, toolCall.name);
195006
+ if (resolvedName)
195007
+ toolCall.name = resolvedName;
195008
+ };
195009
+ const startToolCall = async function* (toolCall, force = false) {
195010
+ if (toolCall.hasStarted || !toolCall.id || !toolCall.name)
195011
+ return;
195012
+ if (!force && toolNameMayBeIncomplete(toolCall.name))
195013
+ return;
195014
+ if (force)
195015
+ canonicalizeFinalToolName(toolCall);
195016
+ toolCall.normalizeAtStop = hasToolFieldMapping(toolCall.name);
195017
+ toolCall.hasStarted = true;
195018
+ toolCall.startedName = toolCall.name;
195019
+ yield {
195020
+ type: "content_block_start",
195021
+ index: toolCall.index,
195022
+ content_block: {
195023
+ type: "tool_use",
195024
+ id: toolCall.id,
195025
+ name: toolCall.name,
195026
+ input: {},
195027
+ ...toolCall.extra_content ? { extra_content: toolCall.extra_content } : {},
195028
+ ...toolCall.extra_content?.google?.thought_signature ? {
195029
+ signature: (toolCall.extra_content?.google).thought_signature
195030
+ } : {}
195031
+ }
195032
+ };
195033
+ if (!toolCall.normalizeAtStop && toolCall.jsonBuffer) {
195034
+ yield {
195035
+ type: "content_block_delta",
195036
+ index: toolCall.index,
195037
+ delta: {
195038
+ type: "input_json_delta",
195039
+ partial_json: toolCall.jsonBuffer
195040
+ }
195041
+ };
195042
+ toolCall.emittedJsonLength = toolCall.jsonBuffer.length;
195043
+ }
195044
+ };
195045
+ const flushReadyToolCalls = async function* (force = false) {
195046
+ const orderedCalls = [...activeToolCalls.values()].sort((a2, b) => a2.index - b.index);
195047
+ for (const toolCall of orderedCalls) {
195048
+ if (!toolCall.hasStarted) {
195049
+ if (!force && !toolCall.readyToStart)
195050
+ break;
195051
+ yield* startToolCall(toolCall, force);
195052
+ if (!toolCall.hasStarted) {
195053
+ if (!force)
195054
+ break;
195055
+ continue;
195056
+ }
195057
+ }
195058
+ if (!toolCall.normalizeAtStop && toolCall.emittedJsonLength < toolCall.jsonBuffer.length) {
195059
+ yield {
195060
+ type: "content_block_delta",
195061
+ index: toolCall.index,
195062
+ delta: {
195063
+ type: "input_json_delta",
195064
+ partial_json: toolCall.jsonBuffer.slice(toolCall.emittedJsonLength)
195065
+ }
195066
+ };
195067
+ toolCall.emittedJsonLength = toolCall.jsonBuffer.length;
195068
+ }
195069
+ }
195070
+ };
194891
195071
  try {
194892
195072
  while (true) {
194893
195073
  const { done, value } = await readWithTimeout();
@@ -194908,7 +195088,9 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
194908
195088
  yield { type: "content_block_stop", index: contentBlockIndex };
194909
195089
  }
194910
195090
  for (const [, toolCall] of activeToolCalls) {
194911
- yield { type: "content_block_stop", index: toolCall.index };
195091
+ if (toolCall.hasStarted) {
195092
+ yield { type: "content_block_stop", index: toolCall.index };
195093
+ }
194912
195094
  }
194913
195095
  activeToolCalls.clear();
194914
195096
  throw new Error(`Upstream stream closed without finish_reason after ${elapsedSec}s — likely a guard_proxy/vLLM disconnect. The session was interrupted, not completed.`);
@@ -194948,7 +195130,9 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
194948
195130
  yield { type: "content_block_stop", index: contentBlockIndex };
194949
195131
  }
194950
195132
  for (const [, toolCall] of activeToolCalls) {
194951
- yield { type: "content_block_stop", index: toolCall.index };
195133
+ if (toolCall.hasStarted) {
195134
+ yield { type: "content_block_stop", index: toolCall.index };
195135
+ }
194952
195136
  }
194953
195137
  activeToolCalls.clear();
194954
195138
  const errorPayload = {
@@ -195007,7 +195191,8 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
195007
195191
  }
195008
195192
  if (delta.tool_calls) {
195009
195193
  for (const tc of delta.tool_calls) {
195010
- if (tc.id && tc.function?.name) {
195194
+ let active = activeToolCalls.get(tc.index);
195195
+ if (!active) {
195011
195196
  if (hasEmittedThinkingStart && !hasClosedThinking) {
195012
195197
  yield {
195013
195198
  type: "content_block_stop",
@@ -195019,83 +195204,43 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
195019
195204
  if (hasEmittedContentStart) {
195020
195205
  yield* closeActiveContentBlock();
195021
195206
  }
195022
- const toolBlockIndex = contentBlockIndex;
195023
- const initialArguments = tc.function.arguments ?? "";
195024
- const normalizeAtStop = hasToolFieldMapping(tc.function.name);
195025
- processStreamChunk(streamState, tc.function.arguments ?? "");
195026
- const topLevelSig = tc.thought_signature;
195027
- const initEC = tc.extra_content ? { ...tc.extra_content } : topLevelSig ? { google: { thought_signature: topLevelSig } } : undefined;
195028
- activeToolCalls.set(tc.index, {
195029
- id: tc.id,
195030
- name: tc.function.name,
195031
- index: toolBlockIndex,
195032
- jsonBuffer: initialArguments,
195033
- normalizeAtStop,
195034
- extra_content: initEC
195035
- });
195036
- yield {
195037
- type: "content_block_start",
195038
- index: toolBlockIndex,
195039
- content_block: {
195040
- type: "tool_use",
195041
- id: tc.id,
195042
- name: tc.function.name,
195043
- input: {},
195044
- ...initEC ? { extra_content: initEC } : {},
195045
- ...initEC?.google?.thought_signature ? { signature: initEC.google.thought_signature } : {}
195046
- }
195207
+ active = {
195208
+ id: "",
195209
+ name: "",
195210
+ index: contentBlockIndex++,
195211
+ jsonBuffer: "",
195212
+ emittedJsonLength: 0,
195213
+ normalizeAtStop: false,
195214
+ hasStarted: false,
195215
+ readyToStart: false
195047
195216
  };
195048
- contentBlockIndex++;
195049
- if (tc.function.arguments && !normalizeAtStop) {
195050
- yield {
195051
- type: "content_block_delta",
195052
- index: toolBlockIndex,
195053
- delta: {
195054
- type: "input_json_delta",
195055
- partial_json: tc.function.arguments
195056
- }
195057
- };
195058
- }
195059
- } else if (tc.function?.arguments) {
195060
- const active = activeToolCalls.get(tc.index);
195061
- if (active) {
195062
- if (tc.function.arguments) {
195063
- active.jsonBuffer += tc.function.arguments;
195064
- }
195065
- const contSig = tc.thought_signature;
195066
- const contEC = tc.extra_content ? { ...tc.extra_content } : contSig ? { google: { thought_signature: contSig } } : undefined;
195067
- if (contEC) {
195068
- active.extra_content = {
195069
- ...active.extra_content ?? {},
195070
- ...contEC
195071
- };
195072
- }
195073
- if (active.normalizeAtStop) {
195074
- continue;
195075
- }
195076
- yield {
195077
- type: "content_block_delta",
195078
- index: active.index,
195079
- delta: {
195080
- type: "input_json_delta",
195081
- partial_json: tc.function.arguments
195082
- }
195083
- };
195084
- }
195085
- } else {
195086
- const active = activeToolCalls.get(tc.index);
195087
- if (active) {
195088
- const lateSig = tc.thought_signature;
195089
- const lateEC = tc.extra_content ? { ...tc.extra_content } : lateSig ? { google: { thought_signature: lateSig } } : undefined;
195090
- if (lateEC) {
195091
- active.extra_content = {
195092
- ...active.extra_content ?? {},
195093
- ...lateEC
195094
- };
195095
- }
195096
- }
195217
+ activeToolCalls.set(tc.index, active);
195218
+ }
195219
+ if (tc.id && !active.id) {
195220
+ active.id = tc.id;
195221
+ }
195222
+ const nameFragment = tc.function?.name;
195223
+ if (nameFragment) {
195224
+ active.name = mergeStreamedToolName(active.name, nameFragment);
195225
+ }
195226
+ const argumentFragment = tc.function?.arguments;
195227
+ if (typeof argumentFragment === "string") {
195228
+ active.jsonBuffer += argumentFragment;
195229
+ processStreamChunk(streamState, argumentFragment);
195230
+ }
195231
+ const thoughtSignature = tc.thought_signature;
195232
+ const extraContent = tc.extra_content ? { ...tc.extra_content } : thoughtSignature ? { google: { thought_signature: thoughtSignature } } : undefined;
195233
+ if (extraContent) {
195234
+ active.extra_content = {
195235
+ ...active.extra_content ?? {},
195236
+ ...extraContent
195237
+ };
195238
+ }
195239
+ if (argumentFragment?.trim()) {
195240
+ active.readyToStart = true;
195097
195241
  }
195098
195242
  }
195243
+ yield* flushReadyToolCalls();
195099
195244
  }
195100
195245
  if (choice.finish_reason && !hasProcessedFinishReason) {
195101
195246
  hasProcessedFinishReason = true;
@@ -195107,8 +195252,20 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
195107
195252
  if (hasEmittedContentStart) {
195108
195253
  yield* closeActiveContentBlock();
195109
195254
  }
195255
+ for (const toolCall of activeToolCalls.values()) {
195256
+ canonicalizeFinalToolName(toolCall);
195257
+ if (toolCall.emittedJsonLength === 0) {
195258
+ toolCall.normalizeAtStop = hasToolFieldMapping(toolCall.name);
195259
+ }
195260
+ }
195261
+ const startedBeforeFinish = new Set([...activeToolCalls.values()].filter((toolCall) => toolCall.hasStarted).map((toolCall) => toolCall.index));
195262
+ yield* flushReadyToolCalls(true);
195110
195263
  for (const [, tc] of activeToolCalls) {
195111
- if (tc.extra_content) {
195264
+ const wasStarted = startedBeforeFinish.has(tc.index);
195265
+ if (!tc.hasStarted) {
195266
+ continue;
195267
+ }
195268
+ if (wasStarted && (tc.extra_content || tc.startedName !== tc.name)) {
195112
195269
  yield {
195113
195270
  type: "content_block_start",
195114
195271
  index: tc.index,
@@ -195117,9 +195274,9 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
195117
195274
  id: tc.id,
195118
195275
  name: tc.name,
195119
195276
  input: {},
195120
- extra_content: tc.extra_content,
195121
- ...tc.extra_content.google?.thought_signature ? {
195122
- signature: tc.extra_content.google.thought_signature
195277
+ ...tc.extra_content ? { extra_content: tc.extra_content } : {},
195278
+ ...tc.extra_content?.google?.thought_signature ? {
195279
+ signature: (tc.extra_content?.google).thought_signature
195123
195280
  } : {}
195124
195281
  }
195125
195282
  };
@@ -195147,6 +195304,17 @@ async function* openaiStreamToAnthropic(response, model2, signal, warmingHint) {
195147
195304
  yield { type: "content_block_stop", index: tc.index };
195148
195305
  continue;
195149
195306
  }
195307
+ if (tc.emittedJsonLength < tc.jsonBuffer.length) {
195308
+ yield {
195309
+ type: "content_block_delta",
195310
+ index: tc.index,
195311
+ delta: {
195312
+ type: "input_json_delta",
195313
+ partial_json: tc.jsonBuffer.slice(tc.emittedJsonLength)
195314
+ }
195315
+ };
195316
+ tc.emittedJsonLength = tc.jsonBuffer.length;
195317
+ }
195150
195318
  let suffixToAdd = "";
195151
195319
  if (tc.jsonBuffer) {
195152
195320
  try {
@@ -195303,6 +195471,7 @@ class OpenAIShimMessages {
195303
195471
  }
195304
195472
  create(params, options2) {
195305
195473
  const self2 = this;
195474
+ const advertisedToolNames = getAdvertisedToolNames(params);
195306
195475
  let httpResponse;
195307
195476
  const promise3 = (async () => {
195308
195477
  const request = resolveProviderRequest({
@@ -195323,12 +195492,12 @@ class OpenAIShimMessages {
195323
195492
  httpResponse = response;
195324
195493
  if (params.stream) {
195325
195494
  const isResponsesStream = response.url?.includes("/responses");
195326
- return new OpenAIShimStream(request.transport === "codex_responses" || request.transport === "responses" || isResponsesStream ? codexStreamToAnthropic(response, request.resolvedModel, options2?.signal) : openaiStreamToAnthropic(response, request.resolvedModel, options2?.signal, warmingHint), warmingHint);
195495
+ return new OpenAIShimStream(request.transport === "codex_responses" || request.transport === "responses" || isResponsesStream ? codexStreamToAnthropic(response, request.resolvedModel, options2?.signal, advertisedToolNames) : openaiStreamToAnthropic(response, request.resolvedModel, options2?.signal, warmingHint, advertisedToolNames), warmingHint);
195327
195496
  }
195328
195497
  warmingHint.resolve();
195329
195498
  if (request.transport === "codex_responses") {
195330
195499
  const data = await collectCodexCompletedResponse(response, options2?.signal);
195331
- return convertCodexResponseToAnthropicMessage(data, request.resolvedModel);
195500
+ return convertCodexResponseToAnthropicMessage(data, request.resolvedModel, advertisedToolNames);
195332
195501
  }
195333
195502
  const isResponsesNonStream = response.url?.includes("/responses");
195334
195503
  if (request.transport === "responses" || isResponsesNonStream || request.transport === "chat_completions" && isGithubModelsMode()) {
@@ -195336,15 +195505,15 @@ class OpenAIShimMessages {
195336
195505
  if (contentType2.includes("application/json")) {
195337
195506
  const parsed = await response.json();
195338
195507
  if (parsed && typeof parsed === "object" && (("output" in parsed) || ("incomplete_details" in parsed))) {
195339
- return convertCodexResponseToAnthropicMessage(parsed, request.resolvedModel);
195508
+ return convertCodexResponseToAnthropicMessage(parsed, request.resolvedModel, advertisedToolNames);
195340
195509
  }
195341
- return self2._convertNonStreamingResponse(parsed, request.resolvedModel);
195510
+ return self2._convertNonStreamingResponse(parsed, request.resolvedModel, advertisedToolNames);
195342
195511
  }
195343
195512
  }
195344
195513
  const contentType = response.headers.get("content-type") ?? "";
195345
195514
  if (contentType.includes("application/json")) {
195346
195515
  const data = await response.json();
195347
- return self2._convertNonStreamingResponse(data, request.resolvedModel);
195516
+ return self2._convertNonStreamingResponse(data, request.resolvedModel, advertisedToolNames);
195348
195517
  }
195349
195518
  const textBody = await response.text().catch(() => "");
195350
195519
  throw APIError.generate(response.status, undefined, `OpenAI API error ${response.status}: unexpected response: ${textBody.slice(0, 500)}`, response.headers);
@@ -195839,7 +196008,7 @@ class OpenAIShimMessages {
195839
196008
  }
195840
196009
  throw APIError.generate(500, undefined, "OpenAI shim: request loop exited unexpectedly", new Headers);
195841
196010
  }
195842
- _convertNonStreamingResponse(data, model2) {
196011
+ _convertNonStreamingResponse(data, model2, advertisedToolNames = []) {
195843
196012
  const choice = data.choices?.[0];
195844
196013
  const content = [];
195845
196014
  const reasoningText = choice?.message?.reasoning_content;
@@ -195870,11 +196039,12 @@ class OpenAIShimMessages {
195870
196039
  }
195871
196040
  if (choice?.message?.tool_calls) {
195872
196041
  for (const tc of choice.message.tool_calls) {
195873
- const input = normalizeToolArguments(tc.function.name, tc.function.arguments);
196042
+ const toolName = resolveToolNameByUniquePrefix(advertisedToolNames, tc.function.name) ?? tc.function.name;
196043
+ const input = normalizeToolArguments(toolName, tc.function.arguments);
195874
196044
  content.push({
195875
196045
  type: "tool_use",
195876
196046
  id: tc.id,
195877
- name: tc.function.name,
196047
+ name: toolName,
195878
196048
  input,
195879
196049
  ...tc.extra_content ? { extra_content: tc.extra_content } : {},
195880
196050
  ...tc.extra_content?.google?.thought_signature ? { signature: tc.extra_content.google.thought_signature } : {}
@@ -195926,6 +196096,7 @@ function createOpenAIShimClient(options2) {
195926
196096
  var GITHUB_429_MAX_RETRIES = 3, GITHUB_429_BASE_DELAY_SEC = 1, GITHUB_429_MAX_DELAY_SEC = 32, GEMINI_API_HOST = "generativelanguage.googleapis.com", VERBOO_SESSION_HEADER = "X-Verboo-Session-Id", COPILOT_HEADERS2, JSON_REPAIR_SUFFIXES, routerStatusHandler = null, routerStatusHandlerGeneration = 0, activeWarmingHints, OpenAIShimStream;
195927
196097
  var init_openaiShim = __esm(() => {
195928
196098
  init_sdk();
196099
+ init_Tool();
195929
196100
  init_state();
195930
196101
  init_oauth();
195931
196102
  init_codexCredentials();
@@ -297859,7 +298030,7 @@ async function* runTools(toolUseMessages, assistantMessages, canUseTool, toolUse
297859
298030
  }
297860
298031
  function partitionToolCalls(toolUseMessages, toolUseContext) {
297861
298032
  return toolUseMessages.reduce((acc, toolUse) => {
297862
- const tool = findToolByName(toolUseContext.options.tools, toolUse.name);
298033
+ const tool = findToolByNameOrUniquePrefix(toolUseContext.options.tools, toolUse.name);
297863
298034
  const parsedInput = tool?.inputSchema.safeParse(toolUse.input);
297864
298035
  const isConcurrencySafe = parsedInput?.success ? (() => {
297865
298036
  try {
@@ -298044,7 +298215,7 @@ async function* handleOrphanedPermission(orphanedPermission, tools, mutableMessa
298044
298215
  }
298045
298216
  const toolName = toolUseBlock.name;
298046
298217
  const toolInput = toolUseBlock.input;
298047
- const toolDefinition = findToolByName(tools, toolName);
298218
+ const toolDefinition = findToolByNameOrUniquePrefix(tools, toolName);
298048
298219
  if (!toolDefinition) {
298049
298220
  return;
298050
298221
  }
@@ -300196,7 +300367,7 @@ function getToolSearchOrReadInfo(toolName, toolInput, tools) {
300196
300367
  isAbsorbedSilently: true
300197
300368
  };
300198
300369
  }
300199
- const tool = findToolByName(tools, toolName) ?? findToolByName(getReplPrimitiveTools(), toolName);
300370
+ const tool = findToolByNameOrUniquePrefix(tools, toolName) ?? findToolByNameOrUniquePrefix(getReplPrimitiveTools(), toolName);
300200
300371
  if (!tool?.isSearchOrReadCommand) {
300201
300372
  return {
300202
300373
  isCollapsible: false,
@@ -300775,7 +300946,7 @@ function getProgressUpdate(tracker) {
300775
300946
  }
300776
300947
  function createActivityDescriptionResolver(tools) {
300777
300948
  return (toolName, input) => {
300778
- const tool = findToolByName(tools, toolName);
300949
+ const tool = findToolByNameOrUniquePrefix(tools, toolName);
300779
300950
  return tool?.getActivityDescription?.(input) ?? undefined;
300780
300951
  };
300781
300952
  }
@@ -323064,7 +323235,17 @@ async function resendCardlessTrialCode(accessToken, verificationId) {
323064
323235
  }
323065
323236
  async function isGroupSubscriptionActive(accessToken, groupId, opts = {}) {
323066
323237
  const subscriptions = await fetchSubscriptions(accessToken, opts);
323067
- return subscriptions.some((sub) => sub.groupId === groupId && (sub.status === "active" || sub.status === "trialing"));
323238
+ return hasGroupSubscriptionEntitlement(subscriptions, groupId, opts.requirement ?? "access");
323239
+ }
323240
+ function hasGroupSubscriptionEntitlement(subscriptions, groupId, requirement) {
323241
+ return subscriptions.some((subscription) => {
323242
+ if (subscription.groupId !== groupId)
323243
+ return false;
323244
+ if (requirement === "access") {
323245
+ return subscription.status === "active" || subscription.status === "trialing";
323246
+ }
323247
+ return subscription.status === "active" && (subscription.source === "stripe" || subscription.source === "stripe_trial" || subscription.source === "woovi");
323248
+ });
323068
323249
  }
323069
323250
  var httpUrlSchema, checkoutResultSchema, checkoutInputSchema, whatsappProfileSchema, cardlessTrialInputSchema, verificationRequiredSchema, trialActivatedSchema, cardlessTrialResultSchema;
323070
323251
  var init_verbooCheckout = __esm(() => {
@@ -323077,9 +323258,14 @@ var init_verbooCheckout = __esm(() => {
323077
323258
  init_verbooSubscriptions();
323078
323259
  httpUrlSchema = exports_external2.string().url().refine((value) => value.startsWith("https://") || value.startsWith("http://"));
323079
323260
  checkoutResultSchema = exports_external2.discriminatedUnion("mode", [
323080
- exports_external2.object({ mode: exports_external2.literal("stripe"), url: httpUrlSchema }).passthrough(),
323261
+ exports_external2.object({
323262
+ mode: exports_external2.literal("stripe"),
323263
+ attemptId: exports_external2.string().uuid(),
323264
+ url: httpUrlSchema
323265
+ }).passthrough(),
323081
323266
  exports_external2.object({
323082
323267
  mode: exports_external2.literal("woovi"),
323268
+ attemptId: exports_external2.string().uuid(),
323083
323269
  wooviQrCode: exports_external2.string().min(1),
323084
323270
  wooviSubscriptionId: exports_external2.string().min(1)
323085
323271
  }).passthrough(),
@@ -323320,6 +323506,9 @@ function movePlanFocus(index, direction, count3, columns) {
323320
323506
  function isCurrentLocalTrial(subscription) {
323321
323507
  return subscription?.status === "trialing" && ["trial", "stripe_trial"].includes(subscription.source ?? "");
323322
323508
  }
323509
+ function getStripeTrialConversionUrl(subscriptionId, billingInterval) {
323510
+ return `${VERBOO_FRONT_BASE_URL}/pt/settings/billing?subscription=${encodeURIComponent(subscriptionId)}&action=convert&billingInterval=${encodeURIComponent(billingInterval)}`;
323511
+ }
323323
323512
  function filterCliPurchasablePlans(groups, subscriptions) {
323324
323513
  const subscriptionsByGroup = new Map(subscriptions.filter((subscription) => ["active", "trialing", "past_due"].includes(subscription.status)).map((subscription) => [subscription.groupId, subscription]));
323325
323514
  return groups.filter((group) => {
@@ -323377,10 +323566,10 @@ function paymentProviderLabel(group) {
323377
323566
  }
323378
323567
  }
323379
323568
  function hasCardlessTrial(group) {
323380
- return Boolean(group.trialEligible && group.trialDays && group.trialPaymentMethodRequired === false && group.paymentProvider !== "woovi");
323569
+ return Boolean(group.trialEligible && group.trialDays && group.billingInterval === "month" && group.trialPaymentMethodRequired === false && group.paymentProvider !== "woovi");
323381
323570
  }
323382
323571
  function hasCardTrial(group) {
323383
- return Boolean(group.trialEligible && group.trialDays && group.trialPaymentMethodRequired !== false && group.paymentProvider !== "woovi");
323572
+ return Boolean(group.trialEligible && group.trialDays && group.billingInterval === "month" && group.trialPaymentMethodRequired !== false && group.paymentProvider !== "woovi");
323384
323573
  }
323385
323574
  function getPlanDetailOptions(plan) {
323386
323575
  if (hasCardlessTrial(plan)) {
@@ -323831,12 +324020,15 @@ function PurchaseFlowView({
323831
324020
  const columnCount = getPlanColumnCount(terminalColumns);
323832
324021
  const [step, setStep] = import_react66.useState("splash");
323833
324022
  const [plans, setPlans] = import_react66.useState([]);
324023
+ const [subscriptionsByGroup, setSubscriptionsByGroup] = import_react66.useState(new Map);
323834
324024
  const [selectedPlan, setSelectedPlan] = import_react66.useState(null);
323835
324025
  const [focusIndex, setFocusIndex] = import_react66.useState(0);
323836
324026
  const [inlineMessage, setInlineMessage] = import_react66.useState(null);
323837
324027
  const [flowError, setFlowError] = import_react66.useState(null);
323838
324028
  const [wooviPayment, setWooviPayment] = import_react66.useState(null);
323839
324029
  const [manualCheckoutUrl, setManualCheckoutUrl] = import_react66.useState(null);
324030
+ const [manualEntitlementRequirement, setManualEntitlementRequirement] = import_react66.useState("paid");
324031
+ const [successRequirement, setSuccessRequirement] = import_react66.useState("paid");
323840
324032
  const [whatsappProfile, setWhatsAppProfile] = import_react66.useState(null);
323841
324033
  const [cardlessVerification, setCardlessVerification] = import_react66.useState(null);
323842
324034
  const plansRequestRef = import_react66.default.useRef(null);
@@ -323853,7 +324045,8 @@ function PurchaseFlowView({
323853
324045
  setFlowError({ message, backStep, retryLabel: retry?.label });
323854
324046
  setStep("error");
323855
324047
  }, []);
323856
- const complete = import_react66.useCallback(() => {
324048
+ const complete = import_react66.useCallback((requirement) => {
324049
+ setSuccessRequirement(requirement);
323857
324050
  setStep("success");
323858
324051
  if (successTimerRef.current)
323859
324052
  clearTimeout(successTimerRef.current);
@@ -323883,6 +324076,7 @@ function PurchaseFlowView({
323883
324076
  if (plansRequestRef.current !== controller)
323884
324077
  return;
323885
324078
  const eligible2 = filterCliPurchasablePlans(groups, subscriptions);
324079
+ setSubscriptionsByGroup(new Map(subscriptions.filter((subscription) => ["active", "trialing", "past_due"].includes(subscription.status)).map((subscription) => [subscription.groupId, subscription])));
323886
324080
  if (eligible2.length === 0) {
323887
324081
  const message = groups.length === 0 ? "Nenhum plano está disponível no momento." : "Não há novos planos compatíveis com a CLI para esta conta.";
323888
324082
  showError(message, "splash", {
@@ -323907,7 +324101,7 @@ function PurchaseFlowView({
323907
324101
  plansRequestRef.current = null;
323908
324102
  }
323909
324103
  }, [accessToken, showError]);
323910
- const startEntitlementPolling = import_react66.useCallback(async function pollEntitlement(groupId, displayStep = "polling") {
324104
+ const startEntitlementPolling = import_react66.useCallback(async function pollEntitlement(groupId, displayStep = "polling", requirement = "paid") {
323911
324105
  pollingRef.current?.abort();
323912
324106
  const controller = new AbortController;
323913
324107
  pollingRef.current = controller;
@@ -323916,11 +324110,12 @@ function PurchaseFlowView({
323916
324110
  while (!controller.signal.aborted && Date.now() - startedAt < POLL_TIMEOUT_MS) {
323917
324111
  try {
323918
324112
  const active = await isGroupSubscriptionActive(accessToken, groupId, {
323919
- signal: controller.signal
324113
+ signal: controller.signal,
324114
+ requirement
323920
324115
  });
323921
324116
  if (active) {
323922
324117
  if (pollingRef.current === controller)
323923
- complete();
324118
+ complete(requirement);
323924
324119
  return;
323925
324120
  }
323926
324121
  } catch (error42) {
@@ -323941,7 +324136,7 @@ function PurchaseFlowView({
323941
324136
  if (pollingRef.current === controller && !controller.signal.aborted) {
323942
324137
  showError("A assinatura foi iniciada, mas os modelos ainda não foram liberados.", "plan-detail", {
323943
324138
  label: "Verificar novamente",
323944
- run: () => void pollEntitlement(groupId, displayStep)
324139
+ run: () => void pollEntitlement(groupId, displayStep, requirement)
323945
324140
  });
323946
324141
  }
323947
324142
  }, [accessToken, complete, showError]);
@@ -323980,7 +324175,7 @@ function PurchaseFlowView({
323980
324175
  setCardlessVerification(result);
323981
324176
  setStep("whatsapp-code");
323982
324177
  } else {
323983
- startEntitlementPolling(group.id, "cardless-polling");
324178
+ startEntitlementPolling(group.id, "cardless-polling", "access");
323984
324179
  }
323985
324180
  } catch (error42) {
323986
324181
  const presentation = describePurchaseError(error42, "Não foi possível iniciar o teste sem cartão.");
@@ -324016,7 +324211,7 @@ function PurchaseFlowView({
324016
324211
  try {
324017
324212
  const result = await confirmCardlessTrial(accessToken, cardlessVerification.verificationId, code);
324018
324213
  if (result.mode === "trial_activated") {
324019
- startEntitlementPolling(group.id, "cardless-polling");
324214
+ startEntitlementPolling(group.id, "cardless-polling", "access");
324020
324215
  } else {
324021
324216
  setCardlessVerification(result);
324022
324217
  setStep("whatsapp-code");
@@ -324064,7 +324259,7 @@ function PurchaseFlowView({
324064
324259
  setStep("whatsapp-code");
324065
324260
  }
324066
324261
  }, [accessToken, cardlessVerification, verificationWaitSeconds]);
324067
- const handleCheckout = import_react66.useCallback(async function runCheckout(group, paymentMethod, woovi) {
324262
+ const handleCheckout = import_react66.useCallback(async function runCheckout(group, paymentMethod, woovi, requirement = "paid") {
324068
324263
  setInlineMessage(null);
324069
324264
  setStep("checkout");
324070
324265
  try {
@@ -324073,7 +324268,7 @@ function PurchaseFlowView({
324073
324268
  woovi
324074
324269
  });
324075
324270
  if (result.mode === "reactivated") {
324076
- startEntitlementPolling(group.id);
324271
+ startEntitlementPolling(group.id, "polling", requirement);
324077
324272
  return;
324078
324273
  }
324079
324274
  if (result.mode === "woovi") {
@@ -324085,8 +324280,9 @@ function PurchaseFlowView({
324085
324280
  return;
324086
324281
  }
324087
324282
  setManualCheckoutUrl(result.url);
324283
+ setManualEntitlementRequirement(requirement);
324088
324284
  if (await openBrowser(result.url)) {
324089
- startEntitlementPolling(group.id);
324285
+ startEntitlementPolling(group.id, "polling", requirement);
324090
324286
  } else {
324091
324287
  setStep("manual-browser");
324092
324288
  }
@@ -324107,7 +324303,7 @@ function PurchaseFlowView({
324107
324303
  }
324108
324304
  if (presentation.code === "already_subscribed" || presentation.code === "manual_access_active") {
324109
324305
  setInlineMessage(presentation.message);
324110
- startEntitlementPolling(group.id);
324306
+ startEntitlementPolling(group.id, "polling", requirement);
324111
324307
  return;
324112
324308
  }
324113
324309
  if (presentation.code === "payment_method_required" || presentation.code === "payment_method_unavailable") {
@@ -324117,20 +324313,33 @@ function PurchaseFlowView({
324117
324313
  }
324118
324314
  showError(presentation.message, "plan-detail", {
324119
324315
  label: "Tentar checkout novamente",
324120
- run: () => void runCheckout(group, paymentMethod, woovi)
324316
+ run: () => void runCheckout(group, paymentMethod, woovi, requirement)
324121
324317
  });
324122
324318
  }
324123
324319
  }, [accessToken, fetchPlans, showError, startEntitlementPolling]);
324124
- const startPaidPurchase = import_react66.useCallback((group) => {
324320
+ const startPaidPurchase = import_react66.useCallback(async (group) => {
324125
324321
  setSelectedPlan(group);
324126
324322
  setInlineMessage(null);
324323
+ const currentSubscription = subscriptionsByGroup.get(group.id);
324324
+ if (currentSubscription?.source === "stripe_trial" && currentSubscription.status === "trialing") {
324325
+ const conversionUrl = getStripeTrialConversionUrl(currentSubscription.id, group.billingInterval);
324326
+ setManualCheckoutUrl(conversionUrl);
324327
+ setManualEntitlementRequirement("paid");
324328
+ setStep("checkout");
324329
+ if (await openBrowser(conversionUrl)) {
324330
+ startEntitlementPolling(group.id, "polling", "paid");
324331
+ } else {
324332
+ setStep("manual-browser");
324333
+ }
324334
+ return;
324335
+ }
324127
324336
  if (group.paymentProvider === "both")
324128
324337
  setStep("payment-method");
324129
324338
  else if (group.paymentProvider === "woovi")
324130
324339
  setStep("woovi-form");
324131
324340
  else
324132
324341
  handleCheckout(group, "stripe");
324133
- }, [handleCheckout]);
324342
+ }, [handleCheckout, startEntitlementPolling, subscriptionsByGroup]);
324134
324343
  const cancelPlansLoading = import_react66.useCallback(() => {
324135
324344
  plansRequestRef.current?.abort();
324136
324345
  plansRequestRef.current = null;
@@ -324281,7 +324490,7 @@ function PurchaseFlowView({
324281
324490
  dimColor: true,
324282
324491
  children: paymentProviderLabel(plan)
324283
324492
  }),
324284
- plan.trialEligible && plan.trialDays ? /* @__PURE__ */ jsx_runtime86.jsxs(ThemedText, {
324493
+ (hasCardlessTrial(plan) || hasCardTrial(plan)) && plan.trialDays ? /* @__PURE__ */ jsx_runtime86.jsxs(ThemedText, {
324285
324494
  color: "success",
324286
324495
  children: [
324287
324496
  plan.trialDays,
@@ -324347,7 +324556,7 @@ function PurchaseFlowView({
324347
324556
  paymentProviderLabel(plan)
324348
324557
  ]
324349
324558
  }),
324350
- plan.trialEligible && plan.trialDays ? /* @__PURE__ */ jsx_runtime86.jsxs(ThemedText, {
324559
+ (hasCardlessTrial(plan) || hasCardTrial(plan)) && plan.trialDays ? /* @__PURE__ */ jsx_runtime86.jsxs(ThemedText, {
324351
324560
  color: "success",
324352
324561
  children: [
324353
324562
  "Teste: ",
@@ -324368,7 +324577,7 @@ function PurchaseFlowView({
324368
324577
  if (value === "trial")
324369
324578
  prepareCardlessTrial(plan);
324370
324579
  else if (value === "card-trial")
324371
- handleCheckout(plan, "stripe");
324580
+ handleCheckout(plan, "stripe", undefined, "access");
324372
324581
  else if (value === "pix")
324373
324582
  setStep("woovi-form");
324374
324583
  else if (value === "buy")
@@ -324602,7 +324811,7 @@ function PurchaseFlowView({
324602
324811
  ],
324603
324812
  onChange: (value) => {
324604
324813
  if (value === "verify" && selectedPlan) {
324605
- startEntitlementPolling(selectedPlan.id);
324814
+ startEntitlementPolling(selectedPlan.id, "polling", manualEntitlementRequirement);
324606
324815
  } else if (value === "back")
324607
324816
  setStep("plan-detail");
324608
324817
  else
@@ -324626,7 +324835,7 @@ function PurchaseFlowView({
324626
324835
  case "success":
324627
324836
  return /* @__PURE__ */ jsx_runtime86.jsx(ThemedText, {
324628
324837
  color: "success",
324629
- children: "Assinatura confirmada! Modelos disponíveis."
324838
+ children: successRequirement === "access" ? "Trial ativado! Modelos disponíveis." : "Assinatura paga confirmada! Modelos disponíveis."
324630
324839
  });
324631
324840
  case "error":
324632
324841
  return /* @__PURE__ */ jsx_runtime86.jsxs(ThemedBox_default, {
@@ -324698,6 +324907,7 @@ var init_purchaseFlow = __esm(() => {
324698
324907
  init_select();
324699
324908
  init_Spinner2();
324700
324909
  init_TextInput();
324910
+ init_oauth();
324701
324911
  init_useTerminalSize();
324702
324912
  init_ink2();
324703
324913
  init_AppState();
@@ -334198,7 +334408,7 @@ function AssistantToolUseMessage(t0) {
334198
334408
  t1 = null;
334199
334409
  break bb0;
334200
334410
  }
334201
- const tool = findToolByName(tools, param.name);
334411
+ const tool = findToolByNameOrUniquePrefix(tools, param.name);
334202
334412
  if (!tool) {
334203
334413
  t1 = null;
334204
334414
  break bb0;
@@ -338231,7 +338441,7 @@ function VerboseToolUse(t0) {
338231
338441
  if ($2[0] !== bg || $2[1] !== content.id || $2[2] !== content.input || $2[3] !== content.name || $2[4] !== inProgressToolUseIDs || $2[5] !== lookups || $2[6] !== shouldAnimate || $2[7] !== theme || $2[8] !== tools) {
338232
338442
  t2 = Symbol.for("react.early_return_sentinel");
338233
338443
  bb0: {
338234
- const tool = findToolByName(tools, content.name) ?? findToolByName(getReplPrimitiveTools(), content.name);
338444
+ const tool = findToolByNameOrUniquePrefix(tools, content.name) ?? findToolByNameOrUniquePrefix(getReplPrimitiveTools(), content.name);
338235
338445
  if (!tool) {
338236
338446
  t2 = null;
338237
338447
  break bb0;
@@ -338912,7 +339122,7 @@ function GroupedToolUseContent({
338912
339122
  inProgressToolUseIDs,
338913
339123
  shouldAnimate
338914
339124
  }) {
338915
- const tool = findToolByName(tools, message.toolName);
339125
+ const tool = findToolByNameOrUniquePrefix(tools, message.toolName);
338916
339126
  if (!tool?.renderGroupedToolUse) {
338917
339127
  return null;
338918
339128
  }
@@ -340746,7 +340956,7 @@ function useGetToolFromMessages(toolUseID, tools, lookups) {
340746
340956
  t0 = null;
340747
340957
  break bb0;
340748
340958
  }
340749
- const tool = findToolByName(tools, toolUse.name);
340959
+ const tool = findToolByNameOrUniquePrefix(tools, toolUse.name);
340750
340960
  if (!tool) {
340751
340961
  t0 = null;
340752
340962
  break bb0;
@@ -342406,7 +342616,7 @@ function extractLastToolInfo(progressMessages, tools) {
342406
342616
  if (toolResultBlock?.type === "tool_result") {
342407
342617
  const toolUseBlock = toolUseByID.get(toolResultBlock.tool_use_id);
342408
342618
  if (toolUseBlock) {
342409
- const tool = findToolByName(tools, toolUseBlock.name);
342619
+ const tool = findToolByNameOrUniquePrefix(tools, toolUseBlock.name);
342410
342620
  if (!tool) {
342411
342621
  return toolUseBlock.name;
342412
342622
  }
@@ -387889,6 +388099,7 @@ class StreamingToolExecutor {
387889
388099
  this.tools.push({
387890
388100
  id: block2.id,
387891
388101
  block: block2,
388102
+ canonicalName: block2.name,
387892
388103
  assistantMessage: assistantMessage2,
387893
388104
  status: "completed",
387894
388105
  isConcurrencySafe: true,
@@ -387921,6 +388132,7 @@ class StreamingToolExecutor {
387921
388132
  this.tools.push({
387922
388133
  id: block2.id,
387923
388134
  block: block2,
388135
+ canonicalName: toolDefinition.name,
387924
388136
  assistantMessage: assistantMessage2,
387925
388137
  status: "queued",
387926
388138
  isConcurrencySafe,
@@ -388013,7 +388225,7 @@ class StreamingToolExecutor {
388013
388225
  return null;
388014
388226
  }
388015
388227
  getToolInterruptBehavior(tool) {
388016
- const definition = findToolByName(this.toolDefinitions, tool.block.name);
388228
+ const definition = findToolByNameOrUniquePrefix(this.toolDefinitions, tool.canonicalName);
388017
388229
  if (!definition?.interruptBehavior)
388018
388230
  return "block";
388019
388231
  try {
@@ -388027,9 +388239,9 @@ class StreamingToolExecutor {
388027
388239
  const summary = input?.command ?? input?.file_path ?? input?.pattern ?? "";
388028
388240
  if (typeof summary === "string" && summary.length > 0) {
388029
388241
  const truncated = summary.length > 40 ? summary.slice(0, 40) + "…" : summary;
388030
- return `${tool.block.name}(${truncated})`;
388242
+ return `${tool.canonicalName}(${truncated})`;
388031
388243
  }
388032
- return tool.block.name;
388244
+ return tool.canonicalName;
388033
388245
  }
388034
388246
  updateInterruptibleState() {
388035
388247
  const executing = this.tools.filter((t) => t.status === "executing");
@@ -388068,7 +388280,7 @@ class StreamingToolExecutor {
388068
388280
  const isErrorResult = update.message.type === "user" && Array.isArray(update.message.message.content) && update.message.message.content.some((_) => _.type === "tool_result" && _.is_error === true);
388069
388281
  if (isErrorResult) {
388070
388282
  thisToolErrored = true;
388071
- if (tool.block.name === BASH_TOOL_NAME) {
388283
+ if (tool.canonicalName === BASH_TOOL_NAME) {
388072
388284
  this.hasErrored = true;
388073
388285
  this.erroredToolDescription = this.getToolDescription(tool);
388074
388286
  this.siblingAbortController.abort("sibling_error");
@@ -390295,7 +390507,7 @@ async function* queryLoop(params, consumedCommandUuids) {
390295
390507
  for (let i3 = 0;i3 < message.message.content.length; i3++) {
390296
390508
  const block2 = message.message.content[i3];
390297
390509
  if (block2.type === "tool_use" && typeof block2.input === "object" && block2.input !== null) {
390298
- const tool = findToolByName(toolUseContext.options.tools, block2.name);
390510
+ const tool = findToolByNameOrUniquePrefix(toolUseContext.options.tools, block2.name);
390299
390511
  if (tool?.backfillObservableInput) {
390300
390512
  const originalInput = block2.input;
390301
390513
  const inputCopy = { ...originalInput };
@@ -391072,7 +391284,7 @@ function getAnthropicEnvMetadata() {
391072
391284
  function getBuildAgeMinutes() {
391073
391285
  if (false)
391074
391286
  ;
391075
- const buildTime = new Date("2026-08-16T02:41:36.697Z").getTime();
391287
+ const buildTime = new Date("2026-08-18T16:18:48.339Z").getTime();
391076
391288
  if (isNaN(buildTime))
391077
391289
  return;
391078
391290
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -405139,7 +405351,7 @@ function normalizeMessagesForAPI(messages, tools = []) {
405139
405351
  ...message.message,
405140
405352
  content: message.message.content.map((block2) => {
405141
405353
  if (block2.type === "tool_use") {
405142
- const tool = tools.find((t) => toolMatchesName(t, block2.name));
405354
+ const tool = findToolByNameOrUniquePrefix(tools, block2.name);
405143
405355
  const normalizedInput = tool ? normalizeToolInputForAPI(tool, block2.input) : block2.input;
405144
405356
  const canonicalName = tool?.name ?? block2.name;
405145
405357
  if (toolSearchEnabled) {
@@ -405377,11 +405589,12 @@ function normalizeContentFromAPI(contentBlocks, tools, agentId) {
405377
405589
  } else {
405378
405590
  normalizedInput = contentBlock.input;
405379
405591
  }
405592
+ const resolvedTool = findToolByNameOrUniquePrefix(tools, contentBlock.name);
405593
+ const normalizedToolName = resolvedTool && resolvedTool.name !== contentBlock.name && !resolvedTool.aliases?.includes(contentBlock.name) && resolvedTool.name.startsWith(contentBlock.name) ? resolvedTool.name : contentBlock.name;
405380
405594
  if (typeof normalizedInput === "object" && normalizedInput !== null) {
405381
- const tool = findToolByName(tools, contentBlock.name);
405382
- if (tool) {
405595
+ if (resolvedTool) {
405383
405596
  try {
405384
- normalizedInput = normalizeToolInput(tool, normalizedInput, agentId);
405597
+ normalizedInput = normalizeToolInput(resolvedTool, normalizedInput, agentId);
405385
405598
  } catch (error42) {
405386
405599
  logError2(new Error("Error normalizing tool input: " + error42));
405387
405600
  }
@@ -405389,6 +405602,7 @@ function normalizeContentFromAPI(contentBlocks, tools, agentId) {
405389
405602
  }
405390
405603
  return {
405391
405604
  ...contentBlock,
405605
+ name: normalizedToolName,
405392
405606
  input: normalizedInput
405393
405607
  };
405394
405608
  }
@@ -432873,7 +433087,7 @@ function buildPrimarySection() {
432873
433087
  });
432874
433088
  return [{
432875
433089
  label: "Version",
432876
- value: "0.15.15"
433090
+ value: "0.15.16"
432877
433091
  }, {
432878
433092
  label: "Session name",
432879
433093
  value: nameValue
@@ -446803,7 +447017,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
446803
447017
  return `${VERBOO_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
446804
447018
  }
446805
447019
  function getPublicBuildVersion() {
446806
- return "0.15.15";
447020
+ return "0.15.16";
446807
447021
  }
446808
447022
  var import_semver10, VERBOO_RELEASES_URL = "https://github.com/verbeux-ai/code/releases", fallbackBuildVersion, publicBuildVersion;
446809
447023
  var init_version = __esm(() => {
@@ -473882,7 +474096,7 @@ var import_react_compiler_runtime198, React97, import_react155, jsx_runtime267,
473882
474096
  if (b_0?.type !== "tool_result" || b_0.is_error || !msg_6.toolUseResult)
473883
474097
  return false;
473884
474098
  const name = lookupsRef.current.toolUseByToolUseID.get(b_0.tool_use_id)?.name;
473885
- const tool = name ? findToolByName(tools, name) : undefined;
474099
+ const tool = name ? findToolByNameOrUniquePrefix(tools, name) : undefined;
473886
474100
  return tool?.isResultTruncated?.(msg_6.toolUseResult) ?? false;
473887
474101
  }, [tools]);
473888
474102
  const canAnimate = (!toolJSX || !!toolJSX.shouldContinueAnimation) && !toolUseConfirmQueue.length && !isMessageSelectorVisible;
@@ -473952,7 +474166,7 @@ var import_react_compiler_runtime198, React97, import_react155, jsx_runtime267,
473952
474166
  const tr = msg_9.message.content.find((b_1) => b_1.type === "tool_result");
473953
474167
  if (tr && "tool_use_id" in tr) {
473954
474168
  const tu = lookups_0.toolUseByToolUseID.get(tr.tool_use_id);
473955
- const tool_0 = tu && findToolByName(tools, tu.name);
474169
+ const tool_0 = tu && findToolByNameOrUniquePrefix(tools, tu.name);
473956
474170
  const extracted = tool_0?.extractSearchText?.(msg_9.toolUseResult);
473957
474171
  if (extracted !== undefined)
473958
474172
  text_0 = extracted;
@@ -478860,7 +479074,7 @@ var init_ultraplan = __esm(() => {
478860
479074
 
478861
479075
  // src/components/tasks/renderToolActivity.tsx
478862
479076
  function renderToolActivity(activity, tools, theme) {
478863
- const tool = findToolByName(tools, activity.toolName);
479077
+ const tool = findToolByNameOrUniquePrefix(tools, activity.toolName);
478864
479078
  if (!tool) {
478865
479079
  return activity.toolName;
478866
479080
  }
@@ -498197,7 +498411,7 @@ var init_bridge_kick = __esm(() => {
498197
498411
  var call66 = async () => {
498198
498412
  return {
498199
498413
  type: "text",
498200
- value: `${"99.0.0"} (built ${"2026-08-16T02:41:36.697Z"})`
498414
+ value: `${"99.0.0"} (built ${"2026-08-18T16:18:48.339Z"})`
498201
498415
  };
498202
498416
  }, version2, version_default;
498203
498417
  var init_version2 = __esm(() => {
@@ -517800,8 +518014,8 @@ async function prepareIfConditionMatcher(hookInput, tools) {
517800
518014
  if (hookInput.hook_event_name !== "PreToolUse" && hookInput.hook_event_name !== "PostToolUse" && hookInput.hook_event_name !== "PostToolUseFailure" && hookInput.hook_event_name !== "PermissionRequest") {
517801
518015
  return;
517802
518016
  }
517803
- const toolName = normalizeLegacyToolName(hookInput.tool_name);
517804
- const tool = tools && findToolByName(tools, hookInput.tool_name);
518017
+ const tool = tools && findToolByNameOrUniquePrefix(tools, hookInput.tool_name);
518018
+ const toolName = normalizeLegacyToolName(tool?.name ?? hookInput.tool_name);
517805
518019
  const input = tool?.inputSchema.safeParse(hookInput.tool_input);
517806
518020
  const patternMatcher = input?.success && tool?.preparePermissionMatcher ? await tool.preparePermissionMatcher(input.data) : undefined;
517807
518021
  return (ifCondition) => {
@@ -521933,7 +522147,7 @@ function printStartupScreen(modelOverride) {
521933
522147
  const home = process.env.HOME || process.env.USERPROFILE || "";
521934
522148
  const cwd2 = process.cwd();
521935
522149
  const displayCwd = home && cwd2.startsWith(home) ? `~${cwd2.slice(home.length)}` : cwd2;
521936
- const version3 = "0.15.15";
522150
+ const version3 = "0.15.16";
521937
522151
  const columns = process.stdout.columns ?? STARTUP_DEFAULT_COLUMNS;
521938
522152
  process.stdout.write(renderStartupScreen(p, version3, displayCwd, columns));
521939
522153
  }
@@ -541162,7 +541376,7 @@ var init_routerRateLimitHook = __esm(() => {
541162
541376
  function getSemverPart(version3) {
541163
541377
  return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
541164
541378
  }
541165
- function useUpdateNotification(updatedVersion, initialVersion = "0.15.15") {
541379
+ function useUpdateNotification(updatedVersion, initialVersion = "0.15.16") {
541166
541380
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react226.useState(() => getSemverPart(initialVersion));
541167
541381
  const [pendingNotification2, setPendingNotification] = import_react226.useState(null);
541168
541382
  if (updatedVersion) {
@@ -541202,7 +541416,7 @@ function AutoUpdater({
541202
541416
  return;
541203
541417
  }
541204
541418
  if (false) {}
541205
- const currentVersion = "0.15.15";
541419
+ const currentVersion = "0.15.16";
541206
541420
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
541207
541421
  let latestVersion = await getLatestVersion(channel2);
541208
541422
  const isDisabled = isAutoUpdaterDisabled();
@@ -541555,17 +541769,17 @@ function PackageManagerAutoUpdater(t0) {
541555
541769
  const maxVersion = await getMaxVersion();
541556
541770
  if (maxVersion && latest && gt(latest, maxVersion)) {
541557
541771
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
541558
- if (gte("0.15.15", maxVersion)) {
541559
- logForDebugging(`PackageManagerAutoUpdater: current version ${"0.15.15"} is already at or above maxVersion ${maxVersion}, skipping update`);
541772
+ if (gte("0.15.16", maxVersion)) {
541773
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"0.15.16"} is already at or above maxVersion ${maxVersion}, skipping update`);
541560
541774
  setUpdateAvailable(false);
541561
541775
  return;
541562
541776
  }
541563
541777
  latest = maxVersion;
541564
541778
  }
541565
- const hasUpdate = latest && !gte("0.15.15", latest) && !shouldSkipVersion(latest);
541779
+ const hasUpdate = latest && !gte("0.15.16", latest) && !shouldSkipVersion(latest);
541566
541780
  setUpdateAvailable(!!hasUpdate);
541567
541781
  if (hasUpdate) {
541568
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.15.15"} -> ${latest}`);
541782
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.15.16"} -> ${latest}`);
541569
541783
  }
541570
541784
  };
541571
541785
  $2[0] = t1;
@@ -541599,7 +541813,7 @@ function PackageManagerAutoUpdater(t0) {
541599
541813
  wrap: "truncate",
541600
541814
  children: [
541601
541815
  "currentVersion: ",
541602
- "0.15.15"
541816
+ "0.15.16"
541603
541817
  ]
541604
541818
  });
541605
541819
  $2[3] = verbose;
@@ -556135,7 +556349,7 @@ function useRemoteSession({
556135
556349
  },
556136
556350
  onPermissionRequest: (request, requestId) => {
556137
556351
  logForDebugging(`[useRemoteSession] Permission request for tool: ${request.tool_name}`);
556138
- const tool = findToolByName(toolsRef.current, request.tool_name) ?? createToolStub(request.tool_name);
556352
+ const tool = findToolByNameOrUniquePrefix(toolsRef.current, request.tool_name) ?? createToolStub(request.tool_name);
556139
556353
  const syntheticMessage = createSyntheticAssistantMessage(request, requestId);
556140
556354
  const permissionResult = {
556141
556355
  behavior: "ask",
@@ -556486,7 +556700,7 @@ function useDirectConnect({
556486
556700
  },
556487
556701
  onPermissionRequest: (request, requestId) => {
556488
556702
  logForDebugging(`[useDirectConnect] Permission request for tool: ${request.tool_name}`);
556489
- const tool = findToolByName(toolsRef.current, request.tool_name) ?? createToolStub(request.tool_name);
556703
+ const tool = findToolByNameOrUniquePrefix(toolsRef.current, request.tool_name) ?? createToolStub(request.tool_name);
556490
556704
  const syntheticMessage = createSyntheticAssistantMessage(request, requestId);
556491
556705
  const permissionResult = {
556492
556706
  behavior: "ask",
@@ -556636,7 +556850,7 @@ function useSSHSession({
556636
556850
  },
556637
556851
  onPermissionRequest: (request, requestId) => {
556638
556852
  logForDebugging(`[useSSHSession] permission request: ${request.tool_name}`);
556639
- const tool = findToolByName(toolsRef.current, request.tool_name) ?? createToolStub(request.tool_name);
556853
+ const tool = findToolByNameOrUniquePrefix(toolsRef.current, request.tool_name) ?? createToolStub(request.tool_name);
556640
556854
  const syntheticMessage = createSyntheticAssistantMessage(request, requestId);
556641
556855
  const permissionResult = {
556642
556856
  behavior: "ask",
@@ -557289,10 +557503,10 @@ async function autoUpdateCliInBackground() {
557289
557503
  return;
557290
557504
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
557291
557505
  const latest = await getLatestVersion(channel2);
557292
- if (!latest || gte("0.15.15", latest))
557506
+ if (!latest || gte("0.15.16", latest))
557293
557507
  return;
557294
557508
  writeToStdout(`
557295
- Nova versão disponível: ${latest} (atual: ${"0.15.15"})
557509
+ Nova versão disponível: ${latest} (atual: ${"0.15.16"})
557296
557510
  `);
557297
557511
  writeToStdout(`Atualizando automaticamente...
557298
557512
  `);
@@ -560943,7 +561157,7 @@ function useInboxPoller({
560943
561157
  if (!parsed)
560944
561158
  continue;
560945
561159
  if (setToolUseConfirmQueue) {
560946
- const tool = findToolByName(getAllBaseTools(), parsed.tool_name);
561160
+ const tool = findToolByNameOrUniquePrefix(getAllBaseTools(), parsed.tool_name);
560947
561161
  if (!tool) {
560948
561162
  logForDebugging(`[InboxPoller] Unknown tool ${parsed.tool_name}, skipping permission request`);
560949
561163
  continue;
@@ -574730,7 +574944,7 @@ var init_ApproveApiKey = __esm(() => {
574730
574944
 
574731
574945
  // src/components/LogoV2/WelcomeV2.tsx
574732
574946
  function WelcomeV2() {
574733
- const version3 = "0.15.15";
574947
+ const version3 = "0.15.16";
574734
574948
  return /* @__PURE__ */ jsx_runtime476.jsxs(ThemedBox_default, {
574735
574949
  flexDirection: "column",
574736
574950
  marginY: 1,
@@ -593678,7 +593892,7 @@ __export(exports_update, {
593678
593892
  });
593679
593893
  async function update() {
593680
593894
  logEvent("tengu_update_check", {});
593681
- writeToStdout(`Current version: ${"0.15.15"}
593895
+ writeToStdout(`Current version: ${"0.15.16"}
593682
593896
  `);
593683
593897
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
593684
593898
  writeToStdout(`Checking for updates to ${channel2} version...
@@ -593763,8 +593977,8 @@ async function update() {
593763
593977
  writeToStdout(`Verboo Code is managed by Homebrew.
593764
593978
  `);
593765
593979
  const latest = await getLatestVersion(channel2);
593766
- if (latest && !gte("0.15.15", latest)) {
593767
- writeToStdout(`Update available: ${"0.15.15"} → ${latest}
593980
+ if (latest && !gte("0.15.16", latest)) {
593981
+ writeToStdout(`Update available: ${"0.15.16"} → ${latest}
593768
593982
  `);
593769
593983
  writeToStdout(`
593770
593984
  `);
@@ -593780,8 +593994,8 @@ async function update() {
593780
593994
  writeToStdout(`Verboo Code is managed by winget.
593781
593995
  `);
593782
593996
  const latest = await getLatestVersion(channel2);
593783
- if (latest && !gte("0.15.15", latest)) {
593784
- writeToStdout(`Update available: ${"0.15.15"} → ${latest}
593997
+ if (latest && !gte("0.15.16", latest)) {
593998
+ writeToStdout(`Update available: ${"0.15.16"} → ${latest}
593785
593999
  `);
593786
594000
  writeToStdout(`
593787
594001
  `);
@@ -593797,8 +594011,8 @@ async function update() {
593797
594011
  writeToStdout(`Verboo Code is managed by apk.
593798
594012
  `);
593799
594013
  const latest = await getLatestVersion(channel2);
593800
- if (latest && !gte("0.15.15", latest)) {
593801
- writeToStdout(`Update available: ${"0.15.15"} → ${latest}
594014
+ if (latest && !gte("0.15.16", latest)) {
594015
+ writeToStdout(`Update available: ${"0.15.16"} → ${latest}
593802
594016
  `);
593803
594017
  writeToStdout(`
593804
594018
  `);
@@ -593851,11 +594065,11 @@ async function update() {
593851
594065
  `);
593852
594066
  await gracefulShutdown(1);
593853
594067
  }
593854
- if (result.latestVersion === "0.15.15") {
593855
- writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.15"})`) + `
594068
+ if (result.latestVersion === "0.15.16") {
594069
+ writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.16"})`) + `
593856
594070
  `);
593857
594071
  } else {
593858
- writeToStdout(source_default.green(`Successfully updated from ${"0.15.15"} to version ${result.latestVersion}`) + `
594072
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.16"} to version ${result.latestVersion}`) + `
593859
594073
  `);
593860
594074
  await regenerateCompletionCache();
593861
594075
  }
@@ -593915,12 +594129,12 @@ async function update() {
593915
594129
  `);
593916
594130
  await gracefulShutdown(1);
593917
594131
  }
593918
- if (latestVersion === "0.15.15") {
593919
- writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.15"})`) + `
594132
+ if (latestVersion === "0.15.16") {
594133
+ writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.16"})`) + `
593920
594134
  `);
593921
594135
  await gracefulShutdown(0);
593922
594136
  }
593923
- writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.15"})
594137
+ writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.16"})
593924
594138
  `);
593925
594139
  writeToStdout(`Installing update...
593926
594140
  `);
@@ -593965,7 +594179,7 @@ async function update() {
593965
594179
  logForDebugging(`update: Installation status: ${status2}`);
593966
594180
  switch (status2) {
593967
594181
  case "success":
593968
- writeToStdout(source_default.green(`Successfully updated from ${"0.15.15"} to version ${latestVersion}`) + `
594182
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.16"} to version ${latestVersion}`) + `
593969
594183
  `);
593970
594184
  await regenerateCompletionCache();
593971
594185
  break;
@@ -595304,7 +595518,7 @@ ${chromeSystemPrompt}` : chromeSystemPrompt;
595304
595518
  is_native_binary: isInBundledMode()
595305
595519
  });
595306
595520
  logMemoryDiagnostics("start", {
595307
- version: "0.15.15",
595521
+ version: "0.15.16",
595308
595522
  debug: debug2,
595309
595523
  debugToStderr,
595310
595524
  print: print ?? false,
@@ -596115,7 +596329,7 @@ Usage: verboo --remote "your task description"`, () => gracefulShutdown(1));
596115
596329
  pendingHookMessages
596116
596330
  }, renderAndRun);
596117
596331
  }
596118
- }).version(`0.15.15 (${cliDesc})`, "-v, --version", "Output the version number");
596332
+ }).version(`0.15.16 (${cliDesc})`, "-v, --version", "Output the version number");
596119
596333
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
596120
596334
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
596121
596335
  if (canUserConfigureAdvisor()) {
@@ -596730,7 +596944,7 @@ if (false) {}
596730
596944
  async function main2() {
596731
596945
  const args = process.argv.slice(2);
596732
596946
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
596733
- console.log(`${"0.15.15"} (Verboo Code)`);
596947
+ console.log(`${"0.15.16"} (Verboo Code)`);
596734
596948
  return;
596735
596949
  }
596736
596950
  if (!IS_VERBOO_CLI && args.includes("--provider")) {
@@ -596904,4 +597118,4 @@ async function main2() {
596904
597118
  }
596905
597119
  main2();
596906
597120
 
596907
- //# debugId=BA1810B7F2F5F50A64756E2164756E21
597121
+ //# debugId=F84B47F82CF95DAE64756E2164756E21