opencode-swarm 7.25.2 → 7.26.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.
@@ -43,9 +43,10 @@
43
43
  * leaves `scope-{id}.json.tmp.{ts}.{rand}` files. No sweeper runs today;
44
44
  * accumulation is bounded by `/swarm close` (which rm -rf's .swarm/scopes/).
45
45
  *
46
- * NOT a security boundary. Bash remains unguarded at the write-authority layer.
47
- * The durable fix lives at the syscall layer (#520). This module closes the
48
- * cross-process gap and the plan-as-scope gap, both of which are mitigations.
46
+ * NOT a standalone security boundary. Tool-layer write interception is now
47
+ * implemented in shell-write-detect.ts (Phases 1-2). This module closes the
48
+ * cross-process gap and the plan-as-scope gap. The syscall-layer fix (#520)
49
+ * remains the durable long-term boundary.
49
50
  */
50
51
  declare const SCOPE_SCHEMA_VERSION: 1;
51
52
  export interface PersistedScope {
@@ -123,36 +123,3 @@ export declare function runConfigDoctorWithFixes(directory: string, config: Plug
123
123
  updatedConfigPath: string | null;
124
124
  artifactPath: string | null;
125
125
  }>;
126
- /**
127
- * A stray .swarm directory found below the project root.
128
- * These are typically created by bugs in prior versions (see Issue #922).
129
- */
130
- export interface StraySwarmFinding {
131
- /** Relative path from project root (forward-slash normalized) */
132
- path: string;
133
- /** Absolute path on disk */
134
- absolutePath: string;
135
- /** Contents summary (up to 20 entries) */
136
- contents: string[];
137
- /** Total number of entries in the directory */
138
- totalEntries: number;
139
- }
140
- /**
141
- * Detect stray .swarm directories in project subdirectories.
142
- * These are .swarm/ directories that exist below the project root,
143
- * typically created by bugs in prior versions (see Issue #922).
144
- *
145
- * Skips: node_modules/, .git/, dist/, .cache/, .next/, coverage/
146
- * and common tool/build output directories.
147
- */
148
- export declare function detectStraySwarmDirs(projectRoot: string): StraySwarmFinding[];
149
- /**
150
- * Remove a stray .swarm directory.
151
- * NEVER removes the root .swarm/ directory.
152
- *
153
- * @returns `{ success, message }` indicating outcome
154
- */
155
- export declare function removeStraySwarmDir(projectRoot: string, strayPath: string): {
156
- success: boolean;
157
- message: string;
158
- };
@@ -1,4 +1,3 @@
1
- import { validateProjectRoot } from '../evidence/manager.js';
2
1
  export interface TestImpactResult {
3
2
  impactedTests: string[];
4
3
  unrelatedTests: string[];
@@ -19,7 +18,6 @@ declare function findTestFilesSync(cwd: string): string[];
19
18
  declare function extractImports(content: string): string[];
20
19
  declare function buildImpactMapInternal(cwd: string): Promise<Record<string, string[]>>;
21
20
  export declare const _internals: {
22
- validateProjectRoot: typeof validateProjectRoot;
23
21
  normalizePath: typeof normalizePath;
24
22
  isCacheStale: typeof isCacheStale;
25
23
  resolveRelativeImport: typeof resolveRelativeImport;
@@ -1,4 +1,3 @@
1
- import { validateProjectRoot } from '../evidence/manager.js';
2
1
  export type TestRunResult = 'pass' | 'fail' | 'skip';
3
2
  export interface TestRunRecord {
4
3
  timestamp: string;
@@ -14,9 +13,3 @@ export interface TestRunRecord {
14
13
  export declare function appendTestRun(record: TestRunRecord, workingDir?: string): void;
15
14
  export declare function getTestHistory(testFile: string, workingDir?: string): TestRunRecord[];
16
15
  export declare function getAllHistory(workingDir?: string): TestRunRecord[];
17
- /**
18
- * DI seam for testability. Contains functions that tests may override.
19
- */
20
- export declare const _internals: {
21
- validateProjectRoot: typeof validateProjectRoot;
22
- };
@@ -79,7 +79,7 @@ export declare function classifySastFindings(findings: SastScanFinding[], change
79
79
  /**
80
80
  * Run all 4 pre-check tools in parallel with concurrency limit
81
81
  * @param input - The pre-check batch input
82
- * @param workspaceDir - Optional workspace directory for traversal validation (injected project root from createSwarmTool, or input.directory)
82
+ * @param workspaceDir - Optional workspace directory for traversal validation (defaults to directory param or process.cwd())
83
83
  */
84
84
  export declare function runPreCheckBatch(input: PreCheckBatchInput, workspaceDir?: string, contextDir?: string): Promise<PreCheckBatchResult>;
85
85
  /**
@@ -19,14 +19,7 @@ export interface ResolveError {
19
19
  message: string;
20
20
  }
21
21
  /**
22
- * Resolves and validates a working directory against a fallback (injected project root).
23
- *
24
- * NOTE: This function intentionally does NOT use realpathSync for the resolved path
25
- * to avoid Windows 8.3 short filename issues. Symlink-based subdirectory bypasses
26
- * through this coarse filter are caught by the write-time validateProjectRoot guard
27
- * in evidence/manager.ts, which DOES use realpathSync. These two functions form a
28
- * defense-in-depth pair: resolveWorkingDirectory is the fast entry filter,
29
- * validateProjectRoot is the authoritative canonical check at write time.
22
+ * Resolve the effective working directory for a swarm tool.
30
23
  *
31
24
  * Priority: explicit working_directory param > injected directory (from createSwarmTool).
32
25
  *
@@ -32,14 +32,6 @@ export interface TestTotals {
32
32
  skipped: number;
33
33
  total: number;
34
34
  }
35
- export interface ParsedTestCaseResult {
36
- testFile: string;
37
- testName: string;
38
- result: 'pass' | 'fail' | 'skip';
39
- durationMs: number;
40
- errorMessage?: string;
41
- stackPrefix?: string;
42
- }
43
35
  export interface TestSuccessResult {
44
36
  success: true;
45
37
  framework: TestFramework;
@@ -50,7 +42,6 @@ export interface TestSuccessResult {
50
42
  totals: TestTotals;
51
43
  coveragePercent?: number;
52
44
  rawOutput?: string;
53
- testCases?: ParsedTestCaseResult[];
54
45
  message?: string;
55
46
  outcome?: RegressionOutcome;
56
47
  }
@@ -65,7 +56,6 @@ export interface TestErrorResult {
65
56
  coveragePercent?: number;
66
57
  error: string;
67
58
  rawOutput?: string;
68
- testCases?: ParsedTestCaseResult[];
69
59
  message?: string;
70
60
  outcome?: RegressionOutcome;
71
61
  attempted_scope?: 'graph';
@@ -53,7 +53,7 @@ export interface ReviewerGateResult {
53
53
  * @param sessionID - Optional session ID to scope Lean Turbo bypass to the current tool-execution context
54
54
  * @returns ReviewerGateResult indicating whether the gate is blocked
55
55
  */
56
- export declare function checkReviewerGate(taskId: string, workingDirectory?: string, stageBParallelEnabled?: boolean, sessionID?: string, fallbackDir?: string): ReviewerGateResult;
56
+ export declare function checkReviewerGate(taskId: string, workingDirectory?: string, stageBParallelEnabled?: boolean, sessionID?: string): ReviewerGateResult;
57
57
  /**
58
58
  * Wrapper around checkReviewerGate that appends a diff-scope advisory warning.
59
59
  * Keeps checkReviewerGate synchronous for backward compatibility.
@@ -61,10 +61,9 @@ export declare function checkReviewerGate(taskId: string, workingDirectory?: str
61
61
  * @param taskId - The task ID to check gate state for
62
62
  * @param workingDirectory - Optional working directory for plan.json fallback
63
63
  * @param sessionID - Optional session ID to scope Lean Turbo bypass to the current tool-execution context
64
- * @param fallbackDir - Optional fallback directory for resolveWorkingDirectory when workingDirectory is absent
65
64
  * @returns ReviewerGateResult with optional scope warning appended to reason
66
65
  */
67
- export declare function checkReviewerGateWithScope(taskId: string, workingDirectory?: string, sessionID?: string, fallbackDir?: string): Promise<ReviewerGateResult>;
66
+ export declare function checkReviewerGateWithScope(taskId: string, workingDirectory?: string, sessionID?: string): Promise<ReviewerGateResult>;
68
67
  /**
69
68
  * Recovery mechanism: reconcile task state with delegation history.
70
69
  * When task-scoped reviewer/test_engineer delegations occurred but the state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.25.2",
3
+ "version": "7.26.1",
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",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "scripts": {
40
40
  "clean": "bun -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
41
- "build": "bun run clean && bun run scripts/copy-grammars.ts && bun build src/index.ts --outdir dist --target node --format esm && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && bun run scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly",
41
+ "build": "bun run clean && bun run scripts/copy-grammars.ts && bun build src/index.ts --outdir dist --target node --format esm --external bash-parser && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external bash-parser && bun run scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly",
42
42
  "typecheck": "tsc --noEmit",
43
43
  "test": "bun test",
44
44
  "lint": "biome lint .",
@@ -52,6 +52,7 @@
52
52
  "@opencode-ai/plugin": "^1.1.53",
53
53
  "@opencode-ai/sdk": "^1.1.53",
54
54
  "@vscode/tree-sitter-wasm": "^0.3.0",
55
+ "bash-parser": "^0.5.0",
55
56
  "p-limit": "^7.3.0",
56
57
  "picomatch": "^4.0.4",
57
58
  "proper-lockfile": "^4.1.2",