@hilbras/omninode 2.0.0-alpha.6 → 2.0.0-alpha.8

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
@@ -296,32 +296,73 @@ interface ChatResponse {
296
296
  * layer so adapters (e.g. planner) never depend on engine modules.
297
297
  */
298
298
  type ChatFn = (model: string, messages: ChatMessage[]) => Promise<string>;
299
+ /** One streamed chunk (SSE deltas from OpenAI-compatible gateways). */
300
+ interface ChatStreamChunk {
301
+ /** Text delta (empty for role-only or final chunks). */
302
+ delta: string;
303
+ /** Provider-reported finish reason, on the final chunk. */
304
+ finishReason?: string;
305
+ raw?: unknown;
306
+ }
299
307
 
300
308
  /**
301
- * Memory abstraction. Remembera is the preferred Hilbras integration, but the
302
- * core depends only on this interface (memory-agnostic principle, §2, §19).
309
+ * Memory abstraction (§19). Remembera is the preferred implementation, but
310
+ * the core depends only on this interface (memory-agnostic principle, §2).
311
+ *
312
+ * v2 contract (roadmap §12): retrieve / store / search / metadata, across
313
+ * project / task / role scopes with structured categories.
303
314
  */
304
- type MemoryScope = "project" | "role" | "task" | "knowledge";
315
+ type MemoryScope = "project" | "task" | "role" | "knowledge";
316
+ /** Structured memory categories (roadmap §12, Memory Categories). */
317
+ type MemoryCategory = "project" | "architecture" | "decisions" | "tasks" | "problems" | "solutions" | "conventions" | "agent_reports";
305
318
  interface MemoryEntry {
306
319
  key: string;
307
320
  scope: MemoryScope;
308
321
  content: string;
322
+ /** Structured category, when the backend supports it. */
323
+ category?: MemoryCategory;
309
324
  tags?: string[];
310
325
  createdAt?: string;
311
326
  updatedAt?: string;
312
327
  metadata?: Record<string, unknown>;
313
328
  }
314
329
  interface MemoryQuery {
330
+ /** Free-text relevance query. */
331
+ text?: string;
315
332
  scope?: MemoryScope;
333
+ category?: MemoryCategory;
316
334
  tags?: string[];
317
- /** Free-text relevance query; implementations decide ranking. */
318
- text?: string;
319
335
  limit?: number;
320
336
  }
337
+ interface MemoryProviderMetadata {
338
+ name: string;
339
+ /** What the backend can do, so callers can adapt (e.g. no category support). */
340
+ capabilities: Array<"retrieve" | "store" | "search" | "categories" | "tags">;
341
+ /** True when the backend enforces relevance ranking itself. */
342
+ relevanceRanking: boolean;
343
+ /** Backend-specific info (gateway version, endpoint type…). */
344
+ backend?: Record<string, unknown>;
345
+ }
346
+ /**
347
+ * The memory contract. `query`/`write` are the v1 names, kept as aliases so
348
+ * existing integrations keep working — new code should use retrieve/store.
349
+ */
321
350
  interface IMemoryProvider {
322
351
  readonly name: string;
323
- /** Retrieve relevant memory; only relevant context should reach a task (§20). */
352
+ /** Retrieve entries relevant to a query (task-oriented). */
353
+ retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
354
+ /** Store an entry (upsert by key). */
355
+ store(entry: MemoryEntry): Promise<void>;
356
+ /** Free-text search across scopes. */
357
+ search(text: string, options?: {
358
+ limit?: number;
359
+ scope?: MemoryScope;
360
+ }): Promise<MemoryEntry[]>;
361
+ /** Provider capabilities (contract introspection). */
362
+ metadata(): MemoryProviderMetadata;
363
+ /** @deprecated v1 alias of {@link retrieve}. */
324
364
  query(query: MemoryQuery): Promise<MemoryEntry[]>;
365
+ /** @deprecated v1 alias of {@link store}. */
325
366
  write(entry: MemoryEntry): Promise<void>;
326
367
  }
327
368
 
@@ -685,6 +726,8 @@ interface ProviderConfig {
685
726
  */
686
727
  apiKeyEnvVar?: string;
687
728
  headers?: Record<string, string>;
729
+ /** Provider-level request timeout in ms (distinct from agent/pipeline budgets). */
730
+ timeoutMs?: number;
688
731
  /** Capabilities declared for this provider (discovered ones are merged in). */
689
732
  capabilities?: ProviderCapability[];
690
733
  enabled?: boolean;
@@ -722,6 +765,11 @@ interface IProvider {
722
765
  /** Contract for providers that can run chat completions (foundation for planning). */
723
766
  interface IChatProvider extends IProvider {
724
767
  chat(request: ChatRequest): Promise<ChatResponse>;
768
+ /**
769
+ * Stream a completion where the provider supports it (§11). Chunks are
770
+ * delivered in order; the resolved ChatResponse carries the assembled text.
771
+ */
772
+ stream?(request: ChatRequest, onChunk: (chunk: ChatStreamChunk) => void): Promise<ChatResponse>;
725
773
  }
726
774
 
727
775
  /** Typed error hierarchy shared across the whole codebase (§4.1 — error model). */
@@ -806,6 +854,7 @@ declare const providerConfigSchema: z.ZodObject<{
806
854
  type: z.ZodEnum<["openai-compatible", "omnihilbras", "openrouter", "local", "custom"]>;
807
855
  base_url: z.ZodString;
808
856
  api_key_env_var: z.ZodOptional<z.ZodString>;
857
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
809
858
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
810
859
  enabled: z.ZodOptional<z.ZodBoolean>;
811
860
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -815,6 +864,7 @@ declare const providerConfigSchema: z.ZodObject<{
815
864
  base_url: string;
816
865
  metadata?: Record<string, unknown> | undefined;
817
866
  api_key_env_var?: string | undefined;
867
+ timeout_ms?: number | undefined;
818
868
  headers?: Record<string, string> | undefined;
819
869
  enabled?: boolean | undefined;
820
870
  }, {
@@ -823,6 +873,7 @@ declare const providerConfigSchema: z.ZodObject<{
823
873
  base_url: string;
824
874
  metadata?: Record<string, unknown> | undefined;
825
875
  api_key_env_var?: string | undefined;
876
+ timeout_ms?: number | undefined;
826
877
  headers?: Record<string, string> | undefined;
827
878
  enabled?: boolean | undefined;
828
879
  }>;
@@ -848,11 +899,11 @@ declare const agentConfigSchema: z.ZodObject<{
848
899
  type: "native" | "process" | "cli";
849
900
  input_mode: "protocol" | "stdin" | "arg";
850
901
  metadata?: Record<string, unknown> | undefined;
902
+ timeout_ms?: number | undefined;
851
903
  command?: string | undefined;
852
904
  args?: string[] | undefined;
853
905
  cwd?: string | undefined;
854
906
  env?: Record<string, string> | undefined;
855
- timeout_ms?: number | undefined;
856
907
  inherit_env?: boolean | undefined;
857
908
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
858
909
  env_allowlist?: string[] | undefined;
@@ -863,12 +914,12 @@ declare const agentConfigSchema: z.ZodObject<{
863
914
  name: string;
864
915
  metadata?: Record<string, unknown> | undefined;
865
916
  type?: "native" | "process" | "cli" | undefined;
917
+ timeout_ms?: number | undefined;
866
918
  command?: string | undefined;
867
919
  args?: string[] | undefined;
868
920
  cwd?: string | undefined;
869
921
  env?: Record<string, string> | undefined;
870
922
  input_mode?: "protocol" | "stdin" | "arg" | undefined;
871
- timeout_ms?: number | undefined;
872
923
  inherit_env?: boolean | undefined;
873
924
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
874
925
  env_allowlist?: string[] | undefined;
@@ -1016,6 +1067,7 @@ declare const projectConfigSchema: z.ZodObject<{
1016
1067
  type: z.ZodEnum<["openai-compatible", "omnihilbras", "openrouter", "local", "custom"]>;
1017
1068
  base_url: z.ZodString;
1018
1069
  api_key_env_var: z.ZodOptional<z.ZodString>;
1070
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
1019
1071
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1020
1072
  enabled: z.ZodOptional<z.ZodBoolean>;
1021
1073
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1025,6 +1077,7 @@ declare const projectConfigSchema: z.ZodObject<{
1025
1077
  base_url: string;
1026
1078
  metadata?: Record<string, unknown> | undefined;
1027
1079
  api_key_env_var?: string | undefined;
1080
+ timeout_ms?: number | undefined;
1028
1081
  headers?: Record<string, string> | undefined;
1029
1082
  enabled?: boolean | undefined;
1030
1083
  }, {
@@ -1033,6 +1086,7 @@ declare const projectConfigSchema: z.ZodObject<{
1033
1086
  base_url: string;
1034
1087
  metadata?: Record<string, unknown> | undefined;
1035
1088
  api_key_env_var?: string | undefined;
1089
+ timeout_ms?: number | undefined;
1036
1090
  headers?: Record<string, string> | undefined;
1037
1091
  enabled?: boolean | undefined;
1038
1092
  }>, "many">>;
@@ -1058,11 +1112,11 @@ declare const projectConfigSchema: z.ZodObject<{
1058
1112
  type: "native" | "process" | "cli";
1059
1113
  input_mode: "protocol" | "stdin" | "arg";
1060
1114
  metadata?: Record<string, unknown> | undefined;
1115
+ timeout_ms?: number | undefined;
1061
1116
  command?: string | undefined;
1062
1117
  args?: string[] | undefined;
1063
1118
  cwd?: string | undefined;
1064
1119
  env?: Record<string, string> | undefined;
1065
- timeout_ms?: number | undefined;
1066
1120
  inherit_env?: boolean | undefined;
1067
1121
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1068
1122
  env_allowlist?: string[] | undefined;
@@ -1073,12 +1127,12 @@ declare const projectConfigSchema: z.ZodObject<{
1073
1127
  name: string;
1074
1128
  metadata?: Record<string, unknown> | undefined;
1075
1129
  type?: "native" | "process" | "cli" | undefined;
1130
+ timeout_ms?: number | undefined;
1076
1131
  command?: string | undefined;
1077
1132
  args?: string[] | undefined;
1078
1133
  cwd?: string | undefined;
1079
1134
  env?: Record<string, string> | undefined;
1080
1135
  input_mode?: "protocol" | "stdin" | "arg" | undefined;
1081
- timeout_ms?: number | undefined;
1082
1136
  inherit_env?: boolean | undefined;
1083
1137
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1084
1138
  env_allowlist?: string[] | undefined;
@@ -1195,14 +1249,18 @@ declare const projectConfigSchema: z.ZodObject<{
1195
1249
  provider: z.ZodDefault<z.ZodString>;
1196
1250
  base_url: z.ZodOptional<z.ZodString>;
1197
1251
  api_key_env_var: z.ZodOptional<z.ZodString>;
1252
+ /** When true, memory failures fail tasks instead of being tolerated (§12). */
1253
+ required: z.ZodOptional<z.ZodBoolean>;
1198
1254
  }, "strict", z.ZodTypeAny, {
1199
1255
  provider: string;
1200
1256
  base_url?: string | undefined;
1201
1257
  api_key_env_var?: string | undefined;
1258
+ required?: boolean | undefined;
1202
1259
  }, {
1203
1260
  base_url?: string | undefined;
1204
1261
  api_key_env_var?: string | undefined;
1205
1262
  provider?: string | undefined;
1263
+ required?: boolean | undefined;
1206
1264
  }>>;
1207
1265
  }, "strict", z.ZodTypeAny, {
1208
1266
  name: string;
@@ -1211,11 +1269,11 @@ declare const projectConfigSchema: z.ZodObject<{
1211
1269
  type: "native" | "process" | "cli";
1212
1270
  input_mode: "protocol" | "stdin" | "arg";
1213
1271
  metadata?: Record<string, unknown> | undefined;
1272
+ timeout_ms?: number | undefined;
1214
1273
  command?: string | undefined;
1215
1274
  args?: string[] | undefined;
1216
1275
  cwd?: string | undefined;
1217
1276
  env?: Record<string, string> | undefined;
1218
- timeout_ms?: number | undefined;
1219
1277
  inherit_env?: boolean | undefined;
1220
1278
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1221
1279
  env_allowlist?: string[] | undefined;
@@ -1229,6 +1287,7 @@ declare const projectConfigSchema: z.ZodObject<{
1229
1287
  base_url: string;
1230
1288
  metadata?: Record<string, unknown> | undefined;
1231
1289
  api_key_env_var?: string | undefined;
1290
+ timeout_ms?: number | undefined;
1232
1291
  headers?: Record<string, string> | undefined;
1233
1292
  enabled?: boolean | undefined;
1234
1293
  }[];
@@ -1267,6 +1326,7 @@ declare const projectConfigSchema: z.ZodObject<{
1267
1326
  provider: string;
1268
1327
  base_url?: string | undefined;
1269
1328
  api_key_env_var?: string | undefined;
1329
+ required?: boolean | undefined;
1270
1330
  } | undefined;
1271
1331
  }, {
1272
1332
  name: string;
@@ -1274,12 +1334,12 @@ declare const projectConfigSchema: z.ZodObject<{
1274
1334
  name: string;
1275
1335
  metadata?: Record<string, unknown> | undefined;
1276
1336
  type?: "native" | "process" | "cli" | undefined;
1337
+ timeout_ms?: number | undefined;
1277
1338
  command?: string | undefined;
1278
1339
  args?: string[] | undefined;
1279
1340
  cwd?: string | undefined;
1280
1341
  env?: Record<string, string> | undefined;
1281
1342
  input_mode?: "protocol" | "stdin" | "arg" | undefined;
1282
- timeout_ms?: number | undefined;
1283
1343
  inherit_env?: boolean | undefined;
1284
1344
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1285
1345
  env_allowlist?: string[] | undefined;
@@ -1293,6 +1353,7 @@ declare const projectConfigSchema: z.ZodObject<{
1293
1353
  base_url: string;
1294
1354
  metadata?: Record<string, unknown> | undefined;
1295
1355
  api_key_env_var?: string | undefined;
1356
+ timeout_ms?: number | undefined;
1296
1357
  headers?: Record<string, string> | undefined;
1297
1358
  enabled?: boolean | undefined;
1298
1359
  }[] | undefined;
@@ -1331,6 +1392,7 @@ declare const projectConfigSchema: z.ZodObject<{
1331
1392
  base_url?: string | undefined;
1332
1393
  api_key_env_var?: string | undefined;
1333
1394
  provider?: string | undefined;
1395
+ required?: boolean | undefined;
1334
1396
  } | undefined;
1335
1397
  }>;
1336
1398
  declare const appConfigSchema: z.ZodObject<{
@@ -1341,6 +1403,7 @@ declare const appConfigSchema: z.ZodObject<{
1341
1403
  type: z.ZodEnum<["openai-compatible", "omnihilbras", "openrouter", "local", "custom"]>;
1342
1404
  base_url: z.ZodString;
1343
1405
  api_key_env_var: z.ZodOptional<z.ZodString>;
1406
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
1344
1407
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1345
1408
  enabled: z.ZodOptional<z.ZodBoolean>;
1346
1409
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1350,6 +1413,7 @@ declare const appConfigSchema: z.ZodObject<{
1350
1413
  base_url: string;
1351
1414
  metadata?: Record<string, unknown> | undefined;
1352
1415
  api_key_env_var?: string | undefined;
1416
+ timeout_ms?: number | undefined;
1353
1417
  headers?: Record<string, string> | undefined;
1354
1418
  enabled?: boolean | undefined;
1355
1419
  }, {
@@ -1358,6 +1422,7 @@ declare const appConfigSchema: z.ZodObject<{
1358
1422
  base_url: string;
1359
1423
  metadata?: Record<string, unknown> | undefined;
1360
1424
  api_key_env_var?: string | undefined;
1425
+ timeout_ms?: number | undefined;
1361
1426
  headers?: Record<string, string> | undefined;
1362
1427
  enabled?: boolean | undefined;
1363
1428
  }>, "many">>;
@@ -1383,11 +1448,11 @@ declare const appConfigSchema: z.ZodObject<{
1383
1448
  type: "native" | "process" | "cli";
1384
1449
  input_mode: "protocol" | "stdin" | "arg";
1385
1450
  metadata?: Record<string, unknown> | undefined;
1451
+ timeout_ms?: number | undefined;
1386
1452
  command?: string | undefined;
1387
1453
  args?: string[] | undefined;
1388
1454
  cwd?: string | undefined;
1389
1455
  env?: Record<string, string> | undefined;
1390
- timeout_ms?: number | undefined;
1391
1456
  inherit_env?: boolean | undefined;
1392
1457
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1393
1458
  env_allowlist?: string[] | undefined;
@@ -1398,12 +1463,12 @@ declare const appConfigSchema: z.ZodObject<{
1398
1463
  name: string;
1399
1464
  metadata?: Record<string, unknown> | undefined;
1400
1465
  type?: "native" | "process" | "cli" | undefined;
1466
+ timeout_ms?: number | undefined;
1401
1467
  command?: string | undefined;
1402
1468
  args?: string[] | undefined;
1403
1469
  cwd?: string | undefined;
1404
1470
  env?: Record<string, string> | undefined;
1405
1471
  input_mode?: "protocol" | "stdin" | "arg" | undefined;
1406
- timeout_ms?: number | undefined;
1407
1472
  inherit_env?: boolean | undefined;
1408
1473
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1409
1474
  env_allowlist?: string[] | undefined;
@@ -1520,14 +1585,18 @@ declare const appConfigSchema: z.ZodObject<{
1520
1585
  provider: z.ZodDefault<z.ZodString>;
1521
1586
  base_url: z.ZodOptional<z.ZodString>;
1522
1587
  api_key_env_var: z.ZodOptional<z.ZodString>;
1588
+ /** When true, memory failures fail tasks instead of being tolerated (§12). */
1589
+ required: z.ZodOptional<z.ZodBoolean>;
1523
1590
  }, "strict", z.ZodTypeAny, {
1524
1591
  provider: string;
1525
1592
  base_url?: string | undefined;
1526
1593
  api_key_env_var?: string | undefined;
1594
+ required?: boolean | undefined;
1527
1595
  }, {
1528
1596
  base_url?: string | undefined;
1529
1597
  api_key_env_var?: string | undefined;
1530
1598
  provider?: string | undefined;
1599
+ required?: boolean | undefined;
1531
1600
  }>>;
1532
1601
  }, "strict", z.ZodTypeAny, {
1533
1602
  name: string;
@@ -1536,11 +1605,11 @@ declare const appConfigSchema: z.ZodObject<{
1536
1605
  type: "native" | "process" | "cli";
1537
1606
  input_mode: "protocol" | "stdin" | "arg";
1538
1607
  metadata?: Record<string, unknown> | undefined;
1608
+ timeout_ms?: number | undefined;
1539
1609
  command?: string | undefined;
1540
1610
  args?: string[] | undefined;
1541
1611
  cwd?: string | undefined;
1542
1612
  env?: Record<string, string> | undefined;
1543
- timeout_ms?: number | undefined;
1544
1613
  inherit_env?: boolean | undefined;
1545
1614
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1546
1615
  env_allowlist?: string[] | undefined;
@@ -1554,6 +1623,7 @@ declare const appConfigSchema: z.ZodObject<{
1554
1623
  base_url: string;
1555
1624
  metadata?: Record<string, unknown> | undefined;
1556
1625
  api_key_env_var?: string | undefined;
1626
+ timeout_ms?: number | undefined;
1557
1627
  headers?: Record<string, string> | undefined;
1558
1628
  enabled?: boolean | undefined;
1559
1629
  }[];
@@ -1592,6 +1662,7 @@ declare const appConfigSchema: z.ZodObject<{
1592
1662
  provider: string;
1593
1663
  base_url?: string | undefined;
1594
1664
  api_key_env_var?: string | undefined;
1665
+ required?: boolean | undefined;
1595
1666
  } | undefined;
1596
1667
  }, {
1597
1668
  name: string;
@@ -1599,12 +1670,12 @@ declare const appConfigSchema: z.ZodObject<{
1599
1670
  name: string;
1600
1671
  metadata?: Record<string, unknown> | undefined;
1601
1672
  type?: "native" | "process" | "cli" | undefined;
1673
+ timeout_ms?: number | undefined;
1602
1674
  command?: string | undefined;
1603
1675
  args?: string[] | undefined;
1604
1676
  cwd?: string | undefined;
1605
1677
  env?: Record<string, string> | undefined;
1606
1678
  input_mode?: "protocol" | "stdin" | "arg" | undefined;
1607
- timeout_ms?: number | undefined;
1608
1679
  inherit_env?: boolean | undefined;
1609
1680
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1610
1681
  env_allowlist?: string[] | undefined;
@@ -1618,6 +1689,7 @@ declare const appConfigSchema: z.ZodObject<{
1618
1689
  base_url: string;
1619
1690
  metadata?: Record<string, unknown> | undefined;
1620
1691
  api_key_env_var?: string | undefined;
1692
+ timeout_ms?: number | undefined;
1621
1693
  headers?: Record<string, string> | undefined;
1622
1694
  enabled?: boolean | undefined;
1623
1695
  }[] | undefined;
@@ -1656,6 +1728,7 @@ declare const appConfigSchema: z.ZodObject<{
1656
1728
  base_url?: string | undefined;
1657
1729
  api_key_env_var?: string | undefined;
1658
1730
  provider?: string | undefined;
1731
+ required?: boolean | undefined;
1659
1732
  } | undefined;
1660
1733
  }>;
1661
1734
  logging: z.ZodOptional<z.ZodObject<{
@@ -1673,11 +1746,11 @@ declare const appConfigSchema: z.ZodObject<{
1673
1746
  type: "native" | "process" | "cli";
1674
1747
  input_mode: "protocol" | "stdin" | "arg";
1675
1748
  metadata?: Record<string, unknown> | undefined;
1749
+ timeout_ms?: number | undefined;
1676
1750
  command?: string | undefined;
1677
1751
  args?: string[] | undefined;
1678
1752
  cwd?: string | undefined;
1679
1753
  env?: Record<string, string> | undefined;
1680
- timeout_ms?: number | undefined;
1681
1754
  inherit_env?: boolean | undefined;
1682
1755
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1683
1756
  env_allowlist?: string[] | undefined;
@@ -1691,6 +1764,7 @@ declare const appConfigSchema: z.ZodObject<{
1691
1764
  base_url: string;
1692
1765
  metadata?: Record<string, unknown> | undefined;
1693
1766
  api_key_env_var?: string | undefined;
1767
+ timeout_ms?: number | undefined;
1694
1768
  headers?: Record<string, string> | undefined;
1695
1769
  enabled?: boolean | undefined;
1696
1770
  }[];
@@ -1729,6 +1803,7 @@ declare const appConfigSchema: z.ZodObject<{
1729
1803
  provider: string;
1730
1804
  base_url?: string | undefined;
1731
1805
  api_key_env_var?: string | undefined;
1806
+ required?: boolean | undefined;
1732
1807
  } | undefined;
1733
1808
  };
1734
1809
  logging?: {
@@ -1741,12 +1816,12 @@ declare const appConfigSchema: z.ZodObject<{
1741
1816
  name: string;
1742
1817
  metadata?: Record<string, unknown> | undefined;
1743
1818
  type?: "native" | "process" | "cli" | undefined;
1819
+ timeout_ms?: number | undefined;
1744
1820
  command?: string | undefined;
1745
1821
  args?: string[] | undefined;
1746
1822
  cwd?: string | undefined;
1747
1823
  env?: Record<string, string> | undefined;
1748
1824
  input_mode?: "protocol" | "stdin" | "arg" | undefined;
1749
- timeout_ms?: number | undefined;
1750
1825
  inherit_env?: boolean | undefined;
1751
1826
  env_policy?: "inherit" | "allowlist" | "denylist" | "explicit" | undefined;
1752
1827
  env_allowlist?: string[] | undefined;
@@ -1760,6 +1835,7 @@ declare const appConfigSchema: z.ZodObject<{
1760
1835
  base_url: string;
1761
1836
  metadata?: Record<string, unknown> | undefined;
1762
1837
  api_key_env_var?: string | undefined;
1838
+ timeout_ms?: number | undefined;
1763
1839
  headers?: Record<string, string> | undefined;
1764
1840
  enabled?: boolean | undefined;
1765
1841
  }[] | undefined;
@@ -1798,6 +1874,7 @@ declare const appConfigSchema: z.ZodObject<{
1798
1874
  base_url?: string | undefined;
1799
1875
  api_key_env_var?: string | undefined;
1800
1876
  provider?: string | undefined;
1877
+ required?: boolean | undefined;
1801
1878
  } | undefined;
1802
1879
  };
1803
1880
  logging?: {
@@ -1829,6 +1906,7 @@ interface AppConfig {
1829
1906
  provider: string;
1830
1907
  baseUrl?: string;
1831
1908
  apiKeyEnvVar?: string;
1909
+ required?: boolean;
1832
1910
  };
1833
1911
  };
1834
1912
  logging?: {
@@ -1923,12 +2001,19 @@ declare class OpenAICompatibleProvider implements IChatProvider {
1923
2001
  private discovered?;
1924
2002
  private readonly env;
1925
2003
  constructor(config: ProviderConfig, log?: Logger, env?: Record<string, string | undefined>);
2004
+ /** Provider-level request timeout (roadmap §6.6/§11) with the shared default. */
2005
+ private get requestTimeoutMs();
1926
2006
  /** Authenticate + discover (roadmap §10, Model Discovery). */
1927
2007
  connect(): Promise<ModelInfo[]>;
1928
2008
  getModel(modelId: string): Promise<ModelInfo | undefined>;
2009
+ /** Raw /models body (protected so adapters can capture gateway-level metadata). */
2010
+ protected rawModelsResponse(): Promise<unknown>;
2011
+ private modelsRequest;
1929
2012
  listModels(): Promise<ModelInfo[]>;
1930
2013
  /** Maps a raw model entry onto the normalized metadata shape (§10). */
1931
2014
  private toModelInfo;
2015
+ /** Streaming where the gateway supports it (§11). */
2016
+ stream(request: ChatRequest, onChunk: (chunk: ChatStreamChunk) => void): Promise<ChatResponse>;
1932
2017
  healthCheck(): Promise<ProviderStatus>;
1933
2018
  chat(request: ChatRequest): Promise<ChatResponse>;
1934
2019
  }
@@ -1971,10 +2056,18 @@ interface OmniHilbrasConnectionResult {
1971
2056
  registered: number;
1972
2057
  }
1973
2058
  declare class OmniHilbrasProvider extends OpenAICompatibleProvider {
2059
+ private gateway?;
2060
+ listModels(): Promise<ModelInfo[]>;
1974
2061
  /**
1975
2062
  * Run the full connect flow. Throws on authentication or transport failure
1976
2063
  * (use healthCheck() for a non-throwing probe).
1977
2064
  */
2065
+ /**
2066
+ * Gateway metadata reported alongside the model list (gateway version, tier,
2067
+ * region…), kept separate from per-model metadata (§11 — provider metadata).
2068
+ */
2069
+ gatewayMetadata(): Record<string, unknown> | undefined;
2070
+ protected extractGatewayMetadata(body: unknown): Promise<void>;
1978
2071
  connectAndRegister(registry?: ModelRegistry): Promise<OmniHilbrasConnectionResult>;
1979
2072
  }
1980
2073
 
@@ -2277,8 +2370,17 @@ declare function keywords(text: string): Set<string>;
2277
2370
  declare class LocalMemoryProvider extends JsonFileStore<MemoryEntry> implements IMemoryProvider {
2278
2371
  readonly name = "local";
2279
2372
  constructor(directory?: string);
2373
+ metadata(): MemoryProviderMetadata;
2374
+ search(text: string, options?: {
2375
+ limit?: number;
2376
+ scope?: MemoryQuery["scope"];
2377
+ }): Promise<MemoryEntry[]>;
2378
+ /** @deprecated v1 alias of {@link retrieve}. */
2280
2379
  query(query: MemoryQuery): Promise<MemoryEntry[]>;
2380
+ /** @deprecated v1 alias of {@link store}. */
2281
2381
  write(entry: MemoryEntry): Promise<void>;
2382
+ retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
2383
+ store(entry: MemoryEntry): Promise<void>;
2282
2384
  count(): Promise<number>;
2283
2385
  }
2284
2386
 
@@ -2294,9 +2396,20 @@ declare class RememberaMemoryProvider implements IMemoryProvider {
2294
2396
  private readonly env;
2295
2397
  private readonly log;
2296
2398
  constructor(config: RememberaConfig, log?: Logger);
2399
+ private get authenticationConfigured();
2297
2400
  private headers;
2401
+ /** Search delegates to the gateway's relevance query. */
2402
+ search(text: string, options?: {
2403
+ limit?: number;
2404
+ scope?: MemoryQuery["scope"];
2405
+ }): Promise<MemoryEntry[]>;
2406
+ metadata(): MemoryProviderMetadata;
2407
+ /** @deprecated v1 alias of {@link retrieve}. */
2298
2408
  query(query: MemoryQuery): Promise<MemoryEntry[]>;
2409
+ /** @deprecated v1 alias of {@link store}. */
2299
2410
  write(entry: MemoryEntry): Promise<void>;
2411
+ retrieve(query: MemoryQuery): Promise<MemoryEntry[]>;
2412
+ store(entry: MemoryEntry): Promise<void>;
2300
2413
  private request;
2301
2414
  private toEntry;
2302
2415
  }
@@ -2304,31 +2417,66 @@ declare class RememberaMemoryProvider implements IMemoryProvider {
2304
2417
  type MemoryProviderConfig = NonNullable<AppConfig["project"]["memory"]>;
2305
2418
  declare function createMemoryProvider(config?: MemoryProviderConfig): IMemoryProvider;
2306
2419
 
2307
- /**
2308
- * Memory service (§19–§20): gathers relevant memory before a task runs and
2309
- * records outcomes afterwards — the Task → memory → relevant context →
2310
- * agents → reports → memory loop. Memory failures are best-effort: they log
2311
- * a warning and never fail a task, because memory is an enhancement, not a
2312
- * dependency (§2).
2313
- */
2314
-
2315
2420
  interface MemoryContextQuery {
2316
2421
  objective: string;
2317
2422
  role?: string;
2318
2423
  project?: string;
2424
+ /** Maximum entries to consider (relevance-ranked by the provider). */
2425
+ limit?: number;
2426
+ }
2427
+ interface MemoryTaskContext {
2428
+ /** Prompt-ready context text ("" when nothing relevant was found). */
2429
+ text: string;
2430
+ entries: MemoryEntry[];
2431
+ /** True when the character budget cut the context short. */
2432
+ truncated: boolean;
2433
+ }
2434
+ declare const MAX_CONTEXT_CHARS = 4000;
2435
+ interface MemoryServiceOptions {
2436
+ /** When true, backend failures propagate instead of being logged. */
2437
+ required?: boolean;
2438
+ maxContextChars?: number;
2319
2439
  }
2320
2440
  declare class MemoryService {
2321
2441
  private readonly provider;
2322
2442
  private readonly log;
2323
- constructor(provider: IMemoryProvider, log?: Logger);
2443
+ private readonly required;
2444
+ private readonly maxContextChars;
2445
+ constructor(provider: IMemoryProvider, log?: Logger, options?: MemoryServiceOptions);
2324
2446
  get providerRef(): IMemoryProvider;
2325
2447
  get providerName(): string;
2326
- /** Relevant context for a task objective; empty string when nothing matches. */
2448
+ get isRequired(): boolean;
2449
+ /** Structured, budgeted context for a task (§12 — avoid loading all memory). */
2450
+ contextFor(query: MemoryContextQuery): Promise<MemoryTaskContext>;
2451
+ /** Prompt-ready context text (v1 convenience wrapper). */
2327
2452
  gatherContext(query: MemoryContextQuery): Promise<string>;
2328
- /** Records a finished task's outcome — best-effort. */
2453
+ /** Records a finished task's outcome — task history plus "known problems" (§12). */
2329
2454
  recordTaskOutcome(task: Task): Promise<void>;
2455
+ private format;
2456
+ /**
2457
+ * Failure policy (§12): continue unless memory is explicitly required.
2458
+ */
2459
+ private handleFailure;
2330
2460
  }
2331
2461
 
2462
+ /**
2463
+ * Shared memory-contract helpers (roadmap §12). Adapters implement
2464
+ * `retrieve` / `store`; these helpers supply the defaults for `search`,
2465
+ * `metadata` and the v1 `query` / `write` aliases, so the contract is
2466
+ * defined once.
2467
+ */
2468
+
2469
+ /** Free-text search defaults to a relevance retrieve. */
2470
+ declare function defaultSearch(provider: Pick<IMemoryProvider, "retrieve">, text: string, options?: {
2471
+ limit?: number;
2472
+ scope?: MemoryQuery["scope"];
2473
+ }): Promise<MemoryEntry[]>;
2474
+ declare function defaultMetadata(name: string, options?: {
2475
+ capabilities?: MemoryProviderMetadata["capabilities"];
2476
+ relevanceRanking?: boolean;
2477
+ backend?: Record<string, unknown>;
2478
+ }): MemoryProviderMetadata;
2479
+
2332
2480
  interface CreateTaskInput {
2333
2481
  objective: string;
2334
2482
  project?: string;
@@ -2645,6 +2793,6 @@ declare class ProjectStores {
2645
2793
  constructor(directory?: string);
2646
2794
  }
2647
2795
 
2648
- declare const OMNINODE_VERSION = "2.0.0-alpha.6";
2796
+ declare const OMNINODE_VERSION = "2.0.0-alpha.8";
2649
2797
 
2650
- 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 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 };
2798
+ 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_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 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, defaultMetadata, defaultProjectConfigYaml, defaultSearch, 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 };