@hilbras/omninode 2.0.0-alpha.7 → 2.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,27 +4,72 @@ import { ChildProcess } from 'node:child_process';
4
4
  /** Structured report format so reports can be processed programmatically (§16). */
5
5
  type Confidence = "low" | "medium" | "high";
6
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
+ }
7
36
  interface Finding {
8
37
  id: string;
9
38
  title: string;
39
+ /** v1 field, kept for compatibility; `description` is the v2 field. */
10
40
  detail: string;
41
+ /** Full description of the finding (§13, Findings). */
42
+ description?: string;
11
43
  severity?: FindingSeverity;
12
- evidence?: string[];
44
+ confidence?: Confidence;
45
+ evidence?: EvidenceInput[];
13
46
  /** File path or conceptual location the finding refers to. */
14
47
  location?: string;
15
48
  tags?: string[];
49
+ /** Provenance of the finding, when known (§13). */
50
+ source?: FindingOrigin;
51
+ /** The concrete fix this finding implies. */
52
+ recommendation?: string;
16
53
  }
17
54
  interface Report {
18
55
  id: string;
19
56
  taskId: string;
20
57
  /** Agent name from the agent registry. */
21
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;
22
63
  /** Model id used, if known. */
23
64
  model?: string;
24
65
  summary: string;
25
66
  findings: Finding[];
26
67
  recommendations: string[];
27
68
  confidence?: Confidence;
69
+ /** Report-level evidence backing the summary. */
70
+ evidence?: EvidenceInput[];
71
+ /** Artifacts produced with the report (§13, Artifacts). */
72
+ artifacts?: ReportArtifact[];
28
73
  createdAt: string;
29
74
  metadata?: Record<string, unknown>;
30
75
  }
@@ -42,7 +87,9 @@ interface AggregatedFinding {
42
87
  occurrences: number;
43
88
  /** Highest severity seen across merged duplicates. */
44
89
  severity?: FindingSeverity;
45
- evidence: string[];
90
+ confidence?: Confidence;
91
+ /** Typed evidence, normalized from strings when reports were ingested. */
92
+ evidence: Evidence[];
46
93
  }
