@rudderjs/ai 1.6.0 → 1.6.2

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
@@ -16,7 +16,9 @@ pnpm add openai # OpenAI (GPT) — also used for OpenRou
16
16
  pnpm add @google/genai # Google (Gemini)
17
17
  pnpm add cohere-ai # Cohere (reranking + embeddings)
18
18
  pnpm add @aws-sdk/client-bedrock-runtime # AWS Bedrock
19
- # Jina — no extra package needed
19
+ # ElevenLabs (premium TTS + STT) — no extra package needed (direct HTTP)
20
+ # VoyageAI (embeddings + reranking) — no extra package needed (direct HTTP)
21
+ # Jina — no extra package needed (direct HTTP)
20
22
  ```
21
23
 
22
24
  ## Runtime Compatibility
@@ -28,6 +30,12 @@ pnpm add @aws-sdk/client-bedrock-runtime # AWS Bedrock
28
30
  | `@rudderjs/ai` | Node, browser, Electron main+renderer, React Native | Agents, tools, streaming, providers — any `fetch`-capable JS runtime |
29
31
  | `@rudderjs/ai/node` | Node only | `documentFromPath()`, `imageFromPath()`, `transcribeFromPath()` (filesystem helpers) |
30
32
  | `@rudderjs/ai/server` | Node only | `AiProvider` (the RudderJS `ServiceProvider` — auto-discovered, you rarely import it) |
33
+ | `@rudderjs/ai/mcp` | Node only (in practice) | `mcpClientTools()` + `mcpServerFromAgent()` — requires `@modelcontextprotocol/sdk` |
34
+ | `@rudderjs/ai/memory-orm` | Node only | `OrmUserMemory` + `UserMemoryRecord` — ORM-backed `UserMemory` |
35
+ | `@rudderjs/ai/memory-embedding` | Node only | `EmbeddingUserMemory` — semantic recall via the registered embedding model |
36
+ | `@rudderjs/ai/budget-orm` | Node only | `OrmBudgetStorage` + `BudgetUsageRecord` — ORM-backed `BudgetStorage` |
37
+ | `@rudderjs/ai/eval` | Any `fetch`-capable runtime | `evalSuite()` + `runSuite()` + metrics for testing agents against real models |
38
+ | `@rudderjs/ai/computer-use` | Node only (in practice) | `executeComputerAction(page, action, state)` — lower-level Playwright dispatcher |
31
39
 
32
40
  The main entry has zero `node:*` static imports, so you can call agents and tools directly from a React Native screen, an Electron renderer, or a browser. `@rudderjs/core` is an optional peer — only `/server` consumers pull it in.
33
41
 
@@ -46,6 +54,8 @@ export default {
46
54
  ollama: { driver: 'ollama', baseUrl: 'http://localhost:11434' },
47
55
  cohere: { driver: 'cohere', apiKey: process.env.COHERE_API_KEY! },
48
56
  jina: { driver: 'jina', apiKey: process.env.JINA_API_KEY! },
57
+ voyage: { driver: 'voyage', apiKey: process.env.VOYAGE_API_KEY! }, // embeddings + reranking
58
+ elevenlabs:{ driver: 'elevenlabs', apiKey: process.env.ELEVENLABS_API_KEY! }, // premium TTS + STT
49
59
  openrouter: {
50
60
  driver: 'openrouter',
51
61
  apiKey: process.env.OPENROUTER_API_KEY!,
@@ -60,11 +70,10 @@ export default {
60
70
  },
61
71
  }
62
72
 
63
- // bootstrap/providers.ts
64
- import { AiProvider } from '@rudderjs/ai/server'
65
- export default [AiProvider]
66
73
  ```
67
74
 
