@verboo/code 0.15.3 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +543 -68
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -117942,7 +117942,7 @@ function getClaudeCodeUserAgent() {
|
|
|
117942
117942
|
return `claude-code/${"99.0.0"}`;
|
|
117943
117943
|
}
|
|
117944
117944
|
function getVerbooCodeUserAgent() {
|
|
117945
|
-
const version2 = "0.15.
|
|
117945
|
+
const version2 = "0.15.5";
|
|
117946
117946
|
return `verboo-code/${version2}`;
|
|
117947
117947
|
}
|
|
117948
117948
|
|
|
@@ -188341,6 +188341,372 @@ var init_contextPartitioning = __esm(() => {
|
|
|
188341
188341
|
];
|
|
188342
188342
|
});
|
|
188343
188343
|
|
|
188344
|
+
// src/utils/messages/toolPairing.ts
|
|
188345
|
+
function getToolUseId(block2) {
|
|
188346
|
+
if (typeof block2 === "object" && block2 !== null && "type" in block2 && block2.type === "tool_use" && "id" in block2 && typeof block2.id === "string") {
|
|
188347
|
+
return block2.id;
|
|
188348
|
+
}
|
|
188349
|
+
return null;
|
|
188350
|
+
}
|
|
188351
|
+
function getToolResultId(block2) {
|
|
188352
|
+
if (typeof block2 === "object" && block2 !== null && "type" in block2 && block2.type === "tool_result" && "tool_use_id" in block2 && typeof block2.tool_use_id === "string") {
|
|
188353
|
+
return block2.tool_use_id;
|
|
188354
|
+
}
|
|
188355
|
+
return null;
|
|
188356
|
+
}
|
|
188357
|
+
function getServerToolUseId(block2) {
|
|
188358
|
+
if (typeof block2 === "object" && block2 !== null && "type" in block2 && (block2.type === "server_tool_use" || block2.type === "mcp_tool_use") && "id" in block2 && typeof block2.id === "string") {
|
|
188359
|
+
return block2.id;
|
|
188360
|
+
}
|
|
188361
|
+
return null;
|
|
188362
|
+
}
|
|
188363
|
+
function getToolUseIdReference(block2) {
|
|
188364
|
+
if (typeof block2 === "object" && block2 !== null && "tool_use_id" in block2 && typeof block2.tool_use_id === "string") {
|
|
188365
|
+
return block2.tool_use_id;
|
|
188366
|
+
}
|
|
188367
|
+
return null;
|
|
188368
|
+
}
|
|
188369
|
+
function getToolResultIdsFromUserMessage(message) {
|
|
188370
|
+
if (!Array.isArray(message.message.content)) {
|
|
188371
|
+
return [];
|
|
188372
|
+
}
|
|
188373
|
+
return message.message.content.map((block2) => getToolResultId(block2)).filter((id) => id !== null);
|
|
188374
|
+
}
|
|
188375
|
+
function isUserOrAssistantMessage(message) {
|
|
188376
|
+
return message.type === "user" || message.type === "assistant";
|
|
188377
|
+
}
|
|
188378
|
+
function getToolUseIdsFromAssistantMessage(message) {
|
|
188379
|
+
if (message.type !== "assistant") {
|
|
188380
|
+
return [];
|
|
188381
|
+
}
|
|
188382
|
+
const content = message.message.content;
|
|
188383
|
+
if (!Array.isArray(content)) {
|
|
188384
|
+
return [];
|
|
188385
|
+
}
|
|
188386
|
+
return content.map((block2) => getToolUseId(block2)).filter((id) => id !== null);
|
|
188387
|
+
}
|
|
188388
|
+
function getToolResultIdsFromMessage(message) {
|
|
188389
|
+
if (message.type !== "user") {
|
|
188390
|
+
return [];
|
|
188391
|
+
}
|
|
188392
|
+
const content = message.message.content;
|
|
188393
|
+
if (!Array.isArray(content)) {
|
|
188394
|
+
return [];
|
|
188395
|
+
}
|
|
188396
|
+
return content.map((block2) => getToolResultId(block2)).filter((id) => id !== null);
|
|
188397
|
+
}
|
|
188398
|
+
function collectToolUseIdsInRange(messages, start, end) {
|
|
188399
|
+
const ids = new Set;
|
|
188400
|
+
for (let i3 = start;i3 < end; i3++) {
|
|
188401
|
+
for (const id of getToolUseIdsFromAssistantMessage(messages[i3])) {
|
|
188402
|
+
ids.add(id);
|
|
188403
|
+
}
|
|
188404
|
+
}
|
|
188405
|
+
return ids;
|
|
188406
|
+
}
|
|
188407
|
+
function collectToolResultIdsInRange(messages, start, end) {
|
|
188408
|
+
const ids = new Set;
|
|
188409
|
+
for (let i3 = start;i3 < end; i3++) {
|
|
188410
|
+
for (const id of getToolResultIdsFromMessage(messages[i3])) {
|
|
188411
|
+
ids.add(id);
|
|
188412
|
+
}
|
|
188413
|
+
}
|
|
188414
|
+
return ids;
|
|
188415
|
+
}
|
|
188416
|
+
function clampRangeIndex(index, min, max2) {
|
|
188417
|
+
if (!Number.isFinite(index))
|
|
188418
|
+
return min;
|
|
188419
|
+
return Math.max(min, Math.min(max2, Math.trunc(index)));
|
|
188420
|
+
}
|
|
188421
|
+
function findToolUseMessageIndex(messages, toolUseId, fromInclusive, toExclusive) {
|
|
188422
|
+
for (let i3 = toExclusive - 1;i3 >= fromInclusive; i3--) {
|
|
188423
|
+
if (getToolUseIdsFromAssistantMessage(messages[i3]).includes(toolUseId)) {
|
|
188424
|
+
return i3;
|
|
188425
|
+
}
|
|
188426
|
+
}
|
|
188427
|
+
return -1;
|
|
188428
|
+
}
|
|
188429
|
+
function findToolResultMessageIndex(messages, toolUseId, fromInclusive, toExclusive) {
|
|
188430
|
+
for (let i3 = fromInclusive;i3 < toExclusive; i3++) {
|
|
188431
|
+
if (getToolResultIdsFromMessage(messages[i3]).includes(toolUseId)) {
|
|
188432
|
+
return i3;
|
|
188433
|
+
}
|
|
188434
|
+
}
|
|
188435
|
+
return -1;
|
|
188436
|
+
}
|
|
188437
|
+
function findEarliestAssistantWithSameMessageId(messages, messageId, fromInclusive, toExclusive) {
|
|
188438
|
+
let result = -1;
|
|
188439
|
+
for (let i3 = fromInclusive;i3 < toExclusive; i3++) {
|
|
188440
|
+
const message = messages[i3];
|
|
188441
|
+
if (message.type === "assistant" && message.message.id === messageId) {
|
|
188442
|
+
result = i3;
|
|
188443
|
+
break;
|
|
188444
|
+
}
|
|
188445
|
+
}
|
|
188446
|
+
return result;
|
|
188447
|
+
}
|
|
188448
|
+
function findLatestAssistantWithSameMessageId(messages, messageId, fromInclusive, toExclusive) {
|
|
188449
|
+
let result = -1;
|
|
188450
|
+
for (let i3 = fromInclusive;i3 < toExclusive; i3++) {
|
|
188451
|
+
const message = messages[i3];
|
|
188452
|
+
if (message.type === "assistant" && message.message.id === messageId) {
|
|
188453
|
+
result = i3;
|
|
188454
|
+
}
|
|
188455
|
+
}
|
|
188456
|
+
return result;
|
|
188457
|
+
}
|
|
188458
|
+
function getPairingIssueKinds(messages) {
|
|
188459
|
+
const pairable = messages.filter(isUserOrAssistantMessage);
|
|
188460
|
+
if (pairable.length === 0)
|
|
188461
|
+
return [];
|
|
188462
|
+
const validation = validateToolResultPairing(pairable);
|
|
188463
|
+
return [...new Set(validation.issues.map((issue2) => issue2.kind))];
|
|
188464
|
+
}
|
|
188465
|
+
function messageHasToolResult(message) {
|
|
188466
|
+
return message ? getToolResultIdsFromMessage(message).length > 0 : false;
|
|
188467
|
+
}
|
|
188468
|
+
function selectToolPairSafeMessageRange(messages, requestedStart, requestedEnd, options2) {
|
|
188469
|
+
const messageList = [...messages];
|
|
188470
|
+
const minStart = clampRangeIndex(options2.minStart ?? 0, 0, messageList.length);
|
|
188471
|
+
const maxEnd = clampRangeIndex(options2.maxEnd ?? messageList.length, minStart, messageList.length);
|
|
188472
|
+
const clampedStart = clampRangeIndex(requestedStart, minStart, maxEnd);
|
|
188473
|
+
const clampedEnd = clampRangeIndex(requestedEnd, clampedStart, maxEnd);
|
|
188474
|
+
const maxExtraMessages = options2.maxExtraMessages === undefined ? messageList.length : Math.max(0, Math.trunc(options2.maxExtraMessages));
|
|
188475
|
+
let expansionMinStart = Math.max(minStart, clampedStart - maxExtraMessages);
|
|
188476
|
+
let expansionMaxEnd = Math.min(maxEnd, clampedEnd + maxExtraMessages);
|
|
188477
|
+
let start = clampedStart;
|
|
188478
|
+
let end = clampedEnd;
|
|
188479
|
+
const requestedMessages = messageList.slice(clampedStart, clampedEnd);
|
|
188480
|
+
const issueKinds = getPairingIssueKinds(requestedMessages);
|
|
188481
|
+
const requestedStartedWithToolResult = messageHasToolResult(messageList[clampedStart]);
|
|
188482
|
+
for (let guard = 0;guard < messageList.length * 2 + 2; guard++) {
|
|
188483
|
+
let changed = false;
|
|
188484
|
+
for (let i3 = start;i3 < end; i3++) {
|
|
188485
|
+
const message = messageList[i3];
|
|
188486
|
+
if (!message)
|
|
188487
|
+
continue;
|
|
188488
|
+
if (message.type !== "assistant")
|
|
188489
|
+
continue;
|
|
188490
|
+
const messageId = message.message.id;
|
|
188491
|
+
if (!messageId)
|
|
188492
|
+
continue;
|
|
188493
|
+
const earlier = findEarliestAssistantWithSameMessageId(messageList, messageId, 0, start);
|
|
188494
|
+
if (earlier !== -1) {
|
|
188495
|
+
if (earlier >= expansionMinStart) {
|
|
188496
|
+
start = earlier;
|
|
188497
|
+
} else {
|
|
188498
|
+
const lastInRange = findLatestAssistantWithSameMessageId(messageList, messageId, start, end);
|
|
188499
|
+
start = lastInRange + 1;
|
|
188500
|
+
expansionMinStart = Math.max(expansionMinStart, start);
|
|
188501
|
+
}
|
|
188502
|
+
changed = true;
|
|
188503
|
+
break;
|
|
188504
|
+
}
|
|
188505
|
+
const later = findLatestAssistantWithSameMessageId(messageList, messageId, end, messageList.length);
|
|
188506
|
+
if (later !== -1) {
|
|
188507
|
+
if (later < expansionMaxEnd) {
|
|
188508
|
+
end = later + 1;
|
|
188509
|
+
} else {
|
|
188510
|
+
const firstInRange = findEarliestAssistantWithSameMessageId(messageList, messageId, start, end);
|
|
188511
|
+
end = firstInRange;
|
|
188512
|
+
expansionMaxEnd = Math.min(expansionMaxEnd, end);
|
|
188513
|
+
}
|
|
188514
|
+
changed = true;
|
|
188515
|
+
break;
|
|
188516
|
+
}
|
|
188517
|
+
}
|
|
188518
|
+
if (changed)
|
|
188519
|
+
continue;
|
|
188520
|
+
const toolUseIds = collectToolUseIdsInRange(messageList, start, end);
|
|
188521
|
+
const toolResultIds = collectToolResultIdsInRange(messageList, start, end);
|
|
188522
|
+
for (let i3 = start;i3 < end; i3++) {
|
|
188523
|
+
const resultIds = getToolResultIdsFromMessage(messageList[i3]);
|
|
188524
|
+
const orphanedResultId = resultIds.find((id) => !toolUseIds.has(id));
|
|
188525
|
+
if (!orphanedResultId)
|
|
188526
|
+
continue;
|
|
188527
|
+
const toolUseIndex = findToolUseMessageIndex(messageList, orphanedResultId, expansionMinStart, start);
|
|
188528
|
+
if (toolUseIndex !== -1) {
|
|
188529
|
+
start = toolUseIndex;
|
|
188530
|
+
changed = true;
|
|
188531
|
+
break;
|
|
188532
|
+
}
|
|
188533
|
+
start = i3 + 1;
|
|
188534
|
+
expansionMinStart = Math.max(expansionMinStart, start);
|
|
188535
|
+
changed = true;
|
|
188536
|
+
break;
|
|
188537
|
+
}
|
|
188538
|
+
if (changed)
|
|
188539
|
+
continue;
|
|
188540
|
+
for (let i3 = start;i3 < end; i3++) {
|
|
188541
|
+
const toolUseIdsForMessage = getToolUseIdsFromAssistantMessage(messageList[i3]);
|
|
188542
|
+
const missingToolUseId = toolUseIdsForMessage.find((id) => !toolResultIds.has(id));
|
|
188543
|
+
if (!missingToolUseId)
|
|
188544
|
+
continue;
|
|
188545
|
+
const toolResultIndex = findToolResultMessageIndex(messageList, missingToolUseId, end, expansionMaxEnd);
|
|
188546
|
+
if (toolResultIndex !== -1) {
|
|
188547
|
+
end = toolResultIndex + 1;
|
|
188548
|
+
changed = true;
|
|
188549
|
+
break;
|
|
188550
|
+
}
|
|
188551
|
+
const hasResultOutsideRange = findToolResultMessageIndex(messageList, missingToolUseId, 0, messageList.length) !== -1;
|
|
188552
|
+
if (options2.allowPendingToolUse && !hasResultOutsideRange)
|
|
188553
|
+
continue;
|
|
188554
|
+
end = i3;
|
|
188555
|
+
expansionMaxEnd = Math.min(expansionMaxEnd, end);
|
|
188556
|
+
changed = true;
|
|
188557
|
+
break;
|
|
188558
|
+
}
|
|
188559
|
+
if (!changed)
|
|
188560
|
+
break;
|
|
188561
|
+
}
|
|
188562
|
+
const selectedMessages = messageList.slice(start, end);
|
|
188563
|
+
const diagnostics = {
|
|
188564
|
+
projectionName: options2.projectionName,
|
|
188565
|
+
querySource: options2.querySource,
|
|
188566
|
+
messageCountBefore: clampedEnd - clampedStart,
|
|
188567
|
+
messageCountAfter: selectedMessages.length,
|
|
188568
|
+
requestedRange: { start: clampedStart, end: clampedEnd },
|
|
188569
|
+
adjustedRange: { start, end },
|
|
188570
|
+
issueKinds,
|
|
188571
|
+
requestedStartedWithToolResult,
|
|
188572
|
+
adjusted: start !== clampedStart || end !== clampedEnd
|
|
188573
|
+
};
|
|
188574
|
+
if (diagnostics.adjusted || issueKinds.length > 0) {
|
|
188575
|
+
logForDebugging(`[messageProjection] tool-pair-safe range projection=${options2.projectionName} ` + `querySource=${options2.querySource ?? "unknown"} ` + `before=${diagnostics.messageCountBefore} after=${diagnostics.messageCountAfter} ` + `requested=${clampedStart}:${clampedEnd} adjusted=${start}:${end} ` + `issueKinds=${issueKinds.join(",") || "none"} ` + `requestedStartedWithToolResult=${requestedStartedWithToolResult}`);
|
|
188576
|
+
}
|
|
188577
|
+
return {
|
|
188578
|
+
messages: selectedMessages,
|
|
188579
|
+
start,
|
|
188580
|
+
end,
|
|
188581
|
+
diagnostics
|
|
188582
|
+
};
|
|
188583
|
+
}
|
|
188584
|
+
function validateToolResultPairing(messages, context = {}) {
|
|
188585
|
+
const issues = [];
|
|
188586
|
+
const seenToolUses = new Map;
|
|
188587
|
+
for (let i3 = 0;i3 < messages.length; i3++) {
|
|
188588
|
+
const msg = messages[i3];
|
|
188589
|
+
if (msg.type === "user") {
|
|
188590
|
+
if (messages[i3 - 1]?.type === "assistant") {
|
|
188591
|
+
continue;
|
|
188592
|
+
}
|
|
188593
|
+
for (const toolUseId of getToolResultIdsFromUserMessage(msg)) {
|
|
188594
|
+
issues.push({
|
|
188595
|
+
kind: "orphaned_tool_result",
|
|
188596
|
+
toolUseId,
|
|
188597
|
+
userIndex: i3
|
|
188598
|
+
});
|
|
188599
|
+
}
|
|
188600
|
+
continue;
|
|
188601
|
+
}
|
|
188602
|
+
const uniqueToolUseIds = new Set;
|
|
188603
|
+
const serverResultIds = new Set;
|
|
188604
|
+
const assistantContent = Array.isArray(msg.message.content) ? msg.message.content : [];
|
|
188605
|
+
for (const block2 of assistantContent) {
|
|
188606
|
+
const toolUseIdReference = getToolUseIdReference(block2);
|
|
188607
|
+
if (toolUseIdReference !== null) {
|
|
188608
|
+
serverResultIds.add(toolUseIdReference);
|
|
188609
|
+
}
|
|
188610
|
+
}
|
|
188611
|
+
for (const block2 of assistantContent) {
|
|
188612
|
+
const toolUseId = getToolUseId(block2);
|
|
188613
|
+
if (toolUseId !== null) {
|
|
188614
|
+
const firstSeen = seenToolUses.get(toolUseId);
|
|
188615
|
+
if (firstSeen) {
|
|
188616
|
+
issues.push({
|
|
188617
|
+
kind: "duplicate_tool_use",
|
|
188618
|
+
toolUseId,
|
|
188619
|
+
assistantIndex: i3,
|
|
188620
|
+
assistantMessageId: msg.message.id,
|
|
188621
|
+
duplicateOfAssistantIndex: firstSeen.assistantIndex,
|
|
188622
|
+
duplicateOfAssistantMessageId: firstSeen.assistantMessageId
|
|
188623
|
+
});
|
|
188624
|
+
} else {
|
|
188625
|
+
seenToolUses.set(toolUseId, {
|
|
188626
|
+
assistantIndex: i3,
|
|
188627
|
+
assistantMessageId: msg.message.id
|
|
188628
|
+
});
|
|
188629
|
+
}
|
|
188630
|
+
uniqueToolUseIds.add(toolUseId);
|
|
188631
|
+
}
|
|
188632
|
+
const serverToolUseId = getServerToolUseId(block2);
|
|
188633
|
+
if (serverToolUseId !== null && !serverResultIds.has(serverToolUseId)) {
|
|
188634
|
+
issues.push({
|
|
188635
|
+
kind: "server_tool_use_without_result",
|
|
188636
|
+
toolUseId: serverToolUseId,
|
|
188637
|
+
assistantIndex: i3,
|
|
188638
|
+
assistantMessageId: msg.message.id
|
|
188639
|
+
});
|
|
188640
|
+
}
|
|
188641
|
+
}
|
|
188642
|
+
const nextMsg = messages[i3 + 1];
|
|
188643
|
+
const toolResultIds = nextMsg?.type === "user" ? getToolResultIdsFromUserMessage(nextMsg) : [];
|
|
188644
|
+
const toolResultIdSet = new Set(toolResultIds);
|
|
188645
|
+
const toolUseIdSet = new Set(uniqueToolUseIds);
|
|
188646
|
+
const seenToolResultIds = new Set;
|
|
188647
|
+
for (const toolResultId of toolResultIds) {
|
|
188648
|
+
if (seenToolResultIds.has(toolResultId)) {
|
|
188649
|
+
issues.push({
|
|
188650
|
+
kind: "duplicate_tool_result",
|
|
188651
|
+
toolUseId: toolResultId,
|
|
188652
|
+
assistantIndex: i3,
|
|
188653
|
+
assistantMessageId: msg.message.id,
|
|
188654
|
+
userIndex: i3 + 1
|
|
188655
|
+
});
|
|
188656
|
+
}
|
|
188657
|
+
seenToolResultIds.add(toolResultId);
|
|
188658
|
+
}
|
|
188659
|
+
for (const toolUseId of toolUseIdSet) {
|
|
188660
|
+
if (!toolResultIdSet.has(toolUseId)) {
|
|
188661
|
+
issues.push({
|
|
188662
|
+
kind: "missing_tool_result",
|
|
188663
|
+
toolUseId,
|
|
188664
|
+
assistantIndex: i3,
|
|
188665
|
+
assistantMessageId: msg.message.id
|
|
188666
|
+
});
|
|
188667
|
+
}
|
|
188668
|
+
}
|
|
188669
|
+
for (const toolResultId of toolResultIdSet) {
|
|
188670
|
+
if (!toolUseIdSet.has(toolResultId)) {
|
|
188671
|
+
issues.push({
|
|
188672
|
+
kind: "orphaned_tool_result",
|
|
188673
|
+
toolUseId: toolResultId,
|
|
188674
|
+
assistantIndex: i3,
|
|
188675
|
+
assistantMessageId: msg.message.id,
|
|
188676
|
+
userIndex: i3 + 1
|
|
188677
|
+
});
|
|
188678
|
+
}
|
|
188679
|
+
}
|
|
188680
|
+
}
|
|
188681
|
+
return {
|
|
188682
|
+
valid: issues.length === 0,
|
|
188683
|
+
context,
|
|
188684
|
+
issues
|
|
188685
|
+
};
|
|
188686
|
+
}
|
|
188687
|
+
function formatToolResultPairingIssue(issue2) {
|
|
188688
|
+
const parts = [`kind=${issue2.kind}`, `tool_use_id=${issue2.toolUseId}`];
|
|
188689
|
+
if (issue2.assistantIndex !== undefined) {
|
|
188690
|
+
parts.push(`assistant_index=${issue2.assistantIndex}`);
|
|
188691
|
+
}
|
|
188692
|
+
if (issue2.assistantMessageId !== undefined) {
|
|
188693
|
+
parts.push(`assistant_message_id=${issue2.assistantMessageId}`);
|
|
188694
|
+
}
|
|
188695
|
+
if (issue2.userIndex !== undefined) {
|
|
188696
|
+
parts.push(`user_index=${issue2.userIndex}`);
|
|
188697
|
+
}
|
|
188698
|
+
if (issue2.duplicateOfAssistantIndex !== undefined) {
|
|
188699
|
+
parts.push(`duplicate_of_assistant_index=${issue2.duplicateOfAssistantIndex}`);
|
|
188700
|
+
}
|
|
188701
|
+
if (issue2.duplicateOfAssistantMessageId !== undefined) {
|
|
188702
|
+
parts.push(`duplicate_of_assistant_message_id=${issue2.duplicateOfAssistantMessageId}`);
|
|
188703
|
+
}
|
|
188704
|
+
return parts.join(",");
|
|
188705
|
+
}
|
|
188706
|
+
var init_toolPairing = __esm(() => {
|
|
188707
|
+
init_debug();
|
|
188708
|
+
});
|
|
188709
|
+
|
|
188344
188710
|
// src/utils/relevancePruning.ts
|
|
188345
188711
|
function extractKeywords(text) {
|
|
188346
188712
|
const words = text.toLowerCase().split(/\s+/);
|
|
@@ -188427,8 +188793,13 @@ function pruneByRelevance(messages, options2) {
|
|
|
188427
188793
|
if (messages.length <= preserveRecent) {
|
|
188428
188794
|
return messages;
|
|
188429
188795
|
}
|
|
188430
|
-
const
|
|
188431
|
-
const
|
|
188796
|
+
const requestedRecentStart = Math.max(0, messages.length - preserveRecent);
|
|
188797
|
+
const recentRange = selectToolPairSafeMessageRange(messages, requestedRecentStart, messages.length, {
|
|
188798
|
+
projectionName: "relevance_pruning_recent",
|
|
188799
|
+
querySource: "compact"
|
|
188800
|
+
});
|
|
188801
|
+
const recentMessages = recentRange.messages;
|
|
188802
|
+
const olderMessages = messages.slice(0, recentRange.start);
|
|
188432
188803
|
const olderGroups = groupMessagesByApiRound(olderMessages);
|
|
188433
188804
|
const scored = [];
|
|
188434
188805
|
for (const group of olderGroups) {
|
|
@@ -188458,6 +188829,7 @@ function pruneByRelevance(messages, options2) {
|
|
|
188458
188829
|
var STOP_WORDS;
|
|
188459
188830
|
var init_relevancePruning = __esm(() => {
|
|
188460
188831
|
init_tokenEstimation();
|
|
188832
|
+
init_toolPairing();
|
|
188461
188833
|
STOP_WORDS = new Set([
|
|
188462
188834
|
"the",
|
|
188463
188835
|
"and",
|
|
@@ -211232,6 +211604,24 @@ var init_headlessProfiler = __esm(() => {
|
|
|
211232
211604
|
SHOULD_PROFILE2 = DETAILED_PROFILING2 || STATSIG_LOGGING_SAMPLED2;
|
|
211233
211605
|
});
|
|
211234
211606
|
|
|
211607
|
+
// src/query/model.ts
|
|
211608
|
+
function resolveQueryTurnModel({
|
|
211609
|
+
permissionMode,
|
|
211610
|
+
turnModel,
|
|
211611
|
+
sessionModel,
|
|
211612
|
+
exceeds200kTokens = false
|
|
211613
|
+
}) {
|
|
211614
|
+
const requestedModel = turnModel ?? parseUserSpecifiedModel(sessionModel ?? getDefaultMainLoopModelSetting());
|
|
211615
|
+
return getRuntimeMainLoopModel({
|
|
211616
|
+
permissionMode,
|
|
211617
|
+
mainLoopModel: requestedModel,
|
|
211618
|
+
exceeds200kTokens
|
|
211619
|
+
});
|
|
211620
|
+
}
|
|
211621
|
+
var init_model2 = __esm(() => {
|
|
211622
|
+
init_model();
|
|
211623
|
+
});
|
|
211624
|
+
|
|
211235
211625
|
// src/tools/SleepTool/prompt.ts
|
|
211236
211626
|
var SLEEP_TOOL_NAME = "Sleep", SLEEP_TOOL_PROMPT;
|
|
211237
211627
|
var init_prompt8 = __esm(() => {
|
|
@@ -385171,6 +385561,39 @@ function getNextImagePasteId(messages) {
|
|
|
385171
385561
|
}
|
|
385172
385562
|
return maxId + 1;
|
|
385173
385563
|
}
|
|
385564
|
+
function messageContainsToolResult(message, toolUseId) {
|
|
385565
|
+
return message.type === "user" && Array.isArray(message.message.content) && message.message.content.some((block2) => block2.type === "tool_result" && block2.tool_use_id === toolUseId);
|
|
385566
|
+
}
|
|
385567
|
+
function createMissingToolResultMessage(toolUseId, assistantMessage2) {
|
|
385568
|
+
const errorMessage2 = "Tool execution ended without returning a result. The tool was not run again.";
|
|
385569
|
+
return {
|
|
385570
|
+
message: createUserMessage({
|
|
385571
|
+
content: [
|
|
385572
|
+
{
|
|
385573
|
+
type: "tool_result",
|
|
385574
|
+
content: `<tool_use_error>${errorMessage2}</tool_use_error>`,
|
|
385575
|
+
is_error: true,
|
|
385576
|
+
tool_use_id: toolUseId
|
|
385577
|
+
}
|
|
385578
|
+
],
|
|
385579
|
+
toolUseResult: errorMessage2,
|
|
385580
|
+
sourceToolAssistantUUID: assistantMessage2.uuid
|
|
385581
|
+
})
|
|
385582
|
+
};
|
|
385583
|
+
}
|
|
385584
|
+
async function* ensureTerminalToolResult(updates, toolUseId, assistantMessage2, onMissing = () => {}) {
|
|
385585
|
+
let hasTerminalToolResult = false;
|
|
385586
|
+
for await (const update of updates) {
|
|
385587
|
+
if (messageContainsToolResult(update.message, toolUseId)) {
|
|
385588
|
+
hasTerminalToolResult = true;
|
|
385589
|
+
}
|
|
385590
|
+
yield update;
|
|
385591
|
+
}
|
|
385592
|
+
if (!hasTerminalToolResult) {
|
|
385593
|
+
onMissing();
|
|
385594
|
+
yield createMissingToolResultMessage(toolUseId, assistantMessage2);
|
|
385595
|
+
}
|
|
385596
|
+
}
|
|
385174
385597
|
function findMcpServerConnection(toolName, mcpClients) {
|
|
385175
385598
|
if (!toolName.startsWith("mcp__")) {
|
|
385176
385599
|
return;
|
|
@@ -385246,6 +385669,7 @@ async function* runToolUse(toolUse, assistantMessage2, canUseTool, toolUseContex
|
|
|
385246
385669
|
return;
|
|
385247
385670
|
}
|
|
385248
385671
|
const toolInput = toolUse.input;
|
|
385672
|
+
let hasTerminalToolResult = false;
|
|
385249
385673
|
try {
|
|
385250
385674
|
if (toolUseContext.abortController.signal.aborted) {
|
|
385251
385675
|
logEvent("tengu_tool_use_cancelled", {
|
|
@@ -385282,7 +385706,21 @@ async function* runToolUse(toolUse, assistantMessage2, canUseTool, toolUseContex
|
|
|
385282
385706
|
toolUseId: toolUse.id,
|
|
385283
385707
|
inputKeys: Object.keys(toolInput ?? {})
|
|
385284
385708
|
}), { level: "debug" });
|
|
385285
|
-
|
|
385709
|
+
const toolUpdates = streamedCheckPermissionsAndCallTool(tool, toolUse.id, toolInput, toolUseContext, canUseTool, assistantMessage2, messageId, requestId, mcpServerType, mcpServerBaseUrl);
|
|
385710
|
+
for await (const update of ensureTerminalToolResult(toolUpdates, toolUse.id, assistantMessage2, () => {
|
|
385711
|
+
const sanitizedToolName = sanitizeToolNameForAnalytics(tool.name);
|
|
385712
|
+
logEvent("tengu_tool_result_missing_at_execution", {
|
|
385713
|
+
toolName: sanitizedToolName,
|
|
385714
|
+
toolUseID: toolUse.id,
|
|
385715
|
+
model: toolUseContext.options.mainLoopModel,
|
|
385716
|
+
querySource: toolUseContext.options.querySource ?? "unknown",
|
|
385717
|
+
isMcp: tool.isMcp ?? false
|
|
385718
|
+
});
|
|
385719
|
+
logError2(new Error(`runToolUse: ${sanitizedToolName} completed without a tool_result`));
|
|
385720
|
+
})) {
|
|
385721
|
+
if (messageContainsToolResult(update.message, toolUse.id)) {
|
|
385722
|
+
hasTerminalToolResult = true;
|
|
385723
|
+
}
|
|
385286
385724
|
yield update;
|
|
385287
385725
|
}
|
|
385288
385726
|
logForDebugging(JSON.stringify({
|
|
@@ -385295,20 +385733,22 @@ async function* runToolUse(toolUse, assistantMessage2, canUseTool, toolUseContex
|
|
|
385295
385733
|
const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
|
|
385296
385734
|
const toolInfo = tool ? ` (${tool.name})` : "";
|
|
385297
385735
|
const detailedError = `Error calling tool${toolInfo}: ${errorMessage2}`;
|
|
385298
|
-
|
|
385299
|
-
|
|
385300
|
-
|
|
385301
|
-
|
|
385302
|
-
|
|
385303
|
-
|
|
385304
|
-
|
|
385305
|
-
|
|
385306
|
-
|
|
385307
|
-
|
|
385308
|
-
|
|
385309
|
-
|
|
385310
|
-
|
|
385311
|
-
|
|
385736
|
+
if (!hasTerminalToolResult) {
|
|
385737
|
+
yield {
|
|
385738
|
+
message: createUserMessage({
|
|
385739
|
+
content: [
|
|
385740
|
+
{
|
|
385741
|
+
type: "tool_result",
|
|
385742
|
+
content: `<tool_use_error>${detailedError}</tool_use_error>`,
|
|
385743
|
+
is_error: true,
|
|
385744
|
+
tool_use_id: toolUse.id
|
|
385745
|
+
}
|
|
385746
|
+
],
|
|
385747
|
+
toolUseResult: detailedError,
|
|
385748
|
+
sourceToolAssistantUUID: assistantMessage2.uuid
|
|
385749
|
+
})
|
|
385750
|
+
};
|
|
385751
|
+
}
|
|
385312
385752
|
}
|
|
385313
385753
|
}
|
|
385314
385754
|
function streamedCheckPermissionsAndCallTool(tool, toolUseID, input, toolUseContext, canUseTool, assistantMessage2, messageId, requestId, mcpServerType, mcpServerBaseUrl) {
|
|
@@ -388265,10 +388705,11 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
388265
388705
|
let streamingToolExecutor = useStreamingToolExecution ? new StreamingToolExecutor(toolUseContext.options.tools, canUseTool, toolUseContext) : null;
|
|
388266
388706
|
const appState = toolUseContext.getAppState();
|
|
388267
388707
|
const permissionMode = appState.toolPermissionContext.mode;
|
|
388268
|
-
const
|
|
388269
|
-
let currentModel =
|
|
388708
|
+
const sessionModel = appState.mainLoopModelForSession ?? appState.mainLoopModel;
|
|
388709
|
+
let currentModel = resolveQueryTurnModel({
|
|
388270
388710
|
permissionMode,
|
|
388271
|
-
|
|
388711
|
+
turnModel: toolUseContext.options.mainLoopModel,
|
|
388712
|
+
sessionModel,
|
|
388272
388713
|
exceeds200kTokens: permissionMode === "plan" && doesMostRecentAssistantMessageExceed200k(messagesForQuery)
|
|
388273
388714
|
});
|
|
388274
388715
|
queryCheckpoint("query_setup_end");
|
|
@@ -388991,6 +389432,7 @@ var init_query2 = __esm(() => {
|
|
|
388991
389432
|
init_messageQueueManager();
|
|
388992
389433
|
init_headlessProfiler();
|
|
388993
389434
|
init_model();
|
|
389435
|
+
init_model2();
|
|
388994
389436
|
init_tokens();
|
|
388995
389437
|
init_context();
|
|
388996
389438
|
init_growthbook();
|
|
@@ -389080,7 +389522,7 @@ function getAnthropicEnvMetadata() {
|
|
|
389080
389522
|
function getBuildAgeMinutes() {
|
|
389081
389523
|
if (false)
|
|
389082
389524
|
;
|
|
389083
|
-
const buildTime = new Date("2026-08-
|
|
389525
|
+
const buildTime = new Date("2026-08-08T15:44:34.132Z").getTime();
|
|
389084
389526
|
if (isNaN(buildTime))
|
|
389085
389527
|
return;
|
|
389086
389528
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -390421,8 +390863,14 @@ async function partialCompactConversation(allMessages, pivotIndex, context, cach
|
|
|
390421
390863
|
logMemoryDiagnostics("compact-start", memoryDiagExtra);
|
|
390422
390864
|
maybeLogMemoryHighWatermark("compact-start", memoryDiagExtra);
|
|
390423
390865
|
try {
|
|
390424
|
-
const
|
|
390425
|
-
const
|
|
390866
|
+
const requestedStart = direction === "up_to" ? 0 : pivotIndex;
|
|
390867
|
+
const requestedEnd = direction === "up_to" ? pivotIndex : allMessages.length;
|
|
390868
|
+
const summarizeRange = selectToolPairSafeMessageRange(allMessages, requestedStart, requestedEnd, {
|
|
390869
|
+
projectionName: "partial_compact",
|
|
390870
|
+
querySource: "compact"
|
|
390871
|
+
});
|
|
390872
|
+
const messagesToSummarize = summarizeRange.messages;
|
|
390873
|
+
const messagesToKeep = direction === "up_to" ? allMessages.slice(summarizeRange.end).filter((m) => m.type !== "progress" && !isCompactBoundaryMessage(m) && !(m.type === "user" && m.isCompactSummary)) : allMessages.slice(0, summarizeRange.start).filter((m) => m.type !== "progress");
|
|
390426
390874
|
if (messagesToSummarize.length === 0) {
|
|
390427
390875
|
throw new Error(direction === "up_to" ? "Nothing to summarize before the selected message." : "Nothing to summarize after the selected message.");
|
|
390428
390876
|
}
|
|
@@ -405047,7 +405495,7 @@ function createToolUseSummaryMessage(summary, precedingToolUseIds) {
|
|
|
405047
405495
|
timestamp: new Date().toISOString()
|
|
405048
405496
|
};
|
|
405049
405497
|
}
|
|
405050
|
-
function ensureToolResultPairing(messages) {
|
|
405498
|
+
function ensureToolResultPairing(messages, context = {}) {
|
|
405051
405499
|
const result = [];
|
|
405052
405500
|
let repaired = false;
|
|
405053
405501
|
const allSeenToolUseIds = new Set;
|
|
@@ -405187,6 +405635,7 @@ function ensureToolResultPairing(messages) {
|
|
|
405187
405635
|
}
|
|
405188
405636
|
}
|
|
405189
405637
|
if (repaired) {
|
|
405638
|
+
const validation = validateToolResultPairing(messages, context);
|
|
405190
405639
|
const messageTypes = messages.map((m, idx) => {
|
|
405191
405640
|
if (m.type === "assistant") {
|
|
405192
405641
|
const toolUses = m.message.content.filter((b) => b.type === "tool_use").map((b) => b.id);
|
|
@@ -405209,14 +405658,26 @@ function ensureToolResultPairing(messages) {
|
|
|
405209
405658
|
return `[${idx}] ${m.type}`;
|
|
405210
405659
|
});
|
|
405211
405660
|
if (getStrictToolResultPairing()) {
|
|
405212
|
-
throw new Error(`ensureToolResultPairing: tool_use/tool_result pairing mismatch detected (strict mode). ` + `Refusing to repair — would inject synthetic placeholders into model context. ` + `Message structure: ${messageTypes.join("; ")}. See inc-4977.`);
|
|
405661
|
+
throw new Error(`ensureToolResultPairing: tool_use/tool_result pairing mismatch detected (strict mode). ` + `Refusing to repair — would inject synthetic placeholders into model context. ` + `Phase: ${validation.context.phase ?? "unknown"}. ` + `Issues: ${validation.issues.map(formatToolResultPairingIssue).join("; ") || "none"}. ` + `Message structure: ${messageTypes.join("; ")}. See inc-4977.`);
|
|
405213
405662
|
}
|
|
405663
|
+
const issueKinds = [
|
|
405664
|
+
...new Set(validation.issues.map((issue2) => issue2.kind))
|
|
405665
|
+
].join(",");
|
|
405666
|
+
const issueSummary = validation.issues.map(formatToolResultPairingIssue).join("; ") || "none";
|
|
405667
|
+
const diagnosticContext = `Phase: ${validation.context.phase ?? "unknown"}. ` + `Query source: ${validation.context.querySource ?? "unknown"}. ` + `Provider: ${validation.context.provider ?? "unknown"}. ` + `Model: ${validation.context.model ?? "unknown"}. ` + `Issues: ${issueSummary}.`;
|
|
405214
405668
|
logEvent("tengu_tool_result_pairing_repaired", {
|
|
405215
405669
|
messageCount: messages.length,
|
|
405216
405670
|
repairedMessageCount: result.length,
|
|
405671
|
+
issueCount: validation.issues.length,
|
|
405672
|
+
phase: validation.context.phase ?? "unknown",
|
|
405673
|
+
querySource: validation.context.querySource ?? "unknown",
|
|
405674
|
+
agentId: validation.context.agentId ?? "none",
|
|
405675
|
+
model: validation.context.model ?? "unknown",
|
|
405676
|
+
provider: validation.context.provider ?? "unknown",
|
|
405677
|
+
issueKinds: issueKinds || "none",
|
|
405217
405678
|
messageTypes: messageTypes.join("; ")
|
|
405218
405679
|
});
|
|
405219
|
-
logError2(new Error(`ensureToolResultPairing: repaired missing tool_result blocks (${messages.length} -> ${result.length} messages). Message structure: ${messageTypes.join("; ")}`));
|
|
405680
|
+
logError2(new Error(`ensureToolResultPairing: repaired missing tool_result blocks (${messages.length} -> ${result.length} messages). ${diagnosticContext} Message structure: ${messageTypes.join("; ")}`));
|
|
405220
405681
|
}
|
|
405221
405682
|
return result;
|
|
405222
405683
|
}
|
|
@@ -405340,11 +405801,13 @@ var init_messages3 = __esm(() => {
|
|
|
405340
405801
|
init_imageValidation();
|
|
405341
405802
|
init_json();
|
|
405342
405803
|
init_log3();
|
|
405804
|
+
init_toolPairing();
|
|
405343
405805
|
init_permissionRuleParser();
|
|
405344
405806
|
init_planModeV2();
|
|
405345
405807
|
init_stringUtils();
|
|
405346
405808
|
init_tasks();
|
|
405347
405809
|
init_toolSearch();
|
|
405810
|
+
init_toolPairing();
|
|
405348
405811
|
DENIAL_WORKAROUND_GUIDANCE = `IMPORTANT: You *may* attempt to accomplish this action using other tools that might naturally be used to accomplish this goal, ` + `e.g. using head instead of cat. But you *should not* attempt to work around this denial in malicious ways, ` + `e.g. do not use your ability to run tests to execute non-test actions. ` + `You should only try to work around this restriction in reasonable ways that do not attempt to bypass the intent behind this denial. ` + `If you believe this capability is essential to complete the user's request, STOP and explain to the user ` + `what you were trying to do and why you need this permission. Let the user decide how to proceed.`;
|
|
405349
405812
|
SYNTHETIC_MESSAGES = new Set([
|
|
405350
405813
|
INTERRUPT_MESSAGE,
|
|
@@ -417485,7 +417948,13 @@ async function* queryModel(messages, systemPrompt, thinkingConfig, tools, signal
|
|
|
417485
417948
|
}
|
|
417486
417949
|
});
|
|
417487
417950
|
}
|
|
417488
|
-
messagesForAPI = ensureToolResultPairing(messagesForAPI
|
|
417951
|
+
messagesForAPI = ensureToolResultPairing(messagesForAPI, {
|
|
417952
|
+
phase: "api_before_repair",
|
|
417953
|
+
querySource: options2.querySource,
|
|
417954
|
+
agentId: options2.agentId,
|
|
417955
|
+
model: options2.model,
|
|
417956
|
+
provider: getAPIProvider()
|
|
417957
|
+
});
|
|
417489
417958
|
if (!betas.includes(ADVISOR_BETA_HEADER)) {
|
|
417490
417959
|
messagesForAPI = stripAdvisorBlocks(messagesForAPI);
|
|
417491
417960
|
}
|
|
@@ -430741,7 +431210,7 @@ function buildPrimarySection() {
|
|
|
430741
431210
|
});
|
|
430742
431211
|
return [{
|
|
430743
431212
|
label: "Version",
|
|
430744
|
-
value: "0.15.
|
|
431213
|
+
value: "0.15.5"
|
|
430745
431214
|
}, {
|
|
430746
431215
|
label: "Session name",
|
|
430747
431216
|
value: nameValue
|
|
@@ -444627,7 +445096,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
|
|
|
444627
445096
|
return `${VERBOO_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
|
|
444628
445097
|
}
|
|
444629
445098
|
function getPublicBuildVersion() {
|
|
444630
|
-
return "0.15.
|
|
445099
|
+
return "0.15.5";
|
|
444631
445100
|
}
|
|
444632
445101
|
var import_semver10, VERBOO_RELEASES_URL = "https://github.com/verbeux-ai/code/releases", fallbackBuildVersion, publicBuildVersion;
|
|
444633
445102
|
var init_version = __esm(() => {
|
|
@@ -496020,7 +496489,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
496020
496489
|
var call66 = async () => {
|
|
496021
496490
|
return {
|
|
496022
496491
|
type: "text",
|
|
496023
|
-
value: `${"99.0.0"} (built ${"2026-08-
|
|
496492
|
+
value: `${"99.0.0"} (built ${"2026-08-08T15:44:34.132Z"})`
|
|
496024
496493
|
};
|
|
496025
496494
|
}, version2, version_default;
|
|
496026
496495
|
var init_version2 = __esm(() => {
|
|
@@ -500452,7 +500921,7 @@ var React123, jsx_runtime354, call74 = async (onDone, context2, args) => {
|
|
|
500452
500921
|
onDone
|
|
500453
500922
|
});
|
|
500454
500923
|
};
|
|
500455
|
-
var
|
|
500924
|
+
var init_model3 = __esm(() => {
|
|
500456
500925
|
init_source2();
|
|
500457
500926
|
init_ModelPicker();
|
|
500458
500927
|
init_xml();
|
|
@@ -500486,7 +500955,7 @@ var init_model2 = __esm(() => {
|
|
|
500486
500955
|
|
|
500487
500956
|
// src/commands/model/index.ts
|
|
500488
500957
|
var model_default;
|
|
500489
|
-
var
|
|
500958
|
+
var init_model4 = __esm(() => {
|
|
500490
500959
|
init_immediateCommand();
|
|
500491
500960
|
init_model();
|
|
500492
500961
|
model_default = {
|
|
@@ -500499,7 +500968,7 @@ var init_model3 = __esm(() => {
|
|
|
500499
500968
|
get immediate() {
|
|
500500
500969
|
return shouldInferenceConfigCommandBeImmediate();
|
|
500501
500970
|
},
|
|
500502
|
-
load: () => Promise.resolve().then(() => (
|
|
500971
|
+
load: () => Promise.resolve().then(() => (init_model3(), exports_model2))
|
|
500503
500972
|
};
|
|
500504
500973
|
});
|
|
500505
500974
|
|
|
@@ -508306,7 +508775,7 @@ var init_commands2 = __esm(() => {
|
|
|
508306
508775
|
init_env2();
|
|
508307
508776
|
init_exit2();
|
|
508308
508777
|
init_export2();
|
|
508309
|
-
|
|
508778
|
+
init_model4();
|
|
508310
508779
|
init_tag2();
|
|
508311
508780
|
init_output_style();
|
|
508312
508781
|
init_remote_env2();
|
|
@@ -520286,7 +520755,7 @@ function printStartupScreen(modelOverride) {
|
|
|
520286
520755
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
520287
520756
|
const cwd2 = process.cwd();
|
|
520288
520757
|
const displayCwd = home && cwd2.startsWith(home) ? `~${cwd2.slice(home.length)}` : cwd2;
|
|
520289
|
-
const version3 = "0.15.
|
|
520758
|
+
const version3 = "0.15.5";
|
|
520290
520759
|
const columns = process.stdout.columns ?? STARTUP_LOGO_MIN_COLUMNS;
|
|
520291
520760
|
process.stdout.write(renderStartupScreen(p, version3, displayCwd, columns));
|
|
520292
520761
|
}
|
|
@@ -539530,7 +539999,7 @@ var init_routerRateLimitHook = __esm(() => {
|
|
|
539530
539999
|
function getSemverPart(version3) {
|
|
539531
540000
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
539532
540001
|
}
|
|
539533
|
-
function useUpdateNotification(updatedVersion, initialVersion = "0.15.
|
|
540002
|
+
function useUpdateNotification(updatedVersion, initialVersion = "0.15.5") {
|
|
539534
540003
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react227.useState(() => getSemverPart(initialVersion));
|
|
539535
540004
|
const [pendingNotification2, setPendingNotification] = import_react227.useState(null);
|
|
539536
540005
|
if (updatedVersion) {
|
|
@@ -539570,7 +540039,7 @@ function AutoUpdater({
|
|
|
539570
540039
|
return;
|
|
539571
540040
|
}
|
|
539572
540041
|
if (false) {}
|
|
539573
|
-
const currentVersion = "0.15.
|
|
540042
|
+
const currentVersion = "0.15.5";
|
|
539574
540043
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
539575
540044
|
let latestVersion = await getLatestVersion(channel2);
|
|
539576
540045
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -539923,17 +540392,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
539923
540392
|
const maxVersion = await getMaxVersion();
|
|
539924
540393
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
539925
540394
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
539926
|
-
if (gte("0.15.
|
|
539927
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.15.
|
|
540395
|
+
if (gte("0.15.5", maxVersion)) {
|
|
540396
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.15.5"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
539928
540397
|
setUpdateAvailable(false);
|
|
539929
540398
|
return;
|
|
539930
540399
|
}
|
|
539931
540400
|
latest = maxVersion;
|
|
539932
540401
|
}
|
|
539933
|
-
const hasUpdate = latest && !gte("0.15.
|
|
540402
|
+
const hasUpdate = latest && !gte("0.15.5", latest) && !shouldSkipVersion(latest);
|
|
539934
540403
|
setUpdateAvailable(!!hasUpdate);
|
|
539935
540404
|
if (hasUpdate) {
|
|
539936
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.15.
|
|
540405
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.15.5"} -> ${latest}`);
|
|
539937
540406
|
}
|
|
539938
540407
|
};
|
|
539939
540408
|
$2[0] = t1;
|
|
@@ -539967,7 +540436,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
539967
540436
|
wrap: "truncate",
|
|
539968
540437
|
children: [
|
|
539969
540438
|
"currentVersion: ",
|
|
539970
|
-
"0.15.
|
|
540439
|
+
"0.15.5"
|
|
539971
540440
|
]
|
|
539972
540441
|
});
|
|
539973
540442
|
$2[3] = verbose;
|
|
@@ -555985,10 +556454,10 @@ async function autoUpdateCliInBackground() {
|
|
|
555985
556454
|
return;
|
|
555986
556455
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
555987
556456
|
const latest = await getLatestVersion(channel2);
|
|
555988
|
-
if (!latest || gte("0.15.
|
|
556457
|
+
if (!latest || gte("0.15.5", latest))
|
|
555989
556458
|
return;
|
|
555990
556459
|
writeToStdout(`
|
|
555991
|
-
Nova versão disponível: ${latest} (atual: ${"0.15.
|
|
556460
|
+
Nova versão disponível: ${latest} (atual: ${"0.15.5"})
|
|
555992
556461
|
`);
|
|
555993
556462
|
writeToStdout(`Atualizando automaticamente...
|
|
555994
556463
|
`);
|
|
@@ -561921,7 +562390,13 @@ async function generateAwaySummary(messages, signal) {
|
|
|
561921
562390
|
}
|
|
561922
562391
|
try {
|
|
561923
562392
|
const memory2 = await getSessionMemoryContent();
|
|
561924
|
-
const
|
|
562393
|
+
const requestedStart = Math.max(0, messages.length - RECENT_MESSAGE_WINDOW);
|
|
562394
|
+
const recentRange = selectToolPairSafeMessageRange(messages, requestedStart, messages.length, {
|
|
562395
|
+
projectionName: "away_summary",
|
|
562396
|
+
querySource: "away_summary",
|
|
562397
|
+
maxExtraMessages: RECENT_MESSAGE_WINDOW
|
|
562398
|
+
});
|
|
562399
|
+
const recent = [...recentRange.messages];
|
|
561925
562400
|
recent.push(createUserMessage({ content: buildAwaySummaryPrompt(memory2) }));
|
|
561926
562401
|
const response = await queryModelWithoutStreaming({
|
|
561927
562402
|
messages: recent,
|
|
@@ -574201,7 +574676,7 @@ function WelcomeV2() {
|
|
|
574201
574676
|
dimColor: true,
|
|
574202
574677
|
children: [
|
|
574203
574678
|
"v",
|
|
574204
|
-
"0.15.
|
|
574679
|
+
"0.15.5",
|
|
574205
574680
|
" "
|
|
574206
574681
|
]
|
|
574207
574682
|
})
|
|
@@ -574388,7 +574863,7 @@ function WelcomeV2() {
|
|
|
574388
574863
|
dimColor: true,
|
|
574389
574864
|
children: [
|
|
574390
574865
|
"v",
|
|
574391
|
-
"0.15.
|
|
574866
|
+
"0.15.5",
|
|
574392
574867
|
" "
|
|
574393
574868
|
]
|
|
574394
574869
|
})
|
|
@@ -574604,7 +575079,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
574604
575079
|
dimColor: true,
|
|
574605
575080
|
children: [
|
|
574606
575081
|
"v",
|
|
574607
|
-
"0.15.
|
|
575082
|
+
"0.15.5",
|
|
574608
575083
|
" "
|
|
574609
575084
|
]
|
|
574610
575085
|
});
|
|
@@ -574813,7 +575288,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
574813
575288
|
dimColor: true,
|
|
574814
575289
|
children: [
|
|
574815
575290
|
"v",
|
|
574816
|
-
"0.15.
|
|
575291
|
+
"0.15.5",
|
|
574817
575292
|
" "
|
|
574818
575293
|
]
|
|
574819
575294
|
});
|
|
@@ -593269,7 +593744,7 @@ __export(exports_update, {
|
|
|
593269
593744
|
});
|
|
593270
593745
|
async function update() {
|
|
593271
593746
|
logEvent("tengu_update_check", {});
|
|
593272
|
-
writeToStdout(`Current version: ${"0.15.
|
|
593747
|
+
writeToStdout(`Current version: ${"0.15.5"}
|
|
593273
593748
|
`);
|
|
593274
593749
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
593275
593750
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -593354,8 +593829,8 @@ async function update() {
|
|
|
593354
593829
|
writeToStdout(`Verboo Code is managed by Homebrew.
|
|
593355
593830
|
`);
|
|
593356
593831
|
const latest = await getLatestVersion(channel2);
|
|
593357
|
-
if (latest && !gte("0.15.
|
|
593358
|
-
writeToStdout(`Update available: ${"0.15.
|
|
593832
|
+
if (latest && !gte("0.15.5", latest)) {
|
|
593833
|
+
writeToStdout(`Update available: ${"0.15.5"} → ${latest}
|
|
593359
593834
|
`);
|
|
593360
593835
|
writeToStdout(`
|
|
593361
593836
|
`);
|
|
@@ -593371,8 +593846,8 @@ async function update() {
|
|
|
593371
593846
|
writeToStdout(`Verboo Code is managed by winget.
|
|
593372
593847
|
`);
|
|
593373
593848
|
const latest = await getLatestVersion(channel2);
|
|
593374
|
-
if (latest && !gte("0.15.
|
|
593375
|
-
writeToStdout(`Update available: ${"0.15.
|
|
593849
|
+
if (latest && !gte("0.15.5", latest)) {
|
|
593850
|
+
writeToStdout(`Update available: ${"0.15.5"} → ${latest}
|
|
593376
593851
|
`);
|
|
593377
593852
|
writeToStdout(`
|
|
593378
593853
|
`);
|
|
@@ -593388,8 +593863,8 @@ async function update() {
|
|
|
593388
593863
|
writeToStdout(`Verboo Code is managed by apk.
|
|
593389
593864
|
`);
|
|
593390
593865
|
const latest = await getLatestVersion(channel2);
|
|
593391
|
-
if (latest && !gte("0.15.
|
|
593392
|
-
writeToStdout(`Update available: ${"0.15.
|
|
593866
|
+
if (latest && !gte("0.15.5", latest)) {
|
|
593867
|
+
writeToStdout(`Update available: ${"0.15.5"} → ${latest}
|
|
593393
593868
|
`);
|
|
593394
593869
|
writeToStdout(`
|
|
593395
593870
|
`);
|
|
@@ -593442,11 +593917,11 @@ async function update() {
|
|
|
593442
593917
|
`);
|
|
593443
593918
|
await gracefulShutdown(1);
|
|
593444
593919
|
}
|
|
593445
|
-
if (result.latestVersion === "0.15.
|
|
593446
|
-
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.
|
|
593920
|
+
if (result.latestVersion === "0.15.5") {
|
|
593921
|
+
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.5"})`) + `
|
|
593447
593922
|
`);
|
|
593448
593923
|
} else {
|
|
593449
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.15.
|
|
593924
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.15.5"} to version ${result.latestVersion}`) + `
|
|
593450
593925
|
`);
|
|
593451
593926
|
await regenerateCompletionCache();
|
|
593452
593927
|
}
|
|
@@ -593506,12 +593981,12 @@ async function update() {
|
|
|
593506
593981
|
`);
|
|
593507
593982
|
await gracefulShutdown(1);
|
|
593508
593983
|
}
|
|
593509
|
-
if (latestVersion === "0.15.
|
|
593510
|
-
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.
|
|
593984
|
+
if (latestVersion === "0.15.5") {
|
|
593985
|
+
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.15.5"})`) + `
|
|
593511
593986
|
`);
|
|
593512
593987
|
await gracefulShutdown(0);
|
|
593513
593988
|
}
|
|
593514
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.
|
|
593989
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.5"})
|
|
593515
593990
|
`);
|
|
593516
593991
|
writeToStdout(`Installing update...
|
|
593517
593992
|
`);
|
|
@@ -593556,7 +594031,7 @@ async function update() {
|
|
|
593556
594031
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
593557
594032
|
switch (status2) {
|
|
593558
594033
|
case "success":
|
|
593559
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.15.
|
|
594034
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.15.5"} to version ${latestVersion}`) + `
|
|
593560
594035
|
`);
|
|
593561
594036
|
await regenerateCompletionCache();
|
|
593562
594037
|
break;
|
|
@@ -594875,7 +595350,7 @@ ${customInstructions}` : customInstructions;
|
|
|
594875
595350
|
is_native_binary: isInBundledMode()
|
|
594876
595351
|
});
|
|
594877
595352
|
logMemoryDiagnostics("start", {
|
|
594878
|
-
version: "0.15.
|
|
595353
|
+
version: "0.15.5",
|
|
594879
595354
|
debug: debug2,
|
|
594880
595355
|
debugToStderr,
|
|
594881
595356
|
print: print ?? false,
|
|
@@ -595686,7 +596161,7 @@ Usage: verboo --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
595686
596161
|
pendingHookMessages
|
|
595687
596162
|
}, renderAndRun);
|
|
595688
596163
|
}
|
|
595689
|
-
}).version(`0.15.
|
|
596164
|
+
}).version(`0.15.5 (${cliDesc})`, "-v, --version", "Output the version number");
|
|
595690
596165
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
595691
596166
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
595692
596167
|
if (canUserConfigureAdvisor()) {
|
|
@@ -596267,7 +596742,7 @@ if (false) {}
|
|
|
596267
596742
|
async function main2() {
|
|
596268
596743
|
const args = process.argv.slice(2);
|
|
596269
596744
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
596270
|
-
console.log(`${"0.15.
|
|
596745
|
+
console.log(`${"0.15.5"} (Verboo Code)`);
|
|
596271
596746
|
return;
|
|
596272
596747
|
}
|
|
596273
596748
|
if (!IS_VERBOO_CLI && args.includes("--provider")) {
|
|
@@ -596441,4 +596916,4 @@ async function main2() {
|
|
|
596441
596916
|
}
|
|
596442
596917
|
main2();
|
|
596443
596918
|
|
|
596444
|
-
//# debugId=
|
|
596919
|
+
//# debugId=239F034E22FCB0DD64756E2164756E21
|