opencode-swarm 7.135.5 → 7.136.0

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 (47) hide show
  1. package/dist/cli/{config-doctor-exj26ryt.js → config-doctor-q0krbxwv.js} +2 -2
  2. package/dist/cli/{curation-policy-mbv3b27c.js → curation-policy-v6ywe8qd.js} +2 -2
  3. package/dist/cli/{curator-llm-factory-4d5pzh47.js → curator-llm-factory-mhwje8rf.js} +12 -12
  4. package/dist/cli/{curator-7ycd6x29.js → curator-tqedvpy1.js} +12 -12
  5. package/dist/cli/{guardrail-explain-2jrqv2zf.js → guardrail-explain-m0m74hvr.js} +13 -13
  6. package/dist/cli/{guardrail-log-c843gxnm.js → guardrail-log-5g8x6qc6.js} +3 -3
  7. package/dist/cli/{hive-promoter-epnj14q8.js → hive-promoter-s804newd.js} +12 -12
  8. package/dist/cli/{index-0csbx1wc.js → index-1kjg590p.js} +1 -1
  9. package/dist/cli/{index-qyn0b2jj.js → index-2cv1j3rf.js} +1 -1
  10. package/dist/cli/{index-09w3ezq2.js → index-2w4tsmva.js} +1 -1
  11. package/dist/cli/{index-9s5b8wrs.js → index-81dkzncr.js} +35 -35
  12. package/dist/cli/{index-bx10dq60.js → index-9bk16zkv.js} +1 -1
  13. package/dist/cli/{index-kjg6vgqs.js → index-bbejqagj.js} +1 -1
  14. package/dist/cli/{index-8et4bx6j.js → index-bwfzq91q.js} +3 -3
  15. package/dist/cli/{index-db52969t.js → index-cfz5750k.js} +1 -1
  16. package/dist/cli/{index-kq9zb1cv.js → index-cxq1t7j1.js} +14 -14
  17. package/dist/cli/{index-ym516a9a.js → index-j08trvny.js} +5 -5
  18. package/dist/cli/{index-k8arazbb.js → index-m1hew17b.js} +7 -2
  19. package/dist/cli/{index-hw6yt4rs.js → index-n8j0cnp1.js} +4 -4
  20. package/dist/cli/{index-6yk6ezvj.js → index-nw9cn84t.js} +1 -1
  21. package/dist/cli/{index-gvfw2y6v.js → index-qh9466j3.js} +2 -2
  22. package/dist/cli/{index-jnemjn16.js → index-w58bmwyq.js} +2 -2
  23. package/dist/cli/{index-t1gszcwg.js → index-wpqypdge.js} +2 -2
  24. package/dist/cli/index.js +12 -12
  25. package/dist/cli/{knowledge-escalator-3tjhpwjf.js → knowledge-escalator-f1m2xp5x.js} +3 -3
  26. package/dist/cli/{knowledge-events-0akk3p15.js → knowledge-events-rksgem6f.js} +1 -1
  27. package/dist/cli/{knowledge-store-7nvfh2n3.js → knowledge-store-t6d6fr8b.js} +1 -1
  28. package/dist/cli/{knowledge-validator-z618vhda.js → knowledge-validator-5ggzb3j1.js} +4 -4
  29. package/dist/cli/{scan-cursor-5zqr3afj.js → scan-cursor-18fnwr58.js} +2 -2
  30. package/dist/cli/{schema-n1cj94m0.js → schema-jw15d8bt.js} +1 -1
  31. package/dist/cli/{skill-generator-560ksca8.js → skill-generator-3n5y902z.js} +5 -5
  32. package/dist/config/schema.d.ts +11 -1
  33. package/dist/hooks/repo-graph-builder.d.ts +17 -11
  34. package/dist/hooks/repo-graph-injection.d.ts +20 -9
  35. package/dist/hooks/semantic-diff-injection.d.ts +2 -2
  36. package/dist/index.js +138 -137
  37. package/dist/tools/repo-graph/builder.d.ts +55 -1
  38. package/dist/tools/repo-graph/cache.d.ts +12 -36
  39. package/dist/tools/repo-graph/freshness.d.ts +54 -0
  40. package/dist/tools/repo-graph/incremental.d.ts +17 -8
  41. package/dist/tools/repo-graph/query.d.ts +7 -1
  42. package/dist/tools/repo-graph/storage.d.ts +3 -1
  43. package/dist/tools/repo-graph/types.d.ts +31 -1
  44. package/dist/tools/repo-graph.d.ts +5 -3
  45. package/dist/tools/repo-map.d.ts +8 -0
  46. package/dist/utils/path-security.d.ts +22 -0
  47. package/package.json +1 -1
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-hw6yt4rs.js";
9
+ } from "./index-n8j0cnp1.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-bx10dq60.js";
15
+ } from "./index-9bk16zkv.js";
16
16
  import {
17
17
  init_knowledge_types,
18
18
  isActiveStatus
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
190
  alreadyInactive: true
191
191
  };