75
+ `AiProvider` is picked up by [auto-discovery](https://github.com/rudderjs/rudder/blob/main/docs/guide/service-providers.md#auto-discovery) — `pnpm rudder providers:discover` is all that's needed. The class lives at `@rudderjs/ai/server` (the main entry is runtime-agnostic); auto-discovery reads `rudderjs.providerSubpath` and loads it for you.
76
+
68
77
  ## Usage
69
78
 
70
79
  ### Agent Class
@@ -573,6 +582,36 @@ const agent = AI.agent({
573
582
  })
574
583
  ```
575
584
 
585
+ ### Computer Use (Anthropic)
586
+
587
+ `computerUseTool({ page })` exposes a Playwright `Page` to an Anthropic Claude model via the native `computer_20250124` tool block — the model takes screenshots, moves the cursor, clicks, types, scrolls, presses keys. Anthropic-only (`anthropic/*` and `bedrock/anthropic.*`); OpenRouter-routed Anthropic models throw `ComputerUseProviderError`.
588
+
589
+ ```ts
590
+ import { chromium } from 'playwright'
591
+ import { Agent, computerUseTool } from '@rudderjs/ai'
592
+
593
+ const browser = await chromium.launch()
594
+ const page = await browser.newPage({ viewport: { width: 1280, height: 800 } })
595
+
596
+ class BrowserAgent extends Agent {
597
+ model() { return 'anthropic/claude-sonnet-4-5' }
598
+ tools() {
599
+ return [
600
+ computerUseTool({
601
+ page,
602
+ viewport: { width: 1280, height: 800 },
603
+ needsApproval: true, // default — pauses the loop before every action
604
+ maxActions: 50, // per-instance safety cap; throws ComputerUseLimitError when exceeded
605
+ }),
606
+ ]
607
+ }
608
+ }
609
+
610
+ await new BrowserAgent().prompt('Find the cheapest flight from SFO to JFK next Tuesday.')
611
+ ```
612
+
613
+ Playwright is **not** a dep of `@rudderjs/ai` — install it in your app. The tool accepts a structural `PageLike` subset so types check without the 300MB Playwright bundle. Action failures surface as `is_error: true` tool-results so the model can retry. `needsApproval: true` (the default) routes every action through the standard approval gate — review what the model wants to click before it clicks it.
614
+
576
615
  ### Hosted vector stores + `fileSearch`
577
616
 
578
617
  `VectorStores` is a CRUD façade over the provider's hosted vector store; `fileSearch({ stores })` is the agent tool that queries them. The provider runs ingestion, chunking, embedding, and retrieval server-side — no embedding pipeline, no pgvector setup, no `execute` to write. Supported on **OpenAI** (`vectorStores.*`) and **Gemini** (`fileSearchStores`). Same façade, same agent surface.
@@ -955,6 +994,44 @@ const loggingMiddleware: AiMiddleware = {
955
994
  }
956
995
  ```
957
996
 
997
+ ### Per-user budgets — `withBudget(...)`
998
+
999
+ Cap daily or monthly spend per user. The middleware pre-debits the estimated input cost on every iteration (refusing with `BudgetExceededError` when the cap would be exceeded) and trues up the actual delta after each step's usage report:
1000
+
1001
+ ```ts
1002
+ import { withBudget, memoryBudgetStorage, BudgetExceededError } from '@rudderjs/ai'
1003
+
1004
+ class ChatAgent extends Agent {
1005
+ model() { return 'anthropic/claude-sonnet-4-5' }
1006
+ middleware() {
1007
+ return [
1008
+ withBudget({
1009
+ user: () => req.user?.id ?? null, // null bypasses enforcement (unauth)
1010
+ budget: { period: 'monthly', cap: 5.00 }, // USD; also 'daily'
1011
+ storage: memoryBudgetStorage(), // swap for ormBudgetStorage in production
1012
+ // timezone: 'America/Los_Angeles', // optional — period rollover boundary
1013
+ // onExceeded: ({ spent, cap }) => log.warn({ spent, cap }, 'budget hit'),
1014
+ // pricing: { ...ModelPricing, 'custom/model': { ... } }, // overrides
1015
+ }),
1016
+ ]
1017
+ }
1018
+ }
1019
+ ```
1020
+
1021
+ **Production storage — `OrmBudgetStorage`** persists spend rows via your registered ORM adapter:
1022
+
1023
+ ```ts
1024
+ import { OrmBudgetStorage, BudgetUsageRecord } from '@rudderjs/ai/budget-orm'
1025
+
1026
+ withBudget({
1027
+ user: () => req.user.id,
1028
+ budget: { period: 'monthly', cap: 25 },
1029
+ storage: new OrmBudgetStorage(),
1030
+ })
1031
+ ```
1032
+
1033
+ Schema reference is exported as `budgetUsagePrismaSchema` from `@rudderjs/ai/budget-orm` (also lives at `playground/prisma/schema/ai.prisma`). The `@@unique([userId, period, periodKey])` index is load-bearing — it provides first-write race protection. Caveats: refunds on errors are **not** issued; cache token deltas (Anthropic ephemeral, OpenAI prefix) aren't yet exposed on `TokenUsage`, so cached requests bill at full input rate; default token estimator is `text.length / 4` (override via `estimateTokens` for `tiktoken`). Under high single-user concurrency, total spend can briefly exceed `cap` by up to `costUsd × concurrency` (R-M-W race in the cap-check). The `BudgetExceededError` bubbles up — catch it at the route boundary to return a friendly 402.
1034
+
958
1035
  ### Testing
959
1036
 
960
1037
  ```ts
@@ -1186,6 +1263,8 @@ Approval gates (`needsApproval: true`) are dropped on the MCP side — there's n
1186
1263
  | Google | `@google/genai` | `google/gemini-2.5-pro` | ✓ | ✓ | ✓ | | | ✓ |
1187
1264
  | Cohere | `cohere-ai` | `cohere/rerank-v3.5` | | ✓ | | | ✓ | |
1188
1265
  | Jina | *(none)* | `jina/jina-reranker-v2-base-multilingual` | | ✓ | | | ✓ | |
1266
+ | VoyageAI | *(none)* | `voyage/voyage-3-large` | | ✓ | | | ✓ | |
1267
+ | ElevenLabs | *(none)* | `elevenlabs/eleven_multilingual_v2` | | | | ✓ | | |
1189
1268
  | Ollama | *(none)* | `ollama/llama3` | ✓ | | | | | |
1190
1269
  | Groq | *(none)* | `groq/llama-3.3-70b` | ✓ | | | | | |
1191
1270
  | DeepSeek | *(none)* | `deepseek/deepseek-chat` | ✓ | | | | | |
@@ -1,6 +1,13 @@
1
1
  ---
2
2
  name: ai-agents
3
3
  description: Building AI agents with tools, streaming, conversation memory, approval flows, and middleware in RudderJS
4
+ license: MIT
5
+ appliesTo:
6
+ - '@rudderjs/ai'
7
+ trigger: building an `Agent` class, calling `Agent.prompt()`/`.stream()`, defining `tools()` or `middleware()`, or wiring conversations / failover
8
+ skip: writing a tool definition by itself — load `ai-tools` instead
9
+ metadata:
10
+ author: rudderjs
4
11
  ---
5
12
 
6
13
  # AI Agents
@@ -1,6 +1,13 @@
1
1
  ---
2
2
  name: ai-tools
3
3
  description: Defining server and client tools with Zod schemas, approval gates, streaming yields, and modelOutput for RudderJS AI agents
4
+ license: MIT
5
+ appliesTo:
6
+ - '@rudderjs/ai'
7
+ trigger: writing a `toolDefinition()`, defining server or client tools, adding streaming yields, or wiring approval gates
8
+ skip: configuring an `Agent` class itself — load `ai-agents` instead
9
+ metadata:
10
+ author: rudderjs
4
11
  ---
5
12
 
6
13
  # AI Tools
package/dist/agent.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
+ import { toolToSchema } from './tool.js';
2
3
  import type { ServerToolBuilder } from './tool.js';
3
4
  import { QueuedPromptBuilder } from './queue-job.js';
4
5
  import type { SubAgentPauseKind, SubAgentRunStore } from './sub-agent-run-store.js';
5
- import type { AgentPromptOptions, AiMessage, AiMiddleware, AgentResponse, AgentStep, AgentStreamResponse, AnyTool, CacheableConfig, ConversationalSpec, ConversationStore, SubAgentUpdate, HasMiddleware, HasTools, PrepareStepResult, RemembersSpec, StopCondition, StreamChunk, ToolCall, UserMemory } from './types.js';
6
+ import type { PendingHandoff } from './handoffs-driver.js';
7
+ import type { AgentPromptOptions, AiMessage, AiMiddleware, AgentResponse, AgentStep, AgentStreamResponse, AnyTool, CacheableConfig, ConversationalSpec, ConversationStore, SubAgentUpdate, FinishReason, HasMiddleware, HasTools, MiddlewareContext, PrepareStepResult, RemembersSpec, StopCondition, StreamChunk, ToolCall, TokenUsage, UserMemory } from './types.js';
6
8
  /** Stop after N steps */
7
9
  export declare function stepCountIs(n: number): StopCondition;
8
10
  /** Stop when a specific tool is called in the latest step */
@@ -276,18 +278,47 @@ export declare function setConversationStore(store: ConversationStore): void;
276
278
  export declare function setUserMemory(memory: UserMemory): void;
277
279
  export declare function resolveUserMemory(): UserMemory | undefined;
278
280
  /**
279
- * Structured error returned to the model when a tool call's arguments fail
280
- * the tool's `inputSchema`. Surfaced both as the `result` on `AgentStep`
281
- * and as the JSON-encoded `tool` message the next provider step receives,
282
- * so the model can correct itself on the next turn.
281
+ * Mutable state shared between the non-streaming and streaming agent loops.
282
+ * Helpers (`runFailover`, `emitObserverFailed`, `emitObserverCompleted`,
283
+ * `buildAgentResponse`) read and write this struct so the same orchestration
284
+ * logic serves both `prompt()` and `stream()` callers.
283
285
  */
284
- export interface InvalidToolArgumentsError {
285
- error: 'invalid_arguments';
286
- message: string;
287
- issues: Array<{
288
- path: string;
289
- message: string;
290
- }>;
286
+ export interface LoopContext {
287
+ readonly agent: Agent;
288
+ readonly input: string;
289
+ readonly options: AgentPromptOptions | undefined;
290
+ readonly modelString: string;
291
+ readonly providerName: string;
292
+ readonly tools: AnyTool[];
293
+ readonly toolMap: Map<string, AnyTool>;
294
+ readonly toolSchemas: ReturnType<typeof toolToSchema>[];
295
+ readonly middlewares: AiMiddleware[];
296
+ readonly loopStart: number;
297
+ readonly ctx: MiddlewareContext & {
298
+ readonly _aborted: boolean;
299
+ readonly _abortReason: string;
300
+ };
301
+ readonly messages: AiMessage[];
302
+ readonly steps: AgentStep[];
303
+ readonly totalUsage: TokenUsage;
304
+ readonly pendingClientToolCalls: ToolCall[];
305
+ pendingApprovalToolCall: {
306
+ toolCall: ToolCall;
307
+ isClientTool: boolean;
308
+ } | undefined;
309
+ loopFinishReason: FinishReason | undefined;
310
+ stopForClientTools: boolean;
311
+ stopForApproval: boolean;
312
+ resumedToolMessages: AiMessage[];
313
+ failoverAttempts: number;
314
+ /**
315
+ * Set by the tool phase when the model called a {@link handoff} tool.
316
+ * Triggers the parent loop to break and the handoff wrapper to construct
317
+ * the child agent and continue with the carried message history.
318
+ */
319
+ pendingHandoff?: PendingHandoff;
320
+ stopForHandoff: boolean;
291
321
  }
292
- export {};
322
+ export type { PendingHandoff } from './handoffs-driver.js';
323
+ export type { InvalidToolArgumentsError } from './tool-helpers.js';
293
324
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAmD,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAInG,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AASpD,OAAO,KAAK,EAAE,iBAAiB,EAAuB,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAYxG,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,YAAY,EAEZ,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,eAAe,EAIf,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EAEd,aAAa,EACb,QAAQ,EAER,iBAAiB,EAEjB,aAAa,EACb,aAAa,EACb,WAAW,EAEX,QAAQ,EAKR,UAAU,EACX,MAAM,YAAY,CAAA;AA8BnB,yBAAyB;AACzB,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAEpD;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAK3D;AAID,8BAAsB,KAAK;IACzB,yCAAyC;IACzC,QAAQ,CAAC,YAAY,IAAI,MAAM;IAE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