opencode-swarm 4.4.0 → 5.0.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.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  <p align="center">
2
- <img src="https://img.shields.io/badge/version-4.3.1-blue" alt="Version">
2
+ <img src="https://img.shields.io/badge/version-5.0.0-blue" alt="Version">
3
3
  <img src="https://img.shields.io/badge/license-MIT-green" alt="License">
4
4
  <img src="https://img.shields.io/badge/opencode-plugin-purple" alt="OpenCode Plugin">
5
5
  <img src="https://img.shields.io/badge/agents-8-orange" alt="Agents">
6
- <img src="https://img.shields.io/badge/tests-483-brightgreen" alt="Tests">
6
+ <img src="https://img.shields.io/badge/tests-876-brightgreen" alt="Tests">
7
7
  </p>
8
8
 
9
9
  <h1 align="center">🐝 OpenCode Swarm</h1>
@@ -168,8 +168,11 @@ Other frameworks lose everything when the session ends. Swarm doesn't.
168
168
 
169
169
  ```
170
170
  .swarm/
171
- ├── plan.md # Your project roadmap
171
+ ├── plan.md # Your project roadmap (+ plan.json)
172
172
  ├── context.md # Everything a new Architect needs
173
+ ├── evidence/ # Per-task execution evidence
174
+ │ ├── 1.1/ # Evidence for task 1.1
175
+ │ └── 2.3/ # Evidence for task 2.3
173
176
  └── history/
174
177
  ├── phase-1.md # What was done, what was learned
175
178
  └── phase-2.md
@@ -313,37 +316,62 @@ Each architect automatically delegates to its own swarm's agents.
313
316
  ## Installation
314
317
 
315
318
  ```bash
316
- # Add to opencode.json
317
- {
318
- "plugin": ["opencode-swarm"]
319
- }
320
-
321
- # Or install via CLI
319
+ # Install via CLI (recommended)
322
320
  bunx opencode-swarm install
323
321
  ```
324
322
 
325
- ---
326
-
327
- ## What's New in v4.3.0
323
+ ### Uninstall
328
324
 
329
- ### 🔧 Hooks Pipeline
330
- - **`safeHook()`** Crash-safe wrapper for all hooks. Errors are caught and logged, never crash the plugin.
331
- - **`composeHandlers()`** — Compose multiple handlers for the same hook type (Plugin API allows only one handler per type).
325
+ ```bash
326
+ # Remove from opencode.json
327
+ bunx opencode-swarm uninstall
332
328
 
