@framers/agentos 0.1.142 → 0.1.144

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 CHANGED
@@ -25,9 +25,15 @@
25
25
 
26
26
  - [Overview](#overview)
27
27
  - [Quick Start](#quick-start)
28
- - [Multi-Agent Teams with agency()](#multi-agent-teams-with-agency)
29
- - [Single-Agent and Low-Level Helpers](#single-agent-and-low-level-helpers)
30
- - [Advanced: AgentGraph and Full Runtime](#advanced-agentgraph-and-full-runtime)
28
+ - [1. Generate Text (Provider-First)](#1-generate-text-provider-first)
29
+ - [2. Agent with Personality & Memory](#2-agent-with-personality--memory)
30
+ - [3. Multimodal RAG](#3-multimodal-rag)
31
+ - [4. Structured Output (Zod Validation)](#4-structured-output-zod-validation)
32
+ - [5. Workflows & Graphs](#5-workflows--graphs)
33
+ - [6. Multi-Agent Teams](#6-multi-agent-teams)
34
+ - [7. Voice Pipeline](#7-voice-pipeline)
35
+ - [8. Guardrails & Security](#8-guardrails--security)
36
+ - [Default Models Per Provider](#default-models-per-provider)
31
37
  - [System Architecture](#system-architecture)
32
38
  - [Architecture Diagram](#architecture-diagram)
33
39
  - [Request Lifecycle](#request-lifecycle)
@@ -153,349 +159,219 @@
153
159
  npm install @framers/agentos
154
160
  ```
155
161
 
156
- **Requirements:** Node.js 18+ and TypeScript 5.0+
162
+ Set any provider's API key and you're ready:
157
163
 
158
- **Start here:**
159
-
160
- - Use [`agency()`](./docs/orchestration/AGENCY_API.md) to coordinate a team of agents with a single call.
161
- - Use [`generateText()` / `streamText()` / `generateObject()` / `streamObject()` / `embedText()` / `generateImage()` / `agent()`](./docs/getting-started/HIGH_LEVEL_API.md) for the fastest path from prompt to working code.
162
- - Use [`AgentOS`](#advanced-agentgraph-and-full-runtime) when you need extensions, workflows, personas, or full runtime lifecycle control.
163
- - Browse the live docs at [docs.agentos.sh/getting-started/high-level-api](https://docs.agentos.sh/getting-started/high-level-api) and [docs.agentos.sh/api](https://docs.agentos.sh/api).
164
+ ```bash
165
+ export OPENAI_API_KEY=sk-... # or ANTHROPIC_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, etc.
166
+ ```
164
167
 
165
- ### Multi-Agent Teams with `agency()`
168
+ ### 1. Generate Text (Provider-First)
166
169
 
167
- `agency()` is the recommended starting point for any task that benefits from
168
- multiple specialised agents. Three lines to go from prompt to a coordinated
169
- research-and-writing pipeline:
170
+ No model strings needed AgentOS picks the best default:
170
171
 
171
172
  ```typescript
172
- import { agency } from '@framers/agentos';
173
+ import { generateText, streamText } from '@framers/agentos';
173
174
 
174
- const team = agency({
175
- agents: {
176
- researcher: { instructions: 'Find relevant facts.' },
177
- writer: { instructions: 'Write a clear, concise summary.' },
178
- },
179
- strategy: 'sequential',
175
+ const result = await generateText({
176
+ provider: 'anthropic',
177
+ prompt: 'Explain how TCP handshakes work in 3 bullets.',
180
178
  });
181
-
182
- const result = await team.generate('Summarise recent advances in fusion energy.');
183
179
  console.log(result.text);
184
- ```
185
-
186
- Set any provider's API key (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`,
187
- `GROQ_API_KEY`, `OLLAMA_BASE_URL`, etc.) and the agency auto-detects the provider.
188
- All five strategies are available out of the box:
189
180
 
190
- | Strategy | What it does |
191
- |---|---|
192
- | `sequential` | Agents run in order; each receives the previous output as context |
193
- | `parallel` | All agents run concurrently; results are merged by a synthesis step |
194
- | `debate` | Agents argue and refine a shared answer over multiple rounds |
195
- | `review-loop` | One agent drafts, another reviews and requests revisions |
196
- | `hierarchical` | A coordinator dispatches sub-tasks to specialist agents at runtime |
197
- | `graph` | Explicit dependency DAG via `dependsOn`; tiers run concurrently |
198
-
199
- **Graph strategy** — declare dependencies between agents and let the orchestrator
200
- handle topological ordering and concurrent execution:
201
-
202
- ```typescript
203
- const team = agency({
204
- agents: {
205
- researcher: { instructions: 'Research the topic.' },
206
- writer: { instructions: 'Write an article.', dependsOn: ['researcher'] },
207
- illustrator: { instructions: 'Describe illustrations.', dependsOn: ['researcher'] },
208
- reviewer: { instructions: 'Review everything.', dependsOn: ['writer', 'illustrator'] },
209
- },
210
- strategy: 'graph', // auto-detected when any agent has dependsOn
211
- });
181
+ // Streaming
182
+ for await (const chunk of streamText({ provider: 'openai', prompt: 'Explain SYN-ACK.' }).textStream) {
183
+ process.stdout.write(chunk);
184
+ }
212
185
  ```
213
186
 
214
- Add guardrails, HITL, resource controls, observability, `listen()` for voice
215
- transport, `connect()` for channel adapters, RAG context injection, and real
216
- per-agent stream events in the same config object — see
217
- [`docs/orchestration/AGENCY_API.md`](./docs/orchestration/AGENCY_API.md) for the full reference.
187
+ 16 providers supported. Automatic fallback when one fails (402/429/5xx tries next available key).
218
188
 
219
- ### Single-Agent and Low-Level Helpers
189
+ ### 2. Agent with Personality & Memory
220
190
 
221
- Use the streamlined helpers when you want AI SDK-style text generation, structured
222
- output extraction, embedding generation, image generation, or a single stateful
223
- session without a multi-agent team.
224
-
225
- #### Provider-First Pattern (Recommended)
226
-
227
- The recommended way to call any helper is **provider-first**: specify the provider
228
- name and let AgentOS pick the best default model automatically. No model string
229
- needed -- just set the matching environment variable and go.
191
+ Agents have HEXACO personality traits that shape their communication style, and cognitive memory with Ebbinghaus decay:
230
192
 
231
193
  ```typescript
232
- import { generateText, streamText, agent } from '@framers/agentos';
233
-
234
- // Provider-first -- AgentOS picks the best default model
235
- const result = await generateText({
236
- provider: 'openai',
237
- prompt: 'Explain TCP handshakes in 3 bullets.',
238
- });
194
+ import { agent } from '@framers/agentos';
239
195
 
240
- // Works with any provider -- just change the name
241
- const result2 = await generateText({
196
+ const tutor = agent({
242
197
  provider: 'anthropic',
243
- prompt: 'Explain TCP handshakes in 3 bullets.',
244
- });
245
-
246
- // Local models via Ollama -- zero API keys
247
- const result3 = await generateText({
248
- provider: 'ollama',
249
- prompt: 'Explain TCP handshakes in 3 bullets.',
198
+ instructions: 'You are a patient computer science tutor.',
199
+ personality: {
200
+ openness: 0.9, // creative, exploratory answers
201
+ conscientiousness: 0.95, // thorough, well-structured
202
+ agreeableness: 0.85, // warm, encouraging tone
203
+ },
204
+ memory: {
205
+ enabled: true,
206
+ cognitive: true, // Ebbinghaus decay, reconsolidation, involuntary recall
207
+ },
250
208
  });
251
- ```
252
-
253
- The same pattern works across **every helper function**: `generateText`, `streamText`,
254
- `generateObject`, `streamObject`, `embedText`, `generateImage`, and `agent`.
255
209
 
256
- #### Default Models Per Provider
257
-
258
- When you use the provider-first pattern, AgentOS resolves the default model
259
- from a built-in registry. Set the matching env var and you are ready to go:
260
-
261
- | Provider | Default Model | Env Var |
262
- |---|---|---|
263
- | `openai` | `gpt-4o` | `OPENAI_API_KEY` |
264
- | `anthropic` | `claude-sonnet-4-20250514` | `ANTHROPIC_API_KEY` |
265
- | `gemini` | `gemini-2.5-flash` | `GEMINI_API_KEY` |
266
- | `ollama` | `llama3.2` | `OLLAMA_BASE_URL` |
267
- | `groq` | `llama-3.3-70b-versatile` | `GROQ_API_KEY` |
268
- | `openrouter` | `openai/gpt-4o` | `OPENROUTER_API_KEY` |
269
- | `together` | `Meta-Llama-3.1-70B-Instruct-Turbo` | `TOGETHER_API_KEY` |
270
- | `mistral` | `mistral-large-latest` | `MISTRAL_API_KEY` |
271
- | `xai` | `grok-2` | `XAI_API_KEY` |
210
+ const session = tutor.session('student-1');
211
+ const reply = await session.send('Explain recursion with an analogy.');
212
+ console.log(reply.text);
272
213
 
273
- See `src/api/runtime/provider-defaults.ts` for the full registry including image
274
- and embedding defaults.
214
+ // Memory persists across sessions — the agent remembers context
215
+ const followUp = await session.send('Can you expand on that?');
216
+ console.log(followUp.text);
217
+ ```
275
218
 
276
- #### Multi-Provider Showcase
219
+ ### 3. Multimodal RAG
277
220
 
278
- The **same prompt** works across every supported provider -- swap one string:
221
+ Ingest documents, images, and structured data retrieve with HyDE (Hypothetical Document Embedding):
279
222
 
280
223
  ```typescript
281
- import { generateText } from '@framers/agentos';
282
-
283
- // OpenAI
284
- await generateText({ provider: 'openai', prompt: 'What is QUIC?' });
224
+ import { agent } from '@framers/agentos';
285
225
 
286
- // Anthropic
287
- await generateText({ provider: 'anthropic', prompt: 'What is QUIC?' });
288
-
289
- // Google Gemini
290
- await generateText({ provider: 'gemini', prompt: 'What is QUIC?' });
291
-
292
- // Groq (fast inference)
293
- await generateText({ provider: 'groq', prompt: 'What is QUIC?' });
294
-
295
- // Local via Ollama (no API key needed)
296
- await generateText({ provider: 'ollama', prompt: 'What is QUIC?' });
226
+ const analyst = agent({
227
+ provider: 'openai',
228
+ instructions: 'You are a financial analyst. Answer questions using provided documents.',
229
+ rag: {
230
+ enabled: true,
231
+ mode: 'aggressive', // always retrieves before answering
232
+ topK: 10,
233
+ strategy: 'hyde', // generates hypothetical answers for better retrieval
234
+ },
235
+ });
297
236
 
298
- // OpenRouter (200+ models, auto-routing)
299
- await generateText({ provider: 'openrouter', prompt: 'What is QUIC?' });
237
+ const session = analyst.session('q4-review');
300
238
 
301
- // Mistral
302
- await generateText({ provider: 'mistral', prompt: 'What is QUIC?' });
239
+ // Ingest documents
240
+ await session.ingest('Q4 revenue grew 23% YoY to $4.2B...');
241
+ await session.ingest({ type: 'file', path: './earnings-report.pdf' });
303
242
 
304
- // xAI (Grok)
305
- await generateText({ provider: 'xai', prompt: 'What is QUIC?' });
243
+ const answer = await session.send('What drove revenue growth in Q4?');
244
+ console.log(answer.text); // Cites specific passages from ingested docs
306
245
  ```
307
246
 
308
- #### Provider + Model Override
247
+ ### 4. Structured Output (Zod Validation)
309
248
 
310
- When you need a specific model instead of the default, pass both:
249
+ Extract typed data from unstructured text:
311
250
 
312
251
  ```typescript
313
- // Cheaper model for high-volume workloads
314
- await generateText({
315
- provider: 'openai',
316
- model: 'gpt-4o-mini',
317
- prompt: 'Classify this support ticket.',
318
- });
252
+ import { generateObject } from '@framers/agentos';
253
+ import { z } from 'zod';
319
254
 
320
- // Specific Anthropic model
321
- await generateText({
322
- provider: 'anthropic',
323
- model: 'claude-haiku-4-5-20251001',
324
- prompt: 'Summarise this paragraph.',
255
+ const { object } = await generateObject({
256
+ provider: 'gemini',
257
+ schema: z.object({
258
+ name: z.string(),
259
+ sentiment: z.enum(['positive', 'negative', 'neutral']),
260
+ topics: z.array(z.string()),
261
+ }),
262
+ prompt: 'Analyze: "The new iPhone camera is incredible but the battery life is disappointing."',
325
263
  });
326
264
 
327
- // Specific Ollama model
328
- await generateText({
329
- provider: 'ollama',
330
- model: 'codellama',
331
- prompt: 'Write a Python fizzbuzz.',
332
- });
265
+ console.log(object);
266
+ // { name: "iPhone Review", sentiment: "mixed", topics: ["camera", "battery"] }
333
267
  ```
334
268
 
335
- #### Global Defaults via Environment Variables
269
+ ### 5. Workflows & Graphs
336
270
 
337
- AgentOS auto-detects your active provider by scanning environment variables in
338
- priority order. Set one key and every call uses that provider automatically --
339
- no `provider` field needed:
340
-
341
- ```bash
342
- # Set one of these -- AgentOS picks the first it finds:
343
- # Priority: OPENROUTER > OPENAI > ANTHROPIC > GEMINI > GROQ > TOGETHER > MISTRAL > XAI > OLLAMA
344
- export ANTHROPIC_API_KEY=sk-ant-...
345
- ```
271
+ Deterministic multi-step pipelines with branching, parallel execution, and checkpointing:
346
272
 
347
273
  ```typescript
348
- import { generateText } from '@framers/agentos';
274
+ import { workflow } from '@framers/agentos';
349
275
 
350
- // No provider or model needed -- auto-detected from env vars
351
- const result = await generateText({ prompt: 'Hello world' });
352
- ```
276
+ const pipeline = workflow('content-pipeline')
277
+ .step('research', { provider: 'anthropic', instructions: 'Research the topic thoroughly.' })
278
+ .step('draft', { provider: 'openai', instructions: 'Write a blog post from the research.' })
279
+ .step('review', { provider: 'anthropic', instructions: 'Review for accuracy and tone.' })
280
+ .step('publish', { tool: 'blog_publish' });
353
281
 
354
- #### Legacy Format
355
-
356
- The `provider:model` string format still works but provider-first is preferred:
357
-
358
- ```typescript
359
- // Legacy format -- still fully supported but not recommended for new code
360
- await generateText({ model: 'openai:gpt-4o', prompt: '...' });
361
- await generateText({ model: 'anthropic:claude-sonnet-4-20250514', prompt: '...' });
362
- await generateText({ model: 'ollama:llama3.2', prompt: '...' });
282
+ const result = await pipeline.run('Write a post about WebAssembly in 2026.');
283
+ console.log(result.text);
363
284
  ```
364
285
 
365
- #### Streaming, Structured Output, Images, and Embeddings
366
-
367
- ```typescript
368
- import {
369
- agent, embedText, generateImage, generateObject, streamText, streamObject,
370
- } from '@framers/agentos';
371
- import { z } from 'zod';
286
+ ### 6. Multi-Agent Teams
372
287
 
373
- // Streaming with Anthropic
374
- const live = streamText({
375
- provider: 'anthropic',
376
- prompt: 'Stream a short explanation of SYN, SYN-ACK, ACK.',
377
- });
288
+ Coordinate specialized agents with built-in strategies:
378
289
 
379
- for await (const delta of live.textStream) {
380
- process.stdout.write(delta);
381
- }
290
+ ```typescript
291
+ import { agency } from '@framers/agentos';
382
292
 
383
- // Image generation with OpenAI
384
- const image = await generateImage({
385
- provider: 'openai',
386
- prompt: 'A cinematic neon city skyline reflected in rain at night.',
293
+ const team = agency({
294
+ agents: {
295
+ researcher: {
296
+ instructions: 'Find relevant facts and data.',
297
+ provider: 'anthropic',
298
+ },
299
+ writer: {
300
+ instructions: 'Write a clear, engaging summary.',
301
+ provider: 'openai',
302
+ },
303
+ reviewer: {
304
+ instructions: 'Check for accuracy and suggest improvements.',
305
+ provider: 'gemini',
306
+ dependsOn: ['writer'], // runs after writer
307
+ },
308
+ },
309
+ strategy: 'graph', // dependency-based DAG execution
310
+ memory: { shared: true }, // agents share context
387
311
  });
388
312
 
389
- console.log(image.images[0]?.mimeType);
313
+ const result = await team.generate('Compare TCP vs UDP for game networking.');
314
+ console.log(result.text);
315
+ ```
390
316
 
391
- // Structured output with Gemini -- Zod-validated JSON extraction
392
- const { object } = await generateObject({
393
- provider: 'gemini',
394
- schema: z.object({ name: z.string(), age: z.number() }),
395
- prompt: 'Extract: "John is 30 years old"',
396
- });
317
+ 6 strategies: `sequential`, `parallel`, `debate`, `review-loop`, `hierarchical`, `graph`.
397
318
 
398
- console.log(object.name, object.age); // "John" 30
319
+ ### 7. Voice Pipeline
399
320
 
400
- // Streaming structured output with Groq
401
- const structured = streamObject({
402
- provider: 'groq',
403
- schema: z.object({ title: z.string(), tags: z.array(z.string()) }),
404
- prompt: 'Generate metadata for an article about TCP.',
405
- });
321
+ Real-time speech-to-text and text-to-speech with streaming:
406
322
 
407
- for await (const partial of structured.partialObjectStream) {
408
- console.log('partial:', partial);
409
- }
410
- console.log('final:', await structured.object);
323
+ ```typescript
324
+ import { agent } from '@framers/agentos';
411
325
 
412
- // Embeddings -- single or batch (OpenAI)
413
- const { embeddings } = await embedText({
326
+ const receptionist = agent({
414
327
  provider: 'openai',
415
- input: ['Hello world', 'Goodbye world'],
416
- dimensions: 256,
417
- });
418
-
419
- console.log(embeddings.length, embeddings[0].length); // 2, 256
420
-
421
- // Stateful agent session with Anthropic
422
- const assistant = agent({
423
- provider: 'anthropic',
424
- instructions: 'You are a concise networking tutor.',
425
- maxSteps: 3,
328
+ instructions: 'You are a friendly receptionist for a dental clinic.',
329
+ voice: {
330
+ tts: { provider: 'elevenlabs', voice: 'Rachel' },
331
+ stt: { provider: 'deepgram' },
332
+ },
426
333
  });
427
334
 
428
- const session = assistant.session('tcp-demo');
429
- const reply = await session.send('Now compare TCP and UDP.');
430
- console.log(reply.text);
431
- console.log(await session.usage());
335
+ // Voice sessions stream audio in real-time
336
+ const call = receptionist.voiceSession('call-1');
337
+ await call.start(); // begins listening
432
338
  ```
433
339
 
434
- If you want durable helper-level usage accounting outside the full runtime, enable
435
- the opt-in usage ledger:
340
+ ### 8. Guardrails & Security
341
+
342
+ 5-tier security with PII redaction, prompt injection defense, and code scanning:
436
343
 
437
344
  ```typescript
438
- import { generateText, getRecordedAgentOSUsage } from '@framers/agentos';
345
+ import { agent } from '@framers/agentos';
439
346
 
440
- await generateText({
347
+ const secureBot = agent({
441
348
  provider: 'anthropic',
442
- prompt: 'Explain HTTP keep-alive.',
443
- usageLedger: { enabled: true, sessionId: 'readme-demo' },
444
- });
445
-
446
- console.log(await getRecordedAgentOSUsage({ enabled: true, sessionId: 'readme-demo' }));
447
- ```
448
-
449
- With `enabled: true`, AgentOS writes to the shared home ledger at `~/.framers/usage-ledger.jsonl` unless you provide `usageLedger.path` or one of the ledger env vars.
450
-
451
- Built-in image providers: `openai`, `openrouter`, `stability`, and `replicate`.
452
-
453
- Use `providerOptions` when you need provider-native controls without leaving the high-level API:
454
-
455
- ```typescript
456
- const poster = await generateImage({
457
- model: 'stability:stable-image-core',
458
- prompt: 'An art deco travel poster for a moon colony',
459
- negativePrompt: 'text, watermark',
460
- providerOptions: {
461
- stability: {
462
- stylePreset: 'illustration',
463
- seed: 42,
464
- cfgScale: 8,
465
- },
349
+ instructions: 'You are a customer support agent.',
350
+ security: { tier: 'strict' },
351
+ guardrails: {
352
+ input: ['pii-redaction', 'ml-classifiers'], // block PII + detect injection
353
+ output: ['grounding-guard', 'code-safety'], // prevent hallucination + unsafe code
466
354
  },
467
355
  });
468
356
  ```
469
357
 
470
- Runnable examples: [`examples/high-level-api.mjs`](./examples/high-level-api.mjs), [`examples/generate-image.mjs`](./examples/generate-image.mjs)
471
-
472
- ### Advanced: AgentGraph and Full Runtime
473
-
474
- Use `AgentGraph` or the full `AgentOS` runtime when you need programmatic graph
475
- construction with custom edge callbacks, extensions, workflow DSL, personas,
476
- chunk-level streaming events, or full runtime lifecycle control.
358
+ 5 tiers: `dangerous` `permissive` → `balanced` → `strict` → `paranoid`.
477
359
 
478
- ```typescript
479
- import { AgentOS, AgentOSResponseChunkType } from '@framers/agentos';
480
- import { createTestAgentOSConfig } from '@framers/agentos/config/AgentOSConfig';
360
+ ### Default Models Per Provider
481
361
 
482
- const agent = new AgentOS();
483
- await agent.initialize(await createTestAgentOSConfig());
484
-
485
- for await (const chunk of agent.processRequest({
486
- userId: 'user-1',
487
- sessionId: 'session-1',
488
- textInput: 'Explain how TCP handshakes work',
489
- })) {
490
- if (chunk.type === AgentOSResponseChunkType.TEXT_DELTA) {
491
- process.stdout.write(chunk.textDelta);
492
- }
493
- }
494
- ```
495
-
496
- See [`docs/architecture/AGENT_GRAPH.md`](./docs/architecture/AGENT_GRAPH.md) for the `AgentGraph` programmatic
497
- graph builder and [`docs/orchestration/WORKFLOW_DSL.md`](./docs/orchestration/WORKFLOW_DSL.md) for the workflow
498
- DSL.
362
+ | Provider | Default Model | Env Var |
363
+ |---|---|---|
364
+ | openai | gpt-4o | `OPENAI_API_KEY` |
365
+ | anthropic | claude-sonnet-4 | `ANTHROPIC_API_KEY` |
366
+ | gemini | gemini-2.5-flash | `GEMINI_API_KEY` |
367
+ | ollama | llama3.2 | `OLLAMA_BASE_URL` |
368
+ | groq | llama-3.3-70b | `GROQ_API_KEY` |
369
+ | openrouter | openai/gpt-4o | `OPENROUTER_API_KEY` |
370
+ | together | meta-llama/Meta-Llama-3.1-70B | `TOGETHER_API_KEY` |
371
+ | mistral | mistral-large-latest | `MISTRAL_API_KEY` |
372
+ | xai | grok-3-mini | `XAI_API_KEY` |
373
+
374
+ Automatic fallback: when a provider fails, AgentOS tries the next available API key.
499
375
 
500
376
  ---
501
377
 
@@ -1046,14 +922,14 @@ See [`docs/memory/MEMORY_SCALING.md`](./docs/memory/MEMORY_SCALING.md), [`docs/m
1046
922
 
1047
923
  **Location:** `knowledge/platform-corpus.json`
1048
924
 
1049
- AgentOS ships with **243 pre-built knowledge entries** covering the entire platform surface area. When the QueryRouter initializes, these entries are automatically loaded alongside your project-specific documentation corpus, giving every agent instant knowledge about AgentOS capabilities with zero configuration.
925
+ AgentOS ships with **244 pre-built knowledge entries** covering the entire platform surface area. When the QueryRouter initializes, these entries are automatically loaded alongside your project-specific documentation corpus, giving every agent instant knowledge about AgentOS capabilities with zero configuration.
1050
926
 
1051
927
  **Coverage breakdown:**
1052
928
 
1053
929
  | Category | Count | What it covers |
1054
930
  |----------|-------|---------------|
1055
931
  | Tools | 105 | Every tool and channel adapter (Discord, Telegram, LinkedIn, Bluesky, etc.) |
1056
- | Skills | 79 | All curated skills from the skills registry |
932
+ | Skills | 80 | All curated skills from the skills registry |
1057
933
  | FAQ | 30 | Common questions (voice setup, supported models, streaming, OCR, etc.) |
1058
934
  | API | 14 | Core API functions (generateText, streamText, agent, agency, etc.) |
1059
935
  | Troubleshooting | 15 | Common errors and their fixes (missing API keys, model not found, etc.) |
@@ -8,7 +8,7 @@
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 GenerateTextOptions, type GenerateTextResult, type Message } from './generateText.js';
11
+ import { type FallbackProviderEntry, type GenerateTextOptions, type GenerateTextResult, type Message } from './generateText.js';
12
12
  import { type StreamTextResult } from './streamText.js';
13
13
  import { type AgentOSUsageAggregate, type AgentOSUsageLedgerOptions } from './runtime/usageLedger.js';
14
14
  import type { BaseAgentConfig } from './types.js';
@@ -34,6 +34,23 @@ export interface AgentOptions extends BaseAgentConfig {
34
34
  * - `string` — inject a custom CoT instruction when tools are present.
35
35
  */
36
36
  chainOfThought?: boolean | string;
37
+ /**
38
+ * Ordered list of fallback providers to try when the primary provider
39
+ * fails with a retryable error (HTTP 402/429/5xx, network errors).
40
+ *
41
+ * Applied to every `generate()`, `stream()`, and `session.send()` /
42
+ * `session.stream()` call made through this agent.
43
+ *
44
+ * @see {@link GenerateTextOptions.fallbackProviders}
45
+ */
46
+ fallbackProviders?: FallbackProviderEntry[];
47
+ /**
48
+ * Callback invoked when a fallback provider is about to be tried.
49
+ *
50
+ * @param error - The error that triggered the fallback.
51
+ * @param fallbackProvider - The provider identifier being tried next.
52
+ */
53
+ onFallback?: (error: Error, fallbackProvider: string) => void;
37
54
  }
38
55
  /**
39
56
  * A named conversation session returned by `Agent.session()`.
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/api/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,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B,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;CAC9D;AAgCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,KAAK,CAiK/C"}
package/dist/api/agent.js CHANGED
@@ -75,6 +75,8 @@ export function agent(opts) {
75
75
  apiKey: opts.apiKey,
76
76
  baseUrl: opts.baseUrl,
77
77
  usageLedger: effectiveLedger,
78
+ fallbackProviders: opts.fallbackProviders,
79
+ onFallback: opts.onFallback,
78
80
  };
79
81
  const agentInstance = {
80
82
  async generate(prompt, extra) {
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/api/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,YAAY,GAIb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,uBAAuB,GAGxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAA0B,MAAM,kBAAkB,CAAC;AAqGpG,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,SAAS,iBAAiB,CAAC,IAAkB;IAC3C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,I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