@band-ai/sdk 0.1.6 → 0.2.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 +372 -0
- package/dist/{ClaudeSDKAdapter-CRq4R-WB.d.cts → ClaudeSDKAdapter-BY4zEbCl.d.cts} +14 -10
- package/dist/{ClaudeSDKAdapter-BHOkjN3X.d.ts → ClaudeSDKAdapter-Cna5P1dR.d.ts} +14 -10
- package/dist/{acp-server-B1Da7L6u.d.ts → acp-server-CiUqN3G3.d.ts} +2 -2
- package/dist/{acp-server-BdRz9_UN.d.cts → acp-server-Dlj7D563.d.cts} +2 -2
- package/dist/adapters.cjs +734 -279
- package/dist/adapters.d.cts +21 -19
- package/dist/adapters.d.ts +21 -19
- package/dist/adapters.js +65 -44
- package/dist/backends-D-dBdDm-.d.ts +27 -0
- package/dist/backends-ZLxmQrTZ.d.cts +27 -0
- package/dist/{chunk-MSL6CWHY.js → chunk-4IAXZBXX.js} +77 -37
- package/dist/{chunk-SG4WLD2H.js → chunk-EAI2M3WM.js} +38 -94
- package/dist/{chunk-YR3BOQNW.js → chunk-JY75VSQK.js} +7 -7
- package/dist/{chunk-INA6YZTZ.js → chunk-LBWKISBS.js} +51 -31
- package/dist/{chunk-I5EZG52P.js → chunk-N2QTUMGO.js} +532 -327
- package/dist/{chunk-RHVH2GZR.js → chunk-NMZLX7TP.js} +110 -56
- package/dist/{chunk-EDPKUUJL.js → chunk-NT7TBFX2.js} +9 -1
- package/dist/{chunk-GVEQ3RAH.js → chunk-RV76SKFT.js} +169 -54
- package/dist/{chunk-W5NDZSYE.js → chunk-TLBCKDQO.js} +23 -23
- package/dist/chunk-US226AS4.js +130 -0
- package/dist/{chunk-IZPV6QS6.js → chunk-WL2HNJZ6.js} +38 -11
- package/dist/chunk-WLCM2OXG.js +181 -0
- package/dist/config.cjs +40 -13
- package/dist/config.d.cts +7 -1
- package/dist/config.d.ts +7 -1
- package/dist/config.js +2 -2
- package/dist/converters.cjs +491 -35
- package/dist/converters.d.cts +5 -5
- package/dist/converters.d.ts +5 -5
- package/dist/converters.js +4 -3
- package/dist/core.cjs +53 -10
- package/dist/core.d.cts +10 -9
- package/dist/core.d.ts +10 -9
- package/dist/core.js +8 -4
- package/dist/disconnectReason-IuADl6TH.d.cts +34 -0
- package/dist/disconnectReason-IuADl6TH.d.ts +34 -0
- package/dist/{dtos-DUpbIu8k.d.ts → dtos-B8KU_q4d.d.cts} +26 -6
- package/dist/{dtos-DUpbIu8k.d.cts → dtos-B8KU_q4d.d.ts} +26 -6
- package/dist/index.cjs +1510 -735
- package/dist/index.d.cts +18 -16
- package/dist/index.d.ts +18 -16
- package/dist/index.js +21 -13
- package/dist/linear.cjs +1044 -112
- package/dist/linear.d.cts +146 -16
- package/dist/linear.d.ts +146 -16
- package/dist/linear.js +1031 -110
- package/dist/mcp-claude.cjs +338 -66
- package/dist/mcp-claude.d.cts +3 -3
- package/dist/mcp-claude.d.ts +3 -3
- package/dist/mcp-claude.js +215 -16
- package/dist/mcp.cjs +414 -105
- package/dist/mcp.d.cts +29 -16
- package/dist/mcp.d.ts +29 -16
- package/dist/mcp.js +14 -14
- package/dist/{opencode-BBcDchcN.d.cts → opencode-2YdscIc1.d.cts} +5 -5
- package/dist/{opencode-DthQQUsZ.d.ts → opencode-Bld62x5t.d.ts} +5 -5
- package/dist/{pagination-CcDkVFxK.d.ts → pagination-BgEx-HeL.d.ts} +2 -2
- package/dist/{pagination-BPiys10t.d.cts → pagination-DqdkQArT.d.cts} +2 -2
- package/dist/{protocols-DrhzOH6K.d.ts → protocols-Bwwcql0h.d.ts} +1 -1
- package/dist/{protocols-CInhtFpA.d.cts → protocols-Bz1rxcUg.d.cts} +1 -1
- package/dist/rest.cjs +41 -97
- package/dist/rest.d.cts +7 -7
- package/dist/rest.d.ts +7 -7
- package/dist/rest.js +2 -2
- package/dist/runtime.cjs +998 -620
- package/dist/runtime.d.cts +22 -29
- package/dist/runtime.d.ts +22 -29
- package/dist/runtime.js +19 -67
- package/dist/{schemas-BpEBkq5V.d.cts → schemas-BotL3ZLH.d.cts} +51 -56
- package/dist/{schemas-vos1AaBc.d.ts → schemas-DBsC4J1g.d.ts} +51 -56
- package/dist/{sdk-CwTAxhwI.d.cts → sdk-BTciSLRQ.d.cts} +35 -5
- package/dist/{sdk-CcnQ5OUC.d.ts → sdk-qKJtMma_.d.ts} +35 -5
- package/dist/{simpleAdapter-9OE_p6QW.d.ts → simpleAdapter--wznuoOw.d.ts} +1 -1
- package/dist/{simpleAdapter-DqhvjsGr.d.cts → simpleAdapter-BpT4XbZC.d.cts} +1 -1
- package/dist/testing.d.cts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/{types-7jVzOeOP.d.ts → types-BTN_ZETM.d.ts} +2 -2
- package/dist/{types-CxII3XkA.d.ts → types-BgYFd_Yw.d.cts} +5 -5
- package/dist/{types-CSHFipIc.d.cts → types-BivGO7I9.d.ts} +5 -5
- package/dist/{types-CovcHpYf.d.cts → types-D958TC71.d.cts} +2 -2
- package/package.json +25 -23
- package/dist/backends-CzDbiQar.d.ts +0 -20
- package/dist/backends-SVMT-7l4.d.cts +0 -20
- package/dist/chunk-SFVKOEQH.js +0 -103
package/dist/adapters.d.cts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { A as A2AAdapter, a as A2AAdapterOptions, K as A2AClientFactory, M as A2AClientLike, b as A2AGatewayAdapter, c as AnthropicAdapter, d as AnthropicAdapterOptions, N as AnthropicClientFactory, Q as AnthropicToolCallingModel, R as AnthropicToolCallingModelOptions, C as CODEX_REASONING_EFFORTS, e as CODEX_REASONING_SUMMARIES, f as CODEX_WEB_SEARCH_MODES, g as ClaudePermissionMode, h as ClaudeSDKAdapter, i as ClaudeSDKAdapterOptions, S as ClaudeSDKQuery, U as ClaudeSDKQueryParams, j as CodexAdapter, k as CodexAdapterConfig, W as CodexAppServerStdioClient, l as CodexApprovalPolicy, X as CodexClientLike, Y as CodexJsonRpcError, m as CodexReasoningEffort, n as CodexReasoningSummary, o as CodexSandboxMode, p as CodexWebSearchMode, Z as DynamicToolCallParams, _ as DynamicToolCallResponse, $ as DynamicToolSpec, G as GeminiAdapter, q as GeminiAdapterOptions, a0 as GeminiClientFactory, a1 as GeminiToolCallingModel, a2 as GeminiToolCallingModelOptions, r as GenericAdapter, s as GenericAdapterHandler, t as GoogleADKAdapter, u as GoogleADKAdapterOptions, a3 as HttpOpencodeClient, a4 as HttpOpencodeClientOptions, a5 as HttpStatusError, L as LangGraphAdapter, v as LangGraphAdapterOptions, w as LangGraphGraph, x as LettaAdapter, y as LettaAdapterOptions, a6 as LettaAgentCreateParams, a7 as LettaClientFactory, a8 as LettaClientLike, a9 as LettaHistoryConverter, aa as LettaMessage, ab as LettaMessageCreateParams, ac as LettaMessages, ad as LettaRequestOptions, ae as LettaResponse, af as LettaResponseMessage, O as OpenAIAdapter, z as OpenAIAdapterOptions, ag as OpenAIClientFactory, ah as OpenAIToolCallingModel, ai as OpenAIToolCallingModelOptions, B as OpencodeAdapter, D as OpencodeAdapterConfig, E as OpencodeApprovalMode, F as OpencodeApprovalReply, aj as OpencodeClientLike, H as OpencodeQuestionMode, P as ParlantAdapter, I as ParlantAdapterOptions, ak as ParlantClientFactory, al as ParlantClientLike, am as ToolCall, an as ToolCallingAdapter, ao as ToolCallingAdapterOptions, T as ToolCallingModel, ap as ToolCallingModelRequest, aq as ToolCallingResponse, ar as ToolResult, as as TurnStartParams, V as VercelAISDKAdapter, J as VercelAISDKAdapterOptions, at as VercelAISDKToolCallingModel, au as VercelAISDKToolCallingModelOptions, av as runSingleToolRound } from './ClaudeSDKAdapter-
|
|
1
|
+
export { A as A2AAdapter, a as A2AAdapterOptions, K as A2AClientFactory, M as A2AClientLike, b as A2AGatewayAdapter, c as AnthropicAdapter, d as AnthropicAdapterOptions, N as AnthropicClientFactory, Q as AnthropicToolCallingModel, R as AnthropicToolCallingModelOptions, C as CODEX_REASONING_EFFORTS, e as CODEX_REASONING_SUMMARIES, f as CODEX_WEB_SEARCH_MODES, g as ClaudePermissionMode, h as ClaudeSDKAdapter, i as ClaudeSDKAdapterOptions, S as ClaudeSDKQuery, U as ClaudeSDKQueryParams, j as CodexAdapter, k as CodexAdapterConfig, W as CodexAppServerStdioClient, l as CodexApprovalPolicy, X as CodexClientLike, Y as CodexJsonRpcError, m as CodexReasoningEffort, n as CodexReasoningSummary, o as CodexSandboxMode, p as CodexWebSearchMode, Z as DynamicToolCallParams, _ as DynamicToolCallResponse, $ as DynamicToolSpec, G as GeminiAdapter, q as GeminiAdapterOptions, a0 as GeminiClientFactory, a1 as GeminiToolCallingModel, a2 as GeminiToolCallingModelOptions, r as GenericAdapter, s as GenericAdapterHandler, t as GoogleADKAdapter, u as GoogleADKAdapterOptions, a3 as HttpOpencodeClient, a4 as HttpOpencodeClientOptions, a5 as HttpStatusError, L as LangGraphAdapter, v as LangGraphAdapterOptions, w as LangGraphGraph, x as LettaAdapter, y as LettaAdapterOptions, a6 as LettaAgentCreateParams, a7 as LettaClientFactory, a8 as LettaClientLike, a9 as LettaHistoryConverter, aa as LettaMessage, ab as LettaMessageCreateParams, ac as LettaMessages, ad as LettaRequestOptions, ae as LettaResponse, af as LettaResponseMessage, O as OpenAIAdapter, z as OpenAIAdapterOptions, ag as OpenAIClientFactory, ah as OpenAIToolCallingModel, ai as OpenAIToolCallingModelOptions, B as OpencodeAdapter, D as OpencodeAdapterConfig, E as OpencodeApprovalMode, F as OpencodeApprovalReply, aj as OpencodeClientLike, H as OpencodeQuestionMode, P as ParlantAdapter, I as ParlantAdapterOptions, ak as ParlantClientFactory, al as ParlantClientLike, am as ToolCall, an as ToolCallingAdapter, ao as ToolCallingAdapterOptions, T as ToolCallingModel, ap as ToolCallingModelRequest, aq as ToolCallingResponse, ar as ToolResult, as as TurnStartParams, V as VercelAISDKAdapter, J as VercelAISDKAdapterOptions, at as VercelAISDKToolCallingModel, au as VercelAISDKToolCallingModelOptions, av as runSingleToolRound } from './ClaudeSDKAdapter-BY4zEbCl.cjs';
|
|
2
2
|
import * as _agentclientprotocol_sdk from '@agentclientprotocol/sdk';
|
|
3
3
|
import { Client, ClientSideConnection, McpServer, ClientCapabilities, SessionMode, AgentSideConnection, SessionModeState, Agent, InitializeResponse, Implementation, Stream, InitializeRequest, LoadSessionRequest, LoadSessionResponse, ListSessionsRequest, ListSessionsResponse, ForkSessionRequest, ForkSessionResponse, ResumeSessionRequest, ResumeSessionResponse, SetSessionModeRequest, SetSessionModeResponse, SetSessionModelRequest, SetSessionModelResponse, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, AuthenticateRequest, AuthenticateResponse, PromptRequest, PromptResponse } from '@agentclientprotocol/sdk';
|
|
4
|
-
import { A as ACPClientSessionState, a as ACPServerSessionState } from './acp-server-
|
|
5
|
-
export { G as GatewayHistoryConverter } from './acp-server-
|
|
6
|
-
import { S as SimpleAdapter } from './simpleAdapter-
|
|
7
|
-
import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-
|
|
8
|
-
import { P as PlatformMessage } from './types-
|
|
9
|
-
import { M as McpToolRegistration } from './sdk-
|
|
10
|
-
import { R as RestApi } from './types-
|
|
11
|
-
import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-
|
|
12
|
-
export { A as A2AAuth, a as A2AGatewayAdapterOptions, d as A2AHistoryConverter, e as A2ASessionState, f as GatewayA2AMessage, g as GatewayA2AStatusUpdateEvent, h as GatewayCancelRequest, i as GatewayPeer, j as GatewayRequest, k as GatewayServerFactory, G as GatewaySessionState, l as GatewayTaskState, P as ParlantHistoryConverter, m as ParlantMessage, n as ParlantMessages, o as PendingA2ATask, p as buildA2AAuthHeaders } from './opencode-
|
|
4
|
+
import { A as ACPClientSessionState, a as ACPServerSessionState } from './acp-server-Dlj7D563.cjs';
|
|
5
|
+
export { G as GatewayHistoryConverter } from './acp-server-Dlj7D563.cjs';
|
|
6
|
+
import { S as SimpleAdapter } from './simpleAdapter-BpT4XbZC.cjs';
|
|
7
|
+
import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-Bz1rxcUg.cjs';
|
|
8
|
+
import { P as PlatformMessage } from './types-D958TC71.cjs';
|
|
9
|
+
import { M as McpToolRegistration } from './sdk-BTciSLRQ.cjs';
|
|
10
|
+
import { R as RestApi } from './types-BgYFd_Yw.cjs';
|
|
11
|
+
import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-2YdscIc1.cjs';
|
|
12
|
+
export { A as A2AAuth, a as A2AGatewayAdapterOptions, d as A2AHistoryConverter, e as A2ASessionState, f as GatewayA2AMessage, g as GatewayA2AStatusUpdateEvent, h as GatewayCancelRequest, i as GatewayPeer, j as GatewayRequest, k as GatewayServerFactory, G as GatewaySessionState, l as GatewayTaskState, P as ParlantHistoryConverter, m as ParlantMessage, n as ParlantMessages, o as PendingA2ATask, p as buildA2AAuthHeaders } from './opencode-2YdscIc1.cjs';
|
|
13
13
|
import './logger-CABQOnlR.cjs';
|
|
14
14
|
import './customTools-BzF0IISO.cjs';
|
|
15
15
|
import 'zod';
|
|
16
|
-
import './dtos-
|
|
17
|
-
import './backends-
|
|
16
|
+
import './dtos-B8KU_q4d.cjs';
|
|
17
|
+
import './backends-ZLxmQrTZ.cjs';
|
|
18
18
|
import '@anthropic-ai/claude-agent-sdk';
|
|
19
19
|
|
|
20
20
|
declare class GatewayServer implements GatewayServerLike {
|
|
@@ -69,6 +69,7 @@ declare class ACPClientAdapter extends SimpleAdapter<ACPClientSessionState, Adap
|
|
|
69
69
|
private readonly activeSessions;
|
|
70
70
|
private readonly bootstrappedSessions;
|
|
71
71
|
private backend;
|
|
72
|
+
private backendPromise;
|
|
72
73
|
private client;
|
|
73
74
|
private connectionHandle;
|
|
74
75
|
private connection;
|
|
@@ -92,13 +93,14 @@ declare class ACPClientAdapter extends SimpleAdapter<ACPClientSessionState, Adap
|
|
|
92
93
|
private tryRestoreSession;
|
|
93
94
|
private buildSessionMcpServers;
|
|
94
95
|
private getOrCreateBackend;
|
|
96
|
+
private createBackend;
|
|
95
97
|
private buildSystemContext;
|
|
96
98
|
private handlePermissionRequest;
|
|
97
99
|
private flushChunks;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
interface
|
|
101
|
-
|
|
102
|
+
interface BandACPServerAdapterOptions {
|
|
103
|
+
bandRest: RestApi;
|
|
102
104
|
maxSessions?: number;
|
|
103
105
|
responseTimeoutMs?: number;
|
|
104
106
|
promptCompletionGraceMs?: number;
|
|
@@ -106,8 +108,8 @@ interface ThenvoiACPServerAdapterOptions {
|
|
|
106
108
|
modeToPeer?: Record<string, string>;
|
|
107
109
|
slashCommands?: Record<string, string>;
|
|
108
110
|
}
|
|
109
|
-
declare class
|
|
110
|
-
private readonly
|
|
111
|
+
declare class BandACPServerAdapter extends SimpleAdapter<ACPServerSessionState, MessagingTools> {
|
|
112
|
+
private readonly bandRest;
|
|
111
113
|
private readonly maxSessions;
|
|
112
114
|
private readonly responseTimeoutMs;
|
|
113
115
|
private readonly promptCompletionGraceMs;
|
|
@@ -124,7 +126,7 @@ declare class ThenvoiACPServerAdapter extends SimpleAdapter<ACPServerSessionStat
|
|
|
124
126
|
private sessionsInFlight;
|
|
125
127
|
private readonly router;
|
|
126
128
|
private readonly pushHandler;
|
|
127
|
-
constructor(options:
|
|
129
|
+
constructor(options: BandACPServerAdapterOptions);
|
|
128
130
|
bindConnection(connection: AgentSideConnection | null): void;
|
|
129
131
|
getConnection(): AgentSideConnection | null;
|
|
130
132
|
hasSession(sessionId: string): boolean;
|
|
@@ -190,7 +192,7 @@ declare class ACPServer implements Agent {
|
|
|
190
192
|
private readonly agentInfo;
|
|
191
193
|
private readonly extensionHandler;
|
|
192
194
|
private connection;
|
|
193
|
-
constructor(adapter:
|
|
195
|
+
constructor(adapter: BandACPServerAdapter, options?: ACPServerOptions);
|
|
194
196
|
connectStream(stream: Stream): Promise<AgentSideConnection>;
|
|
195
197
|
connectStdio(options?: {
|
|
196
198
|
stdin?: NodeJS.ReadableStream;
|
|
@@ -214,4 +216,4 @@ declare class ACPServer implements Agent {
|
|
|
214
216
|
extNotification(method: string, params: Record<string, unknown>): Promise<void>;
|
|
215
217
|
}
|
|
216
218
|
|
|
217
|
-
export { ACPClientAdapter, type ACPClientAdapterOptions, ACPServer, type ACPServerOptions,
|
|
219
|
+
export { ACPClientAdapter, type ACPClientAdapterOptions, ACPServer, type ACPServerOptions, BandACPServerAdapter, type BandACPServerAdapterOptions, GatewayServer, GatewayServerLike, GatewayServerOptions, createGatewayServer };
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { A as A2AAdapter, a as A2AAdapterOptions, K as A2AClientFactory, M as A2AClientLike, b as A2AGatewayAdapter, c as AnthropicAdapter, d as AnthropicAdapterOptions, N as AnthropicClientFactory, Q as AnthropicToolCallingModel, R as AnthropicToolCallingModelOptions, C as CODEX_REASONING_EFFORTS, e as CODEX_REASONING_SUMMARIES, f as CODEX_WEB_SEARCH_MODES, g as ClaudePermissionMode, h as ClaudeSDKAdapter, i as ClaudeSDKAdapterOptions, S as ClaudeSDKQuery, U as ClaudeSDKQueryParams, j as CodexAdapter, k as CodexAdapterConfig, W as CodexAppServerStdioClient, l as CodexApprovalPolicy, X as CodexClientLike, Y as CodexJsonRpcError, m as CodexReasoningEffort, n as CodexReasoningSummary, o as CodexSandboxMode, p as CodexWebSearchMode, Z as DynamicToolCallParams, _ as DynamicToolCallResponse, $ as DynamicToolSpec, G as GeminiAdapter, q as GeminiAdapterOptions, a0 as GeminiClientFactory, a1 as GeminiToolCallingModel, a2 as GeminiToolCallingModelOptions, r as GenericAdapter, s as GenericAdapterHandler, t as GoogleADKAdapter, u as GoogleADKAdapterOptions, a3 as HttpOpencodeClient, a4 as HttpOpencodeClientOptions, a5 as HttpStatusError, L as LangGraphAdapter, v as LangGraphAdapterOptions, w as LangGraphGraph, x as LettaAdapter, y as LettaAdapterOptions, a6 as LettaAgentCreateParams, a7 as LettaClientFactory, a8 as LettaClientLike, a9 as LettaHistoryConverter, aa as LettaMessage, ab as LettaMessageCreateParams, ac as LettaMessages, ad as LettaRequestOptions, ae as LettaResponse, af as LettaResponseMessage, O as OpenAIAdapter, z as OpenAIAdapterOptions, ag as OpenAIClientFactory, ah as OpenAIToolCallingModel, ai as OpenAIToolCallingModelOptions, B as OpencodeAdapter, D as OpencodeAdapterConfig, E as OpencodeApprovalMode, F as OpencodeApprovalReply, aj as OpencodeClientLike, H as OpencodeQuestionMode, P as ParlantAdapter, I as ParlantAdapterOptions, ak as ParlantClientFactory, al as ParlantClientLike, am as ToolCall, an as ToolCallingAdapter, ao as ToolCallingAdapterOptions, T as ToolCallingModel, ap as ToolCallingModelRequest, aq as ToolCallingResponse, ar as ToolResult, as as TurnStartParams, V as VercelAISDKAdapter, J as VercelAISDKAdapterOptions, at as VercelAISDKToolCallingModel, au as VercelAISDKToolCallingModelOptions, av as runSingleToolRound } from './ClaudeSDKAdapter-
|
|
1
|
+
export { A as A2AAdapter, a as A2AAdapterOptions, K as A2AClientFactory, M as A2AClientLike, b as A2AGatewayAdapter, c as AnthropicAdapter, d as AnthropicAdapterOptions, N as AnthropicClientFactory, Q as AnthropicToolCallingModel, R as AnthropicToolCallingModelOptions, C as CODEX_REASONING_EFFORTS, e as CODEX_REASONING_SUMMARIES, f as CODEX_WEB_SEARCH_MODES, g as ClaudePermissionMode, h as ClaudeSDKAdapter, i as ClaudeSDKAdapterOptions, S as ClaudeSDKQuery, U as ClaudeSDKQueryParams, j as CodexAdapter, k as CodexAdapterConfig, W as CodexAppServerStdioClient, l as CodexApprovalPolicy, X as CodexClientLike, Y as CodexJsonRpcError, m as CodexReasoningEffort, n as CodexReasoningSummary, o as CodexSandboxMode, p as CodexWebSearchMode, Z as DynamicToolCallParams, _ as DynamicToolCallResponse, $ as DynamicToolSpec, G as GeminiAdapter, q as GeminiAdapterOptions, a0 as GeminiClientFactory, a1 as GeminiToolCallingModel, a2 as GeminiToolCallingModelOptions, r as GenericAdapter, s as GenericAdapterHandler, t as GoogleADKAdapter, u as GoogleADKAdapterOptions, a3 as HttpOpencodeClient, a4 as HttpOpencodeClientOptions, a5 as HttpStatusError, L as LangGraphAdapter, v as LangGraphAdapterOptions, w as LangGraphGraph, x as LettaAdapter, y as LettaAdapterOptions, a6 as LettaAgentCreateParams, a7 as LettaClientFactory, a8 as LettaClientLike, a9 as LettaHistoryConverter, aa as LettaMessage, ab as LettaMessageCreateParams, ac as LettaMessages, ad as LettaRequestOptions, ae as LettaResponse, af as LettaResponseMessage, O as OpenAIAdapter, z as OpenAIAdapterOptions, ag as OpenAIClientFactory, ah as OpenAIToolCallingModel, ai as OpenAIToolCallingModelOptions, B as OpencodeAdapter, D as OpencodeAdapterConfig, E as OpencodeApprovalMode, F as OpencodeApprovalReply, aj as OpencodeClientLike, H as OpencodeQuestionMode, P as ParlantAdapter, I as ParlantAdapterOptions, ak as ParlantClientFactory, al as ParlantClientLike, am as ToolCall, an as ToolCallingAdapter, ao as ToolCallingAdapterOptions, T as ToolCallingModel, ap as ToolCallingModelRequest, aq as ToolCallingResponse, ar as ToolResult, as as TurnStartParams, V as VercelAISDKAdapter, J as VercelAISDKAdapterOptions, at as VercelAISDKToolCallingModel, au as VercelAISDKToolCallingModelOptions, av as runSingleToolRound } from './ClaudeSDKAdapter-Cna5P1dR.js';
|
|
2
2
|
import * as _agentclientprotocol_sdk from '@agentclientprotocol/sdk';
|
|
3
3
|
import { Client, ClientSideConnection, McpServer, ClientCapabilities, SessionMode, AgentSideConnection, SessionModeState, Agent, InitializeResponse, Implementation, Stream, InitializeRequest, LoadSessionRequest, LoadSessionResponse, ListSessionsRequest, ListSessionsResponse, ForkSessionRequest, ForkSessionResponse, ResumeSessionRequest, ResumeSessionResponse, SetSessionModeRequest, SetSessionModeResponse, SetSessionModelRequest, SetSessionModelResponse, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, AuthenticateRequest, AuthenticateResponse, PromptRequest, PromptResponse } from '@agentclientprotocol/sdk';
|
|
4
|
-
import { A as ACPClientSessionState, a as ACPServerSessionState } from './acp-server-
|
|
5
|
-
export { G as GatewayHistoryConverter } from './acp-server-
|
|
6
|
-
import { S as SimpleAdapter } from './simpleAdapter
|
|
7
|
-
import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-
|
|
8
|
-
import { P as PlatformMessage } from './types-
|
|
9
|
-
import { M as McpToolRegistration } from './sdk-
|
|
10
|
-
import { R as RestApi } from './types-
|
|
11
|
-
import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-
|
|
12
|
-
export { A as A2AAuth, a as A2AGatewayAdapterOptions, d as A2AHistoryConverter, e as A2ASessionState, f as GatewayA2AMessage, g as GatewayA2AStatusUpdateEvent, h as GatewayCancelRequest, i as GatewayPeer, j as GatewayRequest, k as GatewayServerFactory, G as GatewaySessionState, l as GatewayTaskState, P as ParlantHistoryConverter, m as ParlantMessage, n as ParlantMessages, o as PendingA2ATask, p as buildA2AAuthHeaders } from './opencode-
|
|
4
|
+
import { A as ACPClientSessionState, a as ACPServerSessionState } from './acp-server-CiUqN3G3.js';
|
|
5
|
+
export { G as GatewayHistoryConverter } from './acp-server-CiUqN3G3.js';
|
|
6
|
+
import { S as SimpleAdapter } from './simpleAdapter--wznuoOw.js';
|
|
7
|
+
import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-Bwwcql0h.js';
|
|
8
|
+
import { P as PlatformMessage } from './types-BTN_ZETM.js';
|
|
9
|
+
import { M as McpToolRegistration } from './sdk-qKJtMma_.js';
|
|
10
|
+
import { R as RestApi } from './types-BivGO7I9.js';
|
|
11
|
+
import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-Bld62x5t.js';
|
|
12
|
+
export { A as A2AAuth, a as A2AGatewayAdapterOptions, d as A2AHistoryConverter, e as A2ASessionState, f as GatewayA2AMessage, g as GatewayA2AStatusUpdateEvent, h as GatewayCancelRequest, i as GatewayPeer, j as GatewayRequest, k as GatewayServerFactory, G as GatewaySessionState, l as GatewayTaskState, P as ParlantHistoryConverter, m as ParlantMessage, n as ParlantMessages, o as PendingA2ATask, p as buildA2AAuthHeaders } from './opencode-Bld62x5t.js';
|
|
13
13
|
import './logger-CABQOnlR.js';
|
|
14
14
|
import './customTools-BzF0IISO.js';
|
|
15
15
|
import 'zod';
|
|
16
|
-
import './dtos-
|
|
17
|
-
import './backends-
|
|
16
|
+
import './dtos-B8KU_q4d.js';
|
|
17
|
+
import './backends-D-dBdDm-.js';
|
|
18
18
|
import '@anthropic-ai/claude-agent-sdk';
|
|
19
19
|
|
|
20
20
|
declare class GatewayServer implements GatewayServerLike {
|
|
@@ -69,6 +69,7 @@ declare class ACPClientAdapter extends SimpleAdapter<ACPClientSessionState, Adap
|
|
|
69
69
|
private readonly activeSessions;
|
|
70
70
|
private readonly bootstrappedSessions;
|
|
71
71
|
private backend;
|
|
72
|
+
private backendPromise;
|
|
72
73
|
private client;
|
|
73
74
|
private connectionHandle;
|
|
74
75
|
private connection;
|
|
@@ -92,13 +93,14 @@ declare class ACPClientAdapter extends SimpleAdapter<ACPClientSessionState, Adap
|
|
|
92
93
|
private tryRestoreSession;
|
|
93
94
|
private buildSessionMcpServers;
|
|
94
95
|
private getOrCreateBackend;
|
|
96
|
+
private createBackend;
|
|
95
97
|
private buildSystemContext;
|
|
96
98
|
private handlePermissionRequest;
|
|
97
99
|
private flushChunks;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
interface
|
|
101
|
-
|
|
102
|
+
interface BandACPServerAdapterOptions {
|
|
103
|
+
bandRest: RestApi;
|
|
102
104
|
maxSessions?: number;
|
|
103
105
|
responseTimeoutMs?: number;
|
|
104
106
|
promptCompletionGraceMs?: number;
|
|
@@ -106,8 +108,8 @@ interface ThenvoiACPServerAdapterOptions {
|
|
|
106
108
|
modeToPeer?: Record<string, string>;
|
|
107
109
|
slashCommands?: Record<string, string>;
|
|
108
110
|
}
|
|
109
|
-
declare class
|
|
110
|
-
private readonly
|
|
111
|
+
declare class BandACPServerAdapter extends SimpleAdapter<ACPServerSessionState, MessagingTools> {
|
|
112
|
+
private readonly bandRest;
|
|
111
113
|
private readonly maxSessions;
|
|
112
114
|
private readonly responseTimeoutMs;
|
|
113
115
|
private readonly promptCompletionGraceMs;
|
|
@@ -124,7 +126,7 @@ declare class ThenvoiACPServerAdapter extends SimpleAdapter<ACPServerSessionStat
|
|
|
124
126
|
private sessionsInFlight;
|
|
125
127
|
private readonly router;
|
|
126
128
|
private readonly pushHandler;
|
|
127
|
-
constructor(options:
|
|
129
|
+
constructor(options: BandACPServerAdapterOptions);
|
|
128
130
|
bindConnection(connection: AgentSideConnection | null): void;
|
|
129
131
|
getConnection(): AgentSideConnection | null;
|
|
130
132
|
hasSession(sessionId: string): boolean;
|
|
@@ -190,7 +192,7 @@ declare class ACPServer implements Agent {
|
|
|
190
192
|
private readonly agentInfo;
|
|
191
193
|
private readonly extensionHandler;
|
|
192
194
|
private connection;
|
|
193
|
-
constructor(adapter:
|
|
195
|
+
constructor(adapter: BandACPServerAdapter, options?: ACPServerOptions);
|
|
194
196
|
connectStream(stream: Stream): Promise<AgentSideConnection>;
|
|
195
197
|
connectStdio(options?: {
|
|
196
198
|
stdin?: NodeJS.ReadableStream;
|
|
@@ -214,4 +216,4 @@ declare class ACPServer implements Agent {
|
|
|
214
216
|
extNotification(method: string, params: Record<string, unknown>): Promise<void>;
|
|
215
217
|
}
|
|
216
218
|
|
|
217
|
-
export { ACPClientAdapter, type ACPClientAdapterOptions, ACPServer, type ACPServerOptions,
|
|
219
|
+
export { ACPClientAdapter, type ACPClientAdapterOptions, ACPServer, type ACPServerOptions, BandACPServerAdapter, type BandACPServerAdapterOptions, GatewayServer, GatewayServerLike, GatewayServerOptions, createGatewayServer };
|
package/dist/adapters.js
CHANGED
|
@@ -24,12 +24,13 @@ import {
|
|
|
24
24
|
VercelAISDKAdapter,
|
|
25
25
|
VercelAISDKToolCallingModel,
|
|
26
26
|
runSingleToolRound
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-NMZLX7TP.js";
|
|
28
28
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
BandMcpServer,
|
|
30
|
+
BandMcpSseServer,
|
|
31
|
+
generateAuthToken
|
|
32
|
+
} from "./chunk-4IAXZBXX.js";
|
|
33
|
+
import "./chunk-NT7TBFX2.js";
|
|
33
34
|
import {
|
|
34
35
|
ACPClientHistoryConverter,
|
|
35
36
|
ACPServerHistoryConverter
|
|
@@ -47,23 +48,25 @@ import {
|
|
|
47
48
|
createGatewayServer,
|
|
48
49
|
parseToolCall,
|
|
49
50
|
parseToolResult
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-TLBCKDQO.js";
|
|
51
52
|
import {
|
|
52
53
|
SimpleAdapter
|
|
53
54
|
} from "./chunk-AVVDPXP4.js";
|
|
54
55
|
import {
|
|
55
56
|
ensureHandlePrefix
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-GVEQ3RAH.js";
|
|
57
|
+
} from "./chunk-LBWKISBS.js";
|
|
58
58
|
import {
|
|
59
59
|
renderSystemPrompt
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-WLCM2OXG.js";
|
|
61
|
+
import {
|
|
62
|
+
MCP_SERVER_NAME
|
|
63
|
+
} from "./chunk-RV76SKFT.js";
|
|
61
64
|
import "./chunk-ZZJRRBPQ.js";
|
|
62
65
|
import "./chunk-3BKAC4OZ.js";
|
|
63
66
|
import "./chunk-OD2G5LFQ.js";
|
|
64
67
|
import {
|
|
65
68
|
UnsupportedFeatureError
|
|
66
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-JY75VSQK.js";
|
|
67
70
|
|
|
68
71
|
// src/adapters/acp/ACPClientAdapter.ts
|
|
69
72
|
import { spawn } from "child_process";
|
|
@@ -129,7 +132,7 @@ function normalizeMcpServers(mcpServers) {
|
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
// src/adapters/acp/client.ts
|
|
132
|
-
var
|
|
135
|
+
var BandACPClient = class {
|
|
133
136
|
sessionChunks = /* @__PURE__ */ new Map();
|
|
134
137
|
permissionHandlers = /* @__PURE__ */ new Map();
|
|
135
138
|
async sessionUpdate(params) {
|
|
@@ -357,6 +360,7 @@ var ACPClientAdapter = class extends SimpleAdapter {
|
|
|
357
360
|
activeSessions = /* @__PURE__ */ new Set();
|
|
358
361
|
bootstrappedSessions = /* @__PURE__ */ new Set();
|
|
359
362
|
backend = null;
|
|
363
|
+
backendPromise = null;
|
|
360
364
|
client = null;
|
|
361
365
|
connectionHandle = null;
|
|
362
366
|
connection = null;
|
|
@@ -497,7 +501,7 @@ ${message.content}`;
|
|
|
497
501
|
}
|
|
498
502
|
async spawnConnection() {
|
|
499
503
|
const acp = await acpModule.get();
|
|
500
|
-
const client = new
|
|
504
|
+
const client = new BandACPClient();
|
|
501
505
|
const handle = await this.connectionFactory(client, {
|
|
502
506
|
command: this.command,
|
|
503
507
|
cwd: this.cwd,
|
|
@@ -529,11 +533,11 @@ ${message.content}`;
|
|
|
529
533
|
}
|
|
530
534
|
async getOrCreateSession(roomId, connection) {
|
|
531
535
|
const existingSessionId = this.roomToSession.get(roomId);
|
|
536
|
+
if (existingSessionId && this.activeSessions.has(existingSessionId)) {
|
|
537
|
+
return existingSessionId;
|
|
538
|
+
}
|
|
532
539
|
const mcpServers = await this.buildSessionMcpServers();
|
|
533
540
|
if (existingSessionId) {
|
|
534
|
-
if (this.activeSessions.has(existingSessionId)) {
|
|
535
|
-
return existingSessionId;
|
|
536
|
-
}
|
|
537
541
|
const restored = await this.tryRestoreSession(connection, existingSessionId, mcpServers);
|
|
538
542
|
if (restored) {
|
|
539
543
|
this.activeSessions.add(existingSessionId);
|
|
@@ -581,26 +585,26 @@ ${message.content}`;
|
|
|
581
585
|
if (backend.kind === "http") {
|
|
582
586
|
const url = backend.server.url;
|
|
583
587
|
if (!url) {
|
|
584
|
-
throw new Error("
|
|
588
|
+
throw new Error("Band MCP HTTP backend did not expose a URL");
|
|
585
589
|
}
|
|
586
590
|
mcpServers.push({
|
|
587
591
|
type: "http",
|
|
588
|
-
name:
|
|
592
|
+
name: MCP_SERVER_NAME,
|
|
589
593
|
url,
|
|
590
|
-
headers: []
|
|
594
|
+
headers: [{ name: "Authorization", value: `Bearer ${backend.authToken}` }]
|
|
591
595
|
});
|
|
592
596
|
return mcpServers;
|
|
593
597
|
}
|
|
594
598
|
if (backend.kind === "sse") {
|
|
595
599
|
const url = backend.server.sseUrl;
|
|
596
600
|
if (!url) {
|
|
597
|
-
throw new Error("
|
|
601
|
+
throw new Error("Band MCP SSE backend did not expose a URL");
|
|
598
602
|
}
|
|
599
603
|
mcpServers.push({
|
|
600
604
|
type: "sse",
|
|
601
|
-
name:
|
|
605
|
+
name: MCP_SERVER_NAME,
|
|
602
606
|
url,
|
|
603
|
-
headers: []
|
|
607
|
+
headers: [{ name: "Authorization", value: `Bearer ${backend.authToken}` }]
|
|
604
608
|
});
|
|
605
609
|
return mcpServers;
|
|
606
610
|
}
|
|
@@ -610,34 +614,51 @@ ${message.content}`;
|
|
|
610
614
|
if (this.backend) {
|
|
611
615
|
return this.backend;
|
|
612
616
|
}
|
|
613
|
-
|
|
617
|
+
this.backendPromise ??= this.createBackend().finally(() => {
|
|
618
|
+
this.backendPromise = null;
|
|
619
|
+
});
|
|
620
|
+
return this.backendPromise;
|
|
621
|
+
}
|
|
622
|
+
async createBackend() {
|
|
623
|
+
const mcpCapabilities = this.connectionState?.agentCapabilities?.mcpCapabilities;
|
|
624
|
+
const transport = mcpCapabilities?.http ? "http" : mcpCapabilities?.sse ? "sse" : null;
|
|
625
|
+
if (transport === null) {
|
|
626
|
+
throw new Error(
|
|
627
|
+
"ACP agent does not advertise MCP transport support: its initialize response has mcpCapabilities.http and .sse both false or missing, so Band tools cannot be exposed to it over MCP."
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
const authToken = generateAuthToken();
|
|
614
631
|
if (transport === "sse") {
|
|
615
|
-
const server2 = new
|
|
632
|
+
const server2 = new BandMcpSseServer({
|
|
616
633
|
tools: (roomId) => this.roomTools.get(roomId),
|
|
617
634
|
enableMemoryTools: this.enableMemoryTools,
|
|
618
635
|
enableContactTools: true,
|
|
619
|
-
additionalTools: this.additionalMcpTools
|
|
636
|
+
additionalTools: this.additionalMcpTools,
|
|
637
|
+
authToken
|
|
620
638
|
});
|
|
621
639
|
await server2.start();
|
|
622
640
|
this.backend = {
|
|
623
641
|
kind: "sse",
|
|
624
642
|
server: server2,
|
|
643
|
+
authToken,
|
|
625
644
|
stop: async () => {
|
|
626
645
|
await server2.stop();
|
|
627
646
|
}
|
|
628
647
|
};
|
|
629
648
|
return this.backend;
|
|
630
649
|
}
|
|
631
|
-
const server = new
|
|
650
|
+
const server = new BandMcpServer({
|
|
632
651
|
tools: (roomId) => this.roomTools.get(roomId),
|
|
633
652
|
enableMemoryTools: this.enableMemoryTools,
|
|
634
653
|
enableContactTools: true,
|
|
635
|
-
additionalTools: this.additionalMcpTools
|
|
654
|
+
additionalTools: this.additionalMcpTools,
|
|
655
|
+
authToken
|
|
636
656
|
});
|
|
637
657
|
await server.start();
|
|
638
658
|
this.backend = {
|
|
639
659
|
kind: "http",
|
|
640
660
|
server,
|
|
661
|
+
authToken,
|
|
641
662
|
stop: async () => {
|
|
642
663
|
await server.stop();
|
|
643
664
|
}
|
|
@@ -652,14 +673,14 @@ ${message.content}`;
|
|
|
652
673
|
this.systemPrompt,
|
|
653
674
|
"",
|
|
654
675
|
"## Room Context",
|
|
655
|
-
"You are connected to
|
|
656
|
-
"Use the
|
|
676
|
+
"You are connected to Band using Band MCP tools.",
|
|
677
|
+
"Use the Band tools for any visible room action. Plain text output is not posted back to the room.",
|
|
657
678
|
"",
|
|
658
679
|
`Current room_id: ${roomId}`,
|
|
659
680
|
`Current requester name: ${requesterName}`,
|
|
660
681
|
`Current requester id: ${requesterId}`,
|
|
661
682
|
"",
|
|
662
|
-
"All
|
|
683
|
+
"All Band MCP tool calls must include room_id."
|
|
663
684
|
].join("\n");
|
|
664
685
|
}
|
|
665
686
|
async handlePermissionRequest(tools, roomId, params) {
|
|
@@ -768,7 +789,7 @@ function toErrorMessage(error) {
|
|
|
768
789
|
// src/adapters/acp/ACPServer.ts
|
|
769
790
|
import { Readable as Readable2, Writable as Writable2 } from "stream";
|
|
770
791
|
|
|
771
|
-
// src/adapters/acp/
|
|
792
|
+
// src/adapters/acp/BandACPServerAdapter.ts
|
|
772
793
|
import { randomUUID } from "crypto";
|
|
773
794
|
|
|
774
795
|
// src/adapters/acp/eventConverter.ts
|
|
@@ -922,12 +943,12 @@ var AgentRouter = class {
|
|
|
922
943
|
}
|
|
923
944
|
};
|
|
924
945
|
|
|
925
|
-
// src/adapters/acp/
|
|
946
|
+
// src/adapters/acp/BandACPServerAdapter.ts
|
|
926
947
|
var DEFAULT_MAX_SESSIONS = 100;
|
|
927
948
|
var DEFAULT_PROMPT_TIMEOUT_MS = 3e5;
|
|
928
949
|
var DEFAULT_PROMPT_COMPLETION_GRACE_MS = 250;
|
|
929
|
-
var
|
|
930
|
-
|
|
950
|
+
var BandACPServerAdapter = class extends SimpleAdapter {
|
|
951
|
+
bandRest;
|
|
931
952
|
maxSessions;
|
|
932
953
|
responseTimeoutMs;
|
|
933
954
|
promptCompletionGraceMs;
|
|
@@ -948,7 +969,7 @@ var ThenvoiACPServerAdapter = class extends SimpleAdapter {
|
|
|
948
969
|
super({
|
|
949
970
|
historyConverter: new ACPServerHistoryConverter()
|
|
950
971
|
});
|
|
951
|
-
this.
|
|
972
|
+
this.bandRest = options.bandRest;
|
|
952
973
|
this.maxSessions = options.maxSessions ?? DEFAULT_MAX_SESSIONS;
|
|
953
974
|
this.responseTimeoutMs = options.responseTimeoutMs ?? DEFAULT_PROMPT_TIMEOUT_MS;
|
|
954
975
|
this.promptCompletionGraceMs = options.promptCompletionGraceMs ?? DEFAULT_PROMPT_COMPLETION_GRACE_MS;
|
|
@@ -1010,7 +1031,7 @@ var ThenvoiACPServerAdapter = class extends SimpleAdapter {
|
|
|
1010
1031
|
}
|
|
1011
1032
|
async verifyCredentials() {
|
|
1012
1033
|
try {
|
|
1013
|
-
await this.
|
|
1034
|
+
await this.bandRest.getAgentMe();
|
|
1014
1035
|
return true;
|
|
1015
1036
|
} catch {
|
|
1016
1037
|
return false;
|
|
@@ -1019,7 +1040,7 @@ var ThenvoiACPServerAdapter = class extends SimpleAdapter {
|
|
|
1019
1040
|
async onStarted(agentName, agentDescription) {
|
|
1020
1041
|
await super.onStarted(agentName, agentDescription);
|
|
1021
1042
|
try {
|
|
1022
|
-
const identity = await this.
|
|
1043
|
+
const identity = await this.bandRest.getAgentMe();
|
|
1023
1044
|
this.agentId = identity.id;
|
|
1024
1045
|
} catch {
|
|
1025
1046
|
this.agentId = null;
|
|
@@ -1033,7 +1054,7 @@ var ThenvoiACPServerAdapter = class extends SimpleAdapter {
|
|
|
1033
1054
|
throw new Error(`Maximum ACP sessions (${this.maxSessions}) reached`);
|
|
1034
1055
|
}
|
|
1035
1056
|
try {
|
|
1036
|
-
const room = await this.
|
|
1057
|
+
const room = await this.bandRest.createChat();
|
|
1037
1058
|
const sessionId = randomUUID();
|
|
1038
1059
|
const normalizedMcpServers = normalizeMcpServers(input.mcpServers);
|
|
1039
1060
|
this.sessionToRoom.set(sessionId, room.id);
|
|
@@ -1043,7 +1064,7 @@ var ThenvoiACPServerAdapter = class extends SimpleAdapter {
|
|
|
1043
1064
|
this.sessionMcpServers.set(sessionId, normalizedMcpServers);
|
|
1044
1065
|
}
|
|
1045
1066
|
try {
|
|
1046
|
-
await this.
|
|
1067
|
+
await this.bandRest.createChatEvent(room.id, {
|
|
1047
1068
|
content: "ACP session context",
|
|
1048
1069
|
messageType: "task",
|
|
1049
1070
|
metadata: {
|
|
@@ -1076,10 +1097,10 @@ var ThenvoiACPServerAdapter = class extends SimpleAdapter {
|
|
|
1076
1097
|
this.pendingPrompts.set(roomId, pending);
|
|
1077
1098
|
const resolved = this.router.resolve(text, this.sessionModeIds.get(sessionId));
|
|
1078
1099
|
const promptText = this.prependSessionContext(sessionId, resolved.text);
|
|
1079
|
-
const participants = await this.
|
|
1100
|
+
const participants = await this.bandRest.listChatParticipants(roomId);
|
|
1080
1101
|
const mentions = this.resolveMentions(participants, resolved.targetPeer);
|
|
1081
1102
|
try {
|
|
1082
|
-
await this.
|
|
1103
|
+
await this.bandRest.createChatMessage(roomId, {
|
|
1083
1104
|
content: promptText,
|
|
1084
1105
|
mentions
|
|
1085
1106
|
});
|
|
@@ -1332,7 +1353,7 @@ var ACPServer = class {
|
|
|
1332
1353
|
this.authMethods = options?.authMethods ?? [{
|
|
1333
1354
|
id: "api_key",
|
|
1334
1355
|
name: "API Key",
|
|
1335
|
-
description: "Authenticate with THENVOI_API_KEY."
|
|
1356
|
+
description: "Authenticate with BAND_API_KEY (legacy THENVOI_API_KEY)."
|
|
1336
1357
|
}];
|
|
1337
1358
|
this.agentInfo = options?.agentInfo ?? {};
|
|
1338
1359
|
this.extensionHandler = options?.extensionHandler ?? new CursorExtensionHandler();
|
|
@@ -1385,8 +1406,8 @@ var ACPServer = class {
|
|
|
1385
1406
|
}
|
|
1386
1407
|
},
|
|
1387
1408
|
agentInfo: {
|
|
1388
|
-
name: this.agentInfo.name ?? "
|
|
1389
|
-
title: this.agentInfo.title ?? this.adapter.displayName ?? "
|
|
1409
|
+
name: this.agentInfo.name ?? "band-agent",
|
|
1410
|
+
title: this.agentInfo.title ?? this.adapter.displayName ?? "Band Agent",
|
|
1390
1411
|
version: this.agentInfo.version ?? "0.1.0"
|
|
1391
1412
|
},
|
|
1392
1413
|
authMethods: this.authMethods
|
|
@@ -1558,6 +1579,7 @@ export {
|
|
|
1558
1579
|
ACPServer,
|
|
1559
1580
|
AnthropicAdapter,
|
|
1560
1581
|
AnthropicToolCallingModel,
|
|
1582
|
+
BandACPServerAdapter,
|
|
1561
1583
|
CODEX_REASONING_EFFORTS,
|
|
1562
1584
|
CODEX_REASONING_SUMMARIES,
|
|
1563
1585
|
CODEX_WEB_SEARCH_MODES,
|
|
@@ -1581,7 +1603,6 @@ export {
|
|
|
1581
1603
|
OpencodeAdapter,
|
|
1582
1604
|
ParlantAdapter,
|
|
1583
1605
|
ParlantHistoryConverter,
|
|
1584
|
-
ThenvoiACPServerAdapter,
|
|
1585
1606
|
ToolCallingAdapter,
|
|
1586
1607
|
VercelAISDKAdapter,
|
|
1587
1608
|
VercelAISDKToolCallingModel,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { A as AdapterToolsProtocol } from './protocols-Bwwcql0h.js';
|
|
2
|
+
import { M as McpToolRegistration, B as BandSdkMcpServer } from './sdk-qKJtMma_.js';
|
|
3
|
+
|
|
4
|
+
type BandMcpBackendKind = "sdk" | "http" | "sse" | "stdio";
|
|
5
|
+
interface BandMcpBackend {
|
|
6
|
+
kind: BandMcpBackendKind;
|
|
7
|
+
server: unknown;
|
|
8
|
+
allowedTools: string[];
|
|
9
|
+
/** Bearer token callers must present to reach `server`. Set for "http"/"sse", which listen on a loopback network port. */
|
|
10
|
+
authToken?: string;
|
|
11
|
+
stop(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
interface CreateBandMcpBackendOptions {
|
|
14
|
+
kind: BandMcpBackendKind;
|
|
15
|
+
enableMemoryTools: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the tools for a given room. In single-room mode (`multiRoom: false`),
|
|
18
|
+
* called once during init with `""` — must return the tools instance regardless of the argument.
|
|
19
|
+
*/
|
|
20
|
+
getToolsForRoom: (roomId: string) => AdapterToolsProtocol | undefined;
|
|
21
|
+
additionalTools?: McpToolRegistration[];
|
|
22
|
+
multiRoom?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare function createBandMcpBackend(options: CreateBandMcpBackendOptions): Promise<BandMcpBackend>;
|
|
25
|
+
declare function getBandSdkMcpServerConfig(backend: BandMcpBackend): BandSdkMcpServer["serverConfig"];
|
|
26
|
+
|
|
27
|
+
export { type BandMcpBackend as B, type CreateBandMcpBackendOptions as C, type BandMcpBackendKind as a, createBandMcpBackend as c, getBandSdkMcpServerConfig as g };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { A as AdapterToolsProtocol } from './protocols-Bz1rxcUg.cjs';
|
|
2
|
+
import { M as McpToolRegistration, B as BandSdkMcpServer } from './sdk-BTciSLRQ.cjs';
|
|
3
|
+
|
|
4
|
+
type BandMcpBackendKind = "sdk" | "http" | "sse" | "stdio";
|
|
5
|
+
interface BandMcpBackend {
|
|
6
|
+
kind: BandMcpBackendKind;
|
|
7
|
+
server: unknown;
|
|
8
|
+
allowedTools: string[];
|
|
9
|
+
/** Bearer token callers must present to reach `server`. Set for "http"/"sse", which listen on a loopback network port. */
|
|
10
|
+
authToken?: string;
|
|
11
|
+
stop(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
interface CreateBandMcpBackendOptions {
|
|
14
|
+
kind: BandMcpBackendKind;
|
|
15
|
+
enableMemoryTools: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the tools for a given room. In single-room mode (`multiRoom: false`),
|
|
18
|
+
* called once during init with `""` — must return the tools instance regardless of the argument.
|
|
19
|
+
*/
|
|
20
|
+
getToolsForRoom: (roomId: string) => AdapterToolsProtocol | undefined;
|
|
21
|
+
additionalTools?: McpToolRegistration[];
|
|
22
|
+
multiRoom?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare function createBandMcpBackend(options: CreateBandMcpBackendOptions): Promise<BandMcpBackend>;
|
|
25
|
+
declare function getBandSdkMcpServerConfig(backend: BandMcpBackend): BandSdkMcpServer["serverConfig"];
|
|
26
|
+
|
|
27
|
+
export { type BandMcpBackend as B, type CreateBandMcpBackendOptions as C, type BandMcpBackendKind as a, createBandMcpBackend as c, getBandSdkMcpServerConfig as g };
|