192
192
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-z618vhda.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-5ggzb3j1.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-n1cj94m0.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-jnemjn16.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-jw15d8bt.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-w58bmwyq.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {
@@ -21,7 +21,7 @@ var package_default;
21
21
  var init_package = __esm(() => {
22
22
  package_default = {
23
23
  name: "opencode-swarm",
24
- version: "7.135.5",
24
+ version: "7.136.0",
25
25
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
26
26
  main: "dist/index.js",
27
27
  types: "dist/index.d.ts",
@@ -777,6 +777,11 @@ var init_schema = __esm(() => {
777
777
  agent_profiles: exports_external.record(exports_external.string(), exports_external.string()).default({})
778
778
  });
779
779
  RepoGraphConfigSchema = exports_external.object({
780
+ enabled: exports_external.boolean().default(true),
781
+ init_refresh: exports_external.boolean().default(true),
782
+ refresh_cap: exports_external.number().int().min(0).max(500).default(50),
783
+ walk_budget_ms: exports_external.number().int().min(1000).max(60000).default(5000),
784
+ max_files: exports_external.number().int().min(100).max(1e5).default(1e4),
780
785
  exclude_dirs: exports_external.array(exports_external.string().trim().min(1)).default([])
781
786
  });
782
787
  FORBIDDEN_CHECKPOINT_CONFIG_KEYS = new Set([
@@ -1534,7 +1539,7 @@ var init_schema = __esm(() => {
1534
1539
  authority: AuthorityConfigSchema.optional(),
1535
1540
  plan_cursor: PlanCursorConfigSchema.optional(),
1536
1541
  context_map: ContextMapConfigSchema.optional(),
1537
- repo_graph: RepoGraphConfigSchema.optional(),
1542
+ repo_graph: RepoGraphConfigSchema.prefault({}),
1538
1543
  evidence: EvidenceConfigSchema.optional(),
1539
1544
  summaries: SummaryConfigSchema.optional(),
1540
1545
  review_passes: ReviewPassesConfigSchema.optional(),
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
702
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
703
  if (atFloor.length === 0 && recovered.length === 0)
704
704
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-0akk3p15.js");
705
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-rksgem6f.js");
706
706
  const rollups = await readKnowledgeCounterRollups(directory);
707
707
  const flagIds = new Set;
708
708
  for (const e of atFloor) {
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
769
  });
770
770
  }
771
771
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-z618vhda.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-n1cj94m0.js");
772
+ const { quarantineEntry } = await import("./knowledge-validator-5ggzb3j1.js");
773
+ const { KnowledgeConfigSchema } = await import("./schema-jw15d8bt.js");
774
774
  let config;
775
775
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-jnemjn16.js");
776
+ const { loadPluginConfigWithMeta } = await import("./index-w58bmwyq.js");
777
777
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
778
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
779
  } catch {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  init_schema,
4
4
  stripKnownSwarmPrefix
5
- } from "./index-k8arazbb.js";
5
+ } from "./index-m1hew17b.js";
6
6
  import {
7
7
  init_constants
8
8
  } from "./index-3jcyn8g6.js";
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-9s5b8wrs.js";
15
+ } from "./index-81dkzncr.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-6yk6ezvj.js";
22
+ } from "./index-nw9cn84t.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -7,7 +7,7 @@ import {
7
7
  loadPluginConfigWithMeta,
8
8
  loadPluginConfigWithMetaAsync,
9
9
  resolveWorktreeIsolationConfig
10
- } from "./index-kjg6vgqs.js";
10
+ } from "./index-bbejqagj.js";
11
11
  import {
12
12
  ApprovalEvidenceSchema,
13
13
  BaseEvidenceSchema,
@@ -54,7 +54,7 @@ import {
54
54
  TurboConfigSchema,
55
55
  WorktreeIsolationConfigSchema,
56
56
  resolveAutoReviewConfig
57
- } from "./index-k8arazbb.js";
57
+ } from "./index-m1hew17b.js";
58
58
  import"./index-bk5tah7q.js";
