opencode-swarm 7.94.1 → 7.96.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 (31) hide show
  1. package/.opencode/skills/council/SKILL.md +4 -2
  2. package/.opencode/skills/deep-research/SKILL.md +13 -7
  3. package/.opencode/skills/execute/SKILL.md +2 -2
  4. package/.opencode/skills/swarm-pr-review/SKILL.md +1 -1
  5. package/dist/cli/{config-doctor-ecmx9scq.js → config-doctor-h1xrvq83.js} +2 -2
  6. package/dist/cli/{evidence-summary-service-mr9sns2d.js → evidence-summary-service-g4x5e3e3.js} +1 -1
  7. package/dist/cli/{guardrail-explain-we8mhb6y.js → guardrail-explain-0hw3kyab.js} +6 -6
  8. package/dist/cli/{guardrail-log-0q6pvbpx.js → guardrail-log-9yyeccv5.js} +3 -3
  9. package/dist/cli/{index-y1z6yaq4.js → index-4c5jpmn9.js} +3 -3
  10. package/dist/cli/{index-dgjsa6hy.js → index-b223mczb.js} +1 -1
  11. package/dist/cli/{index-q8qx8p47.js → index-d3ds25vx.js} +2 -2
  12. package/dist/cli/{index-a59fjg9v.js → index-q0t7gpf2.js} +17 -13
  13. package/dist/cli/{index-jv0bz96v.js → index-r0zbs7ny.js} +7 -7
  14. package/dist/cli/{index-tx5czwpd.js → index-rdc6nvmw.js} +1 -1
  15. package/dist/cli/{index-79dcqsg9.js → index-tqbb2jx6.js} +29 -2
  16. package/dist/cli/{index-vqg905es.js → index-xx3sv77e.js} +1 -1
  17. package/dist/cli/index.js +5 -5
  18. package/dist/cli/{schema-jy18ftky.js → schema-a8fneygm.js} +1 -1
  19. package/dist/index.js +2222 -1037
  20. package/dist/plan/checkpoint.d.ts +16 -2
  21. package/dist/tools/actionlint-scan.d.ts +29 -0
  22. package/dist/tools/ast-grep.d.ts +26 -0
  23. package/dist/tools/dispatch-lanes.d.ts +18 -0
  24. package/dist/tools/gh-evidence.d.ts +10 -0
  25. package/dist/tools/index.d.ts +4 -0
  26. package/dist/tools/manifest.d.ts +4 -0
  27. package/dist/tools/osv-scan.d.ts +27 -0
  28. package/dist/tools/search.d.ts +27 -0
  29. package/dist/tools/tool-metadata.d.ts +16 -0
  30. package/dist/utils/external-tool-runner.d.ts +25 -0
  31. package/package.json +1 -1
@@ -1,6 +1,20 @@
1
+ /**
2
+ * Checkpoint artifact writer.
3
+ * Writes SWARM_PLAN.md and SWARM_PLAN.json inside .swarm/plan-export/.
4
+ * Export-only — not a live runtime source of truth.
5
+ * Called on: save_plan, phase completion, /swarm close.
6
+ * NOT called on every task update.
7
+ */
8
+ import * as fs from 'node:fs';
9
+ export declare const _fsInternals: {
10
+ mkdirSync: (path: fs.PathLike, options?: fs.MakeDirectoryOptions | fs.Mode | null | undefined) => string | undefined;
11
+ writeFileSync: (path: string, data: string, encoding?: BufferEncoding) => void;
12
+ readFileSync: (path: string, encoding?: BufferEncoding) => string;
13
+ existsSync: (path: string) => boolean;
14
+ };
1
15
  import { type Plan } from '../config/plan-schema';
2
16
  /**
3
- * Write SWARM_PLAN.json and SWARM_PLAN.md inside the .swarm/ directory under the project root.
17
+ * Write SWARM_PLAN.json and SWARM_PLAN.md inside the .swarm/plan-export/ directory under the project root.
4
18
  * Non-blocking: logs a warning on failure but never throws.
5
19
  * @param directory - The working directory (project root)
6
20
  */
@@ -14,7 +28,7 @@ export interface ImportCheckpointResult {
14
28
  error?: string;
15
29
  }