47
94
  interface AggregatedRecommendation {
48
95
  text: string;
@@ -306,30 +353,63 @@ interface ChatStreamChunk {
306
353
  }
307
354
 
308
355
  /**
309
- * Memory abstraction. Remembera is the preferred Hilbras integration, but the
310
- * core depends only on this interface (memory-agnostic principle, §2, §19).
356
+ * Memory abstraction (§19). Remembera is the preferred implementation, but
357
+ * the core depends only on this interface (memory-agnostic principle, §2).
358
+ *
359
+ * v2 contract (roadmap §12): retrieve / store / search / metadata, across
360
+ * project / task / role scopes with structured categories.
311
361
  */
312
- type MemoryScope = "project" | "role" | "task" | "knowledge";
362
+ type MemoryScope = "project" | "task" | "role" | "knowledge";
363
+ /** Structured memory categories (roadmap §12, Memory Categories). */
364
+ type MemoryCategory = "project" | "architecture" | "decisions" | "tasks" | "problems" | "solutions" | "conventions" | "agent_reports";
313
365
  interface MemoryEntry {
314
366
  key: string;
315
367
  scope: MemoryScope;
316
368
  content: string;
369
+ /** Structured category, when the backend supports it. */
370
+ category?: MemoryCategory;
317
371
  tags?: string[];
318
372
  createdAt?: string;
319
373
  updatedAt?: string;
320
374
  metadata?: Record<string, unknown>;
321
375
  }
322
376
  interface MemoryQuery {
377
+ /** Free-text relevance query. */
378
+ text?: string;
323
379
  scope?: MemoryScope;
380
+ category?: MemoryCategory;
324
381
  tags?: string[];
325
- /** Free-text relevance query; implementations decide ranking. */
326
- text?: string;
327
382
  limit?: number;
328
383
  }
384
+ interface MemoryProviderMetadata {
385
+ name: string;
386
+ /** What the backend can do, so callers can adapt (e.g. no category support). */
387
+ capabilities: Array<"retrieve" | "store" | "search" | "categories" | "tags">;
388
+ /** True when the backend enforces relevance ranking itself. */
389
+ relevanceRanking: boolean;
390
+ /** Backend-specific info (gateway version, endpoint type…). */
391
+ backend?: Record<string, unknown>;
392
+ }
393
+ /**
394
+ * The memory contract. `query`/`write` are the v1 names, kept as aliases so
395
+ * existing integrations keep working — new code should use retrieve/store.
396
+ */
329
397
  interface IMemoryProvider {
330
398
  readonly name: string;
331
- /** Retrieve relevant memory; only relevant context should reach a task (§20). */
399
+ /** Retrieve entries relevant to a query (task-oriented). */
400
+ retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
401
+ /** Store an entry (upsert by key). */
402
+ store(entry: MemoryEntry): Promise<void>;
403
+ /** Free-text search across scopes. */
404
+ search(text: string, options?: {
405
+ limit?: number;
406
+ scope?: MemoryScope;
407
+ }): Promise<MemoryEntry[]>;
408
+ /** Provider capabilities (contract introspection). */
409
+ metadata(): MemoryProviderMetadata;
410
+ /** @deprecated v1 alias of {@link retrieve}. */
332
411
  query(query: MemoryQuery): Promise<MemoryEntry[]>;
412
+ /** @deprecated v1 alias of {@link store}. */
333
413
  write(entry: MemoryEntry): Promise<void>;
334
414
  }
335
415
 
@@ -865,9 +945,9 @@ declare const agentConfigSchema: z.ZodObject<{
865
945
  name: string;
866
946
  type: "native" | "process" | "cli";
867
947
  input_mode: "protocol" | "stdin" | "arg";
948
+ command?: string | undefined;
868
949
  metadata?: Record<string, unknown> | undefined;
869
950
  timeout_ms?: number | undefined;
870
- command?: string | undefined;
871
951
  args?: string[] | undefined;
872
952
  cwd?: string | undefined;
873
953
  env?: Record<string, string> | undefined;
@@ -879,10 +959,10 @@ declare const agentConfigSchema: z.ZodObject<{
879
959
  allow_external_cwd?: boolean | undefined;
880
960
  }, {
881
961
  name: string;
962
+ command?: string | undefined;
882
963
  metadata?: Record<string, unknown> | undefined;
883
964
  type?: "native" | "process" | "cli" | undefined;
884
965
  timeout_ms?: number | undefined;
885
- command?: string | undefined;
886
966
  args?: string[] | undefined;
887
967
  cwd?: string | undefined;
888
968
  env?: Record<string, string> | undefined;
@@ -1078,9 +1158,9 @@ declare const projectConfigSchema: z.ZodObject<{
1078
1158
  name: string;
1079
1159
  type: "native" | "process" | "cli";
1080
1160
  input_mode: "protocol" | "stdin" | "arg";
1161
+ command?: string | undefined;
1081
1162
  metadata?: Record<string, unknown> | undefined;
1082
1163
  timeout_ms?: number | undefined;
1083
- command?: string | undefined;
1084
1164
  args?: string[] | undefined;
1085
1165
  cwd?: string | undefined;
1086
1166
  env?: Record<string, string> | undefined;
@@ -1092,10 +1172,10 @@ declare const projectConfigSchema: z.ZodObject<{
1092
1172
  allow_external_cwd?: boolean | undefined;
1093
1173
  }, {
1094
1174
  name: string;
1175
+ command?: string | undefined;
1095
1176
  metadata?: Record<string, unknown> | undefined;
1096
1177
  type?: "native" | "process" | "cli" | undefined;
1097
1178
  timeout_ms?: number | undefined;
1098
- command?: string | undefined;
1099
1179
  args?: string[] | undefined;
1100
1180
  cwd?: string | undefined;
1101
1181
  env?: Record<string, string> | undefined;
@@ -1216,17 +1296,18 @@ declare const projectConfigSchema: z.ZodObject<{
1216
1296
  provider: z.ZodDefault<z.ZodString>;
1217
1297
  base_url: z.ZodOptional<z.ZodString>;
1218
1298
  api_key_env_var: z.ZodOptional<z.ZodString>;
1219
- timeout_ms: z.ZodOptional<z.ZodNumber>;
1299
+ /** When true, memory failures fail tasks instead of being tolerated (§12). */
1300
+ required: z.ZodOptional<z.ZodBoolean>;
1220
1301
  }, "strict", z.ZodTypeAny, {
1221
1302
  provider: string;
1222
1303
  base_url?: string | undefined;
1223
1304
  api_key_env_var?: string | undefined;
1224
- timeout_ms?: number | undefined;
1305
+ required?: boolean | undefined;
1225
1306
  }, {
1226
1307
  base_url?: string | undefined;
1227
1308
  api_key_env_var?: string | undefined;
1228
- timeout_ms?: number | undefined;
1229
1309
  provider?: string | undefined;
1310
+ required?: boolean | undefined;
1230
1311
  }>>;
1231
1312
  }, "strict", z.ZodTypeAny, {
1232
1313
  name: string;
@@ -1234,9 +1315,9 @@ declare const projectConfigSchema: z.ZodObject<{
1234
1315
  name: string;
1235
1316
  type: "native" | "process" | "cli";
1236
1317
  input_mode: "protocol" | "stdin" | "arg";
1318
+ command?: string | undefined;
1237
1319
  metadata?: Record<string, unknown> | undefined;
1238
1320
  timeout_ms?: number | undefined;
1239
- command?: string | undefined;
1240
1321
  args?: string[] | undefined;
1241
1322
  cwd?: string | undefined;
1242
1323
  env?: Record<string, string> | undefined;
@@ -1292,16 +1373,16 @@ declare const projectConfigSchema: z.ZodObject<{
1292
1373
  provider: string;
1293
1374
  base_url?: string | undefined;
1294
1375
  api_key_env_var?: string | undefined;
1295
- timeout_ms?: number | undefined;
1376
+ required?: boolean | undefined;
1296
1377
  } | undefined;
1297
1378
  }, {
1298
1379
  name: string;
1299
1380
  agents?: {
1300
1381
  name: string;
1382
+ command?: string | undefined;
1301
1383
  metadata?: Record<string, unknown> | undefined;
1302
1384
  type?: "native" | "process" | "cli" | undefined;
1303
1385
  timeout_ms?: number | undefined;
1304
- command?: string | undefined;
1305
1386
  args?: string[] | undefined;
1306
1387
  cwd?: string | undefined;
1307
1388
  env?: Record<string, string> | undefined;
@@ -1357,8 +1438,8 @@ declare const projectConfigSchema: z.ZodObject<{
1357
1438
  memory?: {
1358
1439
  base_url?: string | undefined;
1359
1440
  api_key_env_var?: string | undefined;
1360
- timeout_ms?: number | undefined;
1361
1441
  provider?: string | undefined;
1442
+ required?: boolean | undefined;
1362
1443
  } | undefined;
1363
1444
  }>;
1364
1445
  declare const appConfigSchema: z.ZodObject<{
@@ -1413,9 +1494,9 @@ declare const appConfigSchema: z.ZodObject<{
1413
1494
  name: string;
1414
1495
  type: "native" | "process" | "cli";
1415
1496
  input_mode: "protocol" | "stdin" | "arg";
1497
+ command?: string | undefined;
1416
1498
  metadata?: Record<string, unknown> | undefined;
1417
1499
  timeout_ms?: number | undefined;
1418
- command?: string | undefined;
1419
1500
  args?: string[] | undefined;
1420
1501
  cwd?: string | undefined;
1421
1502
  env?: Record<string, string> | undefined;
@@ -1427,10 +1508,10 @@ declare const appConfigSchema: z.ZodObject<{
1427
1508
  allow_external_cwd?: boolean | undefined;
1428
1509
  }, {
1429
1510
  name: string;
1511
+ command?: string | undefined;
1430
1512
  metadata?: Record<string, unknown> | undefined;
1431
1513
  type?: "native" | "process" | "cli" | undefined;
1432
1514
  timeout_ms?: number | undefined;
1433
- command?: string | undefined;
1434
1515
  args?: string[] | undefined;
1435
1516
  cwd?: string | undefined;
1436
1517
  env?: Record<string, string> | undefined;
@@ -1551,17 +1632,18 @@ declare const appConfigSchema: z.ZodObject<{
1551
1632
  provider: z.ZodDefault<z.ZodString>;
1552
1633
  base_url: z.ZodOptional<z.ZodString>;
1553
1634
  api_key_env_var: z.ZodOptional<z.ZodString>;
1554
- timeout_ms: z.ZodOptional<z.ZodNumber>;
1635
+ /** When true, memory failures fail tasks instead of being tolerated (§12). */
1636
+ required: z.ZodOptional<z.ZodBoolean>;
1555
1637
  }, "strict", z.ZodTypeAny, {
1556
1638
  provider: string;
1557
1639
  base_url?: string | undefined;
1558
1640
  api_key_env_var?: string | undefined;
1559
- timeout_ms?: number | undefined;
1641
+ required?: boolean | undefined;
1560
1642
  }, {
1561
1643
  base_url?: string | undefined;
1562
1644
  api_key_env_var?: string | undefined;
1563
- timeout_ms?: number | undefined;
1564
1645
  provider?: string | undefined;
1646
+ required?: boolean | undefined;
1565
1647
  }>>;
1566
1648
  }, "strict", z.ZodTypeAny, {
1567
1649
  name: string;
@@ -1569,9 +1651,9 @@ declare const appConfigSchema: z.ZodObject<{
1569
1651
  name: string;
1570
1652
  type: "native" | "process" | "cli";
1571
1653
  input_mode: "protocol" | "stdin" | "arg";
1654
+ command?: string | undefined;
1572
1655
  metadata?: Record<string, unknown> | undefined;
1573
1656
  timeout_ms?: number | undefined;
1574
- command?: string | undefined;
1575
1657
  args?: string[] | undefined;
1576
1658
  cwd?: string | undefined;
1577
1659
  env?: Record<string, string> | undefined;
@@ -1627,16 +1709,16 @@ declare const appConfigSchema: z.ZodObject<{
1627
1709
  provider: string;
1628
1710
  base_url?: string | undefined;
1629
1711
  api_key_env_var?: string | undefined;
1630
- timeout_ms?: number | undefined;
1712
+ required?: boolean | undefined;
1631
1713
  } | undefined;
1632
1714
  }, {
1633
1715
  name: string;
1634
1716
  agents?: {
1635
1717
  name: string;
1718
+ command?: string | undefined;
1636
1719
  metadata?: Record<string, unknown> | undefined;
1637
1720
  type?: "native" | "process" | "cli" | undefined;
1638
1721
  timeout_ms?: number | undefined;
1639
- command?: string | undefined;
1640
1722
  args?: string[] | undefined;
1641
1723
  cwd?: string | undefined;
1642
1724
  env?: Record<string, string> | undefined;
@@ -1692,8 +1774,8 @@ declare const appConfigSchema: z.ZodObject<{
1692
1774
  memory?: {
1693
1775
  base_url?: string | undefined;
1694
1776
  api_key_env_var?: string | undefined;
1695
- timeout_ms?: number | undefined;
1696
1777
  provider?: string | undefined;
1778
+ required?: boolean | undefined;
1697
1779
  } | undefined;
1698
1780
  }>;
1699
1781
  logging: z.ZodOptional<z.ZodObject<{
@@ -1710,9 +1792,9 @@ declare const appConfigSchema: z.ZodObject<{
1710
1792
  name: string;
1711
1793
  type: "native" | "process" | "cli";
1712
1794
  input_mode: "protocol" | "stdin" | "arg";
1795
+ command?: string | undefined;
1713
1796
  metadata?: Record<string, unknown> | undefined;
1714
1797
  timeout_ms?: number | undefined;
1715
- command?: string | undefined;
1716
1798
  args?: string[] | undefined;
1717
1799
  cwd?: string | undefined;
1718
1800
  env?: Record<string, string> | undefined;
@@ -1768,7 +1850,7 @@ declare const appConfigSchema: z.ZodObject<{
1768
1850
  provider: string;
1769
1851
  base_url?: string | undefined;
1770
1852
  api_key_env_var?: string | undefined;
1771
- timeout_ms?: number | undefined;
1853
+ required?: boolean | undefined;
1772
1854
  } | undefined;
1773
1855
  };
1774
1856
  logging?: {
@@ -1779,10 +1861,10 @@ declare const appConfigSchema: z.ZodObject<{
1779
1861
  name: string;
1780
1862
  agents?: {
1781
1863
  name: string;
1864
+ command?: string | undefined;
1782
1865
  metadata?: Record<string, unknown> | undefined;
1783
1866
  type?: "native" | "process" | "cli" | undefined;
1784
1867
  timeout_ms?: number | undefined;
1785
- command?: string | undefined;
1786
1868
  args?: string[] | undefined;
1787
1869
  cwd?: string | undefined;
1788
1870
  env?: Record<string, string> | undefined;
@@ -1838,8 +1920,8 @@ declare const appConfigSchema: z.ZodObject<{
1838
1920
  memory?: {
1839
1921
  base_url?: string | undefined;
1840
1922
  api_key_env_var?: string | undefined;
1841
- timeout_ms?: number | undefined;
1842
1923
  provider?: string | undefined;
1924
+ required?: boolean | undefined;
1843
1925
  } | undefined;
1844
1926
  };
1845
1927
  logging?: {
@@ -1871,6 +1953,7 @@ interface AppConfig {
1871
1953
  provider: string;
1872
1954
  baseUrl?: string;
1873
1955
  apiKeyEnvVar?: string;
1956
+ required?: boolean;
1874
1957
  };
1875
1958
  };
1876
1959
  logging?: {
@@ -2334,8 +2417,17 @@ declare function keywords(text: string): Set<string>;
2334
2417
  declare class LocalMemoryProvider extends JsonFileStore<MemoryEntry> implements IMemoryProvider {
2335
2418
  readonly name = "local";
2336
2419
  constructor(directory?: string);
2420
+ metadata(): MemoryProviderMetadata;
2421
+ search(text: string, options?: {
2422
+ limit?: number;
2423
+ scope?: MemoryQuery["scope"];
2424
+ }): Promise<MemoryEntry[]>;
2425
+ /** @deprecated v1 alias of {@link retrieve}. */
2337
2426
  query(query: MemoryQuery): Promise<MemoryEntry[]>;
2427
+ /** @deprecated v1 alias of {@link store}. */
2338
2428
  write(entry: MemoryEntry): Promise<void>;
2429
+ retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
2430
+ store(entry: MemoryEntry): Promise<void>;
2339
2431
  count(): Promise<number>;
2340
2432
  }
2341
2433
 
@@ -2351,9 +2443,20 @@ declare class RememberaMemoryProvider implements IMemoryProvider {
2351
2443
  private readonly env;
2352
2444
  private readonly log;
2353
2445
  constructor(config: RememberaConfig, log?: Logger);
2446
+ private get authenticationConfigured();
2354
2447
  private headers;
2448
+ /** Search delegates to the gateway's relevance query. */
2449
+ search(text: string, options?: {
2450
+ limit?: number;
2451
+ scope?: MemoryQuery["scope"];
2452
+ }): Promise<MemoryEntry[]>;
2453
+ metadata(): MemoryProviderMetadata;
2454
+ /** @deprecated v1 alias of {@link retrieve}. */
2355
2455
  query(query: MemoryQuery): Promise<MemoryEntry[]>;
2456
+ /** @deprecated v1 alias of {@link store}. */
2356
2457
  write(entry: MemoryEntry): Promise<void>;
2458
+ retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
2459
+ store(entry: MemoryEntry): Promise<void>;
2357
2460
  private request;
2358
2461
  private toEntry;
2359
2462
  }
@@ -2361,31 +2464,66 @@ declare class RememberaMemoryProvider implements IMemoryProvider {
2361
2464
  type MemoryProviderConfig = NonNullable<AppConfig["project"]["memory"]>;
2362
2465
  declare function createMemoryProvider(config?: MemoryProviderConfig): IMemoryProvider;
2363
2466
 
2364
- /**
2365
- * Memory service (§19–§20): gathers relevant memory before a task runs and
2366
- * records outcomes afterwards — the Task → memory → relevant context →
2367
- * agents → reports → memory loop. Memory failures are best-effort: they log
2368
- * a warning and never fail a task, because memory is an enhancement, not a
2369
- * dependency (§2).
2370
- */
2371
-
2372
2467
  interface MemoryContextQuery {
2373
2468
  objective: string;
2374
2469
  role?: string;
2375
2470
  project?: string;
2471
+ /** Maximum entries to consider (relevance-ranked by the provider). */
2472
+ limit?: number;
2473
+ }
2474
+ interface MemoryTaskContext {
2475
+ /** Prompt-ready context text ("" when nothing relevant was found). */
2476
+ text: string;
2477
+ entries: MemoryEntry[];
2478
+ /** True when the character budget cut the context short. */
2479
+ truncated: boolean;
2480
+ }
2481
+ declare const MAX_CONTEXT_CHARS = 4000;
2482
+ interface MemoryServiceOptions {
2483
+ /** When true, backend failures propagate instead of being logged. */
2484
+ required?: boolean;
2485
+ maxContextChars?: number;
2376
2486
  }
2377
2487
  declare class MemoryService {
2378
2488
  private readonly provider;
2379
2489
  private readonly log;
2380
- constructor(provider: IMemoryProvider, log?: Logger);
2490
+ private readonly required;
2491
+ private readonly maxContextChars;
2492
+ constructor(provider: IMemoryProvider, log?: Logger, options?: MemoryServiceOptions);
2381
2493
  get providerRef(): IMemoryProvider;
2382
2494
  get providerName(): string;
2383
- /** Relevant context for a task objective; empty string when nothing matches. */
2495
+ get isRequired(): boolean;
2496
+ /** Structured, budgeted context for a task (§12 — avoid loading all memory). */
2497
+ contextFor(query: MemoryContextQuery): Promise<MemoryTaskContext>;
2498
+ /** Prompt-ready context text (v1 convenience wrapper). */
2384
2499
  gatherContext(query: MemoryContextQuery): Promise<string>;
2385
- /** Records a finished task's outcome — best-effort. */
2500
+ /** Records a finished task's outcome — task history plus "known problems" (§12). */
2386
2501
  recordTaskOutcome(task: Task): Promise<void>;
2502
+ private format;
2503
+ /**
2504
+ * Failure policy (§12): continue unless memory is explicitly required.
2505
+ */
2506
+ private handleFailure;
2387
2507
  }
2388
2508
 
2509
+ /**
2510
+ * Shared memory-contract helpers (roadmap §12). Adapters implement
2511
+ * `retrieve` / `store`; these helpers supply the defaults for `search`,
2512
+ * `metadata` and the v1 `query` / `write` aliases, so the contract is
2513
+ * defined once.
2514
+ */
2515
+
2516
+ /** Free-text search defaults to a relevance retrieve. */
2517
+ declare function defaultSearch(provider: Pick<IMemoryProvider, "retrieve">, text: string, options?: {
2518
+ limit?: number;
2519
+ scope?: MemoryQuery["scope"];
2520
+ }): Promise<MemoryEntry[]>;
2521
+ declare function defaultMetadata(name: string, options?: {
2522
+ capabilities?: MemoryProviderMetadata["capabilities"];
2523
+ relevanceRanking?: boolean;
2524
+ backend?: Record<string, unknown>;
2525
+ }): MemoryProviderMetadata;
2526
+
2389
2527
  interface CreateTaskInput {
2390
2528
  objective: string;
2391
2529
  project?: string;
@@ -2480,12 +2618,24 @@ interface CombinedMeta {
2480
2618
  pipelineRunId?: string;
2481
2619
  taskIds?: string[];
2482
2620
  }
2621
+ interface CollectionDiagnostics {
2622
+ collected: number;
2623
+ accepted: number;
2624
+ rejected: Array<{
2625
+ key: string;
2626
+ reason: string;
2627
+ issues: string[];
2628
+ }>;
2629
+ }
2483
2630
  declare class ReportService {
2484
2631
  private readonly store;
2485
2632
  private readonly log;
2633
+ /** Rejected reports from the last collection (§13 — malformed never enters aggregation). */
2634
+ lastDiagnostics: CollectionDiagnostics;
2486
2635
  constructor(store: ReportStore, log?: Logger);
2487
2636
  get storeRef(): ReportStore;
2488
- /** Normalizes finished tasks into reports (§17 — normalizer). */
2637
+ /** Normalizes finished tasks into reports (§17 — normalizer), validating each
2638
+ * one so malformed reports never reach aggregation (§13). */
2489
2639
  collectFromTasks(tasks: Task[]): Promise<Report[]>;
2490
2640
  saveReports(reports: Report[]): Promise<void>;
2491
2641
  generateCombined(reports: Report[], meta?: CombinedMeta): Promise<CombinedReport | undefined>;
@@ -2515,6 +2665,24 @@ interface AggregateOptions {
2515
2665
  declare function aggregateReports(reports: Report[], options?: AggregateOptions): CombinedReport;
2516
2666
  declare function similar(a: string, b: string, threshold: number): boolean;
2517
2667
 
2668
+ interface ReportValidationIssue {
2669
+ path: string;
2670
+ message: string;
2671
+ }
2672
+ type ReportValidationResult = {
2673
+ valid: true;
2674
+ report: Report;
2675
+ } | {
2676
+ valid: false;
2677
+ issues: ReportValidationIssue[];
2678
+ reason: string;
2679
+ };
2680
+ /** Validates (and normalizes) a report; malformed reports are rejected. */
2681
+ declare function validateReport(value: unknown): ReportValidationResult;
2682
+ /** Normalizes evidence entries (strings or objects) to typed evidence. */
2683
+ declare function normalizeEvidence(input: EvidenceInput[] | undefined): Evidence[] | undefined;
2684
+ declare function normalizeFinding(finding: Finding): Finding;
2685
+
2518
2686
  /** Planner interface and request contract (§18). The planner is replaceable. */
2519
2687
 
2520
2688
  interface PlanRequest {
@@ -2702,6 +2870,6 @@ declare class ProjectStores {
2702
2870
  constructor(directory?: string);
2703
2871
  }
2704
2872
 
2705
- declare const OMNINODE_VERSION = "2.0.0-alpha.7";
2873
+ declare const OMNINODE_VERSION = "2.0.0-alpha.9";
2706
2874
 
2707
- export { AgentAdapterRegistry, type AgentConfig, type AgentConfigYaml, type AgentDescriptor, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregateOptions, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type AppConfigYaml, type ArtifactKind, type ArtifactPayload, type AskedQuestion, type AuditAction, type AuditEvent, type AuditSink, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatStreamChunk, type ChatUsage, type CombinedMeta, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, ConsoleLogSink, type CreateTaskInput, type CwdValidation, DEFAULT_MAX_OUTPUT_BYTES, type DecodeResult, type DiscoveryResult, type EnvPolicy, type EnvelopeMeta, type ExecutionRecord, type ExtractionMeta, FileAuditLog, FilePipelineRunStore, FilePlanStore, FileReportStore, FileTaskStore, type Finding, type FindingSeverity, type FindingSource, type HelloResult, HeuristicPlanner, type HttpRequestOptions, type HttpResponse, type IAgent, type IAgentAdapter, type IChatProvider, type IMemoryProvider, type IPipelineExecutor, type IPlanner, type IProvider, type JsonDocument, JsonFileStore, type JsonFileStoreOptions, type LoadConfigOptions, LocalMemoryProvider, type LogLevel, type LogSink, Logger, type LoggerOptions, MAX_MESSAGE_BYTES, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryQuery, type MemoryScope, MemoryService, type MessageEnvelope, type Modality, type ModelCapabilities, type ModelFilter, type ModelInfo, ModelPlanner, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, type OmniHilbrasConnectionResult, OmniHilbrasProvider, OmniNodeError, type OmniNodeErrorCode, type OmniNodeErrorOptions, OpenAICompatibleProvider, PROTOCOL_V2, type PipelineConfigYaml, type PipelineDefinition, PipelineEngine, type PipelineEngineOptions, PipelineError, type PipelineRun, type PipelineRunAttempt, type PipelineRunFilter, type PipelineRunOptions, type PipelineRunStatus, type PipelineRunStore, type PipelineStep, type PipelineStepCondition, type PipelineStepConfigYaml, type PipelineStepKind, type PipelineStepRun, type Plan, type PlanFilter, type PlanRequest, type PlanStep, type PlanStore, type PlannerConfigYaml, PlannerError, ProcessAgent, ProcessAgentAdapter, type Project, type ProjectConfigYaml, ProjectStores, type ProtocolAgentToNodeType, ProtocolDecoder, type ProtocolEnvelope, ProtocolError, type ProtocolMessageType, type ProtocolNodeToAgentType, ProtocolSession, type ProtocolViolation, type ProtocolViolationCode, type ProviderAuthentication, type ProviderCapability, type ProviderConfig, type ProviderConfigYaml, ProviderError, type ProviderErrorKind, type ProviderHealth, type ProviderStatus, type ProviderType, type QuestionPayload, type QuestionResponder, type RememberaConfig, RememberaMemoryProvider, type Report, type ReportFilter, type ReportPayload, ReportService, type ReportStore, type RoleConfigYaml, type RoleDefinition, RoleRegistry, type RunPipelineOptions, SUPPORTED_PROTOCOL_VERSIONS, type SessionIds, TERMINAL_TASK_STATUSES, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskPayload, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, type WritableLike, agentConfigSchema, aggregateReports, appConfigSchema, authHeaders, buildAgentRegistry, buildChildEnv, buildHello, buildHelloAck, buildPipelineEngine, buildPlanner, buildPlannerContext, buildRoleRegistry, composeTaskText, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, decodeMessage, decodeStream, defaultProjectConfigYaml, describeExit, encodeMessage, envelope, expandEnvRefs, extractMessage, extractReportFromText, findConfigFile, isNetworkError, isOmniNodeError, isRetryable, isSupportedProtocol, isTimeoutError, keywords, killTree, kindFromStatus, loadConfig, logger, newMessageId, parseHello, parsePlanJson, parseRetryAfter, pipelineConfigSchema, pipelineStepConfigSchema, plannerConfigSchema, projectConfigSchema, providerConfigSchema, providerHttpError, providerTransportError, registryKey, requestJson, requireCompletion, resolveApiKey, resolveEnvPolicy, roleConfigSchema, sanitizeChunk, similar, validateEnvelope, validateWorkingDirectory };
2875
+ export { AgentAdapterRegistry, type AgentConfig, type AgentConfigYaml, type AgentDescriptor, AgentError, type AgentInfo, type AgentInputMode, type AgentIntegrationType, AgentRegistry, type AgentStatus, type AgentTaskInput, type AgentTaskOutput, type AgentToNodeMessage, type AggregateOptions, type AggregatedFinding, type AggregatedRecommendation, type AppConfig, type AppConfigYaml, type ArtifactKind, type ArtifactPayload, type AskedQuestion, type AuditAction, type AuditEvent, type AuditSink, type ChatFn, type ChatMessage, type ChatRequest, type ChatResponse, type ChatRole, type ChatStreamChunk, type ChatUsage, type CollectionDiagnostics, type CombinedMeta, type CombinedReport, type CombinedReportFilter, type Confidence, ConfigError, ConsoleLogSink, type CreateTaskInput, type CwdValidation, DEFAULT_MAX_OUTPUT_BYTES, type DecodeResult, type DiscoveryResult, type EnvPolicy, type EnvelopeMeta, type Evidence, type EvidenceInput, type EvidenceKind, type ExecutionRecord, type ExtractionMeta, FileAuditLog, FilePipelineRunStore, FilePlanStore, FileReportStore, FileTaskStore, type Finding, type FindingOrigin, type FindingSeverity, type FindingSource, type HelloResult, HeuristicPlanner, type HttpRequestOptions, type HttpResponse, type IAgent, type IAgentAdapter, type IChatProvider, type IMemoryProvider, type IPipelineExecutor, type IPlanner, type IProvider, type JsonDocument, JsonFileStore, type JsonFileStoreOptions, type LoadConfigOptions, LocalMemoryProvider, type LogLevel, type LogSink, Logger, type LoggerOptions, MAX_CONTEXT_CHARS, MAX_MESSAGE_BYTES, type MemoryCategory, type MemoryContextQuery, type MemoryEntry, MemoryError, type MemoryProviderConfig, type MemoryProviderMetadata, type MemoryQuery, type MemoryScope, MemoryService, type MemoryServiceOptions, type MemoryTaskContext, type MessageEnvelope, type Modality, type ModelCapabilities, type ModelFilter, type ModelInfo, ModelPlanner, ModelRegistry, type ModelStatus, type NodeToAgentMessage, OMNINODE_VERSION, OPENAI_COMPATIBLE_TYPES, type OmniHilbrasConnectionResult, OmniHilbrasProvider, OmniNodeError, type OmniNodeErrorCode, type OmniNodeErrorOptions, OpenAICompatibleProvider, PROTOCOL_V2, type PipelineConfigYaml, type PipelineDefinition, PipelineEngine, type PipelineEngineOptions, PipelineError, type PipelineRun, type PipelineRunAttempt, type PipelineRunFilter, type PipelineRunOptions, type PipelineRunStatus, type PipelineRunStore, type PipelineStep, type PipelineStepCondition, type PipelineStepConfigYaml, type PipelineStepKind, type PipelineStepRun, type Plan, type PlanFilter, type PlanRequest, type PlanStep, type PlanStore, type PlannerConfigYaml, PlannerError, ProcessAgent, ProcessAgentAdapter, type Project, type ProjectConfigYaml, ProjectStores, type ProtocolAgentToNodeType, ProtocolDecoder, type ProtocolEnvelope, ProtocolError, type ProtocolMessageType, type ProtocolNodeToAgentType, ProtocolSession, type ProtocolViolation, type ProtocolViolationCode, type ProviderAuthentication, type ProviderCapability, type ProviderConfig, type ProviderConfigYaml, ProviderError, type ProviderErrorKind, type ProviderHealth, type ProviderStatus, type ProviderType, type QuestionPayload, type QuestionResponder, type RememberaConfig, RememberaMemoryProvider, type Report, type ReportArtifact, type ReportFilter, type ReportPayload, ReportService, type ReportStore, type ReportValidationIssue, type ReportValidationResult, type RoleConfigYaml, type RoleDefinition, RoleRegistry, type RunPipelineOptions, SUPPORTED_PROTOCOL_VERSIONS, type SessionIds, TERMINAL_TASK_STATUSES, type Task, type TaskContext, TaskEngine, type TaskEngineOptions, TaskError, type TaskPayload, type TaskResult, type TaskStatus, type TaskStore, type TaskStoreFilter, type WritableLike, agentConfigSchema, aggregateReports, appConfigSchema, authHeaders, buildAgentRegistry, buildChildEnv, buildHello, buildHelloAck, buildPipelineEngine, buildPlanner, buildPlannerContext, buildRoleRegistry, composeTaskText, createAgent, createDefaultChatFn, createMemoryProvider, createProvider, createTaskEngine, decodeMessage, decodeStream, defaultMetadata, defaultProjectConfigYaml, defaultSearch, describeExit, encodeMessage, envelope, expandEnvRefs, extractMessage, extractReportFromText, findConfigFile, isNetworkError, isOmniNodeError, isRetryable, isSupportedProtocol, isTimeoutError, keywords, killTree, kindFromStatus, loadConfig, logger, newMessageId, normalizeEvidence, normalizeFinding, parseHello, parsePlanJson, parseRetryAfter, pipelineConfigSchema, pipelineStepConfigSchema, plannerConfigSchema, projectConfigSchema, providerConfigSchema, providerHttpError, providerTransportError, registryKey, requestJson, requireCompletion, resolveApiKey, resolveEnvPolicy, roleConfigSchema, sanitizeChunk, similar, validateEnvelope, validateReport, validateWorkingDirectory };