333
- ### 📊 Context Pruning
334
- - **Token budget tracking** — Estimates context window usage and injects warnings at 70% and 90% thresholds.
335
- - **Enhanced session compaction** — Guides OpenCode's built-in compaction with plan.md phases and context.md decisions.
336
- - **System prompt enhancement** — Injects current phase, task, and key decisions to keep agents focused post-compaction.
329
+ # Remove from opencode.json + clean up config files
330
+ bunx opencode-swarm uninstall --clean
331
+ ```
337
332
 
338
- ### ⚡ Slash Commands
339
- - **`/swarm status`** — Current phase, progress, and agent count.
340
- - **`/swarm plan [N]`** — View full plan or a specific phase.
341
- - **`/swarm agents`** — List all registered agents with models and permissions.
333
+ ---
342
334
 
343
- ### 🤖 Agent Awareness
344
- - **Activity tracking** — Tool usage tracked per agent via `tool.execute.before/after` hooks. Activity summary flushed to context.md every 20 events.
345
- - **Delegation tracking** — Active agent per session tracked via `chat.message` hook. Optional delegation chain logging.
346
- - **Cross-agent context** — System enhancer injects relevant context from other agents' activity into system prompts.
335
+ ## What's New
336
+
337
+ ### v5.0.0 Verifiable Execution
338
+ - **Canonical plan schema** — Machine-readable `plan.json` with Zod-validated `PlanSchema`/`TaskSchema`/`PhaseSchema`. Automatic migration from legacy `plan.md` format. Structured status tracking (`pending`, `in_progress`, `completed`, `blocked`).
339
+ - **Evidence bundles** — Per-task execution evidence persisted to `.swarm/evidence/`. Five evidence types: `review`, `test`, `diff`, `approval`, `note`. Sanitized task IDs, atomic writes, configurable size limits. `/swarm evidence` to view, `/swarm archive` to manage retention.
340
+ - **Per-agent guardrail profiles** — Override guardrail limits for individual agents via `guardrails.profiles`. `resolveGuardrailsConfig()` merges base + profile with per-agent specificity.
341
+ - **Context injection budget** — `max_injection_tokens` config controls how much context is injected into system prompts. Priority-ordered: phase → task → decisions → agent context. Lower-priority items dropped when budget exhausted.
342
+ - **Enhanced `/swarm agents`** — Agent count summary, `⚡ custom limits` indicator for profiled agents, guardrail profiles section.
343
+ - **Packaging smoke tests** — CI-safe `dist/` validation (8 tests).
344
+ - **208 new tests** — 876 total tests across 39 files (up from 668 in v4.6.0).
345
+
346
+ ### v4.6.0 — Agent Guardrails
347
+ - **Circuit breaker** — Two-layer protection against runaway agents. Soft warning at 50% of limits, hard block at 100%. Prevents infinite loops and runaway API costs.
348
+ - **Detection signals** — Tool call count, wall-clock time, consecutive repetition, and consecutive error tracking per agent session.
349
+ - **Configurable limits** — All thresholds tunable via `guardrails` config: `max_tool_calls`, `max_duration_minutes`, `max_repetitions`, `max_consecutive_errors`, `warning_threshold`.
350
+ - **46 new tests** — 668 total tests across 30 files.
351
+
352
+ ### v4.5.0 — Tech Debt + New Commands
353
+ - **Lint cleanup** — Replaced string concatenation with template literals, documented `as any` casts with biome-ignore comments.
354
+ - **Code deduplication** — Extracted `stripSwarmPrefix()` utility to eliminate 3 duplicate prefix-stripping blocks.
355
+ - **`/swarm diagnose`** — Health check for `.swarm/` files, plan structure, and plugin configuration.
356
+ - **`/swarm export`** — Export plan.md and context.md as portable JSON.
357
+ - **`/swarm reset --confirm`** — Clear swarm state files with safety confirmation.
358
+
359
+ ### v4.4.0 — DX & Quality
360
+ - **CLI `uninstall` command** — Remove plugin with optional `--clean` flag.
361
+ - **Custom error classes** — `SwarmError` hierarchy with actionable `guidance` messages.
362
+ - **`/swarm history`** — View completed phases from plan.md.
363
+ - **`/swarm config`** — View current resolved plugin configuration.
364
+
365
+ ### v4.3.2 — Security Hardening
366
+ - **Path validation** — `validateSwarmPath()` prevents directory traversal in `.swarm/` file operations.
367
+ - **Fetch hardening** — 10s timeout, 5MB limit, retry logic for gitingest tool.
368
+ - **Config limits** — Deep merge depth limit (10), config file size limit (100KB).
369
+
370
+ ### v4.3.0 — Hooks & Agent Awareness
371
+ - **Hooks pipeline** — `safeHook()` crash-safe wrapper, `composeHandlers()` for multi-handler composition.
372
+ - **Context pruning** — Token budget tracking with 70%/90% threshold warnings.
373
+ - **Slash commands** — `/swarm status`, `/swarm plan`, `/swarm agents`.
374
+ - **Agent awareness** — Activity tracking, delegation tracking, cross-agent context injection.
347
375
 
348
376
  All features are opt-in via configuration. See [Installation Guide](docs/installation.md) for config options.
349
377
 
@@ -380,6 +408,23 @@ All features are opt-in via configuration. See [Installation Guide](docs/install
380
408
 
381
409
  ---
382
410
 
411
+ ## Slash Commands
412
+
413
+ | Command | Description |
414
+ |---------|-------------|
415
+ | `/swarm status` | Current phase, task progress, and agent count |
416
+ | `/swarm plan [N]` | View full plan or filter by phase number |
417
+ | `/swarm agents` | List all registered agents with models and permissions |
418
+ | `/swarm history` | View completed phases with status icons |
419
+ | `/swarm config` | View current resolved plugin configuration |
420
+ | `/swarm diagnose` | Health check for .swarm/ files and config |
421
+ | `/swarm export` | Export plan and context as portable JSON |
422
+ | `/swarm reset --confirm` | Clear swarm state files (with safety gate) |
423
+ | `/swarm evidence [task]` | View evidence bundles for a task or all tasks |
424
+ | `/swarm archive [--dry-run]` | Archive old evidence bundles with retention policy |
425
+
426
+ ---
427
+
383
428
  ## Configuration
384
429
 
385
430
  Create `~/.config/opencode/opencode-swarm.json`:
@@ -408,6 +453,73 @@ Create `~/.config/opencode/opencode-swarm.json`:
408
453
 
409
454
  ---
410
455
 
456
+ ## Guardrails
457
+
458
+ OpenCode Swarm includes a built-in circuit breaker that prevents subagents from running away — burning API credits in infinite loops, repeating the same tool call, or spinning for hours.
459
+
460
+ ### How It Works
461
+
462
+ | Layer | Trigger | Action |
463
+ |-------|---------|--------|
464
+ | ⚠️ **Soft Warning** | 50% of any limit reached | Injects warning message into agent's chat stream |
465
+ | 🛑 **Hard Block** | 100% of any limit reached | Blocks ALL further tool calls + injects stop message |
466
+
467
+ ### Detection Signals
468
+
469
+ | Signal | Default Limit | Description |
470
+ |--------|---------------|-------------|
471
+ | Tool calls | 200 | Total tool invocations per agent session |
472
+ | Duration | 30 min | Wall-clock time since delegation started |
473
+ | Repetition | 10 | Same tool + args called consecutively |
474
+ | Consecutive errors | 5 | Sequential null/undefined tool outputs |
475
+
476
+ ### Configuration
477
+
478
+ Guardrails are **enabled by default**. Customize in your swarm config:
479
+
480
+ ```jsonc
481
+ {
482
+ "guardrails": {
483
+ "enabled": true, // default: true
484
+ "max_tool_calls": 200, // range: 10–1000
485
+ "max_duration_minutes": 30, // range: 1–120
486
+ "max_repetitions": 10, // range: 3–50
487
+ "max_consecutive_errors": 5, // range: 2–20
488
+ "warning_threshold": 0.5 // range: 0.1–0.9 (fraction of limit for soft warning)
489
+ }
490
+ }
491
+ ```
492
+
493
+ ### Per-Agent Profiles
494
+
495
+ Override limits for specific agents that need more (or less) room:
496
+
497
+ ```jsonc
498
+ {
499
+ "guardrails": {
500
+ "max_tool_calls": 200,
501
+ "profiles": {
502
+ "coder": { "max_tool_calls": 500, "max_duration_minutes": 60 },
503
+ "explorer": { "max_tool_calls": 50 }
504
+ }
505
+ }
506
+ }
507
+ ```
508
+
509
+ Profiles merge with base config — only specified fields are overridden.
510
+
511
+ ### Disable Guardrails
512
+
513
+ ```json
514
+ {
515
+ "guardrails": {
516
+ "enabled": false
517
+ }
518
+ }
519
+ ```
520
+
521
+ ---
522
+
411
523
  ## Comparison
412
524
 
413
525
  | Feature | OpenCode Swarm | AutoGen | CrewAI | LangGraph |
@@ -448,7 +560,22 @@ bun test
448
560
  bun test tests/unit/config/schema.test.ts
449
561
  ```
