@meetsmore-oss/use-ai-server 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/AISDKAgent.d.ts +49 -0
- package/dist/agents/AISDKAgent.d.ts.map +1 -1
- package/dist/agents/anthropicCache.d.ts +65 -0
- package/dist/agents/anthropicCache.d.ts.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/plugins/__tests__/runner.test.d.ts +2 -0
- package/dist/agents/plugins/__tests__/runner.test.d.ts.map +1 -0
- package/dist/agents/plugins/citations/citationPlugin.d.ts +72 -0
- package/dist/agents/plugins/citations/citationPlugin.d.ts.map +1 -0
- package/dist/agents/plugins/citations/citationPlugin.test.d.ts +2 -0
- package/dist/agents/plugins/citations/citationPlugin.test.d.ts.map +1 -0
- package/dist/agents/plugins/citations/index.d.ts +7 -0
- package/dist/agents/plugins/citations/index.d.ts.map +1 -0
- package/dist/agents/plugins/index.d.ts +34 -0
- package/dist/agents/plugins/index.d.ts.map +1 -0
- package/dist/agents/plugins/runner.d.ts +76 -0
- package/dist/agents/plugins/runner.d.ts.map +1 -0
- package/dist/agents/plugins/types.d.ts +280 -0
- package/dist/agents/plugins/types.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -1
- package/dist/src/agents/AISDKAgent.d.ts +49 -0
- package/dist/src/agents/AISDKAgent.d.ts.map +1 -1
- package/dist/src/agents/anthropicCache.d.ts +65 -0
- package/dist/src/agents/anthropicCache.d.ts.map +1 -0
- package/dist/src/agents/index.d.ts +1 -0
- package/dist/src/agents/index.d.ts.map +1 -1
- package/dist/src/agents/plugins/__tests__/runner.test.d.ts +2 -0
- package/dist/src/agents/plugins/__tests__/runner.test.d.ts.map +1 -0
- package/dist/src/agents/plugins/citations/citationPlugin.d.ts +72 -0
- package/dist/src/agents/plugins/citations/citationPlugin.d.ts.map +1 -0
- package/dist/src/agents/plugins/citations/citationPlugin.test.d.ts +2 -0
- package/dist/src/agents/plugins/citations/citationPlugin.test.d.ts.map +1 -0
- package/dist/src/agents/plugins/citations/index.d.ts +7 -0
- package/dist/src/agents/plugins/citations/index.d.ts.map +1 -0
- package/dist/src/agents/plugins/index.d.ts +34 -0
- package/dist/src/agents/plugins/index.d.ts.map +1 -0
- package/dist/src/agents/plugins/runner.d.ts +76 -0
- package/dist/src/agents/plugins/runner.d.ts.map +1 -0
- package/dist/src/agents/plugins/types.d.ts +280 -0
- package/dist/src/agents/plugins/types.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import type { ModelMessage, SystemModelMessage } from 'ai';
|
|
2
|
+
import type { EventEmitter, ClientSession } from '../types';
|
|
3
|
+
import type { ToolDefinition } from '../../types';
|
|
4
|
+
import type { Logger } from '../../logger';
|
|
5
|
+
/**
|
|
6
|
+
* Context available to plugins during a run.
|
|
7
|
+
* Contains session info, event emitter, and shared state.
|
|
8
|
+
*/
|
|
9
|
+
export interface AgentPluginContext {
|
|
10
|
+
/** Unique identifier for this run */
|
|
11
|
+
runId: string;
|
|
12
|
+
/** Client identifier from the session */
|
|
13
|
+
clientId: string;
|
|
14
|
+
/** Thread identifier for the conversation */
|
|
15
|
+
threadId?: string;
|
|
16
|
+
/** AI provider name (e.g., 'openai', 'anthropic') */
|
|
17
|
+
provider: string;
|
|
18
|
+
/** Event emitter for sending AG-UI events */
|
|
19
|
+
events: EventEmitter;
|
|
20
|
+
/** Shared state between plugins within a single run */
|
|
21
|
+
state: Map<string, unknown>;
|
|
22
|
+
/** Logger instance */
|
|
23
|
+
logger: Logger;
|
|
24
|
+
/** The client session */
|
|
25
|
+
session: ClientSession;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Input data passed to onUserMessage hook.
|
|
29
|
+
* Plugins can modify these values before they're sent to the AI SDK.
|
|
30
|
+
*/
|
|
31
|
+
export interface AgentRunInput {
|
|
32
|
+
/** Conversation messages in AI SDK format */
|
|
33
|
+
messages: ModelMessage[];
|
|
34
|
+
/** System messages (if any). Passed directly to AI SDK. */
|
|
35
|
+
systemMessages?: SystemModelMessage[];
|
|
36
|
+
/** Available tools for this run */
|
|
37
|
+
tools: ToolDefinition[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Result data passed to onAgentResponse hook.
|
|
41
|
+
* Plugins can process or transform the response.
|
|
42
|
+
*/
|
|
43
|
+
export interface AgentRunResult {
|
|
44
|
+
/** The generated text response */
|
|
45
|
+
text: string;
|
|
46
|
+
/** Sources/citations from the AI response */
|
|
47
|
+
sources?: unknown[];
|
|
48
|
+
/** Raw response object from AI SDK */
|
|
49
|
+
response?: {
|
|
50
|
+
messages: unknown[];
|
|
51
|
+
};
|
|
52
|
+
/** Provider-specific metadata */
|
|
53
|
+
providerMetadata?: Record<string, unknown>;
|
|
54
|
+
/** Tool calls made during the run */
|
|
55
|
+
toolCalls?: unknown[];
|
|
56
|
+
/** Results from tool executions */
|
|
57
|
+
toolResults?: unknown[];
|
|
58
|
+
/** Token usage information */
|
|
59
|
+
usage?: {
|
|
60
|
+
promptTokens: number;
|
|
61
|
+
completionTokens: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Information about a tool call (before execution).
|
|
66
|
+
*/
|
|
67
|
+
export interface ToolCallInfo {
|
|
68
|
+
/** Unique identifier for this tool call */
|
|
69
|
+
id: string;
|
|
70
|
+
/** Name of the tool being called */
|
|
71
|
+
name: string;
|
|
72
|
+
/** Arguments passed to the tool */
|
|
73
|
+
args: unknown;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Information about a tool result (after execution).
|
|
77
|
+
*/
|
|
78
|
+
export interface ToolResultInfo extends ToolCallInfo {
|
|
79
|
+
/** Result returned from the tool */
|
|
80
|
+
result: unknown;
|
|
81
|
+
/** Error if the tool execution failed */
|
|
82
|
+
error?: Error;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Known AI SDK stream chunk types.
|
|
86
|
+
* These are the chunk types commonly emitted by the AI SDK fullStream.
|
|
87
|
+
*/
|
|
88
|
+
/** Text content being streamed */
|
|
89
|
+
export interface TextDeltaChunk {
|
|
90
|
+
type: 'text-delta';
|
|
91
|
+
text: string;
|
|
92
|
+
}
|
|
93
|
+
/** Extended thinking/reasoning content (Claude) */
|
|
94
|
+
export interface ReasoningDeltaChunk {
|
|
95
|
+
type: 'reasoning-delta';
|
|
96
|
+
text: string;
|
|
97
|
+
}
|
|
98
|
+
/** Source/citation from web search or RAG */
|
|
99
|
+
export interface SourceChunk {
|
|
100
|
+
type: 'source';
|
|
101
|
+
id: string;
|
|
102
|
+
sourceType: string;
|
|
103
|
+
url?: string;
|
|
104
|
+
title?: string;
|
|
105
|
+
providerMetadata?: Record<string, unknown>;
|
|
106
|
+
}
|
|
107
|
+
/** Tool call starting to stream */
|
|
108
|
+
export interface ToolInputStartChunk {
|
|
109
|
+
type: 'tool-input-start';
|
|
110
|
+
id: string;
|
|
111
|
+
toolName: string;
|
|
112
|
+
}
|
|
113
|
+
/** Tool arguments being streamed */
|
|
114
|
+
export interface ToolInputDeltaChunk {
|
|
115
|
+
type: 'tool-input-delta';
|
|
116
|
+
id: string;
|
|
117
|
+
delta: string;
|
|
118
|
+
}
|
|
119
|
+
/** Tool call complete with parsed input */
|
|
120
|
+
export interface ToolCallChunk {
|
|
121
|
+
type: 'tool-call';
|
|
122
|
+
toolCallId: string;
|
|
123
|
+
toolName: string;
|
|
124
|
+
input: unknown;
|
|
125
|
+
}
|
|
126
|
+
/** Tool execution result */
|
|
127
|
+
export interface ToolResultChunk {
|
|
128
|
+
type: 'tool-result';
|
|
129
|
+
toolCallId: string;
|
|
130
|
+
toolName: string;
|
|
131
|
+
output: unknown;
|
|
132
|
+
}
|
|
133
|
+
/** Step started in multi-step execution */
|
|
134
|
+
export interface StartStepChunk {
|
|
135
|
+
type: 'start-step';
|
|
136
|
+
}
|
|
137
|
+
/** Step finished in multi-step execution */
|
|
138
|
+
export interface FinishStepChunk {
|
|
139
|
+
type: 'finish-step';
|
|
140
|
+
usage?: {
|
|
141
|
+
promptTokens: number;
|
|
142
|
+
completionTokens: number;
|
|
143
|
+
};
|
|
144
|
+
finishReason?: string;
|
|
145
|
+
}
|
|
146
|
+
/** Stream error */
|
|
147
|
+
export interface ErrorChunk {
|
|
148
|
+
type: 'error';
|
|
149
|
+
error: Error;
|
|
150
|
+
}
|
|
151
|
+
/** Unknown chunk type (fallback for future AI SDK chunk types) */
|
|
152
|
+
export interface UnknownChunk {
|
|
153
|
+
type: string;
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Union of all known AI SDK stream chunk types.
|
|
158
|
+
* Plugins can use type narrowing with `chunk.type` to handle specific chunk types.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* onChunk(chunk, context) {
|
|
163
|
+
* if (chunk.type === 'source') {
|
|
164
|
+
* // TypeScript knows chunk is SourceChunk here
|
|
165
|
+
* console.log(chunk.url);
|
|
166
|
+
* }
|
|
167
|
+
* }
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export type StreamChunk = TextDeltaChunk | ReasoningDeltaChunk | SourceChunk | ToolInputStartChunk | ToolInputDeltaChunk | ToolCallChunk | ToolResultChunk | StartStepChunk | FinishStepChunk | ErrorChunk | UnknownChunk;
|
|
171
|
+
/**
|
|
172
|
+
* Plugin interface for extending AISDKAgent functionality.
|
|
173
|
+
*
|
|
174
|
+
* Plugins can hook into various points of the agent lifecycle to:
|
|
175
|
+
* - Modify inputs before sending to AI
|
|
176
|
+
* - Transform streaming chunks
|
|
177
|
+
* - Intercept or modify tool calls
|
|
178
|
+
* - Process and transform responses
|
|
179
|
+
* - Handle errors
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const loggingPlugin: AgentPlugin = {
|
|
184
|
+
* id: 'logging',
|
|
185
|
+
*
|
|
186
|
+
* onUserMessage(input, context) {
|
|
187
|
+
* context.logger.info('User message received', {
|
|
188
|
+
* messageCount: input.messages.length,
|
|
189
|
+
* });
|
|
190
|
+
* return input;
|
|
191
|
+
* },
|
|
192
|
+
*
|
|
193
|
+
* onAgentResponse(result, context) {
|
|
194
|
+
* context.logger.info('Agent response', {
|
|
195
|
+
* textLength: result.text.length,
|
|
196
|
+
* });
|
|
197
|
+
* return result;
|
|
198
|
+
* },
|
|
199
|
+
* };
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
export interface AgentPlugin {
|
|
203
|
+
/** Unique plugin identifier */
|
|
204
|
+
id: string;
|
|
205
|
+
/**
|
|
206
|
+
* Initialize plugin (called once when agent is created).
|
|
207
|
+
* Use this to set up any resources the plugin needs.
|
|
208
|
+
*
|
|
209
|
+
* @param context - Initialization context with provider info
|
|
210
|
+
*/
|
|
211
|
+
initialize?(context: {
|
|
212
|
+
provider: string;
|
|
213
|
+
}): void | Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Called before the user message is sent to AI SDK.
|
|
216
|
+
* Can modify messages, system prompt, or tools.
|
|
217
|
+
*
|
|
218
|
+
* @param input - The input data (messages, system prompt, tools)
|
|
219
|
+
* @param context - Plugin context with run info and shared state
|
|
220
|
+
* @returns Modified input or unchanged input
|
|
221
|
+
*/
|
|
222
|
+
onUserMessage?(input: AgentRunInput, context: AgentPluginContext): AgentRunInput | Promise<AgentRunInput>;
|
|
223
|
+
/**
|
|
224
|
+
* Called after AI SDK completes processing (including all tool calls).
|
|
225
|
+
* Can process results, emit events, or transform the final text.
|
|
226
|
+
*
|
|
227
|
+
* @param result - The agent's response data
|
|
228
|
+
* @param context - Plugin context with run info and shared state
|
|
229
|
+
* @returns Modified result or unchanged result
|
|
230
|
+
*/
|
|
231
|
+
onAgentResponse?(result: AgentRunResult, context: AgentPluginContext): AgentRunResult | Promise<AgentRunResult>;
|
|
232
|
+
/**
|
|
233
|
+
* Called for each streaming text chunk.
|
|
234
|
+
* Can transform chunks. Return undefined/void to keep chunk unchanged.
|
|
235
|
+
*
|
|
236
|
+
* @param chunk - The text chunk being streamed
|
|
237
|
+
* @param context - Plugin context with run info and shared state
|
|
238
|
+
* @returns Transformed chunk, or undefined to keep original
|
|
239
|
+
*/
|
|
240
|
+
onTextChunk?(chunk: string, context: AgentPluginContext): string | void | Promise<string | void>;
|
|
241
|
+
/**
|
|
242
|
+
* Called before a tool is executed.
|
|
243
|
+
* Can modify the tool call or return null to skip execution.
|
|
244
|
+
*
|
|
245
|
+
* @param toolCall - Information about the tool being called
|
|
246
|
+
* @param context - Plugin context with run info and shared state
|
|
247
|
+
* @returns Modified tool call, null to skip, or unchanged
|
|
248
|
+
*/
|
|
249
|
+
onBeforeToolCall?(toolCall: ToolCallInfo, context: AgentPluginContext): ToolCallInfo | null | Promise<ToolCallInfo | null>;
|
|
250
|
+
/**
|
|
251
|
+
* Called after a tool is executed.
|
|
252
|
+
* Can modify the tool result before it's sent back to the AI.
|
|
253
|
+
*
|
|
254
|
+
* @param toolResult - Information about the completed tool call
|
|
255
|
+
* @param context - Plugin context with run info and shared state
|
|
256
|
+
* @returns Modified result or unchanged result
|
|
257
|
+
*/
|
|
258
|
+
onAfterToolCall?(toolResult: ToolResultInfo, context: AgentPluginContext): unknown | Promise<unknown>;
|
|
259
|
+
/**
|
|
260
|
+
* Called for each chunk from the AI SDK stream.
|
|
261
|
+
* Plugins can filter by chunk.type to handle specific chunk types.
|
|
262
|
+
*
|
|
263
|
+
* Common chunk types:
|
|
264
|
+
* - 'text-delta': Text content being streamed
|
|
265
|
+
* - 'source': Citation/source from web search or RAG
|
|
266
|
+
* - 'tool-call': Tool invocation
|
|
267
|
+
* - 'tool-result': Tool execution result
|
|
268
|
+
* - 'start-step', 'finish-step': Multi-step execution markers
|
|
269
|
+
*
|
|
270
|
+
* @param chunk - The stream chunk with type and type-specific properties
|
|
271
|
+
* @param context - Plugin context with run info and shared state
|
|
272
|
+
*/
|
|
273
|
+
onChunk?(chunk: StreamChunk, context: AgentPluginContext): void | Promise<void>;
|
|
274
|
+
/**
|
|
275
|
+
* Cleanup (called when agent is destroyed).
|
|
276
|
+
* Use to release any resources the plugin acquired.
|
|
277
|
+
*/
|
|
278
|
+
destroy?(): void | Promise<void>;
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,MAAM,EAAE,YAAY,CAAC;IACrB,uDAAuD;IACvD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5B,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;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EtD;;;;;;;OAOG;IACH,eAAe,CAAC,CACd,UAAU,EAAE,cAAc,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,CACN,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,kBAAkB,GAC1B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;OAGG;IACH,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { UseAIServer } from './server';
|
|
|
2
2
|
export type { UseAIServerConfig, McpEndpointConfig, ToolDefinition, CorsOptions } from './types';
|
|
3
3
|
export type { ClientSession } from './server';
|
|
4
4
|
export type { Agent, AgentInput, EventEmitter, AgentResult } from './agents';
|
|
5
|
-
export { AISDKAgent, type AISDKAgentConfig } from './agents';
|
|
5
|
+
export { AISDKAgent, type AISDKAgentConfig, type MessageWithCacheContext, type CacheTtl, type CacheBreakpointResult, type CacheBreakpointFn } from './agents';
|
|
6
6
|
export type { UseAIServerPlugin, MessageHandler } from './plugins';
|
|
7
7
|
export { logger } from './logger';
|
|
8
8
|
export { createClientToolExecutor, isRemoteTool, createGlobFilter, and, or, not, } from './utils';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjG,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjG,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,KAAK,QAAQ,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG9J,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,GAAG,EACH,EAAE,EACF,GAAG,GACJ,MAAM,SAAS,CAAC"}
|