@band-ai/sdk 0.1.4 → 0.1.10

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.
Files changed (73) hide show
  1. package/README.md +372 -0
  2. package/dist/{ClaudeSDKAdapter-CRq4R-WB.d.cts → ClaudeSDKAdapter-DfjaI5ke.d.cts} +9 -7
  3. package/dist/{ClaudeSDKAdapter-BHOkjN3X.d.ts → ClaudeSDKAdapter-DonPGJ43.d.ts} +9 -7
  4. package/dist/{acp-server-BdRz9_UN.d.cts → acp-server-CUBXIiG6.d.cts} +2 -2
  5. package/dist/{acp-server-B1Da7L6u.d.ts → acp-server-NZAeg-WO.d.ts} +2 -2
  6. package/dist/adapters.cjs +494 -106
  7. package/dist/adapters.d.cts +12 -12
  8. package/dist/adapters.d.ts +12 -12
  9. package/dist/adapters.js +7 -7
  10. package/dist/{backends-SVMT-7l4.d.cts → backends-DYtEhCZG.d.cts} +7 -2
  11. package/dist/{backends-CzDbiQar.d.ts → backends-oYAb7EU-.d.ts} +7 -2
  12. package/dist/{chunk-MSL6CWHY.js → chunk-2BHHR6YW.js} +17 -16
  13. package/dist/{chunk-EDPKUUJL.js → chunk-6RXWL6TC.js} +9 -1
  14. package/dist/{chunk-SFVKOEQH.js → chunk-DNPVCR3S.js} +92 -14
  15. package/dist/{chunk-I5EZG52P.js → chunk-FP237EAG.js} +424 -136
  16. package/dist/{chunk-RHVH2GZR.js → chunk-J3M3PFFY.js} +81 -31
  17. package/dist/{chunk-GVEQ3RAH.js → chunk-MLROFDKR.js} +132 -23
  18. package/dist/{chunk-INA6YZTZ.js → chunk-RDM4TE4B.js} +32 -30
  19. package/dist/chunk-US226AS4.js +130 -0
  20. package/dist/{chunk-W5NDZSYE.js → chunk-XA4N2JPH.js} +1 -1
  21. package/dist/converters.cjs +469 -13
  22. package/dist/converters.d.cts +5 -5
  23. package/dist/converters.d.ts +5 -5
  24. package/dist/converters.js +3 -2
  25. package/dist/core.cjs +45 -2
  26. package/dist/core.d.cts +4 -3
  27. package/dist/core.d.ts +4 -3
  28. package/dist/core.js +5 -1
  29. package/dist/disconnectReason-IuADl6TH.d.cts +34 -0
  30. package/dist/disconnectReason-IuADl6TH.d.ts +34 -0
  31. package/dist/{dtos-DUpbIu8k.d.cts → dtos-Dd_fTfLn.d.cts} +26 -6
  32. package/dist/{dtos-DUpbIu8k.d.ts → dtos-Dd_fTfLn.d.ts} +26 -6
  33. package/dist/index.cjs +1089 -269
  34. package/dist/index.d.cts +16 -15
  35. package/dist/index.d.ts +16 -15
  36. package/dist/index.js +14 -8
  37. package/dist/linear.cjs +985 -53
  38. package/dist/linear.d.cts +137 -7
  39. package/dist/linear.d.ts +137 -7
  40. package/dist/linear.js +974 -53
  41. package/dist/mcp-claude.cjs +303 -32
  42. package/dist/mcp-claude.d.cts +3 -3
  43. package/dist/mcp-claude.d.ts +3 -3
  44. package/dist/mcp-claude.js +210 -12
  45. package/dist/mcp.cjs +313 -45
  46. package/dist/mcp.d.cts +5 -5
  47. package/dist/mcp.d.ts +5 -5
  48. package/dist/mcp.js +3 -3
  49. package/dist/{opencode-BBcDchcN.d.cts → opencode--iA5-KYk.d.cts} +2 -2
  50. package/dist/{opencode-DthQQUsZ.d.ts → opencode-YNacv-eJ.d.ts} +2 -2
  51. package/dist/{pagination-CcDkVFxK.d.ts → pagination-BBLsYLhT.d.ts} +2 -2
  52. package/dist/{pagination-BPiys10t.d.cts → pagination-CqidD-L_.d.cts} +2 -2
  53. package/dist/{protocols-DrhzOH6K.d.ts → protocols-BF6jamIl.d.ts} +1 -1
  54. package/dist/{protocols-CInhtFpA.d.cts → protocols-D2bTrQ_t.d.cts} +1 -1
  55. package/dist/rest.d.cts +5 -5
  56. package/dist/rest.d.ts +5 -5
  57. package/dist/runtime.cjs +721 -172
  58. package/dist/runtime.d.cts +15 -10
  59. package/dist/runtime.d.ts +15 -10
  60. package/dist/runtime.js +11 -8
  61. package/dist/{schemas-vos1AaBc.d.ts → schemas-B1Fd3oUM.d.ts} +17 -8
  62. package/dist/{schemas-BpEBkq5V.d.cts → schemas-CI0qgcp_.d.cts} +17 -8
  63. package/dist/{sdk-CcnQ5OUC.d.ts → sdk-CyqN1W5g.d.ts} +32 -2
  64. package/dist/{sdk-CwTAxhwI.d.cts → sdk-D2rTDU_o.d.cts} +32 -2
  65. package/dist/{simpleAdapter-DqhvjsGr.d.cts → simpleAdapter-C_f-01Cu.d.cts} +1 -1
  66. package/dist/{simpleAdapter-9OE_p6QW.d.ts → simpleAdapter-qQt-tSz4.d.ts} +1 -1
  67. package/dist/testing.d.cts +3 -3
  68. package/dist/testing.d.ts +3 -3
  69. package/dist/{types-CovcHpYf.d.cts → types-CKqrhGB1.d.cts} +2 -2
  70. package/dist/{types-CxII3XkA.d.ts → types-D3AsUnd0.d.ts} +1 -1
  71. package/dist/{types-7jVzOeOP.d.ts → types-DNySTI_8.d.ts} +2 -2
  72. package/dist/{types-CSHFipIc.d.cts → types-DtMms5Fi.d.cts} +1 -1
  73. package/package.json +22 -21
