github-router 0.3.270 → 0.3.271
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/{attribution-settings-of5gJM5a.js → attribution-settings-DLRQEKpU.js} +3 -3
- package/dist/{attribution-settings-of5gJM5a.js.map → attribution-settings-DLRQEKpU.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{claude-BlzCUbVq.js → claude-BpQVQE0T.js} +6 -6
- package/dist/{claude-BlzCUbVq.js.map → claude-BpQVQE0T.js.map} +1 -1
- package/dist/{codex-BaFcXOyg.js → codex-CGMiGJy1.js} +4 -4
- package/dist/{codex-BaFcXOyg.js.map → codex-CGMiGJy1.js.map} +1 -1
- package/dist/engine-DUJyXWZn.js +2 -0
- package/dist/{gate-discovery-AUAjqSpV.js → gate-discovery-BBA7cV1D.js} +2 -2
- package/dist/{gate-discovery-AUAjqSpV.js.map → gate-discovery-BBA7cV1D.js.map} +1 -1
- package/dist/{internal-stop-hook-B1MIwmTR.js → internal-stop-hook-CO2NDmGL.js} +2 -2
- package/dist/{internal-stop-hook-B1MIwmTR.js.map → internal-stop-hook-CO2NDmGL.js.map} +1 -1
- package/dist/main.js +5 -5
- package/dist/{peer-mcp-personas-pWP3Eyt7.js → peer-mcp-personas-CN8xaXcV.js} +226 -18
- package/dist/peer-mcp-personas-CN8xaXcV.js.map +1 -0
- package/dist/{provision-CsYUVdMT.js → provision-CiPjSx7J.js} +2 -2
- package/dist/{provision-CsYUVdMT.js.map → provision-CiPjSx7J.js.map} +1 -1
- package/dist/{serve--c9n9hk4.js → serve-CpTMr5D9.js} +5 -5
- package/dist/{serve--c9n9hk4.js.map → serve-CpTMr5D9.js.map} +1 -1
- package/dist/{server-setup-BmyWS4WU.js → server-setup-B02Myghc.js} +8 -116
- package/dist/server-setup-B02Myghc.js.map +1 -0
- package/dist/{start-CXnLBouJ.js → start-CIV9eXVb.js} +3 -3
- package/dist/{start-CXnLBouJ.js.map → start-CIV9eXVb.js.map} +1 -1
- package/package.json +1 -1
- package/dist/engine-mwIgHJoi.js +0 -2
- package/dist/peer-mcp-personas-pWP3Eyt7.js.map +0 -1
- package/dist/server-setup-BmyWS4WU.js.map +0 -1
|
@@ -5,7 +5,7 @@ import { a as resolveExecutable, c as runManagedExeCapture, i as parseIntEnv, l
|
|
|
5
5
|
import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-0XrazT05.js";
|
|
6
6
|
import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-CGJbNeHb.js";
|
|
7
7
|
import { n as ArtifactError, r as applyInsecureTls, t as ArtifactClient } from "./client-CQMfroGV.js";
|
|
8
|
-
import { n as isPidAlive, r as registerColbertExitHandlers, s as trackChild, t as getColbertInstanceUuid } from "./lifecycle-AgNOtFRv.js";
|
|
8
|
+
import { n as isPidAlive$1, r as registerColbertExitHandlers, s as trackChild, t as getColbertInstanceUuid } from "./lifecycle-AgNOtFRv.js";
|
|
9
9
|
import { h as runGateChecks, m as sealedGateIds, p as resolveSealedGate } from "./stop-gate-hook-BqpumJtl.js";
|
|
10
10
|
import { t as liveExec } from "./orchestration-B_Q3ncXI.js";
|
|
11
11
|
import { createRequire } from "node:module";
|
|
@@ -4966,19 +4966,19 @@ function resolveTierModel(tier) {
|
|
|
4966
4966
|
}
|
|
4967
4967
|
//#endregion
|
|
4968
4968
|
//#region src/lib/first-mate/classifier.ts
|
|
4969
|
-
function isRecord$
|
|
4969
|
+
function isRecord$2(value) {
|
|
4970
4970
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4971
4971
|
}
|
|
4972
4972
|
function firstMessageContent$1(value) {
|
|
4973
|
-
if (!isRecord$
|
|
4973
|
+
if (!isRecord$2(value) || !Array.isArray(value.choices)) return null;
|
|
4974
4974
|
const first = value.choices[0];
|
|
4975
|
-
if (!isRecord$
|
|
4975
|
+
if (!isRecord$2(first) || !isRecord$2(first.message)) return null;
|
|
4976
4976
|
return typeof first.message.content === "string" ? first.message.content : null;
|
|
4977
4977
|
}
|
|
4978
4978
|
function parseJsonObject(value) {
|
|
4979
4979
|
try {
|
|
4980
4980
|
const parsed = JSON.parse(value);
|
|
4981
|
-
return isRecord$
|
|
4981
|
+
return isRecord$2(parsed) ? parsed : null;
|
|
4982
4982
|
} catch {
|
|
4983
4983
|
return null;
|
|
4984
4984
|
}
|
|
@@ -5048,7 +5048,7 @@ async function classifyPlanReady(logExcerpt) {
|
|
|
5048
5048
|
schemaHint: "{\"planReady\":boolean,\"planExcerpt\":\"<=1200 chars from the completed plan, or empty\",\"confidence\":number}",
|
|
5049
5049
|
maxTokens: 500,
|
|
5050
5050
|
validate(value) {
|
|
5051
|
-
if (!isRecord$
|
|
5051
|
+
if (!isRecord$2(value)) return null;
|
|
5052
5052
|
const planReady = booleanValue$1(value.planReady);
|
|
5053
5053
|
const planExcerpt = stringValue$1(value.planExcerpt);
|
|
5054
5054
|
if (planReady === null || planExcerpt === null) return null;
|
|
@@ -5065,7 +5065,7 @@ async function classifyQuestionAnswerable(question, acceptanceCriteria) {
|
|
|
5065
5065
|
user: `Acceptance criteria:\n${acceptanceCriteria}\n\nAgent question:\n${question}`,
|
|
5066
5066
|
schemaHint: "{\"answerable\":boolean,\"answer\":\"present only when answerable\",\"confidence\":number}",
|
|
5067
5067
|
validate(value) {
|
|
5068
|
-
if (!isRecord$
|
|
5068
|
+
if (!isRecord$2(value)) return null;
|
|
5069
5069
|
const answerable = booleanValue$1(value.answerable);
|
|
5070
5070
|
if (answerable === null) return null;
|
|
5071
5071
|
const answer = stringValue$1(value.answer);
|
|
@@ -5083,7 +5083,7 @@ async function classifyFixAddressed(failureSummary, latestLogExcerpt) {
|
|
|
5083
5083
|
user: `Failure summary:\n${failureSummary}\n\nLatest log excerpt:\n${latestLogExcerpt}`,
|
|
5084
5084
|
schemaHint: "{\"addressed\":boolean,\"confidence\":number}",
|
|
5085
5085
|
validate(value) {
|
|
5086
|
-
if (!isRecord$
|
|
5086
|
+
if (!isRecord$2(value)) return null;
|
|
5087
5087
|
const addressed = booleanValue$1(value.addressed);
|
|
5088
5088
|
return addressed === null ? null : { addressed };
|
|
5089
5089
|
}
|
|
@@ -5095,7 +5095,7 @@ async function classifyStuck(logExcerpt) {
|
|
|
5095
5095
|
user: `Log excerpt:\n${logExcerpt}`,
|
|
5096
5096
|
schemaHint: "{\"stuck\":boolean,\"confidence\":number}",
|
|
5097
5097
|
validate(value) {
|
|
5098
|
-
if (!isRecord$
|
|
5098
|
+
if (!isRecord$2(value)) return null;
|
|
5099
5099
|
const stuck = booleanValue$1(value.stuck);
|
|
5100
5100
|
return stuck === null ? null : { stuck };
|
|
5101
5101
|
}
|
|
@@ -9975,6 +9975,40 @@ const WIN_RENAME_TRANSIENT = /* @__PURE__ */ new Set([
|
|
|
9975
9975
|
"EBUSY"
|
|
9976
9976
|
]);
|
|
9977
9977
|
/**
|
|
9978
|
+
* Owner pid embedded in a `.draining.<pid>.<rand>` or `.claim.<pid>.<rand>`
|
|
9979
|
+
* segment. A file can carry both (a claimed orphan keeps the drain segment), so
|
|
9980
|
+
* the LAST match is the current owner.
|
|
9981
|
+
*/
|
|
9982
|
+
const OWNER_SEGMENT_RE = /\.(?:draining|claim)\.(\d+)\./g;
|
|
9983
|
+
/**
|
|
9984
|
+
* Claims held by a live drainer in THIS process, across instances. Per-instance
|
|
9985
|
+
* `inflight` cannot see a peer instance's claim, and both share our pid, so pid
|
|
9986
|
+
* liveness cannot separate them either. A claim abandoned on a read error is
|
|
9987
|
+
* never added here, which is what keeps it replayable (R3 #4).
|
|
9988
|
+
*/
|
|
9989
|
+
const heldClaims = /* @__PURE__ */ new Set();
|
|
9990
|
+
function ownerPidOf(name) {
|
|
9991
|
+
let pid;
|
|
9992
|
+
for (const match of name.matchAll(OWNER_SEGMENT_RE)) pid = Number(match[1]);
|
|
9993
|
+
return pid !== void 0 && Number.isInteger(pid) && pid > 0 ? pid : void 0;
|
|
9994
|
+
}
|
|
9995
|
+
/**
|
|
9996
|
+
* `process.kill(pid, 0)` probes existence without signalling; `EPERM` means the
|
|
9997
|
+
* process exists but is owned by another user (still alive). Mirrors the copies
|
|
9998
|
+
* in `lib/paths.ts`, `lib/colbert/lifecycle.ts`, and `lib/worker-agent/
|
|
9999
|
+
* lifecycle.ts` — kept local so first-mate takes no dependency on those modules.
|
|
10000
|
+
*/
|
|
10001
|
+
function isPidAlive(pid) {
|
|
10002
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
10003
|
+
try {
|
|
10004
|
+
process.kill(pid, 0);
|
|
10005
|
+
return true;
|
|
10006
|
+
} catch (err) {
|
|
10007
|
+
if (err.code === "EPERM") return true;
|
|
10008
|
+
return false;
|
|
10009
|
+
}
|
|
10010
|
+
}
|
|
10011
|
+
/**
|
|
9978
10012
|
* Atomically claim `from` by renaming it to the process-unique `to`.
|
|
9979
10013
|
* Returns `true` if THIS caller won the claim, `false` if a peer already took it
|
|
9980
10014
|
* (source gone). Retries transient Windows sharing violations so two concurrent
|
|
@@ -10070,6 +10104,9 @@ var AnswerInbox = class {
|
|
|
10070
10104
|
if (!name.startsWith(`${base}.draining.`)) continue;
|
|
10071
10105
|
const orphan = path.join(dir, name);
|
|
10072
10106
|
if (this.inflight.has(orphan)) continue;
|
|
10107
|
+
if (heldClaims.has(orphan)) continue;
|
|
10108
|
+
const owner = ownerPidOf(name);
|
|
10109
|
+
if (owner !== void 0 && owner !== process.pid && isPidAlive(owner)) continue;
|
|
10073
10110
|
const claim = `${orphan}.claim.${process.pid}.${randomBytes(4).toString("hex")}`;
|
|
10074
10111
|
if (!await claimByRename(orphan, claim)) continue;
|
|
10075
10112
|
try {
|
|
@@ -10086,11 +10123,15 @@ var AnswerInbox = class {
|
|
|
10086
10123
|
} catch (err) {
|
|
10087
10124
|
if (err.code !== "ENOENT") consola.warn(`first-mate: deferring unreadable inbox claim ${target} for retry:`, err);
|
|
10088
10125
|
}
|
|
10089
|
-
for (const p of claimed)
|
|
10126
|
+
for (const p of claimed) {
|
|
10127
|
+
this.inflight.add(p);
|
|
10128
|
+
heldClaims.add(p);
|
|
10129
|
+
}
|
|
10090
10130
|
const ack = async () => {
|
|
10091
10131
|
for (const p of claimed) {
|
|
10092
10132
|
await fs$1.unlink(p).catch(() => {});
|
|
10093
10133
|
this.inflight.delete(p);
|
|
10134
|
+
heldClaims.delete(p);
|
|
10094
10135
|
}
|
|
10095
10136
|
};
|
|
10096
10137
|
return {
|
|
@@ -11499,7 +11540,7 @@ function parsePackageJson(text) {
|
|
|
11499
11540
|
if (text === void 0) return void 0;
|
|
11500
11541
|
try {
|
|
11501
11542
|
const parsed = JSON.parse(text);
|
|
11502
|
-
if (!isRecord(parsed)) return void 0;
|
|
11543
|
+
if (!isRecord$1(parsed)) return void 0;
|
|
11503
11544
|
return {
|
|
11504
11545
|
scripts: stringRecord(parsed.scripts),
|
|
11505
11546
|
dependencies: stringRecord(parsed.dependencies),
|
|
@@ -11699,11 +11740,11 @@ function buildScaffoldPrBody(reports) {
|
|
|
11699
11740
|
"No factory protocol files are seeded; orchestration remains external to the repository."
|
|
11700
11741
|
].join("\n");
|
|
11701
11742
|
}
|
|
11702
|
-
function isRecord(value) {
|
|
11743
|
+
function isRecord$1(value) {
|
|
11703
11744
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11704
11745
|
}
|
|
11705
11746
|
function stringRecord(value) {
|
|
11706
|
-
if (!isRecord(value)) return {};
|
|
11747
|
+
if (!isRecord$1(value)) return {};
|
|
11707
11748
|
const result = {};
|
|
11708
11749
|
for (const [key, entry] of Object.entries(value)) if (typeof entry === "string") result[key] = entry;
|
|
11709
11750
|
return result;
|
|
@@ -15779,7 +15820,7 @@ async function freshnessVerdict(workspace) {
|
|
|
15779
15820
|
};
|
|
15780
15821
|
if (meta.status === "building") {
|
|
15781
15822
|
const pid = typeof meta.buildPid === "number" ? meta.buildPid : 0;
|
|
15782
|
-
if (isInitInFlight(workspace) || pid > 0 && isPidAlive(pid)) return {
|
|
15823
|
+
if (isInitInFlight(workspace) || pid > 0 && isPidAlive$1(pid)) return {
|
|
15783
15824
|
verdict: "building",
|
|
15784
15825
|
meta
|
|
15785
15826
|
};
|
|
@@ -27384,6 +27425,157 @@ function logStreamError(routePath, error, bytesRelayed) {
|
|
|
27384
27425
|
};
|
|
27385
27426
|
}
|
|
27386
27427
|
//#endregion
|
|
27428
|
+
//#region src/lib/thinking-history-repair.ts
|
|
27429
|
+
const THINKING_INTEGRITY_ERROR_RES = [/messages\.(\d+)\.content\.\d+:\s*`thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified/, /messages\.(\d+)\.content\.\d+:\s*Invalid `signature` in `thinking` block/];
|
|
27430
|
+
const MAX_REMEMBERED_REPAIRS = 1e3;
|
|
27431
|
+
const OMITTED_THINKING_PLACEHOLDER = "[prior reasoning omitted]";
|
|
27432
|
+
const repairSalt = randomBytes(32);
|
|
27433
|
+
const rememberedRepairs = /* @__PURE__ */ new Set();
|
|
27434
|
+
function declined(reason, detail = {}) {
|
|
27435
|
+
return {
|
|
27436
|
+
ok: false,
|
|
27437
|
+
decline: {
|
|
27438
|
+
reason,
|
|
27439
|
+
...detail
|
|
27440
|
+
}
|
|
27441
|
+
};
|
|
27442
|
+
}
|
|
27443
|
+
/** Render a decline as a single log-safe `key=value` line. */
|
|
27444
|
+
function formatThinkingRepairDecline(decline) {
|
|
27445
|
+
return Object.entries(decline).filter(([, value]) => value !== void 0).map(([key, value]) => `${key}=${String(value)}`).join(" ");
|
|
27446
|
+
}
|
|
27447
|
+
function isRecord(value) {
|
|
27448
|
+
return typeof value === "object" && value !== null;
|
|
27449
|
+
}
|
|
27450
|
+
/** Count signed blocks without hashing — used only to explain a decline. */
|
|
27451
|
+
function countSignedBlocks(content) {
|
|
27452
|
+
return content.filter((block) => isRecord(block) && (block.type === "thinking" || block.type === "redacted_thinking")).length;
|
|
27453
|
+
}
|
|
27454
|
+
function signedBlockFingerprint(_messageIndex, content) {
|
|
27455
|
+
const hash = createHash("sha256");
|
|
27456
|
+
hash.update(repairSalt);
|
|
27457
|
+
let signedBlocks = 0;
|
|
27458
|
+
for (let index = 0; index < content.length; index++) {
|
|
27459
|
+
const block = content[index];
|
|
27460
|
+
if (!isRecord(block)) continue;
|
|
27461
|
+
if (block.type !== "thinking" && block.type !== "redacted_thinking") continue;
|
|
27462
|
+
signedBlocks++;
|
|
27463
|
+
hash.update(String(index));
|
|
27464
|
+
hash.update(String(block.type));
|
|
27465
|
+
if (typeof block.signature === "string") hash.update(block.signature);
|
|
27466
|
+
if (typeof block.data === "string") hash.update(block.data);
|
|
27467
|
+
}
|
|
27468
|
+
return signedBlocks > 0 ? hash.digest("hex") : void 0;
|
|
27469
|
+
}
|
|
27470
|
+
function repairMessageAt(parsed, messageIndex) {
|
|
27471
|
+
if (!Array.isArray(parsed.messages)) return declined("no-messages-array", { messageIndex });
|
|
27472
|
+
const messages = [...parsed.messages];
|
|
27473
|
+
const detail = {
|
|
27474
|
+
messageIndex,
|
|
27475
|
+
messageCount: messages.length
|
|
27476
|
+
};
|
|
27477
|
+
const message = messages[messageIndex];
|
|
27478
|
+
if (!isRecord(message)) return declined("message-missing", detail);
|
|
27479
|
+
if (message.role !== "assistant") return declined("message-not-assistant", {
|
|
27480
|
+
...detail,
|
|
27481
|
+
roleAtIndex: typeof message.role === "string" ? message.role : "unknown"
|
|
27482
|
+
});
|
|
27483
|
+
if (!Array.isArray(message.content)) return declined("content-not-array", {
|
|
27484
|
+
...detail,
|
|
27485
|
+
roleAtIndex: "assistant"
|
|
27486
|
+
});
|
|
27487
|
+
const shape = {
|
|
27488
|
+
...detail,
|
|
27489
|
+
roleAtIndex: "assistant",
|
|
27490
|
+
blocksAtIndex: message.content.length,
|
|
27491
|
+
signedBlocksAtIndex: countSignedBlocks(message.content)
|
|
27492
|
+
};
|
|
27493
|
+
const fingerprint = signedBlockFingerprint(messageIndex, message.content);
|
|
27494
|
+
if (!fingerprint) return declined("no-signed-blocks", shape);
|
|
27495
|
+
const repairedContent = message.content.filter((block) => !isRecord(block) || block.type !== "thinking" && block.type !== "redacted_thinking");
|
|
27496
|
+
const removedBlocks = message.content.length - repairedContent.length;
|
|
27497
|
+
if (removedBlocks === 0) return declined("no-blocks-removed", shape);
|
|
27498
|
+
if (repairedContent.length === 0) repairedContent.push({
|
|
27499
|
+
type: "text",
|
|
27500
|
+
text: OMITTED_THINKING_PLACEHOLDER
|
|
27501
|
+
});
|
|
27502
|
+
messages[messageIndex] = {
|
|
27503
|
+
...message,
|
|
27504
|
+
content: repairedContent
|
|
27505
|
+
};
|
|
27506
|
+
parsed.messages = messages;
|
|
27507
|
+
return {
|
|
27508
|
+
ok: true,
|
|
27509
|
+
repair: {
|
|
27510
|
+
body: JSON.stringify(parsed),
|
|
27511
|
+
fingerprint,
|
|
27512
|
+
messageIndex,
|
|
27513
|
+
removedBlocks
|
|
27514
|
+
}
|
|
27515
|
+
};
|
|
27516
|
+
}
|
|
27517
|
+
/**
|
|
27518
|
+
* Build a one-shot repair only for Copilot's known signed-thinking integrity
|
|
27519
|
+
* rejections. The upstream error is the oracle: valid omitted-display thinking
|
|
27520
|
+
* also has an empty `thinking` string, so request shape alone cannot identify a
|
|
27521
|
+
* corrupt signature safely.
|
|
27522
|
+
*
|
|
27523
|
+
* Returns a discriminated outcome so a caller can report WHY a repair was not
|
|
27524
|
+
* applied; a silent decline is what made the original incident undiagnosable.
|
|
27525
|
+
*/
|
|
27526
|
+
function repairRejectedThinkingHistory(rawBody, upstreamErrorText) {
|
|
27527
|
+
const match = THINKING_INTEGRITY_ERROR_RES.map((pattern) => pattern.exec(upstreamErrorText)).find((candidate) => candidate !== null);
|
|
27528
|
+
if (!match) return declined("error-not-recognized");
|
|
27529
|
+
const messageIndex = Number(match[1]);
|
|
27530
|
+
if (!Number.isSafeInteger(messageIndex) || messageIndex < 0) return declined("message-index-invalid", { messageIndex });
|
|
27531
|
+
let parsed;
|
|
27532
|
+
try {
|
|
27533
|
+
parsed = JSON.parse(rawBody);
|
|
27534
|
+
} catch {
|
|
27535
|
+
return declined("body-not-json", { messageIndex });
|
|
27536
|
+
}
|
|
27537
|
+
return repairMessageAt(parsed, messageIndex);
|
|
27538
|
+
}
|
|
27539
|
+
/**
|
|
27540
|
+
* Reapply a repair already proven successful in this process. Only salted
|
|
27541
|
+
* digests are retained; no message, thinking, signature, or tool content is
|
|
27542
|
+
* stored.
|
|
27543
|
+
*/
|
|
27544
|
+
function repairKnownThinkingHistory(rawBody) {
|
|
27545
|
+
if (rememberedRepairs.size === 0) return void 0;
|
|
27546
|
+
let parsed;
|
|
27547
|
+
try {
|
|
27548
|
+
parsed = JSON.parse(rawBody);
|
|
27549
|
+
} catch {
|
|
27550
|
+
return;
|
|
27551
|
+
}
|
|
27552
|
+
if (!Array.isArray(parsed.messages)) return void 0;
|
|
27553
|
+
let repaired;
|
|
27554
|
+
let totalRemovedBlocks = 0;
|
|
27555
|
+
for (let index = parsed.messages.length - 1; index >= 0; index--) {
|
|
27556
|
+
const message = parsed.messages[index];
|
|
27557
|
+
if (!isRecord(message) || !Array.isArray(message.content)) continue;
|
|
27558
|
+
const fingerprint = signedBlockFingerprint(index, message.content);
|
|
27559
|
+
if (!fingerprint || !rememberedRepairs.has(fingerprint)) continue;
|
|
27560
|
+
const attempt = repairMessageAt(parsed, index);
|
|
27561
|
+
if (!attempt.ok) continue;
|
|
27562
|
+
totalRemovedBlocks += attempt.repair.removedBlocks;
|
|
27563
|
+
repaired = {
|
|
27564
|
+
...attempt.repair,
|
|
27565
|
+
removedBlocks: totalRemovedBlocks
|
|
27566
|
+
};
|
|
27567
|
+
}
|
|
27568
|
+
return repaired;
|
|
27569
|
+
}
|
|
27570
|
+
function rememberThinkingHistoryRepair(fingerprint) {
|
|
27571
|
+
if (rememberedRepairs.has(fingerprint)) return;
|
|
27572
|
+
if (rememberedRepairs.size >= MAX_REMEMBERED_REPAIRS) {
|
|
27573
|
+
const oldest = rememberedRepairs.values().next().value;
|
|
27574
|
+
if (typeof oldest === "string") rememberedRepairs.delete(oldest);
|
|
27575
|
+
}
|
|
27576
|
+
rememberedRepairs.add(fingerprint);
|
|
27577
|
+
}
|
|
27578
|
+
//#endregion
|
|
27387
27579
|
//#region src/services/advisor/advisor.ts
|
|
27388
27580
|
/**
|
|
27389
27581
|
* Phase I: ADVISOR proxy-side translation.
|
|
@@ -28062,11 +28254,27 @@ function buildAdvisorStream(opts) {
|
|
|
28062
28254
|
}))
|
|
28063
28255
|
});
|
|
28064
28256
|
if (aborter.signal.aborted) return;
|
|
28065
|
-
|
|
28257
|
+
let continuationSend = JSON.stringify({
|
|
28066
28258
|
...opts.baseBody,
|
|
28067
28259
|
messages: conversation,
|
|
28068
28260
|
stream: true
|
|
28069
|
-
})
|
|
28261
|
+
});
|
|
28262
|
+
const knownRepair = repairKnownThinkingHistory(continuationSend);
|
|
28263
|
+
if (knownRepair) continuationSend = knownRepair.body;
|
|
28264
|
+
try {
|
|
28265
|
+
response = await createMessages(continuationSend, opts.requestHeaders, aborter.signal, true);
|
|
28266
|
+
} catch (continuationError) {
|
|
28267
|
+
if (!(continuationError instanceof HTTPError)) throw continuationError;
|
|
28268
|
+
const errorBody = await continuationError.response.clone().text().catch(() => "");
|
|
28269
|
+
const outcome = repairRejectedThinkingHistory(continuationSend, errorBody);
|
|
28270
|
+
if (!outcome.ok) {
|
|
28271
|
+
consola.warn(`Advisor continuation thinking-history repair declined: ${formatThinkingRepairDecline(outcome.decline)}`);
|
|
28272
|
+
throw continuationError;
|
|
28273
|
+
}
|
|
28274
|
+
consola.warn(`Advisor continuation: retrying without rejected thinking blocks: message=${outcome.repair.messageIndex} removed_blocks=${outcome.repair.removedBlocks}`);
|
|
28275
|
+
response = await createMessages(outcome.repair.body, opts.requestHeaders, aborter.signal, true);
|
|
28276
|
+
rememberThinkingHistoryRepair(outcome.repair.fingerprint);
|
|
28277
|
+
}
|
|
28070
28278
|
}
|
|
28071
28279
|
if (aborter.signal.aborted) return;
|
|
28072
28280
|
const finalIndex = nextSyntheticIndex++;
|
|
@@ -34285,6 +34493,6 @@ function enumerateInjectedMcpToolNames(groupKeys, opts = {}) {
|
|
|
34285
34493
|
return [...new Set(names)];
|
|
34286
34494
|
}
|
|
34287
34495
|
//#endregion
|
|
34288
|
-
export {
|
|
34496
|
+
export { browserToolsEnabled as $, searchWeb as A, collapsePathKeys as At, buildAnthropicErrorEvent as B, withOneMSuffix as Bt, buildToolbeltAwareness as C, provisionAndIndexColbert as Ct, TOOLBELT_TOOLS$1 as D, CONDENSED_OPERATING_SEQUENCE as Dt, vscodeRipgrepPath as E, warmTreeSitterPool as Et, isAdvisorRequested as F, DEFAULT_PORT as Ft, relayAnthropicStream as G, isControllerClosedError as H, formatThinkingRepairDecline as I, UPSTREAM_FETCH_TIMEOUT_MS as It, agentToolsEnabled as J, handleMcpDelete as K, rememberThinkingHistoryRepair as L, UPSTREAM_INACTIVITY_TIMEOUT_MS as Lt, ADVISOR_TOOL_INSTRUCTIONS as M, DEFAULT_CLAUDE_MODEL_FALLBACKS as Mt, buildAdvisorStream as N, DEFAULT_CODEX_MODEL as Nt, assetFor as O, DEFINITION_OF_GREATNESS as Ot, injectAdvisorTool as P, DEFAULT_CODEX_MODEL_FALLBACKS as Pt, browserCompoundToolsEnabled as Q, repairKnownThinkingHistory as R, generateRandomPort as Rt, availableToolCommands as S, colbertDegradedWarning as St, toolbeltSkipSet as T, extractZipMember as Tt, logStreamError as U, buildOpenAIErrorEvent as V, withInstallLock as Vt, readIteratorWithTimeout as W, brainstormModel as X, artifactToolsEnabled as Y, browseAgentEnabled as Z, appendPlanReminder as _, MAX_RESPONSE_BODY_BYTES as _t, buildPeerAwarenessSnippet as a, scribeModel as at, runWorkerAgent as b, provisionBrowserAssets as bt, personasFor as c, shimDefaultsToXhigh as ct, EXPLORE_DEFAULT_MODEL as d, getTokenCount as dt, fleetToolsEnabled as et, EXPLORE_DEFAULT_THINKING as f, assembleResponsesPayload as ft, TEST_DEFAULT_MODEL as g, createChatCompletions as gt, REVIEW_DEFAULT_MODEL as h, createResponses as ht, buildAgentPrompt as i, scoutModel as it, ADVISOR_INTERNAL_TOOL_NAME as j, toolbeltPathOverride as jt, satisfiesMinVersion as k, shouldUseInsecureTls as kt, BROWSE_DEFAULT_MODEL as l, countTokens as lt, PLAN_DEFAULT_MODEL as m, pickEndpoint as mt, MCP_GROUPS as n, nativeSubagentModel as nt, buildPeerAwarenessSummary as o, standInToolEnabled as ot, IMPLEMENT_DEFAULT_MODEL as p, resolveMcpToolTimeoutMs as pt, handleMcpPost as q, assertMcpToolSurfaceConsistent as r, reviewerModel as rt, enumerateInjectedMcpToolNames as s, workerToolsEnabled as st, GROUP_META as t, geminiAvailable as tt, DEFAULT_MODEL as u, createMessages as ut, resolveModeDefaults as v, readResponseBodyCapped as vt, toolbeltEnabled as w, extractTarGzMember as wt, buildEnv as x, hasSupportedBrowserInstalled as xt, resolveWorkerRunOpts as y, parseJsonOrDiagnose as yt, repairRejectedThinkingHistory as z, pickClaudeDefault as zt };
|
|
34289
34497
|
|
|
34290
|
-
//# sourceMappingURL=peer-mcp-personas-
|
|
34498
|
+
//# sourceMappingURL=peer-mcp-personas-CN8xaXcV.js.map
|