@vibgrate/cli 2026.803.1 → 2026.803.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{agent-HNV2VUCO.js → agent-JTA4YWMQ.js} +10 -10
  2. package/dist/{agent-HNV2VUCO.js.map → agent-JTA4YWMQ.js.map} +1 -1
  3. package/dist/{baseline-6WTULHM5.js → baseline-2V7PKA7Q.js} +3 -3
  4. package/dist/{baseline-6WTULHM5.js.map → baseline-2V7PKA7Q.js.map} +1 -1
  5. package/dist/{chunk-N4IDP2M2.js → chunk-3Q3ZXJZP.js} +4 -4
  6. package/dist/{chunk-N4IDP2M2.js.map → chunk-3Q3ZXJZP.js.map} +1 -1
  7. package/dist/{chunk-CE45STY5.js → chunk-4ACXDVON.js} +4 -4
  8. package/dist/{chunk-CE45STY5.js.map → chunk-4ACXDVON.js.map} +1 -1
  9. package/dist/{chunk-6I4TXAI6.js → chunk-6DFV4WCQ.js} +3 -3
  10. package/dist/{chunk-6I4TXAI6.js.map → chunk-6DFV4WCQ.js.map} +1 -1
  11. package/dist/chunk-7KNFG44U.js +6 -0
  12. package/dist/{chunk-QT2PMGN3.js.map → chunk-7KNFG44U.js.map} +1 -1
  13. package/dist/{chunk-DIU3MXB3.js → chunk-CPLG4GFB.js} +4 -4
  14. package/dist/{chunk-DIU3MXB3.js.map → chunk-CPLG4GFB.js.map} +1 -1
  15. package/dist/{chunk-5VH3Y4QC.js → chunk-HC44772H.js} +77 -12
  16. package/dist/chunk-HC44772H.js.map +1 -0
  17. package/dist/{chunk-Y7YKUZ3T.js → chunk-K6Q6HTFD.js} +30 -10
  18. package/dist/chunk-K6Q6HTFD.js.map +1 -0
  19. package/dist/{chunk-O7MTBC52.js → chunk-KYX2YCXT.js} +8 -8
  20. package/dist/{chunk-O7MTBC52.js.map → chunk-KYX2YCXT.js.map} +1 -1
  21. package/dist/{chunk-B2KLJPFY.js → chunk-L5PUNO3T.js} +4 -4
  22. package/dist/{chunk-B2KLJPFY.js.map → chunk-L5PUNO3T.js.map} +1 -1
  23. package/dist/{chunk-SNKTD23L.js → chunk-M452MRWI.js} +6 -6
  24. package/dist/{chunk-SNKTD23L.js.map → chunk-M452MRWI.js.map} +1 -1
  25. package/dist/{chunk-CC6F75GI.js → chunk-M7773OUN.js} +4 -4
  26. package/dist/{chunk-CC6F75GI.js.map → chunk-M7773OUN.js.map} +1 -1
  27. package/dist/{chunk-2TLQDF6C.js → chunk-NSWEJPLV.js} +9 -9
  28. package/dist/{chunk-2TLQDF6C.js.map → chunk-NSWEJPLV.js.map} +1 -1
  29. package/dist/{chunk-4HFSUIIN.js → chunk-NUZM7UOR.js} +4 -4
  30. package/dist/{chunk-4HFSUIIN.js.map → chunk-NUZM7UOR.js.map} +1 -1
  31. package/dist/{chunk-BBFQZ7CA.js → chunk-PXM3VZYR.js} +4 -4
  32. package/dist/{chunk-BBFQZ7CA.js.map → chunk-PXM3VZYR.js.map} +1 -1
  33. package/dist/{chunk-AJ2KE3NT.js → chunk-QMME6TB4.js} +14 -3
  34. package/dist/chunk-QMME6TB4.js.map +1 -0
  35. package/dist/{chunk-JUSXLCSE.js → chunk-TM5XQY3L.js} +3 -3
  36. package/dist/{chunk-JUSXLCSE.js.map → chunk-TM5XQY3L.js.map} +1 -1
  37. package/dist/{chunk-FKFRASAB.js → chunk-TNADGCOX.js} +8 -8
  38. package/dist/{chunk-FKFRASAB.js.map → chunk-TNADGCOX.js.map} +1 -1
  39. package/dist/{chunk-S4NSF5AZ.js → chunk-UXR7FBE3.js} +6 -6
  40. package/dist/{chunk-S4NSF5AZ.js.map → chunk-UXR7FBE3.js.map} +1 -1
  41. package/dist/{chunk-536J6HUR.js → chunk-WGPS3NZQ.js} +13 -8
  42. package/dist/chunk-WGPS3NZQ.js.map +1 -0
  43. package/dist/{chunk-BWMMR5XA.js → chunk-XK5LKOBF.js} +4 -4
  44. package/dist/{chunk-BWMMR5XA.js.map → chunk-XK5LKOBF.js.map} +1 -1
  45. package/dist/cli.js +105 -53
  46. package/dist/cli.js.map +1 -1
  47. package/dist/{ensure-map-5YEI7R7V.js → ensure-map-TAVYMPEG.js} +12 -12
  48. package/dist/{ensure-map-5YEI7R7V.js.map → ensure-map-TAVYMPEG.js.map} +1 -1
  49. package/dist/{graph-backend-CPHLUKUC.js → graph-backend-WF4LGBGD.js} +5 -5
  50. package/dist/{graph-backend-CPHLUKUC.js.map → graph-backend-WF4LGBGD.js.map} +1 -1
  51. package/dist/index.d.ts +27 -2
  52. package/dist/index.js +11 -11
  53. package/dist/{interactive-TNRE4OEK.js → interactive-6PN237LX.js} +25 -21
  54. package/dist/interactive-6PN237LX.js.map +1 -0
  55. package/dist/load-T2FOJUPI.js +10 -0
  56. package/dist/{load-MWG6WZTK.js.map → load-T2FOJUPI.js.map} +1 -1
  57. package/dist/{run-outcome-375HMSQG.js → run-outcome-AMIKAASL.js} +6 -6
  58. package/dist/{run-outcome-375HMSQG.js.map → run-outcome-AMIKAASL.js.map} +1 -1
  59. package/dist/runtime-session-QAVOPSSH.js +20 -0
  60. package/dist/{runtime-session-3MPWXNRL.js.map → runtime-session-QAVOPSSH.js.map} +1 -1
  61. package/dist/{session-2NGJLI5Y.js → session-SCHQQTHN.js} +8 -8
  62. package/dist/{session-2NGJLI5Y.js.map → session-SCHQQTHN.js.map} +1 -1
  63. package/dist/{stream-json-AUMU3NLV.js → stream-json-A6K2MONY.js} +10 -10
  64. package/dist/{stream-json-AUMU3NLV.js.map → stream-json-A6K2MONY.js.map} +1 -1
  65. package/dist/{vg-mcp-bridge-D463EHQI.js → vg-mcp-bridge-3TSFOL4V.js} +8 -8
  66. package/dist/{vg-mcp-bridge-D463EHQI.js.map → vg-mcp-bridge-3TSFOL4V.js.map} +1 -1
  67. package/dist/{vgd-Z23PXSP4.js → vgd-B67JCNJP.js} +8 -8
  68. package/dist/vgd-B67JCNJP.js.map +1 -0
  69. package/package.json +1 -1
  70. package/dist/chunk-536J6HUR.js.map +0 -1
  71. package/dist/chunk-5VH3Y4QC.js.map +0 -1
  72. package/dist/chunk-AJ2KE3NT.js.map +0 -1
  73. package/dist/chunk-QT2PMGN3.js +0 -6
  74. package/dist/chunk-Y7YKUZ3T.js.map +0 -1
  75. package/dist/interactive-TNRE4OEK.js.map +0 -1
  76. package/dist/load-MWG6WZTK.js +0 -10
  77. package/dist/runtime-session-3MPWXNRL.js +0 -20
  78. package/dist/vgd-Z23PXSP4.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { probeFreshness, hasDrift, buildGraph, writeSnapshot } from './chunk-FKFRASAB.js';
