@vibgrate/cli 2026.722.2 → 2026.727.2
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/DOCS.md +418 -213
- package/README.md +34 -8
- package/dist/baseline-TG4ATZGZ.js +8 -0
- package/dist/{baseline-BD3A7EXD.js.map → baseline-TG4ATZGZ.js.map} +1 -1
- package/dist/chunk-2MBL43EJ.js +82 -0
- package/dist/chunk-2MBL43EJ.js.map +1 -0
- package/dist/chunk-2XQDMLKB.js +465 -0
- package/dist/chunk-2XQDMLKB.js.map +1 -0
- package/dist/{chunk-PY3DNX5H.js → chunk-3Q7QBWFW.js} +13 -2
- package/dist/chunk-3Q7QBWFW.js.map +1 -0
- package/dist/chunk-3V24O47U.js +478 -0
- package/dist/chunk-3V24O47U.js.map +1 -0
- package/dist/chunk-5I4VSBWQ.js +764 -0
- package/dist/chunk-5I4VSBWQ.js.map +1 -0
- package/dist/{chunk-WNIIKCNF.js → chunk-6ABXHZRN.js} +59 -311
- package/dist/chunk-6ABXHZRN.js.map +1 -0
- package/dist/chunk-6AYDFFP5.js +136 -0
- package/dist/chunk-6AYDFFP5.js.map +1 -0
- package/dist/chunk-6UQMXIAG.js +122 -0
- package/dist/chunk-6UQMXIAG.js.map +1 -0
- package/dist/chunk-7N4Y3E47.js +108 -0
- package/dist/chunk-7N4Y3E47.js.map +1 -0
- package/dist/chunk-BPF3YX2U.js +64 -0
- package/dist/chunk-BPF3YX2U.js.map +1 -0
- package/dist/chunk-BWPBB45M.js +88 -0
- package/dist/chunk-BWPBB45M.js.map +1 -0
- package/dist/{chunk-6CXTPC74.js → chunk-CY4WKXB2.js} +27 -6
- package/dist/chunk-CY4WKXB2.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +10 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-NONYJLOJ.js → chunk-EX4PQT6W.js} +3 -3
- package/dist/{chunk-NONYJLOJ.js.map → chunk-EX4PQT6W.js.map} +1 -1
- package/dist/chunk-IS7VTH2Q.js +627 -0
- package/dist/chunk-IS7VTH2Q.js.map +1 -0
- package/dist/chunk-IZDH67DX.js +289 -0
- package/dist/chunk-IZDH67DX.js.map +1 -0
- package/dist/chunk-J4RFRKZH.js +2496 -0
- package/dist/chunk-J4RFRKZH.js.map +1 -0
- package/dist/chunk-J7LKEB2R.js +51 -0
- package/dist/chunk-J7LKEB2R.js.map +1 -0
- package/dist/chunk-JIBOJTGS.js +313 -0
- package/dist/chunk-JIBOJTGS.js.map +1 -0
- package/dist/chunk-K3MZIVZW.js +88 -0
- package/dist/chunk-K3MZIVZW.js.map +1 -0
- package/dist/chunk-K7REHDQS.js +776 -0
- package/dist/chunk-K7REHDQS.js.map +1 -0
- package/dist/{chunk-2O5YZVZV.js → chunk-KCKYKDMS.js} +23 -19
- package/dist/chunk-KCKYKDMS.js.map +1 -0
- package/dist/{chunk-3MXNNBLI.js → chunk-KNELIQJO.js} +1647 -2042
- package/dist/chunk-KNELIQJO.js.map +1 -0
- package/dist/chunk-KSBHGWRV.js +613 -0
- package/dist/chunk-KSBHGWRV.js.map +1 -0
- package/dist/chunk-LKVMI67M.js +1695 -0
- package/dist/chunk-LKVMI67M.js.map +1 -0
- package/dist/chunk-NDMDSPFX.js +69 -0
- package/dist/chunk-NDMDSPFX.js.map +1 -0
- package/dist/{chunk-CS37OBE3.js → chunk-OFUC6RYN.js} +791 -783
- package/dist/chunk-OFUC6RYN.js.map +1 -0
- package/dist/chunk-OOIG3RUM.js +276 -0
- package/dist/chunk-OOIG3RUM.js.map +1 -0
- package/dist/chunk-PMYWZRRS.js +62 -0
- package/dist/chunk-PMYWZRRS.js.map +1 -0
- package/dist/chunk-PXHNTC6D.js +382 -0
- package/dist/chunk-PXHNTC6D.js.map +1 -0
- package/dist/{chunk-I7GY7MVN.js → chunk-RNP3SMTV.js} +60 -12
- package/dist/chunk-RNP3SMTV.js.map +1 -0
- package/dist/chunk-TCDAZZNP.js +843 -0
- package/dist/chunk-TCDAZZNP.js.map +1 -0
- package/dist/{chunk-5BDHQ7DD.js → chunk-WGUL45AV.js} +24 -17
- package/dist/chunk-WGUL45AV.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +3373 -617
- package/dist/cli.js.map +1 -1
- package/dist/execution-env-ZU45JZ4G.js +4 -0
- package/dist/execution-env-ZU45JZ4G.js.map +1 -0
- package/dist/federation-SZWZIFZ7.js +7 -0
- package/dist/federation-SZWZIFZ7.js.map +1 -0
- package/dist/{fs-IPY4FJKH.js → fs-B5HZ2MIU.js} +3 -2
- package/dist/fs-B5HZ2MIU.js.map +1 -0
- package/dist/{fs-KCABDURV.js → fs-O5IQYXHO.js} +3 -2
- package/dist/fs-O5IQYXHO.js.map +1 -0
- package/dist/git-ref-XDXB6JP5.js +4 -0
- package/dist/git-ref-XDXB6JP5.js.map +1 -0
- package/dist/graph-backend-73URGTFY.js +11 -0
- package/dist/graph-backend-73URGTFY.js.map +1 -0
- package/dist/index.d.ts +472 -137
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/{interactive-A4DISSIW.js → interactive-372NLI5C.js} +186 -226
- package/dist/interactive-372NLI5C.js.map +1 -0
- package/dist/llm-host-7GWDO6IX.js +9 -0
- package/dist/llm-host-7GWDO6IX.js.map +1 -0
- package/dist/load-I333TGNI.js +8 -0
- package/dist/load-I333TGNI.js.map +1 -0
- package/dist/local-runtime-5O2NN3GA.js +5 -0
- package/dist/local-runtime-5O2NN3GA.js.map +1 -0
- package/dist/mcp-tools-I7JK3S2M.js +4 -0
- package/dist/{mcp-tools-I6PME3AV.js.map → mcp-tools-I7JK3S2M.js.map} +1 -1
- package/dist/model-execution-profile-TFBKCNJG.js +4 -0
- package/dist/model-execution-profile-TFBKCNJG.js.map +1 -0
- package/dist/model-orchestrator-TVONAUPS.js +9 -0
- package/dist/model-orchestrator-TVONAUPS.js.map +1 -0
- package/dist/parse-worker.d.ts +1 -1
- package/dist/parse-worker.js +2 -1
- package/dist/parse-worker.js.map +1 -1
- package/dist/paths-2RAH3GME.js +6 -0
- package/dist/paths-2RAH3GME.js.map +1 -0
- package/dist/resolve-gguf-VPL4YQ6J.js +8 -0
- package/dist/resolve-gguf-VPL4YQ6J.js.map +1 -0
- package/dist/runtime-session-JRKCQUHY.js +18 -0
- package/dist/runtime-session-JRKCQUHY.js.map +1 -0
- package/dist/session-ITPYQ5XI.js +11 -0
- package/dist/{session-POJUDFPH.js.map → session-ITPYQ5XI.js.map} +1 -1
- package/dist/session-store-WFBX7HXL.js +4 -0
- package/dist/{session-store-W5RZZHA3.js.map → session-store-WFBX7HXL.js.map} +1 -1
- package/dist/{stream-json-Q2JGWPHB.js → stream-json-SLMDKLXP.js} +17 -6
- package/dist/stream-json-SLMDKLXP.js.map +1 -0
- package/dist/{types-Jl6RJ175.d.ts → types-7AHBUbFm.d.ts} +8 -2
- package/dist/ui-Q6DJ3GCU.js +5 -0
- package/dist/ui-Q6DJ3GCU.js.map +1 -0
- package/dist/vgd-7JV5KCNJ.js +17 -0
- package/dist/vgd-7JV5KCNJ.js.map +1 -0
- package/package.json +9 -6
- package/dist/baseline-BD3A7EXD.js +0 -7
- package/dist/chunk-2O5YZVZV.js.map +0 -1
- package/dist/chunk-3MXNNBLI.js.map +0 -1
- package/dist/chunk-5BDHQ7DD.js.map +0 -1
- package/dist/chunk-6CXTPC74.js.map +0 -1
- package/dist/chunk-CS37OBE3.js.map +0 -1
- package/dist/chunk-GGJZA3Q6.js +0 -961
- package/dist/chunk-GGJZA3Q6.js.map +0 -1
- package/dist/chunk-I7GY7MVN.js.map +0 -1
- package/dist/chunk-JBXNQCGE.js +0 -484
- package/dist/chunk-JBXNQCGE.js.map +0 -1
- package/dist/chunk-PY3DNX5H.js.map +0 -1
- package/dist/chunk-WNIIKCNF.js.map +0 -1
- package/dist/fs-IPY4FJKH.js.map +0 -1
- package/dist/fs-KCABDURV.js.map +0 -1
- package/dist/interactive-A4DISSIW.js.map +0 -1
- package/dist/mcp-tools-I6PME3AV.js +0 -3
- package/dist/session-POJUDFPH.js +0 -6
- package/dist/session-store-W5RZZHA3.js +0 -3
- package/dist/stream-json-Q2JGWPHB.js.map +0 -1
- package/dist/ui-HOVOPWMX.js +0 -4
- package/dist/ui-HOVOPWMX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
export { GraphSource, createServer, exportGraph, formatForExt, serveStdio } from './chunk-
|
|
2
|
-
export { ASSISTANTS, FREE_PACK, ResourceLimitError,
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { GraphSource, createServer, exportGraph, formatForExt, serveStdio } from './chunk-KCKYKDMS.js';
|
|
2
|
+
export { ASSISTANTS, FREE_PACK, ResourceLimitError, SKIP_DIRS, SKIP_FILES, TOOLS, UsageError, analyze, applyCoverage, assistantById, buildFacts, buildGraph, coveringTests, decodeScipIndex, detectRunner, discover, driftCount, groundGraph, hasDrift, installAssistant, loadCoverage, loadSnapshot, probeFreshness, refreshIfStale, resolveLimits, scipEdges, searchSymbols, shortestPath, testsToRun, uninstallAssistant, verifyDeterminism, writeSnapshot } from './chunk-KNELIQJO.js';
|
|
3
|
+
export { VERSION } from './chunk-WGUL45AV.js';
|
|
4
|
+
export { addLibrary, applyStaticTestLinkage, buildModuleResolver, inventory as dependencyInventory, driftFor, enrichOnline, isTestFile, libId, loadCatalog, parseJsonc, readDoc, relativeResolver, resolveLib, saveCatalog } from './chunk-LKVMI67M.js';
|
|
5
|
+
export { findNodes, nodeById, resolveOne } from './chunk-J7LKEB2R.js';
|
|
6
|
+
export { discoverModels } from './chunk-OOIG3RUM.js';
|
|
7
|
+
export { CAPSULE_COMPILER_ID, CAPSULE_RANKING_VERSION, TASK_CAPSULE_SCHEMA_VERSION, buildCodeContext, buildTaskCapsule, capsuleToCodeContext, readSavings, recordSaving, savingsRecorded, summarizeCapsule } from './chunk-KSBHGWRV.js';
|
|
8
|
+
export { GraphIndex, cosine, getNodeEmbeddings, identifierParts, impactOf, loadEmbedder, nodeEmbedText, queryGraph, queryGraphSemantic } from './chunk-6ABXHZRN.js';
|
|
9
|
+
export { LANGUAGES, allLanguageIds, grammarsSourceDir, langById, langForExtension, parseSource } from './chunk-3Q7QBWFW.js';
|
|
6
10
|
import { redactUrlCredentials, redactSecrets } from './chunk-RXP66R2E.js';
|
|
11
|
+
export { SCHEMA_VERSION, defaultGraphPath, legacyGraphPath, loadGraph, preferInRepoGraph, renderHtml, renderReport, resolveGraphPath, vibgrateDir, writeArtifacts } from './chunk-2XQDMLKB.js';
|
|
12
|
+
export { parseGraph, serializeGraph, stableStringify } from './chunk-K3MZIVZW.js';
|
|
13
|
+
import './chunk-BWPBB45M.js';
|
|
14
|
+
import './chunk-JFGYT6BI.js';
|
|
15
|
+
import './chunk-BPF3YX2U.js';
|
|
7
16
|
import './chunk-GI6W53LM.js';
|
|
8
17
|
import './chunk-CRAMOEBE.js';
|
|
9
|
-
|
|
10
|
-
import './chunk-JFGYT6BI.js';
|
|
18
|
+
import './chunk-DGUM43GV.js';
|
|
11
19
|
import { execFileSync } from 'child_process';
|
|
12
20
|
|
|
13
21
|
function buildEnvelope(root, graph, scanIngestId) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/push.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/engine/push.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBO,SAAS,aAAA,CAAc,IAAA,EAAc,KAAA,EAAgB,YAAA,EAA4C;AACtG,EAAA,MAAM,MAAM,GAAA,CAAI,IAAA,EAAM,CAAC,WAAA,EAAa,MAAM,CAAC,CAAA,IAAK,0CAAA;AAChD,EAAA,MAAM,MAAA,GAAS,IAAI,IAAA,EAAM,CAAC,aAAa,cAAA,EAAgB,MAAM,CAAC,CAAA,IAAK,MAAA;AACnE,EAAA,MAAM,SAAA,GAAY,IAAI,IAAA,EAAM,CAAC,UAAU,OAAA,EAAS,mBAAmB,CAAC,CAAA,IAAK,MAAA;AACzE,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,cAAA;AAAA,IACf,YAAA,EAAc,OAAA;AAAA,IACd,YAAA;AAAA,IACA,GAAA,EAAK,EAAE,GAAA,EAAK,QAAA,EAAU,IAAI,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,EAAG,MAAA,EAAO;AAAA,IAC/C,YAAY,SAAA,GAAY,EAAE,WAAW,oBAAA,CAAqB,SAAS,GAAE,GAAI,MAAA;AAAA,IACzE,aAAa,KAAA,CAAM,WAAA;AAAA,IACnB,KAAA,EAAO,YAAY,KAAK;AAAA,GAC1B;AACF;AAOO,SAAS,YAAY,KAAA,EAAyB;AACnD,EAAA,OAAO;AAAA,IACL,GAAG,KAAA;AAAA,IACH,KAAA,EAAO,KAAA,CAAM,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,KAAM;AAC5B,MAAA,MAAM,YAAY,CAAA,CAAE,SAAA,GAAY,cAAc,CAAA,CAAE,SAAS,IAAI,CAAA,CAAE,SAAA;AAC/D,MAAA,MAAM,MAAM,CAAA,CAAE,GAAA,GAAM,cAAc,CAAA,CAAE,GAAG,IAAI,CAAA,CAAE,GAAA;AAC7C,MAAA,OAAO,SAAA,KAAc,CAAA,CAAE,SAAA,IAAa,GAAA,KAAQ,CAAA,CAAE,GAAA,GAAM,EAAE,GAAG,CAAA,EAAG,SAAA,EAAW,GAAA,EAAI,GAAI,CAAA;AAAA,IACjF,CAAC;AAAA,GACH;AACF;AAEA,SAAS,GAAA,CAAI,MAAc,IAAA,EAA+B;AACxD,EAAA,IAAI;AACF,IAAA,OAAO,YAAA,CAAa,KAAA,EAAO,IAAA,EAAM,EAAE,GAAA,EAAK,IAAA,EAAM,QAAA,EAAU,MAAA,EAAQ,CAAA,CAAE,IAAA,EAAK,IAAK,IAAA;AAAA,EAC9E,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF","file":"index.js","sourcesContent":["import { execFileSync } from 'node:child_process';\nimport { redactSecrets, redactUrlCredentials } from '../core-open/utils/redact.js';\nimport type { VgGraph } from '../schema.js';\n\n/**\n * The deferred, decoupled push envelope (VG-PACKAGE-AND-SCHEMA §7). In the open\n * CLI `vg push` is **specified but not built**: it assembles and redacts the\n * envelope and prints a notice, but performs **no network upload**. Nothing in\n * the free path depends on it. Drift-over-time/governance is the separate\n * commercial product.\n */\n\nexport interface GraphUploadEnvelope {\n schemaVersion: 'vg-graph/1.0';\n artifactType: 'graph';\n scanIngestId?: string;\n vcs: { sha: string; shortSha: string; branch: string };\n repository?: { name?: string; remoteUrl?: string };\n generatedAt: string;\n graph: VgGraph;\n}\n\nexport function buildEnvelope(root: string, graph: VgGraph, scanIngestId?: string): GraphUploadEnvelope {\n const sha = git(root, ['rev-parse', 'HEAD']) ?? '0000000000000000000000000000000000000000';\n const branch = git(root, ['rev-parse', '--abbrev-ref', 'HEAD']) ?? 'HEAD';\n const remoteUrl = git(root, ['config', '--get', 'remote.origin.url']) ?? undefined;\n return {\n schemaVersion: 'vg-graph/1.0',\n artifactType: 'graph',\n scanIngestId,\n vcs: { sha, shortSha: sha.slice(0, 12), branch },\n repository: remoteUrl ? { remoteUrl: redactUrlCredentials(remoteUrl) } : undefined,\n generatedAt: graph.generatedAt,\n graph: redactGraph(graph),\n };\n}\n\n/**\n * Redaction pass (GUARDRAILS §1: redact before storage). The graph is structure,\n * not content, but we defensively scrub any signature/name that matches a\n * credential-shaped pattern, and strip credentials from the remote URL.\n */\nexport function redactGraph(graph: VgGraph): VgGraph {\n return {\n ...graph,\n nodes: graph.nodes.map((n) => {\n const signature = n.signature ? redactSecrets(n.signature) : n.signature;\n const doc = n.doc ? redactSecrets(n.doc) : n.doc;\n return signature !== n.signature || doc !== n.doc ? { ...n, signature, doc } : n;\n }),\n };\n}\n\nfunction git(root: string, args: string[]): string | null {\n try {\n return execFileSync('git', args, { cwd: root, encoding: 'utf8' }).trim() || null;\n } catch {\n return null;\n }\n}\n"]}
|
|
@@ -1,22 +1,41 @@
|
|
|
1
|
+
import { McpToolset, defaultMcpConnect } from './chunk-LEPTUB4H.js';
|
|
1
2
|
import { newSession, loadLatestSession, summarizeSession, saveSession, recordTask } from './chunk-K3SLGULW.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
3
|
+
import { startCodeRuntimeSession } from './chunk-2MBL43EJ.js';
|
|
4
|
+
import { TtyPrompter, PromptCancelled } from './chunk-JYS4OBN2.js';
|
|
5
|
+
import { printCodeLogo, runBuild, fetchCatalog, resolveProviders, topProviders } from './chunk-RNP3SMTV.js';
|
|
6
|
+
import { BranchGraphSession } from './chunk-TCDAZZNP.js';
|
|
7
|
+
import { loadOrDiscoverFederation } from './chunk-5I4VSBWQ.js';
|
|
8
|
+
import { resolveExecutionEnv } from './chunk-IS7VTH2Q.js';
|
|
9
|
+
import { runAgent } from './chunk-J4RFRKZH.js';
|
|
10
|
+
import { hasOllama, gatherSystemMemory, stopModel, pullModelClean } from './chunk-6UQMXIAG.js';
|
|
11
|
+
import { estimateModelBytes, assessCapability, fmt } from './chunk-7N4Y3E47.js';
|
|
12
|
+
import { mergeModelExecutionProfile, resolveModelExecutionProfile } from './chunk-IZDH67DX.js';
|
|
13
|
+
import { resolveGraphBackend } from './chunk-6AYDFFP5.js';
|
|
14
|
+
import { vgdIsRunning, vgdRequest } from './chunk-PMYWZRRS.js';
|
|
15
|
+
import './chunk-K7REHDQS.js';
|
|
16
|
+
import './chunk-JIBOJTGS.js';
|
|
17
|
+
import './chunk-NDMDSPFX.js';
|
|
18
|
+
import { nodeCodeFs, undoChanges } from './chunk-CY4WKXB2.js';
|
|
19
|
+
import { summarizeDiffs } from './chunk-OFUC6RYN.js';
|
|
20
|
+
import { info, c, out } from './chunk-CT5BS56U.js';
|
|
21
|
+
import { refreshIfStale } from './chunk-KNELIQJO.js';
|
|
22
|
+
import './chunk-WGUL45AV.js';
|
|
23
|
+
import './chunk-LKVMI67M.js';
|
|
24
|
+
import './chunk-J7LKEB2R.js';
|
|
25
|
+
import { discoverModels } from './chunk-OOIG3RUM.js';
|
|
26
|
+
import { readModelSavings } from './chunk-KSBHGWRV.js';
|
|
27
|
+
import './chunk-6ABXHZRN.js';
|
|
28
|
+
import './chunk-3Q7QBWFW.js';
|
|
8
29
|
import './chunk-RXP66R2E.js';
|
|
30
|
+
import { loadGraph, resolveGraphPath } from './chunk-2XQDMLKB.js';
|
|
31
|
+
import './chunk-K3MZIVZW.js';
|
|
32
|
+
import './chunk-BWPBB45M.js';
|
|
33
|
+
import './chunk-JFGYT6BI.js';
|
|
34
|
+
import './chunk-BPF3YX2U.js';
|
|
9
35
|
import './chunk-GI6W53LM.js';
|
|
10
36
|
import './chunk-CRAMOEBE.js';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import { readModelSavings } from './chunk-WNIIKCNF.js';
|
|
14
|
-
import './chunk-JFGYT6BI.js';
|
|
15
|
-
import { TtyPrompter, PromptCancelled } from './chunk-JYS4OBN2.js';
|
|
16
|
-
import { info, c, out } from './chunk-CT5BS56U.js';
|
|
17
|
-
import { McpToolset, defaultMcpConnect } from './chunk-LEPTUB4H.js';
|
|
18
|
-
import * as os from 'os';
|
|
19
|
-
import { spawnSync, spawn } from 'child_process';
|
|
37
|
+
import './chunk-DGUM43GV.js';
|
|
38
|
+
import { spawnSync } from 'child_process';
|
|
20
39
|
|
|
21
40
|
// src/code/wizard.ts
|
|
22
41
|
var ENTER_SLUG = "__enter_slug__";
|
|
@@ -99,160 +118,6 @@ function modelHint(contextLength, pricePerM) {
|
|
|
99
118
|
return parts.join(" \xB7 ");
|
|
100
119
|
}
|
|
101
120
|
|
|
102
|
-
// src/code/capability.ts
|
|
103
|
-
var GiB = 1024 ** 3;
|
|
104
|
-
var QUANT_BYTES_PER_PARAM = {
|
|
105
|
-
f16: 2,
|
|
106
|
-
fp16: 2,
|
|
107
|
-
f32: 4,
|
|
108
|
-
q8: 1.06,
|
|
109
|
-
q8_0: 1.06,
|
|
110
|
-
q6: 0.82,
|
|
111
|
-
q6_k: 0.82,
|
|
112
|
-
q5: 0.7,
|
|
113
|
-
q5_k_m: 0.72,
|
|
114
|
-
q5_k_s: 0.68,
|
|
115
|
-
q5_0: 0.71,
|
|
116
|
-
q5_1: 0.77,
|
|
117
|
-
q4: 0.58,
|
|
118
|
-
q4_k_m: 0.6,
|
|
119
|
-
q4_k_s: 0.56,
|
|
120
|
-
q4_0: 0.56,
|
|
121
|
-
q4_1: 0.63,
|
|
122
|
-
q3: 0.46,
|
|
123
|
-
q3_k_m: 0.48,
|
|
124
|
-
q3_k_s: 0.44,
|
|
125
|
-
q2: 0.36,
|
|
126
|
-
q2_k: 0.4
|
|
127
|
-
};
|
|
128
|
-
var DEFAULT_QUANT = "q4_k_m";
|
|
129
|
-
var RUNTIME_OVERHEAD = 1.2;
|
|
130
|
-
function estimateModelBytes(slug, defaultParamsB = 7) {
|
|
131
|
-
const lower = slug.toLowerCase();
|
|
132
|
-
const paramMatch = lower.match(/(\d+(?:\.\d+)?)\s*b\b/);
|
|
133
|
-
const paramsB = paramMatch ? Number(paramMatch[1]) : void 0;
|
|
134
|
-
const quant = detectQuant(lower);
|
|
135
|
-
const bytesPerParam = QUANT_BYTES_PER_PARAM[quant] ?? QUANT_BYTES_PER_PARAM[DEFAULT_QUANT];
|
|
136
|
-
const effectiveParams = (paramsB ?? defaultParamsB) * 1e9;
|
|
137
|
-
const bytes = Math.round(effectiveParams * bytesPerParam * RUNTIME_OVERHEAD);
|
|
138
|
-
return { paramsB, quant, bytes, guessed: paramsB === void 0 };
|
|
139
|
-
}
|
|
140
|
-
function detectQuant(lower) {
|
|
141
|
-
const keys = Object.keys(QUANT_BYTES_PER_PARAM).sort((a, b) => b.length - a.length);
|
|
142
|
-
for (const k of keys) if (lower.includes(k)) return k;
|
|
143
|
-
return DEFAULT_QUANT;
|
|
144
|
-
}
|
|
145
|
-
function parseOllamaPs(stdout) {
|
|
146
|
-
const lines = stdout.split("\n").map((l) => l.trim()).filter(Boolean);
|
|
147
|
-
const out2 = [];
|
|
148
|
-
for (const line of lines) {
|
|
149
|
-
if (/^NAME\b/i.test(line)) continue;
|
|
150
|
-
const sizeMatch = line.match(/(\d+(?:\.\d+)?)\s*(GB|GiB|MB|MiB|TB)/i);
|
|
151
|
-
const name = line.split(/\s+/)[0];
|
|
152
|
-
if (!name || !sizeMatch) continue;
|
|
153
|
-
out2.push({ name, bytes: toBytes(Number(sizeMatch[1]), sizeMatch[2]) });
|
|
154
|
-
}
|
|
155
|
-
return out2;
|
|
156
|
-
}
|
|
157
|
-
function parseNvidiaSmi(stdout) {
|
|
158
|
-
const line = stdout.split("\n").map((l) => l.trim()).find(Boolean);
|
|
159
|
-
if (!line) return null;
|
|
160
|
-
const parts = line.split(",").map((p) => Number(p.trim()));
|
|
161
|
-
if (parts.length < 2 || !Number.isFinite(parts[0]) || !Number.isFinite(parts[1])) return null;
|
|
162
|
-
return { totalBytes: parts[0] * 1024 * 1024, usedBytes: parts[1] * 1024 * 1024 };
|
|
163
|
-
}
|
|
164
|
-
function assessCapability(model, sys) {
|
|
165
|
-
const useVram = typeof sys.vramTotalBytes === "number" && sys.vramTotalBytes > 0;
|
|
166
|
-
const free = useVram ? sys.vramFreeBytes ?? 0 : sys.freeRamBytes;
|
|
167
|
-
const loadedBytes = sys.loaded.reduce((n, m) => n + m.bytes, 0);
|
|
168
|
-
const margin = Math.min(2 * GiB, (useVram ? sys.vramTotalBytes : sys.totalRamBytes) * 0.1);
|
|
169
|
-
const available = Math.max(0, free - margin);
|
|
170
|
-
const availableIfUnloaded = Math.max(0, free + loadedBytes - margin);
|
|
171
|
-
const need = model.bytes;
|
|
172
|
-
const canRunNow = available >= need;
|
|
173
|
-
const canRunUnloaded = availableIfUnloaded >= need;
|
|
174
|
-
const suggestions = [];
|
|
175
|
-
if (!canRunNow && canRunUnloaded && sys.loaded.length) {
|
|
176
|
-
const biggest = [...sys.loaded].sort((a, b) => b.bytes - a.bytes);
|
|
177
|
-
suggestions.push(`unload a loaded model to free memory (e.g. \`ollama stop ${biggest[0].name}\` frees ~${fmt(biggest[0].bytes)})`);
|
|
178
|
-
}
|
|
179
|
-
if (!canRunUnloaded) {
|
|
180
|
-
suggestions.push(`this model needs ~${fmt(need)} but only ~${fmt(availableIfUnloaded)} is available \u2014 choose a smaller model or a lower quant (e.g. q4_K_M)`);
|
|
181
|
-
}
|
|
182
|
-
if (model.guessed) {
|
|
183
|
-
suggestions.push(`couldn't read the parameter count from the name \u2014 this estimate assumes a ~${(model.bytes / GiB).toFixed(1)} GiB model; verify before pulling`);
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
model,
|
|
187
|
-
availableBytes: available,
|
|
188
|
-
availableIfUnloadedBytes: availableIfUnloaded,
|
|
189
|
-
canRun: canRunNow || canRunUnloaded,
|
|
190
|
-
needsUnload: !canRunNow && canRunUnloaded,
|
|
191
|
-
suggestions,
|
|
192
|
-
loaded: sys.loaded
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
function fmt(bytes) {
|
|
196
|
-
if (bytes >= GiB) return `${(bytes / GiB).toFixed(1)} GiB`;
|
|
197
|
-
return `${(bytes / (1024 * 1024)).toFixed(0)} MiB`;
|
|
198
|
-
}
|
|
199
|
-
function toBytes(n, unit) {
|
|
200
|
-
const u = unit.toLowerCase();
|
|
201
|
-
if (u.startsWith("t")) return n * 1e3 ** 4;
|
|
202
|
-
if (u.startsWith("g")) return n * (u.includes("i") ? GiB : 1e9);
|
|
203
|
-
if (u.startsWith("m")) return n * (u.includes("i") ? 1024 * 1024 : 1e6);
|
|
204
|
-
return n;
|
|
205
|
-
}
|
|
206
|
-
function gatherSystemMemory() {
|
|
207
|
-
const loaded = safeRun("ollama", ["ps"]).map(parseOllamaPs).flat();
|
|
208
|
-
const smi = safeRun("nvidia-smi", ["--query-gpu=memory.total,memory.used", "--format=csv,noheader,nounits"]).map(parseNvidiaSmi).find(Boolean);
|
|
209
|
-
const sys = {
|
|
210
|
-
totalRamBytes: os.totalmem(),
|
|
211
|
-
freeRamBytes: os.freemem(),
|
|
212
|
-
loaded
|
|
213
|
-
};
|
|
214
|
-
if (smi) {
|
|
215
|
-
sys.vramTotalBytes = smi.totalBytes;
|
|
216
|
-
sys.vramFreeBytes = Math.max(0, smi.totalBytes - smi.usedBytes);
|
|
217
|
-
}
|
|
218
|
-
return sys;
|
|
219
|
-
}
|
|
220
|
-
function hasOllama() {
|
|
221
|
-
return spawnSync(process.platform === "win32" ? "where" : "which", ["ollama"], { stdio: "ignore" }).status === 0;
|
|
222
|
-
}
|
|
223
|
-
function stopModel(name) {
|
|
224
|
-
return spawnSync("ollama", ["stop", name], { stdio: "ignore" }).status === 0;
|
|
225
|
-
}
|
|
226
|
-
function pullModelClean(name, spinner) {
|
|
227
|
-
return new Promise((resolve) => {
|
|
228
|
-
const child = spawn("ollama", ["pull", name]);
|
|
229
|
-
const onData = (buf) => {
|
|
230
|
-
const line = lastMeaningfulLine(buf.toString());
|
|
231
|
-
if (line) spinner.update(`pulling ${name} \u2014 ${line}`);
|
|
232
|
-
};
|
|
233
|
-
child.stdout?.on("data", onData);
|
|
234
|
-
child.stderr?.on("data", onData);
|
|
235
|
-
child.on("error", () => resolve(false));
|
|
236
|
-
child.on("close", (code) => resolve(code === 0));
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
function lastMeaningfulLine(chunk) {
|
|
240
|
-
const lines = chunk.split(/[\r\n]+/).map((l) => l.trim()).map((l) => l.replace(/\x1b\[[0-9;]*[A-Za-z]/g, "").replace(/[▏▎▍▌▋▊▉█░▒▓⣀-⣿]/g, "").trim()).filter(Boolean);
|
|
241
|
-
const last = lines[lines.length - 1] ?? "";
|
|
242
|
-
const pct = last.match(/(\d+)\s*%/);
|
|
243
|
-
const status = last.replace(/\s{2,}.*$/, "").slice(0, 48);
|
|
244
|
-
return pct ? `${status} ${pct[1]}%`.trim() : status;
|
|
245
|
-
}
|
|
246
|
-
function safeRun(bin, args) {
|
|
247
|
-
try {
|
|
248
|
-
const res = spawnSync(bin, args, { encoding: "utf8", timeout: 5e3 });
|
|
249
|
-
if (res.status !== 0 || typeof res.stdout !== "string") return [];
|
|
250
|
-
return [res.stdout];
|
|
251
|
-
} catch {
|
|
252
|
-
return [];
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
121
|
// src/code/cost.ts
|
|
257
122
|
function costOf(usage, pricing) {
|
|
258
123
|
const inCost = (usage.promptTokens ?? 0) / 1e6 * (pricing.promptPerM ?? 0);
|
|
@@ -300,54 +165,23 @@ function fmtTokens(n) {
|
|
|
300
165
|
function round4(x) {
|
|
301
166
|
return Math.round(x * 1e4) / 1e4;
|
|
302
167
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const spawnImpl = options.spawnImpl ?? spawn;
|
|
321
|
-
try {
|
|
322
|
-
const child = spawnImpl(launch.command, args, { cwd: options.root, stdio: "ignore", detached: false });
|
|
323
|
-
if (!child || typeof child.pid !== "number") return null;
|
|
324
|
-
child.on("error", () => {
|
|
325
|
-
});
|
|
326
|
-
return new _GraphProcess(child, launch.command, args);
|
|
327
|
-
} catch {
|
|
328
|
-
return null;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
get pid() {
|
|
332
|
-
return this.child?.pid;
|
|
333
|
-
}
|
|
334
|
-
/** True while the child is believed to be running. */
|
|
335
|
-
get running() {
|
|
336
|
-
return this.child !== null && !this.disposed;
|
|
337
|
-
}
|
|
338
|
-
/** Kill the child. Idempotent and safe to call after the child already exited. */
|
|
339
|
-
dispose() {
|
|
340
|
-
if (this.disposed) return;
|
|
341
|
-
this.disposed = true;
|
|
342
|
-
const child = this.child;
|
|
343
|
-
this.child = null;
|
|
344
|
-
if (!child || child.killed) return;
|
|
345
|
-
try {
|
|
346
|
-
child.kill("SIGTERM");
|
|
347
|
-
} catch {
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
};
|
|
168
|
+
|
|
169
|
+
// src/runtime/bridge-facts.ts
|
|
170
|
+
function bridgePinnedFacts(bridges, options = {}) {
|
|
171
|
+
if (!bridges?.length) return [];
|
|
172
|
+
const min = options.minConfidence ?? 0.8;
|
|
173
|
+
const max = options.maxFacts ?? 12;
|
|
174
|
+
return bridges.filter((b) => b.confidence >= min).map((b) => {
|
|
175
|
+
const from = shortLabel(b.fromRoot);
|
|
176
|
+
const to = shortLabel(b.toRoot);
|
|
177
|
+
const via = b.packageName ? ` package ${b.packageName}` : "";
|
|
178
|
+
return `bridge ${b.kind}: ${from} \u2192 ${to}${via} (${b.confidence.toFixed(2)})`;
|
|
179
|
+
}).sort((a, b) => a.localeCompare(b)).slice(0, max);
|
|
180
|
+
}
|
|
181
|
+
function shortLabel(root) {
|
|
182
|
+
const parts = root.replace(/\\/g, "/").split("/").filter(Boolean);
|
|
183
|
+
return parts[parts.length - 1] || root;
|
|
184
|
+
}
|
|
351
185
|
|
|
352
186
|
// src/code/interactive.ts
|
|
353
187
|
async function runInteractive(root, global, opts, prompter = new TtyPrompter()) {
|
|
@@ -379,7 +213,8 @@ async function ensureMap(root, global, prompter) {
|
|
|
379
213
|
return;
|
|
380
214
|
}
|
|
381
215
|
const sp = prompter.spinner("Checking the code map is up to date\u2026");
|
|
382
|
-
const
|
|
216
|
+
const graphPath = resolveGraphPath(root);
|
|
217
|
+
const refreshed = await refreshIfStale(root, { graphPath }).catch(() => null);
|
|
383
218
|
if (refreshed?.status === "refreshed") sp.stop("Code map refreshed");
|
|
384
219
|
else sp.stop("Code map ready");
|
|
385
220
|
}
|
|
@@ -454,14 +289,58 @@ async function codingRepl(root, global, opts, selection, prompter) {
|
|
|
454
289
|
sp.stop(`MCP tools: ${toolset.specs().length} from ${Object.keys(opts.mcpServers).length} server(s)${from}`);
|
|
455
290
|
for (const w of warnings) prompter.note(c.yellow(` ${w}`));
|
|
456
291
|
}
|
|
457
|
-
const
|
|
292
|
+
const runtime = await startCodeRuntimeSession({ root });
|
|
293
|
+
const branchGraphs = new BranchGraphSession({ root, graphPath: global.graph });
|
|
294
|
+
const federation = loadOrDiscoverFederation(root);
|
|
295
|
+
const extraPinnedFacts = bridgePinnedFacts(federation.bridges);
|
|
296
|
+
if (federation.members.length > 1 && await vgdIsRunning({ socketPath: runtime.socketPath })) {
|
|
297
|
+
try {
|
|
298
|
+
await vgdRequest(
|
|
299
|
+
{
|
|
300
|
+
op: "register-federation",
|
|
301
|
+
primaryRoot: federation.primaryRoot,
|
|
302
|
+
members: federation.members.map((m) => ({ root: m.root, label: m.label, role: m.role }))
|
|
303
|
+
},
|
|
304
|
+
{ socketPath: runtime.socketPath }
|
|
305
|
+
);
|
|
306
|
+
const bridgeN = federation.bridges?.length ?? 0;
|
|
307
|
+
prompter.note(
|
|
308
|
+
c.dim(
|
|
309
|
+
`federation \xB7 ${federation.members.length} workspace(s) registered with vgd` + (bridgeN ? ` \xB7 ${bridgeN} bridge edge(s)` : "")
|
|
310
|
+
)
|
|
311
|
+
);
|
|
312
|
+
} catch {
|
|
313
|
+
}
|
|
314
|
+
} else if ((federation.bridges?.length ?? 0) > 0) {
|
|
315
|
+
prompter.note(
|
|
316
|
+
c.dim(
|
|
317
|
+
`federation \xB7 ${federation.members.length} member(s) \xB7 ${federation.bridges.length} bridge edge(s) (discovery)`
|
|
318
|
+
)
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
let modelProfile = mergeModelExecutionProfile(
|
|
322
|
+
resolveModelExecutionProfile({
|
|
323
|
+
providerId: sel.providerSlug,
|
|
324
|
+
model: sel.model,
|
|
325
|
+
budget: opts.budget ? Number(opts.budget) : void 0,
|
|
326
|
+
maxRepairRounds: opts.verify?.maxRounds,
|
|
327
|
+
securityTier: opts.securityTier
|
|
328
|
+
}),
|
|
329
|
+
opts.modelProfile
|
|
330
|
+
);
|
|
331
|
+
const securityTier = opts.securityTier ?? modelProfile.securityTier ?? (opts.auto ? "L1" : "L0");
|
|
332
|
+
const writableRoots = federation?.members.map((m) => m.root) ?? [root];
|
|
333
|
+
const executionEnv = resolveExecutionEnv(securityTier, { writableRoots });
|
|
458
334
|
const cleanup = () => {
|
|
459
|
-
|
|
335
|
+
void runtime.dispose();
|
|
460
336
|
void mcp?.dispose();
|
|
461
337
|
};
|
|
462
338
|
process.once("SIGINT", cleanup);
|
|
463
339
|
const autoNote = opts.auto ? c.yellow(" \xB7 auto-approve ON") : "";
|
|
464
|
-
|
|
340
|
+
const runtimeNote = runtime.kind !== "none" ? c.dim(` \xB7 ${runtime.label}`) : "";
|
|
341
|
+
const securityNote = c.dim(` \xB7 ${executionEnv.tier}/${executionEnv.label}`);
|
|
342
|
+
const mepNote = c.dim(` \xB7 mep ${modelProfile.mode}`);
|
|
343
|
+
prompter.intro(`Ready \u2014 ${sel.providerSlug}/${sel.model}${runtimeNote}${securityNote}${mepNote}${autoNote}. Describe a task, or /help. Empty line to exit.`);
|
|
465
344
|
try {
|
|
466
345
|
for (; ; ) {
|
|
467
346
|
const line = (await prompter.input("code \u203A")).trim();
|
|
@@ -499,11 +378,47 @@ async function codingRepl(root, global, opts, selection, prompter) {
|
|
|
499
378
|
}
|
|
500
379
|
continue;
|
|
501
380
|
}
|
|
502
|
-
const
|
|
381
|
+
const branchLoad = branchGraphs.ensureCurrent();
|
|
382
|
+
const graph = branchLoad.graph;
|
|
503
383
|
if (!graph) {
|
|
504
384
|
prompter.note(c.red("the code map disappeared \u2014 run `vg` to rebuild"));
|
|
505
385
|
break;
|
|
506
386
|
}
|
|
387
|
+
if (branchLoad.switched) {
|
|
388
|
+
prompter.note(
|
|
389
|
+
c.dim(
|
|
390
|
+
`branch \xB7 ${branchLoad.gitRef}${branchLoad.fromCache ? " (warm cache)" : " (loaded map)"}`
|
|
391
|
+
)
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
if (runtime.socketPath && graph && branchLoad.gitRef && branchLoad.gitRef !== "unknown") {
|
|
395
|
+
void vgdRequest(
|
|
396
|
+
{
|
|
397
|
+
op: "put-graph",
|
|
398
|
+
repositoryId: branchLoad.repositoryId,
|
|
399
|
+
gitRef: branchLoad.gitRef,
|
|
400
|
+
graph
|
|
401
|
+
},
|
|
402
|
+
{ socketPath: runtime.socketPath }
|
|
403
|
+
).catch(() => {
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
const graphBackend = resolveGraphBackend({
|
|
407
|
+
graph,
|
|
408
|
+
repositoryId: branchLoad.repositoryId,
|
|
409
|
+
gitRef: branchLoad.gitRef !== "unknown" ? branchLoad.gitRef : null,
|
|
410
|
+
socketPath: runtime.socketPath
|
|
411
|
+
});
|
|
412
|
+
modelProfile = mergeModelExecutionProfile(
|
|
413
|
+
resolveModelExecutionProfile({
|
|
414
|
+
providerId: sel.providerSlug,
|
|
415
|
+
model: sel.model,
|
|
416
|
+
budget: opts.budget ? Number(opts.budget) : void 0,
|
|
417
|
+
maxRepairRounds: opts.verify?.maxRounds,
|
|
418
|
+
securityTier
|
|
419
|
+
}),
|
|
420
|
+
opts.modelProfile
|
|
421
|
+
);
|
|
507
422
|
const result = await agentTask({
|
|
508
423
|
root,
|
|
509
424
|
graph,
|
|
@@ -513,15 +428,21 @@ async function codingRepl(root, global, opts, selection, prompter) {
|
|
|
513
428
|
attribution: { client: "vg-code", provider: sel.providerSlug, model: sel.model },
|
|
514
429
|
auto: !!opts.auto,
|
|
515
430
|
maxSteps: opts.maxSteps,
|
|
431
|
+
budget: modelProfile.capsuleBudgetTokens,
|
|
516
432
|
denyCommands: opts.denyCommands,
|
|
517
433
|
testCommand: opts.testCommand,
|
|
518
434
|
contextBudget: opts.contextBudget,
|
|
519
435
|
stream: opts.stream,
|
|
520
|
-
verify: opts.verify,
|
|
436
|
+
verify: opts.verify ? { ...opts.verify, maxRounds: opts.verify.maxRounds ?? modelProfile.maxRepairRounds } : void 0,
|
|
521
437
|
priorSummary,
|
|
522
438
|
externalTools: mcp ? mcpExternalTools(mcp, agentApprove(opts, prompter)) : void 0,
|
|
523
439
|
meter,
|
|
524
|
-
prompter
|
|
440
|
+
prompter,
|
|
441
|
+
capsule: opts.capsule,
|
|
442
|
+
executionEnv,
|
|
443
|
+
graphBackend,
|
|
444
|
+
modelProfile,
|
|
445
|
+
extraPinnedFacts
|
|
525
446
|
});
|
|
526
447
|
priorSummary = void 0;
|
|
527
448
|
if (result.changes.length) {
|
|
@@ -541,6 +462,12 @@ function agentApprove(opts, prompter) {
|
|
|
541
462
|
return async (action) => {
|
|
542
463
|
if (opts.auto) return true;
|
|
543
464
|
if (action.kind === "tool") return prompter.confirm(`Call ${action.name}?`, false);
|
|
465
|
+
if (action.kind === "patch") {
|
|
466
|
+
const n = action.files.length;
|
|
467
|
+
const names = action.files.slice(0, 6).map((f) => f.file).join(", ");
|
|
468
|
+
const more = n > 6 ? ` (+${n - 6} more)` : "";
|
|
469
|
+
return prompter.confirm(`Apply patch to ${n} file(s): ${names}${more}?`, false);
|
|
470
|
+
}
|
|
544
471
|
return true;
|
|
545
472
|
};
|
|
546
473
|
}
|
|
@@ -597,6 +524,16 @@ async function agentTask(params) {
|
|
|
597
524
|
return prompter.confirm(`Run \`${action.command}\`?`, false);
|
|
598
525
|
case "tool":
|
|
599
526
|
return prompter.confirm(`Call ${action.name}(${briefArgs(action.args)})?`, false);
|
|
527
|
+
case "patch": {
|
|
528
|
+
const n = action.files.length;
|
|
529
|
+
for (const f of action.files) {
|
|
530
|
+
if (f.diff) out(f.diff);
|
|
531
|
+
else out(`${f.op} ${f.file}`);
|
|
532
|
+
}
|
|
533
|
+
const names = action.files.slice(0, 6).map((f) => f.file).join(", ");
|
|
534
|
+
const more = n > 6 ? ` (+${n - 6} more)` : "";
|
|
535
|
+
return prompter.confirm(`Apply patch to ${n} file(s): ${names}${more}?`, false);
|
|
536
|
+
}
|
|
600
537
|
}
|
|
601
538
|
};
|
|
602
539
|
let streaming = false;
|
|
@@ -623,6 +560,20 @@ async function agentTask(params) {
|
|
|
623
560
|
info(c.dim(` \xB7 compacted context (${e.droppedRounds} earlier round(s) summarized)`));
|
|
624
561
|
} else if (e.type === "verify") {
|
|
625
562
|
info(e.passed ? c.green(` \u2714 ${e.command} passed`) : c.yellow(` \u2717 ${e.command} failed \u2014 asking the model to fix it`));
|
|
563
|
+
} else if (e.type === "ladder") {
|
|
564
|
+
info(e.ok ? c.green(" \u2714 verification ladder passed") : c.yellow(" \u2717 verification ladder failed \u2014 asking the model to fix it"));
|
|
565
|
+
if (!e.ok && e.summary.trim()) {
|
|
566
|
+
for (const line of e.summary.split("\n").slice(0, 6)) info(c.dim(` ${line}`));
|
|
567
|
+
}
|
|
568
|
+
} else if (e.type === "session-graph") {
|
|
569
|
+
info(c.dim(` \xB7 session graph updated (${e.reparsed} reparsed, ${e.dirty} dirty)`));
|
|
570
|
+
} else if (e.type === "capsule") {
|
|
571
|
+
info(c.dim(` \xB7 Task Capsule \xB7 ${e.summary.primary.length} primary \xB7 ${e.summary.sourceSliceCount} source slice(s) \xB7 ~${e.summary.tokensEstimate} tokens`));
|
|
572
|
+
} else if (e.type === "failure-capsule") {
|
|
573
|
+
info(c.yellow(` \xB7 Failure Capsule \xB7 ${e.capsule.failedStep.type}${e.capsule.failedStep.command ? ` \xB7 ${e.capsule.failedStep.command}` : ""}`));
|
|
574
|
+
} else if (e.type === "metrics") {
|
|
575
|
+
const m = e.metrics;
|
|
576
|
+
info(c.dim(` \xB7 metrics \xB7 discovery ${m.discoveryToolCalls} \xB7 mutations ${m.mutationToolCalls}${m.znsAt1 ? " \xB7 ZNS@1" : ""}`));
|
|
626
577
|
}
|
|
627
578
|
};
|
|
628
579
|
const result = await runAgent({
|
|
@@ -632,6 +583,13 @@ async function agentTask(params) {
|
|
|
632
583
|
providers: params.providers,
|
|
633
584
|
fsImpl: params.fsImpl,
|
|
634
585
|
run: shellRunner(params.root),
|
|
586
|
+
executionEnv: params.executionEnv,
|
|
587
|
+
graphBackend: params.graphBackend,
|
|
588
|
+
modelProfile: params.modelProfile,
|
|
589
|
+
advancedMode: params.advancedMode,
|
|
590
|
+
// Interactive sessions always prefer a worktree-correct map unless disabled.
|
|
591
|
+
worktreeOverlay: params.worktreeOverlay ?? true,
|
|
592
|
+
extraPinnedFacts: params.extraPinnedFacts,
|
|
635
593
|
approve,
|
|
636
594
|
onEvent,
|
|
637
595
|
attribution: params.attribution,
|
|
@@ -645,6 +603,8 @@ async function agentTask(params) {
|
|
|
645
603
|
verify: params.verify,
|
|
646
604
|
priorSummary: params.priorSummary,
|
|
647
605
|
externalTools: params.externalTools,
|
|
606
|
+
capsule: params.capsule,
|
|
607
|
+
files: params.files,
|
|
648
608
|
now: () => Date.now()
|
|
649
609
|
});
|
|
650
610
|
closeStream();
|
|
@@ -677,5 +637,5 @@ ${res.stderr}` : "");
|
|
|
677
637
|
}
|
|
678
638
|
|
|
679
639
|
export { agentTask, runInteractive };
|
|
680
|
-
//# sourceMappingURL=interactive-
|
|
681
|
-
//# sourceMappingURL=interactive-
|
|
640
|
+
//# sourceMappingURL=interactive-372NLI5C.js.map
|
|
641
|
+
//# sourceMappingURL=interactive-372NLI5C.js.map
|