59
59
  import {
60
60
  MigrationStatusSchema,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-09w3ezq2.js";
4
+ } from "./index-2w4tsmva.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,7 +9,7 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-hw6yt4rs.js";
12
+ } from "./index-n8j0cnp1.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
15
  } from "./index-dzyjb33e.js";
package/dist/cli/index.js CHANGED
@@ -6,36 +6,36 @@ import {
6
6
  getPluginConfigDir,
7
7
  getPluginLockFilePaths,
8
8
  resolveCommand
9
- } from "./index-9s5b8wrs.js";
9
+ } from "./index-81dkzncr.js";
10
10
  import"./index-vm4xw9z3.js";
11
- import"./index-6yk6ezvj.js";
12
- import"./index-db52969t.js";
11
+ import"./index-nw9cn84t.js";
12
+ import"./index-cfz5750k.js";
13
13
  import"./index-cggqh2dz.js";
14
14
  import"./index-4905hd2m.js";
15
15
  import"./index-134d35c1.js";
16
- import"./index-8et4bx6j.js";
17
- import"./index-ym516a9a.js";
18
- import"./index-0csbx1wc.js";
16
+ import"./index-bwfzq91q.js";
17
+ import"./index-j08trvny.js";
18
+ import"./index-1kjg590p.js";
19
19
  import"./index-6mjf4vr1.js";
20
20
  import"./index-c8s9a3zh.js";
21
21
  import"./index-9ss2m4rs.js";
22
22
  import"./index-y6a7gjtj.js";
23
23
  import"./index-mrtms113.js";
24
- import"./index-t1gszcwg.js";
25
- import"./index-09w3ezq2.js";
24
+ import"./index-wpqypdge.js";
25
+ import"./index-2w4tsmva.js";
26
26
  import"./index-rtry5xyf.js";
27
- import"./index-hw6yt4rs.js";
28
- import"./index-bx10dq60.js";
27
+ import"./index-n8j0cnp1.js";
28
+ import"./index-9bk16zkv.js";
29
29
  import"./index-ae75rja9.js";
30
30
  import"./index-dzyjb33e.js";
31
31
  import"./index-ey29aap6.js";
32
- import"./index-kjg6vgqs.js";
32
+ import"./index-bbejqagj.js";
33
33
  import"./index-k5jrywpr.js";
34
34
  import"./index-n832052r.js";
35
35
  import {
36
36
  init_package,
37
37
  package_default
38
- } from "./index-k8arazbb.js";
38
+ } from "./index-m1hew17b.js";
39
39
  import"./index-bk5tah7q.js";
40
40
  import"./index-8fwhhayc.js";
41
41
  import"./index-q1exe2b3.js";
@@ -8,9 +8,9 @@ import {
8
8
  maybeEscalateOnViolation,
9
9
  maybeQuarantineOnContradiction,
10
10
  readRecentEscalations
11
- } from "./index-ym516a9a.js";
12
- import"./index-hw6yt4rs.js";
13
- import"./index-bx10dq60.js";
11
+ } from "./index-j08trvny.js";
12
+ import"./index-n8j0cnp1.js";
13
+ import"./index-9bk16zkv.js";
14
14
  import"./index-ae75rja9.js";
15
15
  import"./index-dzyjb33e.js";
16
16
  import"./index-ey29aap6.js";
@@ -28,7 +28,7 @@ import {
28
28
  resolveKnowledgeCounterBaselinePath,
29
29
  resolveKnowledgeEventsPath,
30
30
  resolveLegacyApplicationLogPath
31
- } from "./index-bx10dq60.js";
31
+ } from "./index-9bk16zkv.js";
32
32
  import"./index-ae75rja9.js";
