@framers/agentos 0.1.69 → 0.1.70

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.
Files changed (128) hide show
  1. package/dist/api/agent.d.ts +98 -2
  2. package/dist/api/agent.d.ts.map +1 -1
  3. package/dist/api/agent.js +64 -9
  4. package/dist/api/agent.js.map +1 -1
  5. package/dist/api/generateImage.d.ts +109 -0
  6. package/dist/api/generateImage.d.ts.map +1 -0
  7. package/dist/api/generateImage.js +41 -0
  8. package/dist/api/generateImage.js.map +1 -0
  9. package/dist/api/generateText.d.ts +73 -3
  10. package/dist/api/generateText.d.ts.map +1 -1
  11. package/dist/api/generateText.js +29 -4
  12. package/dist/api/generateText.js.map +1 -1
  13. package/dist/api/model.d.ts +74 -4
  14. package/dist/api/model.d.ts.map +1 -1
  15. package/dist/api/model.js +79 -5
  16. package/dist/api/model.js.map +1 -1
  17. package/dist/api/streamText.d.ts +37 -1
  18. package/dist/api/streamText.d.ts.map +1 -1
  19. package/dist/api/streamText.js +188 -49
  20. package/dist/api/streamText.js.map +1 -1
  21. package/dist/api/toolAdapter.d.ts +58 -0
  22. package/dist/api/toolAdapter.d.ts.map +1 -0
  23. package/dist/api/{tool-adapter.js → toolAdapter.js} +24 -2
  24. package/dist/api/toolAdapter.js.map +1 -0
  25. package/dist/index.d.ts +5 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +5 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/orchestration/builders/AgentGraph.d.ts +250 -0
  30. package/dist/orchestration/builders/AgentGraph.d.ts.map +1 -0
  31. package/dist/orchestration/builders/AgentGraph.js +338 -0
  32. package/dist/orchestration/builders/AgentGraph.js.map +1 -0
  33. package/dist/orchestration/builders/MissionBuilder.d.ts +231 -0
  34. package/dist/orchestration/builders/MissionBuilder.d.ts.map +1 -0
  35. package/dist/orchestration/builders/MissionBuilder.js +321 -0
  36. package/dist/orchestration/builders/MissionBuilder.js.map +1 -0
  37. package/dist/orchestration/builders/WorkflowBuilder.d.ts +265 -0
  38. package/dist/orchestration/builders/WorkflowBuilder.d.ts.map +1 -0
  39. package/dist/orchestration/builders/WorkflowBuilder.js +472 -0
  40. package/dist/orchestration/builders/WorkflowBuilder.js.map +1 -0
  41. package/dist/orchestration/builders/index.d.ts +7 -0
  42. package/dist/orchestration/builders/index.d.ts.map +1 -0
  43. package/dist/orchestration/builders/index.js +5 -0
  44. package/dist/orchestration/builders/index.js.map +1 -0
  45. package/dist/orchestration/builders/nodes.d.ts +36 -0
  46. package/dist/orchestration/builders/nodes.d.ts.map +1 -0
  47. package/dist/orchestration/builders/nodes.js +98 -0
  48. package/dist/orchestration/builders/nodes.js.map +1 -0
  49. package/dist/orchestration/checkpoint/ICheckpointStore.d.ts +152 -0
  50. package/dist/orchestration/checkpoint/ICheckpointStore.d.ts.map +1 -0
  51. package/dist/orchestration/checkpoint/ICheckpointStore.js +8 -0
  52. package/dist/orchestration/checkpoint/ICheckpointStore.js.map +1 -0
  53. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts +89 -0
  54. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts.map +1 -0
  55. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js +156 -0
  56. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js.map +1 -0
  57. package/dist/orchestration/checkpoint/index.d.ts +10 -0
  58. package/dist/orchestration/checkpoint/index.d.ts.map +1 -0
  59. package/dist/orchestration/checkpoint/index.js +10 -0
  60. package/dist/orchestration/checkpoint/index.js.map +1 -0
  61. package/dist/orchestration/compiler/GraphCompiler.d.ts +85 -0
  62. package/dist/orchestration/compiler/GraphCompiler.d.ts.map +1 -0
  63. package/dist/orchestration/compiler/GraphCompiler.js +71 -0
  64. package/dist/orchestration/compiler/GraphCompiler.js.map +1 -0
  65. package/dist/orchestration/compiler/MissionCompiler.d.ts +181 -0
  66. package/dist/orchestration/compiler/MissionCompiler.d.ts.map +1 -0
  67. package/dist/orchestration/compiler/MissionCompiler.js +219 -0
  68. package/dist/orchestration/compiler/MissionCompiler.js.map +1 -0
  69. package/dist/orchestration/compiler/SchemaLowering.d.ts +37 -0
  70. package/dist/orchestration/compiler/SchemaLowering.d.ts.map +1 -0
  71. package/dist/orchestration/compiler/SchemaLowering.js +95 -0
  72. package/dist/orchestration/compiler/SchemaLowering.js.map +1 -0
  73. package/dist/orchestration/compiler/Validator.d.ts +61 -0
  74. package/dist/orchestration/compiler/Validator.d.ts.map +1 -0
  75. package/dist/orchestration/compiler/Validator.js +96 -0
  76. package/dist/orchestration/compiler/Validator.js.map +1 -0
  77. package/dist/orchestration/compiler/index.d.ts +16 -0
  78. package/dist/orchestration/compiler/index.d.ts.map +1 -0
  79. package/dist/orchestration/compiler/index.js +13 -0
  80. package/dist/orchestration/compiler/index.js.map +1 -0
  81. package/dist/orchestration/events/GraphEvent.d.ts +233 -0
  82. package/dist/orchestration/events/GraphEvent.d.ts.map +1 -0
  83. package/dist/orchestration/events/GraphEvent.js +203 -0
  84. package/dist/orchestration/events/GraphEvent.js.map +1 -0
  85. package/dist/orchestration/events/index.d.ts +2 -0
  86. package/dist/orchestration/events/index.d.ts.map +1 -0
  87. package/dist/orchestration/events/index.js +2 -0
  88. package/dist/orchestration/events/index.js.map +1 -0
  89. package/dist/orchestration/index.d.ts +20 -0
  90. package/dist/orchestration/index.d.ts.map +1 -0
  91. package/dist/orchestration/index.js +26 -0
  92. package/dist/orchestration/index.js.map +1 -0
  93. package/dist/orchestration/ir/index.d.ts +2 -0
  94. package/dist/orchestration/ir/index.d.ts.map +1 -0
  95. package/dist/orchestration/ir/index.js +2 -0
  96. package/dist/orchestration/ir/index.js.map +1 -0
  97. package/dist/orchestration/ir/types.d.ts +540 -0
  98. package/dist/orchestration/ir/types.d.ts.map +1 -0
  99. package/dist/orchestration/ir/types.js +20 -0
  100. package/dist/orchestration/ir/types.js.map +1 -0
  101. package/dist/orchestration/runtime/GraphRuntime.d.ts +135 -0
  102. package/dist/orchestration/runtime/GraphRuntime.d.ts.map +1 -0
  103. package/dist/orchestration/runtime/GraphRuntime.js +381 -0
  104. package/dist/orchestration/runtime/GraphRuntime.js.map +1 -0
  105. package/dist/orchestration/runtime/LoopController.d.ts +173 -0
  106. package/dist/orchestration/runtime/LoopController.d.ts.map +1 -0
  107. package/dist/orchestration/runtime/LoopController.js +130 -0
  108. package/dist/orchestration/runtime/LoopController.js.map +1 -0
  109. package/dist/orchestration/runtime/NodeExecutor.d.ts +206 -0
  110. package/dist/orchestration/runtime/NodeExecutor.d.ts.map +1 -0
  111. package/dist/orchestration/runtime/NodeExecutor.js +227 -0
  112. package/dist/orchestration/runtime/NodeExecutor.js.map +1 -0
  113. package/dist/orchestration/runtime/NodeScheduler.d.ts +85 -0
  114. package/dist/orchestration/runtime/NodeScheduler.d.ts.map +1 -0
  115. package/dist/orchestration/runtime/NodeScheduler.js +180 -0
  116. package/dist/orchestration/runtime/NodeScheduler.js.map +1 -0
  117. package/dist/orchestration/runtime/StateManager.d.ts +122 -0
  118. package/dist/orchestration/runtime/StateManager.d.ts.map +1 -0
  119. package/dist/orchestration/runtime/StateManager.js +243 -0
  120. package/dist/orchestration/runtime/StateManager.js.map +1 -0
  121. package/dist/orchestration/runtime/index.d.ts +16 -0
  122. package/dist/orchestration/runtime/index.d.ts.map +1 -0
  123. package/dist/orchestration/runtime/index.js +13 -0
  124. package/dist/orchestration/runtime/index.js.map +1 -0
  125. package/package.json +10 -4
  126. package/dist/api/tool-adapter.d.ts +0 -12
  127. package/dist/api/tool-adapter.d.ts.map +0 -1
  128. package/dist/api/tool-adapter.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolAdapter.d.ts","sourceRoot":"","sources":["../../src/api/toolAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,KAAK,EAA+D,MAAM,wBAAwB,CAAC;AAEjH;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACvC;AAED,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,KAAK,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,KAAK,EAAE,CAiDxE"}
