opencode-swarm 6.57.0 → 6.58.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/dist/__tests__/acknowledge-spec-drift.test.d.ts +1 -0
- package/dist/__tests__/critic_drift_verifier-whitelist.test.d.ts +1 -0
- package/dist/__tests__/lint-spec.test.d.ts +1 -0
- package/dist/__tests__/preflight-phase.test.d.ts +1 -0
- package/dist/__tests__/req-coverage.test.d.ts +1 -0
- package/dist/__tests__/spec-hash.test.d.ts +1 -0
- package/dist/__tests__/spec-schema.test.d.ts +1 -0
- package/dist/__tests__/write-drift-evidence-requirement-coverage.test.d.ts +4 -0
- package/dist/agents/critic.d.ts +2 -2
- package/dist/cli/index.js +3438 -3188
- package/dist/commands/acknowledge-spec-drift.d.ts +5 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/registry.d.ts +4 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/plan-schema.d.ts +10 -0
- package/dist/config/spec-schema.d.ts +113 -0
- package/dist/evidence/manager.d.ts +8 -0
- package/dist/index.js +7356 -6520
- package/dist/plan/manager.d.ts +2 -2
- package/dist/services/preflight-service.d.ts +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/lint-spec.d.ts +2 -0
- package/dist/tools/req-coverage.d.ts +47 -0
- package/dist/tools/tool-names.d.ts +1 -1
- package/dist/tools/write-drift-evidence.d.ts +2 -0
- package/dist/types/events.d.ts +19 -1
- package/dist/utils/spec-hash.d.ts +15 -0
- package/package.json +1 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentDefinition } from '../agents/index.js';
|
|
2
|
+
export { handleAcknowledgeSpecDriftCommand } from './acknowledge-spec-drift';
|
|
2
3
|
export { handleAgentsCommand } from './agents';
|
|
3
4
|
export { handleAnalyzeCommand } from './analyze';
|
|
4
5
|
export { handleArchiveCommand } from './archive';
|
|
@@ -14,6 +14,10 @@ export type CommandEntry = {
|
|
|
14
14
|
subcommandOf?: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const COMMAND_REGISTRY: {
|
|
17
|
+
readonly 'acknowledge-spec-drift': {
|
|
18
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
19
|
+
readonly description: "Acknowledge that the spec has drifted from the plan and suppress further warnings";
|
|
20
|
+
};
|
|
17
21
|
readonly status: {
|
|
18
22
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
19
23
|
readonly description: "Show current swarm state";
|
package/dist/config/index.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskSta
|
|
|
7
7
|
export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
|
|
8
8
|
export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, PhaseCompleteConfig, PipelineConfig, PluginConfig, SwarmConfig, } from './schema';
|
|
9
9
|
export { AgentOverrideConfigSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, AutomationModeSchema, PhaseCompleteConfigSchema, PipelineConfigSchema, PluginConfigSchema, SwarmConfigSchema, } from './schema';
|
|
10
|
+
export type { DeltaSpec, Obligation, SpecDelta, SpecRequirement, SpecScenario, SpecSection, SwarmSpec, } from './spec-schema';
|
|
11
|
+
export { DeltaSpecSchema, ObligationSchema, SpecDeltaSchema, SpecRequirementSchema, SpecScenarioSchema, SpecSectionSchema, SwarmSpecSchema, validateSpecContent, } from './spec-schema';
|
|
@@ -144,8 +144,18 @@ export declare const PlanSchema: z.ZodObject<{
|
|
|
144
144
|
migrated: "migrated";
|
|
145
145
|
migration_failed: "migration_failed";
|
|
146
146
|
}>>;
|
|
147
|
+
specMtime: z.ZodOptional<z.ZodString>;
|
|
148
|
+
specHash: z.ZodOptional<z.ZodString>;
|
|
147
149
|
}, z.core.$strip>;
|
|
148
150
|
export type Plan = z.infer<typeof PlanSchema>;
|
|
151
|
+
/**
|
|
152
|
+
* Runtime plan with spec staleness tracking.
|
|
153
|
+
* Extends Plan with runtime-only fields that are not persisted.
|
|
154
|
+
*/
|
|
155
|
+
export type RuntimePlan = Plan & {
|
|
156
|
+
_specStale?: boolean;
|
|
157
|
+
_specStaleReason?: string;
|
|
158
|
+
};
|
|
149
159
|
/**
|
|
150
160
|
* Find the first phase that is in progress.
|
|
151
161
|
* @param phases - Array of phases
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ObligationSchema: z.ZodEnum<{
|
|
3
|
+
MUST: "MUST";
|
|
4
|
+
SHALL: "SHALL";
|
|
5
|
+
SHOULD: "SHOULD";
|
|
6
|
+
MAY: "MAY";
|
|
7
|
+
}>;
|
|
8
|
+
export type Obligation = z.infer<typeof ObligationSchema>;
|
|
9
|
+
export declare const SpecRequirementSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
obligation: z.ZodEnum<{
|
|
12
|
+
MUST: "MUST";
|
|
13
|
+
SHALL: "SHALL";
|
|
14
|
+
SHOULD: "SHOULD";
|
|
15
|
+
MAY: "MAY";
|
|
16
|
+
}>;
|
|
17
|
+
text: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type SpecRequirement = z.infer<typeof SpecRequirementSchema>;
|
|
20
|
+
export declare const SpecScenarioSchema: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
given: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
23
|
+
when: z.ZodArray<z.ZodString>;
|
|
24
|
+
thenClauses: z.ZodArray<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type SpecScenario = z.infer<typeof SpecScenarioSchema>;
|
|
27
|
+
export declare const SpecSectionSchema: z.ZodObject<{
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
requirements: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
obligation: z.ZodEnum<{
|
|
32
|
+
MUST: "MUST";
|
|
33
|
+
SHALL: "SHALL";
|
|
34
|
+
SHOULD: "SHOULD";
|
|
35
|
+
MAY: "MAY";
|
|
36
|
+
}>;
|
|
37
|
+
text: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type SpecSection = z.infer<typeof SpecSectionSchema>;
|
|
41
|
+
export declare const SwarmSpecSchema: z.ZodObject<{
|
|
42
|
+
title: z.ZodString;
|
|
43
|
+
purpose: z.ZodString;
|
|
44
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
requirements: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
obligation: z.ZodEnum<{
|
|
49
|
+
MUST: "MUST";
|
|
50
|
+
SHALL: "SHALL";
|
|
51
|
+
SHOULD: "SHOULD";
|
|
52
|
+
MAY: "MAY";
|
|
53
|
+
}>;
|
|
54
|
+
text: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export type SwarmSpec = z.infer<typeof SwarmSpecSchema>;
|
|
59
|
+
export declare const SpecDeltaSchema: z.ZodObject<{
|
|
60
|
+
added: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
obligation: z.ZodEnum<{
|
|
63
|
+
MUST: "MUST";
|
|
64
|
+
SHALL: "SHALL";
|
|
65
|
+
SHOULD: "SHOULD";
|
|
66
|
+
MAY: "MAY";
|
|
67
|
+
}>;
|
|
68
|
+
text: z.ZodString;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
modified: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
obligation: z.ZodEnum<{
|
|
73
|
+
MUST: "MUST";
|
|
74
|
+
SHALL: "SHALL";
|
|
75
|
+
SHOULD: "SHOULD";
|
|
76
|
+
MAY: "MAY";
|
|
77
|
+
}>;
|
|
78
|
+
text: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
removed: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
obligation: z.ZodEnum<{
|
|
83
|
+
MUST: "MUST";
|
|
84
|
+
SHALL: "SHALL";
|
|
85
|
+
SHOULD: "SHOULD";
|
|
86
|
+
MAY: "MAY";
|
|
87
|
+
}>;
|
|
88
|
+
text: z.ZodString;
|
|
89
|
+
}, z.core.$strip>>>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export type SpecDelta = z.infer<typeof SpecDeltaSchema>;
|
|
92
|
+
export declare const DeltaSpecSchema: z.ZodType<SwarmSpec | SpecDelta>;
|
|
93
|
+
export type DeltaSpec = z.infer<typeof DeltaSpecSchema>;
|
|
94
|
+
interface ValidationIssue {
|
|
95
|
+
line: number;
|
|
96
|
+
message: string;
|
|
97
|
+
}
|
|
98
|
+
interface SpecContentValidationResult {
|
|
99
|
+
valid: boolean;
|
|
100
|
+
issues: ValidationIssue[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Validate raw markdown spec content using regex patterns.
|
|
104
|
+
* Checks for:
|
|
105
|
+
* - FR-### requirement IDs
|
|
106
|
+
* - Obligation keywords (MUST, SHALL, SHOULD, MAY)
|
|
107
|
+
* - Section headers (## Section Name)
|
|
108
|
+
*
|
|
109
|
+
* @param content - Raw markdown string to validate
|
|
110
|
+
* @returns Validation result with issues array
|
|
111
|
+
*/
|
|
112
|
+
export declare function validateSpecContent(content: string): SpecContentValidationResult;
|
|
113
|
+
export {};
|
|
@@ -71,6 +71,14 @@ export declare function listEvidenceTaskIds(directory: string): Promise<string[]
|
|
|
71
71
|
* Returns true if deleted, false if didn't exist or deletion failed.
|
|
72
72
|
*/
|
|
73
73
|
export declare function deleteEvidence(directory: string, taskId: string): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Check if a requirement coverage file exists for a given phase.
|
|
76
|
+
* Looks for .swarm/evidence/req-coverage-phase-{N}.json
|
|
77
|
+
*/
|
|
78
|
+
export declare function checkRequirementCoverage(phase: number, directory: string): Promise<{
|
|
79
|
+
exists: boolean;
|
|
80
|
+
path: string;
|
|
81
|
+
}>;
|
|
74
82
|
/**
|
|
75
83
|
* Archive old evidence bundles based on retention policy.
|
|
76
84
|
* Removes evidence older than maxAgeDays.
|