@framers/agentos 0.1.158 → 0.1.160
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/README.md +79 -0
- package/dist/api/agent.d.ts +26 -3
- package/dist/api/agent.d.ts.map +1 -1
- package/dist/api/agent.js +87 -5
- package/dist/api/agent.js.map +1 -1
- package/dist/api/agentExport.d.ts +5 -76
- package/dist/api/agentExport.d.ts.map +1 -1
- package/dist/api/agentExport.js +2 -96
- package/dist/api/agentExport.js.map +1 -1
- package/dist/api/agentExportCore.d.ts +52 -0
- package/dist/api/agentExportCore.d.ts.map +1 -0
- package/dist/api/agentExportCore.js +62 -0
- package/dist/api/agentExportCore.js.map +1 -0
- package/dist/api/generateText.d.ts +80 -1
- package/dist/api/generateText.d.ts.map +1 -1
- package/dist/api/generateText.js +115 -5
- package/dist/api/generateText.js.map +1 -1
- package/dist/api/index.d.ts +8 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/streamText.d.ts.map +1 -1
- package/dist/api/streamText.js +124 -6
- package/dist/api/streamText.js.map +1 -1
- package/dist/api/types.d.ts +2 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/extensions/types.d.ts +1 -1
- package/dist/extensions/types.d.ts.map +1 -1
- package/dist/extensions/types.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/memory/AgentMemory.d.ts.map +1 -1
- package/dist/memory/AgentMemory.js +1 -0
- package/dist/memory/AgentMemory.js.map +1 -1
- package/dist/memory/core/types.d.ts +1 -1
- package/dist/memory/core/types.d.ts.map +1 -1
- package/dist/memory/io/extension/CognitiveMemoryExtension.js +1 -1
- package/dist/memory/io/extension/CognitiveMemoryExtension.js.map +1 -1
- package/dist/memory/io/extension/StandaloneMemoryExtension.js +1 -1
- package/dist/memory/io/extension/StandaloneMemoryExtension.js.map +1 -1
- package/dist/memory/io/facade/Memory.d.ts +1 -0
- package/dist/memory/io/facade/Memory.d.ts.map +1 -1
- package/dist/memory/io/facade/Memory.js +62 -4
- package/dist/memory/io/facade/Memory.js.map +1 -1
- package/dist/memory/io/tools/MemoryAddTool.d.ts +1 -1
- package/dist/memory/io/tools/MemoryAddTool.js +1 -1
- package/dist/memory/io/tools/MemoryAddTool.js.map +1 -1
- package/dist/memory/io/tools/MemorySearchTool.js +1 -1
- package/dist/memory/io/tools/MemorySearchTool.js.map +1 -1
- package/dist/memory/pipeline/observation/MemoryReflector.js +1 -1
- package/dist/memory/pipeline/observation/MemoryReflector.js.map +1 -1
- package/dist/memory/retrieval/store/SqliteBrain.d.ts +3 -3
- package/dist/memory/retrieval/store/SqliteBrain.d.ts.map +1 -1
- package/dist/memory/retrieval/store/SqliteBrain.js +35 -23
- package/dist/memory/retrieval/store/SqliteBrain.js.map +1 -1
- package/dist/orchestration/ir/types.d.ts +2 -1
- package/dist/orchestration/ir/types.d.ts.map +1 -1
- package/dist/rag/unified/types.d.ts +1 -1
- package/dist/rag/unified/types.d.ts.map +1 -1
- package/dist/rag/unified/types.js +1 -1
- package/dist/rag/unified/types.js.map +1 -1
- package/package.json +21 -1
package/README.md
CHANGED
|
@@ -179,6 +179,44 @@ console.log(followUp.text);
|
|
|
179
179
|
const config = tutor.exportJSON();
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
+
The lightweight API also supports per-call model routing and lifecycle middleware without booting the full `AgentOS` runtime:
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
import type { IModelRouter } from '@framers/agentos';
|
|
186
|
+
|
|
187
|
+
const router: IModelRouter = {
|
|
188
|
+
routerId: 'fast-vs-quality',
|
|
189
|
+
async initialize() {},
|
|
190
|
+
async selectModel(params) {
|
|
191
|
+
if (params.optimizationPreference === 'speed') {
|
|
192
|
+
return null; // fall back to the caller's provider/model
|
|
193
|
+
}
|
|
194
|
+
return null;
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const reviewer = agent({
|
|
199
|
+
instructions: 'Review drafts for policy and tone.',
|
|
200
|
+
router,
|
|
201
|
+
skills: [{
|
|
202
|
+
skill: {
|
|
203
|
+
name: 'policy-review',
|
|
204
|
+
description: 'Review output before it is shown to users.',
|
|
205
|
+
content: 'Flag unsafe content and keep the tone concise.',
|
|
206
|
+
},
|
|
207
|
+
frontmatter: {} as any,
|
|
208
|
+
}],
|
|
209
|
+
onBeforeGeneration: async (ctx) => ({
|
|
210
|
+
...ctx,
|
|
211
|
+
messages: [{ role: 'system', content: 'User is on the free plan.' }, ...ctx.messages],
|
|
212
|
+
}),
|
|
213
|
+
onAfterGeneration: async (result) => ({
|
|
214
|
+
...result,
|
|
215
|
+
text: result.text.trim(),
|
|
216
|
+
}),
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
182
220
|
### 5. Multimodal (Image, Video, Audio, OCR, Embeddings)
|
|
183
221
|
|
|
184
222
|
```typescript
|
|
@@ -369,6 +407,47 @@ const secureBot = agent({
|
|
|
369
407
|
- **Grounding Guard** -- RAG-source claim verification and hallucination detection
|
|
370
408
|
- **Content Policy Rewriter** -- 8 categories, LLM rewrite/block, 4 presets
|
|
371
409
|
|
|
410
|
+
### 10. Citation Verification
|
|
411
|
+
|
|
412
|
+
Verify claims in agent responses against sources using cosine similarity:
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
import { CitationVerifier } from '@framers/agentos';
|
|
416
|
+
|
|
417
|
+
const verifier = new CitationVerifier({
|
|
418
|
+
embedFn: async (texts) => embeddingManager.embedBatch(texts),
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
const result = await verifier.verify(
|
|
422
|
+
"Tokyo has a population of 14 million. It is the capital of Japan.",
|
|
423
|
+
[
|
|
424
|
+
{ content: "Tokyo proper has a population of approximately 14 million.", url: "https://example.com" },
|
|
425
|
+
{ content: "Tokyo is the capital and largest city of Japan.", url: "https://example.com/japan" },
|
|
426
|
+
]
|
|
427
|
+
);
|
|
428
|
+
|
|
429
|
+
console.log(result.summary);
|
|
430
|
+
// "2/2 claims verified (100%)"
|
|
431
|
+
console.log(result.claims[0]);
|
|
432
|
+
// { text: "Tokyo has a population of 14 million.", verdict: "supported", confidence: 0.87 }
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
On-demand tool for agents:
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
// Agent can call verify_citations to check its own output
|
|
439
|
+
verify_citations({
|
|
440
|
+
text: "The speed of light is 300,000 km/s.",
|
|
441
|
+
webFallback: true, // search web if sources don't match
|
|
442
|
+
})
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Automatic during deep research — set `verifyCitations: true` in config:
|
|
446
|
+
|
|
447
|
+
```json
|
|
448
|
+
{ "queryRouter": { "verifyCitations": true } }
|
|
449
|
+
```
|
|
450
|
+
|
|
372
451
|
### Default Models Per Provider
|
|
373
452
|
|
|
374
453
|
When you specify `provider` without `model`, these defaults are used:
|
package/dist/api/agent.d.ts
CHANGED
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
* are not actively enforced in this lightweight layer — use the full AgentOS
|
|
9
9
|
* runtime (`AgentOSOrchestrator`) or `agency()` for guardrail enforcement.
|
|
10
10
|
*/
|
|
11
|
-
import { type FallbackProviderEntry, type GenerateTextOptions, type GenerateTextResult, type Message } from './generateText.js';
|
|
11
|
+
import { type FallbackProviderEntry, type GenerateTextOptions, type GenerateTextResult, type GenerationHookContext, type GenerationHookResult, type Message, type ToolCallHookInfo } from './generateText.js';
|
|
12
12
|
import { type StreamTextResult } from './streamText.js';
|
|
13
|
-
import
|
|
13
|
+
import type { IModelRouter } from '../core/llm/routing/IModelRouter.js';
|
|
14
|
+
import type { SkillEntry } from '../skills/types.js';
|
|
15
|
+
import type { AgentOSUsageAggregate, AgentOSUsageLedgerOptions } from './runtime/usageLedger.js';
|
|
14
16
|
import type { BaseAgentConfig } from './types.js';
|
|
15
|
-
import { type AgentExportConfig } from './
|
|
17
|
+
import { type AgentExportConfig } from './agentExportCore.js';
|
|
16
18
|
/**
|
|
17
19
|
* Configuration options for the {@link agent} factory function.
|
|
18
20
|
*
|
|
@@ -51,6 +53,27 @@ export interface AgentOptions extends BaseAgentConfig {
|
|
|
51
53
|
* @param fallbackProvider - The provider identifier being tried next.
|
|
52
54
|
*/
|
|
53
55
|
onFallback?: (error: Error, fallbackProvider: string) => void;
|
|
56
|
+
/** Model router for intelligent provider selection per-call. */
|
|
57
|
+
router?: IModelRouter;
|
|
58
|
+
/** Pre-generation hook, called before each LLM step. */
|
|
59
|
+
onBeforeGeneration?: (context: GenerationHookContext) => Promise<GenerationHookContext | void>;
|
|
60
|
+
/** Post-generation hook, called after each LLM step. */
|
|
61
|
+
onAfterGeneration?: (result: GenerationHookResult) => Promise<GenerationHookResult | void>;
|
|
62
|
+
/** Pre-tool-execution hook. */
|
|
63
|
+
onBeforeToolExecution?: (info: ToolCallHookInfo) => Promise<ToolCallHookInfo | null>;
|
|
64
|
+
/**
|
|
65
|
+
* Optional memory provider. When provided:
|
|
66
|
+
* - `session.send()`/`stream()` calls `memory.getContext()` before each turn
|
|
67
|
+
* and prepends results to the system prompt.
|
|
68
|
+
* - `session.send()`/`stream()` calls `memory.observe()` after each turn
|
|
69
|
+
* to encode the exchange into long-term memory.
|
|
70
|
+
*/
|
|
71
|
+
memoryProvider?: any;
|
|
72
|
+
/**
|
|
73
|
+
* Optional skill entries to inject into the system prompt.
|
|
74
|
+
* Skill content is appended to the system prompt as markdown sections.
|
|
75
|
+
*/
|
|
76
|
+
skills?: SkillEntry[];
|
|
54
77
|
}
|
|
55
78
|
/**
|
|
56
79
|
* A named conversation session returned by `Agent.session()`.
|
package/dist/api/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/api/agent.ts"],"names":[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K,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC1D,+DAA+D;IAC/D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG,iBAAiB,CAAC;IACpE;;;;OAIG;IACH,UAAU,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;CAC9D;AAmDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,KAAK,CAuP/C"}
|
package/dist/api/agent.js
CHANGED
|
@@ -10,12 +10,17 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { generateText, } from './generateText.js';
|
|
12
12
|
import { streamText } from './streamText.js';
|
|
13
|
-
import {
|
|
14
|
-
import { exportAgentConfig, exportAgentConfigJSON } from './agentExport.js';
|
|
13
|
+
import { exportAgentConfig, exportAgentConfigJSON } from './agentExportCore.js';
|
|
15
14
|
function mergeUsageLedgerOptions(...parts) {
|
|
16
15
|
const merged = Object.assign({}, ...parts.filter(Boolean));
|
|
17
16
|
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
18
17
|
}
|
|
18
|
+
async function loadRecordedAgentOSUsage(options) {
|
|
19
|
+
const { getRecordedAgentOSUsage } = await import('./runtime/usageLedger.js');
|
|
20
|
+
return getRecordedAgentOSUsage(options);
|
|
21
|
+
}
|
|
22
|
+
/** Timeout for memory operations to prevent blocking generation. */
|
|
23
|
+
const MEMORY_TIMEOUT_MS = 5000;
|
|
19
24
|
function buildSystemPrompt(opts) {
|
|
20
25
|
const sections = [];
|
|
21
26
|
if (opts.instructions?.trim()) {
|
|
@@ -32,6 +37,14 @@ function buildSystemPrompt(opts) {
|
|
|
32
37
|
sections.push(`Behavior traits: ${traits.join(', ')}.`);
|
|
33
38
|
}
|
|
34
39
|
}
|
|
40
|
+
// Append skill content as markdown sections
|
|
41
|
+
if (opts.skills?.length) {
|
|
42
|
+
for (const entry of opts.skills) {
|
|
43
|
+
if (entry.skill.content?.trim()) {
|
|
44
|
+
sections.push(entry.skill.content.trim());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
35
48
|
return sections.length > 0 ? sections.join('\n\n') : undefined;
|
|
36
49
|
}
|
|
37
50
|
/**
|
|
@@ -88,6 +101,10 @@ export function agent(opts) {
|
|
|
88
101
|
usageLedger: effectiveLedger,
|
|
89
102
|
fallbackProviders: opts.fallbackProviders,
|
|
90
103
|
onFallback: opts.onFallback,
|
|
104
|
+
router: opts.router,
|
|
105
|
+
onBeforeGeneration: opts.onBeforeGeneration,
|
|
106
|
+
onAfterGeneration: opts.onAfterGeneration,
|
|
107
|
+
onBeforeToolExecution: opts.onBeforeToolExecution,
|
|
91
108
|
};
|
|
92
109
|
const agentInstance = {
|
|
93
110
|
async generate(prompt, extra) {
|
|
@@ -118,11 +135,33 @@ export function agent(opts) {
|
|
|
118
135
|
return {
|
|
119
136
|
id: sessionId,
|
|
120
137
|
async send(text) {
|
|
138
|
+
// Memory recall before generation
|
|
139
|
+
let memorySystemMsg;
|
|
140
|
+
if (opts.memoryProvider?.getContext) {
|
|
141
|
+
try {
|
|
142
|
+
const ctx = await Promise.race([
|
|
143
|
+
opts.memoryProvider.getContext(text, { tokenBudget: 2000 }),
|
|
144
|
+
new Promise((resolve) => setTimeout(() => resolve(null), MEMORY_TIMEOUT_MS)),
|
|
145
|
+
]);
|
|
146
|
+
if (ctx?.contextText) {
|
|
147
|
+
memorySystemMsg = ctx.contextText;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
// Memory recall failure is non-fatal
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Prepend memory context to system prompt
|
|
155
|
+
let system = baseOpts.system;
|
|
156
|
+
if (memorySystemMsg) {
|
|
157
|
+
system = [memorySystemMsg, system].filter(Boolean).join('\n\n') || undefined;
|
|
158
|
+
}
|
|
121
159
|
const requestMessages = useMemory
|
|
122
160
|
? [...history, { role: 'user', content: text }]
|
|
123
161
|
: [{ role: 'user', content: text }];
|
|
124
162
|
const result = await generateText({
|
|
125
163
|
...baseOpts,
|
|
164
|
+
system,
|
|
126
165
|
messages: requestMessages,
|
|
127
166
|
usageLedger: mergeUsageLedgerOptions(baseOpts.usageLedger, {
|
|
128
167
|
sessionId,
|
|
@@ -133,14 +172,50 @@ export function agent(opts) {
|
|
|
133
172
|
history.push({ role: 'user', content: text });
|
|
134
173
|
history.push({ role: 'assistant', content: result.text });
|
|
135
174
|
}
|
|
175
|
+
// Memory observe after generation (fire-and-forget)
|
|
176
|
+
if (opts.memoryProvider?.observe) {
|
|
177
|
+
opts.memoryProvider.observe('user', text).catch(() => { });
|
|
178
|
+
if (result.text) {
|
|
179
|
+
opts.memoryProvider.observe('assistant', result.text).catch(() => { });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
136
182
|
return result;
|
|
137
183
|
},
|
|
138
184
|
stream(text) {
|
|
185
|
+
// For streaming, use onBeforeGeneration hook to inject memory context
|
|
186
|
+
const originalBeforeHook = baseOpts.onBeforeGeneration;
|
|
139
187
|
const result = streamText({
|
|
140
188
|
...baseOpts,
|
|
141
189
|
messages: useMemory
|
|
142
190
|
? [...history, { role: 'user', content: text }]
|
|
143
191
|
: [{ role: 'user', content: text }],
|
|
192
|
+
onBeforeGeneration: opts.memoryProvider?.getContext
|
|
193
|
+
? async (ctx) => {
|
|
194
|
+
// Inject memory context
|
|
195
|
+
try {
|
|
196
|
+
const memCtx = await Promise.race([
|
|
197
|
+
opts.memoryProvider.getContext(text, { tokenBudget: 2000 }),
|
|
198
|
+
new Promise((resolve) => setTimeout(() => resolve(null), MEMORY_TIMEOUT_MS)),
|
|
199
|
+
]);
|
|
200
|
+
if (memCtx?.contextText) {
|
|
201
|
+
ctx = {
|
|
202
|
+
...ctx,
|
|
203
|
+
messages: [
|
|
204
|
+
{ role: 'system', content: memCtx.contextText },
|
|
205
|
+
...ctx.messages,
|
|
206
|
+
],
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch { /* non-fatal */ }
|
|
211
|
+
// Chain with user's hook if present
|
|
212
|
+
if (originalBeforeHook) {
|
|
213
|
+
const userResult = await originalBeforeHook(ctx);
|
|
214
|
+
return userResult ?? ctx;
|
|
215
|
+
}
|
|
216
|
+
return ctx;
|
|
217
|
+
}
|
|
218
|
+
: originalBeforeHook,
|
|
144
219
|
usageLedger: mergeUsageLedgerOptions(baseOpts.usageLedger, {
|
|
145
220
|
sessionId,
|
|
146
221
|
source: 'agent.session.stream',
|
|
@@ -150,7 +225,14 @@ export function agent(opts) {
|
|
|
150
225
|
if (useMemory) {
|
|
151
226
|
history.push({ role: 'user', content: text });
|
|
152
227
|
void result.text
|
|
153
|
-
.then((replyText) =>
|
|
228
|
+
.then((replyText) => {
|
|
229
|
+
history.push({ role: 'assistant', content: replyText });
|
|
230
|
+
// Memory observe after stream completes
|
|
231
|
+
if (opts.memoryProvider?.observe) {
|
|
232
|
+
opts.memoryProvider.observe('user', text).catch(() => { });
|
|
233
|
+
opts.memoryProvider.observe('assistant', replyText).catch(() => { });
|
|
234
|
+
}
|
|
235
|
+
})
|
|
154
236
|
.catch(() => {
|
|
155
237
|
/* history update failed, non-critical */
|
|
156
238
|
});
|
|
@@ -161,7 +243,7 @@ export function agent(opts) {
|
|
|
161
243
|
return [...history];
|
|
162
244
|
},
|
|
163
245
|
async usage() {
|
|
164
|
-
return
|
|
246
|
+
return loadRecordedAgentOSUsage({
|
|
165
247
|
enabled: baseOpts.usageLedger?.enabled,
|
|
166
248
|
path: baseOpts.usageLedger?.path,
|
|
167
249
|
sessionId,
|
|
@@ -173,7 +255,7 @@ export function agent(opts) {
|
|
|
173
255
|
};
|
|
174
256
|
},
|
|
175
257
|
async usage(sessionId) {
|
|
176
|
-
return
|
|
258
|
+
return loadRecordedAgentOSUsage({
|
|
177
259
|
enabled: baseOpts.usageLedger?.enabled,
|
|
178
260
|
path: baseOpts.usageLedger?.path,
|
|
179
261
|
sessionId,
|
package/dist/api/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/api/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/api/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,YAAY,GAQb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAC;AAQpE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAA0B,MAAM,sBAAsB,CAAC;AA2IxG,SAAS,uBAAuB,CAC9B,GAAG,KAAmD;IAEtD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,KAAK,UAAU,wBAAwB,CACrC,OAAyF;IAEzF,MAAM,EAAE,uBAAuB,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAC7E,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,oEAAoE;AACpE,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B,SAAS,iBAAiB,CAAC,IAAkB;IAC3C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;QAC9B,QAAQ,CAA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,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -28,82 +28,11 @@
|
|
|
28
28
|
* const reply = await restored.generate('Hello!');
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
import type {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* and type discriminator so import logic can reconstruct the correct agent
|
|
37
|
-
* variant (single agent vs. multi-agent agency).
|
|
38
|
-
*/
|
|
39
|
-
export interface AgentExportConfig {
|
|
40
|
-
/** Schema version for forward-compatible deserialization. */
|
|
41
|
-
version: '1.0.0';
|
|
42
|
-
/** ISO 8601 timestamp of when the export was created. */
|
|
43
|
-
exportedAt: string;
|
|
44
|
-
/**
|
|
45
|
-
* Discriminator: `'agent'` for a single-agent export, `'agency'` for
|
|
46
|
-
* a multi-agent export that includes a sub-agent roster.
|
|
47
|
-
*/
|
|
48
|
-
type: 'agent' | 'agency';
|
|
49
|
-
/** The full agent configuration. */
|
|
50
|
-
config: BaseAgentConfig;
|
|
51
|
-
/** Sub-agent roster keyed by agent name. Present for agency exports. */
|
|
52
|
-
agents?: Record<string, BaseAgentConfig>;
|
|
53
|
-
/** Orchestration strategy. Present for agency exports. */
|
|
54
|
-
strategy?: AgencyStrategy;
|
|
55
|
-
/** Whether runtime strategy adaptation is enabled. */
|
|
56
|
-
adaptive?: boolean;
|
|
57
|
-
/** Maximum orchestration rounds for iterative strategies. */
|
|
58
|
-
maxRounds?: number;
|
|
59
|
-
/** Human-readable metadata about the export (name, author, tags, etc.). */
|
|
60
|
-
metadata?: {
|
|
61
|
-
/** Display name for the exported agent. */
|
|
62
|
-
name?: string;
|
|
63
|
-
/** Free-text description of what this agent does. */
|
|
64
|
-
description?: string;
|
|
65
|
-
/** Author identifier (person or system). */
|
|
66
|
-
author?: string;
|
|
67
|
-
/** Searchable tags for categorization. */
|
|
68
|
-
tags?: string[];
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Exports an agent's configuration as a portable {@link AgentExportConfig} object.
|
|
73
|
-
*
|
|
74
|
-
* Captures the full `BaseAgentConfig` including model, instructions,
|
|
75
|
-
* personality, tools, guardrails, memory, RAG, voice, channels, and all
|
|
76
|
-
* other configuration surfaces. For agency instances, the sub-agent roster,
|
|
77
|
-
* strategy, and round limits are also included.
|
|
78
|
-
*
|
|
79
|
-
* @param agentInstance - The agent (or agency) instance to export.
|
|
80
|
-
* @param metadata - Optional human-readable metadata to attach to the export.
|
|
81
|
-
* @returns A portable config object that can be serialized to JSON or YAML.
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* const config = exportAgentConfig(myAgent, {
|
|
86
|
-
* name: 'Research Assistant',
|
|
87
|
-
* author: 'team-alpha',
|
|
88
|
-
* tags: ['research', 'summarization'],
|
|
89
|
-
* });
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
export declare function exportAgentConfig(agentInstance: Agent, metadata?: AgentExportConfig['metadata']): AgentExportConfig;
|
|
93
|
-
/**
|
|
94
|
-
* Exports an agent's configuration as a pretty-printed JSON string.
|
|
95
|
-
*
|
|
96
|
-
* @param agentInstance - The agent (or agency) instance to export.
|
|
97
|
-
* @param metadata - Optional human-readable metadata to attach.
|
|
98
|
-
* @returns JSON string with 2-space indentation.
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```ts
|
|
102
|
-
* const json = exportAgentConfigJSON(myAgent);
|
|
103
|
-
* fs.writeFileSync('agent.json', json);
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
export declare function exportAgentConfigJSON(agentInstance: Agent, metadata?: AgentExportConfig['metadata']): string;
|
|
31
|
+
import type { Agent } from './types.js';
|
|
32
|
+
import { exportAgentConfig, exportAgentConfigJSON } from './agentExportCore.js';
|
|
33
|
+
export { exportAgentConfig, exportAgentConfigJSON };
|
|
34
|
+
export type { AgentExportConfig } from './agentExportCore.js';
|
|
35
|
+
import type { AgentExportConfig } from './agentExportCore.js';
|
|
107
36
|
/**
|
|
108
37
|
* Exports an agent's configuration as a YAML string.
|
|
109
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentExport.d.ts","sourceRoot":"","sources":["../../src/api/agentExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"agentExport.d.ts","sourceRoot":"","sources":["../../src/api/agentExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,OAAO,KAAK,EAAkD,KAAK,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;AACpD,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,KAAK,EACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,GACvC,MAAM,CAER;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,iBAAiB,GAAG,KAAK,CAiDlE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAGvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAG1D;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAyDzF"}
|
package/dist/api/agentExport.js
CHANGED
|
@@ -31,102 +31,8 @@
|
|
|
31
31
|
import YAML from 'yaml';
|
|
32
32
|
import { agent as createAgent } from './agent.js';
|
|
33
33
|
import { agency as createAgency } from './agency.js';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// ============================================================================
|
|
37
|
-
/**
|
|
38
|
-
* Extracts the stored configuration from an Agent instance.
|
|
39
|
-
*
|
|
40
|
-
* The agent's config is captured at creation time by the `agent()` and
|
|
41
|
-
* `agency()` factories and attached as a non-enumerable `__config` property.
|
|
42
|
-
* If the property is absent (e.g. the agent was created by external code),
|
|
43
|
-
* we return an empty config.
|
|
44
|
-
*
|
|
45
|
-
* @param agentInstance - The agent to extract config from.
|
|
46
|
-
* @returns The stored BaseAgentConfig or an empty object.
|
|
47
|
-
*/
|
|
48
|
-
function extractConfig(agentInstance) {
|
|
49
|
-
// The __config property is set by our patched agent/agency factories
|
|
50
|
-
const config = agentInstance.__config;
|
|
51
|
-
if (config && typeof config === 'object') {
|
|
52
|
-
return config;
|
|
53
|
-
}
|
|
54
|
-
// Fallback: no stored config — return empty
|
|
55
|
-
return {};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Extracts agency-specific fields from an Agent instance that was created
|
|
59
|
-
* by the `agency()` factory.
|
|
60
|
-
*
|
|
61
|
-
* @param agentInstance - The agent/agency to extract from.
|
|
62
|
-
* @returns Agency fields if present, or undefined for plain agents.
|
|
63
|
-
*/
|
|
64
|
-
function extractAgencyFields(agentInstance) {
|
|
65
|
-
const raw = agentInstance.__agencyConfig;
|
|
66
|
-
if (raw && typeof raw === 'object') {
|
|
67
|
-
return raw;
|
|
68
|
-
}
|
|
69
|
-
return undefined;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Exports an agent's configuration as a portable {@link AgentExportConfig} object.
|
|
73
|
-
*
|
|
74
|
-
* Captures the full `BaseAgentConfig` including model, instructions,
|
|
75
|
-
* personality, tools, guardrails, memory, RAG, voice, channels, and all
|
|
76
|
-
* other configuration surfaces. For agency instances, the sub-agent roster,
|
|
77
|
-
* strategy, and round limits are also included.
|
|
78
|
-
*
|
|
79
|
-
* @param agentInstance - The agent (or agency) instance to export.
|
|
80
|
-
* @param metadata - Optional human-readable metadata to attach to the export.
|
|
81
|
-
* @returns A portable config object that can be serialized to JSON or YAML.
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* const config = exportAgentConfig(myAgent, {
|
|
86
|
-
* name: 'Research Assistant',
|
|
87
|
-
* author: 'team-alpha',
|
|
88
|
-
* tags: ['research', 'summarization'],
|
|
89
|
-
* });
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
export function exportAgentConfig(agentInstance, metadata) {
|
|
93
|
-
const config = extractConfig(agentInstance);
|
|
94
|
-
const agencyFields = extractAgencyFields(agentInstance);
|
|
95
|
-
const isAgency = !!agencyFields?.agents;
|
|
96
|
-
const exportConfig = {
|
|
97
|
-
version: '1.0.0',
|
|
98
|
-
exportedAt: new Date().toISOString(),
|
|
99
|
-
type: isAgency ? 'agency' : 'agent',
|
|
100
|
-
config,
|
|
101
|
-
};
|
|
102
|
-
// Attach agency-specific fields when present
|
|
103
|
-
if (isAgency && agencyFields) {
|
|
104
|
-
exportConfig.agents = agencyFields.agents;
|
|
105
|
-
exportConfig.strategy = agencyFields.strategy;
|
|
106
|
-
exportConfig.adaptive = agencyFields.adaptive;
|
|
107
|
-
exportConfig.maxRounds = agencyFields.maxRounds;
|
|
108
|
-
}
|
|
109
|
-
if (metadata) {
|
|
110
|
-
exportConfig.metadata = metadata;
|
|
111
|
-
}
|
|
112
|
-
return exportConfig;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Exports an agent's configuration as a pretty-printed JSON string.
|
|
116
|
-
*
|
|
117
|
-
* @param agentInstance - The agent (or agency) instance to export.
|
|
118
|
-
* @param metadata - Optional human-readable metadata to attach.
|
|
119
|
-
* @returns JSON string with 2-space indentation.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```ts
|
|
123
|
-
* const json = exportAgentConfigJSON(myAgent);
|
|
124
|
-
* fs.writeFileSync('agent.json', json);
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
export function exportAgentConfigJSON(agentInstance, metadata) {
|
|
128
|
-
return JSON.stringify(exportAgentConfig(agentInstance, metadata), null, 2);
|
|
129
|
-
}
|
|
34
|
+
import { exportAgentConfig, exportAgentConfigJSON } from './agentExportCore.js';
|
|
35
|
+
export { exportAgentConfig, exportAgentConfigJSON };
|
|
130
36
|
/**
|
|
131
37
|
* Exports an agent's configuration as a YAML string.
|
|
132
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentExport.js","sourceRoot":"","sources":["../../src/api/agentExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"agentExport.js","sourceRoot":"","sources":["../../src/api/agentExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;AAIpD;;;;;;;;;;;;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AC,IAAI,CACT,qBAAqB,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,GAAG,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAChG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC;QACxF,MAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared export-only helpers for lightweight agents and agencies.
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from `agentExport.ts` so the lightweight `agent()` entrypoint
|
|
5
|
+
* can expose config export methods without pulling in agency import/runtime
|
|
6
|
+
* code and optional channel adapters.
|
|
7
|
+
*/
|
|
8
|
+
import type { BaseAgentConfig, AgencyStrategy, Agent } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Portable agent configuration envelope.
|
|
11
|
+
*
|
|
12
|
+
* Wraps a `BaseAgentConfig` with version metadata, export timestamp,
|
|
13
|
+
* and type discriminator so import logic can reconstruct the correct agent
|
|
14
|
+
* variant (single agent vs. multi-agent agency).
|
|
15
|
+
*/
|
|
16
|
+
export interface AgentExportConfig {
|
|
17
|
+
/** Schema version for forward-compatible deserialization. */
|
|
18
|
+
version: '1.0.0';
|
|
19
|
+
/** ISO 8601 timestamp of when the export was created. */
|
|
20
|
+
exportedAt: string;
|
|
21
|
+
/**
|
|
22
|
+
* Discriminator: `'agent'` for a single-agent export, `'agency'` for
|
|
23
|
+
* a multi-agent export that includes a sub-agent roster.
|
|
24
|
+
*/
|
|
25
|
+
type: 'agent' | 'agency';
|
|
26
|
+
/** The full agent configuration. */
|
|
27
|
+
config: BaseAgentConfig;
|
|
28
|
+
/** Sub-agent roster keyed by agent name. Present for agency exports. */
|
|
29
|
+
agents?: Record<string, BaseAgentConfig>;
|
|
30
|
+
/** Orchestration strategy. Present for agency exports. */
|
|
31
|
+
strategy?: AgencyStrategy;
|
|
32
|
+
/** Whether runtime strategy adaptation is enabled. */
|
|
33
|
+
adaptive?: boolean;
|
|
34
|
+
/** Maximum orchestration rounds for iterative strategies. */
|
|
35
|
+
maxRounds?: number;
|
|
36
|
+
/** Human-readable metadata about the export (name, author, tags, etc.). */
|
|
37
|
+
metadata?: {
|
|
38
|
+
name?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
author?: string;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Exports an agent's configuration as a portable object.
|
|
46
|
+
*/
|
|
47
|
+
export declare function exportAgentConfig(agentInstance: Agent, metadata?: AgentExportConfig['metadata']): AgentExportConfig;
|
|
48
|
+
/**
|
|
49
|
+
* Exports an agent's configuration as pretty-printed JSON.
|
|
50
|
+
*/
|
|
51
|
+
export declare function exportAgentConfigJSON(agentInstance: Agent, metadata?: AgentExportConfig['metadata']): string;
|
|
52
|
+
//# sourceMappingURL=agentExportCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentExportCore.d.ts","sourceRoot":"","sources":["../../src/api/agentExportCore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;IAEjB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAEzB,oCAAoC;IACpC,MAAM,EAAE,eAAe,CAAC;IAExB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAEzC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAwCD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,KAAK,EACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,GACvC,iBAAiB,CAwBnB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,KAAK,EACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,GACvC,MAAM,CAER"}
|