opencode-swarm 7.135.5 → 7.136.1

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 (49) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +11 -0
  2. package/dist/background/candidate-contract.d.ts +13 -0
  3. package/dist/cli/{config-doctor-exj26ryt.js → config-doctor-6fphg5xm.js} +2 -2
  4. package/dist/cli/{curation-policy-mbv3b27c.js → curation-policy-m24jbyag.js} +2 -2
  5. package/dist/cli/{curator-llm-factory-4d5pzh47.js → curator-llm-factory-w5arq7tr.js} +12 -12
  6. package/dist/cli/{curator-7ycd6x29.js → curator-zrt5sqj2.js} +12 -12
  7. package/dist/cli/{guardrail-explain-2jrqv2zf.js → guardrail-explain-462jwhbh.js} +13 -13
  8. package/dist/cli/{guardrail-log-c843gxnm.js → guardrail-log-ax21jd9e.js} +3 -3
  9. package/dist/cli/{hive-promoter-epnj14q8.js → hive-promoter-2vacnbws.js} +12 -12
  10. package/dist/cli/{index-8et4bx6j.js → index-1sq47n6t.js} +3 -3
  11. package/dist/cli/{index-0csbx1wc.js → index-9gxp450h.js} +1 -1
  12. package/dist/cli/{index-t1gszcwg.js → index-dyy3hvk3.js} +2 -2
  13. package/dist/cli/{index-jnemjn16.js → index-f4cmtd89.js} +2 -2
  14. package/dist/cli/{index-qyn0b2jj.js → index-g7g4hqh3.js} +1 -1
  15. package/dist/cli/{index-db52969t.js → index-gf7hqbmz.js} +1 -1
  16. package/dist/cli/{index-ym516a9a.js → index-h3bweb88.js} +5 -5
  17. package/dist/cli/{index-hw6yt4rs.js → index-hzkvbycn.js} +4 -4
  18. package/dist/cli/{index-09w3ezq2.js → index-jwrydqjp.js} +1 -1
  19. package/dist/cli/{index-bx10dq60.js → index-kzc2ygea.js} +1 -1
  20. package/dist/cli/{index-kjg6vgqs.js → index-p1pqqwgp.js} +1 -1
  21. package/dist/cli/{index-9s5b8wrs.js → index-prnjt2jr.js} +61 -54
  22. package/dist/cli/{index-k8arazbb.js → index-r9v98d0y.js} +7 -2
  23. package/dist/cli/{index-kq9zb1cv.js → index-rhgctfn3.js} +14 -14
  24. package/dist/cli/{index-6yk6ezvj.js → index-tfa40hwb.js} +1 -1
  25. package/dist/cli/{index-gvfw2y6v.js → index-zkddc5ye.js} +2 -2
  26. package/dist/cli/index.js +12 -12
  27. package/dist/cli/{knowledge-escalator-3tjhpwjf.js → knowledge-escalator-1zt8qy1c.js} +3 -3
  28. package/dist/cli/{knowledge-events-0akk3p15.js → knowledge-events-ej3s9tsm.js} +1 -1
  29. package/dist/cli/{knowledge-store-7nvfh2n3.js → knowledge-store-ey4cbkp4.js} +1 -1
  30. package/dist/cli/{knowledge-validator-z618vhda.js → knowledge-validator-zwmq7s2c.js} +4 -4
  31. package/dist/cli/{scan-cursor-5zqr3afj.js → scan-cursor-809hf2n1.js} +2 -2
  32. package/dist/cli/{schema-n1cj94m0.js → schema-mhd7xqwr.js} +1 -1
  33. package/dist/cli/{skill-generator-560ksca8.js → skill-generator-yyc8zd9j.js} +5 -5
  34. package/dist/config/schema.d.ts +11 -1
  35. package/dist/hooks/repo-graph-builder.d.ts +17 -11
  36. package/dist/hooks/repo-graph-injection.d.ts +20 -9
  37. package/dist/hooks/semantic-diff-injection.d.ts +2 -2
  38. package/dist/index.js +141 -140
  39. package/dist/tools/repo-graph/builder.d.ts +55 -1
  40. package/dist/tools/repo-graph/cache.d.ts +12 -36
  41. package/dist/tools/repo-graph/freshness.d.ts +54 -0
  42. package/dist/tools/repo-graph/incremental.d.ts +17 -8
  43. package/dist/tools/repo-graph/query.d.ts +7 -1
  44. package/dist/tools/repo-graph/storage.d.ts +3 -1
  45. package/dist/tools/repo-graph/types.d.ts +31 -1
  46. package/dist/tools/repo-graph.d.ts +5 -3
  47. package/dist/tools/repo-map.d.ts +8 -0
  48. package/dist/utils/path-security.d.ts +22 -0
  49. package/package.json +1 -1
@@ -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>;