cuelo 0.10.338 → 0.10.340
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +49 -49
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +2 -2
- package/.next/required-server-files.json +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/sessions/[id]/memory-trace/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/memory-trace/route.js.nft.json +1 -1
- package/.next/server/app/api/tool-image/route.js +1 -1
- package/.next/server/app/api/tool-image/route.js.nft.json +1 -1
- package/.next/server/app/api/updates/apply/route.js +2 -2
- package/.next/server/app/api/updates/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
- package/.next/server/app/recover.html +1 -1
- package/.next/server/app/recover.rsc +2 -2
- package/.next/server/app/recover.segments/_full.segment.rsc +2 -2
- package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
- package/.next/server/app/recover.segments/_index.segment.rsc +2 -2
- package/.next/server/app/recover.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +49 -49
- package/.next/server/chunks/205.js +1 -1
- package/.next/server/chunks/402.js +1 -1
- package/.next/server/chunks/4831.js +1 -1
- package/.next/server/chunks/5228.js +1 -1
- package/.next/server/chunks/8685.js +4 -4
- package/.next/server/chunks/9467.js +3 -3
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/app/{layout-684e08588af30001.js → layout-21f6af530e431195.js} +1 -1
- package/.next/static/chunks/app/{page-95dcc3ba96e8666c.js → page-1b8437381ed0a136.js} +3 -3
- package/.next/trace +113 -113
- package/.next/trace-build +1 -1
- package/README.md +3 -3
- package/Tools/CUELO_Setup/files/native-runtime-patch.js +2 -2
- package/Tools/OMP_Global_Config/agent/AGENTS.md +1 -1
- package/Tools/OMP_Global_Config/agent/RULES.md +1 -1
- package/Tools/OMP_Global_Config/agent/agents/maker.md +14 -18
- package/Tools/OMP_Global_Config/agent/cuelo-plugins/argon-preflight/index.ts +1 -1
- package/Tools/OMP_Global_Config/agent/cuelo-plugins/goal-lane/index.ts +29 -37
- package/Tools/OMP_Global_Config/agent/cuelo-plugins/goal-lane/plugin.json +5 -1
- package/Tools/OMP_Global_Config/agent/cuelo-plugins/vm-memory-guard/index.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/index.ts +3 -0
- package/Tools/OMP_Global_Config/agent/extensions/command-guard/task-guard.ts +11 -8
- package/Tools/OMP_Global_Config/agent/extensions/cross-review.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/docmap-route.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/draft.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/edit-lessons.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/jev-runtime.ts +2 -2
- package/Tools/OMP_Global_Config/agent/extensions/korean-reply-guard.ts +2 -2
- package/Tools/OMP_Global_Config/agent/extensions/lib/cross-review.ts +136 -128
- package/Tools/OMP_Global_Config/agent/extensions/lib/interpreter.ts +24 -0
- package/Tools/OMP_Global_Config/agent/extensions/lib/maker-routing.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/lib/routing-ledger.ts +5 -0
- package/Tools/OMP_Global_Config/agent/extensions/lib/turn-publication.ts +80 -6
- package/Tools/OMP_Global_Config/agent/extensions/plugin-lab.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/skim.ts +126 -60
- package/Tools/OMP_Global_Config/agent/extensions/test-session.ts +1 -1
- package/Tools/OMP_Global_Config/agent/extensions/todo-nudge.ts +16 -3
- package/Tools/OMP_Global_Config/agent/extensions/tool-trial.ts +1 -1
- package/Tools/OMP_Global_Config/agent/prompt-copies/AGENTS.en.md +2 -2
- package/Tools/OMP_Global_Config/agent/prompt-copies/RULES.en.md +2 -2
- package/Tools/OMP_Global_Config/agent/rules/cross-review-procedure.md +16 -9
- package/Tools/OMP_Global_Config/agent/rules/docs-handoff.md +1 -1
- package/Tools/OMP_Global_Config/agent/rules/execution-detail.md +1 -1
- package/Tools/OMP_Global_Config/agent/rules/harness-policy.json +0 -14
- package/Tools/OMP_Global_Config/agent/rules/rule-enforcement.md +2 -2
- package/Tools/OMP_Global_Config/agent/rules/subagent.md +4 -4
- package/Tools/OMP_Global_Config/agent/rules/task-guard.md +1 -1
- package/Tools/OMP_Global_Config/agent/rules/writing-review-procedure.md +6 -1
- package/Tools/OMP_Global_Config/agent/sop/_writer.md +13 -17
- package/Tools/OMP_Global_Config/agent/tools/artifact-search/index.ts +1 -1
- package/Tools/OMP_Global_Config/agent/tools/deploy-verify/index.ts +1 -1
- package/Tools/OMP_Global_Config/agent/tools/git-finalizer/index.ts +1 -1
- package/Tools/OMP_Global_Config/agent/tools/vm-build/index.ts +1 -1
- package/Tools/OMP_Global_Config/patches/apply-core-patch.mjs +360 -0
- package/bin/native/upkeep-reader/darwin-arm64.json +2 -2
- package/bin/native/upkeep-reader/darwin-arm64.node +0 -0
- package/bin/native/upkeep-reader/darwin-x64.json +2 -2
- package/bin/native/upkeep-reader/darwin-x64.node +0 -0
- package/bin/native/upkeep-reader/linux-arm64.json +2 -2
- package/bin/native/upkeep-reader/linux-arm64.node +0 -0
- package/bin/native/upkeep-reader/linux-x64.json +2 -2
- package/bin/native/upkeep-reader/linux-x64.node +0 -0
- package/native/upkeep-reader/src/lib.rs +107 -1
- package/package.json +7 -7
- package/Tools/OMP_Global_Config/agent/extensions/external-advice-check.ts +0 -123
- /package/.next/static/{OIQ3yHLubxl04TzpEPXCn → 4XtQSNswpweUHnrOc9NYK}/_buildManifest.js +0 -0
- /package/.next/static/{OIQ3yHLubxl04TzpEPXCn → 4XtQSNswpweUHnrOc9NYK}/_ssgManifest.js +0 -0
|
@@ -25439,6 +25439,366 @@ const legacyArtifactHandler: ProtocolHandler = {
|
|
|
25439
25439
|
"const successPreview = await formatAsyncSuccessPreview(text, job, result => this.sessionManager.saveArtifact(result));");
|
|
25440
25440
|
}
|
|
25441
25441
|
|
|
25442
|
+
// 19.1.0: version-specific shapes; keep 19.0.1 rollback bodies intact.
|
|
25443
|
+
{
|
|
25444
|
+
const one = (file, marker) => {
|
|
25445
|
+
const entries = EDITS.filter(entry => entry.file === file && entry.marker === marker);
|
|
25446
|
+
if (entries.length !== 1) throw new Error(`19.1.0 candidate ${file}: ${entries.length}/1 entries for ${JSON.stringify(marker)}`);
|
|
25447
|
+
return entries[0];
|
|
25448
|
+
};
|
|
25449
|
+
const alternate = (entry, discriminator, anchor, patched = anchor, marker = patched, file = entry.file) => {
|
|
25450
|
+
for (const old of [entry, ...(entry.alternates ?? [])]) old.excludes = [...[old.excludes ?? []].flat(), discriminator];
|
|
25451
|
+
(entry.alternates ??= []).push({ file, requires: discriminator, anchor, patched, marker });
|
|
25452
|
+
};
|
|
25453
|
+
const swap = (text, from, to) => {
|
|
25454
|
+
if (text.split(from).length !== 2) throw new Error(`19.1.0 anchor: ${JSON.stringify(from)}`);
|
|
25455
|
+
return text.replace(from, () => to);
|
|
25456
|
+
};
|
|
25457
|
+
const prior = entry => entry.alternates?.at(-1) ?? entry;
|
|
25458
|
+
|
|
25459
|
+
const advisor = 'if(!c.endsWith(".jsonl")||a.includes(".bak")||!r.includeAdvisors&&HYe(c))continue';
|
|
25460
|
+
const advisorEntry = EDITS.find(entry => entry.file === "dist/cli.js" && entry.marker.includes('o==="__advisor.jsonl"'));
|
|
25461
|
+
alternate(advisorEntry, advisor, advisor);
|
|
25462
|
+
|
|
25463
|
+
const executor = one("src/task/executor.ts", "import { PARENT_REQUEST_STEER, AgentBusyError, EventLoopKeepalive, recordHandoff, resolveTelemetry }");
|
|
25464
|
+
const withExtractIntent = text => swap(text, "recordHandoff, resolveTelemetry", "extractIntent, recordHandoff, resolveTelemetry");
|
|
25465
|
+
alternate(executor, "extractIntent, recordHandoff, resolveTelemetry",
|
|
25466
|
+
withExtractIntent(prior(executor).anchor), withExtractIntent(prior(executor).patched));
|
|
25467
|
+
|
|
25468
|
+
const relay = one("src/prompts/system/browser-relay.md", "Where ego lite is installed (the `ego_browser` tool runs)");
|
|
25469
|
+
const relayEnd = "for a throwaway managed browser.{{/if}}{{/if}}\n";
|
|
25470
|
+
alternate(relay, "{{#if only}}This session was started from omp's extension", relayEnd,
|
|
25471
|
+
swap(prior(relay).patched, prior(relay).anchor, relayEnd), relay.marker);
|
|
25472
|
+
|
|
25473
|
+
const output = one("src/exec/bash-executor.ts", "summary.output += checkCueloSandboxGit(");
|
|
25474
|
+
const imageLinks = "const output = await appendImageLinks(summary.output, decodedImages);";
|
|
25475
|
+
const dumped = "\t\tconst summary = await sink.dump(notice);\n";
|
|
25476
|
+
alternate(output, imageLinks, `${dumped}\t\t${imageLinks}`,
|
|
25477
|
+
`${dumped}\t\tif (sandboxCommand !== undefined) summary.output += checkCueloSandboxGit(sandboxCwd);\n\t\t${imageLinks}`,
|
|
25478
|
+
output.marker);
|
|
25479
|
+
|
|
25480
|
+
const help = (file, marker, discriminator, transform = text => text) => {
|
|
25481
|
+
const entry = one(file, marker);
|
|
25482
|
+
const toHelp = text => text.replaceAll("xd://", "help://");
|
|
25483
|
+
alternate(entry, discriminator, toHelp(prior(entry).anchor), transform(toHelp(prior(entry).patched)), toHelp(prior(entry).marker));
|
|
25484
|
+
};
|
|
25485
|
+
const evalDoc = "src/prompts/tools/eval.md";
|
|
25486
|
+
help(evalDoc, "{{name}}=xd://eval/{{name}}", "help://eval/judge");
|
|
25487
|
+
help(evalDoc, "/completion: xd://eval/judge", "help://eval/{{name}}");
|
|
25488
|
+
help(evalDoc, "- agent/workpool: xd://eval/agents", "help://eval/judge");
|
|
25489
|
+
// Preserve the closing tag that groups the namespace list.
|
|
25490
|
+
help(evalDoc, "{{/each}}\n{{#each inlinePreludes}}", "help://eval/judge",
|
|
25491
|
+
text => text.replace("{{#each inlinePreludes}}", "</namespaces>\n{{#each inlinePreludes}}"));
|
|
25492
|
+
// Keep this marker aligned with the retained closing tag.
|
|
25493
|
+
one(evalDoc, "{{/each}}\n{{#each inlinePreludes}}").alternates.at(-1).marker = "{{/each}}\n</namespaces>\n{{#each inlinePreludes}}";
|
|
25494
|
+
help("src/prompts/tools/read.md", "- Read xd://read/sources BEFORE", "help://read/sources");
|
|
25495
|
+
help("src/prompts/system/system-prompt.md", 'FS/bash URIs.{{#has tools "read"}}', "help://read/urls");
|
|
25496
|
+
const helperIntro = one(evalDoc, "Helpers: read xd://eval/helpers FIRST.");
|
|
25497
|
+
const helperNew = "Helpers: read help://eval/helpers FIRST.";
|
|
25498
|
+
alternate(helperIntro, "help://eval/judge", prior(helperIntro).anchor,
|
|
25499
|
+
swap(prior(helperIntro).patched, helperIntro.marker, helperNew), helperNew);
|
|
25500
|
+
|
|
25501
|
+
const proc = one("src/prompts/internal-urls/proc.md", "proc://[id]: jobs/agents/services status;");
|
|
25502
|
+
const newStreams = "pipes and redirected files so far";
|
|
25503
|
+
alternate(proc, newStreams,
|
|
25504
|
+
swap(prior(proc).anchor, "pipes so far (live under `| tail`/`| grep`", `${newStreams} (live under \`| tail\`/\`| grep\`/\`> log\``),
|
|
25505
|
+
swap(prior(proc).patched, "bash pipes so far", `bash ${newStreams}`), proc.marker);
|
|
25506
|
+
|
|
25507
|
+
const catalog = one("src/tools/xdev.ts", 'if (!listedElsewhere?.has(name)) lines.push(`- ${name}`);');
|
|
25508
|
+
const commandCatalog = "src/prompts/system/tool-command-catalog.md";
|
|
25509
|
+
const onDemand = "Run `<tool> --help` before first use.";
|
|
25510
|
+
alternate(catalog, onDemand, "- `{{this.name}}` — {{this.summary}}", "- `{{this.name}}`", "- `{{this.name}}`\n", commandCatalog);
|
|
25511
|
+
|
|
25512
|
+
const mcp = "src/mcp/manager.ts";
|
|
25513
|
+
const hostManager = "private hostAccess?: McpHostAccess,";
|
|
25514
|
+
const selection = one(mcp, "\t/** Connected by per-request selection; a manual reconnect or disconnect clears it. */");
|
|
25515
|
+
const discovery = "\t#discoveryInFlight: Promise<unknown> = Promise.resolve();";
|
|
25516
|
+
const between = (text, start, end) => {
|
|
25517
|
+
const from = text.indexOf(start);
|
|
25518
|
+
const to = end === undefined ? text.length : text.lastIndexOf(end);
|
|
25519
|
+
if (from < 0 || from !== text.lastIndexOf(start) || to < from + start.length) {
|
|
25520
|
+
throw new Error(`19.1.0 boundaries: ${JSON.stringify([start, end])}`);
|
|
25521
|
+
}
|
|
25522
|
+
return text.slice(from, to);
|
|
25523
|
+
};
|
|
25524
|
+
alternate(selection, hostManager, discovery, discovery + between(selection.patched,
|
|
25525
|
+
"\n\t/** When set, discovery records allowed configs", "\n\t/**\n\t * Timestamps of recent"), selection.marker);
|
|
25526
|
+
const reconnect = one(mcp, "\t\tif (options?.manual) this.#selectionConnected.delete(name);");
|
|
25527
|
+
const pending = "\t\tconst pending = this.#pendingReconnections.get(name);";
|
|
25528
|
+
const reconnectStart = "\t): Promise<MCPServerConnection | null> {\n";
|
|
25529
|
+
const manualBody = between(reconnect.patched, "\t\tif (options?.manual) this.#selectionConnected.delete(name);", "\t\tif (options?.manual) {");
|
|
25530
|
+
alternate(reconnect, hostManager, reconnectStart + pending,
|
|
25531
|
+
reconnectStart + swap(manualBody, "if (deferred) {", "if (options?.manual && deferred) {") + pending, reconnect.marker);
|
|
25532
|
+
const sdk = one("src/sdk.ts", "\tcfgMcpSelection,");
|
|
25533
|
+
const idle = "\tcfgMcpIdleStopMinutes,";
|
|
25534
|
+
alternate(sdk, idle, idle, `${idle}\n\tcfgMcpSelection,`, sdk.marker);
|
|
25535
|
+
// As in the 18.9.1 alternatives, distinguish per-session deferred servers
|
|
25536
|
+
// from the unrelated static #deferred manager factory.
|
|
25537
|
+
for (const entry of [selection, reconnect]) {
|
|
25538
|
+
const candidate = entry.alternates.at(-1);
|
|
25539
|
+
candidate.patched = candidate.patched.replace(/#deferred\b/g, "#deferredServers");
|
|
25540
|
+
}
|
|
25541
|
+
const connectSelection = one(mcp, "\t * are ignored. An already-aborted signal starts nothing; an abort mid-handshake drops the servers");
|
|
25542
|
+
const selectBody = prior(connectSelection);
|
|
25543
|
+
const isReady = 'if (this.getConnectionStatus(name) === "connected") continue;';
|
|
25544
|
+
alternate(connectSelection, hostManager, selectBody.anchor,
|
|
25545
|
+
swap(
|
|
25546
|
+
swap(selectBody.patched, "if (this.#connections.has(name)) continue;", isReady),
|
|
25547
|
+
"if (!entry) continue;",
|
|
25548
|
+
'if (!entry || this.getConnectionStatus(name) !== "disconnected") continue;',
|
|
25549
|
+
), selectBody.marker);
|
|
25550
|
+
|
|
25551
|
+
// Keep the selection metadata cache local to the session manager. The host
|
|
25552
|
+
// cache cannot be queried without resolving a server (which can start it).
|
|
25553
|
+
const newEdit = (file, discriminator, anchor, patched, old) => EDITS.push({
|
|
25554
|
+
file, requires: discriminator, anchor, patched, marker: patched,
|
|
25555
|
+
alternates: [{ file, excludes: discriminator, anchor: old, patched: old, marker: old }],
|
|
25556
|
+
});
|
|
25557
|
+
const cacheTypes = 'import type { AuthStorage } from "../session/auth-storage";';
|
|
25558
|
+
const storageType = 'import type { AgentStorageApi } from "../session/agent-storage";';
|
|
25559
|
+
const cacheImport = 'import { logger, untilAborted } from "@oh-my-pi/pi-utils";';
|
|
25560
|
+
newEdit(mcp, hostManager, cacheImport,
|
|
25561
|
+
'import { isRecord, logger, stableStringifyJson, untilAborted } from "@oh-my-pi/pi-utils";', cacheTypes);
|
|
25562
|
+
newEdit(mcp, hostManager, cacheTypes, `${storageType}\n${cacheTypes}`, cacheTypes);
|
|
25563
|
+
const cacheRead = 'const cached = (await this.toolCache?.get(name, config).catch(() => null)) ?? [];';
|
|
25564
|
+
const selection19 = connectSelection.alternates.at(-1);
|
|
25565
|
+
selection19.patched = swap(swap(swap(swap(selection19.patched,
|
|
25566
|
+
cacheRead, 'const cached = this.#selectionCatalog(name, config);'),
|
|
25567
|
+
'Array.from(this.#deferredServers, async ', 'Array.from(this.#deferredServers, '),
|
|
25568
|
+
'return Promise.all(\n\t\t\tArray.from(', 'return Array.from('),
|
|
25569
|
+
'\n\t\t\t}),\n\t\t);', '\n\t\t\t});');
|
|
25570
|
+
const publish = "\t#publishServerTools(name: string, connection: MCPServerConnection, serverTools: MCPToolDefinition[]): void {";
|
|
25571
|
+
newEdit(mcp, hostManager, publish, String.raw` #selectionStorage: Pick<AgentStorageApi, "getCache" | "setCache"> | null = null;
|
|
25572
|
+
|
|
25573
|
+
setSelectionStorage(storage: Pick<AgentStorageApi, "getCache" | "setCache"> | null): void {
|
|
25574
|
+
this.#selectionStorage = storage;
|
|
25575
|
+
}
|
|
25576
|
+
|
|
25577
|
+
#selectionCatalog(name: string, config: MCPServerConfig): MCPDeferredServer["cachedTools"] {
|
|
25578
|
+
try {
|
|
25579
|
+
const raw = this.#selectionStorage?.getCache("mcp_tools:" + name);
|
|
25580
|
+
if (!raw) return [];
|
|
25581
|
+
const cached: unknown = JSON.parse(raw);
|
|
25582
|
+
if (!isRecord(cached) || cached.version !== 1 || !Array.isArray(cached.tools) ||
|
|
25583
|
+
cached.configHash !== Bun.SHA256.hash(stableStringifyJson(config), "hex")) return [];
|
|
25584
|
+
return cached.tools.flatMap(tool => isRecord(tool) && typeof tool.name === "string"
|
|
25585
|
+
? [{ name: tool.name, description: typeof tool.description === "string" ? tool.description : undefined }]
|
|
25586
|
+
: []);
|
|
25587
|
+
} catch (error) {
|
|
25588
|
+
logger.debug("MCP selection catalog could not be read", { path: "mcp:" + name, error: String(error) });
|
|
25589
|
+
return [];
|
|
25590
|
+
}
|
|
25591
|
+
}
|
|
25592
|
+
|
|
25593
|
+
${publish}
|
|
25594
|
+
if (this.#selectionStorage) {
|
|
25595
|
+
const config = this.#serverConfigs.get(name) ?? connection.config;
|
|
25596
|
+
try {
|
|
25597
|
+
const configHash = Bun.SHA256.hash(stableStringifyJson(config), "hex");
|
|
25598
|
+
// Keep the existing on-disk format so 19.0.1 rollback can still read it.
|
|
25599
|
+
const expires = Math.floor(Date.now() / 1000) + 30 * 24 * 60 * 60;
|
|
25600
|
+
this.#selectionStorage.setCache("mcp_tools:" + name, JSON.stringify({ version: 1, configHash, tools: serverTools }), expires);
|
|
25601
|
+
} catch (error) {
|
|
25602
|
+
logger.debug("MCP selection catalog could not be saved", { path: "mcp:" + name, error: String(error) });
|
|
25603
|
+
}
|
|
25604
|
+
}`, cacheTypes);
|
|
25605
|
+
const loader = "src/mcp/loader.ts";
|
|
25606
|
+
const loaderManager = "\tconst manager = new MCPManager(cwd, undefined, options?.idleStopMs);";
|
|
25607
|
+
const loaderIdle = "\tidleStopMs?: number;";
|
|
25608
|
+
newEdit(loader, "idleStopMs?: number;", loaderIdle,
|
|
25609
|
+
`${loaderIdle}\n\tselectionStorage?: Parameters<MCPManager["setSelectionStorage"]>[0];`, cacheTypes);
|
|
25610
|
+
newEdit(loader, "idleStopMs?: number;", loaderManager,
|
|
25611
|
+
`${loaderManager}\n\tmanager.setSelectionStorage(options?.selectionStorage ?? null);`, cacheTypes);
|
|
25612
|
+
const sdkFile = "src/sdk.ts";
|
|
25613
|
+
const deferredManager = "\t\t\t\tconst deferredMCPManager = new MCPManager(cwd, undefined, mcpIdleStopMs);";
|
|
25614
|
+
newEdit(sdkFile, idle, deferredManager,
|
|
25615
|
+
`${deferredManager}\n\t\t\t\tdeferredMCPManager.setSelectionStorage(settings.getStorage());`, "const deferMCPDiscoveryForUI = enableMCP");
|
|
25616
|
+
const loadManager = "\t\t\t\t\tidleStopMs: mcpIdleStopMs,";
|
|
25617
|
+
newEdit(sdkFile, idle, loadManager, `${loadManager}\n\t\t\t\t\tselectionStorage: settings.getStorage(),`,
|
|
25618
|
+
"const deferMCPDiscoveryForUI = enableMCP");
|
|
25619
|
+
|
|
25620
|
+
// Do not let command-mode special tools widen an explicit tools-off set.
|
|
25621
|
+
const sessionTools = "src/session/session-tools.ts";
|
|
25622
|
+
const commandShape = "const commandTransportActive =";
|
|
25623
|
+
const specialTools = "\t\tif (!commandTransportActive) {\n\t\t\tconst planModeEnabled = this.#host.planModeEnabled();";
|
|
25624
|
+
newEdit(sessionTools, commandShape, specialTools,
|
|
25625
|
+
swap(specialTools, "!commandTransportActive", "!commandTransportActive && selectedTools.length > 0"),
|
|
25626
|
+
"\tsetActiveToolsByName(toolNames: string[]): Promise<void> {");
|
|
25627
|
+
|
|
25628
|
+
// Upstream detects ambiguous numeric selectors before the not-found fallback.
|
|
25629
|
+
// Keep the same-folder hint on that path without changing its suffix/reverse detection.
|
|
25630
|
+
const read = "src/tools/read.ts";
|
|
25631
|
+
const numericSelector = [
|
|
25632
|
+
"\t\t\t\t\t\t\tthrow new ToolError(",
|
|
25633
|
+
"\t\t\t\t\t\t\t\t`Invalid line selector ':${prefix.sel}:${localTarget.sel}'. Use :${prefix.sel} for a single line${range}.`,",
|
|
25634
|
+
"\t\t\t\t\t\t\t);",
|
|
25635
|
+
].join("\n");
|
|
25636
|
+
const nearbyPatch = prior(one(read, "// HANSE: read range selector hint")).patched;
|
|
25637
|
+
const nearby = nearbyPatch.slice(0, nearbyPatch.indexOf("\t\t\t\t\t// HANSE: read range selector hint"))
|
|
25638
|
+
.split("\n").filter(Boolean).map(line => "\t\t" + line).join("\n");
|
|
25639
|
+
newEdit(read, "A numeric pair can also be a literal filename plus a selector", numericSelector,
|
|
25640
|
+
`${nearby}\n${swap(numericSelector, "for a single line${range}.", "for a single line${range}.${range ? ` Try ${prefix.path}:${prefix.sel}-${localTarget.sel}.` : \"\"}${nearby}")}`,
|
|
25641
|
+
'readonly name = "read";');
|
|
25642
|
+
|
|
25643
|
+
// The npm package omits the monorepo browser-relay sibling. Keep the v19.1.0
|
|
25644
|
+
// extension's native host wire shapes in the published relay protocol instead.
|
|
25645
|
+
const relayDir = "src/tools/browser/relay/";
|
|
25646
|
+
const protocol = `${relayDir}protocol.ts`;
|
|
25647
|
+
const panelVersion = "export const PANEL_PROTOCOL_VERSION = 1;";
|
|
25648
|
+
const oldProtocol = "export interface TabSnapshot {";
|
|
25649
|
+
const oldRelay = { file: protocol, excludes: panelVersion, marker: oldProtocol, anchor: oldProtocol, patched: oldProtocol };
|
|
25650
|
+
const nativeHost = 'export const NATIVE_HOST = "sh.omp.browser";';
|
|
25651
|
+
EDITS.push({
|
|
25652
|
+
file: protocol, requires: panelVersion, anchor: panelVersion, marker: nativeHost,
|
|
25653
|
+
patched: `${panelVersion}
|
|
25654
|
+
|
|
25655
|
+
${nativeHost}
|
|
25656
|
+
|
|
25657
|
+
export type ToNativeHost =
|
|
25658
|
+
| { t: "open"; cwd: string; extensionId: string }
|
|
25659
|
+
| { t: "link"; extensionId: string }
|
|
25660
|
+
| { t: "rpc"; line: string }
|
|
25661
|
+
| { t: "relay"; line: string };
|
|
25662
|
+
|
|
25663
|
+
export type FromNativeHost =
|
|
25664
|
+
| { t: "ready"; pid: number }
|
|
25665
|
+
| { t: "rpc"; line: string }
|
|
25666
|
+
| { t: "linked" }
|
|
25667
|
+
| { t: "unlinked"; reason: string }
|
|
25668
|
+
| { t: "relay"; line: string }
|
|
25669
|
+
| { t: "chunk"; relay?: true; id: number; index: number; last: boolean; data: string }
|
|
25670
|
+
| { t: "exit"; code: number | null; stderr: string };`,
|
|
25671
|
+
alternates: [oldRelay],
|
|
25672
|
+
});
|
|
25673
|
+
for (const [file, imported] of [
|
|
25674
|
+
["native-host-manifest.ts", "import { NATIVE_HOST }"],
|
|
25675
|
+
["native-host.ts", "import type { FromNativeHost, ToNativeHost }"],
|
|
25676
|
+
["native-relay.ts", "import type { FromNativeHost, ToNativeHost }"],
|
|
25677
|
+
]) {
|
|
25678
|
+
const anchor = `${imported} from "../../../../../browser-relay/extension/messages";`;
|
|
25679
|
+
const patched = `${imported} from "./protocol";`;
|
|
25680
|
+
EDITS.push({ file: `${relayDir}${file}`, marker: patched, anchor, patched, alternates: [oldRelay] });
|
|
25681
|
+
}
|
|
25682
|
+
|
|
25683
|
+
const completion = "src/eval/completion-bridge.ts";
|
|
25684
|
+
const tagged = "function resolveTaggedAgentCandidates(";
|
|
25685
|
+
const exact = 'const EXACT_WEB6_MODEL = "web6/gpt-6-pro" as const;';
|
|
25686
|
+
const tierType = 'type CompletionTier = "smol" | "default" | "slow";';
|
|
25687
|
+
alternate(one(completion, exact), tagged, tierType, `${tierType}\n${exact}`, exact);
|
|
25688
|
+
const executeTier = "\ttier: CompletionTier | undefined,";
|
|
25689
|
+
alternate(one(completion, "\tfinalTier: CompletionTier | undefined,"), tagged, executeTier);
|
|
25690
|
+
const resultDetails = "\t\tdetails: { model: formatModelString(model), tier, structured: Boolean(schema) },";
|
|
25691
|
+
alternate(one(completion, "...(finalTier === undefined ? {} : { tier: finalTier })"), tagged, resultDetails,
|
|
25692
|
+
'\t\tdetails: { model: formatModelString(model), ...(tier === undefined ? {} : { tier }), structured: Boolean(schema) },');
|
|
25693
|
+
const candidateAnchor = [
|
|
25694
|
+
"\tconst candidates = tier",
|
|
25695
|
+
"\t\t? resolveTierCandidates(tier, options.session)",
|
|
25696
|
+
"\t\t: resolveTaggedAgentCandidates(requested, options.session);",
|
|
25697
|
+
"\tif (candidates.length === 0) {",
|
|
25698
|
+
].join("\n");
|
|
25699
|
+
alternate(one(completion, 'const requestedModel: CompletionModel = model ?? "default";'), tagged,
|
|
25700
|
+
candidateAnchor, [
|
|
25701
|
+
"\tconst candidates = tier",
|
|
25702
|
+
"\t\t? resolveTierCandidates(tier, options.session)",
|
|
25703
|
+
"\t\t: requested === EXACT_WEB6_MODEL",
|
|
25704
|
+
"\t\t\t? resolveExactWeb6Candidate(options.session)",
|
|
25705
|
+
"\t\t\t: resolveTaggedAgentCandidates(requested, options.session);",
|
|
25706
|
+
"\tif (candidates.length === 0) {",
|
|
25707
|
+
'\t\tif (requested === EXACT_WEB6_MODEL) throw new ToolError(`completion() could not resolve exact model "${EXACT_WEB6_MODEL}".`);',
|
|
25708
|
+
].join("\n"), "\t\t\t? resolveExactWeb6Candidate(options.session)");
|
|
25709
|
+
const retain = '\treturn retainCompletionHandle("cmp", options, async (signal, attempts) => {';
|
|
25710
|
+
const execute = "\t\t\treturn await executeCompletion(\n\t\t\t\tprompt,\n\t\t\t\ttier,\n\t\t\t\tsystem,\n\t\t\t\tschema,\n\t\t\t\tcandidates,";
|
|
25711
|
+
alternate(one(completion, "const effectiveCandidates ="), tagged, `${retain}\n\t\tconst rawBuffer = new RawSseDebugBuffer();\n\t\ttry {\n${execute}`,
|
|
25712
|
+
[
|
|
25713
|
+
"\tconst effectiveCandidates = parsed.effort === undefined ? candidates : candidates.map(candidate => ({",
|
|
25714
|
+
"\t\t...candidate,",
|
|
25715
|
+
"\t\t...reasoningForCandidate(tier, candidate.model, parsed.effort),",
|
|
25716
|
+
"\t}));",
|
|
25717
|
+
retain,
|
|
25718
|
+
"\t\tconst rawBuffer = new RawSseDebugBuffer();",
|
|
25719
|
+
"\t\ttry {",
|
|
25720
|
+
execute.replace("\n\t\t\t\tcandidates,", "\n\t\t\t\teffectiveCandidates,"),
|
|
25721
|
+
].join("\n"), "const effectiveCandidates =");
|
|
25722
|
+
const exactDoc = '"web6/gpt-6-pro"';
|
|
25723
|
+
const taggedDoc = '"m<N>"';
|
|
25724
|
+
const judgeDoc = one("src/prompts/tools/eval-judge.md", "effort?=None");
|
|
25725
|
+
const tagModels = text => text.replaceAll('"slow"', `"slow"|${taggedDoc}`);
|
|
25726
|
+
alternate(judgeDoc, "or a user-tagged model agent name", tagModels(prior(judgeDoc).anchor),
|
|
25727
|
+
tagModels(prior(judgeDoc).patched).replaceAll(taggedDoc, `${taggedDoc}|${exactDoc}`), judgeDoc.marker);
|
|
25728
|
+
const workflow = one("src/prompts/system/workflow-notice.md", "effort=None)");
|
|
25729
|
+
const beforeEffort = 'Tiers: `"smol"`, `"default"`, `"slow"`.';
|
|
25730
|
+
const upstreamModels = 'Tiers: `"smol"`, `"default"`, `"slow"`; or a user-tagged model agent (`"m<N>"`).';
|
|
25731
|
+
alternate(workflow, upstreamModels, swap(prior(workflow).anchor, beforeEffort, upstreamModels),
|
|
25732
|
+
swap(prior(workflow).patched, beforeEffort, `${upstreamModels} Exact selector: \`${exactDoc}\`.`), prior(workflow).marker);
|
|
25733
|
+
|
|
25734
|
+
const backend = "src/mnemopi/backend.ts";
|
|
25735
|
+
const memDoc = "src/prompts/system/mnemopi-instructions.md";
|
|
25736
|
+
const instructions = "prompt.render(mnemopiInstructions)";
|
|
25737
|
+
const memBody = one(memDoc, "Mnemopi: <memories> background");
|
|
25738
|
+
const fixedNames = text => text.replace(/\{\{toolRefs\.(recall|retain|reflect)\}\}/g, "$1");
|
|
25739
|
+
const memDiscriminator = "- Use `recall` proactively";
|
|
25740
|
+
const memHead = fixedNames(prior(memBody).anchor);
|
|
25741
|
+
const memCompact = prior(memBody).patched
|
|
25742
|
+
.replace(/\{\{toolRefs\.(recall|retain|reflect)\}\}/g, "`$1`")
|
|
25743
|
+
.replace("`recall` BEFORE history/preferences", "\n- Use `recall` proactively before history/preferences");
|
|
25744
|
+
alternate(memBody, memDiscriminator, memHead, memCompact, memBody.marker);
|
|
25745
|
+
// The existing settings-import patch also applies on 19.1.0.
|
|
25746
|
+
const globalMemory = one(backend, 'staticInstructions(primary?.config.autoRetain ?? settings.get("mnemopi.autoRetain"))');
|
|
25747
|
+
const globalRender = "\t\t\tconst parts = [prompt.render(mnemopiInstructions)];";
|
|
25748
|
+
const memoryBackend = "const parts = [prompt.render(mnemopiInstructions";
|
|
25749
|
+
alternate(globalMemory, memoryBackend, globalRender,
|
|
25750
|
+
swap(globalRender, instructions, 'prompt.render(mnemopiInstructions, { autoRetain: primary?.config.autoRetain ?? cfgMnemopiAutoRetain.get(settings) })'));
|
|
25751
|
+
const sessionMemory = one(backend, "const instructions = staticInstructions(");
|
|
25752
|
+
const budgeting = "\t\tconst instructions = prompt.render(mnemopiInstructions);";
|
|
25753
|
+
const sessionRender = swap(budgeting, instructions,
|
|
25754
|
+
"prompt.render(mnemopiInstructions, { autoRetain: (this.aliasOf ?? this).config.autoRetain })");
|
|
25755
|
+
// The pre-19.1.0 state.ts candidate renders with toolRefs on separate lines.
|
|
25756
|
+
sessionMemory.alternates.push({
|
|
25757
|
+
file: "src/mnemopi/state.ts", requires: "budgetRecallBlock(block: string): string {",
|
|
25758
|
+
anchor: budgeting, marker: sessionRender, patched: sessionRender,
|
|
25759
|
+
});
|
|
25760
|
+
|
|
25761
|
+
const worker = "src/tools/computer/worker.ts";
|
|
25762
|
+
const windowAccess = "class Win extends WindowAccess {";
|
|
25763
|
+
const windowInput = one(worker, "return windowInputResult(action, this.id, options);");
|
|
25764
|
+
const oldWin = prior(windowInput);
|
|
25765
|
+
const throughObserve = text => {
|
|
25766
|
+
const menu = text.indexOf("\n\tget menu() {");
|
|
25767
|
+
if (menu < 0) throw new Error("19.1.0 window methods: missing old menu boundary");
|
|
25768
|
+
return text.slice(0, menu);
|
|
25769
|
+
};
|
|
25770
|
+
const observed = text => swap(swap(text,
|
|
25771
|
+
"\t\tconst screenshot = await emitScreenshot(context, result.capture, options);",
|
|
25772
|
+
"\t\tconst screenshot = await emitScreenshot(context, result.capture, options);\n\t\tconst ax = treeText(result.accessibility);"),
|
|
25773
|
+
"ax: result.accessibility.text,", "ax,");
|
|
25774
|
+
const observeText = text => swap(observed(throughObserve(text)), "text: result.accessibility.text });", "text: ax });");
|
|
25775
|
+
const observeAnchor = observeText(oldWin.anchor);
|
|
25776
|
+
const observePatched = swap(observeText(oldWin.patched),
|
|
25777
|
+
"noteSnapshot(this.id, result.accessibility.text)", "noteSnapshot(this.id, ax)");
|
|
25778
|
+
alternate(windowInput, windowAccess, observeAnchor, observePatched, oldWin.marker);
|
|
25779
|
+
|
|
25780
|
+
const addWindowMethod = (anchor, patched, marker = patched) => EDITS.push({
|
|
25781
|
+
file: worker, requires: windowAccess, anchor, patched, marker,
|
|
25782
|
+
alternates: [{ file: worker, excludes: windowAccess, anchor: "class Win {", patched: "class Win {", marker: "class Win {" }],
|
|
25783
|
+
});
|
|
25784
|
+
const withoutAx = text => between(text, "\tasync raise():", "\tasync ax(")
|
|
25785
|
+
+ between(text, "\tref(ref: string): ElRef");
|
|
25786
|
+
addWindowMethod(withoutAx(oldWin.anchor), withoutAx(oldWin.patched), '\t\treturn windowInputResult("raise", this.id);');
|
|
25787
|
+
|
|
25788
|
+
const axAccess = "\tasync ax(options?: AxOptions): Promise<string> {";
|
|
25789
|
+
const onlyWindowAx = text => between(text, axAccess, "\tref(ref: string): ElRef").trimEnd();
|
|
25790
|
+
const sharedAx = swap(onlyWindowAx(oldWin.anchor),
|
|
25791
|
+
"return (await nativeCall(signal, () => this.#session.axSnapshot(this.id, options))).text;", "return treeText(await nativeCall(signal, () => this.#session.axSnapshot(this.id, options)));");
|
|
25792
|
+
const stableAx = swap(onlyWindowAx(oldWin.patched),
|
|
25793
|
+
"const text = (await nativeCall(signal, () => this.#session.axSnapshot(this.id, options))).text;", "const text = treeText(await nativeCall(signal, () => this.#session.axSnapshot(this.id, options)));");
|
|
25794
|
+
addWindowMethod(sharedAx, stableAx, "return foundElements(await issueElements(this.#session, this.#getContext, nodes, this.id));");
|
|
25795
|
+
}
|
|
25796
|
+
|
|
25797
|
+
/** All possible targets, including files reached only by a version alternate. */
|
|
25798
|
+
export function corePatchTargetFiles() {
|
|
25799
|
+
return [...new Set(EDITS.flatMap(entry => [entry.file, ...(entry.alternates ?? []).map(candidate => candidate.file)]))];
|
|
25800
|
+
}
|
|
25801
|
+
|
|
25442
25802
|
/**
|
|
25443
25803
|
* 항목 하나를 이 설치에서 성립하는 후보로 좁힌다. 후보는 항목 자신과 `alternates` 이고 각 후보는
|
|
25444
25804
|
* file·anchor·marker·patched 묶음이다. upstream 이 그 조각을 다른 모듈이나 다른 패키지로 옮기면
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"target": "darwin-arm64",
|
|
3
|
-
"sourceSha256": "
|
|
4
|
-
"binarySha256": "
|
|
3
|
+
"sourceSha256": "7d6d8320331b5ee4b1501c91d170feedd1550c760ca9c40ef08e8b1f6e20fb54",
|
|
4
|
+
"binarySha256": "c904c704b6bfaeb3c2f8eb981e686f43a289f373b6e87bb604ce51edec1800b4"
|
|
5
5
|
}
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"target": "darwin-x64",
|
|
3
|
-
"sourceSha256": "
|
|
4
|
-
"binarySha256": "
|
|
3
|
+
"sourceSha256": "7d6d8320331b5ee4b1501c91d170feedd1550c760ca9c40ef08e8b1f6e20fb54",
|
|
4
|
+
"binarySha256": "d16124d5eb686054a79423cca54bcb47684297f6d27d01fca98b394697ec8e46"
|
|
5
5
|
}
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"target": "linux-arm64",
|
|
3
|
-
"sourceSha256": "
|
|
4
|
-
"binarySha256": "
|
|
3
|
+
"sourceSha256": "7d6d8320331b5ee4b1501c91d170feedd1550c760ca9c40ef08e8b1f6e20fb54",
|
|
4
|
+
"binarySha256": "ff98d2e95acd3a96b2d79d2999e3b6b99a4b2162f25a6fbb2713eb85fcb659b9"
|
|
5
5
|
}
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"target": "linux-x64",
|
|
3
|
-
"sourceSha256": "
|
|
4
|
-
"binarySha256": "
|
|
3
|
+
"sourceSha256": "7d6d8320331b5ee4b1501c91d170feedd1550c760ca9c40ef08e8b1f6e20fb54",
|
|
4
|
+
"binarySha256": "e41caa14e140236a4eb8e5904836b91d624b31b890e81c51595d49dd771bbdb3"
|
|
5
5
|
}
|
|
Binary file
|
|
@@ -204,9 +204,13 @@ impl<'de: 'a, 'a> Deserialize<'de> for Raw<'a> {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
#[derive(Deserialize)]
|
|
208
|
+
#[serde(transparent)]
|
|
209
|
+
struct BorrowedText<'a>(#[serde(borrow)] Cow<'a, str>);
|
|
210
|
+
|
|
207
211
|
impl Raw<'_> {
|
|
208
212
|
fn is(&self, name: &str) -> bool {
|
|
209
|
-
self.0.is_some_and(|v| serde_json::from_str::<
|
|
213
|
+
self.0.is_some_and(|v| serde_json::from_str::<BorrowedText>(v.get()).is_ok_and(|s| s.0 == name))
|
|
210
214
|
}
|
|
211
215
|
}
|
|
212
216
|
|
|
@@ -261,6 +265,24 @@ struct Message<'a> {
|
|
|
261
265
|
tool_name: Raw<'a>,
|
|
262
266
|
#[serde(default, borrow, rename = "isError")]
|
|
263
267
|
is_error: Raw<'a>,
|
|
268
|
+
#[serde(default, borrow)]
|
|
269
|
+
details: Raw<'a>,
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
#[derive(Deserialize)]
|
|
273
|
+
struct CommandDetails<'a> {
|
|
274
|
+
#[serde(default, borrow, rename = "toolCommands")]
|
|
275
|
+
tool_commands: Raw<'a>,
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
#[derive(Deserialize)]
|
|
279
|
+
struct ToolCommand<'a> {
|
|
280
|
+
#[serde(default, borrow)]
|
|
281
|
+
tool: Raw<'a>,
|
|
282
|
+
#[serde(default, borrow)]
|
|
283
|
+
mode: Raw<'a>,
|
|
284
|
+
#[serde(default, borrow, rename = "exitCode")]
|
|
285
|
+
exit_code: Raw<'a>,
|
|
264
286
|
}
|
|
265
287
|
|
|
266
288
|
#[derive(Deserialize)]
|
|
@@ -354,6 +376,48 @@ impl W<'_> {
|
|
|
354
376
|
}
|
|
355
377
|
}
|
|
356
378
|
|
|
379
|
+
struct WriteToolCommands<'a, 'b>(&'a mut W<'b>);
|
|
380
|
+
|
|
381
|
+
impl<'de> Visitor<'de> for WriteToolCommands<'_, '_> {
|
|
382
|
+
type Value = ();
|
|
383
|
+
|
|
384
|
+
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
385
|
+
f.write_str("a tool command array")
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
fn visit_seq<A: SeqAccess<'de>>(self, mut seq: A) -> std::result::Result<(), A::Error> {
|
|
389
|
+
let w = self.0;
|
|
390
|
+
let mut wrote_command = false;
|
|
391
|
+
while let Some(command) = seq.next_element::<Obj<ToolCommand>>()? {
|
|
392
|
+
let Obj::Object(command) = command else { continue };
|
|
393
|
+
// RawValue has already validated the JSON. A numeric token starts with a digit or minus.
|
|
394
|
+
if !command.exit_code.0.is_some_and(|v| matches!(v.get().as_bytes()[0], b'-' | b'0'..=b'9'))
|
|
395
|
+
|| !command.mode.is("execute")
|
|
396
|
+
|| !(command.tool.is("recall") || command.tool.is("git_finalize"))
|
|
397
|
+
{
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
if wrote_command {
|
|
401
|
+
w.out.push(',');
|
|
402
|
+
} else {
|
|
403
|
+
w.key("details");
|
|
404
|
+
w.out.push_str("{\"toolCommands\":[");
|
|
405
|
+
wrote_command = true;
|
|
406
|
+
}
|
|
407
|
+
w.out.push('{');
|
|
408
|
+
let mut cw = W { out: w.out, first: true };
|
|
409
|
+
cw.field("tool", command.tool);
|
|
410
|
+
cw.field("mode", command.mode);
|
|
411
|
+
cw.field("exitCode", command.exit_code);
|
|
412
|
+
w.out.push('}');
|
|
413
|
+
}
|
|
414
|
+
if wrote_command {
|
|
415
|
+
w.out.push_str("]}");
|
|
416
|
+
}
|
|
417
|
+
Ok(())
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
357
421
|
fn project_entry(line: &[u8], out: &mut String) {
|
|
358
422
|
let text = std::str::from_utf8(line).expect("decoded line");
|
|
359
423
|
let start = out.len();
|
|
@@ -413,6 +477,16 @@ fn write_projection(text: &str, out: &mut String) -> Option<()> {
|
|
|
413
477
|
mw.field("credentialId", m.credential_id);
|
|
414
478
|
mw.field("toolName", m.tool_name);
|
|
415
479
|
mw.field("isError", m.is_error);
|
|
480
|
+
if let Some(details) = m.details.0.filter(|v| v.get().starts_with('{')) {
|
|
481
|
+
if m.role.is("toolResult") && m.tool_name.is("bash") {
|
|
482
|
+
let details: CommandDetails = serde_json::from_str(details.get()).ok()?;
|
|
483
|
+
if let Some(commands) = details.tool_commands.0.filter(|v| v.get().starts_with('[')) {
|
|
484
|
+
serde_json::Deserializer::from_str(commands.get())
|
|
485
|
+
.deserialize_seq(WriteToolCommands(&mut mw))
|
|
486
|
+
.ok()?;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
416
490
|
if let Some(content) = m.content.0 {
|
|
417
491
|
let failed = m.is_error.0.is_some_and(|v| !matches!(v.get(), "false" | "null"));
|
|
418
492
|
let result_text = m.role.is("toolResult") && (failed || ["wait", "hub", "git_finalize"].iter().any(|k| m.tool_name.is(k)));
|
|
@@ -489,3 +563,35 @@ fn write_projection(text: &str, out: &mut String) -> Option<()> {
|
|
|
489
563
|
w.out.push('}');
|
|
490
564
|
Some(())
|
|
491
565
|
}
|
|
566
|
+
|
|
567
|
+
#[cfg(test)]
|
|
568
|
+
mod tests {
|
|
569
|
+
use super::*;
|
|
570
|
+
use serde_json::{json, Value};
|
|
571
|
+
|
|
572
|
+
#[test]
|
|
573
|
+
fn projects_only_the_counted_bash_dispatch_fields() {
|
|
574
|
+
let mut output = String::new();
|
|
575
|
+
let input = r#"{"type":"message","message":{"role":"toolResult","toolName":"bash",
|
|
576
|
+
"content":[{"type":"text","text":"stdout"}],
|
|
577
|
+
"details":{"exitCode":1,"toolCommands":[
|
|
578
|
+
{"tool":"recall","mode":"execute","exitCode":1,"args":{"query":"fixture"}},
|
|
579
|
+
{"tool":"recall","mode":"help","exitCode":0},
|
|
580
|
+
{"tool":"git_finalize","mode":"execute","exitCode":"0"},
|
|
581
|
+
["git_finalize","execute",0],
|
|
582
|
+
{"tool":"read","mode":"execute","exitCode":0},
|
|
583
|
+
{"tool":"git\u005ffinalize","mode":"execute","exitCode":0,"inner":{"stage":"complete"}}
|
|
584
|
+
]}}}"#;
|
|
585
|
+
|
|
586
|
+
assert_eq!(write_projection(input, &mut output), Some(()));
|
|
587
|
+
assert_eq!(
|
|
588
|
+
serde_json::from_str::<Value>(&output).unwrap(),
|
|
589
|
+
json!({"type":"message","message":{"role":"toolResult","toolName":"bash",
|
|
590
|
+
"details":{"toolCommands":[
|
|
591
|
+
{"tool":"recall","mode":"execute","exitCode":1},
|
|
592
|
+
{"tool":"git_finalize","mode":"execute","exitCode":0}
|
|
593
|
+
]}
|
|
594
|
+
}})
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cuelo",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.340",
|
|
4
4
|
"description": "CUELO — open-source AI coding agent workspace and harness for omp (oh-my-pi)",
|
|
5
5
|
"homepage": "https://github.com/gim47656-ship-it/CUELO#readme",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"cueloBuild": {
|
|
32
32
|
"distribution": "cuelo",
|
|
33
|
-
"coreVersion": "19.0
|
|
33
|
+
"coreVersion": "19.1.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=22.19.0",
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"test:coverage": "bun test --coverage ./app ./components ./hooks ./lib ./public ./bin ./install.test.mjs"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@oh-my-pi/pi-agent-core": "19.0
|
|
105
|
-
"@oh-my-pi/pi-ai": "19.0
|
|
106
|
-
"@oh-my-pi/pi-coding-agent": "19.0
|
|
107
|
-
"@oh-my-pi/pi-tui": "19.0
|
|
108
|
-
"@oh-my-pi/pi-utils": "19.0
|
|
104
|
+
"@oh-my-pi/pi-agent-core": "19.1.0",
|
|
105
|
+
"@oh-my-pi/pi-ai": "19.1.0",
|
|
106
|
+
"@oh-my-pi/pi-coding-agent": "19.1.0",
|
|
107
|
+
"@oh-my-pi/pi-tui": "19.1.0",
|
|
108
|
+
"@oh-my-pi/pi-utils": "19.1.0",
|
|
109
109
|
"@sapphi-red/web-noise-suppressor": "^0.4.1",
|
|
110
110
|
"@seed-design/css": "2.8.0",
|
|
111
111
|
"@seed-design/react": "2.4.1",
|