@framers/agentos 0.1.68 → 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,243 @@
1
+ /**
2
+ * @file StateManager.ts
3
+ * @description Manages the mutable {@link GraphState} partitions for an active graph run.
4
+ *
5
+ * Responsibilities:
6
+ * - Creating a clean initial state from caller-supplied input.
7
+ * - Applying node output patches to the `scratch` partition, honoring per-field
8
+ * {@link StateReducers} for deterministic conflict resolution.
9
+ * - Applying node output patches to the `artifacts` partition (last-write-wins by default).
10
+ * - Merging states produced by parallel branches using the same reducer logic.
11
+ * - Tracking the ordered list of visited node ids and the global iteration counter.
12
+ *
13
+ * `StateManager` is intentionally stateless between calls — it receives the current
14
+ * {@link GraphState} as an argument and returns a *new* object; it never mutates in place.
15
+ * This makes it straightforward to unit-test and safe to use in concurrent contexts.
16
+ */
17
+ // ---------------------------------------------------------------------------
18
+ // StateManager
19
+ // ---------------------------------------------------------------------------
20
+ /**
21
+ * Manages the {@link GraphState} partitions (`input`, `scratch`, `artifacts`,
22
+ * `memory`, `diagnostics`) for a single graph run.
23
+ *
24
+ * All methods return a *new* `GraphState` object; the original is never mutated.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const manager = new StateManager({ 'scratch.messages': 'concat' });
29
+ * let state = manager.initialize({ prompt: 'Hello' });
30
+ * state = manager.updateScratch(state, { messages: ['first'] });
31
+ * state = manager.updateScratch(state, { messages: ['second'] });
32
+ * // state.scratch.messages === ['first', 'second']
33
+ * ```
34
+ */
35
+ export class StateManager {
36
+ /**
37
+ * @param reducers - Field-level reducer configuration keyed by dot-notation paths
38
+ * (e.g. `'scratch.messages'`). Determines how conflicting values
39
+ * are merged during {@link updateScratch} and {@link mergeParallelBranches}.
40
+ */
41
+ constructor(reducers) {
42
+ this.reducers = reducers;
43
+ }
44
+ // ---------------------------------------------------------------------------
45
+ // Public API
46
+ // ---------------------------------------------------------------------------
47
+ /**
48
+ * Create a clean initial {@link GraphState} from the caller-supplied `input` value.
49
+ *
50
+ * The `input` partition is frozen with {@link Object.freeze} so that no node can
51
+ * accidentally mutate it. All other partitions start empty.
52
+ *
53
+ * @param input - Arbitrary value provided by the graph caller; becomes `state.input`.
54
+ * @returns A fully initialised `GraphState` ready for the first node execution.
55
+ */
56
+ initialize(input) {
57
+ return {
58
+ input: Object.freeze(input),
59
+ scratch: {},
60
+ memory: this.emptyMemoryView(),
61
+ artifacts: {},
62
+ diagnostics: this.emptyDiagnostics(),
63
+ currentNodeId: '',
64
+ visitedNodes: [],
65
+ iteration: 0,
66
+ };
67
+ }
68
+ /**
69
+ * Apply a `patch` to the `scratch` partition, honoring any registered reducers.
70
+ *
71
+ * For each key in `patch`:
72
+ * - If a reducer is registered at `scratch.<key>` **and** the key already exists
73
+ * in the current scratch, the reducer is called to merge the existing and incoming
74
+ * values.
75
+ * - Otherwise the incoming value simply overwrites (last-write-wins semantics).
76
+ *
77
+ * @param state - Current graph state (not mutated).
78
+ * @param patch - Partial scratch update emitted by a completed node.
79
+ * @returns New `GraphState` with the merged scratch partition.
80
+ */
81
+ updateScratch(state, patch) {
82
+ const newScratch = { ...state.scratch };
83
+ for (const [key, value] of Object.entries(patch)) {
84
+ const reducerKey = `scratch.${key}`;
85
+ const reducer = this.reducers[reducerKey];
86
+ if (reducer !== undefined && newScratch[key] !== undefined) {
87
+ // A reducer is configured and a prior value exists — merge them.
88
+ newScratch[key] = this.applyReducer(reducer, newScratch[key], value);
89
+ }
90
+ else {
91
+ // No reducer or no prior value — overwrite.
92
+ newScratch[key] = value;
93
+ }
94
+ }
95
+ return { ...state, scratch: newScratch };
96
+ }
97
+ /**
98
+ * Apply a `patch` to the `artifacts` partition using last-write-wins semantics.
99
+ *
100
+ * Artifact fields are intended for caller-facing outputs and are not subject to
101
+ * reducer logic in this method. If you need reducer-aware artifact merging, use
102
+ * {@link mergeParallelBranches} instead.
103
+ *
104
+ * @param state - Current graph state (not mutated).
105
+ * @param patch - Partial artifacts update emitted by a completed node.
106
+ * @returns New `GraphState` with the updated artifacts partition.
107
+ */
108
+ updateArtifacts(state, patch) {
109
+ return {
110
+ ...state,
111
+ artifacts: { ...state.artifacts, ...patch },
112
+ };
113
+ }
114
+ /**
115
+ * Record that execution has entered `nodeId`.
116
+ *
117
+ * Updates `currentNodeId`, appends to `visitedNodes`, and increments `iteration`.
118
+ *
119
+ * @param state - Current graph state (not mutated).
120
+ * @param nodeId - Id of the node that is about to execute.
121
+ * @returns New `GraphState` reflecting the visit.
122
+ */
123
+ recordNodeVisit(state, nodeId) {
124
+ return {
125
+ ...state,
126
+ currentNodeId: nodeId,
127
+ visitedNodes: [...state.visitedNodes, nodeId],
128
+ iteration: state.iteration + 1,
129
+ };
130
+ }
131
+ /**
132
+ * Merge the `scratch` partitions of one or more parallel branch states back into
133
+ * a single `GraphState`.
134
+ *
135
+ * The algorithm walks every key present in any branch's scratch object and applies
136
+ * the registered reducer for that key (if any) against the accumulator. When no
137
+ * reducer is registered, the last branch's value wins.
138
+ *
139
+ * The `artifacts`, `memory`, `diagnostics`, `visitedNodes`, and `iteration` fields
140
+ * of `baseState` are preserved unchanged — the caller is responsible for merging
141
+ * those separately if needed.
142
+ *
143
+ * @param baseState - State prior to the parallel fan-out (provides the baseline scratch).
144
+ * @param branchStates - States produced by each parallel branch.
145
+ * @returns New `GraphState` with the merged scratch partition.
146
+ */
147
+ mergeParallelBranches(baseState, branchStates) {
148
+ let merged = { ...baseState.scratch };
149
+ for (const branch of branchStates) {
150
+ const branchScratch = branch.scratch;
151
+ for (const key of Object.keys(branchScratch)) {
152
+ const reducerKey = `scratch.${key}`;
153
+ const reducer = this.reducers[reducerKey];
154
+ if (reducer !== undefined && merged[key] !== undefined) {
155
+ merged[key] = this.applyReducer(reducer, merged[key], branchScratch[key]);
156
+ }
157
+ else {
158
+ merged[key] = branchScratch[key];
159
+ }
160
+ }
161
+ }
162
+ return { ...baseState, scratch: merged };
163
+ }
164
+ // ---------------------------------------------------------------------------
165
+ // Private helpers
166
+ // ---------------------------------------------------------------------------
167
+ /**
168
+ * Dispatch to a {@link BuiltinReducer} strategy or call a custom {@link ReducerFn}.
169
+ *
170
+ * @param reducer - The reducer to apply.
171
+ * @param existing - Value currently stored in `GraphState`.
172
+ * @param incoming - New value emitted by the most recently completed node.
173
+ * @returns The merged value.
174
+ */
175
+ applyReducer(reducer, existing, incoming) {
176
+ if (typeof reducer === 'function') {
177
+ return reducer(existing, incoming);
178
+ }
179
+ switch (reducer) {
180
+ case 'concat':
181
+ // Concatenate arrays; fall back to empty array for non-array operands.
182
+ return [
183
+ ...(Array.isArray(existing) ? existing : []),
184
+ ...(Array.isArray(incoming) ? incoming : []),
185
+ ];
186
+ case 'merge':
187
+ // Shallow-merge objects; right (incoming) wins on key collision.
188
+ return {
189
+ ...(typeof existing === 'object' && existing !== null ? existing : {}),
190
+ ...(typeof incoming === 'object' && incoming !== null ? incoming : {}),
191
+ };
192
+ case 'max':
193
+ return Math.max(existing, incoming);
194
+ case 'min':
195
+ return Math.min(existing, incoming);
196
+ case 'avg':
197
+ return (existing + incoming) / 2;
198
+ case 'sum':
199
+ return existing + incoming;
200
+ case 'last':
201
+ // Always overwrite — this is the default `scratch` field semantics.
202
+ return incoming;
203
+ case 'first':
204
+ // Preserve the first value ever written; ignore subsequent writes.
205
+ return existing;
206
+ case 'longest':
207
+ // Keep whichever operand has the greater string length (or array length).
208
+ return String(existing).length >= String(incoming).length ? existing : incoming;
209
+ default: {
210
+ // Exhaustiveness guard — should be unreachable at runtime if types are respected.
211
+ const _exhaustive = reducer;
212
+ return incoming;
213
+ }
214
+ }
215
+ }
216
+ /**
217
+ * Construct an empty {@link MemoryView} used during state initialisation.
218
+ */
219
+ emptyMemoryView() {
220
+ return {
221
+ traces: [],
222
+ pendingWrites: [],
223
+ totalTracesRead: 0,
224
+ readLatencyMs: 0,
225
+ };
226
+ }
227
+ /**
228
+ * Construct a zeroed {@link DiagnosticsView} used during state initialisation.
229
+ */
230
+ emptyDiagnostics() {
231
+ return {
232
+ totalTokensUsed: 0,
233
+ totalDurationMs: 0,
234
+ nodeTimings: {},
235
+ discoveryResults: {},
236
+ guardrailResults: {},
237
+ checkpointsSaved: 0,
238
+ memoryReads: 0,
239
+ memoryWrites: 0,
240
+ };
241
+ }
242
+ }
243
+ //# sourceMappingURL=StateManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateManager.js","sourceRoot":"","sources":["../../../src/orchestration/runtime/StateManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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QAAmB,GAAI,QAAmB,CAAC,GAAG,CAAC,CAAC;YAE3D,KAAK,KAAK;gBACR,OAAQ,QAAmB,GAAI,QAAmB,CAAC;YAErD,KAAK,MAAM;gBACT,oEAAoE;gBACpE,OAAO,QAAQ,CAAC;YAElB,KAAK,OAAO;gBACV,mEAAmE;gBACnE,OAAO,QAAQ,CAAC;YAElB,KAAK,SAAS;gBACZ,0EAA0E;gBAC1E,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;YAElF,OAAO,CAAC,CAAC,CAAC;gBACR,kFAAkF;gBAClF,MAAM,WAAW,GAAU,OAAO,CAAC;gBACnC,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACK,eAAe;QACrB,OAAO;YACL,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,CAAC;YAClB,aAAa,EAAE,CAAC;SACjB,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,OAAO;YACL,eAAe,EAAE,CAAC;YAClB,eAAe,EAAE,CAAC;YAClB,WAAW,EAAE,EAAE;YACf,gBAAgB,EAAE,EAAE;YACpB,gBAAgB,EAAE,EAAE;YACpB,gBAAgB,EAAE,CAAC;YACnB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;SAChB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file index.ts
3
+ * @description Barrel re-exports for the orchestration runtime subsystem.
4
+ *
5
+ * Consumers should import from this module rather than from individual files
6
+ * to keep import paths stable across internal refactors.
7
+ */
8
+ export { StateManager } from './StateManager.js';
9
+ export { NodeScheduler } from './NodeScheduler.js';
10
+ export { LoopController } from './LoopController.js';
11
+ export type { LoopConfig, LoopContext, LoopEvent } from './LoopController.js';
12
+ export { NodeExecutor } from './NodeExecutor.js';
13
+ export type { NodeExecutionResult } from './NodeExecutor.js';
14
+ export { GraphRuntime } from './GraphRuntime.js';
15
+ export type { GraphRuntimeConfig } from './GraphRuntime.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestration/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file index.ts
3
+ * @description Barrel re-exports for the orchestration runtime subsystem.
4
+ *
5
+ * Consumers should import from this module rather than from individual files
6
+ * to keep import paths stable across internal refactors.
7
+ */
8
+ export { StateManager } from './StateManager.js';
9
+ export { NodeScheduler } from './NodeScheduler.js';
10
+ export { LoopController } from './LoopController.js';
11
+ export { NodeExecutor } from './NodeExecutor.js';
12
+ export { GraphRuntime } from './GraphRuntime.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestration/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "Modular AgentOS orchestration library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -103,6 +103,11 @@
103
103
  "default": "./dist/discovery/index.js",