450
562
 
451
- 447 unit tests across 21 files covering config, tools, agents, hooks, commands, and state. Uses Bun's built-in test runner — zero additional test dependencies.
563
+ 876 unit tests across 39 files covering config, tools, agents, hooks, commands, state, guardrails, evidence, and plan schemas. Uses Bun's built-in test runner — zero additional test dependencies.
564
+
565
+ ## Troubleshooting
566
+
567
+ ### Plugin not loading
568
+ 1. Verify `opencode-swarm` is listed in your `opencode.json` plugins array
569
+ 2. Run `bunx opencode-swarm install` to auto-configure
570
+ 3. Run `/swarm diagnose` to check health status
571
+
572
+ ### Commands not working
573
+ - Ensure you're using `/swarm <command>`, not `/swarm/<command>`
574
+ - Run `/swarm` with no arguments to see available commands
575
+
576
+ ### Resuming a project
577
+ - Swarm automatically detects `.swarm/plan.md` and resumes where you left off
578
+ - If you get unexpected behavior, run `/swarm export` to backup, then `/swarm reset --confirm` to start fresh
452
579
 
453
580
  ---
454
581
 
@@ -2,6 +2,12 @@ import type { AgentConfig as SDKAgentConfig } from '@opencode-ai/sdk';
2
2
  import { type PluginConfig } from '../config';
