opencode-swarm 6.85.3 → 6.85.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.
Files changed (43) hide show
  1. package/dist/cli/index.js +356 -408
  2. package/dist/index.js +1023 -1081
  3. package/dist/tools/batch-symbols.d.ts +1 -1
  4. package/dist/tools/build-check.d.ts +1 -1
  5. package/dist/tools/check-gate-status.d.ts +1 -1
  6. package/dist/tools/checkpoint.d.ts +1 -1
  7. package/dist/tools/co-change-analyzer.d.ts +1 -1
  8. package/dist/tools/completion-verify.d.ts +1 -1
  9. package/dist/tools/complexity-hotspots.d.ts +1 -1
  10. package/dist/tools/convene-council.d.ts +1 -1
  11. package/dist/tools/convene-general-council.d.ts +1 -1
  12. package/dist/tools/create-tool.d.ts +9 -1
  13. package/dist/tools/declare-council-criteria.d.ts +1 -1
  14. package/dist/tools/declare-scope.d.ts +1 -1
  15. package/dist/tools/domain-detector.d.ts +2 -2
  16. package/dist/tools/evidence-check.d.ts +1 -1
  17. package/dist/tools/file-extractor.d.ts +1 -1
  18. package/dist/tools/get-approved-plan.d.ts +1 -1
  19. package/dist/tools/knowledge-query.d.ts +1 -1
  20. package/dist/tools/lint.d.ts +1 -1
  21. package/dist/tools/pkg-audit.d.ts +1 -1
  22. package/dist/tools/placeholder-scan.d.ts +1 -1
  23. package/dist/tools/pre-check-batch.d.ts +1 -1
  24. package/dist/tools/quality-budget.d.ts +1 -1
  25. package/dist/tools/req-coverage.d.ts +1 -1
  26. package/dist/tools/save-plan.d.ts +1 -1
  27. package/dist/tools/sbom-generate.d.ts +1 -1
  28. package/dist/tools/schema-drift.d.ts +1 -1
  29. package/dist/tools/search.d.ts +1 -1
  30. package/dist/tools/set-qa-gates.d.ts +1 -1
  31. package/dist/tools/suggest-patch.d.ts +1 -1
  32. package/dist/tools/symbols.d.ts +1 -1
  33. package/dist/tools/syntax-check.d.ts +1 -1
  34. package/dist/tools/test-runner.d.ts +1 -1
  35. package/dist/tools/todo-extract.d.ts +1 -1
  36. package/dist/tools/update-task-status.d.ts +1 -1
  37. package/dist/tools/web-search.d.ts +1 -1
  38. package/dist/tools/write-drift-evidence.d.ts +1 -1
  39. package/dist/tools/write-hallucination-evidence.d.ts +1 -1
  40. package/dist/tools/write-mutation-evidence.d.ts +1 -1
  41. package/dist/tools/write-retro.d.ts +1 -1
  42. package/package.json +1 -1
  43. package/dist/knowledge/hive-promoter.d.ts +0 -23
