baselineos 0.2.0-beta.1
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/LICENSE +17 -0
- package/README.md +198 -0
- package/dist/__evals__/runner.d.ts +2 -0
- package/dist/__evals__/runner.js +14687 -0
- package/dist/__evals__/runner.js.map +1 -0
- package/dist/api/server.d.ts +21 -0
- package/dist/api/server.js +1007 -0
- package/dist/api/server.js.map +1 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +8427 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/core/agent-bus.d.ts +110 -0
- package/dist/core/agent-bus.js +242 -0
- package/dist/core/agent-bus.js.map +1 -0
- package/dist/core/cache.d.ts +66 -0
- package/dist/core/cache.js +160 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/config.d.ts +1002 -0
- package/dist/core/config.js +429 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/indexer.d.ts +152 -0
- package/dist/core/indexer.js +481 -0
- package/dist/core/indexer.js.map +1 -0
- package/dist/core/llm-tracer.d.ts +2 -0
- package/dist/core/llm-tracer.js +241 -0
- package/dist/core/llm-tracer.js.map +1 -0
- package/dist/core/memory.d.ts +86 -0
- package/dist/core/memory.js +346 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/opa-client.d.ts +51 -0
- package/dist/core/opa-client.js +157 -0
- package/dist/core/opa-client.js.map +1 -0
- package/dist/core/opa-policy-gate.d.ts +133 -0
- package/dist/core/opa-policy-gate.js +454 -0
- package/dist/core/opa-policy-gate.js.map +1 -0
- package/dist/core/orchestrator.d.ts +14 -0
- package/dist/core/orchestrator.js +1297 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/pii-detector.d.ts +82 -0
- package/dist/core/pii-detector.js +126 -0
- package/dist/core/pii-detector.js.map +1 -0
- package/dist/core/rag-engine.d.ts +121 -0
- package/dist/core/rag-engine.js +504 -0
- package/dist/core/rag-engine.js.map +1 -0
- package/dist/core/task-queue.d.ts +69 -0
- package/dist/core/task-queue.js +124 -0
- package/dist/core/task-queue.js.map +1 -0
- package/dist/core/telemetry.d.ts +56 -0
- package/dist/core/telemetry.js +94 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/types.d.ts +328 -0
- package/dist/core/types.js +24 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +12444 -0
- package/dist/index.js.map +1 -0
- package/dist/llm-tracer-CIIujuO-.d.ts +493 -0
- package/dist/mcp/server.d.ts +2651 -0
- package/dist/mcp/server.js +676 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/orchestrator-DF89k_AK.d.ts +506 -0
- package/package.json +157 -0
- package/templates/README.md +7 -0
- package/templates/baseline.config.ts +207 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* BaselineOS Core Types
|
|
5
|
+
*
|
|
6
|
+
* @license Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type TaskStatus = 'pending' | 'planning' | 'executing' | 'verifying' | 'reviewing' | 'correcting' | 'completed' | 'failed' | 'blocked';
|
|
10
|
+
type TaskPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
11
|
+
type TaskComplexity = 'trivial' | 'simple' | 'moderate' | 'complex' | 'epic';
|
|
12
|
+
interface Task {
|
|
13
|
+
id: string;
|
|
14
|
+
parentId?: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
status: TaskStatus;
|
|
18
|
+
priority: TaskPriority;
|
|
19
|
+
complexity: TaskComplexity;
|
|
20
|
+
workflowId?: string;
|
|
21
|
+
workflowPlanId?: string;
|
|
22
|
+
subtasks: Task[];
|
|
23
|
+
dependencies: string[];
|
|
24
|
+
assignedAgent?: string;
|
|
25
|
+
requiredCapabilities: string[];
|
|
26
|
+
attempts: number;
|
|
27
|
+
maxAttempts: number;
|
|
28
|
+
currentCheckpoint?: string;
|
|
29
|
+
acceptanceCriteria: AcceptanceCriterion[];
|
|
30
|
+
verificationResults: VerificationResult[];
|
|
31
|
+
createdAt: number;
|
|
32
|
+
updatedAt: number;
|
|
33
|
+
completedAt?: number;
|
|
34
|
+
estimatedTokens?: number;
|
|
35
|
+
actualTokens?: number;
|
|
36
|
+
context: Record<string, unknown>;
|
|
37
|
+
artifacts: Artifact[];
|
|
38
|
+
needsHumanReview?: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface AcceptanceCriterion {
|
|
41
|
+
id: string;
|
|
42
|
+
description: string;
|
|
43
|
+
type: 'automated' | 'agent-review' | 'human-review';
|
|
44
|
+
checkFunction?: string;
|
|
45
|
+
weight: number;
|
|
46
|
+
}
|
|
47
|
+
interface VerificationResult {
|
|
48
|
+
criterionId: string;
|
|
49
|
+
passed: boolean;
|
|
50
|
+
confidence: number;
|
|
51
|
+
details: string;
|
|
52
|
+
verifiedBy: string;
|
|
53
|
+
verifiedAt: number;
|
|
54
|
+
}
|
|
55
|
+
interface Artifact {
|
|
56
|
+
id: string;
|
|
57
|
+
type: 'code' | 'document' | 'config' | 'test' | 'analysis' | 'decision';
|
|
58
|
+
path?: string;
|
|
59
|
+
content?: string;
|
|
60
|
+
checksum?: string;
|
|
61
|
+
createdBy: string;
|
|
62
|
+
createdAt: number;
|
|
63
|
+
}
|
|
64
|
+
declare const TaskInputSchema: z.ZodObject<{
|
|
65
|
+
title: z.ZodString;
|
|
66
|
+
description: z.ZodString;
|
|
67
|
+
priority: z.ZodDefault<z.ZodEnum<["critical", "high", "medium", "low"]>>;
|
|
68
|
+
requiredCapabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
69
|
+
acceptanceCriteria: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
70
|
+
description: z.ZodString;
|
|
71
|
+
type: z.ZodDefault<z.ZodEnum<["automated", "agent-review", "human-review"]>>;
|
|
72
|
+
weight: z.ZodDefault<z.ZodNumber>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
type: "automated" | "agent-review" | "human-review";
|
|
75
|
+
description: string;
|
|
76
|
+
weight: number;
|
|
77
|
+
}, {
|
|
78
|
+
description: string;
|
|
79
|
+
type?: "automated" | "agent-review" | "human-review" | undefined;
|
|
80
|
+
weight?: number | undefined;
|
|
81
|
+
}>, "many">>;
|
|
82
|
+
context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
title: string;
|
|
85
|
+
description: string;
|
|
86
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
87
|
+
requiredCapabilities: string[];
|
|
88
|
+
acceptanceCriteria: {
|
|
89
|
+
type: "automated" | "agent-review" | "human-review";
|
|
90
|
+
description: string;
|
|
91
|
+
weight: number;
|
|
92
|
+
}[];
|
|
93
|
+
context: Record<string, unknown>;
|
|
94
|
+
}, {
|
|
95
|
+
title: string;
|
|
96
|
+
description: string;
|
|
97
|
+
priority?: "critical" | "high" | "medium" | "low" | undefined;
|
|
98
|
+
requiredCapabilities?: string[] | undefined;
|
|
99
|
+
acceptanceCriteria?: {
|
|
100
|
+
description: string;
|
|
101
|
+
type?: "automated" | "agent-review" | "human-review" | undefined;
|
|
102
|
+
weight?: number | undefined;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
context?: Record<string, unknown> | undefined;
|
|
105
|
+
}>;
|
|
106
|
+
type TaskInput = z.infer<typeof TaskInputSchema>;
|
|
107
|
+
type AgentRole = 'planner' | 'executor' | 'verifier' | 'supervisor' | 'quality' | 'specialist';
|
|
108
|
+
type AgentStatus = 'idle' | 'busy' | 'blocked' | 'error' | 'offline' | 'suspended';
|
|
109
|
+
interface Agent {
|
|
110
|
+
id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
role: AgentRole;
|
|
113
|
+
status: AgentStatus;
|
|
114
|
+
capabilities: string[];
|
|
115
|
+
domains: string[];
|
|
116
|
+
/**
|
|
117
|
+
* Semantic version of this agent's prompt/behavior specification.
|
|
118
|
+
* Format: MAJOR.MINOR.PATCH — bump MAJOR on breaking behavior change,
|
|
119
|
+
* MINOR on new capability, PATCH on prompt refinement.
|
|
120
|
+
* Included in eval output and audit trail for regression tracking.
|
|
121
|
+
*/
|
|
122
|
+
promptVersion?: string;
|
|
123
|
+
trustScore: number;
|
|
124
|
+
successRate: number;
|
|
125
|
+
averageQuality: number;
|
|
126
|
+
tasksCompleted: number;
|
|
127
|
+
tasksFailed: number;
|
|
128
|
+
currentTask?: string;
|
|
129
|
+
taskQueue: string[];
|
|
130
|
+
supervisorId?: string;
|
|
131
|
+
supervisees: string[];
|
|
132
|
+
maxConcurrentTasks: number;
|
|
133
|
+
autoVerify: boolean;
|
|
134
|
+
escalationThreshold: number;
|
|
135
|
+
createdAt: number;
|
|
136
|
+
lastActiveAt: number;
|
|
137
|
+
}
|
|
138
|
+
interface Checkpoint {
|
|
139
|
+
id: string;
|
|
140
|
+
taskId: string;
|
|
141
|
+
stepId?: string;
|
|
142
|
+
state: Record<string, unknown>;
|
|
143
|
+
artifacts: Artifact[];
|
|
144
|
+
decisions: Decision[];
|
|
145
|
+
createdBy: string;
|
|
146
|
+
createdAt: number;
|
|
147
|
+
description: string;
|
|
148
|
+
recoverable: boolean;
|
|
149
|
+
expiresAt?: number;
|
|
150
|
+
}
|
|
151
|
+
interface Decision {
|
|
152
|
+
id: string;
|
|
153
|
+
description: string;
|
|
154
|
+
options: DecisionOption[];
|
|
155
|
+
selectedOption: string;
|
|
156
|
+
rationale: string;
|
|
157
|
+
madeBy: string;
|
|
158
|
+
madeAt: number;
|
|
159
|
+
reversible: boolean;
|
|
160
|
+
confidence: number;
|
|
161
|
+
}
|
|
162
|
+
interface DecisionOption {
|
|
163
|
+
id: string;
|
|
164
|
+
description: string;
|
|
165
|
+
pros: string[];
|
|
166
|
+
cons: string[];
|
|
167
|
+
risk: 'low' | 'medium' | 'high';
|
|
168
|
+
}
|
|
169
|
+
interface Review {
|
|
170
|
+
id: string;
|
|
171
|
+
taskId: string;
|
|
172
|
+
reviewerId: string;
|
|
173
|
+
revieweeId: string;
|
|
174
|
+
type: 'self' | 'peer' | 'supervisor' | 'quality';
|
|
175
|
+
scope: 'full' | 'partial' | 'spot-check';
|
|
176
|
+
findings: ReviewFinding[];
|
|
177
|
+
overallAssessment: 'approved' | 'needs-work' | 'rejected';
|
|
178
|
+
confidence: number;
|
|
179
|
+
feedback: string;
|
|
180
|
+
suggestions: string[];
|
|
181
|
+
requiredChanges: string[];
|
|
182
|
+
createdAt: number;
|
|
183
|
+
completedAt?: number;
|
|
184
|
+
timeSpent: number;
|
|
185
|
+
}
|
|
186
|
+
interface ReviewFinding {
|
|
187
|
+
id: string;
|
|
188
|
+
severity: 'critical' | 'major' | 'minor' | 'suggestion';
|
|
189
|
+
category: 'correctness' | 'completeness' | 'quality' | 'consistency' | 'security';
|
|
190
|
+
description: string;
|
|
191
|
+
location?: string;
|
|
192
|
+
suggestion?: string;
|
|
193
|
+
}
|
|
194
|
+
interface ExecutionPlan {
|
|
195
|
+
id: string;
|
|
196
|
+
taskId: string;
|
|
197
|
+
steps: ExecutionStep[];
|
|
198
|
+
estimatedTokens: number;
|
|
199
|
+
estimatedDuration: number;
|
|
200
|
+
riskAssessment: string[];
|
|
201
|
+
createdAt: number;
|
|
202
|
+
}
|
|
203
|
+
interface ExecutionStep {
|
|
204
|
+
id: string;
|
|
205
|
+
title: string;
|
|
206
|
+
description: string;
|
|
207
|
+
action: StepAction;
|
|
208
|
+
dependencies: string[];
|
|
209
|
+
assignedAgent?: string;
|
|
210
|
+
status: 'pending' | 'executing' | 'completed' | 'failed' | 'skipped';
|
|
211
|
+
result?: StepResult;
|
|
212
|
+
verificationCriteria: string[];
|
|
213
|
+
}
|
|
214
|
+
interface StepAction {
|
|
215
|
+
type: 'llm' | 'tool' | 'human' | 'composite';
|
|
216
|
+
operation: string;
|
|
217
|
+
parameters: Record<string, unknown>;
|
|
218
|
+
timeout?: number;
|
|
219
|
+
}
|
|
220
|
+
interface StepResult {
|
|
221
|
+
success: boolean;
|
|
222
|
+
output: unknown;
|
|
223
|
+
artifacts: Artifact[];
|
|
224
|
+
tokensUsed: number;
|
|
225
|
+
duration: number;
|
|
226
|
+
error?: string;
|
|
227
|
+
}
|
|
228
|
+
interface WorkflowBudget {
|
|
229
|
+
maxTokens?: number;
|
|
230
|
+
maxCostUsd?: number;
|
|
231
|
+
costPer1kTokensUsd?: number;
|
|
232
|
+
maxSteps?: number;
|
|
233
|
+
maxDurationMs?: number;
|
|
234
|
+
maxAttempts?: number;
|
|
235
|
+
/** Optional tenant identifier for per-tenant cost allocation (SIGNAL-052) */
|
|
236
|
+
tenantId?: string;
|
|
237
|
+
}
|
|
238
|
+
interface WorkflowStepTemplate {
|
|
239
|
+
id: string;
|
|
240
|
+
title: string;
|
|
241
|
+
description: string;
|
|
242
|
+
action: StepAction;
|
|
243
|
+
verificationCriteria?: string[];
|
|
244
|
+
}
|
|
245
|
+
interface WorkflowDefinition {
|
|
246
|
+
id: string;
|
|
247
|
+
name: string;
|
|
248
|
+
description?: string;
|
|
249
|
+
steps: WorkflowStepTemplate[];
|
|
250
|
+
requiredCapabilities?: string[];
|
|
251
|
+
budget?: WorkflowBudget;
|
|
252
|
+
}
|
|
253
|
+
type OrchestratorEvent = {
|
|
254
|
+
type: 'task:created';
|
|
255
|
+
task: Task;
|
|
256
|
+
} | {
|
|
257
|
+
type: 'task:decomposed';
|
|
258
|
+
task: Task;
|
|
259
|
+
subtasks: Task[];
|
|
260
|
+
} | {
|
|
261
|
+
type: 'task:assigned';
|
|
262
|
+
task: Task;
|
|
263
|
+
agent: Agent;
|
|
264
|
+
} | {
|
|
265
|
+
type: 'task:started';
|
|
266
|
+
task: Task;
|
|
267
|
+
} | {
|
|
268
|
+
type: 'task:checkpoint';
|
|
269
|
+
task: Task;
|
|
270
|
+
checkpoint: Checkpoint;
|
|
271
|
+
} | {
|
|
272
|
+
type: 'task:verified';
|
|
273
|
+
task: Task;
|
|
274
|
+
result: VerificationResult;
|
|
275
|
+
} | {
|
|
276
|
+
type: 'task:review-requested';
|
|
277
|
+
task: Task;
|
|
278
|
+
reviewer: Agent;
|
|
279
|
+
} | {
|
|
280
|
+
type: 'task:reviewed';
|
|
281
|
+
task: Task;
|
|
282
|
+
review: Review;
|
|
283
|
+
} | {
|
|
284
|
+
type: 'task:correction-needed';
|
|
285
|
+
task: Task;
|
|
286
|
+
feedback: string;
|
|
287
|
+
} | {
|
|
288
|
+
type: 'task:corrected';
|
|
289
|
+
task: Task;
|
|
290
|
+
} | {
|
|
291
|
+
type: 'task:completed';
|
|
292
|
+
task: Task;
|
|
293
|
+
} | {
|
|
294
|
+
type: 'task:failed';
|
|
295
|
+
task: Task;
|
|
296
|
+
error: unknown;
|
|
297
|
+
} | {
|
|
298
|
+
type: 'task:blocked';
|
|
299
|
+
task: Task;
|
|
300
|
+
reason: string;
|
|
301
|
+
policy: string;
|
|
302
|
+
} | {
|
|
303
|
+
type: 'task:approved';
|
|
304
|
+
task: Task;
|
|
305
|
+
approvedBy: string;
|
|
306
|
+
} | {
|
|
307
|
+
type: 'agent:status-changed';
|
|
308
|
+
agent: Agent;
|
|
309
|
+
previousStatus: AgentStatus;
|
|
310
|
+
} | {
|
|
311
|
+
type: 'agent:trust-updated';
|
|
312
|
+
agent: Agent;
|
|
313
|
+
previousTrust: number;
|
|
314
|
+
} | {
|
|
315
|
+
type: 'agent:suspended';
|
|
316
|
+
agent: Agent;
|
|
317
|
+
reason: string;
|
|
318
|
+
} | {
|
|
319
|
+
type: 'agent:reinstated';
|
|
320
|
+
agent: Agent;
|
|
321
|
+
} | {
|
|
322
|
+
type: 'escalation';
|
|
323
|
+
task: Task;
|
|
324
|
+
reason: string;
|
|
325
|
+
escalatedTo: string;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export { type AcceptanceCriterion, type Agent, type AgentRole, type AgentStatus, type Artifact, type Checkpoint, type Decision, type DecisionOption, type ExecutionPlan, type ExecutionStep, type OrchestratorEvent, type Review, type ReviewFinding, type StepAction, type StepResult, type Task, type TaskComplexity, type TaskInput, TaskInputSchema, type TaskPriority, type TaskStatus, type VerificationResult, type WorkflowBudget, type WorkflowDefinition, type WorkflowStepTemplate };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/core/types.ts
|
|
4
|
+
var TaskInputSchema = z.object({
|
|
5
|
+
title: z.string().min(1),
|
|
6
|
+
description: z.string().min(1),
|
|
7
|
+
priority: z.enum(["critical", "high", "medium", "low"]).default("medium"),
|
|
8
|
+
requiredCapabilities: z.array(z.string()).default([]),
|
|
9
|
+
acceptanceCriteria: z.array(z.object({
|
|
10
|
+
description: z.string(),
|
|
11
|
+
type: z.enum(["automated", "agent-review", "human-review"]).default("automated"),
|
|
12
|
+
weight: z.number().min(0).max(1).default(1)
|
|
13
|
+
})).default([]),
|
|
14
|
+
context: z.record(z.unknown()).default({})
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* BaselineOS Core Types
|
|
18
|
+
*
|
|
19
|
+
* @license Apache-2.0
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export { TaskInputSchema };
|
|
23
|
+
//# sourceMappingURL=types.js.map
|
|
24
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/types.ts"],"names":[],"mappings":";;;AAkFO,IAAM,eAAA,GAAkB,EAAE,MAAA,CAAO;AAAA,EACtC,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA,EACvB,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA,EAC7B,QAAA,EAAU,CAAA,CAAE,IAAA,CAAK,CAAC,UAAA,EAAY,MAAA,EAAQ,QAAA,EAAU,KAAK,CAAC,CAAA,CAAE,OAAA,CAAQ,QAAQ,CAAA;AAAA,EACxE,oBAAA,EAAsB,EAAE,KAAA,CAAM,CAAA,CAAE,QAAQ,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAAA,EACpD,kBAAA,EAAoB,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,MAAA,CAAO;AAAA,IACnC,WAAA,EAAa,EAAE,MAAA,EAAO;AAAA,IACtB,IAAA,EAAM,CAAA,CAAE,IAAA,CAAK,CAAC,WAAA,EAAa,gBAAgB,cAAc,CAAC,CAAA,CAAE,OAAA,CAAQ,WAAW,CAAA;AAAA,IAC/E,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,OAAA,CAAQ,CAAC;AAAA,GAC3C,CAAC,CAAA,CAAE,OAAA,CAAQ,EAAE,CAAA;AAAA,EACd,OAAA,EAAS,EAAE,MAAA,CAAO,CAAA,CAAE,SAAS,CAAA,CAAE,OAAA,CAAQ,EAAE;AAC3C,CAAC","file":"types.js","sourcesContent":["/**\n * BaselineOS Core Types\n * \n * @license Apache-2.0\n */\n\nimport { z } from 'zod';\n\n// ─── Task Types ──────────────────────────────────────────────────────────────\n\nexport type TaskStatus = \n | 'pending'\n | 'planning'\n | 'executing'\n | 'verifying'\n | 'reviewing'\n | 'correcting'\n | 'completed'\n | 'failed'\n | 'blocked';\n\nexport type TaskPriority = 'critical' | 'high' | 'medium' | 'low';\nexport type TaskComplexity = 'trivial' | 'simple' | 'moderate' | 'complex' | 'epic';\n\nexport interface Task {\n id: string;\n parentId?: string;\n title: string;\n description: string;\n status: TaskStatus;\n priority: TaskPriority;\n complexity: TaskComplexity;\n workflowId?: string;\n workflowPlanId?: string;\n subtasks: Task[];\n dependencies: string[];\n assignedAgent?: string;\n requiredCapabilities: string[];\n attempts: number;\n maxAttempts: number;\n currentCheckpoint?: string;\n acceptanceCriteria: AcceptanceCriterion[];\n verificationResults: VerificationResult[];\n createdAt: number;\n updatedAt: number;\n completedAt?: number;\n estimatedTokens?: number;\n actualTokens?: number;\n context: Record<string, unknown>;\n artifacts: Artifact[];\n needsHumanReview?: boolean;\n}\n\nexport interface AcceptanceCriterion {\n id: string;\n description: string;\n type: 'automated' | 'agent-review' | 'human-review';\n checkFunction?: string;\n weight: number;\n}\n\nexport interface VerificationResult {\n criterionId: string;\n passed: boolean;\n confidence: number;\n details: string;\n verifiedBy: string;\n verifiedAt: number;\n}\n\nexport interface Artifact {\n id: string;\n type: 'code' | 'document' | 'config' | 'test' | 'analysis' | 'decision';\n path?: string;\n content?: string;\n checksum?: string;\n createdBy: string;\n createdAt: number;\n}\n\n// ─── Task Input ──────────────────────────────────────────────────────────────\n\nexport const TaskInputSchema = z.object({\n title: z.string().min(1),\n description: z.string().min(1),\n priority: z.enum(['critical', 'high', 'medium', 'low']).default('medium'),\n requiredCapabilities: z.array(z.string()).default([]),\n acceptanceCriteria: z.array(z.object({\n description: z.string(),\n type: z.enum(['automated', 'agent-review', 'human-review']).default('automated'),\n weight: z.number().min(0).max(1).default(1),\n })).default([]),\n context: z.record(z.unknown()).default({}),\n});\n\nexport type TaskInput = z.infer<typeof TaskInputSchema>;\n\n// ─── Agent Types ─────────────────────────────────────────────────────────────\n\nexport type AgentRole = 'planner' | 'executor' | 'verifier' | 'supervisor' | 'quality' | 'specialist';\nexport type AgentStatus = 'idle' | 'busy' | 'blocked' | 'error' | 'offline' | 'suspended';\n\nexport interface Agent {\n id: string;\n name: string;\n role: AgentRole;\n status: AgentStatus;\n capabilities: string[];\n domains: string[];\n /**\n * Semantic version of this agent's prompt/behavior specification.\n * Format: MAJOR.MINOR.PATCH — bump MAJOR on breaking behavior change,\n * MINOR on new capability, PATCH on prompt refinement.\n * Included in eval output and audit trail for regression tracking.\n */\n promptVersion?: string;\n trustScore: number;\n successRate: number;\n averageQuality: number;\n tasksCompleted: number;\n tasksFailed: number;\n currentTask?: string;\n taskQueue: string[];\n supervisorId?: string;\n supervisees: string[];\n maxConcurrentTasks: number;\n autoVerify: boolean;\n escalationThreshold: number;\n createdAt: number;\n lastActiveAt: number;\n}\n\n// ─── Checkpoint Types ────────────────────────────────────────────────────────\n\nexport interface Checkpoint {\n id: string;\n taskId: string;\n stepId?: string;\n state: Record<string, unknown>;\n artifacts: Artifact[];\n decisions: Decision[];\n createdBy: string;\n createdAt: number;\n description: string;\n recoverable: boolean;\n expiresAt?: number;\n}\n\nexport interface Decision {\n id: string;\n description: string;\n options: DecisionOption[];\n selectedOption: string;\n rationale: string;\n madeBy: string;\n madeAt: number;\n reversible: boolean;\n confidence: number;\n}\n\nexport interface DecisionOption {\n id: string;\n description: string;\n pros: string[];\n cons: string[];\n risk: 'low' | 'medium' | 'high';\n}\n\n// ─── Review Types ────────────────────────────────────────────────────────────\n\nexport interface Review {\n id: string;\n taskId: string;\n reviewerId: string;\n revieweeId: string;\n type: 'self' | 'peer' | 'supervisor' | 'quality';\n scope: 'full' | 'partial' | 'spot-check';\n findings: ReviewFinding[];\n overallAssessment: 'approved' | 'needs-work' | 'rejected';\n confidence: number;\n feedback: string;\n suggestions: string[];\n requiredChanges: string[];\n createdAt: number;\n completedAt?: number;\n timeSpent: number;\n}\n\nexport interface ReviewFinding {\n id: string;\n severity: 'critical' | 'major' | 'minor' | 'suggestion';\n category: 'correctness' | 'completeness' | 'quality' | 'consistency' | 'security';\n description: string;\n location?: string;\n suggestion?: string;\n}\n\n// ─── Execution Types ─────────────────────────────────────────────────────────\n\nexport interface ExecutionPlan {\n id: string;\n taskId: string;\n steps: ExecutionStep[];\n estimatedTokens: number;\n estimatedDuration: number;\n riskAssessment: string[];\n createdAt: number;\n}\n\nexport interface ExecutionStep {\n id: string;\n title: string;\n description: string;\n action: StepAction;\n dependencies: string[];\n assignedAgent?: string;\n status: 'pending' | 'executing' | 'completed' | 'failed' | 'skipped';\n result?: StepResult;\n verificationCriteria: string[];\n}\n\nexport interface StepAction {\n type: 'llm' | 'tool' | 'human' | 'composite';\n operation: string;\n parameters: Record<string, unknown>;\n timeout?: number;\n}\n\nexport interface StepResult {\n success: boolean;\n output: unknown;\n artifacts: Artifact[];\n tokensUsed: number;\n duration: number;\n error?: string;\n}\n\n// ─── Workflow Types ──────────────────────────────────────────────────────────\n\nexport interface WorkflowBudget {\n maxTokens?: number;\n maxCostUsd?: number;\n costPer1kTokensUsd?: number;\n maxSteps?: number;\n maxDurationMs?: number;\n maxAttempts?: number;\n /** Optional tenant identifier for per-tenant cost allocation (SIGNAL-052) */\n tenantId?: string;\n}\n\nexport interface WorkflowStepTemplate {\n id: string;\n title: string;\n description: string;\n action: StepAction;\n verificationCriteria?: string[];\n}\n\nexport interface WorkflowDefinition {\n id: string;\n name: string;\n description?: string;\n steps: WorkflowStepTemplate[];\n requiredCapabilities?: string[];\n budget?: WorkflowBudget;\n}\n\n// ─── Event Types ─────────────────────────────────────────────────────────────\n\nexport type OrchestratorEvent =\n | { type: 'task:created'; task: Task }\n | { type: 'task:decomposed'; task: Task; subtasks: Task[] }\n | { type: 'task:assigned'; task: Task; agent: Agent }\n | { type: 'task:started'; task: Task }\n | { type: 'task:checkpoint'; task: Task; checkpoint: Checkpoint }\n | { type: 'task:verified'; task: Task; result: VerificationResult }\n | { type: 'task:review-requested'; task: Task; reviewer: Agent }\n | { type: 'task:reviewed'; task: Task; review: Review }\n | { type: 'task:correction-needed'; task: Task; feedback: string }\n | { type: 'task:corrected'; task: Task }\n | { type: 'task:completed'; task: Task }\n | { type: 'task:failed'; task: Task; error: unknown }\n | { type: 'task:blocked'; task: Task; reason: string; policy: string }\n | { type: 'task:approved'; task: Task; approvedBy: string }\n | { type: 'agent:status-changed'; agent: Agent; previousStatus: AgentStatus }\n | { type: 'agent:trust-updated'; agent: Agent; previousTrust: number }\n | { type: 'agent:suspended'; agent: Agent; reason: string }\n | { type: 'agent:reinstated'; agent: Agent }\n | { type: 'escalation'; task: Task; reason: string; escalatedTo: string };\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { Agent, Artifact, Checkpoint, Task, TaskInput, TaskStatus } from './core/types.js';
|
|
2
|
+
import './core/agent-bus.js';
|
|
3
|
+
export { CollectionName, IngestionResult, RAGChunk, RAGConfig, RAGEngine, RAGResult } from './core/rag-engine.js';
|
|
4
|
+
export { A as AnthropicEngine, b as AnthropicEngineConfig, c as AuditEvent, d as AuditLog, e as AuditLogConfig, C as ComplianceResult, f as ComplianceViolation, D as DecompositionResult, a as ExecutionEngine, E as ExecutionResult, L as LayerId, g as LayerResult, h as LayerSweep, i as LayerSweepConfig, j as LayerSweepContext, k as LayerSweepResult, M as MockExecutionEngine, O as Orchestrator, T as ToolExecutor } from './orchestrator-DF89k_AK.js';
|
|
5
|
+
export { MemoryScope, MemorySystem } from './core/memory.js';
|
|
6
|
+
export { Context, ContextLevel, KnowledgeIndexer, SearchResult } from './core/indexer.js';
|
|
7
|
+
export { BaselineConfig, ConfigLoader } from './core/config.js';
|
|
8
|
+
export { A as APIServer, a as ActivityDependencies, b as AgentConfig, c as AgentDefinition, d as AgentExecutionRecord, e as AgentExecutor, f as AgentExecutorConfig, g as AgentExecutorEvent, h as AgentExecutorEventType, i as AgenticBridge, j as AgenticBridgeConfig, k as AgenticExecutionResult, l as ApprovalToken, m as ApprovalTokenConfig, n as ApprovalTokenManager, B as BASELINE_TASK_QUEUE, o as Baseline, p as BaselineActivities, q as BaselineStats, r as BlockerAnalysis, C as CharterCommitment, s as CommandCenter, t as CommandCenterConfig, u as CommandCenterEvent, v as CommandCenterEventType, w as CommandCenterMetrics, x as CommandCenterStatus, y as ComplianceControl, z as ComplianceOSBridge, D as ControlCheckContext, E as ControlCheckResult, F as CostCheckResult, G as CostGuard, H as CostGuardConfig, I as CredentialAccessEvent, J as CredentialEntry, K as CredentialExpiredError, L as CredentialProvider, M as CredentialProviderConfig, N as CycleOutcome, O as CycleTrigger, P as DEFAULT_PROBES, Q as DFIEvidenceBundle, R as DependencyEdge, S as DependencyGraph, T as DriftDetector, U as DriftDetectorConfig, V as DriftReport, W as DriftSeverity, X as DriftStrategy, Y as EvaluateInput, Z as EvidenceExporter, _ as ExpiringCredential, $ as ExportOptions, a0 as GTCX_EDGES, a1 as GTCX_REPOS, a2 as GitActivity, a3 as GovernanceValidationResult, a4 as GovernanceValidator, a5 as GovernanceValidatorConfig, a6 as HandoffContext, a7 as ImprovementCycle, a8 as ImprovementCycleLog, a9 as ImprovementCycleLogConfig, aa as L5CycleInput, ab as L5CycleResult, ac as L5Pipeline, ad as L5PipelineConfig, ae as LoadedPrompt, MCPServer, af as MigrationAuditEntry, ag as MigrationResult, ah as MigrationTaskContext, ai as NDPCCheckResult, aj as NDPCComplianceGate, ak as NDPCContext, al as NDPCViolation, am as OutputValidationFailure, an as OutputValidationFailureReason, ao as OutputValidationResult, ap as OutputValidator, aq as OutputValidatorConfig, ar as Permission, as as PillarResult, at as Pipeline, au as PipelineExecution, av as PipelineStep, aw as PipelineStepExecution, ax as ProbeCategory, ay as ProbeResult, az as PromotionDecision, aA as PromotionGate, aB as PromotionGateConfig, aC as PromotionOutcome, aD as PromptMeta, aE as QueuedTask, aF as RedTeamProbe, aG as RedTeamReport, aH as RedTeamRunner, aI as RedTeamRunnerConfig, aJ as RepoNode, aK as RollbackManager, aL as RollbackManagerConfig, aM as RollbackResult, aN as SPECIALIZED_AGENTS, aO as STANDARD_PIPELINES, aP as SafetyCheckResult, aQ as SafetyContext, aR as SafetyResult, aS as SafetyRule, aT as SafetyViolation, aU as SecurityAuditEntry, aV as SecurityAuditEventType, aW as SecurityManager, aX as SecurityManagerConfig, aY as SecuritySafetyRule, aZ as SenseiAIBridge, a_ as ShadowComparison, a$ as ShadowMode, b0 as ShadowRouter, b1 as ShadowRouterConfig, b2 as StandupEntry, b3 as StandupSynthesis, b4 as SubmitOptions, b5 as TaskEvent, b6 as TaskHandle, b7 as TemporalClientConfig, b8 as TemporalOrchestrator, b9 as TemporalOrchestratorConfig, ba as TenantCostSummary, bb as TokenUsage, bc as ToolCallRecord, bd as ToolRiskClassification, be as ToolRiskLevel, bf as TradeContext, bg as TradePassGovernanceBridge, bh as TradeVerificationResult, bi as TrustSyncEvent, bj as TrustSyncProtocol, bk as TrustSyncTarget, bl as TrustTier, bm as ValidateOptions, bn as ValidationResult, bo as VelocitySnapshot, bp as WorkflowAccumulator, bq as buildStepTaskInput, br as createActivities, bs as createAgentFromDefinition, bt as createDependencyGraph, bu as createGTCXGraph, bv as createHandoff, bw as createPipeline, bx as createPipelineExecution, by as createTemporalClient, bz as createVelocitySnapshot, bA as detectCycles, bB as findBlockers, bC as getAgentDefinition, bD as getAgentsByCapability, bE as getAgentsByDomain, bF as getReadySteps, bG as getTopologicalOrder, bH as getTrustTier, bI as isComplete, bJ as isFailed, bK as loadAllPersonas, bL as loadPersonaPrompt, bM as loadRolePrompt, bN as projectCompletion, bO as synthesizeStandup } from './mcp/server.js';
|
|
9
|
+
export { SemanticCache } from './core/cache.js';
|
|
10
|
+
export { PiiBlockedError, PiiDetector, PiiDetectorConfig, PiiMatch, PiiMode, PiiScanResult, PiiType } from './core/pii-detector.js';
|
|
11
|
+
export { C as CurationResult, G as GroundTruthCase, b as LlmGenerationOptions, L as LlmTracer, c as LlmTracerConfig, d as ModelVersionEntry, M as ModelVersionRegistry, e as ModelVersionRegistryConfig, f as ProdEvalCheck, g as ProdEvalCheckContext, h as ProdEvalCheckResult, i as ProdEvalReport, P as ProductionEvalPipeline, j as ProductionEvalPipelineConfig, S as SamplingStrategy, T as TraceCurator, k as TraceCuratorConfig, l as TraceRecord, a as VersionComparison, V as VersionEvalResult } from './llm-tracer-CIIujuO-.js';
|
|
12
|
+
export { TaskQueue, TaskQueueConfig } from './core/task-queue.js';
|
|
13
|
+
import 'zod';
|
|
14
|
+
import 'eventemitter3';
|
|
15
|
+
import './core/opa-policy-gate.js';
|
|
16
|
+
import './core/opa-client.js';
|
|
17
|
+
import '@baselineos/persona';
|
|
18
|
+
import '@baselineos/govern';
|
|
19
|
+
import '@baselineos/autonomy';
|
|
20
|
+
import 'events';
|
|
21
|
+
import '@temporalio/client';
|