opencode-swarm 6.41.2 → 6.41.4

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.
@@ -12,6 +12,8 @@ export interface CompletionVerifyArgs {
12
12
  phase: number;
13
13
  /** Session ID (optional, auto-provided by plugin context) */
14
14
  sessionID?: string;
15
+ /** Explicit project root directory override */
16
+ working_directory?: string;
15
17
  }
16
18
  /**
17
19
  * Execute the completion verification check
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared utility for resolving working_directory across swarm tools.
3
+ *
4
+ * Tools that read .swarm/ state (plan.json, evidence/) must resolve paths
5
+ * relative to the actual project root, not process.cwd(). When the MCP host's
6
+ * CWD differs from the project root (e.g. CWD=RAGAPPv2, project=RAGAPPv3),
7
+ * tools that lack a working_directory parameter silently read stale data from
8
+ * the wrong directory.
9
+ *
10
+ * This helper provides consistent validation and resolution, matching the
11
+ * pattern already used by save_plan and update_task_status.
12
+ */
13
+ export interface ResolveResult {
14
+ success: true;
15
+ directory: string;
16
+ }
17
+ export interface ResolveError {
18
+ success: false;
19
+ message: string;
20
+ }
21
+ /**
22
+ * Resolve the effective working directory for a swarm tool.
23
+ *
24
+ * Priority: explicit working_directory param > injected directory (from createSwarmTool).
25
+ *
26
+ * When working_directory is provided, it is validated for:
27
+ * - Null-byte injection
28
+ * - Path traversal sequences (..)
29
+ * - Windows device paths
30
+ * - Existence on disk
31
+ *
32
+ * @param workingDirectory - Explicit working_directory from tool args (caller-controlled)
33
+ * @param fallbackDirectory - Injected directory from createSwarmTool (ctx.directory ?? process.cwd())
34
+ */
35
+ export declare function resolveWorkingDirectory(workingDirectory: string | undefined | null, fallbackDirectory: string): ResolveResult | ResolveError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.41.2",
3
+ "version": "6.41.4",
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",