@hilbras/omninode 2.0.0-alpha.2 → 2.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -249
- package/dist/cli/chunk-BTJDQTWH.js +722 -0
- package/dist/cli/chunk-BTJDQTWH.js.map +1 -0
- package/dist/cli/index.js +2852 -1206
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/providers-KPW3FURD.js +36 -0
- package/dist/cli/providers-KPW3FURD.js.map +1 -0
- package/dist/index.d.ts +1201 -153
- package/dist/index.js +2309 -470
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,75 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ChildProcess } from 'node:child_process';
|
|
2
3
|
|
|
3
4
|
/** Structured report format so reports can be processed programmatically (§16). */
|
|
4
5
|
type Confidence = "low" | "medium" | "high";
|
|
5
6
|
type FindingSeverity = "info" | "low" | "medium" | "high" | "critical";
|
|
7
|
+
/** Typed evidence (roadmap §13, Evidence). Plain strings remain accepted
|
|
8
|
+
* and normalize to `observation` evidence. */
|
|
9
|
+
type EvidenceKind = "file" | "line" | "url" | "command" | "observation" | "artifact";
|
|
10
|
+
interface Evidence {
|
|
11
|
+
kind: EvidenceKind;
|
|
12
|
+
/** Path, URL, command or logical reference. */
|
|
13
|
+
ref?: string;
|
|
14
|
+
/** Line number for file/line evidence. */
|
|
15
|
+
line?: number;
|
|
16
|
+
/** Verbatim excerpt backing the finding. */
|
|
17
|
+
excerpt?: string;
|
|
18
|
+
/** Agent that produced the evidence. */
|
|
19
|
+
agent?: string;
|
|
20
|
+
}
|
|
21
|
+
type EvidenceInput = string | Evidence;
|
|
22
|
+
/** Artifact produced alongside a report (§13). */
|
|
23
|
+
interface ReportArtifact {
|
|
24
|
+
kind: "file" | "patch" | "log" | "screenshot" | "document" | "data";
|
|
25
|
+
ref: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
mediaType?: string;
|
|
28
|
+
bytes?: number;
|
|
29
|
+
}
|
|
30
|
+
/** Where a finding came from, when known. */
|
|
31
|
+
interface FindingOrigin {
|
|
32
|
+
agent?: string;
|
|
33
|
+
reportId?: string;
|
|
34
|
+
pipelineRunId?: string;
|
|
35
|
+
}
|
|
6
36
|
interface Finding {
|
|
7
37
|
id: string;
|
|
8
38
|
title: string;
|
|
39
|
+
/** v1 field, kept for compatibility; `description` is the v2 field. */
|
|
9
40
|
detail: string;
|
|
41
|
+
/** Full description of the finding (§13, Findings). */
|
|
42
|
+
description?: string;
|
|
10
43
|
severity?: FindingSeverity;
|
|
11
|
-
|
|
44
|
+
confidence?: Confidence;
|
|
45
|
+
evidence?: EvidenceInput[];
|
|
12
46
|
/** File path or conceptual location the finding refers to. */
|
|
13
47
|
location?: string;
|
|
14
48
|
tags?: string[];
|
|
49
|
+
/** Provenance of the finding, when known (§13). */
|
|
50
|
+
source?: FindingOrigin;
|
|
51
|
+
/** The concrete fix this finding implies. */
|
|
52
|
+
recommendation?: string;
|
|
15
53
|
}
|
|
16
54
|
interface Report {
|
|
17
55
|
id: string;
|
|
18
56
|
taskId: string;
|
|
19
57
|
/** Agent name from the agent registry. */
|
|
20
58
|
agent: string;
|
|
59
|
+
/** v2 spelling of `agent` for machine consumers (§13). */
|
|
60
|
+
agentId?: string;
|
|
61
|
+
/** Pipeline run that produced this report, when applicable. */
|
|
62
|
+
pipelineRunId?: string;
|
|
21
63
|
/** Model id used, if known. */
|
|
22
64
|
model?: string;
|
|
23
65
|
summary: string;
|
|
24
66
|
findings: Finding[];
|
|
25
67
|
recommendations: string[];
|
|
26
68
|
confidence?: Confidence;
|
|
69
|
+
/** Report-level evidence backing the summary. */
|
|
70
|
+
evidence?: EvidenceInput[];
|
|
71
|
+
/** Artifacts produced with the report (§13, Artifacts). */
|
|
72
|
+
artifacts?: ReportArtifact[];
|
|
27
73
|
createdAt: string;
|
|
28
74
|
metadata?: Record<string, unknown>;
|
|
29
75
|
}
|
|
@@ -41,7 +87,31 @@ interface AggregatedFinding {
|
|
|
41
87
|
occurrences: number;
|
|
42
88
|
/** Highest severity seen across merged duplicates. */
|
|
43
89
|
severity?: FindingSeverity;
|
|
44
|
-
|
|
90
|
+
/** Highest confidence seen across merged duplicates (§14 — confidence preservation). */
|
|
91
|
+
confidence?: Confidence;
|
|
92
|
+
/** Per-agent severity, so a disagreement is visible rather than flattened. */
|
|
93
|
+
severityBySource?: Record<string, FindingSeverity>;
|
|
94
|
+
/** Per-agent confidence. */
|
|
95
|
+
confidenceBySource?: Record<string, Confidence>;
|
|
96
|
+
/** Distinct recommendations attached to this finding across reports. */
|
|
97
|
+
recommendations?: string[];
|
|
98
|
+
/** Typed evidence, normalized from strings when reports were ingested. */
|
|
99
|
+
evidence: Evidence[];
|
|
100
|
+
}
|
|
101
|
+
/** One agent's position on a disputed finding (§14, Conflicts). */
|
|
102
|
+
interface ConflictPosition {
|
|
103
|
+
agent: string;
|
|
104
|
+
reportId: string;
|
|
105
|
+
severity?: FindingSeverity;
|
|
106
|
+
confidence?: Confidence;
|
|
107
|
+
recommendation?: string;
|
|
108
|
+
}
|
|
109
|
+
interface ReportConflict {
|
|
110
|
+
type: "severity" | "recommendation";
|
|
111
|
+
findingTitle: string;
|
|
112
|
+
/** Both positions are preserved — OmniNode never silently chooses one. */
|
|
113
|
+
positions: ConflictPosition[];
|
|
114
|
+
note: string;
|
|
45
115
|
}
|
|
46
116
|
interface AggregatedRecommendation {
|
|
47
117
|
text: string;
|
|
@@ -57,6 +127,10 @@ interface CombinedReport {
|
|
|
57
127
|
taskIds: string[];
|
|
58
128
|
summary: string;
|
|
59
129
|
findings: AggregatedFinding[];
|
|
130
|
+
/** Findings multiple agents reported with the same severity (consensus). */
|
|
131
|
+
agreements: AggregatedFinding[];
|
|
132
|
+
/** Disagreements between agents (§14) — both positions preserved. */
|
|
133
|
+
conflicts: ReportConflict[];
|
|
60
134
|
recommendations: AggregatedRecommendation[];
|
|
61
135
|
/** Distinct agent names that contributed. */
|
|
62
136
|
sources: string[];
|
|
@@ -65,6 +139,95 @@ interface CombinedReport {
|
|
|
65
139
|
metadata?: Record<string, unknown>;
|
|
66
140
|
}
|
|
67
141
|
|
|
142
|
+
/**
|
|
143
|
+
* OmniNode Agent Protocol v2 — message model (roadmap §7.2–§7.4, §7.7).
|
|
144
|
+
*
|
|
145
|
+
* Every message is a JSON line carrying a `ProtocolEnvelope`. All ids are
|
|
146
|
+
* optional for inbound tolerance but OmniNode always emits them, so every
|
|
147
|
+
* message is traceable to agent / task / pipeline / execution / request.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/** Messages OmniNode sends to an agent. */
|
|
151
|
+
type ProtocolNodeToAgentType = "TASK" | "HELLO_ACK" | "CONTEXT" | "INSTRUCTION" | "RESPONSE" | "CANCEL";
|
|
152
|
+
/** Messages an agent sends to OmniNode. */
|
|
153
|
+
type ProtocolAgentToNodeType = "HELLO" | "TASK_REQUEST" | "TASK_ACCEPTED" | "TASK_STARTED" | "STATUS" | "QUESTION" | "REPORT" | "ARTIFACT" | "COMPLETION" | "ERROR" | "CANCELLED";
|
|
154
|
+
type ProtocolMessageType = ProtocolNodeToAgentType | ProtocolAgentToNodeType;
|
|
155
|
+
interface ProtocolEnvelope<T extends ProtocolMessageType = ProtocolMessageType> {
|
|
156
|
+
/** `omninode-agent-protocol/2`. Inbound messages without it are treated as v1. */
|
|
157
|
+
protocol: string;
|
|
158
|
+
/** Unique id of this message. */
|
|
159
|
+
messageId: string;
|
|
160
|
+
/** Id of the request/thread this message belongs to. */
|
|
161
|
+
requestId?: string;
|
|
162
|
+
taskId?: string;
|
|
163
|
+
agentId?: string;
|
|
164
|
+
pipelineId?: string;
|
|
165
|
+
/** Execution identity (roadmap §6.5) — ties the message to one attempt. */
|
|
166
|
+
executionId?: string;
|
|
167
|
+
timestamp: string;
|
|
168
|
+
type: T;
|
|
169
|
+
payload: unknown;
|
|
170
|
+
metadata?: Record<string, unknown>;
|
|
171
|
+
}
|
|
172
|
+
/** Standard artifact kinds (roadmap §7.7). */
|
|
173
|
+
type ArtifactKind = "file" | "patch" | "report" | "log" | "screenshot" | "document" | "data";
|
|
174
|
+
interface ArtifactPayload {
|
|
175
|
+
kind: ArtifactKind;
|
|
176
|
+
/** Path, URL or logical name. */
|
|
177
|
+
ref: string;
|
|
178
|
+
description?: string;
|
|
179
|
+
mediaType?: string;
|
|
180
|
+
bytes?: number;
|
|
181
|
+
metadata?: Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
interface QuestionPayload {
|
|
184
|
+
/** Question id to answer. */
|
|
185
|
+
questionId: string;
|
|
186
|
+
question: string;
|
|
187
|
+
/** What kind of answer is expected (free text, file path, options…). */
|
|
188
|
+
expected?: "text" | "path" | "choice";
|
|
189
|
+
options?: string[];
|
|
190
|
+
}
|
|
191
|
+
interface ReportPayload {
|
|
192
|
+
report: Report | Report[];
|
|
193
|
+
}
|
|
194
|
+
/** A question an agent asked during a run, with the answer OmniNode gave (if any). */
|
|
195
|
+
interface AskedQuestion {
|
|
196
|
+
questionId: string;
|
|
197
|
+
question: string;
|
|
198
|
+
answer?: string;
|
|
199
|
+
}
|
|
200
|
+
declare function newMessageId(prefix?: string): string;
|
|
201
|
+
/** Builds a v2 envelope with ids and timestamp filled in. */
|
|
202
|
+
declare function envelope<T extends ProtocolMessageType>(type: T, payload: unknown, ids?: {
|
|
203
|
+
requestId?: string;
|
|
204
|
+
taskId?: string;
|
|
205
|
+
agentId?: string;
|
|
206
|
+
pipelineId?: string;
|
|
207
|
+
executionId?: string;
|
|
208
|
+
metadata?: Record<string, unknown>;
|
|
209
|
+
}): ProtocolEnvelope<T>;
|
|
210
|
+
|
|
211
|
+
interface AgentDescriptor {
|
|
212
|
+
/** Protocol the agent speaks. */
|
|
213
|
+
protocol: string;
|
|
214
|
+
name: string;
|
|
215
|
+
version?: string;
|
|
216
|
+
capabilities: string[];
|
|
217
|
+
/** Message types the agent can emit. */
|
|
218
|
+
supports: string[];
|
|
219
|
+
}
|
|
220
|
+
type HelloResult = {
|
|
221
|
+
ok: true;
|
|
222
|
+
descriptor: AgentDescriptor;
|
|
223
|
+
} | {
|
|
224
|
+
ok: false;
|
|
225
|
+
reason: string;
|
|
226
|
+
};
|
|
227
|
+
declare function parseHello(envelopeValue: ProtocolEnvelope): HelloResult;
|
|
228
|
+
declare function buildHello(descriptor: Omit<AgentDescriptor, "protocol">): ProtocolEnvelope<"HELLO">;
|
|
229
|
+
declare function buildHelloAck(descriptor: AgentDescriptor): ProtocolEnvelope<"HELLO_ACK">;
|
|
230
|
+
|
|
68
231
|
/** Role system: what an AI is supposed to do, independent of any provider (§11). */
|
|
69
232
|
interface RoleDefinition {
|
|
70
233
|
/** Slug identifier, e.g. "architecture-reviewer". */
|
|
@@ -98,8 +261,21 @@ interface AgentConfig {
|
|
|
98
261
|
inputMode?: AgentInputMode;
|
|
99
262
|
/** Per-task timeout in milliseconds; the process is killed when exceeded. */
|
|
100
263
|
timeoutMs?: number;
|
|
101
|
-
/**
|
|
264
|
+
/**
|
|
265
|
+
* When false, the agent process starts with a minimal environment (PATH +
|
|
266
|
+
* env). Deprecated in v2 — prefer `envPolicy`.
|
|
267
|
+
*/
|
|
102
268
|
inheritEnv?: boolean;
|
|
269
|
+
/** Explicit environment policy (roadmap §8). */
|
|
270
|
+
envPolicy?: "inherit" | "allowlist" | "denylist" | "explicit";
|
|
271
|
+
/** Variables forwarded from the parent under the `allowlist` policy. */
|
|
272
|
+
envAllowlist?: string[];
|
|
273
|
+
/** Variables removed from the parent under the `denylist` policy. */
|
|
274
|
+
envDenylist?: string[];
|
|
275
|
+
/** Per-stream byte budget for agent stdout/stderr (default 5 MiB). */
|
|
276
|
+
maxOutputBytes?: number;
|
|
277
|
+
/** Allow a working directory outside the project root. */
|
|
278
|
+
allowExternalCwd?: boolean;
|
|
103
279
|
/** Models (as "provider:model-id") this agent may use, if restricted. */
|
|
104
280
|
allowedModels?: string[];
|
|
105
281
|
metadata?: Record<string, unknown>;
|
|
@@ -117,6 +293,10 @@ interface AgentInfo {
|
|
|
117
293
|
interface AgentTaskInput {
|
|
118
294
|
taskId: string;
|
|
119
295
|
objective: string;
|
|
296
|
+
/** Pipeline run that owns this task (protocol correlation, §7.4). */
|
|
297
|
+
pipelineId?: string;
|
|
298
|
+
/** Execution identity for this attempt (protocol correlation, §7.4). */
|
|
299
|
+
executionId?: string;
|
|
120
300
|
role?: RoleDefinition;
|
|
121
301
|
/** Assembled task context (project, memory, files) already selected for this agent. */
|
|
122
302
|
context?: string;
|
|
@@ -132,6 +312,14 @@ interface AgentTaskOutput {
|
|
|
132
312
|
logs?: string[];
|
|
133
313
|
/** Structured reports extracted from protocol-mode runs (§16, §21). */
|
|
134
314
|
reports?: Report[];
|
|
315
|
+
/** Protocol diagnostics for protocol-mode runs (roadmap §7): questions asked, violations seen. */
|
|
316
|
+
protocol?: {
|
|
317
|
+
protocol: string;
|
|
318
|
+
legacy: boolean;
|
|
319
|
+
descriptor?: AgentDescriptor;
|
|
320
|
+
questions: AskedQuestion[];
|
|
321
|
+
violations: string[];
|
|
322
|
+
};
|
|
135
323
|
error?: string;
|
|
136
324
|
}
|
|
137
325
|
/** Contract every agent adapter implements (Phase 3+). */
|
|
@@ -177,32 +365,73 @@ interface ChatResponse {
|
|
|
177
365
|
* layer so adapters (e.g. planner) never depend on engine modules.
|
|
178
366
|
*/
|
|
179
367
|
type ChatFn = (model: string, messages: ChatMessage[]) => Promise<string>;
|
|
368
|
+
/** One streamed chunk (SSE deltas from OpenAI-compatible gateways). */
|
|
369
|
+
interface ChatStreamChunk {
|
|
370
|
+
/** Text delta (empty for role-only or final chunks). */
|
|
371
|
+
delta: string;
|
|
372
|
+
/** Provider-reported finish reason, on the final chunk. */
|
|
373
|
+
finishReason?: string;
|
|
374
|
+
raw?: unknown;
|
|
375
|
+
}
|
|
180
376
|
|
|
181
377
|
/**
|
|
182
|
-
* Memory abstraction. Remembera is the preferred
|
|
183
|
-
* core depends only on this interface (memory-agnostic principle, §2
|
|
378
|
+
* Memory abstraction (§19). Remembera is the preferred implementation, but
|
|
379
|
+
* the core depends only on this interface (memory-agnostic principle, §2).
|
|
380
|
+
*
|
|
381
|
+
* v2 contract (roadmap §12): retrieve / store / search / metadata, across
|
|
382
|
+
* project / task / role scopes with structured categories.
|
|
184
383
|
*/
|
|
185
|
-
type MemoryScope = "project" | "
|
|
384
|
+
type MemoryScope = "project" | "task" | "role" | "knowledge";
|
|
385
|
+
/** Structured memory categories (roadmap §12, Memory Categories). */
|
|
386
|
+
type MemoryCategory = "project" | "architecture" | "decisions" | "tasks" | "problems" | "solutions" | "conventions" | "agent_reports";
|
|
186
387
|
interface MemoryEntry {
|
|
187
388
|
key: string;
|
|
188
389
|
scope: MemoryScope;
|
|
189
390
|
content: string;
|
|
391
|
+
/** Structured category, when the backend supports it. */
|
|
392
|
+
category?: MemoryCategory;
|
|
190
393
|
tags?: string[];
|
|
191
394
|
createdAt?: string;
|
|
192
395
|
updatedAt?: string;
|
|
193
396
|
metadata?: Record<string, unknown>;
|
|
194
397
|
}
|
|
195
398
|
interface MemoryQuery {
|
|
399
|
+
/** Free-text relevance query. */
|
|
400
|
+
text?: string;
|
|
196
401
|
scope?: MemoryScope;
|
|
402
|
+
category?: MemoryCategory;
|
|
197
403
|
tags?: string[];
|
|
198
|
-
/** Free-text relevance query; implementations decide ranking. */
|
|
199
|
-
text?: string;
|
|
200
404
|
limit?: number;
|
|
201
405
|
}
|
|
406
|
+
interface MemoryProviderMetadata {
|
|
407
|
+
name: string;
|
|
408
|
+
/** What the backend can do, so callers can adapt (e.g. no category support). */
|
|
409
|
+
capabilities: Array<"retrieve" | "store" | "search" | "categories" | "tags">;
|
|
410
|
+
/** True when the backend enforces relevance ranking itself. */
|
|
411
|
+
relevanceRanking: boolean;
|
|
412
|
+
/** Backend-specific info (gateway version, endpoint type…). */
|
|
413
|
+
backend?: Record<string, unknown>;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* The memory contract. `query`/`write` are the v1 names, kept as aliases so
|
|
417
|
+
* existing integrations keep working — new code should use retrieve/store.
|
|
418
|
+
*/
|
|
202
419
|
interface IMemoryProvider {
|
|
203
420
|
readonly name: string;
|
|
204
|
-
/** Retrieve
|
|
421
|
+
/** Retrieve entries relevant to a query (task-oriented). */
|
|
422
|
+
retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
|
|
423
|
+
/** Store an entry (upsert by key). */
|
|
424
|
+
store(entry: MemoryEntry): Promise<void>;
|
|
425
|
+
/** Free-text search across scopes. */
|
|
426
|
+
search(text: string, options?: {
|
|
427
|
+
limit?: number;
|
|
428
|
+
scope?: MemoryScope;
|
|
429
|
+
}): Promise<MemoryEntry[]>;
|
|
430
|
+
/** Provider capabilities (contract introspection). */
|
|
431
|
+
metadata(): MemoryProviderMetadata;
|
|
432
|
+
/** @deprecated v1 alias of {@link retrieve}. */
|
|
205
433
|
query(query: MemoryQuery): Promise<MemoryEntry[]>;
|
|
434
|
+
/** @deprecated v1 alias of {@link store}. */
|
|
206
435
|
write(entry: MemoryEntry): Promise<void>;
|
|
207
436
|
}
|
|
208
437
|
|
|
@@ -215,14 +444,25 @@ interface ModelCapabilities {
|
|
|
215
444
|
embeddings?: boolean;
|
|
216
445
|
}
|
|
217
446
|
type ModelStatus = "available" | "unavailable" | "deprecated";
|
|
447
|
+
type Modality = "text" | "image" | "audio" | "video" | "embedding";
|
|
448
|
+
/** Model metadata (roadmap §10, Model Metadata). */
|
|
218
449
|
interface ModelInfo {
|
|
219
450
|
/** Name of the provider this model belongs to. */
|
|
220
451
|
provider: string;
|
|
221
452
|
/** Provider-specific model identifier, e.g. "qwen3-coder". */
|
|
222
453
|
id: string;
|
|
223
454
|
displayName?: string;
|
|
455
|
+
/** Human-readable model name reported by the provider, when available. */
|
|
456
|
+
name?: string;
|
|
224
457
|
capabilities?: ModelCapabilities;
|
|
225
458
|
contextWindow?: number;
|
|
459
|
+
inputTypes?: Modality[];
|
|
460
|
+
outputTypes?: Modality[];
|
|
461
|
+
supportsTools?: boolean;
|
|
462
|
+
supportsVision?: boolean;
|
|
463
|
+
supportsReasoning?: boolean;
|
|
464
|
+
supportsStructuredOutput?: boolean;
|
|
465
|
+
supportsStreaming?: boolean;
|
|
226
466
|
status?: ModelStatus;
|
|
227
467
|
metadata?: Record<string, unknown>;
|
|
228
468
|
}
|
|
@@ -265,6 +505,24 @@ interface TaskResult {
|
|
|
265
505
|
reportId?: string;
|
|
266
506
|
/** Structured reports produced by protocol-mode agents (Phase 6 builds on this). */
|
|
267
507
|
reports?: Report[];
|
|
508
|
+
/** Protocol-mode diagnostics (descriptor, questions, violations) — see docs/PROTOCOL.md. */
|
|
509
|
+
protocol?: {
|
|
510
|
+
protocol: string;
|
|
511
|
+
legacy: boolean;
|
|
512
|
+
descriptor?: {
|
|
513
|
+
protocol: string;
|
|
514
|
+
name: string;
|
|
515
|
+
version?: string;
|
|
516
|
+
capabilities: string[];
|
|
517
|
+
supports: string[];
|
|
518
|
+
};
|
|
519
|
+
questions: Array<{
|
|
520
|
+
questionId: string;
|
|
521
|
+
question: string;
|
|
522
|
+
answer?: string;
|
|
523
|
+
}>;
|
|
524
|
+
violations: string[];
|
|
525
|
+
};
|
|
268
526
|
/** Truncated verbatim agent output, kept for report extraction and audit. */
|
|
269
527
|
rawOutput?: string;
|
|
270
528
|
error?: string;
|
|
@@ -273,6 +531,8 @@ interface TaskResult {
|
|
|
273
531
|
interface Task {
|
|
274
532
|
id: string;
|
|
275
533
|
project?: string;
|
|
534
|
+
/** Pipeline run that owns this task, when created by a pipeline. */
|
|
535
|
+
pipelineId?: string;
|
|
276
536
|
objective: string;
|
|
277
537
|
/** Role id from the role system. */
|
|
278
538
|
role?: string;
|
|
@@ -308,6 +568,8 @@ interface PipelineStep {
|
|
|
308
568
|
dependsOn?: string[];
|
|
309
569
|
condition?: PipelineStepCondition;
|
|
310
570
|
retries?: number;
|
|
571
|
+
/** Constraints handed to the planner for plan steps (§15). */
|
|
572
|
+
constraints?: string[];
|
|
311
573
|
}
|
|
312
574
|
interface PipelineDefinition {
|
|
313
575
|
id: string;
|
|
@@ -324,18 +586,37 @@ interface PipelineDefinition {
|
|
|
324
586
|
* authoritative detail always lives in `stepRuns`/`taskRuns`.
|
|
325
587
|
*/
|
|
326
588
|
type PipelineRunStatus = "pending" | "running" | "completed" | "failed" | "partial" | "cancelled";
|
|
589
|
+
/**
|
|
590
|
+
* One step execution inside a run (§9.1 — Step Run is NOT the Step).
|
|
591
|
+
*/
|
|
327
592
|
interface PipelineStepRun {
|
|
328
593
|
stepId: string;
|
|
329
594
|
status: TaskStatus;
|
|
330
595
|
/** Tasks created for this step (research fans out to several). */
|
|
331
596
|
taskIds?: string[];
|
|
597
|
+
/** Execution ids of the tasks this step created, for correlation (§6.5). */
|
|
598
|
+
executionIds?: string[];
|
|
599
|
+
/** Which attempt of this step produced this record (1 = first try). */
|
|
600
|
+
attempt?: number;
|
|
332
601
|
/** Set on plan steps that produced a stored plan (§18). */
|
|
333
602
|
planId?: string;
|
|
334
603
|
error?: string;
|
|
335
604
|
}
|
|
605
|
+
/** One execution attempt of a run (§9.1 — Attempt is not the Run). */
|
|
606
|
+
interface PipelineRunAttempt {
|
|
607
|
+
attempt: number;
|
|
608
|
+
startedAt: string;
|
|
609
|
+
finishedAt?: string;
|
|
610
|
+
status: PipelineRunStatus;
|
|
611
|
+
}
|
|
336
612
|
interface PipelineRun {
|
|
337
613
|
id: string;
|
|
338
614
|
pipelineId: string;
|
|
615
|
+
/** Execution attempt counter: retries of the same run increment it. */
|
|
616
|
+
attempt: number;
|
|
617
|
+
/** Set when cancellation was requested; the run stops at the next check point. */
|
|
618
|
+
cancellationRequested?: boolean;
|
|
619
|
+
cancellationRequestedAt?: string;
|
|
339
620
|
/** The objective this run is executing (persisted for retries). */
|
|
340
621
|
objective?: string;
|
|
341
622
|
status: PipelineRunStatus;
|
|
@@ -350,6 +631,28 @@ interface PipelineRun {
|
|
|
350
631
|
planId?: string;
|
|
351
632
|
/** Outcome summary of the final executed step (§28 — Result). */
|
|
352
633
|
resultSummary?: string;
|
|
634
|
+
/** Per-attempt history (§9.1). */
|
|
635
|
+
attempts?: PipelineRunAttempt[];
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Executor contract (roadmap §9.1 / §9.2): a Pipeline definition, a Run of
|
|
639
|
+
* it, Steps, Step Runs and Attempts are distinct concepts; this interface is
|
|
640
|
+
* what orchestration code depends on.
|
|
641
|
+
*/
|
|
642
|
+
interface IPipelineExecutor {
|
|
643
|
+
validate(definition: PipelineDefinition): void;
|
|
644
|
+
run(definition: PipelineDefinition, options?: PipelineRunOptions): Promise<PipelineRun>;
|
|
645
|
+
cancel(runId: string): Promise<void>;
|
|
646
|
+
get(runId: string): Promise<PipelineRun | undefined>;
|
|
647
|
+
listRuns(filter?: {
|
|
648
|
+
pipelineId?: string;
|
|
649
|
+
}): Promise<PipelineRun[]>;
|
|
650
|
+
}
|
|
651
|
+
interface PipelineRunOptions {
|
|
652
|
+
objective?: string;
|
|
653
|
+
onStep?: (stepRun: PipelineStepRun) => void;
|
|
654
|
+
/** Total run attempts (1 = no automatic rerun of the whole run). */
|
|
655
|
+
maxAttempts?: number;
|
|
353
656
|
}
|
|
354
657
|
|
|
355
658
|
/** Plan types: the final implementation plan produced by the planner layer (§18). */
|
|
@@ -369,6 +672,8 @@ interface PlanStep {
|
|
|
369
672
|
interface Plan {
|
|
370
673
|
id: string;
|
|
371
674
|
objective: string;
|
|
675
|
+
/** Explicit goal statement (§15, Planner Output). */
|
|
676
|
+
goal?: string;
|
|
372
677
|
summary: string;
|
|
373
678
|
steps: PlanStep[];
|
|
374
679
|
risks?: string[];
|
|
@@ -490,7 +795,20 @@ interface Project {
|
|
|
490
795
|
|
|
491
796
|
type ProviderType = "openai-compatible" | "omnihilbras" | "openrouter" | "local" | "custom";
|
|
492
797
|
type ProviderHealth = "unknown" | "healthy" | "degraded" | "unreachable";
|
|
798
|
+
/** Declared provider capabilities (roadmap §10, Provider Interface). */
|
|
799
|
+
type ProviderCapability = "chat" | "models" | "streaming" | "tools" | "embeddings" | "vision";
|
|
800
|
+
/** Normalized authentication description — never contains a secret value. */
|
|
801
|
+
interface ProviderAuthentication {
|
|
802
|
+
/** How the provider authenticates. */
|
|
803
|
+
method: "bearer" | "none" | "custom";
|
|
804
|
+
/** Environment variable that holds the credential, if any. */
|
|
805
|
+
envVar?: string;
|
|
806
|
+
/** True when the referenced variable is currently set. */
|
|
807
|
+
configured: boolean;
|
|
808
|
+
}
|
|
493
809
|
interface ProviderConfig {
|
|
810
|
+
/** Stable identifier used in records and references (defaults to `name`). */
|
|
811
|
+
providerId?: string;
|
|
494
812
|
/** Unique name used in project configuration and the model registry. */
|
|
495
813
|
name: string;
|
|
496
814
|
type: ProviderType;
|
|
@@ -501,6 +819,10 @@ interface ProviderConfig {
|
|
|
501
819
|
*/
|
|
502
820
|
apiKeyEnvVar?: string;
|
|
503
821
|
headers?: Record<string, string>;
|
|
822
|
+
/** Provider-level request timeout in ms (distinct from agent/pipeline budgets). */
|
|
823
|
+
timeoutMs?: number;
|
|
824
|
+
/** Capabilities declared for this provider (discovered ones are merged in). */
|
|
825
|
+
capabilities?: ProviderCapability[];
|
|
504
826
|
enabled?: boolean;
|
|
505
827
|
metadata?: Record<string, unknown>;
|
|
506
828
|
}
|
|
@@ -514,21 +836,37 @@ interface ProviderStatus {
|
|
|
514
836
|
lastCheckedAt?: string;
|
|
515
837
|
message?: string;
|
|
516
838
|
}
|
|
517
|
-
/** Contract every provider adapter implements (
|
|
839
|
+
/** Contract every provider adapter implements (roadmap §10). */
|
|
518
840
|
interface IProvider {
|
|
519
841
|
readonly config: ProviderConfig;
|
|
842
|
+
/** Stable identifier of this provider. */
|
|
843
|
+
readonly providerId: string;
|
|
844
|
+
/** Normalized authentication description (no secret values). */
|
|
845
|
+
readonly authentication: ProviderAuthentication;
|
|
846
|
+
/**
|
|
847
|
+
* Connect: authenticate and discover models (roadmap §10, Model Discovery).
|
|
848
|
+
* Returns the discovered models.
|
|
849
|
+
*/
|
|
850
|
+
connect(): Promise<ModelInfo[]>;
|
|
520
851
|
/** Discover models exposed by this provider. */
|
|
521
852
|
listModels(): Promise<ModelInfo[]>;
|
|
853
|
+
/** Fetch a single model's metadata (from discovery; re-discovers if unknown). */
|
|
854
|
+
getModel(modelId: string): Promise<ModelInfo | undefined>;
|
|
522
855
|
/** Check connectivity and authentication. */
|
|
523
856
|
healthCheck(): Promise<ProviderStatus>;
|
|
524
857
|
}
|
|
525
858
|
/** Contract for providers that can run chat completions (foundation for planning). */
|
|
526
859
|
interface IChatProvider extends IProvider {
|
|
527
860
|
chat(request: ChatRequest): Promise<ChatResponse>;
|
|
861
|
+
/**
|
|
862
|
+
* Stream a completion where the provider supports it (§11). Chunks are
|
|
863
|
+
* delivered in order; the resolved ChatResponse carries the assembled text.
|
|
864
|
+
*/
|
|
865
|
+
stream?(request: ChatRequest, onChunk: (chunk: ChatStreamChunk) => void): Promise<ChatResponse>;
|
|
528
866
|
}
|
|
529
867
|
|
|
530
868
|
/** Typed error hierarchy shared across the whole codebase (§4.1 — error model). */
|
|
531
|
-
type OmniNodeErrorCode = "CONFIG_NOT_FOUND" | "CONFIG_INVALID" | "PROVIDER_NOT_FOUND" | "PROVIDER_UNAVAILABLE" | "PROVIDER_AUTH_FAILED" | "MODEL_NOT_FOUND" | "AGENT_NOT_FOUND" | "AGENT_FAILED" | "AGENT_TIMEOUT" | "TASK_INVALID" | "TASK_NOT_FOUND" | "TASK_FAILED" | "PIPELINE_NOT_FOUND" | "PIPELINE_INVALID" | "PIPELINE_FAILED" | "PLANNER_FAILED" | "PLAN_INVALID" | "PROTOCOL_VIOLATION" | "MEMORY_UNAVAILABLE" | "REPORT_NOT_FOUND" | "NOT_IMPLEMENTED" | "CLI_USAGE" | "INTERNAL";
|
|
869
|
+
type OmniNodeErrorCode = "CONFIG_NOT_FOUND" | "CONFIG_INVALID" | "PROVIDER_NOT_FOUND" | "PROVIDER_UNAVAILABLE" | "PROVIDER_AUTH_FAILED" | "MODEL_NOT_FOUND" | "AGENT_NOT_FOUND" | "AGENT_FAILED" | "AGENT_TIMEOUT" | "TASK_INVALID" | "TASK_NOT_FOUND" | "TASK_FAILED" | "PIPELINE_NOT_FOUND" | "PIPELINE_INVALID" | "PIPELINE_FAILED" | "PLANNER_FAILED" | "PLAN_INVALID" | "TASK_NOT_FOUND" | "PROVIDER_NOT_FOUND" | "PROTOCOL_VIOLATION" | "MEMORY_UNAVAILABLE" | "REPORT_NOT_FOUND" | "NOT_IMPLEMENTED" | "CLI_USAGE" | "INTERNAL";
|
|
532
870
|
interface OmniNodeErrorOptions {
|
|
533
871
|
cause?: unknown;
|
|
534
872
|
details?: Record<string, unknown>;
|
|
@@ -577,14 +915,18 @@ declare class ConsoleLogSink implements LogSink {
|
|
|
577
915
|
constructor(stream?: WritableLike);
|
|
578
916
|
write(_level: LogLevel, line: string): void;
|
|
579
917
|
}
|
|
918
|
+
type LogFormat = "text" | "json";
|
|
580
919
|
interface LoggerOptions {
|
|
581
920
|
level?: LogLevel;
|
|
582
921
|
sink?: LogSink;
|
|
922
|
+
/** "text" (default) or machine-readable "json" lines (roadmap §18). */
|
|
923
|
+
format?: LogFormat;
|
|
583
924
|
/** Structured fields attached to every line, e.g. { component: "config" }. */
|
|
584
925
|
context?: Record<string, unknown>;
|
|
585
926
|
}
|
|
586
927
|
declare class Logger {
|
|
587
|
-
|
|
928
|
+
level: LogLevel;
|
|
929
|
+
format: LogFormat;
|
|
588
930
|
private readonly sink;
|
|
589
931
|
private readonly context;
|
|
590
932
|
constructor(options?: LoggerOptions);
|
|
@@ -597,6 +939,11 @@ declare class Logger {
|
|
|
597
939
|
}
|
|
598
940
|
/** Default application logger. Writes to stderr so stdout stays clean for CLI output. */
|
|
599
941
|
declare const logger: Logger;
|
|
942
|
+
/** Applies configuration (level/format) to the default logger — used by the CLI. */
|
|
943
|
+
declare function configureLogger(options: {
|
|
944
|
+
level?: LogLevel;
|
|
945
|
+
format?: LogFormat;
|
|
946
|
+
}): void;
|
|
600
947
|
|
|
601
948
|
/**
|
|
602
949
|
* Configuration schema. The project file (omninode.yaml) uses snake_case keys
|
|
@@ -609,6 +956,7 @@ declare const providerConfigSchema: z.ZodObject<{
|
|
|
609
956
|
type: z.ZodEnum<["openai-compatible", "omnihilbras", "openrouter", "local", "custom"]>;
|
|
610
957
|
base_url: z.ZodString;
|
|
611
958
|
api_key_env_var: z.ZodOptional<z.ZodString>;
|
|
959
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
612
960
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
613
961
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
614
962
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -616,18 +964,20 @@ declare const providerConfigSchema: z.ZodObject<{
|
|
|
616
964
|
name: string;
|
|
617
965
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
618
966
|
base_url: string;
|
|
967
|
+
metadata?: Record<string, unknown> | undefined;
|
|
619
968
|
api_key_env_var?: string | undefined;
|
|
969
|
+
timeout_ms?: number | undefined;
|
|
620
970
|
headers?: Record<string, string> | undefined;
|
|
621
971
|
enabled?: boolean | undefined;
|
|
622
|
-
metadata?: Record<string, unknown> | undefined;
|
|
623
972
|
}, {
|
|
624
973
|
name: string;
|
|
625
974
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
626
975
|
base_url: string;
|
|
976
|
+
metadata?: Record<string, unknown> | undefined;
|
|
627
977
|
api_key_env_var?: string | undefined;
|
|
978
|
+
timeout_ms?: number | undefined;
|
|
628
979
|
headers?: Record<string, string> | undefined;
|
|
629
980
|
enabled?: boolean | undefined;
|
|
630
|
-
metadata?: Record<string, unknown> | undefined;
|
|
631
981
|
}>;
|
|
632
982
|
declare const agentConfigSchema: z.ZodObject<{
|
|
633
983
|
name: z.ZodString;
|
|
@@ -640,29 +990,44 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
640
990
|
input_mode: z.ZodDefault<z.ZodEnum<["stdin", "arg", "protocol"]>>;
|
|
641
991
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
642
992
|
inherit_env: z.ZodOptional<z.ZodBoolean>;
|
|
993
|
+
env_policy: z.ZodOptional<z.ZodEnum<["inherit", "allowlist", "denylist", "explicit"]>>;
|
|
994
|
+
env_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
995
|
+
env_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
996
|
+
max_output_bytes: z.ZodOptional<z.ZodNumber>;
|
|
997
|
+
allow_external_cwd: z.ZodOptional<z.ZodBoolean>;
|
|
643
998
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
644
999
|
}, "strict", z.ZodTypeAny, {
|
|
645
1000
|
name: string;
|
|
646
1001
|
type: "native" | "process" | "cli";
|
|
647
|
-
input_mode: "
|
|
648
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1002
|
+
input_mode: "protocol" | "stdin" | "arg";
|
|
649
1003
|
command?: string | undefined;
|
|
1004
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1005
|
+
timeout_ms?: number | undefined;
|
|
650
1006
|
args?: string[] | undefined;
|
|
651
1007
|
cwd?: string | undefined;
|
|
652
1008
|
env?: Record<string, string> | undefined;
|
|
653
|
-
timeout_ms?: number | undefined;
|
|
654
1009
|
inherit_env?: boolean | undefined;
|
|
1010
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1011
|
+
env_allowlist?: string[] | undefined;
|
|
1012
|
+
env_denylist?: string[] | undefined;
|
|
1013
|
+
max_output_bytes?: number | undefined;
|
|
1014
|
+
allow_external_cwd?: boolean | undefined;
|
|
655
1015
|
}, {
|
|
656
1016
|
name: string;
|
|
657
|
-
type?: "native" | "process" | "cli" | undefined;
|
|
658
|
-
metadata?: Record<string, unknown> | undefined;
|
|
659
1017
|
command?: string | undefined;
|
|
1018
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1019
|
+
type?: "native" | "process" | "cli" | undefined;
|
|
1020
|
+
timeout_ms?: number | undefined;
|
|
660
1021
|
args?: string[] | undefined;
|
|
661
1022
|
cwd?: string | undefined;
|
|
662
1023
|
env?: Record<string, string> | undefined;
|
|
663
|
-
input_mode?: "
|
|
664
|
-
timeout_ms?: number | undefined;
|
|
1024
|
+
input_mode?: "protocol" | "stdin" | "arg" | undefined;
|
|
665
1025
|
inherit_env?: boolean | undefined;
|
|
1026
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1027
|
+
env_allowlist?: string[] | undefined;
|
|
1028
|
+
env_denylist?: string[] | undefined;
|
|
1029
|
+
max_output_bytes?: number | undefined;
|
|
1030
|
+
allow_external_cwd?: boolean | undefined;
|
|
666
1031
|
}>;
|
|
667
1032
|
declare const roleConfigSchema: z.ZodObject<{
|
|
668
1033
|
id: z.ZodString;
|
|
@@ -701,6 +1066,8 @@ declare const pipelineStepConfigSchema: z.ZodObject<{
|
|
|
701
1066
|
depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
702
1067
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
703
1068
|
condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
|
|
1069
|
+
/** Constraints passed to the planner for plan steps (§15). */
|
|
1070
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
704
1071
|
}, "strict", z.ZodTypeAny, {
|
|
705
1072
|
id: string;
|
|
706
1073
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -710,6 +1077,7 @@ declare const pipelineStepConfigSchema: z.ZodObject<{
|
|
|
710
1077
|
depends_on?: string[] | undefined;
|
|
711
1078
|
retries?: number | undefined;
|
|
712
1079
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1080
|
+
constraints?: string[] | undefined;
|
|
713
1081
|
}, {
|
|
714
1082
|
id: string;
|
|
715
1083
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -719,6 +1087,7 @@ declare const pipelineStepConfigSchema: z.ZodObject<{
|
|
|
719
1087
|
depends_on?: string[] | undefined;
|
|
720
1088
|
retries?: number | undefined;
|
|
721
1089
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1090
|
+
constraints?: string[] | undefined;
|
|
722
1091
|
}>;
|
|
723
1092
|
declare const pipelineConfigSchema: z.ZodObject<{
|
|
724
1093
|
id: z.ZodString;
|
|
@@ -734,6 +1103,8 @@ declare const pipelineConfigSchema: z.ZodObject<{
|
|
|
734
1103
|
depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
735
1104
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
736
1105
|
condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
|
|
1106
|
+
/** Constraints passed to the planner for plan steps (§15). */
|
|
1107
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
737
1108
|
}, "strict", z.ZodTypeAny, {
|
|
738
1109
|
id: string;
|
|
739
1110
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -743,6 +1114,7 @@ declare const pipelineConfigSchema: z.ZodObject<{
|
|
|
743
1114
|
depends_on?: string[] | undefined;
|
|
744
1115
|
retries?: number | undefined;
|
|
745
1116
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1117
|
+
constraints?: string[] | undefined;
|
|
746
1118
|
}, {
|
|
747
1119
|
id: string;
|
|
748
1120
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -752,6 +1124,7 @@ declare const pipelineConfigSchema: z.ZodObject<{
|
|
|
752
1124
|
depends_on?: string[] | undefined;
|
|
753
1125
|
retries?: number | undefined;
|
|
754
1126
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1127
|
+
constraints?: string[] | undefined;
|
|
755
1128
|
}>, "many">;
|
|
756
1129
|
}, "strict", z.ZodTypeAny, {
|
|
757
1130
|
id: string;
|
|
@@ -764,9 +1137,10 @@ declare const pipelineConfigSchema: z.ZodObject<{
|
|
|
764
1137
|
depends_on?: string[] | undefined;
|
|
765
1138
|
retries?: number | undefined;
|
|
766
1139
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1140
|
+
constraints?: string[] | undefined;
|
|
767
1141
|
}[];
|
|
768
|
-
role?: string | undefined;
|
|
769
1142
|
name?: string | undefined;
|
|
1143
|
+
role?: string | undefined;
|
|
770
1144
|
objective?: string | undefined;
|
|
771
1145
|
}, {
|
|
772
1146
|
id: string;
|
|
@@ -779,9 +1153,10 @@ declare const pipelineConfigSchema: z.ZodObject<{
|
|
|
779
1153
|
depends_on?: string[] | undefined;
|
|
780
1154
|
retries?: number | undefined;
|
|
781
1155
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1156
|
+
constraints?: string[] | undefined;
|
|
782
1157
|
}[];
|
|
783
|
-
role?: string | undefined;
|
|
784
1158
|
name?: string | undefined;
|
|
1159
|
+
role?: string | undefined;
|
|
785
1160
|
objective?: string | undefined;
|
|
786
1161
|
}>;
|
|
787
1162
|
declare const plannerConfigSchema: z.ZodObject<{
|
|
@@ -804,6 +1179,7 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
804
1179
|
type: z.ZodEnum<["openai-compatible", "omnihilbras", "openrouter", "local", "custom"]>;
|
|
805
1180
|
base_url: z.ZodString;
|
|
806
1181
|
api_key_env_var: z.ZodOptional<z.ZodString>;
|
|
1182
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
807
1183
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
808
1184
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
809
1185
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -811,18 +1187,20 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
811
1187
|
name: string;
|
|
812
1188
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
813
1189
|
base_url: string;
|
|
1190
|
+
metadata?: Record<string, unknown> | undefined;
|
|
814
1191
|
api_key_env_var?: string | undefined;
|
|
1192
|
+
timeout_ms?: number | undefined;
|
|
815
1193
|
headers?: Record<string, string> | undefined;
|
|
816
1194
|
enabled?: boolean | undefined;
|
|
817
|
-
metadata?: Record<string, unknown> | undefined;
|
|
818
1195
|
}, {
|
|
819
1196
|
name: string;
|
|
820
1197
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
821
1198
|
base_url: string;
|
|
1199
|
+
metadata?: Record<string, unknown> | undefined;
|
|
822
1200
|
api_key_env_var?: string | undefined;
|
|
1201
|
+
timeout_ms?: number | undefined;
|
|
823
1202
|
headers?: Record<string, string> | undefined;
|
|
824
1203
|
enabled?: boolean | undefined;
|
|
825
|
-
metadata?: Record<string, unknown> | undefined;
|
|
826
1204
|
}>, "many">>;
|
|
827
1205
|
agents: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
828
1206
|
name: z.ZodString;
|
|
@@ -835,29 +1213,44 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
835
1213
|
input_mode: z.ZodDefault<z.ZodEnum<["stdin", "arg", "protocol"]>>;
|
|
836
1214
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
837
1215
|
inherit_env: z.ZodOptional<z.ZodBoolean>;
|
|
1216
|
+
env_policy: z.ZodOptional<z.ZodEnum<["inherit", "allowlist", "denylist", "explicit"]>>;
|
|
1217
|
+
env_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1218
|
+
env_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1219
|
+
max_output_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1220
|
+
allow_external_cwd: z.ZodOptional<z.ZodBoolean>;
|
|
838
1221
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
839
1222
|
}, "strict", z.ZodTypeAny, {
|
|
840
1223
|
name: string;
|
|
841
1224
|
type: "native" | "process" | "cli";
|
|
842
|
-
input_mode: "
|
|
843
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1225
|
+
input_mode: "protocol" | "stdin" | "arg";
|
|
844
1226
|
command?: string | undefined;
|
|
1227
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1228
|
+
timeout_ms?: number | undefined;
|
|
845
1229
|
args?: string[] | undefined;
|
|
846
1230
|
cwd?: string | undefined;
|
|
847
1231
|
env?: Record<string, string> | undefined;
|
|
848
|
-
timeout_ms?: number | undefined;
|
|
849
1232
|
inherit_env?: boolean | undefined;
|
|
1233
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1234
|
+
env_allowlist?: string[] | undefined;
|
|
1235
|
+
env_denylist?: string[] | undefined;
|
|
1236
|
+
max_output_bytes?: number | undefined;
|
|
1237
|
+
allow_external_cwd?: boolean | undefined;
|
|
850
1238
|
}, {
|
|
851
1239
|
name: string;
|
|
852
|
-
type?: "native" | "process" | "cli" | undefined;
|
|
853
|
-
metadata?: Record<string, unknown> | undefined;
|
|
854
1240
|
command?: string | undefined;
|
|
1241
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1242
|
+
type?: "native" | "process" | "cli" | undefined;
|
|
1243
|
+
timeout_ms?: number | undefined;
|
|
855
1244
|
args?: string[] | undefined;
|
|
856
1245
|
cwd?: string | undefined;
|
|
857
1246
|
env?: Record<string, string> | undefined;
|
|
858
|
-
input_mode?: "
|
|
859
|
-
timeout_ms?: number | undefined;
|
|
1247
|
+
input_mode?: "protocol" | "stdin" | "arg" | undefined;
|
|
860
1248
|
inherit_env?: boolean | undefined;
|
|
1249
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1250
|
+
env_allowlist?: string[] | undefined;
|
|
1251
|
+
env_denylist?: string[] | undefined;
|
|
1252
|
+
max_output_bytes?: number | undefined;
|
|
1253
|
+
allow_external_cwd?: boolean | undefined;
|
|
861
1254
|
}>, "many">>;
|
|
862
1255
|
roles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
863
1256
|
id: z.ZodString;
|
|
@@ -901,6 +1294,8 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
901
1294
|
depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
902
1295
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
903
1296
|
condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
|
|
1297
|
+
/** Constraints passed to the planner for plan steps (§15). */
|
|
1298
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
904
1299
|
}, "strict", z.ZodTypeAny, {
|
|
905
1300
|
id: string;
|
|
906
1301
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -910,6 +1305,7 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
910
1305
|
depends_on?: string[] | undefined;
|
|
911
1306
|
retries?: number | undefined;
|
|
912
1307
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1308
|
+
constraints?: string[] | undefined;
|
|
913
1309
|
}, {
|
|
914
1310
|
id: string;
|
|
915
1311
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -919,6 +1315,7 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
919
1315
|
depends_on?: string[] | undefined;
|
|
920
1316
|
retries?: number | undefined;
|
|
921
1317
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1318
|
+
constraints?: string[] | undefined;
|
|
922
1319
|
}>, "many">;
|
|
923
1320
|
}, "strict", z.ZodTypeAny, {
|
|
924
1321
|
id: string;
|
|
@@ -931,9 +1328,10 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
931
1328
|
depends_on?: string[] | undefined;
|
|
932
1329
|
retries?: number | undefined;
|
|
933
1330
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1331
|
+
constraints?: string[] | undefined;
|
|
934
1332
|
}[];
|
|
935
|
-
role?: string | undefined;
|
|
936
1333
|
name?: string | undefined;
|
|
1334
|
+
role?: string | undefined;
|
|
937
1335
|
objective?: string | undefined;
|
|
938
1336
|
}, {
|
|
939
1337
|
id: string;
|
|
@@ -946,9 +1344,10 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
946
1344
|
depends_on?: string[] | undefined;
|
|
947
1345
|
retries?: number | undefined;
|
|
948
1346
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1347
|
+
constraints?: string[] | undefined;
|
|
949
1348
|
}[];
|
|
950
|
-
role?: string | undefined;
|
|
951
1349
|
name?: string | undefined;
|
|
1350
|
+
role?: string | undefined;
|
|
952
1351
|
objective?: string | undefined;
|
|
953
1352
|
}>, "many">>;
|
|
954
1353
|
planner: z.ZodOptional<z.ZodObject<{
|
|
@@ -968,37 +1367,47 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
968
1367
|
provider: z.ZodDefault<z.ZodString>;
|
|
969
1368
|
base_url: z.ZodOptional<z.ZodString>;
|
|
970
1369
|
api_key_env_var: z.ZodOptional<z.ZodString>;
|
|
1370
|
+
/** When true, memory failures fail tasks instead of being tolerated (§12). */
|
|
1371
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
971
1372
|
}, "strict", z.ZodTypeAny, {
|
|
972
1373
|
provider: string;
|
|
973
1374
|
base_url?: string | undefined;
|
|
974
1375
|
api_key_env_var?: string | undefined;
|
|
1376
|
+
required?: boolean | undefined;
|
|
975
1377
|
}, {
|
|
976
1378
|
base_url?: string | undefined;
|
|
977
1379
|
api_key_env_var?: string | undefined;
|
|
978
1380
|
provider?: string | undefined;
|
|
1381
|
+
required?: boolean | undefined;
|
|
979
1382
|
}>>;
|
|
980
1383
|
}, "strict", z.ZodTypeAny, {
|
|
981
1384
|
name: string;
|
|
982
1385
|
agents: {
|
|
983
1386
|
name: string;
|
|
984
1387
|
type: "native" | "process" | "cli";
|
|
985
|
-
input_mode: "
|
|
986
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1388
|
+
input_mode: "protocol" | "stdin" | "arg";
|
|
987
1389
|
command?: string | undefined;
|
|
1390
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1391
|
+
timeout_ms?: number | undefined;
|
|
988
1392
|
args?: string[] | undefined;
|
|
989
1393
|
cwd?: string | undefined;
|
|
990
1394
|
env?: Record<string, string> | undefined;
|
|
991
|
-
timeout_ms?: number | undefined;
|
|
992
1395
|
inherit_env?: boolean | undefined;
|
|
1396
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1397
|
+
env_allowlist?: string[] | undefined;
|
|
1398
|
+
env_denylist?: string[] | undefined;
|
|
1399
|
+
max_output_bytes?: number | undefined;
|
|
1400
|
+
allow_external_cwd?: boolean | undefined;
|
|
993
1401
|
}[];
|
|
994
1402
|
providers: {
|
|
995
1403
|
name: string;
|
|
996
1404
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
997
1405
|
base_url: string;
|
|
1406
|
+
metadata?: Record<string, unknown> | undefined;
|
|
998
1407
|
api_key_env_var?: string | undefined;
|
|
1408
|
+
timeout_ms?: number | undefined;
|
|
999
1409
|
headers?: Record<string, string> | undefined;
|
|
1000
1410
|
enabled?: boolean | undefined;
|
|
1001
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1002
1411
|
}[];
|
|
1003
1412
|
roles: {
|
|
1004
1413
|
name: string;
|
|
@@ -1021,9 +1430,10 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
1021
1430
|
depends_on?: string[] | undefined;
|
|
1022
1431
|
retries?: number | undefined;
|
|
1023
1432
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1433
|
+
constraints?: string[] | undefined;
|
|
1024
1434
|
}[];
|
|
1025
|
-
role?: string | undefined;
|
|
1026
1435
|
name?: string | undefined;
|
|
1436
|
+
role?: string | undefined;
|
|
1027
1437
|
objective?: string | undefined;
|
|
1028
1438
|
}[];
|
|
1029
1439
|
planner?: {
|
|
@@ -1035,29 +1445,36 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
1035
1445
|
provider: string;
|
|
1036
1446
|
base_url?: string | undefined;
|
|
1037
1447
|
api_key_env_var?: string | undefined;
|
|
1448
|
+
required?: boolean | undefined;
|
|
1038
1449
|
} | undefined;
|
|
1039
1450
|
}, {
|
|
1040
1451
|
name: string;
|
|
1041
1452
|
agents?: {
|
|
1042
1453
|
name: string;
|
|
1043
|
-
type?: "native" | "process" | "cli" | undefined;
|
|
1044
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1045
1454
|
command?: string | undefined;
|
|
1455
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1456
|
+
type?: "native" | "process" | "cli" | undefined;
|
|
1457
|
+
timeout_ms?: number | undefined;
|
|
1046
1458
|
args?: string[] | undefined;
|
|
1047
1459
|
cwd?: string | undefined;
|
|
1048
1460
|
env?: Record<string, string> | undefined;
|
|
1049
|
-
input_mode?: "
|
|
1050
|
-
timeout_ms?: number | undefined;
|
|
1461
|
+
input_mode?: "protocol" | "stdin" | "arg" | undefined;
|
|
1051
1462
|
inherit_env?: boolean | undefined;
|
|
1463
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1464
|
+
env_allowlist?: string[] | undefined;
|
|
1465
|
+
env_denylist?: string[] | undefined;
|
|
1466
|
+
max_output_bytes?: number | undefined;
|
|
1467
|
+
allow_external_cwd?: boolean | undefined;
|
|
1052
1468
|
}[] | undefined;
|
|
1053
1469
|
providers?: {
|
|
1054
1470
|
name: string;
|
|
1055
1471
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1056
1472
|
base_url: string;
|
|
1473
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1057
1474
|
api_key_env_var?: string | undefined;
|
|
1475
|
+
timeout_ms?: number | undefined;
|
|
1058
1476
|
headers?: Record<string, string> | undefined;
|
|
1059
1477
|
enabled?: boolean | undefined;
|
|
1060
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1061
1478
|
}[] | undefined;
|
|
1062
1479
|
roles?: {
|
|
1063
1480
|
name: string;
|
|
@@ -1080,9 +1497,10 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
1080
1497
|
depends_on?: string[] | undefined;
|
|
1081
1498
|
retries?: number | undefined;
|
|
1082
1499
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1500
|
+
constraints?: string[] | undefined;
|
|
1083
1501
|
}[];
|
|
1084
|
-
role?: string | undefined;
|
|
1085
1502
|
name?: string | undefined;
|
|
1503
|
+
role?: string | undefined;
|
|
1086
1504
|
objective?: string | undefined;
|
|
1087
1505
|
}[] | undefined;
|
|
1088
1506
|
planner?: {
|
|
@@ -1094,9 +1512,14 @@ declare const projectConfigSchema: z.ZodObject<{
|
|
|
1094
1512
|
base_url?: string | undefined;
|
|
1095
1513
|
api_key_env_var?: string | undefined;
|
|
1096
1514
|
provider?: string | undefined;
|
|
1515
|
+
required?: boolean | undefined;
|
|
1097
1516
|
} | undefined;
|
|
1098
1517
|
}>;
|
|
1099
1518
|
declare const appConfigSchema: z.ZodObject<{
|
|
1519
|
+
/** Active profile; overlays live under `profiles` (§16). */
|
|
1520
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
1521
|
+
/** Named partial overlays, e.g. development/production/testing. */
|
|
1522
|
+
profiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1100
1523
|
project: z.ZodObject<{
|
|
1101
1524
|
name: z.ZodString;
|
|
1102
1525
|
providers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -1104,6 +1527,7 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1104
1527
|
type: z.ZodEnum<["openai-compatible", "omnihilbras", "openrouter", "local", "custom"]>;
|
|
1105
1528
|
base_url: z.ZodString;
|
|
1106
1529
|
api_key_env_var: z.ZodOptional<z.ZodString>;
|
|
1530
|
+
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
1107
1531
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1108
1532
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1109
1533
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1111,18 +1535,20 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1111
1535
|
name: string;
|
|
1112
1536
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1113
1537
|
base_url: string;
|
|
1538
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1114
1539
|
api_key_env_var?: string | undefined;
|
|
1540
|
+
timeout_ms?: number | undefined;
|
|
1115
1541
|
headers?: Record<string, string> | undefined;
|
|
1116
1542
|
enabled?: boolean | undefined;
|
|
1117
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1118
1543
|
}, {
|
|
1119
1544
|
name: string;
|
|
1120
1545
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1121
1546
|
base_url: string;
|
|
1547
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1122
1548
|
api_key_env_var?: string | undefined;
|
|
1549
|
+
timeout_ms?: number | undefined;
|
|
1123
1550
|
headers?: Record<string, string> | undefined;
|
|
1124
1551
|
enabled?: boolean | undefined;
|
|
1125
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1126
1552
|
}>, "many">>;
|
|
1127
1553
|
agents: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1128
1554
|
name: z.ZodString;
|
|
@@ -1135,29 +1561,44 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1135
1561
|
input_mode: z.ZodDefault<z.ZodEnum<["stdin", "arg", "protocol"]>>;
|
|
1136
1562
|
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
1137
1563
|
inherit_env: z.ZodOptional<z.ZodBoolean>;
|
|
1564
|
+
env_policy: z.ZodOptional<z.ZodEnum<["inherit", "allowlist", "denylist", "explicit"]>>;
|
|
1565
|
+
env_allowlist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1566
|
+
env_denylist: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1567
|
+
max_output_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1568
|
+
allow_external_cwd: z.ZodOptional<z.ZodBoolean>;
|
|
1138
1569
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1139
1570
|
}, "strict", z.ZodTypeAny, {
|
|
1140
1571
|
name: string;
|
|
1141
1572
|
type: "native" | "process" | "cli";
|
|
1142
|
-
input_mode: "
|
|
1143
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1573
|
+
input_mode: "protocol" | "stdin" | "arg";
|
|
1144
1574
|
command?: string | undefined;
|
|
1575
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1576
|
+
timeout_ms?: number | undefined;
|
|
1145
1577
|
args?: string[] | undefined;
|
|
1146
1578
|
cwd?: string | undefined;
|
|
1147
1579
|
env?: Record<string, string> | undefined;
|
|
1148
|
-
timeout_ms?: number | undefined;
|
|
1149
1580
|
inherit_env?: boolean | undefined;
|
|
1581
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1582
|
+
env_allowlist?: string[] | undefined;
|
|
1583
|
+
env_denylist?: string[] | undefined;
|
|
1584
|
+
max_output_bytes?: number | undefined;
|
|
1585
|
+
allow_external_cwd?: boolean | undefined;
|
|
1150
1586
|
}, {
|
|
1151
1587
|
name: string;
|
|
1152
|
-
type?: "native" | "process" | "cli" | undefined;
|
|
1153
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1154
1588
|
command?: string | undefined;
|
|
1589
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1590
|
+
type?: "native" | "process" | "cli" | undefined;
|
|
1591
|
+
timeout_ms?: number | undefined;
|
|
1155
1592
|
args?: string[] | undefined;
|
|
1156
1593
|
cwd?: string | undefined;
|
|
1157
1594
|
env?: Record<string, string> | undefined;
|
|
1158
|
-
input_mode?: "
|
|
1159
|
-
timeout_ms?: number | undefined;
|
|
1595
|
+
input_mode?: "protocol" | "stdin" | "arg" | undefined;
|
|
1160
1596
|
inherit_env?: boolean | undefined;
|
|
1597
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1598
|
+
env_allowlist?: string[] | undefined;
|
|
1599
|
+
env_denylist?: string[] | undefined;
|
|
1600
|
+
max_output_bytes?: number | undefined;
|
|
1601
|
+
allow_external_cwd?: boolean | undefined;
|
|
1161
1602
|
}>, "many">>;
|
|
1162
1603
|
roles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1163
1604
|
id: z.ZodString;
|
|
@@ -1201,6 +1642,8 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1201
1642
|
depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1202
1643
|
retries: z.ZodOptional<z.ZodNumber>;
|
|
1203
1644
|
condition: z.ZodOptional<z.ZodEnum<["always", "on-success", "on-failure"]>>;
|
|
1645
|
+
/** Constraints passed to the planner for plan steps (§15). */
|
|
1646
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1204
1647
|
}, "strict", z.ZodTypeAny, {
|
|
1205
1648
|
id: string;
|
|
1206
1649
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -1210,6 +1653,7 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1210
1653
|
depends_on?: string[] | undefined;
|
|
1211
1654
|
retries?: number | undefined;
|
|
1212
1655
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1656
|
+
constraints?: string[] | undefined;
|
|
1213
1657
|
}, {
|
|
1214
1658
|
id: string;
|
|
1215
1659
|
kind: "custom" | "research" | "collect" | "analyze" | "plan" | "execute";
|
|
@@ -1219,6 +1663,7 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1219
1663
|
depends_on?: string[] | undefined;
|
|
1220
1664
|
retries?: number | undefined;
|
|
1221
1665
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1666
|
+
constraints?: string[] | undefined;
|
|
1222
1667
|
}>, "many">;
|
|
1223
1668
|
}, "strict", z.ZodTypeAny, {
|
|
1224
1669
|
id: string;
|
|
@@ -1231,9 +1676,10 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1231
1676
|
depends_on?: string[] | undefined;
|
|
1232
1677
|
retries?: number | undefined;
|
|
1233
1678
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1679
|
+
constraints?: string[] | undefined;
|
|
1234
1680
|
}[];
|
|
1235
|
-
role?: string | undefined;
|
|
1236
1681
|
name?: string | undefined;
|
|
1682
|
+
role?: string | undefined;
|
|
1237
1683
|
objective?: string | undefined;
|
|
1238
1684
|
}, {
|
|
1239
1685
|
id: string;
|
|
@@ -1246,9 +1692,10 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1246
1692
|
depends_on?: string[] | undefined;
|
|
1247
1693
|
retries?: number | undefined;
|
|
1248
1694
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1695
|
+
constraints?: string[] | undefined;
|
|
1249
1696
|
}[];
|
|
1250
|
-
role?: string | undefined;
|
|
1251
1697
|
name?: string | undefined;
|
|
1698
|
+
role?: string | undefined;
|
|
1252
1699
|
objective?: string | undefined;
|
|
1253
1700
|
}>, "many">>;
|
|
1254
1701
|
planner: z.ZodOptional<z.ZodObject<{
|
|
@@ -1268,37 +1715,47 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1268
1715
|
provider: z.ZodDefault<z.ZodString>;
|
|
1269
1716
|
base_url: z.ZodOptional<z.ZodString>;
|
|
1270
1717
|
api_key_env_var: z.ZodOptional<z.ZodString>;
|
|
1718
|
+
/** When true, memory failures fail tasks instead of being tolerated (§12). */
|
|
1719
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1271
1720
|
}, "strict", z.ZodTypeAny, {
|
|
1272
1721
|
provider: string;
|
|
1273
1722
|
base_url?: string | undefined;
|
|
1274
1723
|
api_key_env_var?: string | undefined;
|
|
1724
|
+
required?: boolean | undefined;
|
|
1275
1725
|
}, {
|
|
1276
1726
|
base_url?: string | undefined;
|
|
1277
1727
|
api_key_env_var?: string | undefined;
|
|
1278
1728
|
provider?: string | undefined;
|
|
1729
|
+
required?: boolean | undefined;
|
|
1279
1730
|
}>>;
|
|
1280
1731
|
}, "strict", z.ZodTypeAny, {
|
|
1281
1732
|
name: string;
|
|
1282
1733
|
agents: {
|
|
1283
1734
|
name: string;
|
|
1284
1735
|
type: "native" | "process" | "cli";
|
|
1285
|
-
input_mode: "
|
|
1286
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1736
|
+
input_mode: "protocol" | "stdin" | "arg";
|
|
1287
1737
|
command?: string | undefined;
|
|
1738
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1739
|
+
timeout_ms?: number | undefined;
|
|
1288
1740
|
args?: string[] | undefined;
|
|
1289
1741
|
cwd?: string | undefined;
|
|
1290
1742
|
env?: Record<string, string> | undefined;
|
|
1291
|
-
timeout_ms?: number | undefined;
|
|
1292
1743
|
inherit_env?: boolean | undefined;
|
|
1744
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1745
|
+
env_allowlist?: string[] | undefined;
|
|
1746
|
+
env_denylist?: string[] | undefined;
|
|
1747
|
+
max_output_bytes?: number | undefined;
|
|
1748
|
+
allow_external_cwd?: boolean | undefined;
|
|
1293
1749
|
}[];
|
|
1294
1750
|
providers: {
|
|
1295
1751
|
name: string;
|
|
1296
1752
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1297
1753
|
base_url: string;
|
|
1754
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1298
1755
|
api_key_env_var?: string | undefined;
|
|
1756
|
+
timeout_ms?: number | undefined;
|
|
1299
1757
|
headers?: Record<string, string> | undefined;
|
|
1300
1758
|
enabled?: boolean | undefined;
|
|
1301
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1302
1759
|
}[];
|
|
1303
1760
|
roles: {
|
|
1304
1761
|
name: string;
|
|
@@ -1321,9 +1778,10 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1321
1778
|
depends_on?: string[] | undefined;
|
|
1322
1779
|
retries?: number | undefined;
|
|
1323
1780
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1781
|
+
constraints?: string[] | undefined;
|
|
1324
1782
|
}[];
|
|
1325
|
-
role?: string | undefined;
|
|
1326
1783
|
name?: string | undefined;
|
|
1784
|
+
role?: string | undefined;
|
|
1327
1785
|
objective?: string | undefined;
|
|
1328
1786
|
}[];
|
|
1329
1787
|
planner?: {
|
|
@@ -1335,29 +1793,36 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1335
1793
|
provider: string;
|
|
1336
1794
|
base_url?: string | undefined;
|
|
1337
1795
|
api_key_env_var?: string | undefined;
|
|
1796
|
+
required?: boolean | undefined;
|
|
1338
1797
|
} | undefined;
|
|
1339
1798
|
}, {
|
|
1340
1799
|
name: string;
|
|
1341
1800
|
agents?: {
|
|
1342
1801
|
name: string;
|
|
1343
|
-
type?: "native" | "process" | "cli" | undefined;
|
|
1344
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1345
1802
|
command?: string | undefined;
|
|
1803
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1804
|
+
type?: "native" | "process" | "cli" | undefined;
|
|
1805
|
+
timeout_ms?: number | undefined;
|
|
1346
1806
|
args?: string[] | undefined;
|
|
1347
1807
|
cwd?: string | undefined;
|
|
1348
1808
|
env?: Record<string, string> | undefined;
|
|
1349
|
-
input_mode?: "
|
|
1350
|
-
timeout_ms?: number | undefined;
|
|
1809
|
+
input_mode?: "protocol" | "stdin" | "arg" | undefined;
|
|
1351
1810
|
inherit_env?: boolean | undefined;
|
|
1811
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1812
|
+
env_allowlist?: string[] | undefined;
|
|
1813
|
+
env_denylist?: string[] | undefined;
|
|
1814
|
+
max_output_bytes?: number | undefined;
|
|
1815
|
+
allow_external_cwd?: boolean | undefined;
|
|
1352
1816
|
}[] | undefined;
|
|
1353
1817
|
providers?: {
|
|
1354
1818
|
name: string;
|
|
1355
1819
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1356
1820
|
base_url: string;
|
|
1821
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1357
1822
|
api_key_env_var?: string | undefined;
|
|
1823
|
+
timeout_ms?: number | undefined;
|
|
1358
1824
|
headers?: Record<string, string> | undefined;
|
|
1359
1825
|
enabled?: boolean | undefined;
|
|
1360
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1361
1826
|
}[] | undefined;
|
|
1362
1827
|
roles?: {
|
|
1363
1828
|
name: string;
|
|
@@ -1380,9 +1845,10 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1380
1845
|
depends_on?: string[] | undefined;
|
|
1381
1846
|
retries?: number | undefined;
|
|
1382
1847
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1848
|
+
constraints?: string[] | undefined;
|
|
1383
1849
|
}[];
|
|
1384
|
-
role?: string | undefined;
|
|
1385
1850
|
name?: string | undefined;
|
|
1851
|
+
role?: string | undefined;
|
|
1386
1852
|
objective?: string | undefined;
|
|
1387
1853
|
}[] | undefined;
|
|
1388
1854
|
planner?: {
|
|
@@ -1394,14 +1860,18 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1394
1860
|
base_url?: string | undefined;
|
|
1395
1861
|
api_key_env_var?: string | undefined;
|
|
1396
1862
|
provider?: string | undefined;
|
|
1863
|
+
required?: boolean | undefined;
|
|
1397
1864
|
} | undefined;
|
|
1398
1865
|
}>;
|
|
1399
1866
|
logging: z.ZodOptional<z.ZodObject<{
|
|
1400
1867
|
level: z.ZodEnum<["debug", "info", "warn", "error"]>;
|
|
1868
|
+
format: z.ZodOptional<z.ZodEnum<["text", "json"]>>;
|
|
1401
1869
|
}, "strict", z.ZodTypeAny, {
|
|
1402
1870
|
level: "info" | "error" | "debug" | "warn";
|
|
1871
|
+
format?: "text" | "json" | undefined;
|
|
1403
1872
|
}, {
|
|
1404
1873
|
level: "info" | "error" | "debug" | "warn";
|
|
1874
|
+
format?: "text" | "json" | undefined;
|
|
1405
1875
|
}>>;
|
|
1406
1876
|
}, "strict", z.ZodTypeAny, {
|
|
1407
1877
|
project: {
|
|
@@ -1409,23 +1879,29 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1409
1879
|
agents: {
|
|
1410
1880
|
name: string;
|
|
1411
1881
|
type: "native" | "process" | "cli";
|
|
1412
|
-
input_mode: "
|
|
1413
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1882
|
+
input_mode: "protocol" | "stdin" | "arg";
|
|
1414
1883
|
command?: string | undefined;
|
|
1884
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1885
|
+
timeout_ms?: number | undefined;
|
|
1415
1886
|
args?: string[] | undefined;
|
|
1416
1887
|
cwd?: string | undefined;
|
|
1417
1888
|
env?: Record<string, string> | undefined;
|
|
1418
|
-
timeout_ms?: number | undefined;
|
|
1419
1889
|
inherit_env?: boolean | undefined;
|
|
1890
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1891
|
+
env_allowlist?: string[] | undefined;
|
|
1892
|
+
env_denylist?: string[] | undefined;
|
|
1893
|
+
max_output_bytes?: number | undefined;
|
|
1894
|
+
allow_external_cwd?: boolean | undefined;
|
|
1420
1895
|
}[];
|
|
1421
1896
|
providers: {
|
|
1422
1897
|
name: string;
|
|
1423
1898
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1424
1899
|
base_url: string;
|
|
1900
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1425
1901
|
api_key_env_var?: string | undefined;
|
|
1902
|
+
timeout_ms?: number | undefined;
|
|
1426
1903
|
headers?: Record<string, string> | undefined;
|
|
1427
1904
|
enabled?: boolean | undefined;
|
|
1428
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1429
1905
|
}[];
|
|
1430
1906
|
roles: {
|
|
1431
1907
|
name: string;
|
|
@@ -1448,9 +1924,10 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1448
1924
|
depends_on?: string[] | undefined;
|
|
1449
1925
|
retries?: number | undefined;
|
|
1450
1926
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
1927
|
+
constraints?: string[] | undefined;
|
|
1451
1928
|
}[];
|
|
1452
|
-
role?: string | undefined;
|
|
1453
1929
|
name?: string | undefined;
|
|
1930
|
+
role?: string | undefined;
|
|
1454
1931
|
objective?: string | undefined;
|
|
1455
1932
|
}[];
|
|
1456
1933
|
planner?: {
|
|
@@ -1462,34 +1939,44 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1462
1939
|
provider: string;
|
|
1463
1940
|
base_url?: string | undefined;
|
|
1464
1941
|
api_key_env_var?: string | undefined;
|
|
1942
|
+
required?: boolean | undefined;
|
|
1465
1943
|
} | undefined;
|
|
1466
1944
|
};
|
|
1945
|
+
profile?: string | undefined;
|
|
1946
|
+
profiles?: Record<string, unknown> | undefined;
|
|
1467
1947
|
logging?: {
|
|
1468
1948
|
level: "info" | "error" | "debug" | "warn";
|
|
1949
|
+
format?: "text" | "json" | undefined;
|
|
1469
1950
|
} | undefined;
|
|
1470
1951
|
}, {
|
|
1471
1952
|
project: {
|
|
1472
1953
|
name: string;
|
|
1473
1954
|
agents?: {
|
|
1474
1955
|
name: string;
|
|
1475
|
-
type?: "native" | "process" | "cli" | undefined;
|
|
1476
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1477
1956
|
command?: string | undefined;
|
|
1957
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1958
|
+
type?: "native" | "process" | "cli" | undefined;
|
|
1959
|
+
timeout_ms?: number | undefined;
|
|
1478
1960
|
args?: string[] | undefined;
|
|
1479
1961
|
cwd?: string | undefined;
|
|
1480
1962
|
env?: Record<string, string> | undefined;
|
|
1481
|
-
input_mode?: "
|
|
1482
|
-
timeout_ms?: number | undefined;
|
|
1963
|
+
input_mode?: "protocol" | "stdin" | "arg" | undefined;
|
|
1483
1964
|
inherit_env?: boolean | undefined;
|
|
1965
|
+
env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
|
|
1966
|
+
env_allowlist?: string[] | undefined;
|
|
1967
|
+
env_denylist?: string[] | undefined;
|
|
1968
|
+
max_output_bytes?: number | undefined;
|
|
1969
|
+
allow_external_cwd?: boolean | undefined;
|
|
1484
1970
|
}[] | undefined;
|
|
1485
1971
|
providers?: {
|
|
1486
1972
|
name: string;
|
|
1487
1973
|
type: "custom" | "openai-compatible" | "omnihilbras" | "openrouter" | "local";
|
|
1488
1974
|
base_url: string;
|
|
1975
|
+
metadata?: Record<string, unknown> | undefined;
|
|
1489
1976
|
api_key_env_var?: string | undefined;
|
|
1977
|
+
timeout_ms?: number | undefined;
|
|
1490
1978
|
headers?: Record<string, string> | undefined;
|
|
1491
1979
|
enabled?: boolean | undefined;
|
|
1492
|
-
metadata?: Record<string, unknown> | undefined;
|
|
1493
1980
|
}[] | undefined;
|
|
1494
1981
|
roles?: {
|
|
1495
1982
|
name: string;
|
|
@@ -1512,9 +1999,10 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1512
1999
|
depends_on?: string[] | undefined;
|
|
1513
2000
|
retries?: number | undefined;
|
|
1514
2001
|
condition?: "always" | "on-success" | "on-failure" | undefined;
|
|
2002
|
+
constraints?: string[] | undefined;
|
|
1515
2003
|
}[];
|
|
1516
|
-
role?: string | undefined;
|
|
1517
2004
|
name?: string | undefined;
|
|
2005
|
+
role?: string | undefined;
|
|
1518
2006
|
objective?: string | undefined;
|
|
1519
2007
|
}[] | undefined;
|
|
1520
2008
|
planner?: {
|
|
@@ -1526,20 +2014,36 @@ declare const appConfigSchema: z.ZodObject<{
|
|
|
1526
2014
|
base_url?: string | undefined;
|
|
1527
2015
|
api_key_env_var?: string | undefined;
|
|
1528
2016
|
provider?: string | undefined;
|
|
2017
|
+
required?: boolean | undefined;
|
|
1529
2018
|
} | undefined;
|
|
1530
2019
|
};
|
|
2020
|
+
profile?: string | undefined;
|
|
2021
|
+
profiles?: Record<string, unknown> | undefined;
|
|
1531
2022
|
logging?: {
|
|
1532
2023
|
level: "info" | "error" | "debug" | "warn";
|
|
2024
|
+
format?: "text" | "json" | undefined;
|
|
1533
2025
|
} | undefined;
|
|
1534
2026
|
}>;
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
2027
|
+
|
|
2028
|
+
/**
|
|
2029
|
+
* Inline secret detection (roadmap §17, Secrets).
|
|
2030
|
+
*
|
|
2031
|
+
* OmniNode configuration must never contain literal credentials — only
|
|
2032
|
+
* environment-variable *references*. This scanner runs before the config is
|
|
2033
|
+
* parsed and reports anything that looks like an inline secret, so the file
|
|
2034
|
+
* is rejected before it can be committed or persisted.
|
|
2035
|
+
*/
|
|
2036
|
+
interface SecretFinding {
|
|
2037
|
+
/** 1-based line number in the source. */
|
|
2038
|
+
line: number;
|
|
2039
|
+
/** The offending key, e.g. `api_key`. */
|
|
2040
|
+
key: string;
|
|
2041
|
+
/** Redacted excerpt — never echoes the value. */
|
|
2042
|
+
excerpt: string;
|
|
2043
|
+
}
|
|
2044
|
+
declare function scanForInlineSecrets(source: string): SecretFinding[];
|
|
2045
|
+
/** Formats findings as an actionable configuration error message. */
|
|
2046
|
+
declare function describeSecretFindings(file: string, findings: SecretFinding[]): string;
|
|
1543
2047
|
|
|
1544
2048
|
interface AppConfig {
|
|
1545
2049
|
project: {
|
|
@@ -1557,6 +2061,7 @@ interface AppConfig {
|
|
|
1557
2061
|
provider: string;
|
|
1558
2062
|
baseUrl?: string;
|
|
1559
2063
|
apiKeyEnvVar?: string;
|
|
2064
|
+
required?: boolean;
|
|
1560
2065
|
};
|
|
1561
2066
|
};
|
|
1562
2067
|
logging?: {
|
|
@@ -1564,11 +2069,13 @@ interface AppConfig {
|
|
|
1564
2069
|
};
|
|
1565
2070
|
}
|
|
1566
2071
|
interface LoadConfigOptions {
|
|
1567
|
-
/** Explicit path; otherwise
|
|
2072
|
+
/** Explicit path (CLI --config); otherwise the project file is discovered. */
|
|
1568
2073
|
path?: string;
|
|
1569
2074
|
directory?: string;
|
|
1570
|
-
/** Environment used for ${VAR} expansion; defaults to process.env. */
|
|
2075
|
+
/** Environment used for ${VAR} expansion and OMNINODE_* overrides; defaults to process.env. */
|
|
1571
2076
|
env?: Record<string, string | undefined>;
|
|
2077
|
+
/** Profile override (CLI --profile), above environment and file selection. */
|
|
2078
|
+
profile?: string;
|
|
1572
2079
|
}
|
|
1573
2080
|
declare function findConfigFile(directory?: string): string | undefined;
|
|
1574
2081
|
/**
|
|
@@ -1577,7 +2084,36 @@ declare function findConfigFile(directory?: string): string | undefined;
|
|
|
1577
2084
|
* authentication.
|
|
1578
2085
|
*/
|
|
1579
2086
|
declare function expandEnvRefs(text: string, env: Record<string, string | undefined>, source?: string): string;
|
|
2087
|
+
interface LoadConfigResult {
|
|
2088
|
+
config: AppConfig;
|
|
2089
|
+
sources: ConfigSources;
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Composes configuration from every source with the documented precedence
|
|
2093
|
+
* (roadmap §16): CLI → environment → project file → user file → profile
|
|
2094
|
+
* overlay → defaults.
|
|
2095
|
+
*/
|
|
2096
|
+
declare function loadConfigDetailed(options?: LoadConfigOptions): LoadConfigResult;
|
|
2097
|
+
/** Backwards-compatible wrapper: the composed configuration. */
|
|
1580
2098
|
declare function loadConfig(options?: LoadConfigOptions): AppConfig;
|
|
2099
|
+
/**
|
|
2100
|
+
* Actionable configuration diagnostics (roadmap §16) — the kind of message a
|
|
2101
|
+
* user can act on, rather than a generic schema failure.
|
|
2102
|
+
*/
|
|
2103
|
+
declare function configDiagnostics(config: AppConfig): string[];
|
|
2104
|
+
|
|
2105
|
+
interface ConfigSources {
|
|
2106
|
+
/** Project-level configuration file, if any. */
|
|
2107
|
+
projectFile?: string;
|
|
2108
|
+
/** User-level configuration file, if any. */
|
|
2109
|
+
userFile?: string;
|
|
2110
|
+
/** Active profile. */
|
|
2111
|
+
profile: string;
|
|
2112
|
+
/** Environment variables that overrode configuration. */
|
|
2113
|
+
envOverrides: string[];
|
|
2114
|
+
/** Values that came from built-in defaults. */
|
|
2115
|
+
defaults: string[];
|
|
2116
|
+
}
|
|
1581
2117
|
|
|
1582
2118
|
/** Template written by `omninode init` (§22, §23). */
|
|
1583
2119
|
declare function defaultProjectConfigYaml(projectName?: string): string;
|
|
@@ -1603,15 +2139,112 @@ interface HttpResponse {
|
|
|
1603
2139
|
}
|
|
1604
2140
|
declare function requestJson(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
|
|
1605
2141
|
|
|
2142
|
+
type AuditAction = "task.created" | "task.queued" | "task.running" | "task.completed" | "task.failed" | "task.cancelled" | "task.retry" | "pipeline.run.started" | "pipeline.run.finished" | "pipeline.run.failed" | "pipeline.run.cancelled" | "plan.generated" | "agent.started" | "agent.completed" | "provider.error" | "memory.context.gathered" | "memory.outcome.recorded";
|
|
2143
|
+
/**
|
|
2144
|
+
* Every event carries correlation ids so a failed execution can be traced
|
|
2145
|
+
* across task → execution → pipeline run → agent → provider (roadmap §18).
|
|
2146
|
+
*/
|
|
2147
|
+
interface AuditEvent {
|
|
2148
|
+
at: string;
|
|
2149
|
+
action: AuditAction;
|
|
2150
|
+
project?: string;
|
|
2151
|
+
/** Primary subject: task id, pipeline run id, plan id… */
|
|
2152
|
+
id?: string;
|
|
2153
|
+
taskId?: string;
|
|
2154
|
+
pipelineId?: string;
|
|
2155
|
+
executionId?: string;
|
|
2156
|
+
agentId?: string;
|
|
2157
|
+
providerId?: string;
|
|
2158
|
+
actor?: string;
|
|
2159
|
+
detail?: Record<string, unknown>;
|
|
2160
|
+
}
|
|
2161
|
+
interface AuditSink {
|
|
2162
|
+
record(event: AuditEvent): Promise<void>;
|
|
2163
|
+
}
|
|
2164
|
+
/** Default rotation threshold: the audit log is rotated past this size (§24). */
|
|
2165
|
+
declare const DEFAULT_AUDIT_MAX_BYTES: number;
|
|
2166
|
+
/** Append-only JSONL sink. Failures are logged, never propagated. */
|
|
2167
|
+
declare class FileAuditLog implements AuditSink {
|
|
2168
|
+
private readonly filePath;
|
|
2169
|
+
private readonly maxBytes;
|
|
2170
|
+
private readonly log;
|
|
2171
|
+
constructor(directory?: string, log?: Logger, maxBytes?: number);
|
|
2172
|
+
/** Rotates the log once it passes the size budget, keeping one backup. */
|
|
2173
|
+
private rotateIfNeeded;
|
|
2174
|
+
record(event: AuditEvent): Promise<void>;
|
|
2175
|
+
/** Recent events, oldest first; used by the CLI. */
|
|
2176
|
+
recent(limit?: number): Promise<AuditEvent[]>;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
1606
2179
|
/** Provider types served by the OpenAI-compatible adapter. */
|
|
1607
2180
|
declare const OPENAI_COMPATIBLE_TYPES: readonly ProviderType[];
|
|
1608
|
-
|
|
2181
|
+
interface CreateProviderOptions {
|
|
2182
|
+
/** Correlates provider errors in the audit log (§18). */
|
|
2183
|
+
audit?: AuditSink;
|
|
2184
|
+
env?: Record<string, string | undefined>;
|
|
2185
|
+
}
|
|
2186
|
+
declare function createProvider(config: ProviderConfig, options?: CreateProviderOptions): IChatProvider;
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* Provider error normalization (roadmap §10).
|
|
2190
|
+
*
|
|
2191
|
+
* Every provider failure is mapped to one stable kind, so callers can react
|
|
2192
|
+
* (retry a rate limit, surface an auth problem, treat a missing model
|
|
2193
|
+
* differently) without string-matching provider-specific payloads.
|
|
2194
|
+
*/
|
|
2195
|
+
|
|
2196
|
+
type ProviderErrorKind = "AUTHENTICATION_ERROR" | "RATE_LIMIT_ERROR" | "INVALID_REQUEST" | "MODEL_NOT_FOUND" | "TIMEOUT" | "NETWORK_ERROR" | "SERVER_ERROR" | "UNKNOWN_ERROR";
|
|
2197
|
+
interface ProviderErrorContext {
|
|
2198
|
+
provider: string;
|
|
2199
|
+
operation: string;
|
|
2200
|
+
status?: number;
|
|
2201
|
+
body?: unknown;
|
|
2202
|
+
retryAfterMs?: number;
|
|
2203
|
+
cause?: unknown;
|
|
2204
|
+
/** Maps the normalized kind onto the legacy stable error code. */
|
|
2205
|
+
code?: "PROVIDER_UNAVAILABLE" | "PROVIDER_AUTH_FAILED" | "MODEL_NOT_FOUND";
|
|
2206
|
+
}
|
|
2207
|
+
/** Kinds worth retrying automatically (rate limits and transient server errors). */
|
|
2208
|
+
declare function isRetryable(kind: ProviderErrorKind): boolean;
|
|
2209
|
+
/** Maps an HTTP status (and optional body) to a normalized kind. */
|
|
2210
|
+
declare function kindFromStatus(status: number): ProviderErrorKind;
|
|
2211
|
+
/** Extracts a human message from common provider error body shapes. */
|
|
2212
|
+
declare function extractMessage(body: unknown): string | undefined;
|
|
2213
|
+
/** Parses `Retry-After` (seconds or HTTP-date) into milliseconds. */
|
|
2214
|
+
declare function parseRetryAfter(value: string | null | undefined, now?: number): number | undefined;
|
|
2215
|
+
/** True for the abort/timeout errors raised by fetch's AbortSignal.timeout. */
|
|
2216
|
+
declare function isTimeoutError(error: unknown): boolean;
|
|
2217
|
+
/** True for transport failures (DNS, refused, TLS, offline). */
|
|
2218
|
+
declare function isNetworkError(error: unknown): boolean;
|
|
2219
|
+
declare function providerHttpError(context: ProviderErrorContext): ProviderError;
|
|
2220
|
+
/** Wraps a thrown transport/abort error into a normalized ProviderError. */
|
|
2221
|
+
declare function providerTransportError(context: Omit<ProviderErrorContext, "status" | "body">): ProviderError;
|
|
1609
2222
|
|
|
1610
2223
|
declare class OpenAICompatibleProvider implements IChatProvider {
|
|
1611
2224
|
readonly config: ProviderConfig;
|
|
2225
|
+
readonly providerId: string;
|
|
2226
|
+
readonly authentication: ProviderAuthentication;
|
|
1612
2227
|
private readonly log;
|
|
1613
|
-
|
|
2228
|
+
/** Discovered models, so getModel() answers without another round-trip. */
|
|
2229
|
+
private discovered?;
|
|
2230
|
+
private readonly env;
|
|
2231
|
+
private readonly audit?;
|
|
2232
|
+
constructor(config: ProviderConfig, log?: Logger, env?: Record<string, string | undefined>, audit?: AuditSink);
|
|
2233
|
+
/** Provider-level request timeout (roadmap §6.6/§11) with the shared default. */
|
|
2234
|
+
private get requestTimeoutMs();
|
|
2235
|
+
/** Authenticate + discover (roadmap §10, Model Discovery). */
|
|
2236
|
+
connect(): Promise<ModelInfo[]>;
|
|
2237
|
+
getModel(modelId: string): Promise<ModelInfo | undefined>;
|
|
2238
|
+
/** Raw /models body (protected so adapters can capture gateway-level metadata). */
|
|
2239
|
+
protected rawModelsResponse(): Promise<unknown>;
|
|
2240
|
+
private modelsRequest;
|
|
1614
2241
|
listModels(): Promise<ModelInfo[]>;
|
|
2242
|
+
/** Maps a raw model entry onto the normalized metadata shape (§10). */
|
|
2243
|
+
private toModelInfo;
|
|
2244
|
+
/** Streaming where the gateway supports it (§11). */
|
|
2245
|
+
stream(request: ChatRequest, onChunk: (chunk: ChatStreamChunk) => void): Promise<ChatResponse>;
|
|
2246
|
+
/** Provider errors are part of the audit trail (§14 correlation, §18 observability). */
|
|
2247
|
+
private recordProviderError;
|
|
1615
2248
|
healthCheck(): Promise<ProviderStatus>;
|
|
1616
2249
|
chat(request: ChatRequest): Promise<ChatResponse>;
|
|
1617
2250
|
}
|
|
@@ -1654,20 +2287,37 @@ interface OmniHilbrasConnectionResult {
|
|
|
1654
2287
|
registered: number;
|
|
1655
2288
|
}
|
|
1656
2289
|
declare class OmniHilbrasProvider extends OpenAICompatibleProvider {
|
|
2290
|
+
private gateway?;
|
|
2291
|
+
listModels(): Promise<ModelInfo[]>;
|
|
1657
2292
|
/**
|
|
1658
2293
|
* Run the full connect flow. Throws on authentication or transport failure
|
|
1659
2294
|
* (use healthCheck() for a non-throwing probe).
|
|
1660
2295
|
*/
|
|
1661
|
-
|
|
2296
|
+
/**
|
|
2297
|
+
* Gateway metadata reported alongside the model list (gateway version, tier,
|
|
2298
|
+
* region…), kept separate from per-model metadata (§11 — provider metadata).
|
|
2299
|
+
*/
|
|
2300
|
+
gatewayMetadata(): Record<string, unknown> | undefined;
|
|
2301
|
+
protected extractGatewayMetadata(body: unknown): Promise<void>;
|
|
2302
|
+
connectAndRegister(registry?: ModelRegistry): Promise<OmniHilbrasConnectionResult>;
|
|
1662
2303
|
}
|
|
1663
2304
|
|
|
1664
2305
|
/**
|
|
1665
|
-
*
|
|
1666
|
-
*
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
2306
|
+
* Process adapter (§9): runs CLI agents as child processes and communicates
|
|
2307
|
+
* over stdin/stdout, managing the process lifecycle, working directory,
|
|
2308
|
+
* environment, exit codes, logs and timeouts.
|
|
2309
|
+
*
|
|
2310
|
+
* Three input modes (§9, §21):
|
|
2311
|
+
* - "stdin": the composed task text is written to the agent's stdin.
|
|
2312
|
+
* - "arg": the composed task text is appended as the last command argument.
|
|
2313
|
+
* - "protocol": NodeToAgentMessage envelopes as JSON lines on stdin; the
|
|
2314
|
+
* agent answers with AgentToNodeMessage JSON lines (REPORT,
|
|
2315
|
+
* COMPLETION, ERROR, ...) whose structured payloads are parsed
|
|
2316
|
+
* into reports.
|
|
1669
2317
|
*/
|
|
1670
|
-
|
|
2318
|
+
|
|
2319
|
+
/** Per-stream byte budget before output is truncated and the agent killed. */
|
|
2320
|
+
declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
1671
2321
|
declare function composeTaskText(input: AgentTaskInput): string;
|
|
1672
2322
|
declare class ProcessAgent implements IAgent {
|
|
1673
2323
|
readonly config: AgentConfig;
|
|
@@ -1680,6 +2330,63 @@ declare class ProcessAgent implements IAgent {
|
|
|
1680
2330
|
cancel(taskId: string): Promise<void>;
|
|
1681
2331
|
runningTaskIds(): string[];
|
|
1682
2332
|
}
|
|
2333
|
+
/** Kills a child and, on POSIX, its whole process group (roadmap §8 tree cleanup). */
|
|
2334
|
+
declare function killTree(child: ChildProcess, signal: NodeJS.Signals): void;
|
|
2335
|
+
/** Human-readable exit reason, including signal terminations. */
|
|
2336
|
+
declare function describeExit(code: number | null, signal: NodeJS.Signals | null): string;
|
|
2337
|
+
/**
|
|
2338
|
+
* Decodes a stdout/stderr chunk safely: invalid UTF-8 becomes replacement
|
|
2339
|
+
* characters and NUL bytes are stripped, so binary noise cannot poison the
|
|
2340
|
+
* protocol decoder or the terminal (roadmap §8, encoding hardening).
|
|
2341
|
+
*/
|
|
2342
|
+
declare function sanitizeChunk(chunk: Buffer): string;
|
|
2343
|
+
|
|
2344
|
+
/**
|
|
2345
|
+
* Agent environment policies (roadmap §8, Environment Isolation).
|
|
2346
|
+
*
|
|
2347
|
+
* Four explicit policies, so operators decide exactly what an agent can see:
|
|
2348
|
+
* - `inherit` (default, backwards compatible): the full parent environment
|
|
2349
|
+
* - `allowlist`: only the allow-listed variables (+ PATH/HOME)
|
|
2350
|
+
* - `denylist`: the parent environment minus the deny-listed variables
|
|
2351
|
+
* - `explicit`: nothing from the parent; only PATH/HOME and `env`
|
|
2352
|
+
*
|
|
2353
|
+
* The v1 boolean `inherit_env: false` is still honored and maps to `explicit`.
|
|
2354
|
+
*/
|
|
2355
|
+
|
|
2356
|
+
type EnvPolicy = "inherit" | "allowlist" | "denylist" | "explicit";
|
|
2357
|
+
declare function resolveEnvPolicy(config: Partial<AgentConfig>): EnvPolicy;
|
|
2358
|
+
declare function buildChildEnv(config: AgentConfig): NodeJS.ProcessEnv;
|
|
2359
|
+
|
|
2360
|
+
interface CwdValidation {
|
|
2361
|
+
/** Normalized absolute path. */
|
|
2362
|
+
cwd: string;
|
|
2363
|
+
/** True when the directory sits outside the project root (project boundary). */
|
|
2364
|
+
outsideProject: boolean;
|
|
2365
|
+
}
|
|
2366
|
+
declare function validateWorkingDirectory(cwd: string | undefined, options?: {
|
|
2367
|
+
projectRoot?: string;
|
|
2368
|
+
allowExternal?: boolean;
|
|
2369
|
+
}): CwdValidation | undefined;
|
|
2370
|
+
|
|
2371
|
+
interface IAgentAdapter {
|
|
2372
|
+
/** Integration type this adapter serves, e.g. "native" or "process". */
|
|
2373
|
+
readonly integration: string;
|
|
2374
|
+
create(config: AgentConfig): IAgent;
|
|
2375
|
+
}
|
|
2376
|
+
declare class AgentAdapterRegistry {
|
|
2377
|
+
private readonly adapters;
|
|
2378
|
+
register(adapter: IAgentAdapter): void;
|
|
2379
|
+
get(integration: string): IAgentAdapter | undefined;
|
|
2380
|
+
list(): IAgentAdapter[];
|
|
2381
|
+
create(config: AgentConfig): IAgent;
|
|
2382
|
+
}
|
|
2383
|
+
/** Process-level adapter — the built-in CLI integration. */
|
|
2384
|
+
declare class ProcessAgentAdapter implements IAgentAdapter {
|
|
2385
|
+
private readonly factory;
|
|
2386
|
+
readonly integration = "process";
|
|
2387
|
+
constructor(factory: (config: AgentConfig) => IAgent);
|
|
2388
|
+
create(config: AgentConfig): IAgent;
|
|
2389
|
+
}
|
|
1683
2390
|
|
|
1684
2391
|
/** Agent registry (§10): the set of agents connected to OmniNode. */
|
|
1685
2392
|
|
|
@@ -1695,7 +2402,13 @@ declare class AgentRegistry {
|
|
|
1695
2402
|
* "cli" agent configs are mapped to the process integration by the loader.
|
|
1696
2403
|
*/
|
|
1697
2404
|
|
|
1698
|
-
|
|
2405
|
+
/**
|
|
2406
|
+
* Registry consulted first so native/API-level integrations plug in without
|
|
2407
|
+
* touching core (roadmap §8, Native Adapters).
|
|
2408
|
+
*/
|
|
2409
|
+
declare const defaultAgentAdapters: AgentAdapterRegistry;
|
|
2410
|
+
declare function createAgent(config: AgentConfig, adapters?: AgentAdapterRegistry): IAgent;
|
|
2411
|
+
|
|
1699
2412
|
/** Builds an agent registry from the project configuration, skipping agents that fail to construct. */
|
|
1700
2413
|
declare function buildAgentRegistry(config: AppConfig, log?: Logger): AgentRegistry;
|
|
1701
2414
|
|
|
@@ -1711,27 +2424,64 @@ declare class RoleRegistry {
|
|
|
1711
2424
|
/** Builds a role registry from the project configuration. */
|
|
1712
2425
|
declare function buildRoleRegistry(config: AppConfig): RoleRegistry;
|
|
1713
2426
|
|
|
2427
|
+
/** Current on-disk schema version. */
|
|
2428
|
+
declare const SCHEMA_VERSION = 2;
|
|
1714
2429
|
interface JsonDocument<T> {
|
|
1715
|
-
/** Bumped when the persisted shape changes in a breaking way (v2 Phase 12). */
|
|
1716
2430
|
schemaVersion?: number;
|
|
1717
2431
|
items: T[];
|
|
1718
2432
|
}
|
|
2433
|
+
type DocumentState = {
|
|
2434
|
+
status: "missing";
|
|
2435
|
+
} | {
|
|
2436
|
+
status: "empty";
|
|
2437
|
+
} | {
|
|
2438
|
+
status: "v1-legacy";
|
|
2439
|
+
} | {
|
|
2440
|
+
status: "current";
|
|
2441
|
+
schemaVersion: number;
|
|
2442
|
+
count: number;
|
|
2443
|
+
} | {
|
|
2444
|
+
status: "future";
|
|
2445
|
+
schemaVersion: number;
|
|
2446
|
+
} | {
|
|
2447
|
+
status: "corrupt";
|
|
2448
|
+
detail: string;
|
|
2449
|
+
};
|
|
1719
2450
|
interface JsonFileStoreOptions {
|
|
1720
2451
|
directory?: string;
|
|
1721
2452
|
fileName: string;
|
|
2453
|
+
/** Schema version to write (defaults to the current version). */
|
|
1722
2454
|
schemaVersion?: number;
|
|
1723
|
-
/**
|
|
2455
|
+
/** Power-loss durability: "rename" (default) or "fsync" (slower). */
|
|
2456
|
+
durability?: Durability;
|
|
2457
|
+
/** Called when a persisted file is corrupt (after quarantine). */
|
|
1724
2458
|
onCorrupt?: (path: string, error: unknown) => void;
|
|
2459
|
+
/** Disable file moves (used by dry runs / tests that inspect in place). */
|
|
2460
|
+
quarantine?: boolean;
|
|
1725
2461
|
}
|
|
2462
|
+
type Durability = "rename" | "fsync";
|
|
2463
|
+
/**
|
|
2464
|
+
* Writes a file atomically: temp → rename. The rename guarantees readers
|
|
2465
|
+
* never observe a torn file. With `durability: "fsync"` the data and the
|
|
2466
|
+
* directory entry are also flushed, which additionally survives power loss —
|
|
2467
|
+
* at a significant per-write cost, so it is opt-in.
|
|
2468
|
+
*/
|
|
2469
|
+
declare function writeFileAtomic(target: string, contents: string, durability?: Durability): Promise<void>;
|
|
2470
|
+
/** Reads and classifies a persisted document without modifying it. */
|
|
2471
|
+
declare function inspectDocument(path: string): Promise<DocumentState>;
|
|
2472
|
+
/** Reads a document, migrating v1 shapes and quarantining corruption. */
|
|
2473
|
+
declare function readDocument<T>(path: string, onCorrupt?: (path: string, error: unknown) => void, quarantine?: boolean): Promise<T[]>;
|
|
1726
2474
|
declare class JsonFileStore<T> {
|
|
1727
2475
|
private readonly filePath;
|
|
1728
2476
|
private readonly schemaVersion;
|
|
2477
|
+
private readonly durability;
|
|
1729
2478
|
private readonly onCorrupt?;
|
|
2479
|
+
private readonly quarantine;
|
|
1730
2480
|
private readonly log;
|
|
1731
2481
|
private queue;
|
|
1732
2482
|
constructor(options: JsonFileStoreOptions);
|
|
1733
2483
|
get path(): string;
|
|
1734
|
-
/** All items, or [] when missing/corrupt. */
|
|
2484
|
+
/** All items, or [] when missing/migrated-from-v1/corrupt. */
|
|
1735
2485
|
protected readAll(): Promise<T[]>;
|
|
1736
2486
|
protected writeAll(items: T[]): Promise<void>;
|
|
1737
2487
|
/** Serializes an async operation against this file. */
|
|
@@ -1762,28 +2512,6 @@ declare class FileTaskStore extends JsonFileStore<Task> implements TaskStore {
|
|
|
1762
2512
|
list(filter?: TaskStoreFilter): Promise<Task[]>;
|
|
1763
2513
|
}
|
|
1764
2514
|
|
|
1765
|
-
type AuditAction = "task.created" | "task.queued" | "task.running" | "task.completed" | "task.failed" | "task.cancelled" | "task.retry" | "pipeline.run.started" | "pipeline.run.finished" | "plan.generated" | "memory.context.gathered" | "memory.outcome.recorded";
|
|
1766
|
-
interface AuditEvent {
|
|
1767
|
-
at: string;
|
|
1768
|
-
action: AuditAction;
|
|
1769
|
-
project?: string;
|
|
1770
|
-
id?: string;
|
|
1771
|
-
actor?: string;
|
|
1772
|
-
detail?: Record<string, unknown>;
|
|
1773
|
-
}
|
|
1774
|
-
interface AuditSink {
|
|
1775
|
-
record(event: AuditEvent): Promise<void>;
|
|
1776
|
-
}
|
|
1777
|
-
/** Append-only JSONL sink. Failures are logged, never propagated. */
|
|
1778
|
-
declare class FileAuditLog implements AuditSink {
|
|
1779
|
-
private readonly filePath;
|
|
1780
|
-
private readonly log;
|
|
1781
|
-
constructor(directory?: string, log?: Logger);
|
|
1782
|
-
record(event: AuditEvent): Promise<void>;
|
|
1783
|
-
/** Recent events, oldest first; used by the CLI. */
|
|
1784
|
-
recent(limit?: number): Promise<AuditEvent[]>;
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
2515
|
/**
|
|
1788
2516
|
* Local file-based memory provider: the default implementation so persistent
|
|
1789
2517
|
* memory works out of the box, locally (§25), with no external service.
|
|
@@ -1791,12 +2519,20 @@ declare class FileAuditLog implements AuditSink {
|
|
|
1791
2519
|
* dependency-free.
|
|
1792
2520
|
*/
|
|
1793
2521
|
|
|
1794
|
-
declare function keywords(text: string): Set<string>;
|
|
1795
2522
|
declare class LocalMemoryProvider extends JsonFileStore<MemoryEntry> implements IMemoryProvider {
|
|
1796
2523
|
readonly name = "local";
|
|
1797
2524
|
constructor(directory?: string);
|
|
2525
|
+
metadata(): MemoryProviderMetadata;
|
|
2526
|
+
search(text: string, options?: {
|
|
2527
|
+
limit?: number;
|
|
2528
|
+
scope?: MemoryQuery["scope"];
|
|
2529
|
+
}): Promise<MemoryEntry[]>;
|
|
2530
|
+
/** @deprecated v1 alias of {@link retrieve}. */
|
|
1798
2531
|
query(query: MemoryQuery): Promise<MemoryEntry[]>;
|
|
2532
|
+
/** @deprecated v1 alias of {@link store}. */
|
|
1799
2533
|
write(entry: MemoryEntry): Promise<void>;
|
|
2534
|
+
retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
|
|
2535
|
+
store(entry: MemoryEntry): Promise<void>;
|
|
1800
2536
|
count(): Promise<number>;
|
|
1801
2537
|
}
|
|
1802
2538
|
|
|
@@ -1812,9 +2548,20 @@ declare class RememberaMemoryProvider implements IMemoryProvider {
|
|
|
1812
2548
|
private readonly env;
|
|
1813
2549
|
private readonly log;
|
|
1814
2550
|
constructor(config: RememberaConfig, log?: Logger);
|
|
2551
|
+
private get authenticationConfigured();
|
|
1815
2552
|
private headers;
|
|
2553
|
+
/** Search delegates to the gateway's relevance query. */
|
|
2554
|
+
search(text: string, options?: {
|
|
2555
|
+
limit?: number;
|
|
2556
|
+
scope?: MemoryQuery["scope"];
|
|
2557
|
+
}): Promise<MemoryEntry[]>;
|
|
2558
|
+
metadata(): MemoryProviderMetadata;
|
|
2559
|
+
/** @deprecated v1 alias of {@link retrieve}. */
|
|
1816
2560
|
query(query: MemoryQuery): Promise<MemoryEntry[]>;
|
|
2561
|
+
/** @deprecated v1 alias of {@link store}. */
|
|
1817
2562
|
write(entry: MemoryEntry): Promise<void>;
|
|
2563
|
+
retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
|
|
2564
|
+
store(entry: MemoryEntry): Promise<void>;
|
|
1818
2565
|
private request;
|
|
1819
2566
|
private toEntry;
|
|
1820
2567
|
}
|
|
@@ -1822,34 +2569,52 @@ declare class RememberaMemoryProvider implements IMemoryProvider {
|
|
|
1822
2569
|
type MemoryProviderConfig = NonNullable<AppConfig["project"]["memory"]>;
|
|
1823
2570
|
declare function createMemoryProvider(config?: MemoryProviderConfig): IMemoryProvider;
|
|
1824
2571
|
|
|
1825
|
-
/**
|
|
1826
|
-
* Memory service (§19–§20): gathers relevant memory before a task runs and
|
|
1827
|
-
* records outcomes afterwards — the Task → memory → relevant context →
|
|
1828
|
-
* agents → reports → memory loop. Memory failures are best-effort: they log
|
|
1829
|
-
* a warning and never fail a task, because memory is an enhancement, not a
|
|
1830
|
-
* dependency (§2).
|
|
1831
|
-
*/
|
|
1832
|
-
|
|
1833
2572
|
interface MemoryContextQuery {
|
|
1834
2573
|
objective: string;
|
|
1835
2574
|
role?: string;
|
|
1836
2575
|
project?: string;
|
|
2576
|
+
/** Maximum entries to consider (relevance-ranked by the provider). */
|
|
2577
|
+
limit?: number;
|
|
2578
|
+
}
|
|
2579
|
+
interface MemoryTaskContext {
|
|
2580
|
+
/** Prompt-ready context text ("" when nothing relevant was found). */
|
|
2581
|
+
text: string;
|
|
2582
|
+
entries: MemoryEntry[];
|
|
2583
|
+
/** True when the character budget cut the context short. */
|
|
2584
|
+
truncated: boolean;
|
|
2585
|
+
}
|
|
2586
|
+
declare const MAX_CONTEXT_CHARS = 4000;
|
|
2587
|
+
interface MemoryServiceOptions {
|
|
2588
|
+
/** When true, backend failures propagate instead of being logged. */
|
|
2589
|
+
required?: boolean;
|
|
2590
|
+
maxContextChars?: number;
|
|
1837
2591
|
}
|
|
1838
2592
|
declare class MemoryService {
|
|
1839
2593
|
private readonly provider;
|
|
1840
2594
|
private readonly log;
|
|
1841
|
-
|
|
2595
|
+
private readonly required;
|
|
2596
|
+
private readonly maxContextChars;
|
|
2597
|
+
constructor(provider: IMemoryProvider, log?: Logger, options?: MemoryServiceOptions);
|
|
1842
2598
|
get providerRef(): IMemoryProvider;
|
|
1843
2599
|
get providerName(): string;
|
|
1844
|
-
|
|
2600
|
+
get isRequired(): boolean;
|
|
2601
|
+
/** Structured, budgeted context for a task (§12 — avoid loading all memory). */
|
|
2602
|
+
contextFor(query: MemoryContextQuery): Promise<MemoryTaskContext>;
|
|
2603
|
+
/** Prompt-ready context text (v1 convenience wrapper). */
|
|
1845
2604
|
gatherContext(query: MemoryContextQuery): Promise<string>;
|
|
1846
|
-
/** Records a finished task's outcome —
|
|
2605
|
+
/** Records a finished task's outcome — task history plus "known problems" (§12). */
|
|
1847
2606
|
recordTaskOutcome(task: Task): Promise<void>;
|
|
2607
|
+
private format;
|
|
2608
|
+
/**
|
|
2609
|
+
* Failure policy (§12): continue unless memory is explicitly required.
|
|
2610
|
+
*/
|
|
2611
|
+
private handleFailure;
|
|
1848
2612
|
}
|
|
1849
2613
|
|
|
1850
2614
|
interface CreateTaskInput {
|
|
1851
2615
|
objective: string;
|
|
1852
2616
|
project?: string;
|
|
2617
|
+
pipelineId?: string;
|
|
1853
2618
|
role?: string;
|
|
1854
2619
|
agent?: string;
|
|
1855
2620
|
context?: TaskContext;
|
|
@@ -1941,12 +2706,26 @@ interface CombinedMeta {
|
|
|
1941
2706
|
pipelineRunId?: string;
|
|
1942
2707
|
taskIds?: string[];
|
|
1943
2708
|
}
|
|
2709
|
+
/** Serialized size budget for a single report (roadmap §17 — output limits). */
|
|
2710
|
+
declare const MAX_REPORT_BYTES: number;
|
|
2711
|
+
interface CollectionDiagnostics {
|
|
2712
|
+
collected: number;
|
|
2713
|
+
accepted: number;
|
|
2714
|
+
rejected: Array<{
|
|
2715
|
+
key: string;
|
|
2716
|
+
reason: string;
|
|
2717
|
+
issues: string[];
|
|
2718
|
+
}>;
|
|
2719
|
+
}
|
|
1944
2720
|
declare class ReportService {
|
|
1945
2721
|
private readonly store;
|
|
1946
2722
|
private readonly log;
|
|
2723
|
+
/** Rejected reports from the last collection (§13 — malformed never enters aggregation). */
|
|
2724
|
+
lastDiagnostics: CollectionDiagnostics;
|
|
1947
2725
|
constructor(store: ReportStore, log?: Logger);
|
|
1948
2726
|
get storeRef(): ReportStore;
|
|
1949
|
-
/** Normalizes finished tasks into reports (§17 — normalizer)
|
|
2727
|
+
/** Normalizes finished tasks into reports (§17 — normalizer), validating each
|
|
2728
|
+
* one so malformed reports never reach aggregation (§13). */
|
|
1950
2729
|
collectFromTasks(tasks: Task[]): Promise<Report[]>;
|
|
1951
2730
|
saveReports(reports: Report[]): Promise<void>;
|
|
1952
2731
|
generateCombined(reports: Report[], meta?: CombinedMeta): Promise<CombinedReport | undefined>;
|
|
@@ -1966,26 +2745,61 @@ interface ExtractionMeta {
|
|
|
1966
2745
|
}
|
|
1967
2746
|
declare function extractReportFromText(raw: string, meta: ExtractionMeta): Report;
|
|
1968
2747
|
|
|
2748
|
+
/** Default cap on retained finding groups per combined report (§24, memory). */
|
|
2749
|
+
declare const MAX_COMBINED_FINDINGS = 200;
|
|
1969
2750
|
interface AggregateOptions {
|
|
1970
2751
|
objective?: string;
|
|
1971
2752
|
pipelineRunId?: string;
|
|
1972
2753
|
taskIds?: string[];
|
|
1973
2754
|
/** Token-set Jaccard similarity above which findings are merged. */
|
|
1974
2755
|
similarityThreshold?: number;
|
|
2756
|
+
/** Cap on retained finding groups; excess is counted in metadata. */
|
|
2757
|
+
maxFindings?: number;
|
|
1975
2758
|
}
|
|
1976
2759
|
declare function aggregateReports(reports: Report[], options?: AggregateOptions): CombinedReport;
|
|
2760
|
+
/**
|
|
2761
|
+
* Conflict detection (§14): agents disagreeing about the same finding is a
|
|
2762
|
+
* first-class result. Both positions are preserved — OmniNode never silently
|
|
2763
|
+
* chooses one.
|
|
2764
|
+
*/
|
|
2765
|
+
declare function detectConflicts(groups: AggregatedFinding[]): ReportConflict[];
|
|
1977
2766
|
declare function similar(a: string, b: string, threshold: number): boolean;
|
|
1978
2767
|
|
|
2768
|
+
interface ReportValidationIssue {
|
|
2769
|
+
path: string;
|
|
2770
|
+
message: string;
|
|
2771
|
+
}
|
|
2772
|
+
type ReportValidationResult = {
|
|
2773
|
+
valid: true;
|
|
2774
|
+
report: Report;
|
|
2775
|
+
} | {
|
|
2776
|
+
valid: false;
|
|
2777
|
+
issues: ReportValidationIssue[];
|
|
2778
|
+
reason: string;
|
|
2779
|
+
};
|
|
2780
|
+
/** Validates (and normalizes) a report; malformed reports are rejected. */
|
|
2781
|
+
declare function validateReport(value: unknown): ReportValidationResult;
|
|
2782
|
+
/** Normalizes evidence entries (strings or objects) to typed evidence. */
|
|
2783
|
+
declare function normalizeEvidence(input: EvidenceInput[] | undefined): Evidence[] | undefined;
|
|
2784
|
+
declare function normalizeFinding(finding: Finding): Finding;
|
|
2785
|
+
|
|
1979
2786
|
/** Planner interface and request contract (§18). The planner is replaceable. */
|
|
1980
2787
|
|
|
1981
2788
|
interface PlanRequest {
|
|
2789
|
+
/** The original task (§15, Planner Input). */
|
|
1982
2790
|
objective: string;
|
|
1983
|
-
/**
|
|
2791
|
+
/** Project context (repository/workspace background, role-derived context…). */
|
|
2792
|
+
projectContext?: string;
|
|
2793
|
+
/** Agent reports the plan is based on. */
|
|
1984
2794
|
reports: Report[];
|
|
2795
|
+
/** Aggregated findings (combined report) — consensus and conflicts made explicit. */
|
|
2796
|
+
aggregated?: CombinedReport;
|
|
1985
2797
|
/** Combined research context from upstream pipeline steps, if available. */
|
|
1986
2798
|
context?: string;
|
|
1987
2799
|
role?: RoleDefinition;
|
|
1988
2800
|
memory?: MemoryEntry[];
|
|
2801
|
+
/** Constraints the plan must respect. */
|
|
2802
|
+
constraints?: string[];
|
|
1989
2803
|
project?: string;
|
|
1990
2804
|
taskId?: string;
|
|
1991
2805
|
pipelineRunId?: string;
|
|
@@ -1996,10 +2810,9 @@ interface IPlanner {
|
|
|
1996
2810
|
}
|
|
1997
2811
|
|
|
1998
2812
|
/**
|
|
1999
|
-
* Planner context builder (§
|
|
2000
|
-
*
|
|
2001
|
-
*
|
|
2002
|
-
* structured text.
|
|
2813
|
+
* Planner context builder (§15, Planner Input): assembles the original task,
|
|
2814
|
+
* project context, agent reports, aggregated findings, relevant memory and
|
|
2815
|
+
* constraints into one structured input, in that order.
|
|
2003
2816
|
*/
|
|
2004
2817
|
|
|
2005
2818
|
declare function buildPlannerContext(request: PlanRequest): string;
|
|
@@ -2026,13 +2839,108 @@ declare class ModelPlanner implements IPlanner {
|
|
|
2026
2839
|
plan(request: PlanRequest): Promise<Plan>;
|
|
2027
2840
|
private degrade;
|
|
2028
2841
|
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2842
|
+
type PlanJsonResult = {
|
|
2843
|
+
ok: true;
|
|
2844
|
+
goal: string;
|
|
2031
2845
|
summary: string;
|
|
2032
2846
|
steps: PlanStep[];
|
|
2033
2847
|
risks?: string[];
|
|
2034
2848
|
notes?: string[];
|
|
2035
|
-
} |
|
|
2849
|
+
} | {
|
|
2850
|
+
ok: false;
|
|
2851
|
+
reason: string;
|
|
2852
|
+
issues: Array<{
|
|
2853
|
+
path: string;
|
|
2854
|
+
message: string;
|
|
2855
|
+
}>;
|
|
2856
|
+
};
|
|
2857
|
+
/** Extracts and validates plan JSON from arbitrary model output (§15). */
|
|
2858
|
+
declare function parsePlanJson(text: string): PlanJsonResult;
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* Plan validation (roadmap §15, Validation): every generated plan passes
|
|
2862
|
+
* schema validation. Invalid plans are rejected with structured issues and
|
|
2863
|
+
* — where a fallback is configured — fall back to heuristic planning.
|
|
2864
|
+
*/
|
|
2865
|
+
|
|
2866
|
+
declare const planJsonSchema: z.ZodObject<{
|
|
2867
|
+
goal: z.ZodString;
|
|
2868
|
+
summary: z.ZodString;
|
|
2869
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
2870
|
+
id: z.ZodOptional<z.ZodString>;
|
|
2871
|
+
title: z.ZodString;
|
|
2872
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2873
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
2874
|
+
targets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2875
|
+
acceptance_criteria: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2876
|
+
depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2877
|
+
source_findings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2878
|
+
}, "strip", z.ZodTypeAny, {
|
|
2879
|
+
title: string;
|
|
2880
|
+
id?: string | undefined;
|
|
2881
|
+
description?: string | undefined;
|
|
2882
|
+
depends_on?: string[] | undefined;
|
|
2883
|
+
order?: number | undefined;
|
|
2884
|
+
targets?: string[] | undefined;
|
|
2885
|
+
acceptance_criteria?: string[] | undefined;
|
|
2886
|
+
source_findings?: string[] | undefined;
|
|
2887
|
+
}, {
|
|
2888
|
+
title: string;
|
|
2889
|
+
id?: string | undefined;
|
|
2890
|
+
description?: string | undefined;
|
|
2891
|
+
depends_on?: string[] | undefined;
|
|
2892
|
+
order?: number | undefined;
|
|
2893
|
+
targets?: string[] | undefined;
|
|
2894
|
+
acceptance_criteria?: string[] | undefined;
|
|
2895
|
+
source_findings?: string[] | undefined;
|
|
2896
|
+
}>, "many">;
|
|
2897
|
+
risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2898
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2899
|
+
}, "strip", z.ZodTypeAny, {
|
|
2900
|
+
steps: {
|
|
2901
|
+
title: string;
|
|
2902
|
+
id?: string | undefined;
|
|
2903
|
+
description?: string | undefined;
|
|
2904
|
+
depends_on?: string[] | undefined;
|
|
2905
|
+
order?: number | undefined;
|
|
2906
|
+
targets?: string[] | undefined;
|
|
2907
|
+
acceptance_criteria?: string[] | undefined;
|
|
2908
|
+
source_findings?: string[] | undefined;
|
|
2909
|
+
}[];
|
|
2910
|
+
summary: string;
|
|
2911
|
+
goal: string;
|
|
2912
|
+
risks?: string[] | undefined;
|
|
2913
|
+
notes?: string[] | undefined;
|
|
2914
|
+
}, {
|
|
2915
|
+
steps: {
|
|
2916
|
+
title: string;
|
|
2917
|
+
id?: string | undefined;
|
|
2918
|
+
description?: string | undefined;
|
|
2919
|
+
depends_on?: string[] | undefined;
|
|
2920
|
+
order?: number | undefined;
|
|
2921
|
+
targets?: string[] | undefined;
|
|
2922
|
+
acceptance_criteria?: string[] | undefined;
|
|
2923
|
+
source_findings?: string[] | undefined;
|
|
2924
|
+
}[];
|
|
2925
|
+
summary: string;
|
|
2926
|
+
goal: string;
|
|
2927
|
+
risks?: string[] | undefined;
|
|
2928
|
+
notes?: string[] | undefined;
|
|
2929
|
+
}>;
|
|
2930
|
+
interface PlanValidationIssue {
|
|
2931
|
+
path: string;
|
|
2932
|
+
message: string;
|
|
2933
|
+
}
|
|
2934
|
+
type PlanValidationResult = {
|
|
2935
|
+
valid: true;
|
|
2936
|
+
plan: Plan;
|
|
2937
|
+
} | {
|
|
2938
|
+
valid: false;
|
|
2939
|
+
issues: PlanValidationIssue[];
|
|
2940
|
+
reason: string;
|
|
2941
|
+
};
|
|
2942
|
+
/** Validates a plan object (ids/order filled by the caller). */
|
|
2943
|
+
declare function validatePlan(plan: Plan): PlanValidationResult;
|
|
2036
2944
|
|
|
2037
2945
|
/**
|
|
2038
2946
|
* Plan persistence (§27 Phase 8 — planner result storage). Same
|
|
@@ -2093,17 +3001,36 @@ interface PipelineEngineOptions {
|
|
|
2093
3001
|
audit?: AuditSink;
|
|
2094
3002
|
/** When present, finished runs have their reports collected, stored and combined (§16–§17). */
|
|
2095
3003
|
reports?: ReportService;
|
|
3004
|
+
/** Max steps executed concurrently within one wave (§24 execution-storm guard). */
|
|
3005
|
+
maxParallelSteps?: number;
|
|
3006
|
+
/** Combined-context budget in characters (§24 memory bound). */
|
|
3007
|
+
maxContextChars?: number;
|
|
2096
3008
|
log?: Logger;
|
|
2097
3009
|
}
|
|
2098
3010
|
interface RunPipelineOptions {
|
|
2099
3011
|
objective?: string;
|
|
2100
3012
|
onStep?: (stepRun: PipelineStepRun) => void;
|
|
2101
3013
|
}
|
|
2102
|
-
|
|
3014
|
+
|
|
3015
|
+
/** Default cap on steps running concurrently in one wave (§24). */
|
|
3016
|
+
declare const DEFAULT_MAX_PARALLEL_STEPS = 8;
|
|
3017
|
+
/** Default combined-context budget for downstream steps (§24). */
|
|
3018
|
+
declare const MAX_COMBINED_CONTEXT_CHARS = 20000;
|
|
3019
|
+
/** Keeps the most recent context within budget, marking what was dropped. */
|
|
3020
|
+
declare function budgetContext(context: string, maxChars?: number): string;
|
|
3021
|
+
declare class PipelineEngine implements IPipelineExecutor {
|
|
2103
3022
|
private readonly options;
|
|
2104
3023
|
private readonly log;
|
|
3024
|
+
/** Runs executing in THIS process — cancellation can terminate them directly. */
|
|
3025
|
+
private readonly activeRuns;
|
|
2105
3026
|
constructor(options: PipelineEngineOptions);
|
|
2106
3027
|
get store(): PipelineRunStore;
|
|
3028
|
+
/**
|
|
3029
|
+
* Saves the run while preserving fields that may be set by another process
|
|
3030
|
+
* (e.g. a cancellation request) — an in-memory snapshot must never clobber
|
|
3031
|
+
* externally requested cancellation (§9.2).
|
|
3032
|
+
*/
|
|
3033
|
+
private persist;
|
|
2107
3034
|
/** Structural + semantic validation (§27 Phase 5 — pipeline parser). */
|
|
2108
3035
|
validate(def: PipelineDefinition): void;
|
|
2109
3036
|
private assertAcyclic;
|
|
@@ -2112,13 +3039,18 @@ declare class PipelineEngine {
|
|
|
2112
3039
|
* dependencies, which enable parallel branches.
|
|
2113
3040
|
*/
|
|
2114
3041
|
private effectiveDependencies;
|
|
2115
|
-
run(def: PipelineDefinition, options?:
|
|
3042
|
+
run(def: PipelineDefinition, options?: PipelineRunOptions): Promise<PipelineRun>;
|
|
3043
|
+
/** First-class cancellation (§9.2): requests cancellation and terminates
|
|
3044
|
+
* tasks that are running in this process immediately. */
|
|
3045
|
+
cancel(runId: string): Promise<void>;
|
|
2116
3046
|
get(runId: string): Promise<PipelineRun | undefined>;
|
|
2117
3047
|
listRuns(filter?: {
|
|
2118
3048
|
pipelineId?: string;
|
|
2119
3049
|
}): Promise<PipelineRun[]>;
|
|
2120
3050
|
private shouldRun;
|
|
2121
3051
|
private executeStep;
|
|
3052
|
+
/** Registers tasks created for a step as live, so cancellation can terminate them (§9.2). */
|
|
3053
|
+
private trackLiveTasks;
|
|
2122
3054
|
private executeStepOnce;
|
|
2123
3055
|
/** Research fan-out: one task per agent, in parallel (§15). */
|
|
2124
3056
|
private runFanOut;
|
|
@@ -2127,16 +3059,19 @@ declare class PipelineEngine {
|
|
|
2127
3059
|
private getChat;
|
|
2128
3060
|
}
|
|
2129
3061
|
/** Default chat function: resolves "provider:model" against the configured providers. */
|
|
2130
|
-
|
|
3062
|
+
interface DefaultChatOptions {
|
|
3063
|
+
/** Correlates provider errors in the audit log (§18). */
|
|
3064
|
+
audit?: AuditSink;
|
|
3065
|
+
env?: Record<string, string | undefined>;
|
|
3066
|
+
}
|
|
3067
|
+
declare function createDefaultChatFn(providers: AppConfig["project"]["providers"], options?: DefaultChatOptions): ChatFn;
|
|
2131
3068
|
|
|
2132
3069
|
declare function buildPipelineEngine(config: AppConfig, log?: Logger): PipelineEngine;
|
|
2133
3070
|
|
|
2134
3071
|
/**
|
|
2135
|
-
* Persistence layer (v2 Phase
|
|
2136
|
-
*
|
|
2137
|
-
*
|
|
2138
|
-
* (TaskStore, PipelineRunStore, ReportStore, PlanStore, IMemoryProvider,
|
|
2139
|
-
* AuditSink) — see docs/API.md for the inventory and stability status.
|
|
3072
|
+
* Persistence layer (v2 Phase 12): one entry point to every local store,
|
|
3073
|
+
* the canonical storage interface names, and the migration path that upgrades
|
|
3074
|
+
* v1 data in place.
|
|
2140
3075
|
*/
|
|
2141
3076
|
|
|
2142
3077
|
/** Bundles every store for a single project directory. */
|
|
@@ -2149,7 +3084,120 @@ declare class ProjectStores {
|
|
|
2149
3084
|
readonly audit: FileAuditLog;
|
|
2150
3085
|
constructor(directory?: string);
|
|
2151
3086
|
}
|
|
3087
|
+
interface MigrationReport {
|
|
3088
|
+
file: string;
|
|
3089
|
+
state: DocumentState["status"];
|
|
3090
|
+
before?: number;
|
|
3091
|
+
after?: number;
|
|
3092
|
+
migrated: boolean;
|
|
3093
|
+
note?: string;
|
|
3094
|
+
}
|
|
3095
|
+
/**
|
|
3096
|
+
* Migration (roadmap §16): inspects every store file, reports its schema
|
|
3097
|
+
* state, and — unless `checkOnly` — rewrites v1 documents at the current
|
|
3098
|
+
* schema version. Idempotent and safe: unknown/future versions are reported,
|
|
3099
|
+
* never rewritten.
|
|
3100
|
+
*/
|
|
3101
|
+
declare function migrateProjectStores(directory?: string, options?: {
|
|
3102
|
+
checkOnly?: boolean;
|
|
3103
|
+
}): Promise<MigrationReport[]>;
|
|
3104
|
+
|
|
3105
|
+
/**
|
|
3106
|
+
* OmniNode Agent Protocol v2 — versioning (roadmap §7.1).
|
|
3107
|
+
*
|
|
3108
|
+
* Protocol identifiers are namespaced strings so an agent can negotiate the
|
|
3109
|
+
* dialect it speaks: `omninode-agent-protocol/2`.
|
|
3110
|
+
*/
|
|
3111
|
+
declare const PROTOCOL_V2 = "omninode-agent-protocol/2";
|
|
3112
|
+
/** Versions this build accepts. v1 is the unversioned dialect shipped with OmniNode 1.x. */
|
|
3113
|
+
declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
|
|
3114
|
+
declare const MAX_MESSAGE_BYTES = 1048576;
|
|
3115
|
+
declare function isSupportedProtocol(protocol: string): boolean;
|
|
3116
|
+
|
|
3117
|
+
type ProtocolViolationCode = "INVALID_JSON" | "NOT_AN_OBJECT" | "UNKNOWN_TYPE" | "MISSING_FIELD" | "UNSUPPORTED_VERSION" | "OVERSIZED" | "INVALID_PAYLOAD";
|
|
3118
|
+
interface ProtocolViolation {
|
|
3119
|
+
code: ProtocolViolationCode;
|
|
3120
|
+
message: string;
|
|
3121
|
+
/** Raw line (truncated) for diagnostics. */
|
|
3122
|
+
sample?: string;
|
|
3123
|
+
}
|
|
3124
|
+
type DecodeResult = {
|
|
3125
|
+
ok: true;
|
|
3126
|
+
envelope: ProtocolEnvelope;
|
|
3127
|
+
legacy: boolean;
|
|
3128
|
+
} | {
|
|
3129
|
+
ok: false;
|
|
3130
|
+
error: ProtocolViolation;
|
|
3131
|
+
};
|
|
3132
|
+
/** Validates one decoded JSON value as a protocol envelope. */
|
|
3133
|
+
declare function validateEnvelope(value: unknown, line?: string): DecodeResult;
|
|
3134
|
+
/** Decodes one protocol line (no trailing newline). */
|
|
3135
|
+
declare function decodeMessage(line: string, maxBytes?: number): DecodeResult;
|
|
3136
|
+
/** Serializes an envelope to a single JSON line. */
|
|
3137
|
+
declare function encodeMessage(envelope: ProtocolEnvelope, maxBytes?: number): string;
|
|
3138
|
+
/**
|
|
3139
|
+
* Streaming line decoder for agent stdout. Feed chunks; receive decoded
|
|
3140
|
+
* envelopes and violations in order. Survives garbage: a bad line yields a
|
|
3141
|
+
* violation and the stream continues.
|
|
3142
|
+
*/
|
|
3143
|
+
declare class ProtocolDecoder {
|
|
3144
|
+
private buffer;
|
|
3145
|
+
private readonly maxBytes;
|
|
3146
|
+
constructor(maxBytes?: number);
|
|
3147
|
+
push(chunk: string): DecodeResult[];
|
|
3148
|
+
/** Flush any trailing line when the process exits. */
|
|
3149
|
+
flush(): DecodeResult[];
|
|
3150
|
+
}
|
|
2152
3151
|
|
|
2153
|
-
|
|
3152
|
+
/**
|
|
3153
|
+
* OmniNode Agent Protocol v2 — session (roadmap §7.6).
|
|
3154
|
+
*
|
|
3155
|
+
* A session drives a protocol-mode agent: it emits v2 envelopes with
|
|
3156
|
+
* correlation ids, tolerates legacy (unversioned) replies, answers agent
|
|
3157
|
+
* questions through a responder callback, and collects reports, artifacts
|
|
3158
|
+
* and the completion — never throwing on malformed input.
|
|
3159
|
+
*/
|
|
2154
3160
|
|
|
2155
|
-
|
|
3161
|
+
interface SessionIds {
|
|
3162
|
+
requestId: string;
|
|
3163
|
+
taskId: string;
|
|
3164
|
+
agentId: string;
|
|
3165
|
+
pipelineId?: string;
|
|
3166
|
+
executionId?: string;
|
|
3167
|
+
}
|
|
3168
|
+
interface QuestionResponder {
|
|
3169
|
+
(question: {
|
|
3170
|
+
questionId: string;
|
|
3171
|
+
question: string;
|
|
3172
|
+
expected?: string;
|
|
3173
|
+
}): Promise<string> | string;
|
|
3174
|
+
}
|
|
3175
|
+
declare class ProtocolSession {
|
|
3176
|
+
readonly decoder: ProtocolDecoder;
|
|
3177
|
+
private readonly ids;
|
|
3178
|
+
private readonly responder;
|
|
3179
|
+
readonly violations: ProtocolViolation[];
|
|
3180
|
+
readonly questions: AskedQuestion[];
|
|
3181
|
+
readonly artifacts: ProtocolEnvelope["payload"][];
|
|
3182
|
+
reports: ProtocolEnvelope["payload"][];
|
|
3183
|
+
descriptor?: AgentDescriptor;
|
|
3184
|
+
completionSummary?: string;
|
|
3185
|
+
errorMessage?: string;
|
|
3186
|
+
constructor(ids: SessionIds, options?: {
|
|
3187
|
+
responder?: QuestionResponder;
|
|
3188
|
+
maxBytes?: number;
|
|
3189
|
+
});
|
|
3190
|
+
/** The v2 messages OmniNode sends to open a task (written to the agent's stdin). */
|
|
3191
|
+
taskMessages(objective: string, role?: unknown, context?: string, instruction?: string): string[];
|
|
3192
|
+
helloAck(descriptor: AgentDescriptor): string;
|
|
3193
|
+
/** Consumes decoded stdout, answering questions as they arrive. */
|
|
3194
|
+
handle(decoded: DecodeResult): Promise<void>;
|
|
3195
|
+
private answerQuestion;
|
|
3196
|
+
readonly pendingAnswers: string[];
|
|
3197
|
+
/** True once any inbound message carried the v2 protocol field. */
|
|
3198
|
+
sawV2: boolean;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
declare const OMNINODE_VERSION = "2.0.0-alpha.20";
|
|
3202
|
+
|
|
3203
|
+
export { AgentAdapterRegistry, type AgentConfig, type AgentDescriptor, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type ArtifactPayload, type AskedQuestion, type AuditAction, type AuditEvent, type AuditSink, type AuditSink as AuditStore, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatStreamChunk, type ChatUsage, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, type ConflictPosition, ConsoleLogSink, type CreateProviderOptions, type CreateTaskInput, type CwdValidation, DEFAULT_AUDIT_MAX_BYTES, DEFAULT_MAX_OUTPUT_BYTES, DEFAULT_MAX_PARALLEL_STEPS, type DecodeResult, type DefaultChatOptions, type DocumentState, type Durability, type EnvPolicy, type EnvelopeMeta, type Evidence, type EvidenceInput, type EvidenceKind, type ExecutionRecord, FileAuditLog, FilePipelineRunStore, FilePlanStore, FileReportStore, FileTaskStore, type Finding, type FindingOrigin, type FindingSeverity, type FindingSource, type HelloResult, HeuristicPlanner, type IAgent, type IAgentAdapter, type IChatProvider, type IMemoryProvider, type IPipelineExecutor, type IPlanner, type IProvider, type JsonDocument, JsonFileStore, type JsonFileStoreOptions, type LoadConfigOptions, type LoadConfigResult, LocalMemoryProvider, type LogFormat, type LogLevel, type LogSink, Logger, type LoggerOptions, MAX_COMBINED_CONTEXT_CHARS, MAX_COMBINED_FINDINGS, MAX_CONTEXT_CHARS, MAX_MESSAGE_BYTES, MAX_REPORT_BYTES, type MemoryCategory, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryProviderMetadata, type MemoryQuery, type MemoryScope, MemoryService, type MemoryServiceOptions, LocalMemoryProvider as MemoryStore, type MemoryTaskContext, type MessageEnvelope, type MigrationReport, type Modality, type ModelCapabilities, type ModelInfo, ModelPlanner, type ModelPlannerOptions, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, OmniHilbrasProvider, OmniNodeError, OpenAICompatibleProvider, PROTOCOL_V2, type PipelineDefinition, PipelineEngine, PipelineError, type PipelineRun, type PipelineRunAttempt, type PipelineRunFilter, type PipelineRunOptions, type PipelineRunStatus, type PipelineRunStore, type PipelineStep, type PipelineStepCondition, type PipelineStepKind, type PipelineStepRun, type PipelineRunStore as PipelineStore, type Plan, type PlanFilter, type PlanRequest, type PlanStep, type PlanStore, type PlanValidationIssue, type PlanValidationResult, PlannerError, ProcessAgent, ProcessAgentAdapter, type Project, ProjectStores, type ProtocolAgentToNodeType, ProtocolDecoder, type ProtocolEnvelope, ProtocolError, type ProtocolMessageType, type ProtocolNodeToAgentType, ProtocolSession, type ProtocolViolation, type ProtocolViolationCode, type ProviderAuthentication, type ProviderCapability, type ProviderConfig, ProviderError, type ProviderHealth, type ProviderStatus, type ProviderType, type QuestionPayload, type QuestionResponder, type RememberaConfig, RememberaMemoryProvider, type Report, type ReportArtifact, type ReportConflict, type ReportFilter, type ReportPayload, ReportService, type ReportStore, type RoleDefinition, RoleRegistry, type RunPipelineOptions, type RunTaskOptions, SCHEMA_VERSION, SUPPORTED_PROTOCOL_VERSIONS, type SessionIds, TERMINAL_TASK_STATUSES, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, agentConfigSchema, aggregateReports, appConfigSchema, authHeaders, budgetContext, buildAgentRegistry, buildChildEnv, buildHello, buildHelloAck, buildPipelineEngine, buildPlanner, buildPlannerContext, buildRoleRegistry, composeTaskText, configDiagnostics, configureLogger, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, decodeMessage, defaultAgentAdapters, defaultProjectConfigYaml, describeExit, describeSecretFindings, detectConflicts, encodeMessage, envelope, expandEnvRefs, extractMessage, extractReportFromText, findConfigFile, inspectDocument, isNetworkError, isOmniNodeError, isRetryable, isSupportedProtocol, isTimeoutError, killTree, kindFromStatus, loadConfig, loadConfigDetailed, logger, migrateProjectStores, newMessageId, normalizeEvidence, normalizeFinding, parseHello, parsePlanJson, parseRetryAfter, pipelineConfigSchema, pipelineStepConfigSchema, planJsonSchema, plannerConfigSchema, projectConfigSchema, providerConfigSchema, providerHttpError, providerTransportError, readDocument, registryKey, requestJson, resolveApiKey, resolveEnvPolicy, roleConfigSchema, sanitizeChunk, scanForInlineSecrets, similar, validateEnvelope, validatePlan, validateReport, validateWorkingDirectory, writeFileAtomic };
|