33
33
  import"./index-dzyjb33e.js";
34
34
  import"./index-ey29aap6.js";
@@ -41,7 +41,7 @@ import {
41
41
  transactKnowledge,
42
42
  transactKnowledgeWithCas,
43
43
  wordBigrams
44
- } from "./index-hw6yt4rs.js";
44
+ } from "./index-n8j0cnp1.js";
45
45
  import {
46
46
  resolveHiveDataDir
47
47
  } from "./index-ae75rja9.js";
@@ -23,11 +23,11 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-t1gszcwg.js";
27
- import"./index-09w3ezq2.js";
26
+ } from "./index-wpqypdge.js";
27
+ import"./index-2w4tsmva.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-hw6yt4rs.js";
30
- import"./index-bx10dq60.js";
29
+ import"./index-n8j0cnp1.js";
30
+ import"./index-9bk16zkv.js";
31
31
  import"./index-ae75rja9.js";
32
32
  import"./index-dzyjb33e.js";
33
33
  import"./index-ey29aap6.js";
@@ -4,8 +4,8 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-0csbx1wc.js";
8
- import"./index-hw6yt4rs.js";
7
+ } from "./index-1kjg590p.js";
8
+ import"./index-n8j0cnp1.js";
9
9
  import"./index-ae75rja9.js";
10
10
  import"./index-dzyjb33e.js";
11
11
  import"./index-ey29aap6.js";
@@ -93,7 +93,7 @@ import {
93
93
  resolveGeneratedAgentRole,
94
94
  resolveGuardrailsConfig,
95
95
  stripKnownSwarmPrefix
96
- } from "./index-k8arazbb.js";
96
+ } from "./index-m1hew17b.js";
97
97
  import"./index-bk5tah7q.js";
98
98
  import"./index-3jcyn8g6.js";
99
99
  import"./index-bpmtbmy9.js";
@@ -33,12 +33,12 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-8et4bx6j.js";
37
- import"./index-t1gszcwg.js";
38
- import"./index-09w3ezq2.js";
36
+ } from "./index-bwfzq91q.js";
37
+ import"./index-wpqypdge.js";
38
+ import"./index-2w4tsmva.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-hw6yt4rs.js";
41
- import"./index-bx10dq60.js";
40
+ import"./index-n8j0cnp1.js";
41
+ import"./index-9bk16zkv.js";
42
42
  import"./index-ae75rja9.js";
43
43
  import"./index-dzyjb33e.js";
44
44
  import"./index-ey29aap6.js";
@@ -582,6 +582,11 @@ export declare const ContextMapConfigSchema: z.ZodObject<{
582
582
  }, z.core.$strip>;
583
583
  export type ContextMapConfig = z.infer<typeof ContextMapConfigSchema>;
584
584
  export declare const RepoGraphConfigSchema: z.ZodObject<{
585
+ enabled: z.ZodDefault<z.ZodBoolean>;
586
+ init_refresh: z.ZodDefault<z.ZodBoolean>;
587
+ refresh_cap: z.ZodDefault<z.ZodNumber>;
588
+ walk_budget_ms: z.ZodDefault<z.ZodNumber>;
589
+ max_files: z.ZodDefault<z.ZodNumber>;
585
590
  exclude_dirs: z.ZodDefault<z.ZodArray<z.ZodString>>;
586
591
  }, z.core.$strip>;
587
592
  export type RepoGraphConfig = z.infer<typeof RepoGraphConfigSchema>;
@@ -1928,7 +1933,12 @@ export declare const PluginConfigSchema: z.ZodObject<{
1928
1933
  invalidate_on_hash_change: z.ZodDefault<z.ZodBoolean>;
1929
1934
  agent_profiles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1930
1935
  }, z.core.$strip>>;