3
3
  import { type AgentDefinition } from './architect';
4
4
  export type { AgentDefinition } from './architect';
5
+ /**
6
+ * Strip the swarm prefix from an agent name to get the base name.
7
+ * e.g., "local_coder" with prefix "local" → "coder"
8
+ * Returns the name unchanged if no prefix matches.
9
+ */
10
+ export declare function stripSwarmPrefix(agentName: string, swarmPrefix?: string): string;
5
11
  /**
6
12
  * Create all agent definitions with configuration applied
7
13
  */
@@ -1,2 +1,3 @@
1
1
  import type { AgentDefinition } from '../agents';
2
- export declare function handleAgentsCommand(agents: Record<string, AgentDefinition>): string;
2
+ import type { GuardrailsConfig } from '../config/schema';
3
+ export declare function handleAgentsCommand(agents: Record<string, AgentDefinition>, guardrails?: GuardrailsConfig): string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Handles the /swarm archive command.
3
+ * Archives old evidence bundles based on retention policy.
4
+ */
5
+ export declare function handleArchiveCommand(directory: string, args: string[]): Promise<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Handles the /swarm diagnose command.
3
+ * Performs health checks on swarm state files and configuration.
4
+ */
5
+ export declare function handleDiagnoseCommand(directory: string, _args: string[]): Promise<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Handles the /swarm evidence command.
3
+ * Lists all evidence bundles or shows details for a specific task.
4
+ */
5
+ export declare function handleEvidenceCommand(directory: string, args: string[]): Promise<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Handles the /swarm export command.
3
+ * Exports plan.md and context.md as a portable JSON object.
4
+ */
5
+ export declare function handleExportCommand(directory: string, _args: string[]): Promise<string>;
@@ -1,8 +1,13 @@
1
1
  import type { AgentDefinition } from '../agents';
2
2
  export { handleAgentsCommand } from './agents';
3
+ export { handleArchiveCommand } from './archive';
3
4
  export { handleConfigCommand } from './config';
5
+ export { handleDiagnoseCommand } from './diagnose';
6
+ export { handleEvidenceCommand } from './evidence';
7
+ export { handleExportCommand } from './export';
4
8
  export { handleHistoryCommand } from './history';
5
9
  export { handlePlanCommand } from './plan';
10
+ export { handleResetCommand } from './reset';
6
11
  export { handleStatusCommand } from './status';