2
- import { acquireLock, releaseLock } from './chunk-5VH3Y4QC.js';
3
- import { vibgrateDir, writeArtifacts } from './chunk-N4IDP2M2.js';
4
- import { cacheDir } from './chunk-AJ2KE3NT.js';
1
+ import { probeFreshness, hasDrift, buildGraph, writeSnapshot } from './chunk-TNADGCOX.js';
2
+ import { acquireLock, releaseLock } from './chunk-HC44772H.js';
3
+ import { vibgrateDir, writeArtifacts } from './chunk-3Q3ZXJZP.js';
4
+ import { cacheDir } from './chunk-QMME6TB4.js';
5
5
  import * as fs from 'fs';
6
6
  import * as path from 'path';
7
7
 
@@ -61,5 +61,5 @@ async function refreshIfStale(root, opts = {}) {
61
61
  }
62
62
 
63
63
  export { refreshIfStale };
64
- //# sourceMappingURL=chunk-S4NSF5AZ.js.map
65
- //# sourceMappingURL=chunk-S4NSF5AZ.js.map
64
+ //# sourceMappingURL=chunk-UXR7FBE3.js.map
65
+ //# sourceMappingURL=chunk-UXR7FBE3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/engine/refresh.ts"],"names":[],"mappings":";;;;;;;AAsDA,IAAM,qBAAA,GAAwB,KAAK,EAAA,GAAK,GAAA;AAExC,SAAS,gBAAgB,IAAA,EAAsB;AAC7C,EAAA,OAAY,IAAA,CAAA,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA,EAAG,cAAc,CAAA;AACjD;AAMA,eAAsB,cAAA,CAAe,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A,QAC3B,IAAA;AAAA,QACA,WAAW,IAAA,CAAK,SAAA;AAAA,QAChB,MAAA,EAAW,EAAA,CAAA,UAAA,CAAgB,IAAA,CAAA,IAAA,CAAK,GAAA,EAAK,iBAAiB,CAAC,CAAA;AAAA,QACvD,IAAA,EAAS,EAAA,CAAA,UAAA,CAAgB,IAAA,CAAA,IAAA,CAAK,GAAA,EAAK,YAAY,CAAC;AAAA,OACjD,CAAA;AAAA,IACH;AACA,IAAA,aAAA,CAAc,MAAM,MAAA,CAAO,KAAA,CAAM,WAAW,UAAA,EAAY,MAAA,CAAO,WAAW,KAAK,CAAA;AAE/E,IAAA,MAAM,KAAK,MAAA,CAAA,CAAQ,OAAA,CAAQ,OAAO,MAAA,EAAO,GAAI,SAAS,QAAQ,CAAA;AAC9D,IAAA,OAAO;AAAA,MACL,MAAA,EAAQ,WAAA;AAAA,MACR,OAAO,KAAA,CAAM,KAAA;AAAA,MACb,EAAA;AAAA,MACA,UAAU,MAAA,CAAO,QAAA;AAAA,MACjB,YAAY,MAAA,CAAO,UAAA;AAAA,MACnB;AAAA,KACF;AAAA,EACF,SAAS,GAAA,EAAK;AACZ,IAAA,OAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,OAAA,EAAU,IAAc,OAAA,EAAQ;AAAA,EAC5D,CAAA,SAAE;AACA,IAAA,WAAA,CAAY,IAAI,CAAA;AAAA,EAClB;AACF","file":"chunk-S4NSF5AZ.js","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { buildGraph } from './build.js';\nimport { probeFreshness, writeSnapshot, hasDrift, type Drift } from './freshness.js';\nimport { writeArtifacts, vibgrateDir } from './artifacts.js';\nimport { acquireLock, releaseLock } from './lock.js';\nimport { cacheDir } from './cache.js';\nimport type { ClusterMode } from './analyze.js';\n\n/**\n * Auto-refresh: bring the code map back in sync with the working tree when the\n * freshness probe says it drifted. The rebuild is the ordinary incremental\n * `buildGraph` (warm parse cache → only changed files re-parse), replaying the\n * scope recorded at the last explicit build, guarded by a cross-process lock\n * so a serving MCP process and a foreground command never write at once.\n *\n * Two properties keep this safe to run implicitly:\n * - **No git churn**: if the rebuilt corpusHash equals the snapshot's (e.g. a\n * drift that reverted itself), `graph.json` is left untouched — the artifact\n * stays byte-identical.\n * - **No surprise artifacts**: `GRAPH_REPORT.md`/`graph.html` are rewritten\n * only if they already exist; a refresh never adds files a user's explicit\n * build chose not to produce.\n */\n\nexport interface RefreshOptions {\n /** Force single-threaded parsing (tests / constrained hosts). */\n inline?: boolean;\n /** Worker count for the parse pool. */\n jobs?: number;\n /**\n * The map path already resolved by the caller (e.g. `vg serve`'s startup\n * resolution). Passed straight through to `writeArtifacts` so a refresh\n * never re-resolves it: `defaultGraphPath` shells out to `git rev-parse`\n * (Fusion §4.1.1 branch keying), and re-running that on every drift-driven\n * refresh put a synchronous git spawn back on the hot tool-call path this\n * function exists to keep off of. Omit only when no caller-known path\n * exists (falls back to a fresh `defaultGraphPath` resolution).\n */\n graphPath?: string;\n}\n\nexport type RefreshOutcome =\n /** Map already matches the working tree. */\n | { status: 'fresh' }\n /** No freshness snapshot — no build ever ran here, so scope is unknown. */\n | { status: 'no-snapshot' }\n /** Another vg process is rebuilding right now; its write will land shortly. */\n | { status: 'locked' }\n /** Rebuilt. `wrote` is false when the corpus turned out unchanged. */\n | { status: 'refreshed'; drift: Drift; ms: number; reparsed: number; totalFiles: number; wrote: boolean }\n | { status: 'error'; message: string };\n\n/** A refresh stuck longer than this is presumed crashed and its lock reclaimed. */\nconst REFRESH_LOCK_STALE_MS = 10 * 60 * 1000;\n\nfunction refreshLockPath(root: string): string {\n return path.join(cacheDir(root), 'refresh.lock');\n}\n\n/**\n * Probe, and rebuild incrementally if the tree drifted from the map.\n * Silent (no output) — callers own the messaging for their surface.\n */\nexport async function refreshIfStale(root: string, opts: RefreshOptions = {}): Promise<RefreshOutcome> {\n const probe = probeFreshness(root);\n if (!probe) return { status: 'no-snapshot' };\n if (!hasDrift(probe.drift)) return { status: 'fresh' };\n\n const lock = refreshLockPath(root);\n if (!acquireLock(lock, REFRESH_LOCK_STALE_MS)) return { status: 'locked' };\n\n const start = process.hrtime.bigint();\n try {\n const { scope } = probe;\n const result = await buildGraph({\n root,\n only: scope.only,\n exclude: scope.exclude,\n paths: scope.paths,\n deep: scope.deep,\n noGround: scope.noGround,\n scip: scope.scip,\n noScip: scope.noScip,\n noTsc: scope.noTsc,\n cluster: scope.cluster as ClusterMode | undefined,\n grammarsDir: scope.grammarsDir,\n inline: opts.inline,\n jobs: opts.jobs,\n });\n\n const wrote = result.graph.provenance.corpusHash !== probe.corpusHash;\n if (wrote) {\n const dir = vibgrateDir(root);\n writeArtifacts(result.graph, {\n root,\n graphPath: opts.graphPath,\n report: fs.existsSync(path.join(dir, 'GRAPH_REPORT.md')),\n html: fs.existsSync(path.join(dir, 'graph.html')),\n });\n }\n writeSnapshot(root, result.graph.provenance.corpusHash, result.fileStats, scope);\n\n const ms = Number((process.hrtime.bigint() - start) / 1000000n);\n return {\n status: 'refreshed',\n drift: probe.drift,\n ms,\n reparsed: result.reparsed,\n totalFiles: result.totalFiles,\n wrote,\n };\n } catch (err) {\n return { status: 'error', message: (err as Error).message };\n } finally {\n releaseLock(lock);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/engine/refresh.ts"],"names":[],"mappings":";;;;;;;AAsDA,IAAM,qBAAA,GAAwB,KAAK,EAAA,GAAK,GAAA;AAExC,SAAS,gBAAgB,IAAA,EAAsB;AAC7C,EAAA,OAAY,IAAA,CAAA,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA,EAAG,cAAc,CAAA;AACjD;AAMA,eAAsB,cAAA,CAAe,IAAA,EAAc,IAAA,GAAuB,EAAC,EAA4B;AACrG,EAAA,MAAM,KAAA,GAAQ,eAAe,IAAI,CAAA;AACjC,EAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAE,QAAQ,aAAA,EAAc;AAC3C,EAAA,IAAI,CAAC,SAAS,KAAA,CAAM,KAAK,GA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AAA,CAAA,IAAA,CAAK,GAAA,EAAK,YAAY,CAAC;AAAA,OACjD,CAAA;AAAA,IACH;AACA,IAAA,aAAA,CAAc,MAAM,MAAA,CAAO,KAAA,CAAM,WAAW,UAAA,EAAY,MAAA,CAAO,WAAW,KAAK,CAAA;AAE/E,IAAA,MAAM,KAAK,MAAA,CAAA,CAAQ,OAAA,CAAQ,OAAO,MAAA,EAAO,GAAI,SAAS,QAAQ,CAAA;AAC9D,IAAA,OAAO;AAAA,MACL,MAAA,EAAQ,WAAA;AAAA,MACR,OAAO,KAAA,CAAM,KAAA;AAAA,MACb,EAAA;AAAA,MACA,UAAU,MAAA,CAAO,QAAA;AAAA,MACjB,YAAY,MAAA,CAAO,UAAA;AAAA,MACnB;AAAA,KACF;AAAA,EACF,SAAS,GAAA,EAAK;AACZ,IAAA,OAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,OAAA,EAAU,IAAc,OAAA,EAAQ;AAAA,EAC5D,CAAA,SAAE;AACA,IAAA,WAAA,CAAY,IAAI,CAAA;AAAA,EAClB;AACF","file":"chunk-UXR7FBE3.js","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { buildGraph } from './build.js';\nimport { probeFreshness, writeSnapshot, hasDrift, type Drift } from './freshness.js';\nimport { writeArtifacts, vibgrateDir } from './artifacts.js';\nimport { acquireLock, releaseLock } from './lock.js';\nimport { cacheDir } from './cache.js';\nimport type { ClusterMode } from './analyze.js';\n\n/**\n * Auto-refresh: bring the code map back in sync with the working tree when the\n * freshness probe says it drifted. The rebuild is the ordinary incremental\n * `buildGraph` (warm parse cache → only changed files re-parse), replaying the\n * scope recorded at the last explicit build, guarded by a cross-process lock\n * so a serving MCP process and a foreground command never write at once.\n *\n * Two properties keep this safe to run implicitly:\n * - **No git churn**: if the rebuilt corpusHash equals the snapshot's (e.g. a\n * drift that reverted itself), `graph.json` is left untouched — the artifact\n * stays byte-identical.\n * - **No surprise artifacts**: `GRAPH_REPORT.md`/`graph.html` are rewritten\n * only if they already exist; a refresh never adds files a user's explicit\n * build chose not to produce.\n */\n\nexport interface RefreshOptions {\n /** Force single-threaded parsing (tests / constrained hosts). */\n inline?: boolean;\n /** Worker count for the parse pool. */\n jobs?: number;\n /**\n * The map path already resolved by the caller (e.g. `vg serve`'s startup\n * resolution). Passed straight through to `writeArtifacts` so a refresh\n * never re-resolves it: `defaultGraphPath` shells out to `git rev-parse`\n * (Fusion §4.1.1 branch keying), and re-running that on every drift-driven\n * refresh put a synchronous git spawn back on the hot tool-call path this\n * function exists to keep off of. Omit only when no caller-known path\n * exists (falls back to a fresh `defaultGraphPath` resolution).\n */\n graphPath?: string;\n}\n\nexport type RefreshOutcome =\n /** Map already matches the working tree. */\n | { status: 'fresh' }\n /** No freshness snapshot — no build ever ran here, so scope is unknown. */\n | { status: 'no-snapshot' }\n /** Another vg process is rebuilding right now; its write will land shortly. */\n | { status: 'locked' }\n /** Rebuilt. `wrote` is false when the corpus turned out unchanged. */\n | { status: 'refreshed'; drift: Drift; ms: number; reparsed: number; totalFiles: number; wrote: boolean }\n | { status: 'error'; message: string };\n\n/** A refresh stuck longer than this is presumed crashed and its lock reclaimed. */\nconst REFRESH_LOCK_STALE_MS = 10 * 60 * 1000;\n\nfunction refreshLockPath(root: string): string {\n return path.join(cacheDir(root), 'refresh.lock');\n}\n\n/**\n * Probe, and rebuild incrementally if the tree drifted from the map.\n * Silent (no output) — callers own the messaging for their surface.\n */\nexport async function refreshIfStale(root: string, opts: RefreshOptions = {}): Promise<RefreshOutcome> {\n const probe = probeFreshness(root);\n if (!probe) return { status: 'no-snapshot' };\n if (!hasDrift(probe.drift)) return { status: 'fresh' };\n\n const lock = refreshLockPath(root);\n if (!acquireLock(lock, REFRESH_LOCK_STALE_MS)) return { status: 'locked' };\n\n const start = process.hrtime.bigint();\n try {\n const { scope } = probe;\n const result = await buildGraph({\n root,\n only: scope.only,\n exclude: scope.exclude,\n paths: scope.paths,\n deep: scope.deep,\n noGround: scope.noGround,\n scip: scope.scip,\n noScip: scope.noScip,\n noTsc: scope.noTsc,\n cluster: scope.cluster as ClusterMode | undefined,\n grammarsDir: scope.grammarsDir,\n inline: opts.inline,\n jobs: opts.jobs,\n });\n\n const wrote = result.graph.provenance.corpusHash !== probe.corpusHash;\n if (wrote) {\n const dir = vibgrateDir(root);\n writeArtifacts(result.graph, {\n root,\n graphPath: opts.graphPath,\n report: fs.existsSync(path.join(dir, 'GRAPH_REPORT.md')),\n html: fs.existsSync(path.join(dir, 'graph.html')),\n });\n }\n writeSnapshot(root, result.graph.provenance.corpusHash, result.fileStats, scope);\n\n const ms = Number((process.hrtime.bigint() - start) / 1000000n);\n return {\n status: 'refreshed',\n drift: probe.drift,\n ms,\n reparsed: result.reparsed,\n totalFiles: result.totalFiles,\n wrote,\n };\n } catch (err) {\n return { status: 'error', message: (err as Error).message };\n } finally {\n releaseLock(lock);\n }\n}\n"]}
@@ -1,14 +1,14 @@
1
1
  import { secretEgressRefusal, isSecretPath, secretRefusal, redactText } from './chunk-543E6WDJ.js';