104
104
  "types": "./dist/discovery/index.d.ts"
105
105
  },
106
+ "./orchestration": {
107
+ "import": "./dist/orchestration/index.js",
108
+ "default": "./dist/orchestration/index.js",
109
+ "types": "./dist/orchestration/index.d.ts"
110
+ },
106
111
  "./memory/index": {
107
112
  "import": "./dist/memory/index.js",
108
113
  "default": "./dist/memory/index.js",
@@ -170,8 +175,8 @@
170
175
  "author": "Voice Chat Assistant Team",
171
176
  "license": "Apache-2.0",
172
177
  "optionalDependencies": {
173
- "compromise": "^14.15.0",
174
- "@huggingface/transformers": "^3.8.1"
178
+ "@huggingface/transformers": "^3.8.1",
179
+ "compromise": "^14.15.0"
175
180
  },
176
181
  "devDependencies": {
177
182
  "@eslint/js": "^9.11.0",
@@ -213,7 +218,8 @@
213
218
  "openredaction": "^1.1.2",
214
219
  "pino": "^9.14.0",
215
220
  "uuid": "^11.1.0",
216
- "yaml": "^2.8.1"
221
+ "yaml": "^2.8.1",
222
+ "zod": "^4.3.6"
217
223
  },
218
224
  "peerDependencies": {
219
225
  "@framers/sql-storage-adapter": ">=0.5.0",
@@ -1,12 +0,0 @@
1
- import type { ITool } from '../core/tools/ITool.js';
2
- export interface ToolDefinition {
3
- description?: string;
4
- parameters?: Record<string, unknown>;
5
- execute?: (args: any) => Promise<any>;
6
- }
7
- export type ToolDefinitionMap = Record<string, ToolDefinition | ITool>;
8
- /**
9
- * Adapts Zod schemas, JSON Schema objects, and ITool instances into ITool[].
10
- */
11
- export declare function adaptTools(tools: ToolDefinitionMap | undefined): ITool[];
12
- //# sourceMappingURL=tool-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-adapter.d.ts","sourceRoot":"","sources":["../../src/api/tool-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAA+D,MAAM,wBAAwB,CAAC;AAEjH,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACvC;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,KAAK,CAAC,CAAC;AAEvE;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,KAAK,EAAE,CAgDxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-adapter.js","sourceRoot":"","sources":["../../src/api/tool-adapter.ts"],"names":[],"mappings":"AAWA;;GAEG;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;QAE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