7
12
  /**
8
13
  * Creates a command.execute.before handler for /swarm commands.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Handles the /swarm reset command.
3
+ * Clears plan.md and context.md from .swarm/ directory.
4
+ * Requires --confirm flag as a safety gate.
5
+ */
6
+ export declare function handleResetCommand(directory: string, args: string[]): Promise<string>;
@@ -0,0 +1,353 @@
1
+ import { z } from 'zod';
2
+ export declare const EVIDENCE_MAX_JSON_BYTES: number;
3
+ export declare const EVIDENCE_MAX_PATCH_BYTES: number;
4
+ export declare const EVIDENCE_MAX_TASK_BYTES: number;
5
+ export declare const EvidenceTypeSchema: z.ZodEnum<{
6
+ review: "review";
7
+ test: "test";
8
+ diff: "diff";
9
+ approval: "approval";
10
+ note: "note";
11
+ }>;
12
+ export type EvidenceType = z.infer<typeof EvidenceTypeSchema>;
13
+ export declare const EvidenceVerdictSchema: z.ZodEnum<{
14
+ pass: "pass";
15
+ fail: "fail";
16
+ approved: "approved";
17
+ rejected: "rejected";
18
+ info: "info";
19
+ }>;
20
+ export type EvidenceVerdict = z.infer<typeof EvidenceVerdictSchema>;
21
+ export declare const BaseEvidenceSchema: z.ZodObject<{
22
+ task_id: z.ZodString;
23
+ type: z.ZodEnum<{
24
+ review: "review";
25
+ test: "test";
26
+ diff: "diff";
27
+ approval: "approval";
28
+ note: "note";
29
+ }>;
30
+ timestamp: z.ZodString;
31
+ agent: z.ZodString;
32
+ verdict: z.ZodEnum<{
33
+ pass: "pass";
34
+ fail: "fail";
35
+ approved: "approved";
36
+ rejected: "rejected";
37
+ info: "info";
38
+ }>;
39
+ summary: z.ZodString;
40
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
41
+ }, z.core.$strip>;
42
+ export type BaseEvidence = z.infer<typeof BaseEvidenceSchema>;
43
+ export declare const ReviewEvidenceSchema: z.ZodObject<{
44
+ task_id: z.ZodString;
45
+ timestamp: z.ZodString;
46
+ agent: z.ZodString;
47
+ verdict: z.ZodEnum<{
48
+ pass: "pass";
49
+ fail: "fail";
50
+ approved: "approved";
51
+ rejected: "rejected";
52
+ info: "info";
53
+ }>;
54
+ summary: z.ZodString;
55
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
56
+ type: z.ZodLiteral<"review">;
57
+ risk: z.ZodEnum<{
58
+ medium: "medium";
59
+ low: "low";
60
+ high: "high";
61
+ critical: "critical";
62
+ }>;
63
+ issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
64
+ severity: z.ZodEnum<{
65
+ error: "error";
66
+ info: "info";
67
+ warning: "warning";
68
+ }>;
69
+ message: z.ZodString;
70
+ file: z.ZodOptional<z.ZodString>;
71
+ line: z.ZodOptional<z.ZodNumber>;
72
+ }, z.core.$strip>>>;
73
+ }, z.core.$strip>;
74
+ export type ReviewEvidence = z.infer<typeof ReviewEvidenceSchema>;
75
+ export declare const TestEvidenceSchema: z.ZodObject<{
76
+ task_id: z.ZodString;
77
+ timestamp: z.ZodString;
78
+ agent: z.ZodString;
79
+ verdict: z.ZodEnum<{
80
+ pass: "pass";
81
+ fail: "fail";
82
+ approved: "approved";
83
+ rejected: "rejected";
84
+ info: "info";
85
+ }>;
86
+ summary: z.ZodString;
87
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
88
+ type: z.ZodLiteral<"test">;
89
+ tests_passed: z.ZodNumber;
90
+ tests_failed: z.ZodNumber;
91
+ test_file: z.ZodOptional<z.ZodString>;
92
+ failures: z.ZodDefault<z.ZodArray<z.ZodObject<{
93
+ name: z.ZodString;
94
+ message: z.ZodString;
95
+ }, z.core.$strip>>>;
96
+ }, z.core.$strip>;
97
+ export type TestEvidence = z.infer<typeof TestEvidenceSchema>;
98
+ export declare const DiffEvidenceSchema: z.ZodObject<{
99
+ task_id: z.ZodString;
100
+ timestamp: z.ZodString;
101
+ agent: z.ZodString;
102
+ verdict: z.ZodEnum<{
103
+ pass: "pass";
104
+ fail: "fail";
105
+ approved: "approved";
106
+ rejected: "rejected";
107
+ info: "info";
108
+ }>;
109
+ summary: z.ZodString;
110
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
111
+ type: z.ZodLiteral<"diff">;
112
+ files_changed: z.ZodDefault<z.ZodArray<z.ZodString>>;
113
+ additions: z.ZodDefault<z.ZodNumber>;
114
+ deletions: z.ZodDefault<z.ZodNumber>;
115
+ patch_path: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strip>;
117
+ export type DiffEvidence = z.infer<typeof DiffEvidenceSchema>;
118
+ export declare const ApprovalEvidenceSchema: z.ZodObject<{
119
+ task_id: z.ZodString;
120
+ timestamp: z.ZodString;
121
+ agent: z.ZodString;
122
+ verdict: z.ZodEnum<{
123
+ pass: "pass";
124
+ fail: "fail";
125
+ approved: "approved";
126
+ rejected: "rejected";
127
+ info: "info";
128
+ }>;
129
+ summary: z.ZodString;
130
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
131
+ type: z.ZodLiteral<"approval">;
132
+ }, z.core.$strip>;
133
+ export type ApprovalEvidence = z.infer<typeof ApprovalEvidenceSchema>;
134
+ export declare const NoteEvidenceSchema: z.ZodObject<{
135
+ task_id: z.ZodString;
136
+ timestamp: z.ZodString;
137
+ agent: z.ZodString;
138
+ verdict: z.ZodEnum<{
139
+ pass: "pass";
140
+ fail: "fail";
141
+ approved: "approved";
142
+ rejected: "rejected";
143
+ info: "info";
144
+ }>;
145
+ summary: z.ZodString;
146
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
147
+ type: z.ZodLiteral<"note">;
148
+ }, z.core.$strip>;
149
+ export type NoteEvidence = z.infer<typeof NoteEvidenceSchema>;
150
+ export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
151
+ task_id: z.ZodString;
152
+ timestamp: z.ZodString;
153
+ agent: z.ZodString;
154
+ verdict: z.ZodEnum<{
155
+ pass: "pass";
156
+ fail: "fail";
157
+ approved: "approved";
158
+ rejected: "rejected";
159
+ info: "info";
160
+ }>;
161
+ summary: z.ZodString;
162
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
163
+ type: z.ZodLiteral<"review">;
164
+ risk: z.ZodEnum<{
165
+ medium: "medium";
166
+ low: "low";
167
+ high: "high";
168
+ critical: "critical";
169
+ }>;
170
+ issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
171
+ severity: z.ZodEnum<{
172
+ error: "error";
173
+ info: "info";
174
+ warning: "warning";
175
+ }>;
176
+ message: z.ZodString;
177
+ file: z.ZodOptional<z.ZodString>;
178
+ line: z.ZodOptional<z.ZodNumber>;
179
+ }, z.core.$strip>>>;
180
+ }, z.core.$strip>, z.ZodObject<{
181
+ task_id: z.ZodString;
182
+ timestamp: z.ZodString;
183
+ agent: z.ZodString;
184
+ verdict: z.ZodEnum<{
185
+ pass: "pass";
186
+ fail: "fail";
187
+ approved: "approved";
188
+ rejected: "rejected";
189
+ info: "info";
190
+ }>;
191
+ summary: z.ZodString;
192
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
193
+ type: z.ZodLiteral<"test">;
194
+ tests_passed: z.ZodNumber;
195
+ tests_failed: z.ZodNumber;
196
+ test_file: z.ZodOptional<z.ZodString>;
197
+ failures: z.ZodDefault<z.ZodArray<z.ZodObject<{
198
+ name: z.ZodString;
199
+ message: z.ZodString;
200
+ }, z.core.$strip>>>;
201
+ }, z.core.$strip>, z.ZodObject<{
202
+ task_id: z.ZodString;
203
+ timestamp: z.ZodString;
204
+ agent: z.ZodString;
205
+ verdict: z.ZodEnum<{
206
+ pass: "pass";
207
+ fail: "fail";
208
+ approved: "approved";
209
+ rejected: "rejected";
210
+ info: "info";
211
+ }>;
212
+ summary: z.ZodString;
213
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
214
+ type: z.ZodLiteral<"diff">;
215
+ files_changed: z.ZodDefault<z.ZodArray<z.ZodString>>;
216
+ additions: z.ZodDefault<z.ZodNumber>;
217
+ deletions: z.ZodDefault<z.ZodNumber>;
218
+ patch_path: z.ZodOptional<z.ZodString>;
219
+ }, z.core.$strip>, z.ZodObject<{
220
+ task_id: z.ZodString;
221
+ timestamp: z.ZodString;
222
+ agent: z.ZodString;
223
+ verdict: z.ZodEnum<{
224
+ pass: "pass";
225
+ fail: "fail";
226
+ approved: "approved";
227
+ rejected: "rejected";
228
+ info: "info";
229
+ }>;
230
+ summary: z.ZodString;
231
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
232
+ type: z.ZodLiteral<"approval">;
233
+ }, z.core.$strip>, z.ZodObject<{
234
+ task_id: z.ZodString;
235
+ timestamp: z.ZodString;
236
+ agent: z.ZodString;
237
+ verdict: z.ZodEnum<{
238
+ pass: "pass";
239
+ fail: "fail";
240
+ approved: "approved";
241
+ rejected: "rejected";
242
+ info: "info";
243
+ }>;
244
+ summary: z.ZodString;
245
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ type: z.ZodLiteral<"note">;
247
+ }, z.core.$strip>], "type">;
248
+ export type Evidence = z.infer<typeof EvidenceSchema>;
249
+ export declare const EvidenceBundleSchema: z.ZodObject<{
250
+ schema_version: z.ZodLiteral<"1.0.0">;
251
+ task_id: z.ZodString;
252
+ entries: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
253
+ task_id: z.ZodString;
254
+ timestamp: z.ZodString;
255
+ agent: z.ZodString;
256
+ verdict: z.ZodEnum<{
257
+ pass: "pass";
258
+ fail: "fail";
259
+ approved: "approved";
260
+ rejected: "rejected";
261
+ info: "info";
262
+ }>;
263
+ summary: z.ZodString;
264
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
265
+ type: z.ZodLiteral<"review">;
266
+ risk: z.ZodEnum<{
267
+ medium: "medium";
268
+ low: "low";
269
+ high: "high";
270
+ critical: "critical";
271
+ }>;
272
+ issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
273
+ severity: z.ZodEnum<{
274
+ error: "error";
275
+ info: "info";
276
+ warning: "warning";
277
+ }>;
278
+ message: z.ZodString;
279
+ file: z.ZodOptional<z.ZodString>;
280
+ line: z.ZodOptional<z.ZodNumber>;
281
+ }, z.core.$strip>>>;
282
+ }, z.core.$strip>, z.ZodObject<{
283
+ task_id: z.ZodString;
284
+ timestamp: z.ZodString;
285
+ agent: z.ZodString;
286
+ verdict: z.ZodEnum<{
287
+ pass: "pass";
288
+ fail: "fail";
289
+ approved: "approved";
290
+ rejected: "rejected";
291
+ info: "info";
292
+ }>;
293
+ summary: z.ZodString;
294
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
295
+ type: z.ZodLiteral<"test">;
296
+ tests_passed: z.ZodNumber;
297
+ tests_failed: z.ZodNumber;
298
+ test_file: z.ZodOptional<z.ZodString>;
299
+ failures: z.ZodDefault<z.ZodArray<z.ZodObject<{
300
+ name: z.ZodString;
301
+ message: z.ZodString;
302
+ }, z.core.$strip>>>;
303
+ }, z.core.$strip>, z.ZodObject<{
304
+ task_id: z.ZodString;
305
+ timestamp: z.ZodString;
306
+ agent: z.ZodString;
307
+ verdict: z.ZodEnum<{
308
+ pass: "pass";
309
+ fail: "fail";
310
+ approved: "approved";
311
+ rejected: "rejected";
312
+ info: "info";
313
+ }>;
314
+ summary: z.ZodString;
315
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
316
+ type: z.ZodLiteral<"diff">;
317
+ files_changed: z.ZodDefault<z.ZodArray<z.ZodString>>;
318
+ additions: z.ZodDefault<z.ZodNumber>;
319
+ deletions: z.ZodDefault<z.ZodNumber>;
320
+ patch_path: z.ZodOptional<z.ZodString>;
321
+ }, z.core.$strip>, z.ZodObject<{
322
+ task_id: z.ZodString;
323
+ timestamp: z.ZodString;
324
+ agent: z.ZodString;
325
+ verdict: z.ZodEnum<{
326
+ pass: "pass";
327
+ fail: "fail";
328
+ approved: "approved";
329
+ rejected: "rejected";
330
+ info: "info";
331
+ }>;
332
+ summary: z.ZodString;
333
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
334
+ type: z.ZodLiteral<"approval">;
335
+ }, z.core.$strip>, z.ZodObject<{
336
+ task_id: z.ZodString;
337
+ timestamp: z.ZodString;
338
+ agent: z.ZodString;
339
+ verdict: z.ZodEnum<{
340
+ pass: "pass";
341
+ fail: "fail";
342
+ approved: "approved";
343
+ rejected: "rejected";
344
+ info: "info";
345
+ }>;
346
+ summary: z.ZodString;
347
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
348
+ type: z.ZodLiteral<"note">;
349
+ }, z.core.$strip>], "type">>>;
350
+ created_at: z.ZodString;
351
+ updated_at: z.ZodString;
352
+ }, z.core.$strip>;
353
+ export type EvidenceBundle = z.infer<typeof EvidenceBundleSchema>;
@@ -1,5 +1,9 @@
1
- export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, DEFAULT_MODELS, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS, isQAAgent, isSubagent, } from './constants';
2
1
  export type { AgentName, PipelineAgentName, QAAgentName, } from './constants';