2
2
  import { buildAgentMessages, redactSecrets, unifiedDiff, applyEdit } from './chunk-SJFBXCII.js';
3
- import { localGraphBackend } from './chunk-JUSXLCSE.js';
3
+ import { localGraphBackend } from './chunk-TM5XQY3L.js';
4
4
  import { buildIdentifierTrieFromGraph, KvBlockRegistry, graphDraftCandidates, extractIdentifiers, scanIdentifiersAgainstTrie } from './chunk-5HYCB55P.js';
5
- import { summarizeCapsule, CAPSULE_RANKING_VERSION, buildCodeContext, buildTaskCapsule, capsuleToCodeContext, recordCliCall, CLI_TOOL_ALIASES } from './chunk-Y7YKUZ3T.js';
5
+ import { summarizeCapsule, CAPSULE_RANKING_VERSION, buildCodeContext, buildTaskCapsule, capsuleToCodeContext, recordCliCall, CLI_TOOL_ALIASES } from './chunk-K6Q6HTFD.js';
6
6
  import { resolve } from './chunk-VIWZ4QT7.js';
7
- import { searchSymbols, resolveLib, loadCatalog, readDoc, localPackageDocs, resolveVersion } from './chunk-BWMMR5XA.js';
7
+ import { searchSymbols, resolveLib, loadCatalog, readDoc, localPackageDocs, resolveVersion } from './chunk-XK5LKOBF.js';
8
8
  import { resolveOne } from './chunk-J7LKEB2R.js';
