@framers/agentos 0.1.69 → 0.1.71
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/api/agent.d.ts +98 -2
- package/dist/api/agent.d.ts.map +1 -1
- package/dist/api/agent.js +64 -9
- package/dist/api/agent.js.map +1 -1
- package/dist/api/generateImage.d.ts +109 -0
- package/dist/api/generateImage.d.ts.map +1 -0
- package/dist/api/generateImage.js +41 -0
- package/dist/api/generateImage.js.map +1 -0
- package/dist/api/generateText.d.ts +73 -3
- package/dist/api/generateText.d.ts.map +1 -1
- package/dist/api/generateText.js +29 -4
- package/dist/api/generateText.js.map +1 -1
- package/dist/api/model.d.ts +74 -4
- package/dist/api/model.d.ts.map +1 -1
- package/dist/api/model.js +79 -5
- package/dist/api/model.js.map +1 -1
- package/dist/api/streamText.d.ts +37 -1
- package/dist/api/streamText.d.ts.map +1 -1
- package/dist/api/streamText.js +188 -49
- package/dist/api/streamText.js.map +1 -1
- package/dist/api/toolAdapter.d.ts +58 -0
- package/dist/api/toolAdapter.d.ts.map +1 -0
- package/dist/api/{tool-adapter.js → toolAdapter.js} +24 -2
- package/dist/api/toolAdapter.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/orchestration/builders/AgentGraph.d.ts +250 -0
- package/dist/orchestration/builders/AgentGraph.d.ts.map +1 -0
- package/dist/orchestration/builders/AgentGraph.js +338 -0
- package/dist/orchestration/builders/AgentGraph.js.map +1 -0
- package/dist/orchestration/builders/MissionBuilder.d.ts +231 -0
- package/dist/orchestration/builders/MissionBuilder.d.ts.map +1 -0
- package/dist/orchestration/builders/MissionBuilder.js +321 -0
- package/dist/orchestration/builders/MissionBuilder.js.map +1 -0
- package/dist/orchestration/builders/WorkflowBuilder.d.ts +265 -0
- package/dist/orchestration/builders/WorkflowBuilder.d.ts.map +1 -0
- package/dist/orchestration/builders/WorkflowBuilder.js +472 -0
- package/dist/orchestration/builders/WorkflowBuilder.js.map +1 -0
- package/dist/orchestration/builders/index.d.ts +7 -0
- package/dist/orchestration/builders/index.d.ts.map +1 -0
- package/dist/orchestration/builders/index.js +5 -0
- package/dist/orchestration/builders/index.js.map +1 -0
- package/dist/orchestration/builders/nodes.d.ts +36 -0
- package/dist/orchestration/builders/nodes.d.ts.map +1 -0
- package/dist/orchestration/builders/nodes.js +98 -0
- package/dist/orchestration/builders/nodes.js.map +1 -0
- package/dist/orchestration/checkpoint/ICheckpointStore.d.ts +152 -0
- package/dist/orchestration/checkpoint/ICheckpointStore.d.ts.map +1 -0
- package/dist/orchestration/checkpoint/ICheckpointStore.js +8 -0
- package/dist/orchestration/checkpoint/ICheckpointStore.js.map +1 -0
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts +89 -0
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts.map +1 -0
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js +156 -0
- package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js.map +1 -0
- package/dist/orchestration/checkpoint/index.d.ts +10 -0
- package/dist/orchestration/checkpoint/index.d.ts.map +1 -0
- package/dist/orchestration/checkpoint/index.js +10 -0
- package/dist/orchestration/checkpoint/index.js.map +1 -0
- package/dist/orchestration/compiler/GraphCompiler.d.ts +85 -0
- package/dist/orchestration/compiler/GraphCompiler.d.ts.map +1 -0
- package/dist/orchestration/compiler/GraphCompiler.js +71 -0
- package/dist/orchestration/compiler/GraphCompiler.js.map +1 -0
- package/dist/orchestration/compiler/MissionCompiler.d.ts +181 -0
- package/dist/orchestration/compiler/MissionCompiler.d.ts.map +1 -0
- package/dist/orchestration/compiler/MissionCompiler.js +219 -0
- package/dist/orchestration/compiler/MissionCompiler.js.map +1 -0
- package/dist/orchestration/compiler/SchemaLowering.d.ts +37 -0
- package/dist/orchestration/compiler/SchemaLowering.d.ts.map +1 -0
- package/dist/orchestration/compiler/SchemaLowering.js +93 -0
- package/dist/orchestration/compiler/SchemaLowering.js.map +1 -0
- package/dist/orchestration/compiler/Validator.d.ts +61 -0
- package/dist/orchestration/compiler/Validator.d.ts.map +1 -0
- package/dist/orchestration/compiler/Validator.js +96 -0
- package/dist/orchestration/compiler/Validator.js.map +1 -0
- package/dist/orchestration/compiler/index.d.ts +16 -0
- package/dist/orchestration/compiler/index.d.ts.map +1 -0
- package/dist/orchestration/compiler/index.js +13 -0
- package/dist/orchestration/compiler/index.js.map +1 -0
- package/dist/orchestration/events/GraphEvent.d.ts +233 -0
- package/dist/orchestration/events/GraphEvent.d.ts.map +1 -0
- package/dist/orchestration/events/GraphEvent.js +203 -0
- package/dist/orchestration/events/GraphEvent.js.map +1 -0
- package/dist/orchestration/events/index.d.ts +2 -0
- package/dist/orchestration/events/index.d.ts.map +1 -0
- package/dist/orchestration/events/index.js +2 -0
- package/dist/orchestration/events/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +20 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +26 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/ir/index.d.ts +2 -0
- package/dist/orchestration/ir/index.d.ts.map +1 -0
- package/dist/orchestration/ir/index.js +2 -0
- package/dist/orchestration/ir/index.js.map +1 -0
- package/dist/orchestration/ir/types.d.ts +540 -0
- package/dist/orchestration/ir/types.d.ts.map +1 -0
- package/dist/orchestration/ir/types.js +20 -0
- package/dist/orchestration/ir/types.js.map +1 -0
- package/dist/orchestration/runtime/GraphRuntime.d.ts +135 -0
- package/dist/orchestration/runtime/GraphRuntime.d.ts.map +1 -0
- package/dist/orchestration/runtime/GraphRuntime.js +381 -0
- package/dist/orchestration/runtime/GraphRuntime.js.map +1 -0
- package/dist/orchestration/runtime/LoopController.d.ts +173 -0
- package/dist/orchestration/runtime/LoopController.d.ts.map +1 -0
- package/dist/orchestration/runtime/LoopController.js +130 -0
- package/dist/orchestration/runtime/LoopController.js.map +1 -0
- package/dist/orchestration/runtime/NodeExecutor.d.ts +206 -0
- package/dist/orchestration/runtime/NodeExecutor.d.ts.map +1 -0
- package/dist/orchestration/runtime/NodeExecutor.js +227 -0
- package/dist/orchestration/runtime/NodeExecutor.js.map +1 -0
- package/dist/orchestration/runtime/NodeScheduler.d.ts +85 -0
- package/dist/orchestration/runtime/NodeScheduler.d.ts.map +1 -0
- package/dist/orchestration/runtime/NodeScheduler.js +180 -0
- package/dist/orchestration/runtime/NodeScheduler.js.map +1 -0
- package/dist/orchestration/runtime/StateManager.d.ts +122 -0
- package/dist/orchestration/runtime/StateManager.d.ts.map +1 -0
- package/dist/orchestration/runtime/StateManager.js +243 -0
- package/dist/orchestration/runtime/StateManager.js.map +1 -0
- package/dist/orchestration/runtime/index.d.ts +16 -0
- package/dist/orchestration/runtime/index.d.ts.map +1 -0
- package/dist/orchestration/runtime/index.js +13 -0
- package/dist/orchestration/runtime/index.js.map +1 -0
- package/package.json +10 -4
- package/dist/api/tool-adapter.d.ts +0 -12
- package/dist/api/tool-adapter.d.ts.map +0 -1
- package/dist/api/tool-adapter.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestration/ir/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestration/ir/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @description Core Intermediate Representation (IR) types for the AgentOS Unified Orchestration Layer.
|
|
4
|
+
*
|
|
5
|
+
* All three authoring APIs — AgentGraph (graph-based), workflow (sequential), and mission
|
|
6
|
+
* (goal-oriented) — compile down to these IR types before execution. Keeping a single shared IR
|
|
7
|
+
* means the runtime, checkpointing, memory, and diagnostics subsystems only need one implementation.
|
|
8
|
+
*
|
|
9
|
+
* Dependency graph (no circular imports):
|
|
10
|
+
* primitive enums/constants → condition/executor unions → policy interfaces →
|
|
11
|
+
* view interfaces → GraphNode / GraphEdge / GraphState → CompiledExecutionGraph
|
|
12
|
+
*/
|
|
13
|
+
/** Sentinel node-id representing the implicit entry point of every graph. */
|
|
14
|
+
export declare const START: "__START__";
|
|
15
|
+
/** Sentinel node-id representing the implicit exit point of every graph. */
|
|
16
|
+
export declare const END: "__END__";
|
|
17
|
+
/**
|
|
18
|
+
* Controls how many LLM turns a node may consume per invocation.
|
|
19
|
+
*
|
|
20
|
+
* - `single_turn` — exactly one prompt/response pair; deterministic cost.
|
|
21
|
+
* - `react_bounded` — ReAct-style tool-use loop capped by `maxInternalIterations`.
|
|
22
|
+
* - `planner_controlled` — the orchestrating planner decides when the node is "done".
|
|
23
|
+
*/
|
|
24
|
+
export type NodeExecutionMode = 'single_turn' | 'react_bounded' | 'planner_controlled';
|
|
25
|
+
/**
|
|
26
|
+
* Broad classification of the side-effects a node may produce.
|
|
27
|
+
* Used by the runtime for scheduling, parallelism gating, and audit logging.
|
|
28
|
+
*
|
|
29
|
+
* - `pure` — no I/O; can be cached and parallelised freely.
|
|
30
|
+
* - `read` — reads external state but does not mutate it.
|
|
31
|
+
* - `write` — mutates external state (DB, API, file-system, …).
|
|
32
|
+
* - `external` — fire-and-forget external call; mutation status unknown.
|
|
33
|
+
* - `human` — requires a human in the loop; execution suspends until resolved.
|
|
34
|
+
*/
|
|
35
|
+
export type EffectClass = 'pure' | 'read' | 'write' | 'external' | 'human';
|
|
36
|
+
/**
|
|
37
|
+
* Cognitive memory trace categories, modelled after the psychological taxonomy used
|
|
38
|
+
* throughout the AgentOS memory subsystem.
|
|
39
|
+
*
|
|
40
|
+
* - `episodic` — autobiographical events tied to a moment in time.
|
|
41
|
+
* - `semantic` — factual / world-knowledge, not time-stamped.
|
|
42
|
+
* - `procedural` — how-to knowledge; encoded skills and routines.
|
|
43
|
+
* - `prospective` — future-oriented intentions ("remember to …").
|
|
44
|
+
*/
|
|
45
|
+
export type MemoryTraceType = 'episodic' | 'semantic' | 'procedural' | 'prospective';
|
|
46
|
+
/**
|
|
47
|
+
* Visibility scope of a memory trace.
|
|
48
|
+
*
|
|
49
|
+
* - `global` — shared across all agents and all sessions.
|
|
50
|
+
* - `persona` — private to this agent identity.
|
|
51
|
+
* - `session` — lives only for the lifetime of a single run.
|
|
52
|
+
* - `conversation` — lives only for the current conversation turn window.
|
|
53
|
+
*/
|
|
54
|
+
export type GraphMemoryScope = 'global' | 'persona' | 'session' | 'conversation';
|
|
55
|
+
/**
|
|
56
|
+
* How the runtime handles in-flight memory reads/writes relative to concurrent graph branches.
|
|
57
|
+
*
|
|
58
|
+
* - `live` — always reads/writes the latest committed value; no isolation.
|
|
59
|
+
* - `snapshot` — reads a point-in-time snapshot taken at graph start; writes are deferred.
|
|
60
|
+
* - `journaled` — writes are appended to a journal and replayed atomically at commit.
|
|
61
|
+
*/
|
|
62
|
+
export type MemoryConsistencyMode = 'live' | 'snapshot' | 'journaled';
|
|
63
|
+
/**
|
|
64
|
+
* A TypeScript function that inspects `GraphState` and returns the id of the next node.
|
|
65
|
+
* Used with `{ type: 'function' }` conditions so authors can express arbitrary routing logic.
|
|
66
|
+
*/
|
|
67
|
+
export type GraphConditionFn = (state: GraphState) => string;
|
|
68
|
+
/**
|
|
69
|
+
* A DSL expression string evaluated by the runtime's condition interpreter.
|
|
70
|
+
* Expressions may reference `state.*` fields using dot-notation.
|
|
71
|
+
* Example: `"state.scratch.confidence > 0.8 ? 'approve' : 'review'"`
|
|
72
|
+
*/
|
|
73
|
+
export type GraphConditionExpr = string;
|
|
74
|
+
/**
|
|
75
|
+
* Discriminated union for all routing predicates supported by graph edges.
|
|
76
|
+
*
|
|
77
|
+
* - `{ type: 'function' }` — calls a runtime-registered TypeScript function.
|
|
78
|
+
* - `{ type: 'expression' }` — evaluates a sandboxed DSL string.
|
|
79
|
+
*/
|
|
80
|
+
export type GraphCondition = {
|
|
81
|
+
type: 'function';
|
|
82
|
+
fn: GraphConditionFn;
|
|
83
|
+
description?: string;
|
|
84
|
+
} | {
|
|
85
|
+
type: 'expression';
|
|
86
|
+
expr: GraphConditionExpr;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Describes how the runtime should execute a `GraphNode`. Each variant maps to a
|
|
90
|
+
* distinct execution strategy.
|
|
91
|
+
*
|
|
92
|
+
* - `gmi` — General Model Invocation: call an LLM with system instructions.
|
|
93
|
+
* - `tool` — Invoke a registered `ITool` by name, optionally with static args.
|
|
94
|
+
* - `extension` — Call a method on a registered `IExtension`.
|
|
95
|
+
* - `human` — Suspend execution and surface a prompt to a human operator.
|
|
96
|
+
* - `guardrail` — Run one or more guardrail checks; route or block on violation.
|
|
97
|
+
* - `router` — Pure routing node; evaluates a `GraphCondition` and emits no output.
|
|
98
|
+
* - `subgraph` — Delegate to another `CompiledExecutionGraph` with optional field mapping.
|
|
99
|
+
*/
|
|
100
|
+
export type NodeExecutorConfig = {
|
|
101
|
+
type: 'gmi';
|
|
102
|
+
/** System-level instructions injected before the user message. */
|
|
103
|
+
instructions: string;
|
|
104
|
+
/** Maximum ReAct loop iterations when `executionMode` is `react_bounded`. Defaults to 10. */
|
|
105
|
+
maxInternalIterations?: number;
|
|
106
|
+
/** Whether to issue multiple tool calls in a single model turn. */
|
|
107
|
+
parallelTools?: boolean;
|
|
108
|
+
/** Sampling temperature forwarded to the LLM provider. */
|
|
109
|
+
temperature?: number;
|
|
110
|
+
/** Hard cap on output tokens for this node's completion. */
|
|
111
|
+
maxTokens?: number;
|
|
112
|
+
} | {
|
|
113
|
+
type: 'tool';
|
|
114
|
+
/** Registered tool name as it appears in the tool catalogue. */
|
|
115
|
+
toolName: string;
|
|
116
|
+
/** Static arguments merged with runtime-provided arguments before invocation. */
|
|
117
|
+
args?: Record<string, unknown>;
|
|
118
|
+
} | {
|
|
119
|
+
type: 'extension';
|
|
120
|
+
/** Extension identifier as registered in the capability registry. */
|
|
121
|
+
extensionId: string;
|
|
122
|
+
/** Name of the extension method to call. */
|
|
123
|
+
method: string;
|
|
124
|
+
} | {
|
|
125
|
+
type: 'human';
|
|
126
|
+
/** Message displayed to the human operator while the graph is suspended. */
|
|
127
|
+
prompt: string;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'guardrail';
|
|
130
|
+
/** Ordered list of guardrail identifiers to evaluate. */
|
|
131
|
+
guardrailIds: string[];
|
|
132
|
+
/** Action taken when any guardrail fires. */
|
|
133
|
+
onViolation: 'block' | 'reroute' | 'warn' | 'sanitize';
|
|
134
|
+
/** Node id to route to when `onViolation` is `'reroute'`. */
|
|
135
|
+
rerouteTarget?: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: 'router';
|
|
138
|
+
/** Routing predicate; the returned node-id determines the next edge. */
|
|
139
|
+
condition: GraphCondition;
|
|
140
|
+
} | {
|
|
141
|
+
type: 'subgraph';
|
|
142
|
+
/** Id of the `CompiledExecutionGraph` to delegate to. */
|
|
143
|
+
graphId: string;
|
|
144
|
+
/** Maps parent `scratch` field paths → child `input` field paths. */
|
|
145
|
+
inputMapping?: Record<string, string>;
|
|
146
|
+
/** Maps child `artifacts` field paths → parent `scratch` field paths. */
|
|
147
|
+
outputMapping?: Record<string, string>;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Governs automatic retry behaviour for transient node failures.
|
|
151
|
+
*
|
|
152
|
+
* @property maxAttempts - Total number of attempts (including the first).
|
|
153
|
+
* @property backoff - Wait time growth strategy between attempts.
|
|
154
|
+
* @property backoffMs - Base wait duration in milliseconds.
|
|
155
|
+
* @property retryOn - Optional allowlist of error codes/names that trigger retry.
|
|
156
|
+
* When absent, all errors are retried up to `maxAttempts`.
|
|
157
|
+
*/
|
|
158
|
+
export interface RetryPolicy {
|
|
159
|
+
maxAttempts: number;
|
|
160
|
+
backoff: 'fixed' | 'linear' | 'exponential';
|
|
161
|
+
backoffMs: number;
|
|
162
|
+
retryOn?: string[];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Controls how a node reads from and writes to the agent's memory subsystem.
|
|
166
|
+
*
|
|
167
|
+
* @property consistency - Isolation mode applied for all memory I/O in this node.
|
|
168
|
+
* @property read - Optional filter applied when loading traces before execution.
|
|
169
|
+
* @property write - Optional encoding settings applied when persisting after execution.
|
|
170
|
+
*/
|
|
171
|
+
export interface MemoryPolicy {
|
|
172
|
+
consistency: MemoryConsistencyMode;
|
|
173
|
+
read?: {
|
|
174
|
+
/** Restrict loaded traces to these memory types. */
|
|
175
|
+
types?: MemoryTraceType[];
|
|
176
|
+
/** Restrict loaded traces to this scope. */
|
|
177
|
+
scope?: GraphMemoryScope;
|
|
178
|
+
/** Maximum number of traces to surface into `GraphState.memory`. */
|
|
179
|
+
maxTraces?: number;
|
|
180
|
+
/** Minimum consolidation strength (0–1) for a trace to be returned. */
|
|
181
|
+
minStrength?: number;
|
|
182
|
+
/** Free-text semantic query used for vector-similarity retrieval. */
|
|
183
|
+
semanticQuery?: string;
|
|
184
|
+
};
|
|
185
|
+
write?: {
|
|
186
|
+
/** When true, the runtime auto-encodes node output into a new trace. */
|
|
187
|
+
autoEncode?: boolean;
|
|
188
|
+
/** Trace category applied to auto-encoded output. */
|
|
189
|
+
type?: MemoryTraceType;
|
|
190
|
+
/** Scope applied to auto-encoded output. */
|
|
191
|
+
scope?: GraphMemoryScope;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Controls dynamic capability discovery performed before or during node execution.
|
|
196
|
+
*
|
|
197
|
+
* @property enabled - Master switch; when false all other fields are ignored.
|
|
198
|
+
* @property query - Semantic query forwarded to `CapabilityDiscoveryEngine`.
|
|
199
|
+
* @property kind - Restricts discovery to a specific capability kind.
|
|
200
|
+
* @property maxResults - Maximum number of results injected into the node's context.
|
|
201
|
+
* @property fallback - Behaviour when discovery returns no results.
|
|
202
|
+
* `'all'` injects the full capability list; `'error'` aborts the node.
|
|
203
|
+
*/
|
|
204
|
+
export interface DiscoveryPolicy {
|
|
205
|
+
enabled: boolean;
|
|
206
|
+
query?: string;
|
|
207
|
+
kind?: 'tool' | 'skill' | 'extension' | 'any';
|
|
208
|
+
maxResults?: number;
|
|
209
|
+
fallback?: 'all' | 'error';
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Configures persona-layer traits injected into the node's prompt context.
|
|
213
|
+
*
|
|
214
|
+
* @property traits - HEXACO-style trait overrides (values in range 0–1).
|
|
215
|
+
* @property mood - Override the PAD mood state label for this node.
|
|
216
|
+
* @property adaptStyle - Whether to apply learned communication-style preferences.
|
|
217
|
+
*/
|
|
218
|
+
export interface PersonaPolicy {
|
|
219
|
+
traits?: Record<string, number>;
|
|
220
|
+
mood?: string;
|
|
221
|
+
adaptStyle?: boolean;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Declarative guardrail policy attached to a node or edge.
|
|
225
|
+
*
|
|
226
|
+
* @property input - Guardrail ids evaluated against the node's incoming payload.
|
|
227
|
+
* @property output - Guardrail ids evaluated against the node's outgoing payload.
|
|
228
|
+
* @property onViolation - Action taken when any guardrail fires.
|
|
229
|
+
* @property rerouteTarget - Required when `onViolation` is `'reroute'`.
|
|
230
|
+
*/
|
|
231
|
+
export interface GuardrailPolicy {
|
|
232
|
+
input?: string[];
|
|
233
|
+
output?: string[];
|
|
234
|
+
onViolation: 'block' | 'reroute' | 'warn' | 'sanitize';
|
|
235
|
+
rerouteTarget?: string;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* A read-only snapshot of memory state visible to a node during execution.
|
|
239
|
+
* Populated by the runtime before the node's executor is called; immutable thereafter.
|
|
240
|
+
*/
|
|
241
|
+
export interface MemoryView {
|
|
242
|
+
/** Traces retrieved according to the node's `MemoryPolicy.read` configuration. */
|
|
243
|
+
traces: ReadonlyArray<{
|
|
244
|
+
traceId: string;
|
|
245
|
+
type: MemoryTraceType;
|
|
246
|
+
content: string;
|
|
247
|
+
/** Consolidation strength in range 0–1; higher = stronger/more salient. */
|
|
248
|
+
strength: number;
|
|
249
|
+
scope: GraphMemoryScope;
|
|
250
|
+
/** Unix epoch milliseconds when the trace was first encoded. */
|
|
251
|
+
createdAt: number;
|
|
252
|
+
metadata?: Record<string, unknown>;
|
|
253
|
+
}>;
|
|
254
|
+
/** Writes staged during this node's execution, not yet committed to the store. */
|
|
255
|
+
pendingWrites: ReadonlyArray<{
|
|
256
|
+
type: MemoryTraceType;
|
|
257
|
+
content: string;
|
|
258
|
+
scope: GraphMemoryScope;
|
|
259
|
+
}>;
|
|
260
|
+
/** Total number of traces that matched the read filter (before `maxTraces` capping). */
|
|
261
|
+
totalTracesRead: number;
|
|
262
|
+
/** Wall-clock time in milliseconds spent on the memory read operation. */
|
|
263
|
+
readLatencyMs: number;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Accumulated diagnostic telemetry for an entire graph run.
|
|
267
|
+
* Appended to `GraphState.diagnostics` after each node completes.
|
|
268
|
+
*/
|
|
269
|
+
export interface DiagnosticsView {
|
|
270
|
+
/** Cumulative LLM tokens consumed across all `gmi` nodes. */
|
|
271
|
+
totalTokensUsed: number;
|
|
272
|
+
/** Wall-clock duration from graph start to the latest completed node. */
|
|
273
|
+
totalDurationMs: number;
|
|
274
|
+
/** Per-node timing and token attribution. */
|
|
275
|
+
nodeTimings: Record<string, {
|
|
276
|
+
startMs: number;
|
|
277
|
+
endMs: number;
|
|
278
|
+
tokensUsed: number;
|
|
279
|
+
}>;
|
|
280
|
+
/** Results from each `DiscoveryPolicy`-triggered capability lookup. */
|
|
281
|
+
discoveryResults: Record<string, {
|
|
282
|
+
query: string;
|
|
283
|
+
toolsFound: string[];
|
|
284
|
+
latencyMs: number;
|
|
285
|
+
}>;
|
|
286
|
+
/** Results from each guardrail evaluation. */
|
|
287
|
+
guardrailResults: Record<string, {
|
|
288
|
+
guardrailId: string;
|
|
289
|
+
passed: boolean;
|
|
290
|
+
action: string;
|
|
291
|
+
latencyMs: number;
|
|
292
|
+
}>;
|
|
293
|
+
/** Number of checkpoint snapshots persisted during the run. */
|
|
294
|
+
checkpointsSaved: number;
|
|
295
|
+
/** Number of memory read operations performed. */
|
|
296
|
+
memoryReads: number;
|
|
297
|
+
/** Number of memory write operations performed (including pending). */
|
|
298
|
+
memoryWrites: number;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* A single vertex in the compiled execution graph.
|
|
302
|
+
*
|
|
303
|
+
* Nodes are immutable once compiled; all runtime state lives in `GraphState`.
|
|
304
|
+
*/
|
|
305
|
+
export interface GraphNode {
|
|
306
|
+
/** Unique identifier within the parent `CompiledExecutionGraph`. Must not equal `START` or `END`. */
|
|
307
|
+
id: string;
|
|
308
|
+
/** Coarse type label kept in sync with `executorConfig.type` for fast switching. */
|
|
309
|
+
type: 'gmi' | 'tool' | 'extension' | 'human' | 'guardrail' | 'router' | 'subgraph';
|
|
310
|
+
/** Full executor configuration; discriminated union determines runtime strategy. */
|
|
311
|
+
executorConfig: NodeExecutorConfig;
|
|
312
|
+
/** Controls the LLM turn budget for this node. */
|
|
313
|
+
executionMode: NodeExecutionMode;
|
|
314
|
+
/** Classifies the side-effects this node may produce. */
|
|
315
|
+
effectClass: EffectClass;
|
|
316
|
+
/** Maximum wall-clock execution time in milliseconds before the node is aborted. */
|
|
317
|
+
timeout?: number;
|
|
318
|
+
/** Automatic retry configuration for transient failures. */
|
|
319
|
+
retryPolicy?: RetryPolicy;
|
|
320
|
+
/**
|
|
321
|
+
* When the runtime should persist a checkpoint snapshot.
|
|
322
|
+
* - `before` — snapshot taken before executor runs (enables re-entry on crash).
|
|
323
|
+
* - `after` — snapshot taken after executor succeeds.
|
|
324
|
+
* - `both` — snapshot taken at both points.
|
|
325
|
+
* - `none` — no snapshot for this node.
|
|
326
|
+
*/
|
|
327
|
+
checkpoint: 'before' | 'after' | 'both' | 'none';
|
|
328
|
+
/** JSON-Schema-compatible description of the expected input shape. */
|
|
329
|
+
inputSchema?: Record<string, unknown>;
|
|
330
|
+
/** JSON-Schema-compatible description of the expected output shape. */
|
|
331
|
+
outputSchema?: Record<string, unknown>;
|
|
332
|
+
/** Memory read/write configuration applied by the runtime around execution. */
|
|
333
|
+
memoryPolicy?: MemoryPolicy;
|
|
334
|
+
/** Dynamic capability discovery configuration applied before execution. */
|
|
335
|
+
discoveryPolicy?: DiscoveryPolicy;
|
|
336
|
+
/** Persona layer configuration injected into the prompt context. */
|
|
337
|
+
personaPolicy?: PersonaPolicy;
|
|
338
|
+
/** Declarative guardrails evaluated on input and/or output payloads. */
|
|
339
|
+
guardrailPolicy?: GuardrailPolicy;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* A directed edge connecting two vertices in the compiled execution graph.
|
|
343
|
+
*
|
|
344
|
+
* The `source` and `target` fields may be `START` or `END` sentinels.
|
|
345
|
+
*/
|
|
346
|
+
export interface GraphEdge {
|
|
347
|
+
/** Unique identifier within the parent `CompiledExecutionGraph`. */
|
|
348
|
+
id: string;
|
|
349
|
+
/** Source node id (or `START`). */
|
|
350
|
+
source: string;
|
|
351
|
+
/** Target node id (or `END`). */
|
|
352
|
+
target: string;
|
|
353
|
+
/**
|
|
354
|
+
* Edge routing strategy:
|
|
355
|
+
* - `static` — always followed; no condition evaluated.
|
|
356
|
+
* - `conditional` — followed only when `condition` evaluates to this edge's target.
|
|
357
|
+
* - `discovery` — target is resolved at runtime via capability discovery.
|
|
358
|
+
* - `personality` — target is chosen based on the agent's current trait values.
|
|
359
|
+
*/
|
|
360
|
+
type: 'static' | 'conditional' | 'discovery' | 'personality';
|
|
361
|
+
/** Routing predicate; required when `type` is `'conditional'`. */
|
|
362
|
+
condition?: GraphCondition;
|
|
363
|
+
/** Semantic query used to discover the target node at runtime; required for `'discovery'` edges. */
|
|
364
|
+
discoveryQuery?: string;
|
|
365
|
+
/** Capability kind filter applied during discovery-based routing. */
|
|
366
|
+
discoveryKind?: 'tool' | 'skill' | 'extension' | 'any';
|
|
367
|
+
/** Node id used as fallback when discovery resolves no target. */
|
|
368
|
+
discoveryFallback?: string;
|
|
369
|
+
/**
|
|
370
|
+
* Personality-based routing descriptor; required when `type` is `'personality'`.
|
|
371
|
+
* The runtime reads `trait` from the agent's current HEXACO/PAD state and
|
|
372
|
+
* routes to `above` or `below` depending on whether the value exceeds `threshold`.
|
|
373
|
+
*/
|
|
374
|
+
personalityCondition?: {
|
|
375
|
+
trait: string;
|
|
376
|
+
threshold: number;
|
|
377
|
+
above: string;
|
|
378
|
+
below: string;
|
|
379
|
+
};
|
|
380
|
+
/** Optional guardrail policy evaluated when traffic crosses this edge. */
|
|
381
|
+
guardrailPolicy?: GuardrailPolicy;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* The mutable execution state threaded through every node of a graph run.
|
|
385
|
+
*
|
|
386
|
+
* Generic parameters allow authors to provide precise types for their specific graph.
|
|
387
|
+
* All fields except `scratch` and `artifacts` are managed exclusively by the runtime.
|
|
388
|
+
*
|
|
389
|
+
* @template TInput - Shape of the initial user-provided input.
|
|
390
|
+
* @template TScratch - Shape of intermediate computation results passed between nodes.
|
|
391
|
+
* @template TArtifacts - Shape of outputs produced for external consumption.
|
|
392
|
+
*/
|
|
393
|
+
export interface GraphState<TInput = unknown, TScratch = unknown, TArtifacts = unknown> {
|
|
394
|
+
/** The original user-provided input; frozen after graph start. */
|
|
395
|
+
input: Readonly<TInput>;
|
|
396
|
+
/** Node-to-node communication bag; merged via `StateReducers` after each node. */
|
|
397
|
+
scratch: TScratch;
|
|
398
|
+
/** Read-only memory snapshot populated before each node executes. */
|
|
399
|
+
memory: MemoryView;
|
|
400
|
+
/** Accumulated outputs intended for the caller; merged via `StateReducers` after each node. */
|
|
401
|
+
artifacts: TArtifacts;
|
|
402
|
+
/** Append-only telemetry record updated after each node completes. */
|
|
403
|
+
diagnostics: DiagnosticsView;
|
|
404
|
+
/** Id of the node currently executing (or most recently completed). */
|
|
405
|
+
currentNodeId: string;
|
|
406
|
+
/** Ordered list of node ids that have completed execution in this run. */
|
|
407
|
+
visitedNodes: string[];
|
|
408
|
+
/** Number of times the graph has looped back to a previously visited node. */
|
|
409
|
+
iteration: number;
|
|
410
|
+
/** Id of the most recently persisted checkpoint snapshot, if any. */
|
|
411
|
+
checkpointId?: string;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Named built-in reducer strategies for `GraphState.scratch` and `GraphState.artifacts` fields.
|
|
415
|
+
*
|
|
416
|
+
* - `concat` — append arrays or concatenate strings.
|
|
417
|
+
* - `merge` — deep-merge objects (right wins on conflict).
|
|
418
|
+
* - `max` — keep the larger numeric value.
|
|
419
|
+
* - `min` — keep the smaller numeric value.
|
|
420
|
+
* - `avg` — running arithmetic mean.
|
|
421
|
+
* - `sum` — running total.
|
|
422
|
+
* - `last` — always overwrite with the latest value (default semantics).
|
|
423
|
+
* - `first` — keep the first value; ignore subsequent writes.
|
|
424
|
+
* - `longest` — keep the longer string or larger array.
|
|
425
|
+
*/
|
|
426
|
+
export type BuiltinReducer = 'concat' | 'merge' | 'max' | 'min' | 'avg' | 'sum' | 'last' | 'first' | 'longest';
|
|
427
|
+
/**
|
|
428
|
+
* Custom reducer function for a single state field.
|
|
429
|
+
*
|
|
430
|
+
* @param existing - The current field value held in `GraphState`.
|
|
431
|
+
* @param incoming - The new value emitted by the most recently completed node.
|
|
432
|
+
* @returns The merged value to store back into `GraphState`.
|
|
433
|
+
*/
|
|
434
|
+
export type ReducerFn = (existing: unknown, incoming: unknown) => unknown;
|
|
435
|
+
/**
|
|
436
|
+
* Maps dot-notation field paths in `GraphState.scratch` / `GraphState.artifacts` to
|
|
437
|
+
* either a `BuiltinReducer` name or a custom `ReducerFn`.
|
|
438
|
+
*
|
|
439
|
+
* Example:
|
|
440
|
+
* ```ts
|
|
441
|
+
* const reducers: StateReducers = {
|
|
442
|
+
* 'scratch.messages': 'concat',
|
|
443
|
+
* 'artifacts.summary': (a, b) => String(b ?? a),
|
|
444
|
+
* };
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
export interface StateReducers {
|
|
448
|
+
[fieldPath: string]: ReducerFn | BuiltinReducer;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Lightweight descriptor stored alongside each persisted checkpoint snapshot.
|
|
452
|
+
* Used by the runtime to enumerate and restore checkpoints without deserialising
|
|
453
|
+
* the full `GraphState` payload.
|
|
454
|
+
*/
|
|
455
|
+
export interface CheckpointMetadata {
|
|
456
|
+
/** Unique checkpoint id (UUIDv4 assigned by the runtime). */
|
|
457
|
+
id: string;
|
|
458
|
+
/** Id of the graph run that produced this checkpoint. */
|
|
459
|
+
runId: string;
|
|
460
|
+
/** Id of the `CompiledExecutionGraph` being executed. */
|
|
461
|
+
graphId: string;
|
|
462
|
+
/** Id of the node that triggered checkpoint persistence. */
|
|
463
|
+
nodeId: string;
|
|
464
|
+
/** Unix epoch milliseconds when the checkpoint was persisted. */
|
|
465
|
+
timestamp: number;
|
|
466
|
+
/** Serialised byte size of the `GraphState` payload. */
|
|
467
|
+
stateSize: number;
|
|
468
|
+
/** Whether a full `MemoryView` snapshot was included in the payload. */
|
|
469
|
+
hasMemorySnapshot: boolean;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Complete inspection record for an in-progress or finished graph run.
|
|
473
|
+
* Returned by the runtime's run-management API.
|
|
474
|
+
*/
|
|
475
|
+
export interface RunInspection {
|
|
476
|
+
/** Unique run id (UUIDv4 assigned when the run was started). */
|
|
477
|
+
runId: string;
|
|
478
|
+
/** Id of the `CompiledExecutionGraph` being executed. */
|
|
479
|
+
graphId: string;
|
|
480
|
+
/** Current lifecycle phase of the run. */
|
|
481
|
+
status: 'running' | 'completed' | 'errored' | 'interrupted';
|
|
482
|
+
/** Id of the node currently executing; absent when `status` is terminal. */
|
|
483
|
+
currentNodeId?: string;
|
|
484
|
+
/** Ordered list of node ids that have completed execution. */
|
|
485
|
+
visitedNodes: string[];
|
|
486
|
+
/** Ordered stream of runtime events emitted during the run (type: `GraphEvent[]`). */
|
|
487
|
+
events: unknown[];
|
|
488
|
+
/** All checkpoint snapshots persisted during the run. */
|
|
489
|
+
checkpoints: CheckpointMetadata[];
|
|
490
|
+
/** Accumulated diagnostic telemetry. */
|
|
491
|
+
diagnostics: DiagnosticsView;
|
|
492
|
+
/** Final output value; only present when `status` is `'completed'`. */
|
|
493
|
+
finalOutput?: unknown;
|
|
494
|
+
/** Structured error detail; only present when `status` is `'errored'`. */
|
|
495
|
+
error?: {
|
|
496
|
+
message: string;
|
|
497
|
+
code: string;
|
|
498
|
+
nodeId?: string;
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* The fully compiled, execution-ready representation of an agent graph.
|
|
503
|
+
*
|
|
504
|
+
* All three authoring APIs (AgentGraph builder, workflow DSL, mission planner) produce
|
|
505
|
+
* a `CompiledExecutionGraph` as their final compilation artefact. The runtime never
|
|
506
|
+
* interprets authoring-API-specific constructs — it operates exclusively on this type.
|
|
507
|
+
*/
|
|
508
|
+
export interface CompiledExecutionGraph {
|
|
509
|
+
/** Stable, globally unique graph identifier (slug or UUIDv4). */
|
|
510
|
+
id: string;
|
|
511
|
+
/** Human-readable display name. */
|
|
512
|
+
name: string;
|
|
513
|
+
/** All vertices, including any `START`/`END` bridge nodes inserted by the compiler. */
|
|
514
|
+
nodes: GraphNode[];
|
|
515
|
+
/** All directed edges, including static entry/exit edges from/to `START`/`END`. */
|
|
516
|
+
edges: GraphEdge[];
|
|
517
|
+
/**
|
|
518
|
+
* JSON-Schema-compatible schema declarations for the three `GraphState` generics.
|
|
519
|
+
* Used by the runtime for validation and by tooling for type generation.
|
|
520
|
+
*/
|
|
521
|
+
stateSchema: {
|
|
522
|
+
input: Record<string, unknown>;
|
|
523
|
+
scratch: Record<string, unknown>;
|
|
524
|
+
artifacts: Record<string, unknown>;
|
|
525
|
+
};
|
|
526
|
+
/** Field-level reducer configuration applied after each node completes. */
|
|
527
|
+
reducers: StateReducers;
|
|
528
|
+
/**
|
|
529
|
+
* Graph-wide default checkpoint persistence policy.
|
|
530
|
+
* Per-node `GraphNode.checkpoint` settings override this default.
|
|
531
|
+
*
|
|
532
|
+
* - `every_node` — persist after every node (safe, high storage cost).
|
|
533
|
+
* - `explicit` — persist only for nodes that declare `checkpoint !== 'none'`.
|
|
534
|
+
* - `none` — never persist (lowest overhead; no recovery on crash).
|
|
535
|
+
*/
|
|
536
|
+
checkpointPolicy: 'every_node' | 'explicit' | 'none';
|
|
537
|
+
/** Graph-wide memory consistency mode; may be overridden per-node via `MemoryPolicy.consistency`. */
|
|
538
|
+
memoryConsistency: MemoryConsistencyMode;
|
|
539
|
+
}
|
|
540
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/orchestration/ir/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,6EAA6E;AAC7E,eAAO,MAAM,KAAK,EAAG,WAAoB,CAAC;AAE1C,4EAA4E;AAC5E,eAAO,MAAM,GAAG,EAAG,SAAkB,CAAC;AAMtC;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAEvF;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;AAM3E;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;AAErF;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,CAAC;AAEjF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAMtE;;;GAGG;AACH,MAAM,MA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IAC3E,QAAQ,EAAE,aAAa,CAAC;IACxB;;;;;;;OAOG;IACH,gBAAgB,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IACrD,qGAAqG;IACrG,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @description Core Intermediate Representation (IR) types for the AgentOS Unified Orchestration Layer.
|
|
4
|
+
*
|
|
5
|
+
* All three authoring APIs — AgentGraph (graph-based), workflow (sequential), and mission
|
|
6
|
+
* (goal-oriented) — compile down to these IR types before execution. Keeping a single shared IR
|
|
7
|
+
* means the runtime, checkpointing, memory, and diagnostics subsystems only need one implementation.
|
|
8
|
+
*
|
|
9
|
+
* Dependency graph (no circular imports):
|
|
10
|
+
* primitive enums/constants → condition/executor unions → policy interfaces →
|
|
11
|
+
* view interfaces → GraphNode / GraphEdge / GraphState → CompiledExecutionGraph
|
|
12
|
+
*/
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Sentinels
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/** Sentinel node-id representing the implicit entry point of every graph. */
|
|
17
|
+
export const START = '__START__';
|
|
18
|
+
/** Sentinel node-id representing the implicit exit point of every graph. */
|
|
19
|
+
export const END = '__END__';
|
|
20
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/orchestration/ir/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,KAAK,GAAG,WAAoB,CAAC;AAE1C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,GAAG,GAAG,SAAkB,CAAC"}
|