3
- export { AgentOverrideConfigSchema, PluginConfigSchema, SwarmConfigSchema, } from './schema';
4
- export type { AgentOverrideConfig, PluginConfig, SwarmConfig, } from './schema';
2
+ export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, DEFAULT_MODELS, isQAAgent, isSubagent, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS, } from './constants';
5
3
  export { loadAgentPrompt, loadPluginConfig, } from './loader';
4
+ export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
5
+ export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
6
+ export type { ApprovalEvidence, BaseEvidence, DiffEvidence, Evidence, EvidenceBundle, EvidenceType, EvidenceVerdict, NoteEvidence, ReviewEvidence, TestEvidence, } from './evidence-schema';
7
+ export { ApprovalEvidenceSchema, BaseEvidenceSchema, DiffEvidenceSchema, EVIDENCE_MAX_JSON_BYTES, EVIDENCE_MAX_PATCH_BYTES, EVIDENCE_MAX_TASK_BYTES, EvidenceBundleSchema, EvidenceSchema, EvidenceTypeSchema, EvidenceVerdictSchema, NoteEvidenceSchema, ReviewEvidenceSchema, TestEvidenceSchema, } from './evidence-schema';
8
+ export type { AgentOverrideConfig, PluginConfig, SwarmConfig, } from './schema';
9
+ export { AgentOverrideConfigSchema, PluginConfigSchema, SwarmConfigSchema, } from './schema';