@meetsmore-oss/use-ai-server 1.10.0 → 1.12.0
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 +30 -0
- package/dist/agents/AISDKAgent.d.ts.map +1 -1
- package/dist/agents/AISDKAgent.reasoning.test.d.ts +2 -0
- package/dist/agents/AISDKAgent.reasoning.test.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/testing/MockReasoningModel.d.ts +33 -0
- package/dist/agents/testing/MockReasoningModel.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6806 -6436
- package/dist/server.d.ts.map +1 -1
- package/dist/src/agents/AISDKAgent.d.ts +30 -0
- package/dist/src/agents/AISDKAgent.d.ts.map +1 -1
- package/dist/src/agents/AISDKAgent.reasoning.test.d.ts +2 -0
- package/dist/src/agents/AISDKAgent.reasoning.test.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/testing/MockReasoningModel.d.ts +33 -0
- package/dist/src/agents/testing/MockReasoningModel.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -210,6 +210,12 @@ export interface AISDKAgentConfig {
|
|
|
210
210
|
* - AG-UI event emission
|
|
211
211
|
* - Optional Langfuse telemetry
|
|
212
212
|
*
|
|
213
|
+
* **Reasoning / Extended Thinking:**
|
|
214
|
+
* Reasoning (extended thinking) is tested with Anthropic and OpenAI models.
|
|
215
|
+
* The signature extraction logic supports pluggable providers via {@link REASONING_SIGNATURE_KEYS}.
|
|
216
|
+
* Anthropic and OpenAI have been verified end-to-end.
|
|
217
|
+
* Google provider is mapped but commented out pending testing.
|
|
218
|
+
*
|
|
213
219
|
* Used for conversational chat (via useAI hook).
|
|
214
220
|
*
|
|
215
221
|
* @example
|
|
@@ -353,7 +359,19 @@ export declare class AISDKAgent implements Agent {
|
|
|
353
359
|
* automatically stripping any provider-specific fields (like 'id', 'tool_use_id').
|
|
354
360
|
* Using .strip() to silently remove unknown fields rather than throwing errors.
|
|
355
361
|
*/
|
|
362
|
+
/**
|
|
363
|
+
* Schema for tool-result content parts.
|
|
364
|
+
* Preserves providerMetadata (e.g., Gemini's thoughtSignature) for multi-turn context.
|
|
365
|
+
* The transform merges providerMetadata into providerOptions so the AI SDK sends it
|
|
366
|
+
* to the correct provider API (required for Gemini thoughtSignature on tool results).
|
|
367
|
+
*/
|
|
356
368
|
private static readonly toolResultContentSchema;
|
|
369
|
+
/**
|
|
370
|
+
* Schema for tool-call content parts.
|
|
371
|
+
* Preserves providerMetadata (e.g., Gemini's thoughtSignature) for multi-turn context.
|
|
372
|
+
* The transform merges providerMetadata into providerOptions so the AI SDK sends it
|
|
373
|
+
* to the correct provider API (required for Gemini thoughtSignature on tool calls).
|
|
374
|
+
*/
|
|
357
375
|
private static readonly toolCallContentSchema;
|
|
358
376
|
private static readonly textContentSchema;
|
|
359
377
|
private static readonly imageContentSchema;
|
|
@@ -364,6 +382,18 @@ export declare class AISDKAgent implements Agent {
|
|
|
364
382
|
* This allows file transformers on the client to send pre-processed file content.
|
|
365
383
|
*/
|
|
366
384
|
private static readonly transformedFileContentSchema;
|
|
385
|
+
/**
|
|
386
|
+
* Schema for reasoning content parts (extended thinking).
|
|
387
|
+
* Preserves providerMetadata (e.g., Anthropic's signature) for multi-turn context.
|
|
388
|
+
*
|
|
389
|
+
* providerMetadata is stored as an opaque record keyed by provider name.
|
|
390
|
+
* The transform merges it into providerOptions so the AI SDK sends it back
|
|
391
|
+
* to the correct provider API for signature verification.
|
|
392
|
+
*
|
|
393
|
+
* Anthropic and OpenAI signatures are tested.
|
|
394
|
+
* @see REASONING_SIGNATURE_KEYS for the mapping of supported providers.
|
|
395
|
+
*/
|
|
396
|
+
private static readonly reasoningContentSchema;
|
|
367
397
|
private static readonly contentPartSchema;
|
|
368
398
|
private static readonly messageSchema;
|
|
369
399
|
private static readonly messagesArraySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AISDKAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/AISDKAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,aAAa,EAA8G,KAAK,SAAS,EAAE,MAAM,IAAI,CAAC;AAMvL,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"AISDKAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/AISDKAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,aAAa,EAA8G,KAAK,SAAS,EAAE,MAAM,IAAI,CAAC;AAMvL,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,UAAU,CAAC;AAgCpE,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAsHjF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,EAAE,aAAa,CAAC;IAErB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IAC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AAiB,CAQtC;IAEH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAM1B;IAEX,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAqC;IAEhF;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;CAgBzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AISDKAgent.reasoning.test.d.ts","sourceRoot":"","sources":["../../../src/agents/AISDKAgent.reasoning.test.ts"],"names":[],"mappings":""}
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export type { Agent, AgentInput, EventEmitter, AgentResult, ClientSession } from './types';
|
|
6
6
|
export { AISDKAgent, type AISDKAgentConfig } from './AISDKAgent';
|
|
7
|
+
export { createMockReasoningModel } from './testing/MockReasoningModel';
|
|
7
8
|
export { applyCacheBreakpoints, isAnthropicModel, type MessageWithCacheContext, type CacheTtl, type CacheBreakpointResult, type CacheBreakpointFn, } from './anthropicCache';
|
|
8
9
|
export { toolNeedsApproval, createApprovalWrapper, waitForApproval, type ToolArguments, type ToolResult, type ToolExecutor, } from './toolApproval';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock AI model for UI development and testing.
|
|
3
|
+
*
|
|
4
|
+
* Classifies incoming user messages by fixed keyword and returns predetermined responses,
|
|
5
|
+
* including reasoning (extended thinking) blocks and multi-step tool calls.
|
|
6
|
+
* Runs through the full AISDKAgent pipeline so all production code paths are exercised.
|
|
7
|
+
*
|
|
8
|
+
* Keywords:
|
|
9
|
+
* "long reasoning" → long reasoning block + text
|
|
10
|
+
* "multi-step reasoning" → reasoning + tool call + reasoning + text
|
|
11
|
+
* anything else → short reasoning + text (default)
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* import { createMockReasoningModel, AISDKAgent } from '@meetsmore-oss/use-ai-server';
|
|
15
|
+
*
|
|
16
|
+
* const agent = new AISDKAgent({
|
|
17
|
+
* model: createMockReasoningModel(),
|
|
18
|
+
* name: 'Mock (Reasoning)',
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* Enable in server-app with: USE_AI_ENABLE_MOCK_AGENT=true
|
|
22
|
+
*/
|
|
23
|
+
import { MockLanguageModelV3 } from 'ai/test';
|
|
24
|
+
/**
|
|
25
|
+
* Create a mock model that simulates reasoning/thinking responses.
|
|
26
|
+
*
|
|
27
|
+
* Keyword detection (case-insensitive, in user message):
|
|
28
|
+
* - `"long reasoning"` → long reasoning block + text
|
|
29
|
+
* - `"multi-step reasoning"` → reasoning + tool call + reasoning + text
|
|
30
|
+
* - anything else → short reasoning + text (default)
|
|
31
|
+
*/
|
|
32
|
+
export declare function createMockReasoningModel(): MockLanguageModelV3;
|
|
33
|
+
//# sourceMappingURL=MockReasoningModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockReasoningModel.d.ts","sourceRoot":"","sources":["../../../../src/agents/testing/MockReasoningModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,mBAAmB,EAA0B,MAAM,SAAS,CAAC;AAuItE;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,mBAAmB,CAqE9D"}
|
package/dist/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, type MessageWithCacheContext, type CacheTtl, type CacheBreakpointResult, type CacheBreakpointFn } from './agents';
|
|
5
|
+
export { AISDKAgent, type AISDKAgentConfig, type MessageWithCacheContext, type CacheTtl, type CacheBreakpointResult, type CacheBreakpointFn, createMockReasoningModel } from './agents';
|
|
6
6
|
export type { UseAIServerPlugin, MessageHandler, BeforeRunAgentResult } from './plugins';
|
|
7
7
|
export { FeedbackPlugin } from './plugins';
|
|
8
8
|
export type { SpanProcessor } from './instrumentation';
|
package/dist/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,KAAK,uBAAuB,EAAE,KAAK,QAAQ,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,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,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGxL,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;A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