@@ -1,4 +1,4 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
2
  export interface SymbolInfo {
3
3
  name: string;
4
4
  kind: 'function' | 'class' | 'interface' | 'type' | 'enum' | 'const' | 'variable' | 'method' | 'property';
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Discovers and runs build commands for various ecosystems in a project directory.
5
5
  */
6
- import { tool } from '@opencode-ai/plugin';
6
+ import type { tool } from '@opencode-ai/plugin';
7
7
  import type { EvidenceVerdict } from '../config/evidence-schema';
8
8
  export declare const DEFAULT_TIMEOUT_MS = 300000;
9
9
  export declare const MAX_OUTPUT_BYTES: number;
@@ -3,5 +3,5 @@
3
3
  * Reads .swarm/evidence/{taskId}.json and returns structured JSON describing
4
4
  * which gates have passed, which are missing, and overall task status.
5
5
  */
6
- import { tool } from '@opencode-ai/plugin';
6
+ import type { tool } from '@opencode-ai/plugin';
7
7
  export declare const check_gate_status: ReturnType<typeof tool>;
@@ -1,2 +1,2 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
2
  export declare const checkpoint: ToolDefinition;
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  import type { SwarmKnowledgeEntry } from '../hooks/knowledge-types.js';
3
3
  export interface CoChangeEntry {
4
4
  fileA: string;
@@ -3,7 +3,7 @@
3
3
  * identifiers exist in their target source files before phase completion.
4
4
  * Blocks if obviously incomplete.
5
5
  */
6
- import { type ToolDefinition } from '@opencode-ai/plugin';
6
+ import type { ToolDefinition } from '@opencode-ai/plugin';
7
7
  /**
8
8
  * Arguments for the completion_verify tool
9
9
  */
@@ -1,2 +1,2 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  export declare const complexity_hotspots: ReturnType<typeof tool>;
@@ -8,7 +8,7 @@
8
8
  * Config-gated (council.enabled must be true) and architect-only via
9
9
  * AGENT_TOOL_MAP. Follows the check-gate-status.ts pattern.
10
10
  */
11
- import { tool } from '@opencode-ai/plugin';
11
+ import type { tool } from '@opencode-ai/plugin';
12
12
  import { z } from 'zod';
13
13
  export declare const ArgsSchema: z.ZodObject<{
14
14
  taskId: z.ZodString;
@@ -21,5 +21,5 @@
21
21
  * Evidence path is .swarm/council/general/ (subdirectory; never writes to
22
22
  * .swarm/council/ root, where the QA council stores its files).
23
23
  */
24
- import { tool } from '@opencode-ai/plugin';
24
+ import type { tool } from '@opencode-ai/plugin';
25
25
  export declare const convene_general_council: ReturnType<typeof tool>;
@@ -1,4 +1,12 @@
1
1
  import { type ToolContext, tool } from '@opencode-ai/plugin';
2
+ /**
3
+ * ToolResult can be string | {output: string; metadata?: any}
4
+ * This type matches what the plugin's tool() function expects as a return value.
5
+ */
6
+ export type ToolResult = string | {
7
+ output: string;
8
+ metadata?: unknown;
9
+ };
2
10
  /**
3
11
  * Options for creating a swarm tool.
4
12
  * The args type is inferred from what you pass to the tool() call.
@@ -10,7 +18,7 @@ import { type ToolContext, tool } from '@opencode-ai/plugin';
10
18
  export interface SwarmToolOptions<Args extends Record<string, unknown>> {
11
19
  description: string;
12
20
  args: Args;
13
- execute: (args: Args, directory: string, ctx?: ToolContext) => Promise<string>;
21
+ execute: (args: Args, directory: string, ctx?: ToolContext) => Promise<ToolResult>;
14
22
  }
15
23
  /**
16
24
  * Creates a swarm tool with automatic working directory injection.
@@ -10,5 +10,5 @@
10
10
  * Config-gated (council.enabled must be true) and architect-only via
11
11
  * AGENT_TOOL_MAP. Follows the convene-council.ts pattern.
12
12
  */
13
- import { tool } from '@opencode-ai/plugin';
13
+ import type { tool } from '@opencode-ai/plugin';
14
14
  export declare const declare_council_criteria: ReturnType<typeof tool>;
@@ -3,7 +3,7 @@
3
3
  * Implements FR-010: Declare coder scope before delegation.
4
4
  * This tool must be called before delegating to coder to enable scope containment checking.
5
5
  */
6
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
6
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
7
7
  /**
8
8
  * Arguments for the declare_scope tool
9
9
  */
@@ -1,6 +1,6 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  /**
3
3
  * Detect SME domains from text content.
4
4
  * Returns list of domains that match patterns in the input.
5
5
  */
6
- export declare const detect_domains: ToolDefinition;
6
+ export declare const detect_domains: ReturnType<typeof tool>;
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  interface CompletedTask {
3
3
  taskId: string;
4
4
  taskName: string;
@@ -1,4 +1,4 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
2
  /**
3
3
  * Extract filename from code content or context
4
4
  */
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * @see https://github.com/zaxbysauce/opencode-swarm/issues/449
16
16
  */
17
- import { tool } from '@opencode-ai/plugin';
17
+ import type { tool } from '@opencode-ai/plugin';
18
18
  interface GetApprovedPlanResult {
19
19
  success: boolean;
20
20
  reason?: string;
@@ -1,5 +1,5 @@
1
1
  /** Knowledge query tool for architect-level access to swarm and hive knowledge.
2
2
  * Provides filtered, formatted text output for knowledge retrieval.
3
3
  */
4
- import { tool } from '@opencode-ai/plugin';
4
+ import type { tool } from '@opencode-ai/plugin';
5
5
  export declare const knowledge_query: ReturnType<typeof tool>;
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  export declare const MAX_OUTPUT_BYTES = 512000;
3
3
  export declare const MAX_COMMAND_LENGTH = 500;
4
4
  export declare const SUPPORTED_LINTERS: readonly ["biome", "eslint"];
@@ -1,2 +1,2 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  export declare const pkg_audit: ReturnType<typeof tool>;
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  import type { EvidenceVerdict } from '../config/evidence-schema';
3
3
  export interface PlaceholderScanInput {
4
4
  changed_files: string[];
@@ -3,7 +3,7 @@
3
3
  * Runs 4 verification tools in parallel: lint, secretscan, sast-scan, quality-budget
4
4
  * Returns unified result with gates_passed status
5
5
  */
6
- import { tool } from '@opencode-ai/plugin';
6
+ import type { tool } from '@opencode-ai/plugin';
7
7
  import type { PluginConfig } from '../config';
8
8
  import type { LintResult } from './lint';
9
9
  import type { QualityBudgetResult } from './quality-budget';
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  import type { QualityBudgetConfig } from '../config/schema';
3
3
  import { type QualityMetrics, type QualityViolation } from '../quality/metrics';
4
4
  export interface QualityBudgetInput {
@@ -3,7 +3,7 @@
3
3
  * Reads .swarm/spec.md for FR-### requirements and checks coverage against
4
4
  * files touched during a phase via evidence files.
5
5
  */
6
- import { tool } from '@opencode-ai/plugin';
6
+ import type { tool } from '@opencode-ai/plugin';
7
7
  declare const OBLIGATION_KEYWORDS: readonly ["MUST", "SHOULD", "SHALL"];
8
8
  type ObligationLevel = (typeof OBLIGATION_KEYWORDS)[number];
9
9
  interface Requirement {
@@ -2,7 +2,7 @@
2
2
  * Save plan tool for persisting validated implementation plans.
3
3
  * Allows the Architect agent to save structured plans to .swarm/plan.json and .swarm/plan.md.
4
4
  */
5
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
5
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
6
6
  /**
7
7
  * Arguments for the save_plan tool
8
8
  */
@@ -4,7 +4,7 @@
4
4
  * Generates Software Bill of Materials (SBOM) by scanning project
5
5
  * for manifest/lock files and generating CycloneDX format output.
6
6
  */
7
- import { tool } from '@opencode-ai/plugin';
7
+ import type { tool } from '@opencode-ai/plugin';
8
8
  export interface SbomGenerateInput {
9
9
  /** Scope of the scan: 'changed' for modified files only, 'all' for entire project */
10
10
  scope: 'changed' | 'all';
@@ -1,2 +1,2 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  export declare const schema_drift: ReturnType<typeof tool>;
@@ -1,4 +1,4 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
2
  export interface SearchMatch {
3
3
  file: string;
4
4
  lineNumber: number;
@@ -8,7 +8,7 @@
8
8
  * Creates the profile with defaults if missing, then applies the requested
9
9
  * partial update.
10
10
  */
11
- import { tool } from '@opencode-ai/plugin';
11
+ import type { tool } from '@opencode-ai/plugin';
12
12
  export interface SetQaGatesArgs {
13
13
  reviewer?: boolean;
14
14
  test_engineer?: boolean;
@@ -1,4 +1,4 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
2
  export interface PatchHunk {
3
3
  file: string;
4
4
  originalContext: string[];
@@ -1,4 +1,4 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
2
2
  interface SymbolInfo {
3
3
  name: string;
4
4
  kind: 'function' | 'class' | 'interface' | 'type' | 'enum' | 'const' | 'variable' | 'method' | 'property';
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  import type { PluginConfig } from '../config';
3
3
  import type { EvidenceVerdict } from '../config/evidence-schema';
4
4
  export interface SyntaxCheckInput {
@@ -1,4 +1,4 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  export declare const MAX_OUTPUT_BYTES = 512000;
3
3
  export declare const MAX_COMMAND_LENGTH = 500;
4
4
  export declare const DEFAULT_TIMEOUT_MS = 60000;
@@ -1,2 +1,2 @@
1
- import { tool } from '@opencode-ai/plugin';
1
+ import type { tool } from '@opencode-ai/plugin';
2
2
  export declare const todo_extract: ReturnType<typeof tool>;
@@ -2,7 +2,7 @@
2
2
  * Update task status tool for changing the status of individual tasks in a plan.
3
3
  * Allows agents to mark tasks as pending, in_progress, completed, or blocked.
4
4
  */
5
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
5
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
6
6
  /**
7
7
  * Arguments for the update_task_status tool
8
8
  */
@@ -9,5 +9,5 @@
9
9
  *
10
10
  * Hard cap on max_results = 10 (clamped silently). Default sourced from council.general.maxSourcesPerMember.
11
11
  */
12
- import { tool } from '@opencode-ai/plugin';
12
+ import type { tool } from '@opencode-ai/plugin';
13
13
  export declare const web_search: ReturnType<typeof tool>;
@@ -3,7 +3,7 @@
3
3
  * Accepts phase, verdict, and summary from the Architect and writes
4
4
  * a gate-contract formatted evidence file.
5
5
  */
6
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
6
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
7
7
  /**
8
8
  * Arguments for the write_drift_evidence tool
9
9
  */
@@ -6,7 +6,7 @@
6
6
  * Unlike write_drift_evidence, this tool does NOT lock the QA gate profile or
7
7
  * write a plan snapshot — those side-effects belong to drift verification only.
8
8
  */
9
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
9
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
10
10
  /**
11
11
  * Arguments for the write_hallucination_evidence tool
12
12
  */
@@ -6,7 +6,7 @@
6
6
  * Unlike write_drift_evidence, this tool does NOT lock the QA gate profile or
7
7
  * write a plan snapshot — those side-effects belong to drift verification only.
8
8
  */
9
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
9
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
10
10
  /**
11
11
  * Arguments for the write_mutation_evidence tool
12
12
  */
@@ -4,7 +4,7 @@
4
4
  * in a RetrospectiveEvidence entry before calling saveEvidence().
5
5
  * This fixes the bug where Architect was writing flat JSON that failed EvidenceBundleSchema.parse().
6
6
  */
7
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
7
+ import type { ToolDefinition } from '@opencode-ai/plugin/tool';
8
8
  /**
9
9
  * Arguments for the write_retro tool
10
10
  * User-supplied fields (the Architect provides these)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.85.3",
3
+ "version": "6.85.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",
@@ -1,23 +0,0 @@
1
- /**
2
- * Hive promotion logic for manually promoting lessons to the hive knowledge store.
3
- */
4
- export interface LessonValidationResult {
5
- valid: boolean;
6
- reason?: string;
7
- }
8
- /**
9
- * Validate a lesson text for dangerous content or raw shell commands.
10
- */
11
- export declare function validateLesson(text: string): LessonValidationResult;
12
- /**
13
- * Return the platform-appropriate path to the hive knowledge file.
14
- */
15
- export declare function getHiveFilePath(): string;
16
- /**
17
- * Promote a lesson text directly to the hive knowledge store.
18
- */
19
- export declare function promoteToHive(_directory: string, lesson: string, category?: string): Promise<string>;
20
- /**
21
- * Promote an existing lesson from .swarm/knowledge.jsonl to the hive by ID.
22
- */
23
- export declare function promoteFromSwarm(directory: string, lessonId: string): Promise<string>;