16
30
  /**
17
- * Import a checkpoint from .swarm/SWARM_PLAN.json (with backward-compat fallback to project root).
31
+ * Import a checkpoint from .swarm/plan-export/SWARM_PLAN.json (with backward-compat fallback to .swarm/ and project root).
18
32
  * Validates the checkpoint against PlanSchema, persists it as the live plan
19
33
  * via savePlan, and appends a 'plan_rebuilt' ledger event.
20
34
  *
@@ -0,0 +1,29 @@
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { resolveExecutableFromPath, runExternalTool } from '../utils/external-tool-runner';
3
+ interface ActionlintFinding {
4
+ file: string;
5
+ line: number;
6
+ column: number;
7
+ kind: string;
8
+ message: string;
9
+ endColumn?: number;
10
+ }
11
+ interface WorkflowDiscoveryResult {
12
+ files: string[];
13
+ truncated: boolean;
14
+ }
15
+ declare function resolveActionlintBinary(): string | null;
16
+ declare function discoverWorkflowFiles(workspace: string): WorkflowDiscoveryResult;
17
+ declare function parseActionlintOutput(stdout: string, workspace: string, maxResults: number): {
18
+ findings: ActionlintFinding[];
19
+ total: number;
20
+ };
21
+ export declare const actionlint_scan: ToolDefinition;
22
+ export declare const _internals: {
23
+ resolveExecutableFromPath: typeof resolveExecutableFromPath;
24
+ resolveActionlintBinary: typeof resolveActionlintBinary;
25
+ runExternalTool: typeof runExternalTool;
26
+ discoverWorkflowFiles: typeof discoverWorkflowFiles;
27
+ parseActionlintOutput: typeof parseActionlintOutput;
28
+ };
29
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { resolveExecutableFromPath, runExternalTool } from '../utils/external-tool-runner';
3
+ interface AstGrepMatch {
4
+ file: string;
5
+ lineNumber: number;
6
+ column: number;
7
+ endLineNumber: number;
8
+ endColumn: number;
9
+ text: string;
10
+ lines: string;
11
+ language?: string;
12
+ metaVariables?: unknown;
13
+ }
14
+ declare function resolveAstGrepBinary(): string | null;
15
+ declare function parseAstGrepStream(stdout: string, workspace: string, maxResults: number): {
16
+ matches: AstGrepMatch[];
17
+ total: number;
18
+ };
19
+ export declare const ast_grep: ToolDefinition;
20
+ export declare const _internals: {
21
+ resolveExecutableFromPath: typeof resolveExecutableFromPath;
22
+ resolveAstGrepBinary: typeof resolveAstGrepBinary;
23
+ runExternalTool: typeof runExternalTool;
24
+ parseAstGrepStream: typeof parseAstGrepStream;
25
+ };
26
+ export {};
@@ -26,6 +26,7 @@ declare const DispatchLanesAsyncArgsSchema: z.ZodObject<{
26
26
  common_prompt: z.ZodOptional<z.ZodString>;
27
27
  max_concurrent: z.ZodOptional<z.ZodNumber>;
28
28
  timeout_ms: z.ZodOptional<z.ZodNumber>;
29
+ launch_timeout_ms: z.ZodOptional<z.ZodNumber>;
29
30
  batch_id: z.ZodOptional<z.ZodString>;
30
31
  mode: z.ZodOptional<z.ZodString>;
31
32
  pr_head_sha: z.ZodOptional<z.ZodString>;
@@ -88,6 +89,8 @@ export interface DispatchLanesAsyncResult {
88
89
  failed: number;
89
90
  rejected: number;
90
91
  max_concurrent: number;
92
+ launch_timeout_ms: number;
93
+ /** Deprecated alias for launch_timeout_ms; retained for existing callers. */
91
94
  timeout_ms: number;
92
95
  lane_results: DispatchLaneResult[];
93
96
  errors?: string[];
@@ -181,6 +184,16 @@ export interface SessionOps {
181
184
  }> | null;
182
185
  error?: unknown;
183
186
  }>;