@@ -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-CRq4R-WB.cjs';
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-DfjaI5ke.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-BdRz9_UN.cjs';
5
- export { G as GatewayHistoryConverter } from './acp-server-BdRz9_UN.cjs';
6
- import { S as SimpleAdapter } from './simpleAdapter-DqhvjsGr.cjs';
7
- import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-CInhtFpA.cjs';
8
- import { P as PlatformMessage } from './types-CovcHpYf.cjs';
9
- import { M as McpToolRegistration } from './sdk-CwTAxhwI.cjs';
10
- import { R as RestApi } from './types-CSHFipIc.cjs';
11
- import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-BBcDchcN.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-BBcDchcN.cjs';
4
+ import { A as ACPClientSessionState, a as ACPServerSessionState } from './acp-server-CUBXIiG6.cjs';
5
+ export { G as GatewayHistoryConverter } from './acp-server-CUBXIiG6.cjs';
6
+ import { S as SimpleAdapter } from './simpleAdapter-C_f-01Cu.cjs';
7
+ import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-D2bTrQ_t.cjs';
8
+ import { P as PlatformMessage } from './types-CKqrhGB1.cjs';
9
+ import { M as McpToolRegistration } from './sdk-D2rTDU_o.cjs';
10
+ import { R as RestApi } from './types-DtMms5Fi.cjs';
11
+ import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode--iA5-KYk.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--iA5-KYk.cjs';
13
13
  import './logger-CABQOnlR.cjs';
14
14
  import './customTools-BzF0IISO.cjs';
15
15
  import 'zod';
16
- import './dtos-DUpbIu8k.cjs';
17
- import './backends-SVMT-7l4.cjs';
16
+ import './dtos-Dd_fTfLn.cjs';
17
+ import './backends-DYtEhCZG.cjs';
18
18
  import '@anthropic-ai/claude-agent-sdk';
19
19
 
