@martinloop/mcp 0.7.1 → 0.8.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/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/vendor/adapters/claude-cli.d.ts +11 -1
- package/dist/vendor/adapters/claude-cli.js +285 -71
- package/dist/vendor/adapters/cli-bridge.d.ts +12 -3
- package/dist/vendor/adapters/cli-bridge.js +129 -149
- package/dist/vendor/adapters/codex-cli.d.ts +3 -3
- package/dist/vendor/adapters/codex-cli.js +10 -24
- package/dist/vendor/adapters/codex-host.js +127 -132
- package/dist/vendor/adapters/index.d.ts +2 -1
- package/dist/vendor/adapters/index.js +2 -1
- package/dist/vendor/adapters/openai-compatible.js +88 -6
- package/dist/vendor/adapters/process-supervisor.d.ts +60 -0
- package/dist/vendor/adapters/process-supervisor.js +541 -0
- package/dist/vendor/adapters/verifier-only.d.ts +10 -1
- package/dist/vendor/adapters/verifier-only.js +43 -1
- package/dist/vendor/contracts/external-outcome.d.ts +102 -0
- package/dist/vendor/contracts/external-outcome.js +226 -0
- package/dist/vendor/contracts/index.d.ts +8 -1
- package/dist/vendor/contracts/index.js +2 -0
- package/dist/vendor/contracts/swarm-hosted.d.ts +204 -0
- package/dist/vendor/contracts/swarm-hosted.js +629 -0
- package/dist/vendor/contracts/swarm.d.ts +449 -0
- package/dist/vendor/contracts/swarm.js +550 -0
- package/dist/vendor/core/external-outcome.d.ts +34 -0
- package/dist/vendor/core/external-outcome.js +515 -0
- package/dist/vendor/core/grounding.js +1 -1
- package/dist/vendor/core/index.d.ts +47 -1
- package/dist/vendor/core/index.js +53 -3
- package/dist/vendor/core/leash.d.ts +1 -0
- package/dist/vendor/core/leash.js +13 -0
- package/dist/vendor/core/persistence/integrity.d.ts +4 -0
- package/dist/vendor/core/persistence/integrity.js +19 -6
- package/dist/vendor/core/persistence/swarm-integrity.d.ts +63 -0
- package/dist/vendor/core/persistence/swarm-integrity.js +309 -0
- package/dist/vendor/core/swarm/candidates.d.ts +78 -0
- package/dist/vendor/core/swarm/candidates.js +810 -0
- package/dist/vendor/core/swarm/evidence-projection.d.ts +87 -0
- package/dist/vendor/core/swarm/evidence-projection.js +128 -0
- package/dist/vendor/core/swarm/evidence.d.ts +40 -0
- package/dist/vendor/core/swarm/evidence.js +575 -0
- package/dist/vendor/core/swarm/hosted-export.d.ts +48 -0
- package/dist/vendor/core/swarm/hosted-export.js +362 -0
- package/dist/vendor/core/swarm/hosted-projection.d.ts +5 -0
- package/dist/vendor/core/swarm/hosted-projection.js +258 -0
- package/dist/vendor/core/swarm/index.d.ts +110 -0
- package/dist/vendor/core/swarm/index.js +1060 -0
- package/dist/vendor/core/swarm/integration.d.ts +76 -0
- package/dist/vendor/core/swarm/integration.js +615 -0
- package/dist/vendor/core/swarm/lifecycle.d.ts +72 -0
- package/dist/vendor/core/swarm/lifecycle.js +252 -0
- package/dist/vendor/core/swarm/live-runtime.d.ts +78 -0
- package/dist/vendor/core/swarm/live-runtime.js +1482 -0
- package/dist/vendor/core/swarm/live-store.d.ts +99 -0
- package/dist/vendor/core/swarm/live-store.js +860 -0
- package/dist/vendor/core/swarm/operational-reader.d.ts +17 -0
- package/dist/vendor/core/swarm/operational-reader.js +96 -0
- package/dist/vendor/core/swarm/operations.d.ts +29 -0
- package/dist/vendor/core/swarm/operations.js +128 -0
- package/dist/vendor/core/swarm/parent-receipt.d.ts +13 -0
- package/dist/vendor/core/swarm/parent-receipt.js +489 -0
- package/dist/vendor/core/swarm/receipt-projection.d.ts +26 -0
- package/dist/vendor/core/swarm/receipt-projection.js +120 -0
- package/dist/vendor/core/swarm/scheduler.d.ts +92 -0
- package/dist/vendor/core/swarm/scheduler.js +555 -0
- package/dist/vendor/core/swarm/verification.d.ts +70 -0
- package/dist/vendor/core/swarm/verification.js +295 -0
- package/dist/vendor/core/swarm/workspaces.d.ts +77 -0
- package/dist/vendor/core/swarm/workspaces.js +488 -0
- package/dist/vendor/core/verified-handoff.d.ts +4 -0
- package/dist/vendor/core/verified-handoff.js +4 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import type { ApprovalPolicy, FailureClass, LoopBudget, ReceiptIntegrityState, VerificationStep } from "./index.js";
|
|
2
|
+
export declare const SWARM_SCHEMA_VERSION: "martin.swarm.v1";
|
|
3
|
+
export declare const SWARM_EVENT_TYPES: readonly ["SWARM_CREATED", "SWARM_PLAN_CREATED", "SWARM_PLAN_APPROVED", "TASK_READY", "TASK_ASSIGNED", "CHILD_STARTED", "CHILD_PROGRESS", "CHILD_VERIFIER_STARTED", "CHILD_VERIFIED", "CHILD_STOPPED", "CHILD_NEEDS_REVIEW", "CHILD_PATCH_PROPOSED", "CHILD_PATCH_REJECTED", "CHILD_PATCH_ADMITTED", "ACTION_BLOCKED", "TASK_REASSIGNED", "DEPENDENCY_SATISFIED", "INTEGRATION_STARTED", "INTEGRATION_CONFLICT", "INTEGRATION_COMPLETED", "GLOBAL_VERIFIER_STARTED", "GLOBAL_VERIFIER_PASSED", "GLOBAL_VERIFIER_FAILED", "SWARM_CANCEL_REQUESTED", "SWARM_STOPPED", "SWARM_NEEDS_REVIEW", "SWARM_VERIFIED"];
|
|
4
|
+
export type SwarmEventType = (typeof SWARM_EVENT_TYPES)[number];
|
|
5
|
+
export declare const SWARM_ORCHESTRATION_STRATEGIES: readonly ["hierarchical_dag", "pipeline_dag", "parallel_dag", "hybrid"];
|
|
6
|
+
export type SwarmOrchestrationStrategy = (typeof SWARM_ORCHESTRATION_STRATEGIES)[number];
|
|
7
|
+
export type SwarmIntegrationStrategy = "parent_fan_in" | "serial_parent_merge";
|
|
8
|
+
export type SwarmStopDisposition = "stop" | "needs_review";
|
|
9
|
+
export type SwarmVerifierAuthority = "child_only" | "parent_global";
|
|
10
|
+
export interface SwarmScope {
|
|
11
|
+
allowedPaths: string[];
|
|
12
|
+
deniedPaths: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface SwarmPermissions {
|
|
15
|
+
networkDomains: string[];
|
|
16
|
+
commands: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface SwarmStopPolicy {
|
|
19
|
+
budgetExhausted: SwarmStopDisposition;
|
|
20
|
+
blockingFailure: SwarmStopDisposition;
|
|
21
|
+
verifierFailure: SwarmStopDisposition;
|
|
22
|
+
}
|
|
23
|
+
export interface SwarmRecoveryPolicy {
|
|
24
|
+
maxReassignmentsPerTask: number;
|
|
25
|
+
dependencyWaiversAllowed: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface SwarmParentContract {
|
|
28
|
+
policyVersion: string;
|
|
29
|
+
objective: string;
|
|
30
|
+
definitionOfDone: string[];
|
|
31
|
+
budget: LoopBudget;
|
|
32
|
+
maxWallClockMs: number;
|
|
33
|
+
maxConcurrency: number;
|
|
34
|
+
scope: SwarmScope;
|
|
35
|
+
permissions: SwarmPermissions;
|
|
36
|
+
integrationStrategy: SwarmIntegrationStrategy;
|
|
37
|
+
globalVerifierStack: VerificationStep[];
|
|
38
|
+
stopPolicy: SwarmStopPolicy;
|
|
39
|
+
recoveryPolicy: SwarmRecoveryPolicy;
|
|
40
|
+
approvalPolicy: ApprovalPolicy;
|
|
41
|
+
orchestrationStrategy: SwarmOrchestrationStrategy;
|
|
42
|
+
}
|
|
43
|
+
export interface SwarmChildContract {
|
|
44
|
+
agentId: string;
|
|
45
|
+
taskIds: string[];
|
|
46
|
+
scope: SwarmScope;
|
|
47
|
+
budget: LoopBudget;
|
|
48
|
+
/** Optional explicit child ceiling, distinct from its initial fair-share reservation. */
|
|
49
|
+
hardMaxUsd?: number;
|
|
50
|
+
/** Optional explicit child ceiling, distinct from its initial fair-share reservation. */
|
|
51
|
+
hardMaxTokens?: number;
|
|
52
|
+
maxWallClockMs: number;
|
|
53
|
+
permissions: SwarmPermissions;
|
|
54
|
+
approvalPolicy: ApprovalPolicy;
|
|
55
|
+
verifierAuthority: SwarmVerifierAuthority;
|
|
56
|
+
}
|
|
57
|
+
export interface SwarmChildReceiptLink {
|
|
58
|
+
parentSwarmId: string;
|
|
59
|
+
agentId: string;
|
|
60
|
+
attemptId: string;
|
|
61
|
+
taskIds: string[];
|
|
62
|
+
}
|
|
63
|
+
export type SwarmTaskStatus = "queued" | "ready" | "running" | "accepted" | "rejected" | "stopped" | "needs_review";
|
|
64
|
+
export interface SwarmTaskNode {
|
|
65
|
+
taskId: string;
|
|
66
|
+
title: string;
|
|
67
|
+
objective: string;
|
|
68
|
+
required: boolean;
|
|
69
|
+
dependsOn: string[];
|
|
70
|
+
assignedAgentId?: string;
|
|
71
|
+
status: SwarmTaskStatus;
|
|
72
|
+
mutationMode: "read_only" | "write";
|
|
73
|
+
writeScope: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface SwarmDependencyWaiver {
|
|
76
|
+
taskId: string;
|
|
77
|
+
dependencyTaskId: string;
|
|
78
|
+
parentPolicyVersion: string;
|
|
79
|
+
approvedBy: string;
|
|
80
|
+
approvedAt: string;
|
|
81
|
+
}
|
|
82
|
+
export type SwarmAgentStatus = "queued" | "running" | "verified" | "stopped" | "needs_review";
|
|
83
|
+
export interface SwarmAgentRecord {
|
|
84
|
+
agentId: string;
|
|
85
|
+
role: string;
|
|
86
|
+
status: SwarmAgentStatus;
|
|
87
|
+
childRunId?: string;
|
|
88
|
+
contract: SwarmChildContract;
|
|
89
|
+
failureClass?: FailureClass;
|
|
90
|
+
}
|
|
91
|
+
export type SwarmLeaseStatus = "reserved" | "settled" | "overspent" | "released";
|
|
92
|
+
export interface SwarmBudgetUsage {
|
|
93
|
+
usd: number;
|
|
94
|
+
tokens: number;
|
|
95
|
+
provenance?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface SwarmBudgetLease {
|
|
98
|
+
leaseId: string;
|
|
99
|
+
agentId: string;
|
|
100
|
+
taskId: string;
|
|
101
|
+
reservedUsd: number;
|
|
102
|
+
reservedTokens: number;
|
|
103
|
+
status: SwarmLeaseStatus;
|
|
104
|
+
actualUsage?: SwarmBudgetUsage;
|
|
105
|
+
}
|
|
106
|
+
export interface SwarmBudgetLedger {
|
|
107
|
+
capUsd: number;
|
|
108
|
+
capTokens?: number;
|
|
109
|
+
settledUsd: number;
|
|
110
|
+
settledTokens: number;
|
|
111
|
+
leases: SwarmBudgetLease[];
|
|
112
|
+
}
|
|
113
|
+
export interface SwarmConflictRecord {
|
|
114
|
+
conflictId: string;
|
|
115
|
+
taskIds: string[];
|
|
116
|
+
paths: string[];
|
|
117
|
+
state: "detected" | "resolved" | "blocking";
|
|
118
|
+
resolution?: string;
|
|
119
|
+
schemaVersion?: typeof SWARM_SCHEMA_VERSION;
|
|
120
|
+
candidateId?: string;
|
|
121
|
+
childRunId?: string;
|
|
122
|
+
agentId?: string;
|
|
123
|
+
preIntegrationTreeHash?: string;
|
|
124
|
+
recordedAt?: string;
|
|
125
|
+
diagnostic?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface SwarmVerificationRecord {
|
|
128
|
+
verifierId: string;
|
|
129
|
+
scope: "child" | "parent_global";
|
|
130
|
+
state: "pending" | "passed" | "failed" | "unknown";
|
|
131
|
+
steps: VerificationStep[];
|
|
132
|
+
boundAt?: string;
|
|
133
|
+
}
|
|
134
|
+
export type SwarmWorkspaceKind = "child" | "integration" | "verifier";
|
|
135
|
+
export type SwarmWorkspaceState = "created" | "active" | "closed" | "cleanup_pending" | "removed";
|
|
136
|
+
interface SwarmWorkspaceRecordBase {
|
|
137
|
+
readonly schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
138
|
+
readonly workspaceId: string;
|
|
139
|
+
readonly swarmId: string;
|
|
140
|
+
readonly kind: SwarmWorkspaceKind;
|
|
141
|
+
readonly baselineCommit: string;
|
|
142
|
+
readonly state: SwarmWorkspaceState;
|
|
143
|
+
readonly createdAt: string;
|
|
144
|
+
}
|
|
145
|
+
export interface SwarmChildWorkspaceRecord extends SwarmWorkspaceRecordBase {
|
|
146
|
+
readonly kind: "child";
|
|
147
|
+
readonly childRunId: string;
|
|
148
|
+
readonly agentId: string;
|
|
149
|
+
readonly taskIds: readonly string[];
|
|
150
|
+
}
|
|
151
|
+
export interface SwarmIntegrationWorkspaceRecord extends SwarmWorkspaceRecordBase {
|
|
152
|
+
readonly kind: "integration";
|
|
153
|
+
}
|
|
154
|
+
export interface SwarmVerifierWorkspaceRecord extends SwarmWorkspaceRecordBase {
|
|
155
|
+
readonly kind: "verifier";
|
|
156
|
+
}
|
|
157
|
+
export type SwarmWorkspaceRecord = SwarmChildWorkspaceRecord | SwarmIntegrationWorkspaceRecord | SwarmVerifierWorkspaceRecord;
|
|
158
|
+
export interface SwarmCandidate {
|
|
159
|
+
readonly schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
160
|
+
readonly candidateId: string;
|
|
161
|
+
readonly swarmId: string;
|
|
162
|
+
readonly workspaceId: string;
|
|
163
|
+
readonly childRunId: string;
|
|
164
|
+
readonly agentId: string;
|
|
165
|
+
readonly taskIds: readonly string[];
|
|
166
|
+
readonly baselineCommit: string;
|
|
167
|
+
readonly patchSha256: string;
|
|
168
|
+
readonly changedPaths: readonly string[];
|
|
169
|
+
readonly createdAt: string;
|
|
170
|
+
}
|
|
171
|
+
export type SwarmPatchAdmissionState = "admitted" | "rejected";
|
|
172
|
+
export type SwarmPatchAdmissionReasonCode = "admitted" | "child_not_terminal" | "process_active" | "identity_mismatch" | "receipt_not_verified" | "receipt_scope_mismatch" | "stale_baseline" | "git_inventory_failed" | "invalid_concrete_path" | "unsafe_path" | "undeclared_path" | "path_not_allowed" | "path_denied" | "task_scope_violation" | "candidate_changed_during_capture" | "empty_candidate" | "patch_hash_mismatch" | "integration_precondition_failed" | "integration_conflict" | "integration_apply_failed" | "artifact_persistence_failed";
|
|
173
|
+
export interface SwarmPatchAdmission {
|
|
174
|
+
readonly schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
175
|
+
readonly admissionId: string;
|
|
176
|
+
readonly candidateId: string;
|
|
177
|
+
readonly swarmId: string;
|
|
178
|
+
readonly workspaceId: string;
|
|
179
|
+
readonly childRunId: string;
|
|
180
|
+
readonly agentId: string;
|
|
181
|
+
readonly taskIds: readonly string[];
|
|
182
|
+
readonly baselineCommit: string;
|
|
183
|
+
readonly changedPaths: readonly string[];
|
|
184
|
+
readonly state: SwarmPatchAdmissionState;
|
|
185
|
+
readonly reasonCode: SwarmPatchAdmissionReasonCode;
|
|
186
|
+
readonly receiptIntegrity: ReceiptIntegrityState;
|
|
187
|
+
readonly decidedAt: string;
|
|
188
|
+
readonly preIntegrationTreeHash?: string;
|
|
189
|
+
readonly postIntegrationTreeHash?: string;
|
|
190
|
+
readonly diagnostic?: string;
|
|
191
|
+
}
|
|
192
|
+
export type SwarmGlobalVerificationCommandState = "pending" | "passed" | "failed" | "unknown";
|
|
193
|
+
export type SwarmVerifierMutationState = "pending" | "clean" | "mutated" | "unknown";
|
|
194
|
+
export interface SwarmVerifierSubprocessResult {
|
|
195
|
+
readonly command: string;
|
|
196
|
+
readonly launched: boolean;
|
|
197
|
+
readonly completed: boolean;
|
|
198
|
+
readonly timedOut: boolean;
|
|
199
|
+
readonly exitCode: number | null;
|
|
200
|
+
readonly signal?: string;
|
|
201
|
+
readonly startedAt: string;
|
|
202
|
+
readonly completedAt?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface SwarmGlobalVerification {
|
|
205
|
+
readonly schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
206
|
+
readonly verificationId: string;
|
|
207
|
+
readonly swarmId: string;
|
|
208
|
+
readonly workspaceId: string;
|
|
209
|
+
readonly parentPolicyVersion: string;
|
|
210
|
+
readonly baselineCommit: string;
|
|
211
|
+
readonly integratedTreeHash: string;
|
|
212
|
+
readonly commands: readonly string[];
|
|
213
|
+
readonly commandState: SwarmGlobalVerificationCommandState;
|
|
214
|
+
readonly mutationState: SwarmVerifierMutationState;
|
|
215
|
+
readonly startedAt: string;
|
|
216
|
+
readonly completedAt?: string;
|
|
217
|
+
readonly subprocessResults: readonly SwarmVerifierSubprocessResult[];
|
|
218
|
+
}
|
|
219
|
+
export type SwarmProcessCloseState = "not_required" | "pending" | "closed" | "failed";
|
|
220
|
+
export type SwarmWorkspaceRemovalState = "pending" | "removed" | "failed";
|
|
221
|
+
export type SwarmCleanupState = "pending" | "completed" | "failed" | "cleanup_pending";
|
|
222
|
+
export interface SwarmCleanupRecord {
|
|
223
|
+
readonly schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
224
|
+
readonly cleanupId: string;
|
|
225
|
+
readonly swarmId: string;
|
|
226
|
+
readonly workspaceId: string;
|
|
227
|
+
readonly workspaceKind: SwarmWorkspaceKind;
|
|
228
|
+
readonly ownedProcessId?: number;
|
|
229
|
+
readonly evidencePersisted: boolean;
|
|
230
|
+
readonly processCloseState: SwarmProcessCloseState;
|
|
231
|
+
readonly removalState: SwarmWorkspaceRemovalState;
|
|
232
|
+
readonly state: SwarmCleanupState;
|
|
233
|
+
readonly attemptedAt: string;
|
|
234
|
+
readonly completedAt?: string;
|
|
235
|
+
readonly errorCode?: string;
|
|
236
|
+
}
|
|
237
|
+
export type SwarmDemoReferentialBindingState = "passed" | "failed" | "unknown";
|
|
238
|
+
export interface SwarmDeterministicDemoReceiptEvidence {
|
|
239
|
+
evidenceKind: "deterministic_demo";
|
|
240
|
+
swarmId: string;
|
|
241
|
+
agentId: string;
|
|
242
|
+
taskIds: string[];
|
|
243
|
+
childRunId: string;
|
|
244
|
+
referentialBinding: SwarmDemoReferentialBindingState;
|
|
245
|
+
signedIntegrity: "not_evaluated";
|
|
246
|
+
}
|
|
247
|
+
export type SwarmOutcomeState = "running" | "stopped" | "needs_review" | "verified";
|
|
248
|
+
export interface SwarmOutcome {
|
|
249
|
+
state: SwarmOutcomeState;
|
|
250
|
+
reason: string;
|
|
251
|
+
verifiedAt?: string;
|
|
252
|
+
}
|
|
253
|
+
export interface SwarmEvent {
|
|
254
|
+
type: SwarmEventType;
|
|
255
|
+
swarmId: string;
|
|
256
|
+
timestamp: string;
|
|
257
|
+
parentPolicyVersion: string;
|
|
258
|
+
taskId?: string;
|
|
259
|
+
agentId?: string;
|
|
260
|
+
childRunId?: string;
|
|
261
|
+
payload: Record<string, unknown>;
|
|
262
|
+
}
|
|
263
|
+
export interface SwarmRunRecord {
|
|
264
|
+
schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
265
|
+
swarmId: string;
|
|
266
|
+
workspaceId: string;
|
|
267
|
+
projectId: string;
|
|
268
|
+
parentContract: SwarmParentContract;
|
|
269
|
+
tasks: SwarmTaskNode[];
|
|
270
|
+
agents: SwarmAgentRecord[];
|
|
271
|
+
dependencyWaivers: SwarmDependencyWaiver[];
|
|
272
|
+
budgetLedger: SwarmBudgetLedger;
|
|
273
|
+
conflicts: SwarmConflictRecord[];
|
|
274
|
+
verification: SwarmVerificationRecord[];
|
|
275
|
+
outcome: SwarmOutcome;
|
|
276
|
+
events: SwarmEvent[];
|
|
277
|
+
createdAt: string;
|
|
278
|
+
updatedAt: string;
|
|
279
|
+
}
|
|
280
|
+
export interface SwarmRunDraft {
|
|
281
|
+
swarmId: string;
|
|
282
|
+
workspaceId: string;
|
|
283
|
+
projectId: string;
|
|
284
|
+
parentContract: SwarmParentContract;
|
|
285
|
+
tasks: SwarmTaskNode[];
|
|
286
|
+
agents: SwarmAgentRecord[];
|
|
287
|
+
dependencyWaivers?: SwarmDependencyWaiver[];
|
|
288
|
+
budgetLedger?: SwarmBudgetLedger;
|
|
289
|
+
conflicts?: SwarmConflictRecord[];
|
|
290
|
+
verification?: SwarmVerificationRecord[];
|
|
291
|
+
outcome?: SwarmOutcome;
|
|
292
|
+
events?: SwarmEvent[];
|
|
293
|
+
createdAt?: string;
|
|
294
|
+
updatedAt?: string;
|
|
295
|
+
}
|
|
296
|
+
export declare const SWARM_LIVE_ENGINES: readonly ["claude", "codex", "gemini", "openai"];
|
|
297
|
+
export type SwarmLiveEngine = (typeof SWARM_LIVE_ENGINES)[number];
|
|
298
|
+
export interface SwarmLiveEngineProfile {
|
|
299
|
+
engine: SwarmLiveEngine;
|
|
300
|
+
model: string;
|
|
301
|
+
}
|
|
302
|
+
export interface SwarmLivePlanDraft {
|
|
303
|
+
planId: string;
|
|
304
|
+
swarmId: string;
|
|
305
|
+
workspaceId: string;
|
|
306
|
+
projectId: string;
|
|
307
|
+
baselineCommit: string;
|
|
308
|
+
parentContract: SwarmParentContract;
|
|
309
|
+
tasks: SwarmTaskNode[];
|
|
310
|
+
agents: SwarmAgentRecord[];
|
|
311
|
+
engine: SwarmLiveEngineProfile;
|
|
312
|
+
childMaxIterations: number;
|
|
313
|
+
createdAt: string;
|
|
314
|
+
}
|
|
315
|
+
export interface SwarmLivePlan extends SwarmLivePlanDraft {
|
|
316
|
+
schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
317
|
+
planHash: string;
|
|
318
|
+
}
|
|
319
|
+
export type SwarmLiveRevision = number;
|
|
320
|
+
export interface SwarmLiveEvent {
|
|
321
|
+
schemaVersion: typeof SWARM_SCHEMA_VERSION;
|
|
322
|
+
sequence: number;
|
|
323
|
+
idempotencyKey: string;
|
|
324
|
+
type: SwarmEventType;
|
|
325
|
+
swarmId: string;
|
|
326
|
+
timestamp: string;
|
|
327
|
+
parentPolicyVersion: string;
|
|
328
|
+
planHash: string;
|
|
329
|
+
taskId?: string;
|
|
330
|
+
agentId?: string;
|
|
331
|
+
childRunId?: string;
|
|
332
|
+
failureClass?: FailureClass;
|
|
333
|
+
payload: Record<string, unknown>;
|
|
334
|
+
}
|
|
335
|
+
export declare const SWARM_PARENT_RECEIPT_SCHEMA_VERSION: "martin.swarm-receipt.v1";
|
|
336
|
+
export interface SwarmReceiptBlockedAction {
|
|
337
|
+
eventId: string;
|
|
338
|
+
sequence: number;
|
|
339
|
+
agentId: string;
|
|
340
|
+
taskId: string;
|
|
341
|
+
attemptId: string;
|
|
342
|
+
action: string;
|
|
343
|
+
reason: string;
|
|
344
|
+
timestamp: string;
|
|
345
|
+
}
|
|
346
|
+
export interface SwarmReceiptReassignment {
|
|
347
|
+
eventId: string;
|
|
348
|
+
sequence: number;
|
|
349
|
+
taskId: string;
|
|
350
|
+
fromAgentId: string;
|
|
351
|
+
toAgentId: string;
|
|
352
|
+
fromAttemptId: string;
|
|
353
|
+
toAttemptId: string;
|
|
354
|
+
reason: string;
|
|
355
|
+
timestamp: string;
|
|
356
|
+
}
|
|
357
|
+
export interface SwarmParentReceipt {
|
|
358
|
+
schemaVersion: typeof SWARM_PARENT_RECEIPT_SCHEMA_VERSION;
|
|
359
|
+
receiptId: string;
|
|
360
|
+
receiptSha256: string;
|
|
361
|
+
swarmId: string;
|
|
362
|
+
planHash: string;
|
|
363
|
+
objective: string;
|
|
364
|
+
engine: SwarmLiveEngineProfile;
|
|
365
|
+
baselineCommit: string;
|
|
366
|
+
tasks: SwarmTaskNode[];
|
|
367
|
+
agents: SwarmAgentRecord[];
|
|
368
|
+
budget: LoopBudget;
|
|
369
|
+
budgetLedger: SwarmBudgetLedger;
|
|
370
|
+
childReceipts: Array<{
|
|
371
|
+
childRunId: string;
|
|
372
|
+
agentId: string;
|
|
373
|
+
attemptId: string;
|
|
374
|
+
taskIds: string[];
|
|
375
|
+
receiptIntegritySha256: string;
|
|
376
|
+
}>;
|
|
377
|
+
blockedActions: SwarmReceiptBlockedAction[];
|
|
378
|
+
reassignments: SwarmReceiptReassignment[];
|
|
379
|
+
events: SwarmLiveEvent[];
|
|
380
|
+
evidenceIndexSha256: string;
|
|
381
|
+
evidenceFiles: Array<{
|
|
382
|
+
kind: "operational" | "artifact";
|
|
383
|
+
path: string;
|
|
384
|
+
sha256: string;
|
|
385
|
+
bytes: number;
|
|
386
|
+
}>;
|
|
387
|
+
evidenceBindings: {
|
|
388
|
+
admissions: string[];
|
|
389
|
+
rejections: string[];
|
|
390
|
+
conflicts: string[];
|
|
391
|
+
integration: string[];
|
|
392
|
+
globalVerification: string[];
|
|
393
|
+
cleanup: string[];
|
|
394
|
+
};
|
|
395
|
+
integratedTreeHash?: string;
|
|
396
|
+
globalVerificationId?: string;
|
|
397
|
+
parentOutcome: Omit<SwarmOutcome, "state"> & {
|
|
398
|
+
state: Exclude<SwarmOutcomeState, "running">;
|
|
399
|
+
};
|
|
400
|
+
taskVerificationState: "passed" | "failed" | "unknown";
|
|
401
|
+
sealedAt: string;
|
|
402
|
+
}
|
|
403
|
+
export interface SwarmValidationError {
|
|
404
|
+
code: string;
|
|
405
|
+
path: string;
|
|
406
|
+
message: string;
|
|
407
|
+
}
|
|
408
|
+
export type SwarmValidationResult = {
|
|
409
|
+
ok: true;
|
|
410
|
+
errors: [];
|
|
411
|
+
} | {
|
|
412
|
+
ok: false;
|
|
413
|
+
errors: SwarmValidationError[];
|
|
414
|
+
};
|
|
415
|
+
export type SwarmPathPatternResult = {
|
|
416
|
+
ok: true;
|
|
417
|
+
value: string;
|
|
418
|
+
} | {
|
|
419
|
+
ok: false;
|
|
420
|
+
error: string;
|
|
421
|
+
};
|
|
422
|
+
export type SwarmConcretePathResult = {
|
|
423
|
+
ok: true;
|
|
424
|
+
value: string;
|
|
425
|
+
} | {
|
|
426
|
+
ok: false;
|
|
427
|
+
error: string;
|
|
428
|
+
};
|
|
429
|
+
export declare function validateSwarmChildReceiptLink(value: unknown): SwarmValidationResult;
|
|
430
|
+
export declare function createSwarmLivePlan(draft: SwarmLivePlanDraft): SwarmLivePlan;
|
|
431
|
+
export declare function computeSwarmLivePlanHash(plan: SwarmLivePlan | (SwarmLivePlanDraft & {
|
|
432
|
+
schemaVersion?: typeof SWARM_SCHEMA_VERSION;
|
|
433
|
+
})): string;
|
|
434
|
+
export declare function validateSwarmLiveRevision(value: unknown): value is SwarmLiveRevision;
|
|
435
|
+
export declare function validateSwarmLivePlan(plan: SwarmLivePlan): SwarmValidationResult;
|
|
436
|
+
export declare function validateSwarmLiveEvent(event: SwarmLiveEvent, plan: SwarmLivePlan): SwarmValidationResult;
|
|
437
|
+
export declare function validateSwarmConcretePath(value: string): SwarmConcretePathResult;
|
|
438
|
+
export declare function swarmConcretePathMatchesPattern(concretePath: string, pattern: string): boolean;
|
|
439
|
+
export declare function normalizeSwarmPathPattern(value: string): SwarmPathPatternResult;
|
|
440
|
+
export declare function swarmPathPatternContains(parent: string, child: string): boolean;
|
|
441
|
+
export declare function swarmPathPatternsOverlap(left: string, right: string): boolean;
|
|
442
|
+
export declare function validateSwarmParentContract(parent: SwarmParentContract): SwarmValidationResult;
|
|
443
|
+
export declare function validateSwarmDeterministicDemoReceiptEvidence(evidence: SwarmDeterministicDemoReceiptEvidence): SwarmValidationResult;
|
|
444
|
+
export declare function validateSwarmChildContract(parent: SwarmParentContract, child: SwarmChildContract): SwarmValidationResult;
|
|
445
|
+
export declare function createSwarmRunRecord(draft: SwarmRunDraft, options?: {
|
|
446
|
+
now?: string;
|
|
447
|
+
}): SwarmRunRecord;
|
|
448
|
+
export declare function validateSwarmRunRecord(record: SwarmRunRecord): SwarmValidationResult;
|
|
449
|
+
export {};
|