@@ -1,5 +1,26 @@
1
1
  /**
2
- * Adapts Zod schemas, JSON Schema objects, and ITool instances into ITool[].
2
+ * Converts a {@link ToolDefinitionMap} into an array of {@link ITool} instances
3
+ * suitable for use with the AgentOS provider layer.
4
+ *
5
+ * - Existing {@link ITool} instances (identified by `inputSchema` + `id` properties)
6
+ * are passed through unchanged.
7
+ * - Plain {@link ToolDefinition} objects are wrapped in a minimal {@link ITool}
8
+ * implementation. Zod schemas are converted to JSON Schema when `zod-to-json-schema`
9
+ * is available.
10
+ *
11
+ * @param tools - Optional map of tool names to definitions. Returns `[]` when falsy.
12
+ * @returns Flat array of normalised {@link ITool} instances ready for provider dispatch.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const tools = adaptTools({
17
+ * getWeather: {
18
+ * description: 'Returns current weather for a city.',
19
+ * parameters: { type: 'object', properties: { city: { type: 'string' } }, required: ['city'] },
20
+ * execute: async ({ city }) => fetchWeather(city),
21
+ * },
22
+ * });
23
+ * ```
3
24
  */
4
25
  export function adaptTools(tools) {
5
26
  if (!tools)
@@ -16,6 +37,7 @@ export function adaptTools(tools) {
16
37
  if (td.parameters && '_def' in td.parameters) {
17
38
  // Zod schema — convert to JSON Schema
18
39
  try {
40
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
19
41
  const { zodToJsonSchema } = require('zod-to-json-schema');
20
42
  schema = zodToJsonSchema(td.parameters);
21
43
  }
@@ -48,4 +70,4 @@ export function adaptTools(tools) {
48
70
  }
49
71
  return result;
50
72
  }
51
- //# sourceMappingURL=tool-adapter.js.map
73
+ //# sourceMappingURL=toolAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolAdapter.js","sourceRoot":"","sources":["../../src/api/toolAdapter.ts"],"names":[],"mappings":"AAmCA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,UAAU,CAAC,KAAoC;IAC7D,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChD,oEAAoE;QACpE,IAAI,aAAa,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,GAAY,CAAC,CAAC;YAC1B,SAAS;QACX,CAAC;QAED,MAAM,EAAE,GAAG,GAAqB,CAAC;QACjC,IAAI,MAAwB,CAAC;QAE7B,IAAI,EAAE,CAAC,UAAU,IAAI,MAAM,IAAK,EAAE,CAAC,UAAkB,EAAE,CAAC;YACtD,sCAAsC;YACtC,IAAI,CAAC;gBACH,iEAAiE;gBACjE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAQ,CAAC;gBACjE,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC,UAAU,CAAqB,CAAC;YAC9D,CAAC;YAAC,MAAM,CAAC;gBACP,0DAA0D;gBAC1D,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;YAC9C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAC,EAAE,CAAC,UAAU,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,CAAqB,CAAC;QACrF,CAAC;QAED,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAElE,MAAM,CAAC,IAAI,CAAC;YACV,EAAE,EAAE,GAAG,IAAI,KAAK;YAChB,IAAI;YACJ,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE;YACvF,WAAW,EAAE,EAAE,CAAC,WAAW,IAAI,EAAE;YACjC,WAAW,EAAE,MAAM;YACnB,cAAc,EAAE,KAAK;YACrB,KAAK,CAAC,OAAO,CAAC,IAAS,EAAE,IAA0B;gBACjD,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;oBACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gBACnC,CAAC;gBAAC,OAAO,GAAQ,EAAE,CAAC;oBAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChE,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -59,6 +59,7 @@ export * from './types/rateLimitTypes';
59
59
  export * from './core/storage';
60
60
  export * from './rag';
61
61
  export * from './memory';
62
+ export * from './orchestration/index.js';
62
63
  export * from './core/provenance';
63
64
  export * from './core/safety';
64
65
  export { EXTENSION_SECRET_DEFINITIONS, type ExtensionSecretDefinition, getSecretDefinition, resolveSecretForProvider, } from './config/extensionSecrets.js';
@@ -68,7 +69,9 @@ export { streamText } from './api/streamText.js';
68
69
  export type { StreamTextResult, StreamPart } from './api/streamText.js';
69
70
  export { agent } from './api/agent.js';
70
71
  export type { Agent, AgentSession, AgentOptions } from './api/agent.js';
72
+ export { generateImage } from './api/generateImage.js';
73
+ export type { GenerateImageOptions, GenerateImageResult } from './api/generateImage.js';
71
74
  export { parseModelString, resolveProvider } from './api/model.js';
72
- export { adaptTools } from './api/tool-adapter.js';
73
- export type { ToolDefinitionMap } from './api/tool-adapter.js';
75
+ export { adaptTools } from './api/toolAdapter.js';
76
+ export type { ToolDefinitionMap } from './api/toolAdapter.js';
74
77
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,YAAY,EAAE,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7G,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kCAAkC,CAAC;AACjD,cAAc,mDAAmD,CAAC;AAClE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,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}
package/dist/index.js CHANGED
@@ -61,6 +61,7 @@ export * from './channels/index.js';
61
61
  export * from './voice/index.js';
62
62
  // Unified speech runtime (STT/TTS/VAD/wake-word)
63
63
  export * from './speech/index.js';
64
+ // TODO: export * from './core/images' — module not yet implemented
64
65
  // Skills (SKILL.md prompt modules)
65
66
  export * from './skills.js';
66
67
  // Multilingual exports
@@ -75,6 +76,8 @@ export * from './core/storage/index.js';
75
76
  export * from './rag/index.js';
76
77
  // Cognitive Memory System
77
78
  export * from './memory/index.js';
79
+ // Orchestration Layer (IR, Events, Checkpoint, Runtime)
80
+ export * from './orchestration/index.js';
78
81
  // Provenance, Audit & Immutability
79
82
  export * from './core/provenance/index.js';
80
83
  // Safety Primitives (circuit breaker, dedup, cost guard, stuck detection)
@@ -85,6 +88,7 @@ export { EXTENSION_SECRET_DEFINITIONS, getSecretDefinition, resolveSecretForProv
85
88
  export { generateText } from './api/generateText.js';
86
89
  export { streamText } from './api/streamText.js';
87
90
  export { agent } from './api/agent.js';
91
+ export { generateImage } from './api/generateImage.js';
88
92
  export { parseModelString, resolveProvider } from './api/model.js';
89
- export { adaptTools } from './api/tool-adapter.js';
93
+ export { adaptTools } from './api/toolAdapter.js';
90
94
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAA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AC;AAC3C,cAAc,iCAAiC,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,mBAAmB;AACnB,cAAc,wBAAwB,CAAC;AACvC,mBAAmB;AACnB,cAAc,gBAAgB,CAAC;AAC/B,uCAAuC;AACvC,cAAc,OAAO,CAAC;AACtB,0BAA0B;AAC1B,cAAc,UAAU,CAAC;AACzB,wDAAwD;AACxD,cAAc,0BAA0B,CAAC;AACzC,mCAAmC;AACnC,cAAc,mBAAmB,CAAC;AAClC,0EAA0E;AAC1E,cAAc,eAAe,CAAC;AAC9B,4BAA4B;AAC5B,OAAO,EACL,4BAA4B,EAE5B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AAEtC,wCAAwC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,250 @@
1
+ /**
2
+ * @file AgentGraph.ts
3
+ * @description Fluent builder for constructing compiled agent execution graphs.
4
+ *
5
+ * `AgentGraph` provides a type-safe, chainable API for declaring nodes and edges —
6
+ * including static, conditional, discovery-based, and personality-driven routing —
7
+ * and then compiling the resulting graph into a `CompiledExecutionGraph` IR object
8
+ * that the `GraphRuntime` can execute.
9
+ *
10
+ * ```
11
+ * AgentGraph (builder)
12
+ * → GraphCompiler.compile() → CompiledExecutionGraph (IR)
13
+ * → GraphValidator.validate() → validation gate
14
+ * → CompiledAgentGraph → GraphRuntime.invoke() / stream() / resume()
15
+ * ```
16
+ *
17
+ * Typical usage:
18
+ * ```ts
19
+ * const graph = new AgentGraph({ input: z.object({ topic: z.string() }), ... })
20
+ * .addNode('search', toolNode('web_search'))
21
+ * .addEdge(START, 'search')
22
+ * .addEdge('search', END)
23
+ * .compile();
24
+ *
25
+ * const result = await graph.invoke({ topic: 'AgentOS' });
26
+ * ```
27
+ */
28
+ import type { GraphNode, GraphState, CompiledExecutionGraph, StateReducers, MemoryConsistencyMode } from '../ir/types.js';
29
+ import { START, END } from '../ir/types.js';
30
+ import type { ICheckpointStore } from '../checkpoint/ICheckpointStore.js';
31
+ import type { GraphEvent } from '../events/GraphEvent.js';
32
+ export { START, END };
33
+ /**
34
+ * Fluent builder for agent execution graphs.
35
+ *
36
+ * Each mutating method returns `this` to support method chaining. All state is held
37
+ * in private Maps/arrays; nothing is compiled or validated until `.compile()` is called.
38
+ *
39
+ * @template TState - Narrows the `GraphState` type used in conditional-edge callbacks.
40
+ * Defaults to the base `GraphState` when not specified.
41
+ */
42
+ export declare class AgentGraph<TState extends GraphState = GraphState> {
43
+ private readonly stateSchema;
44
+ private readonly config?;
45
+ /** All user-declared nodes, keyed by their assigned id. */
46
+ private nodes;
47
+ /** All directed edges declared via `addEdge`, `addConditionalEdge`, etc. */
48
+ private edges;
49
+ /** Monotonically increasing counter used to generate unique edge ids. */
50
+ private edgeCounter;
51
+ /**
52
+ * @param stateSchema - Zod schemas for the three `GraphState` generic partitions.
53
+ * - `input` — shape of the frozen user-provided input passed to `invoke()`.
54
+ * - `scratch` — shape of the mutable node-to-node communication bag.
55
+ * - `artifacts` — shape of the accumulated external outputs returned by `invoke()`.
56
+ * @param config - Optional graph-wide configuration overrides.
57
+ */
58
+ constructor(stateSchema: {
59
+ /** Zod schema for `GraphState.input`. */
60
+ input: any;
61
+ /** Zod schema for `GraphState.scratch`. */
62
+ scratch: any;
63
+ /** Zod schema for `GraphState.artifacts`. */
64
+ artifacts: any;
65
+ }, config?: {
66
+ /** Field-level merge strategies for `scratch` and `artifacts` fields. */
67
+ reducers?: StateReducers;
68
+ /** Graph-wide memory consistency mode (default: `'snapshot'`). */
69
+ memoryConsistency?: MemoryConsistencyMode;
70
+ /** Graph-wide checkpoint persistence strategy (default: `'none'`). */
71
+ checkpointPolicy?: "every_node" | "explicit" | "none";
72
+ } | undefined);
73
+ /**
74
+ * Add a node to the graph.
75
+ *
76
+ * The node's `id` field is overridden with the supplied `id` argument so the
77
+ * user-declared identifier is always canonical.
78
+ *
79
+ * @param id - Unique node identifier within this graph. Must not equal `START` or `END`.
80
+ * @param node - A `GraphNode` produced by one of the factory helpers in `builders/nodes.ts`.
81
+ * @returns `this` for chaining.
82
+ * @throws {Error} When `id` has already been registered.
83
+ */
84
+ addNode(id: string, node: GraphNode): this;
85
+ /**
86
+ * Add an unconditional (static) edge that is always followed at runtime.
87
+ *
88
+ * Either `source` or `target` (or both) may be the `START` / `END` sentinels.
89
+ *
90
+ * @param source - Source node id (or `START`).
91
+ * @param target - Target node id (or `END`).
92
+ * @returns `this` for chaining.
93
+ */
94
+ addEdge(source: string, target: string): this;
95
+ /**
96
+ * Add a conditional edge whose target is determined at runtime by a callback.
97
+ *
98
+ * The `condition` function receives the current `GraphState` and returns the id of
99
+ * the next node to activate. The returned id is resolved against the edge list at
100
+ * runtime; no compile-time validation of the returned id is performed.
101
+ *
102
+ * Because conditional edges encode the target resolution in a closure, the `target`
103
+ * field stored in the IR is set to the placeholder `'__CONDITIONAL__'`.
104
+ *
105
+ * @param source - Source node id (or `START`).
106
+ * @param condition - Pure function `(state: TState) => string` returning the next node id.
107
+ * @returns `this` for chaining.
108
+ */
109
+ addConditionalEdge(source: string, condition: (state: TState) => string): this;
110
+ /**
111
+ * Add a discovery edge whose target is resolved at runtime via the capability discovery engine.
112
+ *
113
+ * When discovery returns no result, execution falls back to `config.fallbackTarget` (if provided)
114
+ * or the placeholder `'__DISCOVERY__'`.
115
+ *
116
+ * @param source - Source node id.
117
+ * @param config - Discovery configuration.
118
+ * @param config.query - Semantic search query forwarded to `CapabilityDiscoveryEngine`.
119
+ * @param config.kind - Optional filter: restrict discovery to a specific capability kind.
120
+ * @param config.fallbackTarget - Node id to route to when discovery resolves no target.
121
+ * @returns `this` for chaining.
122
+ */
123
+ addDiscoveryEdge(source: string, config: {
124
+ /** Semantic query forwarded to the capability discovery engine. */
125
+ query: string;
126
+ /** Optional capability kind filter (`'tool'`, `'skill'`, `'extension'`, or `'any'`). */
127
+ kind?: 'tool' | 'skill' | 'extension' | 'any';
128
+ /** Fallback node id used when discovery resolves no target. */
129
+ fallbackTarget?: string;
130
+ }): this;
131
+ /**
132
+ * Add a personality edge whose target is chosen based on the agent's current trait value.
133
+ *
134
+ * At runtime the engine reads `config.trait` from the agent's HEXACO/PAD state and routes
135
+ * to `config.above` when the value is ≥ `config.threshold`, or `config.below` otherwise.
136
+ *
137
+ * @param source - Source node id.
138
+ * @param config - Personality routing configuration.
139
+ * @param config.trait - HEXACO/PAD trait name to inspect (e.g. `'conscientiousness'`).
140
+ * @param config.threshold - Decision boundary (0–1).
141
+ * @param config.above - Target node id when trait value ≥ threshold.
142
+ * @param config.below - Target node id when trait value < threshold.
143
+ * @returns `this` for chaining.
144
+ */
145
+ addPersonalityEdge(source: string, config: {
146
+ /** HEXACO/PAD trait name, e.g. `'conscientiousness'` or `'openness'`. */
147
+ trait: string;
148
+ /** Decision threshold in range 0–1. */
149
+ threshold: number;
150
+ /** Target node id when the trait value is at or above the threshold. */
151
+ above: string;
152
+ /** Target node id when the trait value is below the threshold. */
153
+ below: string;
154
+ }): this;
155
+ /**
156
+ * Compile the builder state into a `CompiledAgentGraph` ready for execution.
157
+ *
158
+ * Compilation steps:
159
+ * 1. Call `GraphCompiler.compile()` to produce the raw `CompiledExecutionGraph` IR.
160
+ * 2. (Optional, default: enabled) Call `GraphValidator.validate()` to assert structural
161
+ * correctness — any validation error or warning causes an exception.
162
+ * 3. Wrap the IR and a checkpoint store in a `CompiledAgentGraph` instance.
163
+ *
164
+ * Pass `{ validate: false }` to skip validation (e.g. for cyclic graphs under construction).
165
+ *
166
+ * @param options - Optional compilation flags.
167
+ * @param options.checkpointStore - Custom checkpoint store; defaults to `InMemoryCheckpointStore`.
168
+ * @param options.validate - Set to `false` to skip structural validation (default: `true`).
169
+ * @returns A `CompiledAgentGraph` instance ready for `invoke()` / `stream()` / `resume()`.
170
+ * @throws {Error} When validation is enabled and the graph contains structural errors or warnings.
171
+ */
172
+ compile(options?: {
173
+ /** Custom checkpoint persistence backend. Defaults to an in-memory store. */
174
+ checkpointStore?: ICheckpointStore;
175
+ /**
176
+ * Whether to run `GraphValidator.validate()` before returning.
177
+ * Defaults to `true`. Set to `false` for cyclic or incomplete graphs under construction.
178
+ */
179
+ validate?: boolean;
180
+ }): CompiledAgentGraph<TState>;
181
+ }
182
+ /**
183
+ * A compiled, execution-ready agent graph.
184
+ *
185
+ * Returned by `AgentGraph.compile()` — do not instantiate directly.
186
+ *
187
+ * Wraps a `CompiledExecutionGraph` IR object and a `GraphRuntime` instance, exposing
188
+ * the three execution modes: synchronous `invoke()`, streaming `stream()`, and
189
+ * checkpoint-based `resume()`.
190
+ *
191
+ * @template TState - Type parameter threaded from the parent `AgentGraph`.
192
+ */
193
+ export declare class CompiledAgentGraph<TState extends GraphState = GraphState> {
194
+ private readonly ir;
195
+ /** Internal `GraphRuntime` instance reused across all invocations. */
196
+ private readonly runtime;
197
+ /**
198
+ * @param ir - Compiled execution graph IR produced by `GraphCompiler`.
199
+ * @param checkpointStore - Persistence backend for checkpoint snapshots.
200
+ */
201
+ constructor(ir: CompiledExecutionGraph, checkpointStore: ICheckpointStore);
202
+ /**
203
+ * Execute the graph to completion and return the final `artifacts` payload.
204
+ *
205
+ * This is the simplest execution mode — it buffers all events internally and returns
206
+ * only the terminal output. Use `stream()` when you need real-time progress updates.
207
+ *
208
+ * @param input - Initial user-provided input frozen into `GraphState.input`.
209
+ * @returns The `GraphState.artifacts` value after the last node completes.
210
+ */
211
+ invoke(input: unknown): Promise<unknown>;
212
+ /**
213
+ * Execute the graph while yielding `GraphEvent` values at each significant step.
214
+ *
215
+ * Events are emitted in strict causal order:
216
+ * `run_start` → (`node_start` → `node_end` → `edge_transition`?)+ → `run_end`
217
+ *
218
+ * @param input - Initial user-provided input frozen into `GraphState.input`.
219
+ * @yields {GraphEvent} Runtime events in causal order.
220
+ */
221
+ stream(input: unknown): AsyncIterable<GraphEvent>;
222
+ /**
223
+ * Resume a previously interrupted run from its latest persisted checkpoint.
224
+ *
225
+ * The `patch` argument is accepted for API compatibility with future resume-with-patch
226
+ * support; it is not forwarded to the runtime in the current implementation.
227
+ *
228
+ * @param checkpointId - The run id returned by the original `stream()` call.
229
+ * @param patch - Reserved for future use: optional partial state override.
230
+ * @returns The final `GraphState.artifacts` value after resumption completes.
231
+ * @throws {Error} When no checkpoint exists for the given `checkpointId`.
232
+ */
233
+ resume(checkpointId: string, patch?: Partial<TState>): Promise<unknown>;
234
+ /**
235
+ * Inspect execution state for a completed or in-progress run.
236
+ *
237
+ * @param runId - The unique run identifier assigned at `stream()` call-time.
238
+ * @returns A stub object — full inspection support is tracked separately.
239
+ *
240
+ * @todo Implement with full runtime inspection once the run-registry subsystem lands.
241
+ */
242
+ inspect(_runId: string): Promise<unknown>;
243
+ /**
244
+ * Return the underlying `CompiledExecutionGraph` IR.
245
+ *
246
+ * Useful for serialisation, debugging, or forwarding to external tooling.
247
+ */
248
+ toIR(): CompiledExecutionGraph;
249
+ }
250
+ //# sourceMappingURL=AgentGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentGraph.d.ts","sourceRoot":"","sources":["../../../src/orchestration/builders/AgentGraph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EACV,SAAS,EAET,UAAU,EACV,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;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