9
- import { isLocateOnlyInstruction, extractLiteralNeedles, impactOf } from './chunk-5VH3Y4QC.js';
9
+ import { isLocateOnlyInstruction, extractLiteralNeedles, impactOf } from './chunk-HC44772H.js';
10
10
  import { parseSource, langForExtension } from './chunk-UTNNGKKX.js';
11
- import { analyzeQuestion, loadTopicTags } from './chunk-N4IDP2M2.js';
11
+ import { analyzeQuestion, loadTopicTags } from './chunk-3Q3ZXJZP.js';
12
12
  import { repositoryIdFromRoot } from './chunk-BWPBB45M.js';
13
13
  import { hashString, canonicalize } from './chunk-JFGYT6BI.js';
14
14
  import { spawnSync } from 'child_process';
@@ -2307,6 +2307,7 @@ async function runAgent(options) {
2307
2307
  files: options.files,
2308
2308
  relevance,
2309
2309
  topicTags,
2310
+ priorInstruction: options.priorInstruction,
2310
2311
  readFile: (rel) => fsImpl.read(rel),
2311
2312
  repositoryId: repositoryIdFromRoot(root),
2312
2313
  provenance: {
@@ -2734,13 +2735,17 @@ function buildAgentContext(graph, instruction, options) {
2734
2735
  const relevance = options.relevance;
2735
2736
  const topicTags = options.topicTags;
2736
2737
  if (!options.capsule) {
2737
- return { context: buildCodeContext(graph, instruction, { budget, files, relevance, topicTags }), capsule: null };
2738
+ return {
2739
+ context: buildCodeContext(graph, instruction, { budget, files, relevance, topicTags, priorInstruction: options.priorInstruction }),
2740
+ capsule: null
2741
+ };
2738
2742
  }
2739
2743
  const capsule = buildTaskCapsule(graph, instruction, {
2740
2744
  budget,
2741
2745
  files,
2742
2746
  relevance,
2743
2747
  topicTags,
2748
+ priorInstruction: options.priorInstruction,
2744
2749
  readFile: (rel) => options.fsImpl.read(rel),
2745
2750
  repositoryId: repositoryIdFromRoot(options.root),
2746
2751
  extraPinnedFacts: options.extraPinnedFacts,
@@ -2832,5 +2837,5 @@ function buildSpanIndex(graph) {
2832
2837
  }
2833
2838
 
2834
2839
  export { CONTEXT_POLICY_VERSION, DISCOVERY_TOOLS, MUTATION_TOOLS, compact, compactWithModel, computeFcsReport, createTrajectoryCollector, lookupModelCapabilities, renderFcsReportMarkdown, runAgent };
2835
- //# sourceMappingURL=chunk-536J6HUR.js.map
2836
- //# sourceMappingURL=chunk-536J6HUR.js.map
2840
+ //# sourceMappingURL=chunk-WGPS3NZQ.js.map
2841
+ //# sourceMappingURL=chunk-WGPS3NZQ.js.map