187
+ status?: (args: {
188
+ query?: {
189
+ directory?: string;
190
+ };
191
+ }) => Promise<{
192
+ data?: Record<string, {
193
+ type?: string;
194
+ }> | null;
195
+ error?: unknown;
196
+ }>;
184
197
  abort?: (args: {
185
198
  path: {
186
199
  id: string;
@@ -225,11 +238,16 @@ export declare const _test_exports: {
225
238
  common_prompt: z.ZodOptional<z.ZodString>;
226
239
  max_concurrent: z.ZodOptional<z.ZodNumber>;
227
240
  timeout_ms: z.ZodOptional<z.ZodNumber>;
241
+ launch_timeout_ms: z.ZodOptional<z.ZodNumber>;
228
242
  batch_id: z.ZodOptional<z.ZodString>;
229
243
  mode: z.ZodOptional<z.ZodString>;
230
244
  pr_head_sha: z.ZodOptional<z.ZodString>;
231
245
  scope: z.ZodOptional<z.ZodString>;
232
246
  }, z.core.$strip>;
247
+ DEFAULT_TIMEOUT_MS: number;
248
+ DEFAULT_ASYNC_LAUNCH_TIMEOUT_MS: number;
249
+ DEFAULT_ASYNC_STALE_TIMEOUT_MS: number;
250
+ DEFAULT_COLLECT_TIMEOUT_MS: number;
233
251
  };
234
252
  type ReadOnlyToolPermissions = Record<string, false> & {
235
253
  write: false;
@@ -0,0 +1,10 @@
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { resolveExecutableFromPath, runExternalTool } from '../utils/external-tool-runner';
3
+ declare function resolveGhBinary(): string | null;
4
+ export declare const gh_evidence: ToolDefinition;
5
+ export declare const _internals: {
6
+ resolveExecutableFromPath: typeof resolveExecutableFromPath;
7
+ resolveGhBinary: typeof resolveGhBinary;
8
+ runExternalTool: typeof runExternalTool;
9
+ };
10
+ export {};
@@ -1,6 +1,8 @@
1
1
  import { swarmApplyPatch } from './apply-patch';
2
2
  export { swarmApplyPatch };
3
3
  export declare const swarm_apply_patch: typeof swarmApplyPatch;
4
+ export { actionlint_scan } from './actionlint-scan';
5
+ export { ast_grep } from './ast-grep';
4
6
  export { batch_symbols } from './batch-symbols';
5
7
  export { build_check } from './build-check';
6
8
  export { check_gate_status } from './check-gate-status';
@@ -29,6 +31,7 @@ export { external_skill_revoke } from './external-skill-revoke';
29
31
  export { extract_code_blocks } from './file-extractor';
30
32
  export { get_approved_plan } from './get-approved-plan';
31
33
  export { get_qa_gate_profile } from './get-qa-gate-profile';
34
+ export { gh_evidence } from './gh-evidence';
32
35
  export { git_blame } from './git-blame';
33
36
  export { fetchGitingest, type GitingestArgs, gitingest } from './gitingest';
34
37
  export { imports } from './imports';
@@ -39,6 +42,7 @@ export { knowledge_recall } from './knowledge-recall';
39
42
  export { knowledge_receipt } from './knowledge-receipt';
40
43
  export { knowledge_remove } from './knowledge-remove';
41
44
  export { lint } from './lint';
45
+ export { osv_scan } from './osv-scan';
42
46
  export { parse_lane_candidates } from './parse-lane-candidates';
43
47
  export { phase_complete } from './phase-complete';
44
48
  export { pkg_audit } from './pkg-audit';
@@ -77,6 +77,10 @@ export declare const TOOL_MANIFEST: {
77
77
  knowledge_remove: () => ToolDefinition;
78
78
  co_change_analyzer: () => ToolDefinition;
79
79
  search: () => ToolDefinition;
80
+ ast_grep: () => ToolDefinition;
81
+ actionlint_scan: () => ToolDefinition;
82
+ osv_scan: () => ToolDefinition;
83
+ gh_evidence: () => ToolDefinition;
80
84
  batch_symbols: () => ToolDefinition;
81
85
  suggest_patch: () => ToolDefinition;
82
86
  req_coverage: () => ToolDefinition;
@@ -0,0 +1,27 @@
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { resolveExecutableFromPath, runExternalTool } from '../utils/external-tool-runner';
3
+ interface OsvFinding {
4
+ id: string;
5
+ summary?: string;
6
+ packageName?: string;
7
+ ecosystem?: string;
8
+ installedVersion?: string;
9
+ fixedVersion?: string;
10
+ aliases?: string[];
11
+ references?: string[];
12
+ }
13
+ interface ParsedOsvOutput {
14
+ findings: OsvFinding[];
15
+ total: number;
16
+ parseError: boolean;
17
+ }
18
+ declare function resolveOsvScannerBinary(): string | null;
19
+ declare function parseOsvOutput(stdout: string, maxResults: number): ParsedOsvOutput;
20
+ export declare const osv_scan: ToolDefinition;
21
+ export declare const _internals: {
22
+ resolveExecutableFromPath: typeof resolveExecutableFromPath;
23
+ resolveOsvScannerBinary: typeof resolveOsvScannerBinary;
24
+ runExternalTool: typeof runExternalTool;
25
+ parseOsvOutput: typeof parseOsvOutput;
26
+ };
27
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
+ import { resolveExecutableFromPath, runExternalTool } from '../utils/external-tool-runner';
2
3
  export interface SearchMatch {
3
4
  file: string;
4
5
  lineNumber: number;
@@ -12,6 +13,9 @@ export interface SearchResult {
12
13
  query: string;
13
14
  mode: 'literal' | 'regex';
14
15
  maxResults: number;
16
+ engine: 'ripgrep' | 'fallback';
17
+ outputTruncated?: boolean;
18
+ warning?: string;
15
19
  }
16
20
  export interface SearchError {
17
21
  error: true;
@@ -26,4 +30,27 @@ export interface SearchArgs {
26
30
  max_results?: number;
27
31
  max_lines?: number;
28
32
  }
33
+ declare function resolvePackagedRipgrep(): string | null;
34
+ declare function resolveRipgrepBinary(): string | null;
35
+ interface FallbackSearchOptions {
36
+ query: string;
37
+ mode: 'literal' | 'regex';
38
+ include?: string;
39
+ exclude?: string;
40
+ maxResults: number;
41
+ maxLines: number;
42
+ workspace: string;
43
+ }
44
+ /**
45
+ * Execute search using Node.js fallback (when ripgrep not available).
46
+ */
47
+ declare function fallbackSearch(opts: FallbackSearchOptions): Promise<SearchResult | SearchError>;
29
48
  export declare const search: ToolDefinition;
49
+ export declare const _internals: {
50
+ resolvePackagedRipgrep: typeof resolvePackagedRipgrep;
51
+ resolveExecutableFromPath: typeof resolveExecutableFromPath;
52
+ resolveRipgrepBinary: typeof resolveRipgrepBinary;
53
+ runExternalTool: typeof runExternalTool;
54
+ fallbackSearch: typeof fallbackSearch;
55
+ };
56
+ export {};
@@ -239,6 +239,22 @@ export declare const TOOL_METADATA: {
239
239
  description: string;
240
240
  agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic_hallucination_verifier" | "critic_oversight" | "architect" | "researcher" | "docs_design" | "skill_improver" | "spec_writer")[];
241
241
  };
242
+ ast_grep: {
243
+ description: string;
244
+ agents: ("test_engineer" | "coder" | "docs" | "explorer" | "sme" | "critic_hallucination_verifier" | "architect" | "researcher" | "docs_design" | "spec_writer")[];
245
+ };
246
+ actionlint_scan: {
247
+ description: string;
248
+ agents: ("test_engineer" | "architect")[];
249
+ };
250
+ osv_scan: {
251
+ description: string;
252
+ agents: ("test_engineer" | "architect")[];
253
+ };
254
+ gh_evidence: {
255
+ description: string;
256
+ agents: ("architect" | "researcher")[];
257
+ };
242
258
  batch_symbols: {
243
259
  description: string;
244
260
  agents: ("reviewer" | "explorer" | "critic_hallucination_verifier" | "critic_oversight" | "architect")[];
@@ -0,0 +1,25 @@
1
+ import { bunSpawn } from './bun-compat';
2
+ export interface ExternalToolRunOptions {
3
+ executable: string;
4
+ args: string[];
5
+ cwd: string;
6
+ timeoutMs: number;
7
+ maxStdoutBytes: number;
8
+ maxStderrBytes: number;
9
+ env?: Record<string, string | undefined>;
10
+ }
11
+ export interface ExternalToolRunResult {
12
+ status: 'completed' | 'timeout' | 'spawn-error';
13
+ exitCode: number | null;
14
+ stdout: string;
15
+ stderr: string;
16
+ stdoutTruncated: boolean;
17
+ stderrTruncated: boolean;
18
+ message?: string;
19
+ }
20
+ export declare function resolveExecutableFromPath(names: string[], envPath?: string, platform?: NodeJS.Platform): string | null;
21
+ export declare function runExternalTool(options: ExternalToolRunOptions): Promise<ExternalToolRunResult>;
22
+ export declare const _internals: {
23
+ bunSpawn: typeof bunSpawn;
24
+ platform: () => NodeJS.Platform;
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.94.1",
3
+ "version": "7.96.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",