20
20
  declare class GatewayServer implements GatewayServerLike {
@@ -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-BHOkjN3X.js';
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-DonPGJ43.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-B1Da7L6u.js';
5
- export { G as GatewayHistoryConverter } from './acp-server-B1Da7L6u.js';
6
- import { S as SimpleAdapter } from './simpleAdapter-9OE_p6QW.js';
7
- import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-DrhzOH6K.js';
8
- import { P as PlatformMessage } from './types-7jVzOeOP.js';
9
- import { M as McpToolRegistration } from './sdk-CcnQ5OUC.js';
10
- import { R as RestApi } from './types-CxII3XkA.js';
11
- import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-DthQQUsZ.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-DthQQUsZ.js';
4
+ import { A as ACPClientSessionState, a as ACPServerSessionState } from './acp-server-NZAeg-WO.js';
5
+ export { G as GatewayHistoryConverter } from './acp-server-NZAeg-WO.js';
6
+ import { S as SimpleAdapter } from './simpleAdapter-qQt-tSz4.js';
7
+ import { A as AdapterToolsProtocol, c as MessagingTools } from './protocols-BF6jamIl.js';
8
+ import { P as PlatformMessage } from './types-DNySTI_8.js';
9
+ import { M as McpToolRegistration } from './sdk-CyqN1W5g.js';
10
+ import { R as RestApi } from './types-D3AsUnd0.js';
11
+ import { b as GatewayServerLike, c as GatewayServerOptions } from './opencode-YNacv-eJ.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-YNacv-eJ.js';
13
13
  import './logger-CABQOnlR.js';
14
14
  import './customTools-BzF0IISO.js';
15
15
  import 'zod';
16
- import './dtos-DUpbIu8k.js';
17
- import './backends-CzDbiQar.js';
16
+ import './dtos-Dd_fTfLn.js';
17
+ import './backends-oYAb7EU-.js';
18
18
  import '@anthropic-ai/claude-agent-sdk';
19
19
 
20
20
  declare class GatewayServer implements GatewayServerLike {
package/dist/adapters.js CHANGED
@@ -24,12 +24,12 @@ import {
24
24
  VercelAISDKAdapter,
25
25
  VercelAISDKToolCallingModel,
26
26
  runSingleToolRound
27
- } from "./chunk-RHVH2GZR.js";
27
+ } from "./chunk-J3M3PFFY.js";
28
28
  import {
29
29
  ThenvoiMcpServer,
30
30
  ThenvoiMcpSseServer
31
- } from "./chunk-MSL6CWHY.js";
32
- import "./chunk-EDPKUUJL.js";
31
+ } from "./chunk-2BHHR6YW.js";
32
+ import "./chunk-6RXWL6TC.js";
33
33
  import {
34
34
  ACPClientHistoryConverter,
35
35
  ACPServerHistoryConverter
@@ -47,17 +47,17 @@ import {
47
47
  createGatewayServer,
48
48
  parseToolCall,
49
49
  parseToolResult
50
- } from "./chunk-W5NDZSYE.js";
50
+ } from "./chunk-XA4N2JPH.js";
51
51
  import {
52
52
  SimpleAdapter
53
53
  } from "./chunk-AVVDPXP4.js";
54
54
  import {
55
55
  ensureHandlePrefix
56
- } from "./chunk-INA6YZTZ.js";
57
- import "./chunk-GVEQ3RAH.js";
56
+ } from "./chunk-RDM4TE4B.js";
58
57
  import {
59
58
  renderSystemPrompt
60
- } from "./chunk-SFVKOEQH.js";
59
+ } from "./chunk-DNPVCR3S.js";
60
+ import "./chunk-MLROFDKR.js";
61
61
  import "./chunk-ZZJRRBPQ.js";
62
62
  import "./chunk-3BKAC4OZ.js";
63
63
  import "./chunk-OD2G5LFQ.js";
@@ -1,5 +1,5 @@
1
- import { A as AdapterToolsProtocol } from './protocols-CInhtFpA.cjs';
2
- import { M as McpToolRegistration, T as ThenvoiSdkMcpServer } from './sdk-CwTAxhwI.cjs';
1
+ import { A as AdapterToolsProtocol } from './protocols-D2bTrQ_t.cjs';
2
+ import { M as McpToolRegistration, T as ThenvoiSdkMcpServer } from './sdk-D2rTDU_o.cjs';
3
3
 
