@witqq/agent-sdk 0.7.0 → 0.8.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/README.md +140 -34
- package/dist/{types-CqvUAYxt.d.cts → agent-CW9XbmG_.d.ts} +137 -102
- package/dist/{types-CqvUAYxt.d.ts → agent-DxY68NZL.d.cts} +137 -102
- package/dist/auth/index.cjs +72 -1
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +21 -154
- package/dist/auth/index.d.ts +21 -154
- package/dist/auth/index.js +72 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/backends/claude.cjs +480 -261
- package/dist/backends/claude.cjs.map +1 -1
- package/dist/backends/claude.d.cts +3 -1
- package/dist/backends/claude.d.ts +3 -1
- package/dist/backends/claude.js +480 -261
- package/dist/backends/claude.js.map +1 -1
- package/dist/backends/copilot.cjs +329 -97
- package/dist/backends/copilot.cjs.map +1 -1
- package/dist/backends/copilot.d.cts +12 -4
- package/dist/backends/copilot.d.ts +12 -4
- package/dist/backends/copilot.js +329 -97
- package/dist/backends/copilot.js.map +1 -1
- package/dist/backends/vercel-ai.cjs +294 -61
- package/dist/backends/vercel-ai.cjs.map +1 -1
- package/dist/backends/vercel-ai.d.cts +3 -1
- package/dist/backends/vercel-ai.d.ts +3 -1
- package/dist/backends/vercel-ai.js +294 -61
- package/dist/backends/vercel-ai.js.map +1 -1
- package/dist/backends-BSrsBYFn.d.cts +39 -0
- package/dist/backends-BSrsBYFn.d.ts +39 -0
- package/dist/chat/accumulator.cjs +1 -1
- package/dist/chat/accumulator.cjs.map +1 -1
- package/dist/chat/accumulator.d.cts +5 -2
- package/dist/chat/accumulator.d.ts +5 -2
- package/dist/chat/accumulator.js +1 -1
- package/dist/chat/accumulator.js.map +1 -1
- package/dist/chat/backends.cjs +736 -746
- package/dist/chat/backends.cjs.map +1 -1
- package/dist/chat/backends.d.cts +10 -6
- package/dist/chat/backends.d.ts +10 -6
- package/dist/chat/backends.js +736 -725
- package/dist/chat/backends.js.map +1 -1
- package/dist/chat/context.cjs +50 -0
- package/dist/chat/context.cjs.map +1 -1
- package/dist/chat/context.d.cts +27 -3
- package/dist/chat/context.d.ts +27 -3
- package/dist/chat/context.js +50 -0
- package/dist/chat/context.js.map +1 -1
- package/dist/chat/core.cjs +25 -2
- package/dist/chat/core.cjs.map +1 -1
- package/dist/chat/core.d.cts +30 -381
- package/dist/chat/core.d.ts +30 -381
- package/dist/chat/core.js +24 -3
- package/dist/chat/core.js.map +1 -1
- package/dist/chat/errors.cjs +48 -26
- package/dist/chat/errors.cjs.map +1 -1
- package/dist/chat/errors.d.cts +6 -31
- package/dist/chat/errors.d.ts +6 -31
- package/dist/chat/errors.js +48 -25
- package/dist/chat/errors.js.map +1 -1
- package/dist/chat/events.cjs.map +1 -1
- package/dist/chat/events.d.cts +6 -2
- package/dist/chat/events.d.ts +6 -2
- package/dist/chat/events.js.map +1 -1
- package/dist/chat/index.cjs +1199 -1008
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +35 -10
- package/dist/chat/index.d.ts +35 -10
- package/dist/chat/index.js +1196 -987
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/react/theme.css +2517 -0
- package/dist/chat/react.cjs +2003 -1153
- package/dist/chat/react.cjs.map +1 -1
- package/dist/chat/react.d.cts +590 -121
- package/dist/chat/react.d.ts +590 -121
- package/dist/chat/react.js +1984 -1151
- package/dist/chat/react.js.map +1 -1
- package/dist/chat/runtime.cjs +401 -186
- package/dist/chat/runtime.cjs.map +1 -1
- package/dist/chat/runtime.d.cts +92 -28
- package/dist/chat/runtime.d.ts +92 -28
- package/dist/chat/runtime.js +401 -186
- package/dist/chat/runtime.js.map +1 -1
- package/dist/chat/server.cjs +2234 -209
- package/dist/chat/server.cjs.map +1 -1
- package/dist/chat/server.d.cts +451 -90
- package/dist/chat/server.d.ts +451 -90
- package/dist/chat/server.js +2221 -210
- package/dist/chat/server.js.map +1 -1
- package/dist/chat/sessions.cjs +25 -43
- package/dist/chat/sessions.cjs.map +1 -1
- package/dist/chat/sessions.d.cts +37 -118
- package/dist/chat/sessions.d.ts +37 -118
- package/dist/chat/sessions.js +25 -43
- package/dist/chat/sessions.js.map +1 -1
- package/dist/chat/sqlite.cjs +441 -0
- package/dist/chat/sqlite.cjs.map +1 -0
- package/dist/chat/sqlite.d.cts +128 -0
- package/dist/chat/sqlite.d.ts +128 -0
- package/dist/chat/sqlite.js +435 -0
- package/dist/chat/sqlite.js.map +1 -0
- package/dist/chat/state.cjs +14 -1
- package/dist/chat/state.cjs.map +1 -1
- package/dist/chat/state.d.cts +5 -2
- package/dist/chat/state.d.ts +5 -2
- package/dist/chat/state.js +14 -1
- package/dist/chat/state.js.map +1 -1
- package/dist/chat/storage.cjs +19 -10
- package/dist/chat/storage.cjs.map +1 -1
- package/dist/chat/storage.d.cts +11 -5
- package/dist/chat/storage.d.ts +11 -5
- package/dist/chat/storage.js +19 -10
- package/dist/chat/storage.js.map +1 -1
- package/dist/errors-C-so0M4t.d.cts +33 -0
- package/dist/errors-C-so0M4t.d.ts +33 -0
- package/dist/errors-CmVvczxZ.d.cts +28 -0
- package/dist/errors-CmVvczxZ.d.ts +28 -0
- package/dist/{in-process-transport-C2oPTYs6.d.ts → in-process-transport-C1JnJGVR.d.ts} +28 -23
- package/dist/{in-process-transport-DG-w5G6k.d.cts → in-process-transport-C7DSqPyX.d.cts} +28 -23
- package/dist/index.cjs +340 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +292 -123
- package/dist/index.d.ts +292 -123
- package/dist/index.js +334 -47
- package/dist/index.js.map +1 -1
- package/dist/provider-types-PTSlRPNB.d.cts +39 -0
- package/dist/provider-types-PTSlRPNB.d.ts +39 -0
- package/dist/refresh-manager-B81PpYBr.d.cts +153 -0
- package/dist/refresh-manager-Dlv_iNZi.d.ts +153 -0
- package/dist/testing.cjs +383 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +132 -0
- package/dist/testing.d.ts +132 -0
- package/dist/testing.js +377 -0
- package/dist/testing.js.map +1 -0
- package/dist/token-store-CSUBgYwn.d.ts +48 -0
- package/dist/token-store-CuC4hB9Z.d.cts +48 -0
- package/dist/{transport-DX1Nhm4N.d.cts → transport-Cdh3M0tS.d.cts} +5 -4
- package/dist/{transport-D1OaUgRk.d.ts → transport-Ciap4PWK.d.ts} +5 -4
- package/dist/{types-CGF7AEX1.d.cts → types-4vbcmPTp.d.cts} +4 -2
- package/dist/{types-Bh5AhqD-.d.ts → types-BxggH0Yh.d.ts} +4 -2
- package/dist/types-DRgd_9R7.d.cts +363 -0
- package/dist/types-ajANVzf7.d.ts +363 -0
- package/package.json +31 -6
- package/dist/errors-BDLbNu9w.d.cts +0 -13
- package/dist/errors-BDLbNu9w.d.ts +0 -13
- package/dist/types-DLZzlJxt.d.ts +0 -39
- package/dist/types-tE0CXwBl.d.cts +0 -39
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Options for constructing an AgentSDKError */
|
|
2
|
+
interface AgentSDKErrorOptions extends ErrorOptions {
|
|
3
|
+
/** Machine-readable error code */
|
|
4
|
+
code?: string;
|
|
5
|
+
/** Whether this error is retryable (default: false) */
|
|
6
|
+
retryable?: boolean;
|
|
7
|
+
/** HTTP status code hint (e.g. 401, 429, 500) */
|
|
8
|
+
httpStatus?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Base error class for agent-sdk.
|
|
11
|
+
*
|
|
12
|
+
* Use `AgentSDKError.is(err)` for reliable cross-module `instanceof` checks
|
|
13
|
+
* (works across separately bundled entry points where `instanceof` may fail). */
|
|
14
|
+
declare class AgentSDKError extends Error {
|
|
15
|
+
/** @internal Marker for cross-bundle identity checks */
|
|
16
|
+
readonly _agentSDKError: true;
|
|
17
|
+
/** Machine-readable error code. Prefer values from the ErrorCode enum. */
|
|
18
|
+
readonly code?: string;
|
|
19
|
+
/** Whether this error is safe to retry */
|
|
20
|
+
readonly retryable: boolean;
|
|
21
|
+
/** HTTP status code hint for error classification */
|
|
22
|
+
readonly httpStatus?: number;
|
|
23
|
+
constructor(message: string, options?: AgentSDKErrorOptions);
|
|
24
|
+
/** Check if an error is an AgentSDKError (works across bundled copies) */
|
|
25
|
+
static is(error: unknown): error is AgentSDKError;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { AgentSDKError as A };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ChatSession, SendMessageOptions, ChatEvent,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { I as IChatTransport } from './transport-
|
|
1
|
+
import { I as IChatBackend, B as BackendAdapterOptions, g as ChatSession, S as SendMessageOptions, c as ChatMessage, a as ChatEvent, d as IResumableBackend } from './types-ajANVzf7.js';
|
|
2
|
+
import { F as FullAgentConfig, I as IAgentService, c as IAgent, d as Message, M as ModelInfo } from './agent-CW9XbmG_.js';
|
|
3
|
+
import { C as CopilotBackendOptions, a as ClaudeBackendOptions, V as VercelAIBackendOptions } from './backends-BSrsBYFn.js';
|
|
4
|
+
import { I as IChatTransport } from './transport-Ciap4PWK.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @witqq/agent-sdk/chat/backends/base
|
|
@@ -11,23 +11,28 @@ import { I as IChatTransport } from './transport-D1OaUgRk.js';
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Abstract base for backend adapters.
|
|
15
|
-
* Subclasses implement createService()
|
|
14
|
+
* Abstract base for backend adapters implementing IChatBackend (core only).
|
|
15
|
+
* Subclasses implement createService() for backend-specific service creation.
|
|
16
|
+
* Resume support is NOT required — subclasses can implement IResumableBackend separately.
|
|
16
17
|
*/
|
|
17
|
-
declare abstract class BaseBackendAdapter implements
|
|
18
|
+
declare abstract class BaseBackendAdapter implements IChatBackend {
|
|
18
19
|
readonly name: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
protected readonly _agentConfig:
|
|
23
|
-
private
|
|
20
|
+
private _agentService;
|
|
21
|
+
private _agentServiceFactory;
|
|
22
|
+
private _disposed;
|
|
23
|
+
protected readonly _agentConfig: FullAgentConfig;
|
|
24
|
+
private _ownsService;
|
|
25
|
+
private _currentAgent;
|
|
24
26
|
constructor(name: string, options: BackendAdapterOptions);
|
|
25
27
|
/** Subclasses create their specific IAgentService */
|
|
26
28
|
protected abstract createService(): IAgentService;
|
|
27
29
|
get agentService(): IAgentService;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
get currentModel(): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated No-op. Tools are passed per-call via SendMessageOptions.tools.
|
|
33
|
+
* Kept for backward compatibility with code that calls setTools() directly.
|
|
34
|
+
*/
|
|
35
|
+
setTools(): void;
|
|
31
36
|
sendMessage(session: ChatSession, message: string, options?: SendMessageOptions): Promise<ChatMessage>;
|
|
32
37
|
streamMessage(session: ChatSession, message: string, options?: SendMessageOptions): AsyncIterable<ChatEvent>;
|
|
33
38
|
/**
|
|
@@ -41,7 +46,9 @@ declare abstract class BaseBackendAdapter implements IBackendAdapter {
|
|
|
41
46
|
errors: string[];
|
|
42
47
|
}>;
|
|
43
48
|
dispose(): Promise<void>;
|
|
44
|
-
/** Get or create an agent
|
|
49
|
+
/** Get or create an agent. Model is passed per-call via RunOptions.
|
|
50
|
+
* Tools are passed per-call via SendMessageOptions — not baked into config.
|
|
51
|
+
* For persistent sessions, reuses agent when model matches. */
|
|
45
52
|
protected getOrCreateAgent(options?: SendMessageOptions): IAgent;
|
|
46
53
|
/** Subclasses capture backend session ID from agent after streaming */
|
|
47
54
|
protected abstract captureSessionId(agent: IAgent): void;
|
|
@@ -64,7 +71,7 @@ interface CopilotChatAdapterOptions extends BackendAdapterOptions {
|
|
|
64
71
|
* Backend adapter for GitHub Copilot CLI.
|
|
65
72
|
* Uses persistent session mode for session resume via CLI session ID.
|
|
66
73
|
*/
|
|
67
|
-
declare class CopilotChatAdapter extends BaseBackendAdapter {
|
|
74
|
+
declare class CopilotChatAdapter extends BaseBackendAdapter implements IResumableBackend {
|
|
68
75
|
private _backendSessionId;
|
|
69
76
|
private readonly _copilotOptions?;
|
|
70
77
|
constructor(options: CopilotChatAdapterOptions);
|
|
@@ -91,7 +98,7 @@ interface ClaudeChatAdapterOptions extends BackendAdapterOptions {
|
|
|
91
98
|
* Backend adapter for Claude CLI.
|
|
92
99
|
* Uses persistent session mode for session resume via Claude's session_id.
|
|
93
100
|
*/
|
|
94
|
-
declare class ClaudeChatAdapter extends BaseBackendAdapter {
|
|
101
|
+
declare class ClaudeChatAdapter extends BaseBackendAdapter implements IResumableBackend {
|
|
95
102
|
private _backendSessionId;
|
|
96
103
|
private readonly _claudeOptions?;
|
|
97
104
|
constructor(options: ClaudeChatAdapterOptions);
|
|
@@ -106,7 +113,7 @@ declare class ClaudeChatAdapter extends BaseBackendAdapter {
|
|
|
106
113
|
* @witqq/agent-sdk/chat/backends/vercel-ai
|
|
107
114
|
*
|
|
108
115
|
* VercelAIChatAdapter wraps VercelAIAgentService for chat use.
|
|
109
|
-
* Stateless adapter —
|
|
116
|
+
* Stateless adapter — implements IChatBackend only (no resume support).
|
|
110
117
|
* Each streamMessage/sendMessage creates a fresh agent (per-call session mode).
|
|
111
118
|
*/
|
|
112
119
|
|
|
@@ -118,14 +125,12 @@ interface VercelAIChatAdapterOptions extends BackendAdapterOptions {
|
|
|
118
125
|
/**
|
|
119
126
|
* Backend adapter for Vercel AI SDK (API-based).
|
|
120
127
|
* Stateless — each call creates a fresh agent. Does not support resume.
|
|
128
|
+
* Implements IChatBackend only (no IResumableBackend).
|
|
121
129
|
*/
|
|
122
130
|
declare class VercelAIChatAdapter extends BaseBackendAdapter {
|
|
123
131
|
private readonly _vercelOptions?;
|
|
124
132
|
constructor(options: VercelAIChatAdapterOptions);
|
|
125
133
|
protected createService(): IAgentService;
|
|
126
|
-
get backendSessionId(): string | null;
|
|
127
|
-
canResume(): boolean;
|
|
128
|
-
resume(_session: ChatSession, _backendSessionId: string, _options?: SendMessageOptions): AsyncIterable<ChatEvent>;
|
|
129
134
|
protected captureSessionId(_agent: IAgent): void;
|
|
130
135
|
}
|
|
131
136
|
|
|
@@ -220,4 +225,4 @@ declare class InProcessChatTransport implements IChatTransport {
|
|
|
220
225
|
[Symbol.asyncIterator](): AsyncIterator<ChatEvent>;
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
export { BaseBackendAdapter as B, ClaudeChatAdapter as C, InProcessChatTransport as I, VercelAIChatAdapter as V,
|
|
228
|
+
export { BaseBackendAdapter as B, ClaudeChatAdapter as C, InProcessChatTransport as I, VercelAIChatAdapter as V, WS_READY_STATE as W, type ClaudeChatAdapterOptions as a, CopilotChatAdapter as b, type CopilotChatAdapterOptions as c, type VercelAIChatAdapterOptions as d, type WebSocketLike as e, WsChatTransport as f, type WsTransportOptions as g };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ChatSession, SendMessageOptions, ChatEvent,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { I as IChatTransport } from './transport-
|
|
1
|
+
import { I as IChatBackend, B as BackendAdapterOptions, g as ChatSession, S as SendMessageOptions, c as ChatMessage, a as ChatEvent, d as IResumableBackend } from './types-DRgd_9R7.cjs';
|
|
2
|
+
import { F as FullAgentConfig, I as IAgentService, c as IAgent, d as Message, M as ModelInfo } from './agent-DxY68NZL.cjs';
|
|
3
|
+
import { C as CopilotBackendOptions, a as ClaudeBackendOptions, V as VercelAIBackendOptions } from './backends-BSrsBYFn.cjs';
|
|
4
|
+
import { I as IChatTransport } from './transport-Cdh3M0tS.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @witqq/agent-sdk/chat/backends/base
|
|
@@ -11,23 +11,28 @@ import { I as IChatTransport } from './transport-DX1Nhm4N.cjs';
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Abstract base for backend adapters.
|
|
15
|
-
* Subclasses implement createService()
|
|
14
|
+
* Abstract base for backend adapters implementing IChatBackend (core only).
|
|
15
|
+
* Subclasses implement createService() for backend-specific service creation.
|
|
16
|
+
* Resume support is NOT required — subclasses can implement IResumableBackend separately.
|
|
16
17
|
*/
|
|
17
|
-
declare abstract class BaseBackendAdapter implements
|
|
18
|
+
declare abstract class BaseBackendAdapter implements IChatBackend {
|
|
18
19
|
readonly name: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
protected readonly _agentConfig:
|
|
23
|
-
private
|
|
20
|
+
private _agentService;
|
|
21
|
+
private _agentServiceFactory;
|
|
22
|
+
private _disposed;
|
|
23
|
+
protected readonly _agentConfig: FullAgentConfig;
|
|
24
|
+
private _ownsService;
|
|
25
|
+
private _currentAgent;
|
|
24
26
|
constructor(name: string, options: BackendAdapterOptions);
|
|
25
27
|
/** Subclasses create their specific IAgentService */
|
|
26
28
|
protected abstract createService(): IAgentService;
|
|
27
29
|
get agentService(): IAgentService;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
get currentModel(): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated No-op. Tools are passed per-call via SendMessageOptions.tools.
|
|
33
|
+
* Kept for backward compatibility with code that calls setTools() directly.
|
|
34
|
+
*/
|
|
35
|
+
setTools(): void;
|
|
31
36
|
sendMessage(session: ChatSession, message: string, options?: SendMessageOptions): Promise<ChatMessage>;
|
|
32
37
|
streamMessage(session: ChatSession, message: string, options?: SendMessageOptions): AsyncIterable<ChatEvent>;
|
|
33
38
|
/**
|
|
@@ -41,7 +46,9 @@ declare abstract class BaseBackendAdapter implements IBackendAdapter {
|
|
|
41
46
|
errors: string[];
|
|
42
47
|
}>;
|
|
43
48
|
dispose(): Promise<void>;
|
|
44
|
-
/** Get or create an agent
|
|
49
|
+
/** Get or create an agent. Model is passed per-call via RunOptions.
|
|
50
|
+
* Tools are passed per-call via SendMessageOptions — not baked into config.
|
|
51
|
+
* For persistent sessions, reuses agent when model matches. */
|
|
45
52
|
protected getOrCreateAgent(options?: SendMessageOptions): IAgent;
|
|
46
53
|
/** Subclasses capture backend session ID from agent after streaming */
|
|
47
54
|
protected abstract captureSessionId(agent: IAgent): void;
|
|
@@ -64,7 +71,7 @@ interface CopilotChatAdapterOptions extends BackendAdapterOptions {
|
|
|
64
71
|
* Backend adapter for GitHub Copilot CLI.
|
|
65
72
|
* Uses persistent session mode for session resume via CLI session ID.
|
|
66
73
|
*/
|
|
67
|
-
declare class CopilotChatAdapter extends BaseBackendAdapter {
|
|
74
|
+
declare class CopilotChatAdapter extends BaseBackendAdapter implements IResumableBackend {
|
|
68
75
|
private _backendSessionId;
|
|
69
76
|
private readonly _copilotOptions?;
|
|
70
77
|
constructor(options: CopilotChatAdapterOptions);
|
|
@@ -91,7 +98,7 @@ interface ClaudeChatAdapterOptions extends BackendAdapterOptions {
|
|
|
91
98
|
* Backend adapter for Claude CLI.
|
|
92
99
|
* Uses persistent session mode for session resume via Claude's session_id.
|
|
93
100
|
*/
|
|
94
|
-
declare class ClaudeChatAdapter extends BaseBackendAdapter {
|
|
101
|
+
declare class ClaudeChatAdapter extends BaseBackendAdapter implements IResumableBackend {
|
|
95
102
|
private _backendSessionId;
|
|
96
103
|
private readonly _claudeOptions?;
|
|
97
104
|
constructor(options: ClaudeChatAdapterOptions);
|
|
@@ -106,7 +113,7 @@ declare class ClaudeChatAdapter extends BaseBackendAdapter {
|
|
|
106
113
|
* @witqq/agent-sdk/chat/backends/vercel-ai
|
|
107
114
|
*
|
|
108
115
|
* VercelAIChatAdapter wraps VercelAIAgentService for chat use.
|
|
109
|
-
* Stateless adapter —
|
|
116
|
+
* Stateless adapter — implements IChatBackend only (no resume support).
|
|
110
117
|
* Each streamMessage/sendMessage creates a fresh agent (per-call session mode).
|
|
111
118
|
*/
|
|
112
119
|
|
|
@@ -118,14 +125,12 @@ interface VercelAIChatAdapterOptions extends BackendAdapterOptions {
|
|
|
118
125
|
/**
|
|
119
126
|
* Backend adapter for Vercel AI SDK (API-based).
|
|
120
127
|
* Stateless — each call creates a fresh agent. Does not support resume.
|
|
128
|
+
* Implements IChatBackend only (no IResumableBackend).
|
|
121
129
|
*/
|
|
122
130
|
declare class VercelAIChatAdapter extends BaseBackendAdapter {
|
|
123
131
|
private readonly _vercelOptions?;
|
|
124
132
|
constructor(options: VercelAIChatAdapterOptions);
|
|
125
133
|
protected createService(): IAgentService;
|
|
126
|
-
get backendSessionId(): string | null;
|
|
127
|
-
canResume(): boolean;
|
|
128
|
-
resume(_session: ChatSession, _backendSessionId: string, _options?: SendMessageOptions): AsyncIterable<ChatEvent>;
|
|
129
134
|
protected captureSessionId(_agent: IAgent): void;
|
|
130
135
|
}
|
|
131
136
|
|
|
@@ -220,4 +225,4 @@ declare class InProcessChatTransport implements IChatTransport {
|
|
|
220
225
|
[Symbol.asyncIterator](): AsyncIterator<ChatEvent>;
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
export { BaseBackendAdapter as B, ClaudeChatAdapter as C, InProcessChatTransport as I, VercelAIChatAdapter as V,
|
|
228
|
+
export { BaseBackendAdapter as B, ClaudeChatAdapter as C, InProcessChatTransport as I, VercelAIChatAdapter as V, WS_READY_STATE as W, type ClaudeChatAdapterOptions as a, CopilotChatAdapter as b, type CopilotChatAdapterOptions as c, type VercelAIChatAdapterOptions as d, type WebSocketLike as e, WsChatTransport as f, type WsTransportOptions as g };
|