1931
- repo_graph: z.ZodOptional<z.ZodObject<{
1936
+ repo_graph: z.ZodPrefault<z.ZodObject<{
1937
+ enabled: z.ZodDefault<z.ZodBoolean>;
1938
+ init_refresh: z.ZodDefault<z.ZodBoolean>;
1939
+ refresh_cap: z.ZodDefault<z.ZodNumber>;
1940
+ walk_budget_ms: z.ZodDefault<z.ZodNumber>;
1941
+ max_files: z.ZodDefault<z.ZodNumber>;
1932
1942
  exclude_dirs: z.ZodDefault<z.ZodArray<z.ZodString>>;
1933
1943
  }, z.core.$strip>>;
1934
1944
  evidence: z.ZodOptional<z.ZodObject<{
@@ -15,7 +15,8 @@
15
15
  * exposes the init promise so `toolAfter` can serialize incremental
16
16
  * updates after the initial scan completes.
17
17
  */
18
- import { type RepoGraph } from '../tools/repo-graph';
18
+ import { type BuildWorkspaceGraphOptions, type RepoGraph } from '../tools/repo-graph';
19
+ import { type FreshnessOptions, type FreshnessProbe } from '../tools/repo-graph/freshness';
19
20
  import { safeRealpathSync } from '../tools/repo-graph/safe-realpath';
20
21
  export interface RepoGraphBuilderHook {
21
22
  init(): Promise<void>;
@@ -29,21 +30,28 @@ export interface RepoGraphBuilderHook {
29
30
  }): Promise<void>;
30
31
  }
31
32
  export interface RepoGraphDeps {
32
- buildWorkspaceGraph: (workspace: string, options?: {
33
- maxFileSizeBytes?: number;
34
- maxFiles?: number;
35
- walkBudgetMs?: number;
36
- followSymlinks?: boolean;
37
- excludeDirs?: readonly string[];
38
- }) => Promise<RepoGraph>;
33
+ buildWorkspaceGraph: (workspace: string, options?: BuildWorkspaceGraphOptions) => Promise<RepoGraph>;
39
34
  saveGraph: (workspace: string, graph: RepoGraph, options?: {
40
35
  createAtomic?: boolean;
41
36
  }) => Promise<void>;
42
37
  updateGraphForFiles: (workspace: string, files: string[], options?: {
43
38
  forceRebuild?: boolean;
39
+ buildOptions?: BuildWorkspaceGraphOptions;
44
40
  }) => Promise<RepoGraph>;
41
+ loadGraph: (workspace: string) => Promise<RepoGraph | null>;
42
+ probeFreshness: (workspace: string, options?: FreshnessOptions) => Promise<FreshnessProbe>;
43
+ writeFingerprint: (workspace: string, graph: RepoGraph, options?: FreshnessOptions) => Promise<boolean>;
44
+ isGraphWideInputPath: (filePath: string) => boolean;
45
45
  safeRealpathSync?: typeof safeRealpathSync;
46
46
  }
47
+ export interface RepoGraphBuilderOptions {
48
+ enabled?: boolean;
49
+ initRefresh?: boolean;
50
+ refreshCap?: number;
51
+ maxFiles?: number;
52
+ walkBudgetMs?: number;
53
+ excludeDirs?: readonly string[];
54
+ }
47
55
  /**
48
56
  * Rebase a realpath'd file onto the lexical workspace root so the incremental
49
57
  * update keys the same node the walk produced (issue #1985, defect A5). Exported
@@ -62,6 +70,4 @@ export interface RepoGraphDeps {
62
70
  * the realpath is preserved.
63
71
  */
64
72
  export declare function rebaseOntoWorkspace(realFilePath: string, realWorkspace: string, workspaceRoot: string): string;
65
- export declare function createRepoGraphBuilderHook(workspaceRoot: string, deps?: Partial<RepoGraphDeps>, options?: {
66
- excludeDirs?: readonly string[];
67
- }): RepoGraphBuilderHook;
73
+ export declare function createRepoGraphBuilderHook(workspaceRoot: string, deps?: Partial<RepoGraphDeps>, options?: RepoGraphBuilderOptions): RepoGraphBuilderHook;
@@ -11,18 +11,29 @@
11
11
  * the agent simply doesn't get the extra context. The graph is built
12
12
  * on-demand by the agent calling `repo_map` with action="build".
13
13
  *
14
- * Caching: the loaded graph is cached per-directory in module scope to
15
- * avoid re-reading the JSON on every system prompt construction. The
16
- * cache is bypassed if the file's mtime advances.
14
+ * Caching: the loaded graph is cached in a bounded per-directory LRU and
15
+ * invalidated when the graph artifact changes. Before returning it, the shared
16
+ * bounded workspace probe gates use of the graph. Uncertified graphs and
17
+ * complete drift above the configured refresh cap are suppressed;
18
+ * inconclusive probes remain usable as freshness-unknown, without mutation.
17
19
  */
18
- import { type RepoGraph } from '../tools/repo-graph';
20
+ import { type FreshnessOptions, probeFreshness, type RepoGraph } from '../tools/repo-graph';
21
+ export interface RepoGraphInjectionOptions extends FreshnessOptions {
22
+ enabled?: boolean;
23
+ refreshCap?: number;
24
+ }
25
+ export declare const _internals: {
26
+ probeFreshness: typeof probeFreshness;
27
+ cacheSize: () => number;
28
+ };
19
29
  /**
20
- * Load the repo graph for `directory`, using a per-directory cache that
21
- * invalidates on file mtime change. Returns null if no graph exists.
30
+ * Load the repo graph for `directory`, using a bounded per-directory cache that
31
+ * invalidates on file mtime/size change and a shared content-freshness gate.
32
+ * Returns null if no graph exists or its workspace alignment is unsafe.
22
33
  *
23
34
  * Exported only for tests; production callers use the buildXxxBlock helpers below.
24
35
  */
25
- export declare function getCachedGraph(directory: string): RepoGraph | null;
36
+ export declare function getCachedGraph(directory: string, options?: RepoGraphInjectionOptions): Promise<RepoGraph | null>;
26
37
  /** Test-only: clear the per-directory cache. */
27
38
  export declare function resetGraphInjectionCache(): void;
28
39
  /**
@@ -33,7 +44,7 @@ export declare function resetGraphInjectionCache(): void;
33
44
  * - No graph exists.
34
45
  * - The target isn't tracked in the graph (file too new, language unsupported).
35
46
  */
36
- export declare function buildCoderLocalizationBlock(directory: string, targetFile: string): string | null;
47
+ export declare function buildCoderLocalizationBlock(directory: string, targetFile: string, options?: RepoGraphInjectionOptions): Promise<string | null>;
37
48
  /**
38
49
  * Build a blast-radius block for a list of changed files. Used by the
39
50
  * reviewer agent to spot-check whether unseen consumers might break.
@@ -42,4 +53,4 @@ export declare function buildCoderLocalizationBlock(directory: string, targetFil
42
53
  * graph. The result is bounded to the top 8 dependents to stay within
43
54
  * the per-block context budget.
44
55
  */
45
- export declare function buildReviewerBlastRadiusBlock(directory: string, changedFiles: string[]): string | null;
56
+ export declare function buildReviewerBlastRadiusBlock(directory: string, changedFiles: string[], options?: RepoGraphInjectionOptions): Promise<string | null>;
@@ -13,7 +13,7 @@ import { computeASTDiff } from '../diff/ast-diff.js';
13
13
  import { classifyChanges } from '../diff/semantic-classifier.js';
14
14
  import { generateSummary, generateSummaryMarkdown } from '../diff/summary-generator.js';
15
15
  import { getImporters, normalizeGraphPath } from '../tools/repo-graph.js';
16
- import { getCachedGraph } from './repo-graph-injection.js';
16
+ import { getCachedGraph, type RepoGraphInjectionOptions } from './repo-graph-injection.js';
17
17
  export declare const _internals: {
18
18
  execFile: typeof child_process.execFile;
19
19
  realpathSync: typeof fs.realpathSync;
@@ -40,4 +40,4 @@ export declare const _internals: {
40
40
  *
41
41
  * Returns null if no changes are detected or on failure.
42
42
  */
43
- export declare function buildSemanticDiffBlock(directory: string, changedFiles: string[], maxFiles?: number): Promise<string | null>;
43
+ export declare function buildSemanticDiffBlock(directory: string, changedFiles: string[], maxFiles?: number, repoGraphOptions?: RepoGraphInjectionOptions): Promise<string | null>;