4
4
  type ThenvoiMcpBackendKind = "sdk" | "http" | "sse" | "stdio";
5
5
  interface ThenvoiMcpBackend {
@@ -11,8 +11,13 @@ interface ThenvoiMcpBackend {
11
11
  interface CreateThenvoiMcpBackendOptions {
12
12
  kind: ThenvoiMcpBackendKind;
13
13
  enableMemoryTools: boolean;
14
+ /**
15
+ * Returns the tools for a given room. In single-room mode (`multiRoom: false`),
16
+ * called once during init with `""` — must return the tools instance regardless of the argument.
17
+ */
14
18
  getToolsForRoom: (roomId: string) => AdapterToolsProtocol | undefined;
15
19
  additionalTools?: McpToolRegistration[];
20
+ multiRoom?: boolean;
16
21
  }
17
22
  declare function createThenvoiMcpBackend(options: CreateThenvoiMcpBackendOptions): Promise<ThenvoiMcpBackend>;
18
23
  declare function getThenvoiSdkMcpServerConfig(backend: ThenvoiMcpBackend): ThenvoiSdkMcpServer["serverConfig"];
@@ -1,5 +1,5 @@
1
- import { A as AdapterToolsProtocol } from './protocols-DrhzOH6K.js';
2
- import { M as McpToolRegistration, T as ThenvoiSdkMcpServer } from './sdk-CcnQ5OUC.js';
1
+ import { A as AdapterToolsProtocol } from './protocols-BF6jamIl.js';
2
+ import { M as McpToolRegistration, T as ThenvoiSdkMcpServer } from './sdk-CyqN1W5g.js';
3
3
 
4
4
  type ThenvoiMcpBackendKind = "sdk" | "http" | "sse" | "stdio";
5
5
  interface ThenvoiMcpBackend {
@@ -11,8 +11,13 @@ interface ThenvoiMcpBackend {
11
11
  interface CreateThenvoiMcpBackendOptions {
12
12
  kind: ThenvoiMcpBackendKind;
13
13
  enableMemoryTools: boolean;
14
+ /**
15
+ * Returns the tools for a given room. In single-room mode (`multiRoom: false`),
16
+ * called once during init with `""` — must return the tools instance regardless of the argument.
17
+ */
14
18
  getToolsForRoom: (roomId: string) => AdapterToolsProtocol | undefined;
15
19
  additionalTools?: McpToolRegistration[];
20
+ multiRoom?: boolean;
16
21
  }
17
22
  declare function createThenvoiMcpBackend(options: CreateThenvoiMcpBackendOptions): Promise<ThenvoiMcpBackend>;
18
23
  declare function getThenvoiSdkMcpServerConfig(backend: ThenvoiMcpBackend): ThenvoiSdkMcpServer["serverConfig"];
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  buildRoomScopedRegistrations,
3
3
  buildSingleContextRegistrations,
4
- buildZodShape
5
- } from "./chunk-EDPKUUJL.js";
4
+ buildZodShape,
5
+ resolveSingleRoomTools
6
+ } from "./chunk-6RXWL6TC.js";
6
7
  import {
7
8
  mcpToolNames
8
- } from "./chunk-GVEQ3RAH.js";
9
+ } from "./chunk-MLROFDKR.js";
9
10
 
10
11
  // src/mcp/stdio.ts
11
12
  var ThenvoiMcpStdioServer = class {
@@ -488,20 +489,17 @@ function checkPort2(http, port) {
488
489
 
489
490
  // src/mcp/backends.ts
490
491
  async function createThenvoiMcpBackend(options) {
491
- const registrations = buildRoomScopedRegistrations(
492
- options.getToolsForRoom,
493
- {
494
- enableMemoryTools: options.enableMemoryTools,
495
- enableContactTools: true,
496
- additionalTools: options.additionalTools
497
- }
498
- );
499
- const allowedTools = mcpToolNames(new Set(registrations.map((registration) => registration.name)));
492
+ const registrationOptions = {
493
+ enableMemoryTools: options.enableMemoryTools,
494
+ enableContactTools: true,
495
+ additionalTools: options.additionalTools
496
+ };
500
497
  if (options.kind === "sdk") {
501
498
  const { createThenvoiSdkMcpServer } = await import("./mcp-claude.js");
502
499
  const server2 = createThenvoiSdkMcpServer({
503
- enableMemoryTools: options.enableMemoryTools,
504
500
  getToolsForRoom: options.getToolsForRoom,
501
+ multiRoom: options.multiRoom,
502
+ enableMemoryTools: options.enableMemoryTools,
505
503
  additionalTools: options.additionalTools
506
504
  });
507
505
  return {
@@ -511,9 +509,12 @@ async function createThenvoiMcpBackend(options) {
511
509
  stop: async () => void 0
512
510
  };
513
511
  }
512
+ const resolvedTools = options.multiRoom === false ? resolveSingleRoomTools(options.getToolsForRoom) : options.getToolsForRoom;
513
+ const registrations = options.multiRoom === false ? buildSingleContextRegistrations(resolvedTools, registrationOptions) : buildRoomScopedRegistrations(resolvedTools, registrationOptions);
514
+ const allowedTools = mcpToolNames(new Set(registrations.map((registration) => registration.name)));
514
515
  if (options.kind === "stdio") {
515
516
  const server2 = new ThenvoiMcpStdioServer({
516
- tools: options.getToolsForRoom,
517
+ tools: resolvedTools,
517
518
  enableMemoryTools: options.enableMemoryTools,
518
519
  enableContactTools: true,
519
520
  additionalTools: options.additionalTools
@@ -530,7 +531,7 @@ async function createThenvoiMcpBackend(options) {
530
531
  }
531
532
  if (options.kind === "sse") {
532
533
  const server2 = new ThenvoiMcpSseServer({
533
- tools: options.getToolsForRoom,
534
+ tools: resolvedTools,
534
535
  enableMemoryTools: options.enableMemoryTools,
535
536
  enableContactTools: true,
536
537
  additionalTools: options.additionalTools
@@ -546,7 +547,7 @@ async function createThenvoiMcpBackend(options) {
546
547
  };
547
548
  }
548
549
  const server = new ThenvoiMcpServer({
549
- tools: options.getToolsForRoom,
550
+ tools: resolvedTools,
550
551
  enableMemoryTools: options.enableMemoryTools,
551
552
  enableContactTools: true,
552
553
  additionalTools: options.additionalTools
@@ -4,7 +4,7 @@ import {
4
4
  MEMORY_TOOL_NAMES,
5
5
  TOOL_MODELS,
6
6
  getToolDescription
7
- } from "./chunk-GVEQ3RAH.js";
7
+ } from "./chunk-MLROFDKR.js";
8
8
  import {
9
9
  isToolExecutorError,
10
10
  toLegacyToolExecutorErrorMessage
@@ -128,6 +128,13 @@ function serializeValue(value) {
128
128
  return String(value);
129
129
  }
130
130
  }
131
+ function resolveSingleRoomTools(getToolsForRoom) {
132
+ const tools = getToolsForRoom("");
133
+ if (!tools) {
134
+ throw new Error('Single-room mode requires getToolsForRoom("") to return a tools instance');
135
+ }
136
+ return tools;
137
+ }
131
138
 
132
139
  // src/mcp/zod.ts
133
140
  function buildZodShape(z, properties, required) {
@@ -173,5 +180,6 @@ export {
173
180
  buildSingleContextRegistrations,
174
181
  successResult,
175
182
  errorResult,
183
+ resolveSingleRoomTools,
176
184
  buildZodShape
177
185
  };
@@ -1,13 +1,21 @@
1
- // src/runtime/prompts.ts
2
- var BASE_INSTRUCTIONS = `
1
+ import {
2
+ MEMORY_SEGMENT,
3
+ MEMORY_STORE_SCOPE,
4
+ MEMORY_SYSTEM,
5
+ MEMORY_SYSTEM_TYPES,
6
+ MEMORY_TYPE,
7
+ TOOL_MODELS
8
+ } from "./chunk-MLROFDKR.js";
9
+
10
+ // src/runtime/prompts/base.ts
11
+ var ENVIRONMENT_SECTION = `
3
12
  ## Environment
4
13
 
5
14
  Multi-participant chat. Messages show sender: [Name]: content.
6
15
  Messages prefixed with [System]: are platform updates (participant changes, contact updates, etc.) \u2014 not messages from users.
7
16
  Use \`thenvoi_send_message(content, mentions)\` to respond. Plain text output is not delivered.
8
- Mentions use handles: @<username> for users, @<username>/<agent-name> for agents.
9
-
10
- ## CRITICAL: Delegate When You Cannot Help Directly
17
+ Mentions use handles: @<username> for users, @<username>/<agent-name> for agents.`;
18
+ var MULTI_AGENT_RULES_SECTION = `## CRITICAL: Delegate When You Cannot Help Directly
11
19
 
12
20
  You have NO internet access and NO real-time data. When asked about weather, news, stock prices,
13
21
  or any current information you cannot answer directly:
@@ -33,14 +41,12 @@ Only remove agents if the user explicitly requests it.
33
41
  When someone asks you to get information from another agent:
34
42
  1. Ask the other agent for the information
35
43
  2. When you receive the response, IMMEDIATELY relay it back to the ORIGINAL REQUESTER
36
- 3. Do NOT just thank the helper agent - the requester is waiting for their answer!
37
-
38
- ## IMPORTANT: Always Share Your Thinking
44
+ 3. Do NOT just thank the helper agent - the requester is waiting for their answer!`;
45
+ var THINKING_SECTION = `## IMPORTANT: Always Share Your Thinking
39
46
 
40
47
  You MUST call \`thenvoi_send_event(content, message_type="thought")\` BEFORE every action.
41
- This is required so users can see your reasoning process.
42
-
43
- ## Examples
48
+ This is required so users can see your reasoning process.`;
49
+ var EXAMPLES_SECTION = `## Examples
44
50
 
45
51
  ### Simple question - answer directly
46
52
  [John Doe]: What's 2+2?
@@ -73,8 +79,73 @@ This is required so users can see your reasoning process.
73
79
 
74
80
  [Weather Agent]: London is 8\xB0C and rainy.
75
81
  -> thenvoi_send_event("Got London weather. Relaying to John Doe.", message_type="thought")
76
- -> thenvoi_send_message("London is 8\xB0C and rainy.", mentions=["@john"])
77
- `;
82
+ -> thenvoi_send_message("London is 8\xB0C and rainy.", mentions=["@john"])`;
83
+ var BASE_INSTRUCTIONS = [
84
+ ENVIRONMENT_SECTION,
85
+ MULTI_AGENT_RULES_SECTION,
86
+ THINKING_SECTION,
87
+ EXAMPLES_SECTION
88
+ ].join("\n\n") + "\n";
89
+
90
+ // src/runtime/prompts/memory.ts
91
+ var MEMORY_INTRO = `## Memory Tools
92
+
93
+ You have access to memory tools for storing and retrieving information
94
+ across conversations. Use \`thenvoi_store_memory\` to persist important
95
+ information and \`thenvoi_list_memories\` / \`thenvoi_get_memory\` to recall it.
96
+ Use \`thenvoi_supersede_memory\` to mark outdated memories and
97
+ \`thenvoi_archive_memory\` to hide memories that should be preserved.`;
98
+ function longTermPattern(label, type, segment, scope) {
99
+ return {
100
+ label,
101
+ system: MEMORY_SYSTEM.long_term,
102
+ type,
103
+ segment,
104
+ scope
105
+ };
106
+ }
107
+ var COMMON_MEMORY_PATTERNS = [
108
+ longTermPattern("Facts learned about a specific agent/entity", MEMORY_TYPE.semantic, MEMORY_SEGMENT.agent, MEMORY_STORE_SCOPE.subject),
109
+ longTermPattern("Events involving a specific person/agent", MEMORY_TYPE.episodic, MEMORY_SEGMENT.agent, MEMORY_STORE_SCOPE.subject),
110
+ longTermPattern("A user's preferences or profile info", MEMORY_TYPE.semantic, MEMORY_SEGMENT.user, MEMORY_STORE_SCOPE.subject),
111
+ longTermPattern("Org-wide knowledge or how to perform a task", MEMORY_TYPE.procedural, MEMORY_SEGMENT.tool, MEMORY_STORE_SCOPE.organization)
112
+ ];
113
+ function renderMemoryPattern(pattern) {
114
+ return `- ${pattern.label}: \`system="${pattern.system}"\`, \`type="${pattern.type}"\`, \`segment="${pattern.segment}"\`, \`scope="${pattern.scope}"\``;
115
+ }
116
+ var MEMORY_COMMON_PATTERNS = [
117
+ "Common patterns:",
118
+ ...COMMON_MEMORY_PATTERNS.map(renderMemoryPattern)
119
+ ].join("\n");
120
+ var MEMORY_SCOPE_GUIDANCE = `Prefer \`scope="${MEMORY_STORE_SCOPE.subject}"\` whenever the memory is about a specific person or agent, so it
121
+ stays attached to that subject rather than leaking org-wide. Storing with \`scope="${MEMORY_STORE_SCOPE.subject}"\` requires a
122
+ real \`subject_id\` UUID, so resolve it first via \`thenvoi_lookup_peers\` or the participant list.
123
+ Reserve \`scope="${MEMORY_STORE_SCOPE.organization}"\` for knowledge that is genuinely shared across the whole organization and
124
+ is not about any one subject.`;
125
+ function quoteChoices(values) {
126
+ return values.map((value) => `\`"${value}"\``).join(" | ");
127
+ }
128
+ function memoryTypeLines() {
129
+ return Object.entries(MEMORY_SYSTEM_TYPES).map(([system, types]) => ` - ${system}: ${quoteChoices(types)}`).join("\n");
130
+ }
131
+ function buildMemorySection() {
132
+ const storeMemoryProps = TOOL_MODELS.thenvoi_store_memory.properties;
133
+ const systems = storeMemoryProps.system.enum;
134
+ const segments = storeMemoryProps.segment.enum;
135
+ const scopes = storeMemoryProps.scope.enum;
136
+ const fieldRules = `When calling \`thenvoi_store_memory\`, the \`system\`, \`type\`, \`segment\`, and \`scope\` fields
137
+ must use these exact values (case-sensitive):
138
+
139
+ - **system**: ${quoteChoices(systems)}
140
+ - **type** (must match the chosen system):
141
+ ${memoryTypeLines()}
142
+ - **segment**: ${quoteChoices(segments)}
143
+ - **scope**: ${quoteChoices(scopes)}`;
144
+ return [MEMORY_INTRO, fieldRules, MEMORY_COMMON_PATTERNS, MEMORY_SCOPE_GUIDANCE].join("\n\n");
145
+ }
146
+ var MEMORY_SECTION = buildMemorySection();
147
+
148
+ // src/runtime/prompts/templates.ts
78
149
  var TEMPLATES = {
79
150
  default: `You are {agent_name}, {agent_description}.
80
151
 
@@ -93,11 +164,18 @@ ${customSection}`.trim();
93
164
  }
94
165
  const template = options?.template ?? "default";
95
166
  const templateString = TEMPLATES[template] ?? TEMPLATES.default;
96
- return templateString.replaceAll("{agent_name}", agentName).replaceAll("{agent_description}", agentDescription).replaceAll("{custom_section}", customSection);
167
+ const parts = [
168
+ templateString.replaceAll("{agent_name}", agentName).replaceAll("{agent_description}", agentDescription).replaceAll("{custom_section}", customSection)
169
+ ];
170
+ if (options?.capabilities?.memory) {
171
+ parts.push(MEMORY_SECTION);
172
+ }
173
+ return parts.join("\n\n");
97
174
  }
98
175
 
99
176
  export {
100
177
  BASE_INSTRUCTIONS,
178
+ MEMORY_SECTION,
101
179
  TEMPLATES,
102
180
  renderSystemPrompt
103
181
  };