opencode-swarm-plugin 0.21.0 → 0.23.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 (131) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +111 -166
  4. package/dist/agent-mail.d.ts +480 -0
  5. package/dist/agent-mail.d.ts.map +1 -0
  6. package/dist/anti-patterns.d.ts +257 -0
  7. package/dist/anti-patterns.d.ts.map +1 -0
  8. package/dist/beads.d.ts +377 -0
  9. package/dist/beads.d.ts.map +1 -0
  10. package/dist/eval-capture.d.ts +206 -0
  11. package/dist/eval-capture.d.ts.map +1 -0
  12. package/dist/index.d.ts +1299 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +776 -4387
  15. package/dist/learning.d.ts +670 -0
  16. package/dist/learning.d.ts.map +1 -0
  17. package/dist/mandate-promotion.d.ts +93 -0
  18. package/dist/mandate-promotion.d.ts.map +1 -0
  19. package/dist/mandate-storage.d.ts +209 -0
  20. package/dist/mandate-storage.d.ts.map +1 -0
  21. package/dist/mandates.d.ts +230 -0
  22. package/dist/mandates.d.ts.map +1 -0
  23. package/dist/output-guardrails.d.ts +125 -0
  24. package/dist/output-guardrails.d.ts.map +1 -0
  25. package/dist/pattern-maturity.d.ts +246 -0
  26. package/dist/pattern-maturity.d.ts.map +1 -0
  27. package/dist/plugin.d.ts +22 -0
  28. package/dist/plugin.d.ts.map +1 -0
  29. package/dist/plugin.js +755 -4375
  30. package/dist/rate-limiter.d.ts +218 -0
  31. package/dist/rate-limiter.d.ts.map +1 -0
  32. package/dist/repo-crawl.d.ts +146 -0
  33. package/dist/repo-crawl.d.ts.map +1 -0
  34. package/dist/schemas/bead.d.ts +255 -0
  35. package/dist/schemas/bead.d.ts.map +1 -0
  36. package/dist/schemas/evaluation.d.ts +161 -0
  37. package/dist/schemas/evaluation.d.ts.map +1 -0
  38. package/dist/schemas/index.d.ts +34 -0
  39. package/dist/schemas/index.d.ts.map +1 -0
  40. package/dist/schemas/mandate.d.ts +336 -0
  41. package/dist/schemas/mandate.d.ts.map +1 -0
  42. package/dist/schemas/swarm-context.d.ts +131 -0
  43. package/dist/schemas/swarm-context.d.ts.map +1 -0
  44. package/dist/schemas/task.d.ts +188 -0
  45. package/dist/schemas/task.d.ts.map +1 -0
  46. package/dist/skills.d.ts +471 -0
  47. package/dist/skills.d.ts.map +1 -0
  48. package/dist/storage.d.ts +260 -0
  49. package/dist/storage.d.ts.map +1 -0
  50. package/dist/structured.d.ts +196 -0
  51. package/dist/structured.d.ts.map +1 -0
  52. package/dist/swarm-decompose.d.ts +201 -0
  53. package/dist/swarm-decompose.d.ts.map +1 -0
  54. package/dist/swarm-mail.d.ts +240 -0
  55. package/dist/swarm-mail.d.ts.map +1 -0
  56. package/dist/swarm-orchestrate.d.ts +708 -0
  57. package/dist/swarm-orchestrate.d.ts.map +1 -0
  58. package/dist/swarm-prompts.d.ts +292 -0
  59. package/dist/swarm-prompts.d.ts.map +1 -0
  60. package/dist/swarm-strategies.d.ts +100 -0
  61. package/dist/swarm-strategies.d.ts.map +1 -0
  62. package/dist/swarm.d.ts +455 -0
  63. package/dist/swarm.d.ts.map +1 -0
  64. package/dist/tool-availability.d.ts +91 -0
  65. package/dist/tool-availability.d.ts.map +1 -0
  66. package/docs/planning/ADR-001-monorepo-structure.md +171 -0
  67. package/docs/planning/ADR-002-package-extraction.md +393 -0
  68. package/docs/planning/ADR-003-performance-improvements.md +451 -0
  69. package/docs/planning/ADR-004-message-queue-features.md +187 -0
  70. package/docs/planning/ADR-005-devtools-observability.md +202 -0
  71. package/docs/planning/ROADMAP.md +368 -0
  72. package/docs/semantic-memory-cli-syntax.md +123 -0
  73. package/docs/swarm-mail-architecture.md +1147 -0
  74. package/package.json +13 -24
  75. package/scripts/cleanup-test-memories.ts +346 -0
  76. package/src/agent-mail.ts +1 -1
  77. package/src/beads.ts +1 -2
  78. package/src/index.ts +2 -2
  79. package/src/learning.integration.test.ts +80 -10
  80. package/src/mandate-storage.test.ts +3 -3
  81. package/src/storage.ts +189 -9
  82. package/src/swarm-mail.ts +3 -3
  83. package/src/swarm-orchestrate.ts +399 -246
  84. package/src/swarm.integration.test.ts +124 -0
  85. package/src/tool-availability.ts +1 -1
  86. package/tsconfig.json +1 -1
  87. package/.beads/.local_version +0 -1
  88. package/.beads/README.md +0 -81
  89. package/.beads/analysis/skill-architecture-meta-skills.md +0 -1562
  90. package/.beads/config.yaml +0 -62
  91. package/.beads/issues.jsonl +0 -2186
  92. package/.beads/metadata.json +0 -4
  93. package/.gitattributes +0 -3
  94. package/.github/workflows/ci.yml +0 -30
  95. package/.github/workflows/opencode.yml +0 -31
  96. package/.opencode/skills/tdd/SKILL.md +0 -182
  97. package/INTEGRATION_EXAMPLE.md +0 -66
  98. package/VERIFICATION_QUALITY_PATTERNS.md +0 -565
  99. package/bun.lock +0 -286
  100. package/dist/pglite.data +0 -0
  101. package/dist/pglite.wasm +0 -0
  102. package/src/streams/agent-mail.test.ts +0 -777
  103. package/src/streams/agent-mail.ts +0 -535
  104. package/src/streams/debug.test.ts +0 -500
  105. package/src/streams/debug.ts +0 -727
  106. package/src/streams/effect/ask.integration.test.ts +0 -314
  107. package/src/streams/effect/ask.ts +0 -202
  108. package/src/streams/effect/cursor.integration.test.ts +0 -418
  109. package/src/streams/effect/cursor.ts +0 -288
  110. package/src/streams/effect/deferred.test.ts +0 -357
  111. package/src/streams/effect/deferred.ts +0 -445
  112. package/src/streams/effect/index.ts +0 -17
  113. package/src/streams/effect/layers.ts +0 -73
  114. package/src/streams/effect/lock.test.ts +0 -385
  115. package/src/streams/effect/lock.ts +0 -399
  116. package/src/streams/effect/mailbox.test.ts +0 -260
  117. package/src/streams/effect/mailbox.ts +0 -318
  118. package/src/streams/events.test.ts +0 -924
  119. package/src/streams/events.ts +0 -329
  120. package/src/streams/index.test.ts +0 -229
  121. package/src/streams/index.ts +0 -578
  122. package/src/streams/migrations.test.ts +0 -359
  123. package/src/streams/migrations.ts +0 -362
  124. package/src/streams/projections.test.ts +0 -611
  125. package/src/streams/projections.ts +0 -504
  126. package/src/streams/store.integration.test.ts +0 -658
  127. package/src/streams/store.ts +0 -1075
  128. package/src/streams/swarm-mail.ts +0 -552
  129. package/test-bug-fixes.ts +0 -86
  130. package/vitest.integration.config.ts +0 -13
  131. package/workflow-integration-analysis.md +0 -876
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Evaluation schemas for structured agent output validation
3
+ *
4
+ * These schemas define the expected format for agent self-evaluations
5
+ * and coordinator evaluations of completed work.
6
+ *
7
+ * Includes support for confidence decay - criteria weights fade over time
8
+ * unless revalidated by successful outcomes.
9
+ *
10
+ * @see src/learning.ts for decay calculations
11
+ */
12
+ import { z } from "zod";
13
+ /**
14
+ * Evaluation of a single criterion.
15
+ *
16
+ * @example
17
+ * // Passing criterion
18
+ * { passed: true, feedback: "All types validated", score: 0.95 }
19
+ *
20
+ * @example
21
+ * // Failing criterion
22
+ * { passed: false, feedback: "Missing error handling in auth flow", score: 0.3 }
23
+ */
24
+ export declare const CriterionEvaluationSchema: z.ZodObject<{
25
+ passed: z.ZodBoolean;
26
+ feedback: z.ZodString;
27
+ score: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strip>;
29
+ export type CriterionEvaluation = z.infer<typeof CriterionEvaluationSchema>;
30
+ /**
31
+ * Weighted criterion evaluation with confidence decay
32
+ *
33
+ * Extends CriterionEvaluation with weight information from learning.
34
+ * Lower weights indicate criteria that have been historically unreliable.
35
+ */
36
+ export declare const WeightedCriterionEvaluationSchema: z.ZodObject<{
37
+ passed: z.ZodBoolean;
38
+ feedback: z.ZodString;
39
+ score: z.ZodOptional<z.ZodNumber>;
40
+ weight: z.ZodDefault<z.ZodNumber>;
41
+ weighted_score: z.ZodOptional<z.ZodNumber>;
42
+ deprecated: z.ZodDefault<z.ZodBoolean>;
43
+ }, z.core.$strip>;
44
+ export type WeightedCriterionEvaluation = z.infer<typeof WeightedCriterionEvaluationSchema>;
45
+ /**
46
+ * Full evaluation result
47
+ *
48
+ * Returned by agents after completing a subtask.
49
+ * Used by coordinator to determine if work is acceptable.
50
+ */
51
+ export declare const EvaluationSchema: z.ZodObject<{
52
+ passed: z.ZodBoolean;
53
+ criteria: z.ZodRecord<z.ZodString, z.ZodObject<{
54
+ passed: z.ZodBoolean;
55
+ feedback: z.ZodString;
56
+ score: z.ZodOptional<z.ZodNumber>;
57
+ }, z.core.$strip>>;
58
+ overall_feedback: z.ZodString;
59
+ retry_suggestion: z.ZodNullable<z.ZodString>;
60
+ timestamp: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>;
62
+ export type Evaluation = z.infer<typeof EvaluationSchema>;
63
+ /**
64
+ * Default evaluation criteria
65
+ *
66
+ * These are the standard criteria used when none are specified.
67
+ * Can be overridden per-task or per-project.
68
+ */
69
+ export declare const DEFAULT_CRITERIA: readonly ["type_safe", "no_bugs", "patterns", "readable"];
70
+ export type DefaultCriterion = (typeof DEFAULT_CRITERIA)[number];
71
+ /**
72
+ * Evaluation request arguments
73
+ */
74
+ export declare const EvaluationRequestSchema: z.ZodObject<{
75
+ bead_id: z.ZodString;
76
+ subtask_title: z.ZodString;
77
+ files_touched: z.ZodArray<z.ZodString>;
78
+ requested_at: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>;
80
+ export type EvaluationRequest = z.infer<typeof EvaluationRequestSchema>;
81
+ /**
82
+ * Weighted evaluation result with confidence-adjusted scores
83
+ *
84
+ * Used when applying learned weights to evaluation criteria.
85
+ */
86
+ export declare const WeightedEvaluationSchema: z.ZodObject<{
87
+ passed: z.ZodBoolean;
88
+ criteria: z.ZodRecord<z.ZodString, z.ZodObject<{
89
+ passed: z.ZodBoolean;
90
+ feedback: z.ZodString;
91
+ score: z.ZodOptional<z.ZodNumber>;
92
+ weight: z.ZodDefault<z.ZodNumber>;
93
+ weighted_score: z.ZodOptional<z.ZodNumber>;
94
+ deprecated: z.ZodDefault<z.ZodBoolean>;
95
+ }, z.core.$strip>>;
96
+ overall_feedback: z.ZodString;
97
+ retry_suggestion: z.ZodNullable<z.ZodString>;
98
+ timestamp: z.ZodOptional<z.ZodString>;
99
+ average_weight: z.ZodOptional<z.ZodNumber>;
100
+ raw_score: z.ZodOptional<z.ZodNumber>;
101
+ weighted_score: z.ZodOptional<z.ZodNumber>;
102
+ }, z.core.$strip>;
103
+ export type WeightedEvaluation = z.infer<typeof WeightedEvaluationSchema>;
104
+ /**
105
+ * Aggregated evaluation results for a swarm
106
+ */
107
+ export declare const SwarmEvaluationResultSchema: z.ZodObject<{
108
+ epic_id: z.ZodString;
109
+ total: z.ZodNumber;
110
+ passed: z.ZodNumber;
111
+ failed: z.ZodNumber;
112
+ evaluations: z.ZodArray<z.ZodObject<{
113
+ bead_id: z.ZodString;
114
+ evaluation: z.ZodObject<{
115
+ passed: z.ZodBoolean;
116
+ criteria: z.ZodRecord<z.ZodString, z.ZodObject<{
117
+ passed: z.ZodBoolean;
118
+ feedback: z.ZodString;
119
+ score: z.ZodOptional<z.ZodNumber>;
120
+ }, z.core.$strip>>;
121
+ overall_feedback: z.ZodString;
122
+ retry_suggestion: z.ZodNullable<z.ZodString>;
123
+ timestamp: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>;
125
+ }, z.core.$strip>>;
126
+ overall_passed: z.ZodBoolean;
127
+ retry_needed: z.ZodArray<z.ZodString>;
128
+ }, z.core.$strip>;
129
+ export type SwarmEvaluationResult = z.infer<typeof SwarmEvaluationResultSchema>;
130
+ /**
131
+ * Validation result with retry info
132
+ */
133
+ export declare const ValidationResultSchema: z.ZodObject<{
134
+ success: z.ZodBoolean;
135
+ data: z.ZodOptional<z.ZodUnknown>;
136
+ attempts: z.ZodNumber;
137
+ errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
+ extractionMethod: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strip>;
140
+ export type ValidationResult = z.infer<typeof ValidationResultSchema>;
141
+ /**
142
+ * Failure mode taxonomy for task failures
143
+ *
144
+ * Classifies WHY tasks fail, not just that they failed.
145
+ * Used in outcome tracking to learn from failure patterns.
146
+ *
147
+ * @see src/learning.ts OutcomeSignalsSchema
148
+ * @see "Patterns for Building AI Agents" p.46
149
+ */
150
+ export declare const FailureModeSchema: z.ZodEnum<{
151
+ timeout: "timeout";
152
+ unknown: "unknown";
153
+ conflict: "conflict";
154
+ validation: "validation";
155
+ tool_failure: "tool_failure";
156
+ context_overflow: "context_overflow";
157
+ dependency_blocked: "dependency_blocked";
158
+ user_cancelled: "user_cancelled";
159
+ }>;
160
+ export type FailureMode = z.infer<typeof FailureModeSchema>;
161
+ //# sourceMappingURL=evaluation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluation.d.ts","sourceRoot":"","sources":["../../src/schemas/evaluation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC;;;;;;;iBAY1C,CAAC;AACL,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAM3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,2DAKnB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;iBAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBAYnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;iBAatC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;iBAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;EAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Schema Definitions - Central export point for all Zod schemas
3
+ *
4
+ * This module re-exports all schema definitions used throughout the plugin.
5
+ * Schemas are organized by domain:
6
+ *
7
+ * ## Bead Schemas (Issue Tracking)
8
+ * - `BeadSchema` - Core bead/issue definition
9
+ * - `BeadStatusSchema` - Status enum (open, in_progress, blocked, closed)
10
+ * - `BeadTypeSchema` - Type enum (bug, feature, task, epic, chore)
11
+ * - `SubtaskSpecSchema` - Subtask specification for epic creation
12
+ *
13
+ * ## Task Schemas (Swarm Decomposition)
14
+ * - `TaskDecompositionSchema` - Full task breakdown
15
+ * - `DecomposedSubtaskSchema` - Individual subtask definition
16
+ * - `BeadTreeSchema` - Epic + subtasks structure
17
+ *
18
+ * ## Evaluation Schemas (Agent Self-Assessment)
19
+ * - `EvaluationSchema` - Complete evaluation with criteria
20
+ * - `CriterionEvaluationSchema` - Single criterion result
21
+ *
22
+ * ## Progress Schemas (Swarm Coordination)
23
+ * - `SwarmStatusSchema` - Overall swarm progress
24
+ * - `AgentProgressSchema` - Individual agent status
25
+ * - `SpawnedAgentSchema` - Spawned agent metadata
26
+ *
27
+ * @module schemas
28
+ */
29
+ export { BeadStatusSchema, BeadTypeSchema, BeadDependencySchema, BeadSchema, BeadCreateArgsSchema, BeadUpdateArgsSchema, BeadCloseArgsSchema, BeadQueryArgsSchema, SubtaskSpecSchema, BeadTreeSchema, EpicCreateArgsSchema, EpicCreateResultSchema, type BeadStatus, type BeadType, type BeadDependency, type Bead, type BeadCreateArgs, type BeadUpdateArgs, type BeadCloseArgs, type BeadQueryArgs, type SubtaskSpec, type BeadTree, type EpicCreateArgs, type EpicCreateResult, } from "./bead";
30
+ export { CriterionEvaluationSchema, WeightedCriterionEvaluationSchema, EvaluationSchema, WeightedEvaluationSchema, EvaluationRequestSchema, SwarmEvaluationResultSchema, ValidationResultSchema, DEFAULT_CRITERIA, type CriterionEvaluation, type WeightedCriterionEvaluation, type Evaluation, type WeightedEvaluation, type EvaluationRequest, type SwarmEvaluationResult, type ValidationResult, type DefaultCriterion, } from "./evaluation";
31
+ export { EffortLevelSchema, DependencyTypeSchema, DecomposedSubtaskSchema, SubtaskDependencySchema, TaskDecompositionSchema, DecomposeArgsSchema, SpawnedAgentSchema, SwarmSpawnResultSchema, AgentProgressSchema, SwarmStatusSchema, type EffortLevel, type DependencyType, type DecomposedSubtask, type SubtaskDependency, type TaskDecomposition, type DecomposeArgs, type SpawnedAgent, type SwarmSpawnResult, type AgentProgress, type SwarmStatus, } from "./task";
32
+ export { MandateContentTypeSchema, MandateStatusSchema, VoteTypeSchema, MandateEntrySchema, VoteSchema, MandateScoreSchema, CreateMandateArgsSchema, CastVoteArgsSchema, QueryMandatesArgsSchema, ScoreCalculationResultSchema, DEFAULT_MANDATE_DECAY_CONFIG, mandateSchemas, type MandateContentType, type MandateStatus, type VoteType, type MandateEntry, type Vote, type MandateScore, type MandateDecayConfig, type CreateMandateArgs, type CastVoteArgs, type QueryMandatesArgs, type ScoreCalculationResult, } from "./mandate";
33
+ export { SwarmStrategySchema, SwarmDirectivesSchema, SwarmRecoverySchema, SwarmBeadContextSchema, CreateSwarmContextArgsSchema, UpdateSwarmContextArgsSchema, QuerySwarmContextsArgsSchema, type SwarmStrategy, type SwarmDirectives, type SwarmRecovery, type SwarmBeadContext, type CreateSwarmContextArgs, type UpdateSwarmContextArgs, type QuerySwarmContextsArgs, } from "./swarm-context";
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,4BAA4B,EAC5B,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Mandate schemas for voting system
3
+ *
4
+ * Agents file and vote on ideas, tips, lore, snippets, and feature requests.
5
+ * High-consensus items become "mandates" that influence future behavior.
6
+ *
7
+ * Vote decay and scoring patterns match learning.ts (90-day half-life).
8
+ */
9
+ import { z } from "zod";
10
+ /**
11
+ * Content types for mandate entries
12
+ */
13
+ export declare const MandateContentTypeSchema: z.ZodEnum<{
14
+ idea: "idea";
15
+ tip: "tip";
16
+ lore: "lore";
17
+ snippet: "snippet";
18
+ feature_request: "feature_request";
19
+ }>;
20
+ export type MandateContentType = z.infer<typeof MandateContentTypeSchema>;
21
+ /**
22
+ * Mandate status lifecycle
23
+ *
24
+ * - candidate: New entry, collecting votes
25
+ * - established: Has some consensus but not enough for mandate status
26
+ * - mandate: High consensus (net_votes >= 5 AND vote_ratio >= 0.7)
27
+ * - rejected: Strong negative consensus or explicitly rejected
28
+ */
29
+ export declare const MandateStatusSchema: z.ZodEnum<{
30
+ candidate: "candidate";
31
+ established: "established";
32
+ mandate: "mandate";
33
+ rejected: "rejected";
34
+ }>;
35
+ export type MandateStatus = z.infer<typeof MandateStatusSchema>;
36
+ /**
37
+ * Vote type
38
+ */
39
+ export declare const VoteTypeSchema: z.ZodEnum<{
40
+ upvote: "upvote";
41
+ downvote: "downvote";
42
+ }>;
43
+ export type VoteType = z.infer<typeof VoteTypeSchema>;
44
+ /**
45
+ * A mandate entry represents a proposal from an agent
46
+ *
47
+ * Entries can be ideas, tips, lore, code snippets, or feature requests.
48
+ * Other agents vote on entries to reach consensus.
49
+ */
50
+ export declare const MandateEntrySchema: z.ZodObject<{
51
+ id: z.ZodString;
52
+ content: z.ZodString;
53
+ content_type: z.ZodEnum<{
54
+ idea: "idea";
55
+ tip: "tip";
56
+ lore: "lore";
57
+ snippet: "snippet";
58
+ feature_request: "feature_request";
59
+ }>;
60
+ author_agent: z.ZodString;
61
+ created_at: z.ZodString;
62
+ status: z.ZodDefault<z.ZodEnum<{
63
+ candidate: "candidate";
64
+ established: "established";
65
+ mandate: "mandate";
66
+ rejected: "rejected";
67
+ }>>;
68
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
69
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
+ }, z.core.$strip>;
71
+ export type MandateEntry = z.infer<typeof MandateEntrySchema>;
72
+ /**
73
+ * A vote on a mandate entry
74
+ *
75
+ * Each agent can vote once per entry (upvote or downvote).
76
+ * Votes decay with 90-day half-life matching learning.ts patterns.
77
+ */
78
+ export declare const VoteSchema: z.ZodObject<{
79
+ id: z.ZodString;
80
+ mandate_id: z.ZodString;
81
+ agent_name: z.ZodString;
82
+ vote_type: z.ZodEnum<{
83
+ upvote: "upvote";
84
+ downvote: "downvote";
85
+ }>;
86
+ timestamp: z.ZodString;
87
+ weight: z.ZodDefault<z.ZodNumber>;
88
+ }, z.core.$strip>;
89
+ export type Vote = z.infer<typeof VoteSchema>;
90
+ /**
91
+ * Calculated score for a mandate entry
92
+ *
93
+ * Scores are recalculated periodically with decay applied.
94
+ * Uses same decay formula as learning.ts (90-day half-life).
95
+ */
96
+ export declare const MandateScoreSchema: z.ZodObject<{
97
+ mandate_id: z.ZodString;
98
+ net_votes: z.ZodNumber;
99
+ vote_ratio: z.ZodNumber;
100
+ decayed_score: z.ZodNumber;
101
+ last_calculated: z.ZodString;
102
+ raw_upvotes: z.ZodNumber;
103
+ raw_downvotes: z.ZodNumber;
104
+ decayed_upvotes: z.ZodNumber;
105
+ decayed_downvotes: z.ZodNumber;
106
+ }, z.core.$strip>;
107
+ export type MandateScore = z.infer<typeof MandateScoreSchema>;
108
+ /**
109
+ * Configuration for mandate decay calculation
110
+ *
111
+ * Matches learning.ts decay patterns.
112
+ */
113
+ export interface MandateDecayConfig {
114
+ /** Half-life for vote decay in days */
115
+ halfLifeDays: number;
116
+ /** Net votes threshold for mandate status */
117
+ mandateNetVotesThreshold: number;
118
+ /** Vote ratio threshold for mandate status */
119
+ mandateVoteRatioThreshold: number;
120
+ /** Net votes threshold for established status */
121
+ establishedNetVotesThreshold: number;
122
+ /** Negative net votes threshold for rejected status */
123
+ rejectedNetVotesThreshold: number;
124
+ }
125
+ export declare const DEFAULT_MANDATE_DECAY_CONFIG: MandateDecayConfig;
126
+ /**
127
+ * Arguments for creating a mandate entry
128
+ */
129
+ export declare const CreateMandateArgsSchema: z.ZodObject<{
130
+ content: z.ZodString;
131
+ content_type: z.ZodEnum<{
132
+ idea: "idea";
133
+ tip: "tip";
134
+ lore: "lore";
135
+ snippet: "snippet";
136
+ feature_request: "feature_request";
137
+ }>;
138
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
139
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
140
+ }, z.core.$strip>;
141
+ export type CreateMandateArgs = z.infer<typeof CreateMandateArgsSchema>;
142
+ /**
143
+ * Arguments for casting a vote
144
+ */
145
+ export declare const CastVoteArgsSchema: z.ZodObject<{
146
+ mandate_id: z.ZodString;
147
+ vote_type: z.ZodEnum<{
148
+ upvote: "upvote";
149
+ downvote: "downvote";
150
+ }>;
151
+ weight: z.ZodDefault<z.ZodNumber>;
152
+ }, z.core.$strip>;
153
+ export type CastVoteArgs = z.infer<typeof CastVoteArgsSchema>;
154
+ /**
155
+ * Arguments for querying mandates
156
+ */
157
+ export declare const QueryMandatesArgsSchema: z.ZodObject<{
158
+ status: z.ZodOptional<z.ZodEnum<{
159
+ candidate: "candidate";
160
+ established: "established";
161
+ mandate: "mandate";
162
+ rejected: "rejected";
163
+ }>>;
164
+ content_type: z.ZodOptional<z.ZodEnum<{
165
+ idea: "idea";
166
+ tip: "tip";
167
+ lore: "lore";
168
+ snippet: "snippet";
169
+ feature_request: "feature_request";
170
+ }>>;
171
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
172
+ author_agent: z.ZodOptional<z.ZodString>;
173
+ limit: z.ZodDefault<z.ZodNumber>;
174
+ min_score: z.ZodOptional<z.ZodNumber>;
175
+ }, z.core.$strip>;
176
+ export type QueryMandatesArgs = z.infer<typeof QueryMandatesArgsSchema>;
177
+ /**
178
+ * Result of score calculation
179
+ */
180
+ export declare const ScoreCalculationResultSchema: z.ZodObject<{
181
+ mandate_id: z.ZodString;
182
+ previous_status: z.ZodEnum<{
183
+ candidate: "candidate";
184
+ established: "established";
185
+ mandate: "mandate";
186
+ rejected: "rejected";
187
+ }>;
188
+ new_status: z.ZodEnum<{
189
+ candidate: "candidate";
190
+ established: "established";
191
+ mandate: "mandate";
192
+ rejected: "rejected";
193
+ }>;
194
+ score: z.ZodObject<{
195
+ mandate_id: z.ZodString;
196
+ net_votes: z.ZodNumber;
197
+ vote_ratio: z.ZodNumber;
198
+ decayed_score: z.ZodNumber;
199
+ last_calculated: z.ZodString;
200
+ raw_upvotes: z.ZodNumber;
201
+ raw_downvotes: z.ZodNumber;
202
+ decayed_upvotes: z.ZodNumber;
203
+ decayed_downvotes: z.ZodNumber;
204
+ }, z.core.$strip>;
205
+ status_changed: z.ZodBoolean;
206
+ }, z.core.$strip>;
207
+ export type ScoreCalculationResult = z.infer<typeof ScoreCalculationResultSchema>;
208
+ export declare const mandateSchemas: {
209
+ MandateContentTypeSchema: z.ZodEnum<{
210
+ idea: "idea";
211
+ tip: "tip";
212
+ lore: "lore";
213
+ snippet: "snippet";
214
+ feature_request: "feature_request";
215
+ }>;
216
+ MandateStatusSchema: z.ZodEnum<{
217
+ candidate: "candidate";
218
+ established: "established";
219
+ mandate: "mandate";
220
+ rejected: "rejected";
221
+ }>;
222
+ VoteTypeSchema: z.ZodEnum<{
223
+ upvote: "upvote";
224
+ downvote: "downvote";
225
+ }>;
226
+ MandateEntrySchema: z.ZodObject<{
227
+ id: z.ZodString;
228
+ content: z.ZodString;
229
+ content_type: z.ZodEnum<{
230
+ idea: "idea";
231
+ tip: "tip";
232
+ lore: "lore";
233
+ snippet: "snippet";
234
+ feature_request: "feature_request";
235
+ }>;
236
+ author_agent: z.ZodString;
237
+ created_at: z.ZodString;
238
+ status: z.ZodDefault<z.ZodEnum<{
239
+ candidate: "candidate";
240
+ established: "established";
241
+ mandate: "mandate";
242
+ rejected: "rejected";
243
+ }>>;
244
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
245
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ }, z.core.$strip>;
247
+ VoteSchema: z.ZodObject<{
248
+ id: z.ZodString;
249
+ mandate_id: z.ZodString;
250
+ agent_name: z.ZodString;
251
+ vote_type: z.ZodEnum<{
252
+ upvote: "upvote";
253
+ downvote: "downvote";
254
+ }>;
255
+ timestamp: z.ZodString;
256
+ weight: z.ZodDefault<z.ZodNumber>;
257
+ }, z.core.$strip>;
258
+ MandateScoreSchema: z.ZodObject<{
259
+ mandate_id: z.ZodString;
260
+ net_votes: z.ZodNumber;
261
+ vote_ratio: z.ZodNumber;
262
+ decayed_score: z.ZodNumber;
263
+ last_calculated: z.ZodString;
264
+ raw_upvotes: z.ZodNumber;
265
+ raw_downvotes: z.ZodNumber;
266
+ decayed_upvotes: z.ZodNumber;
267
+ decayed_downvotes: z.ZodNumber;
268
+ }, z.core.$strip>;
269
+ CreateMandateArgsSchema: z.ZodObject<{
270
+ content: z.ZodString;
271
+ content_type: z.ZodEnum<{
272
+ idea: "idea";
273
+ tip: "tip";
274
+ lore: "lore";
275
+ snippet: "snippet";
276
+ feature_request: "feature_request";
277
+ }>;
278
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
279
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
280
+ }, z.core.$strip>;
281
+ CastVoteArgsSchema: z.ZodObject<{
282
+ mandate_id: z.ZodString;
283
+ vote_type: z.ZodEnum<{
284
+ upvote: "upvote";
285
+ downvote: "downvote";
286
+ }>;
287
+ weight: z.ZodDefault<z.ZodNumber>;
288
+ }, z.core.$strip>;
289
+ QueryMandatesArgsSchema: z.ZodObject<{
290
+ status: z.ZodOptional<z.ZodEnum<{
291
+ candidate: "candidate";
292
+ established: "established";
293
+ mandate: "mandate";
294
+ rejected: "rejected";
295
+ }>>;
296
+ content_type: z.ZodOptional<z.ZodEnum<{
297
+ idea: "idea";
298
+ tip: "tip";
299
+ lore: "lore";
300
+ snippet: "snippet";
301
+ feature_request: "feature_request";
302
+ }>>;
303
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
304
+ author_agent: z.ZodOptional<z.ZodString>;
305
+ limit: z.ZodDefault<z.ZodNumber>;
306
+ min_score: z.ZodOptional<z.ZodNumber>;
307
+ }, z.core.$strip>;
308
+ ScoreCalculationResultSchema: z.ZodObject<{
309
+ mandate_id: z.ZodString;
310
+ previous_status: z.ZodEnum<{
311
+ candidate: "candidate";
312
+ established: "established";
313
+ mandate: "mandate";
314
+ rejected: "rejected";
315
+ }>;
316
+ new_status: z.ZodEnum<{
317
+ candidate: "candidate";
318
+ established: "established";
319
+ mandate: "mandate";
320
+ rejected: "rejected";
321
+ }>;
322
+ score: z.ZodObject<{
323
+ mandate_id: z.ZodString;
324
+ net_votes: z.ZodNumber;
325
+ vote_ratio: z.ZodNumber;
326
+ decayed_score: z.ZodNumber;
327
+ last_calculated: z.ZodString;
328
+ raw_upvotes: z.ZodNumber;
329
+ raw_downvotes: z.ZodNumber;
330
+ decayed_upvotes: z.ZodNumber;
331
+ decayed_downvotes: z.ZodNumber;
332
+ }, z.core.$strip>;
333
+ status_changed: z.ZodBoolean;
334
+ }, z.core.$strip>;
335
+ };
336
+ //# sourceMappingURL=mandate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mandate.d.ts","sourceRoot":"","sources":["../../src/schemas/mandate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;EAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;EAK9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,cAAc;;;EAAiC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAMtD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;iBAiB7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;iBAarB,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAM9C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAiB7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,wBAAwB,EAAE,MAAM,CAAC;IACjC,8CAA8C;IAC9C,yBAAyB,EAAE,MAAM,CAAC;IAClC,iDAAiD;IACjD,4BAA4B,EAAE,MAAM,CAAC;IACrC,uDAAuD;IACvD,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAM1C,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;iBAI7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;iBAOlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAMF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW1B,CAAC"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Swarm Context Schemas
3
+ *
4
+ * These schemas define the structure for storing and recovering swarm execution context.
5
+ * Used for checkpoint/recovery, continuation after crashes, and swarm state management.
6
+ */
7
+ import { z } from "zod";
8
+ /**
9
+ * Decomposition strategy used for the swarm
10
+ */
11
+ export declare const SwarmStrategySchema: z.ZodEnum<{
12
+ "file-based": "file-based";
13
+ "feature-based": "feature-based";
14
+ "risk-based": "risk-based";
15
+ }>;
16
+ export type SwarmStrategy = z.infer<typeof SwarmStrategySchema>;
17
+ /**
18
+ * Shared directives and context for all agents in a swarm
19
+ */
20
+ export declare const SwarmDirectivesSchema: z.ZodObject<{
21
+ shared_context: z.ZodString;
22
+ skills_to_load: z.ZodDefault<z.ZodArray<z.ZodString>>;
23
+ coordinator_notes: z.ZodDefault<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ export type SwarmDirectives = z.infer<typeof SwarmDirectivesSchema>;
26
+ /**
27
+ * Recovery state for checkpoint/resume
28
+ */
29
+ export declare const SwarmRecoverySchema: z.ZodObject<{
30
+ last_checkpoint: z.ZodString;
31
+ files_modified: z.ZodDefault<z.ZodArray<z.ZodString>>;
32
+ progress_percent: z.ZodDefault<z.ZodNumber>;
33
+ last_message: z.ZodDefault<z.ZodString>;
34
+ error_context: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>;
36
+ export type SwarmRecovery = z.infer<typeof SwarmRecoverySchema>;
37
+ /**
38
+ * Complete context for a single bead in a swarm
39
+ *
40
+ * Stored in swarm_contexts table for recovery, continuation, and state management.
41
+ */
42
+ export declare const SwarmBeadContextSchema: z.ZodObject<{
43
+ id: z.ZodString;
44
+ epic_id: z.ZodString;
45
+ bead_id: z.ZodString;
46
+ strategy: z.ZodEnum<{
47
+ "file-based": "file-based";
48
+ "feature-based": "feature-based";
49
+ "risk-based": "risk-based";
50
+ }>;
51
+ files: z.ZodArray<z.ZodString>;
52
+ dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
53
+ directives: z.ZodObject<{
54
+ shared_context: z.ZodString;
55
+ skills_to_load: z.ZodDefault<z.ZodArray<z.ZodString>>;
56
+ coordinator_notes: z.ZodDefault<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ recovery: z.ZodObject<{
59
+ last_checkpoint: z.ZodString;
60
+ files_modified: z.ZodDefault<z.ZodArray<z.ZodString>>;
61
+ progress_percent: z.ZodDefault<z.ZodNumber>;
62
+ last_message: z.ZodDefault<z.ZodString>;
63
+ error_context: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ created_at: z.ZodNumber;
66
+ updated_at: z.ZodNumber;
67
+ }, z.core.$strip>;
68
+ export type SwarmBeadContext = z.infer<typeof SwarmBeadContextSchema>;
69
+ /**
70
+ * Args for creating a swarm context
71
+ */
72
+ export declare const CreateSwarmContextArgsSchema: z.ZodObject<{
73
+ dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
74
+ files: z.ZodArray<z.ZodString>;
75
+ epic_id: z.ZodString;
76
+ bead_id: z.ZodString;
77
+ strategy: z.ZodEnum<{
78
+ "file-based": "file-based";
79
+ "feature-based": "feature-based";
80
+ "risk-based": "risk-based";
81
+ }>;
82
+ directives: z.ZodObject<{
83
+ shared_context: z.ZodString;
84
+ skills_to_load: z.ZodDefault<z.ZodArray<z.ZodString>>;
85
+ coordinator_notes: z.ZodDefault<z.ZodString>;
86
+ }, z.core.$strip>;
87
+ recovery: z.ZodObject<{
88
+ last_checkpoint: z.ZodString;
89
+ files_modified: z.ZodDefault<z.ZodArray<z.ZodString>>;
90
+ progress_percent: z.ZodDefault<z.ZodNumber>;
91
+ last_message: z.ZodDefault<z.ZodString>;
92
+ error_context: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strip>;
94
+ }, z.core.$strip>;
95
+ export type CreateSwarmContextArgs = z.infer<typeof CreateSwarmContextArgsSchema>;
96
+ /**
97
+ * Args for updating a swarm context
98
+ */
99
+ export declare const UpdateSwarmContextArgsSchema: z.ZodObject<{
100
+ id: z.ZodString;
101
+ recovery: z.ZodOptional<z.ZodObject<{
102
+ last_checkpoint: z.ZodOptional<z.ZodString>;
103
+ files_modified: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
104
+ progress_percent: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
105
+ last_message: z.ZodOptional<z.ZodDefault<z.ZodString>>;
106
+ error_context: z.ZodOptional<z.ZodOptional<z.ZodString>>;
107
+ }, z.core.$strip>>;
108
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
+ directives: z.ZodOptional<z.ZodObject<{
111
+ shared_context: z.ZodOptional<z.ZodString>;
112
+ skills_to_load: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
113
+ coordinator_notes: z.ZodOptional<z.ZodDefault<z.ZodString>>;
114
+ }, z.core.$strip>>;
115
+ }, z.core.$strip>;
116
+ export type UpdateSwarmContextArgs = z.infer<typeof UpdateSwarmContextArgsSchema>;
117
+ /**
118
+ * Args for querying swarm contexts
119
+ */
120
+ export declare const QuerySwarmContextsArgsSchema: z.ZodObject<{
121
+ epic_id: z.ZodOptional<z.ZodString>;
122
+ bead_id: z.ZodOptional<z.ZodString>;
123
+ strategy: z.ZodOptional<z.ZodEnum<{
124
+ "file-based": "file-based";
125
+ "feature-based": "feature-based";
126
+ "risk-based": "risk-based";
127
+ }>>;
128
+ has_errors: z.ZodOptional<z.ZodBoolean>;
129
+ }, z.core.$strip>;
130
+ export type QuerySwarmContextsArgs = z.infer<typeof QuerySwarmContextsArgsSchema>;
131
+ //# sourceMappingURL=swarm-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swarm-context.d.ts","sourceRoot":"","sources":["../../src/schemas/swarm-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;iBAOhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;iBAW9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;iBAIvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}