@band-ai/sdk 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CodexAdapter-A1k_LMdZ.d.ts +1278 -0
- package/dist/CodexAdapter-BbZD-nBd.d.cts +1278 -0
- package/dist/adapters.cjs +10643 -0
- package/dist/adapters.d.cts +217 -0
- package/dist/adapters.d.ts +217 -0
- package/dist/adapters.js +92 -0
- package/dist/backends-BnOLsG7w.d.cts +20 -0
- package/dist/backends-C4n6cKOf.d.ts +20 -0
- package/dist/chunk-3BKAC4OZ.js +44 -0
- package/dist/chunk-5CXIMAH2.js +52 -0
- package/dist/chunk-6AJA2OPC.js +3682 -0
- package/dist/chunk-A3TDK6GP.js +6674 -0
- package/dist/chunk-AVVDPXP4.js +39 -0
- package/dist/chunk-EDPKUUJL.js +177 -0
- package/dist/chunk-FUODYQRE.js +2562 -0
- package/dist/chunk-GVEQ3RAH.js +373 -0
- package/dist/chunk-INA6YZTZ.js +88 -0
- package/dist/chunk-IZPV6QS6.js +115 -0
- package/dist/chunk-LY55KYVI.js +0 -0
- package/dist/chunk-NIAQBANR.js +577 -0
- package/dist/chunk-OD2G5LFQ.js +78 -0
- package/dist/chunk-SFVKOEQH.js +103 -0
- package/dist/chunk-SG4WLD2H.js +1093 -0
- package/dist/chunk-YR3BOQNW.js +39 -0
- package/dist/chunk-ZZJRRBPQ.js +82 -0
- package/dist/claude-CcnQ5OUC.d.ts +53 -0
- package/dist/claude-CwTAxhwI.d.cts +53 -0
- package/dist/config.cjs +164 -0
- package/dist/config.d.cts +19 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js +9 -0
- package/dist/converters.cjs +1086 -0
- package/dist/converters.d.cts +143 -0
- package/dist/converters.d.ts +143 -0
- package/dist/converters.js +468 -0
- package/dist/core.cjs +185 -0
- package/dist/core.d.cts +22 -0
- package/dist/core.d.ts +22 -0
- package/dist/core.js +24 -0
- package/dist/customTools-BzF0IISO.d.cts +10 -0
- package/dist/customTools-BzF0IISO.d.ts +10 -0
- package/dist/dtos-DUpbIu8k.d.cts +163 -0
- package/dist/dtos-DUpbIu8k.d.ts +163 -0
- package/dist/history-ByessXNq.d.ts +24 -0
- package/dist/history-i6yN7neC.d.cts +24 -0
- package/dist/index.cjs +13914 -0
- package/dist/index.d.cts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +198 -0
- package/dist/linear.cjs +2207 -0
- package/dist/linear.d.cts +167 -0
- package/dist/linear.d.ts +167 -0
- package/dist/linear.js +2139 -0
- package/dist/logger-CABQOnlR.d.cts +21 -0
- package/dist/logger-CABQOnlR.d.ts +21 -0
- package/dist/mcp-claude.cjs +584 -0
- package/dist/mcp-claude.d.cts +4 -0
- package/dist/mcp-claude.d.ts +4 -0
- package/dist/mcp-claude.js +11 -0
- package/dist/mcp.cjs +1247 -0
- package/dist/mcp.d.cts +97 -0
- package/dist/mcp.d.ts +97 -0
- package/dist/mcp.js +27 -0
- package/dist/opencode-BBcDchcN.d.cts +159 -0
- package/dist/opencode-DthQQUsZ.d.ts +159 -0
- package/dist/pagination-BPiys10t.d.cts +25 -0
- package/dist/pagination-CcDkVFxK.d.ts +25 -0
- package/dist/protocols-CInhtFpA.d.cts +116 -0
- package/dist/protocols-DrhzOH6K.d.ts +116 -0
- package/dist/rest.cjs +1159 -0
- package/dist/rest.d.cts +144 -0
- package/dist/rest.d.ts +144 -0
- package/dist/rest.js +18 -0
- package/dist/runtime.cjs +5353 -0
- package/dist/runtime.d.cts +276 -0
- package/dist/runtime.d.ts +276 -0
- package/dist/runtime.js +274 -0
- package/dist/schemas-BpEBkq5V.d.cts +592 -0
- package/dist/schemas-vos1AaBc.d.ts +592 -0
- package/dist/sdk-HJUVSSWA.js +10 -0
- package/dist/simpleAdapter-9OE_p6QW.d.ts +29 -0
- package/dist/simpleAdapter-DqhvjsGr.d.cts +29 -0
- package/dist/testing.cjs +217 -0
- package/dist/testing.d.cts +126 -0
- package/dist/testing.d.ts +126 -0
- package/dist/testing.js +186 -0
- package/dist/types-7jVzOeOP.d.ts +446 -0
- package/dist/types-CSHFipIc.d.cts +331 -0
- package/dist/types-CovcHpYf.d.cts +446 -0
- package/dist/types-CxII3XkA.d.ts +331 -0
- package/package.json +189 -0
package/dist/mcp.d.cts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export { C as CreateThenvoiMcpBackendOptions, T as ThenvoiMcpBackend, a as ThenvoiMcpBackendKind, c as createThenvoiMcpBackend, g as getThenvoiSdkMcpServerConfig } from './backends-BnOLsG7w.cjs';
|
|
2
|
+
import { M as McpToolRegistration } from './claude-CwTAxhwI.cjs';
|
|
3
|
+
export { B as BuildRegistrationsOptions, a as McpToolInputSchema, b as McpToolResult, c as buildRoomScopedRegistrations, d as buildSingleContextRegistrations, e as errorResult, s as successResult } from './claude-CwTAxhwI.cjs';
|
|
4
|
+
import { A as AdapterToolsProtocol } from './protocols-CInhtFpA.cjs';
|
|
5
|
+
import { Readable, Writable } from 'node:stream';
|
|
6
|
+
import '@anthropic-ai/claude-agent-sdk';
|
|
7
|
+
import './dtos-DUpbIu8k.cjs';
|
|
8
|
+
|
|
9
|
+
interface ThenvoiMcpServerOptions {
|
|
10
|
+
/** Single tools instance (no room scoping) or a resolver function for room-scoped tools. */
|
|
11
|
+
tools: AdapterToolsProtocol | ((roomId: string) => AdapterToolsProtocol | undefined);
|
|
12
|
+
/** Server name advertised to MCP clients. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Port to listen on. Defaults to auto-selecting from 50000-60000. */
|
|
15
|
+
port?: number;
|
|
16
|
+
/** Enable memory tools. */
|
|
17
|
+
enableMemoryTools?: boolean;
|
|
18
|
+
/** Enable contact tools. */
|
|
19
|
+
enableContactTools?: boolean;
|
|
20
|
+
/** Additional MCP tool registrations to expose alongside the built-in tools. */
|
|
21
|
+
additionalTools?: McpToolRegistration[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Standalone MCP server that exposes Thenvoi agent tools over Streamable HTTP.
|
|
25
|
+
*
|
|
26
|
+
* Uses `@modelcontextprotocol/server` (optional peer dependency) and `express`.
|
|
27
|
+
* Install with: `npm install @modelcontextprotocol/server express`
|
|
28
|
+
*/
|
|
29
|
+
declare class ThenvoiMcpServer {
|
|
30
|
+
private readonly options;
|
|
31
|
+
private readonly registrations;
|
|
32
|
+
private httpServer;
|
|
33
|
+
private actualPort;
|
|
34
|
+
private readonly sessions;
|
|
35
|
+
private sessionSweepTimer;
|
|
36
|
+
constructor(options: ThenvoiMcpServerOptions);
|
|
37
|
+
/** Port the server is listening on. Null if not started. */
|
|
38
|
+
get port(): number | null;
|
|
39
|
+
/** MCP endpoint URL. Null if not started. */
|
|
40
|
+
get url(): string | null;
|
|
41
|
+
/** Tool names registered on this server. */
|
|
42
|
+
get toolNames(): string[];
|
|
43
|
+
start(): Promise<void>;
|
|
44
|
+
stop(): Promise<void>;
|
|
45
|
+
private createSession;
|
|
46
|
+
private startSessionSweep;
|
|
47
|
+
private stopSessionSweep;
|
|
48
|
+
private closeIdleSessions;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface ThenvoiMcpSseServerOptions {
|
|
52
|
+
tools: AdapterToolsProtocol | ((roomId: string) => AdapterToolsProtocol | undefined);
|
|
53
|
+
name?: string;
|
|
54
|
+
port?: number;
|
|
55
|
+
enableMemoryTools?: boolean;
|
|
56
|
+
enableContactTools?: boolean;
|
|
57
|
+
additionalTools?: McpToolRegistration[];
|
|
58
|
+
}
|
|
59
|
+
declare class ThenvoiMcpSseServer {
|
|
60
|
+
private readonly options;
|
|
61
|
+
private readonly registrations;
|
|
62
|
+
private httpServer;
|
|
63
|
+
private actualPort;
|
|
64
|
+
private readonly sessions;
|
|
65
|
+
private sweepTimer;
|
|
66
|
+
constructor(options: ThenvoiMcpSseServerOptions);
|
|
67
|
+
get port(): number | null;
|
|
68
|
+
get sseUrl(): string | null;
|
|
69
|
+
get toolNames(): string[];
|
|
70
|
+
start(): Promise<void>;
|
|
71
|
+
stop(): Promise<void>;
|
|
72
|
+
private startSessionSweep;
|
|
73
|
+
private stopSessionSweep;
|
|
74
|
+
private closeIdleSessions;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface ThenvoiMcpStdioServerOptions {
|
|
78
|
+
tools: AdapterToolsProtocol | ((roomId: string) => AdapterToolsProtocol | undefined);
|
|
79
|
+
name?: string;
|
|
80
|
+
enableMemoryTools?: boolean;
|
|
81
|
+
enableContactTools?: boolean;
|
|
82
|
+
additionalTools?: McpToolRegistration[];
|
|
83
|
+
stdin?: Readable;
|
|
84
|
+
stdout?: Writable;
|
|
85
|
+
}
|
|
86
|
+
declare class ThenvoiMcpStdioServer {
|
|
87
|
+
private readonly options;
|
|
88
|
+
private readonly registrations;
|
|
89
|
+
private mcpServer;
|
|
90
|
+
private transport;
|
|
91
|
+
constructor(options: ThenvoiMcpStdioServerOptions);
|
|
92
|
+
get toolNames(): string[];
|
|
93
|
+
start(): Promise<void>;
|
|
94
|
+
stop(): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { McpToolRegistration, ThenvoiMcpServer, type ThenvoiMcpServerOptions, ThenvoiMcpSseServer, type ThenvoiMcpSseServerOptions, ThenvoiMcpStdioServer, type ThenvoiMcpStdioServerOptions };
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export { C as CreateThenvoiMcpBackendOptions, T as ThenvoiMcpBackend, a as ThenvoiMcpBackendKind, c as createThenvoiMcpBackend, g as getThenvoiSdkMcpServerConfig } from './backends-C4n6cKOf.js';
|
|
2
|
+
import { M as McpToolRegistration } from './claude-CcnQ5OUC.js';
|
|
3
|
+
export { B as BuildRegistrationsOptions, a as McpToolInputSchema, b as McpToolResult, c as buildRoomScopedRegistrations, d as buildSingleContextRegistrations, e as errorResult, s as successResult } from './claude-CcnQ5OUC.js';
|
|
4
|
+
import { A as AdapterToolsProtocol } from './protocols-DrhzOH6K.js';
|
|
5
|
+
import { Readable, Writable } from 'node:stream';
|
|
6
|
+
import '@anthropic-ai/claude-agent-sdk';
|
|
7
|
+
import './dtos-DUpbIu8k.js';
|
|
8
|
+
|
|
9
|
+
interface ThenvoiMcpServerOptions {
|
|
10
|
+
/** Single tools instance (no room scoping) or a resolver function for room-scoped tools. */
|
|
11
|
+
tools: AdapterToolsProtocol | ((roomId: string) => AdapterToolsProtocol | undefined);
|
|
12
|
+
/** Server name advertised to MCP clients. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Port to listen on. Defaults to auto-selecting from 50000-60000. */
|
|
15
|
+
port?: number;
|
|
16
|
+
/** Enable memory tools. */
|
|
17
|
+
enableMemoryTools?: boolean;
|
|
18
|
+
/** Enable contact tools. */
|
|
19
|
+
enableContactTools?: boolean;
|
|
20
|
+
/** Additional MCP tool registrations to expose alongside the built-in tools. */
|
|
21
|
+
additionalTools?: McpToolRegistration[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Standalone MCP server that exposes Thenvoi agent tools over Streamable HTTP.
|
|
25
|
+
*
|
|
26
|
+
* Uses `@modelcontextprotocol/server` (optional peer dependency) and `express`.
|
|
27
|
+
* Install with: `npm install @modelcontextprotocol/server express`
|
|
28
|
+
*/
|
|
29
|
+
declare class ThenvoiMcpServer {
|
|
30
|
+
private readonly options;
|
|
31
|
+
private readonly registrations;
|
|
32
|
+
private httpServer;
|
|
33
|
+
private actualPort;
|
|
34
|
+
private readonly sessions;
|
|
35
|
+
private sessionSweepTimer;
|
|
36
|
+
constructor(options: ThenvoiMcpServerOptions);
|
|
37
|
+
/** Port the server is listening on. Null if not started. */
|
|
38
|
+
get port(): number | null;
|
|
39
|
+
/** MCP endpoint URL. Null if not started. */
|
|
40
|
+
get url(): string | null;
|
|
41
|
+
/** Tool names registered on this server. */
|
|
42
|
+
get toolNames(): string[];
|
|
43
|
+
start(): Promise<void>;
|
|
44
|
+
stop(): Promise<void>;
|
|
45
|
+
private createSession;
|
|
46
|
+
private startSessionSweep;
|
|
47
|
+
private stopSessionSweep;
|
|
48
|
+
private closeIdleSessions;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface ThenvoiMcpSseServerOptions {
|
|
52
|
+
tools: AdapterToolsProtocol | ((roomId: string) => AdapterToolsProtocol | undefined);
|
|
53
|
+
name?: string;
|
|
54
|
+
port?: number;
|
|
55
|
+
enableMemoryTools?: boolean;
|
|
56
|
+
enableContactTools?: boolean;
|
|
57
|
+
additionalTools?: McpToolRegistration[];
|
|
58
|
+
}
|
|
59
|
+
declare class ThenvoiMcpSseServer {
|
|
60
|
+
private readonly options;
|
|
61
|
+
private readonly registrations;
|
|
62
|
+
private httpServer;
|
|
63
|
+
private actualPort;
|
|
64
|
+
private readonly sessions;
|
|
65
|
+
private sweepTimer;
|
|
66
|
+
constructor(options: ThenvoiMcpSseServerOptions);
|
|
67
|
+
get port(): number | null;
|
|
68
|
+
get sseUrl(): string | null;
|
|
69
|
+
get toolNames(): string[];
|
|
70
|
+
start(): Promise<void>;
|
|
71
|
+
stop(): Promise<void>;
|
|
72
|
+
private startSessionSweep;
|
|
73
|
+
private stopSessionSweep;
|
|
74
|
+
private closeIdleSessions;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface ThenvoiMcpStdioServerOptions {
|
|
78
|
+
tools: AdapterToolsProtocol | ((roomId: string) => AdapterToolsProtocol | undefined);
|
|
79
|
+
name?: string;
|
|
80
|
+
enableMemoryTools?: boolean;
|
|
81
|
+
enableContactTools?: boolean;
|
|
82
|
+
additionalTools?: McpToolRegistration[];
|
|
83
|
+
stdin?: Readable;
|
|
84
|
+
stdout?: Writable;
|
|
85
|
+
}
|
|
86
|
+
declare class ThenvoiMcpStdioServer {
|
|
87
|
+
private readonly options;
|
|
88
|
+
private readonly registrations;
|
|
89
|
+
private mcpServer;
|
|
90
|
+
private transport;
|
|
91
|
+
constructor(options: ThenvoiMcpStdioServerOptions);
|
|
92
|
+
get toolNames(): string[];
|
|
93
|
+
start(): Promise<void>;
|
|
94
|
+
stop(): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { McpToolRegistration, ThenvoiMcpServer, type ThenvoiMcpServerOptions, ThenvoiMcpSseServer, type ThenvoiMcpSseServerOptions, ThenvoiMcpStdioServer, type ThenvoiMcpStdioServerOptions };
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ThenvoiMcpServer,
|
|
3
|
+
ThenvoiMcpSseServer,
|
|
4
|
+
ThenvoiMcpStdioServer,
|
|
5
|
+
createThenvoiMcpBackend,
|
|
6
|
+
getThenvoiSdkMcpServerConfig
|
|
7
|
+
} from "./chunk-NIAQBANR.js";
|
|
8
|
+
import {
|
|
9
|
+
buildRoomScopedRegistrations,
|
|
10
|
+
buildSingleContextRegistrations,
|
|
11
|
+
errorResult,
|
|
12
|
+
successResult
|
|
13
|
+
} from "./chunk-EDPKUUJL.js";
|
|
14
|
+
import "./chunk-GVEQ3RAH.js";
|
|
15
|
+
import "./chunk-3BKAC4OZ.js";
|
|
16
|
+
import "./chunk-YR3BOQNW.js";
|
|
17
|
+
export {
|
|
18
|
+
ThenvoiMcpServer,
|
|
19
|
+
ThenvoiMcpSseServer,
|
|
20
|
+
ThenvoiMcpStdioServer,
|
|
21
|
+
buildRoomScopedRegistrations,
|
|
22
|
+
buildSingleContextRegistrations,
|
|
23
|
+
createThenvoiMcpBackend,
|
|
24
|
+
errorResult,
|
|
25
|
+
getThenvoiSdkMcpServerConfig,
|
|
26
|
+
successResult
|
|
27
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { H as HistoryConverter } from './protocols-CInhtFpA.cjs';
|
|
2
|
+
import { R as RestApi } from './types-CSHFipIc.cjs';
|
|
3
|
+
|
|
4
|
+
interface GoogleADKMessage {
|
|
5
|
+
role: "user" | "model";
|
|
6
|
+
content: string | Array<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
type GoogleADKMessages = GoogleADKMessage[];
|
|
9
|
+
declare class GoogleADKHistoryConverter {
|
|
10
|
+
private agentName;
|
|
11
|
+
constructor(agentName?: string);
|
|
12
|
+
setAgentName(name: string): void;
|
|
13
|
+
convert(raw: Array<Record<string, unknown>>): GoogleADKMessages;
|
|
14
|
+
}
|
|
15
|
+
declare function extractGoogleAdkSessionId(raw: Array<Record<string, unknown>>): string | null;
|
|
16
|
+
|
|
17
|
+
interface A2AAuth {
|
|
18
|
+
apiKey?: string;
|
|
19
|
+
bearerToken?: string;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
interface A2ASessionState {
|
|
23
|
+
contextId: string | null;
|
|
24
|
+
taskId: string | null;
|
|
25
|
+
taskState: string | null;
|
|
26
|
+
}
|
|
27
|
+
declare function buildA2AAuthHeaders(auth?: A2AAuth): Record<string, string>;
|
|
28
|
+
declare class A2AHistoryConverter implements HistoryConverter<A2ASessionState> {
|
|
29
|
+
convert(raw: Array<Record<string, unknown>>): A2ASessionState;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type GatewayTaskState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | "auth-required" | "unknown";
|
|
33
|
+
interface GatewayMessagePart {
|
|
34
|
+
kind?: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
root?: {
|
|
37
|
+
text?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface GatewayA2AMessage {
|
|
41
|
+
kind: "message";
|
|
42
|
+
messageId: string;
|
|
43
|
+
role: "user" | "agent";
|
|
44
|
+
parts: GatewayMessagePart[];
|
|
45
|
+
contextId?: string;
|
|
46
|
+
taskId?: string;
|
|
47
|
+
}
|
|
48
|
+
interface GatewayA2ATaskStatus {
|
|
49
|
+
state: GatewayTaskState;
|
|
50
|
+
timestamp?: string;
|
|
51
|
+
message?: GatewayA2AMessage;
|
|
52
|
+
}
|
|
53
|
+
interface GatewayA2AStatusUpdateEvent {
|
|
54
|
+
kind: "status-update";
|
|
55
|
+
taskId: string;
|
|
56
|
+
contextId: string;
|
|
57
|
+
final: boolean;
|
|
58
|
+
status: GatewayA2ATaskStatus;
|
|
59
|
+
metadata?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
interface GatewayRequest {
|
|
62
|
+
/**
|
|
63
|
+
* Canonical Thenvoi peer id.
|
|
64
|
+
* Legacy clients may still send a slug in this field; adapter-side normalization handles that alias.
|
|
65
|
+
*/
|
|
66
|
+
peerId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional gateway route slug for compatibility/diagnostics.
|
|
69
|
+
*/
|
|
70
|
+
peerSlug?: string;
|
|
71
|
+
taskId: string;
|
|
72
|
+
contextId: string;
|
|
73
|
+
message: GatewayA2AMessage;
|
|
74
|
+
}
|
|
75
|
+
interface GatewayCancelRequest {
|
|
76
|
+
/**
|
|
77
|
+
* Canonical Thenvoi peer id.
|
|
78
|
+
* Legacy clients may still send a slug in this field; adapter-side normalization handles that alias.
|
|
79
|
+
*/
|
|
80
|
+
peerId: string;
|
|
81
|
+
/**
|
|
82
|
+
* Optional gateway route slug for compatibility/diagnostics.
|
|
83
|
+
*/
|
|
84
|
+
peerSlug?: string;
|
|
85
|
+
taskId: string;
|
|
86
|
+
}
|
|
87
|
+
interface GatewayPeer {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
description: string;
|
|
91
|
+
handle?: string | null;
|
|
92
|
+
slug: string;
|
|
93
|
+
}
|
|
94
|
+
interface GatewaySessionState {
|
|
95
|
+
contextToRoom: Record<string, string>;
|
|
96
|
+
roomParticipants: Record<string, string[]>;
|
|
97
|
+
}
|
|
98
|
+
interface PendingA2ATask {
|
|
99
|
+
taskId: string;
|
|
100
|
+
contextId: string;
|
|
101
|
+
peerId: string;
|
|
102
|
+
peerSlug?: string;
|
|
103
|
+
roomId: string;
|
|
104
|
+
enqueue(event: GatewayA2AStatusUpdateEvent): void;
|
|
105
|
+
}
|
|
106
|
+
interface GatewayServerLike {
|
|
107
|
+
start(): Promise<void>;
|
|
108
|
+
stop(): Promise<void>;
|
|
109
|
+
}
|
|
110
|
+
interface GatewayServerOptions {
|
|
111
|
+
peersBySlug: Map<string, GatewayPeer>;
|
|
112
|
+
peersById: Map<string, GatewayPeer>;
|
|
113
|
+
gatewayUrl: string;
|
|
114
|
+
host: string;
|
|
115
|
+
port: number;
|
|
116
|
+
authToken?: string;
|
|
117
|
+
allowUnauthenticatedLoopback?: boolean;
|
|
118
|
+
onRequest: (request: GatewayRequest) => AsyncIterable<GatewayA2AStatusUpdateEvent>;
|
|
119
|
+
onCancel?: (request: GatewayCancelRequest) => Promise<void>;
|
|
120
|
+
loadModules?: () => Promise<unknown>;
|
|
121
|
+
}
|
|
122
|
+
type GatewayServerFactory = (options: GatewayServerOptions) => GatewayServerLike;
|
|
123
|
+
interface A2AGatewayAdapterOptions {
|
|
124
|
+
thenvoiRest: RestApi;
|
|
125
|
+
gatewayUrl?: string;
|
|
126
|
+
host?: string;
|
|
127
|
+
port?: number;
|
|
128
|
+
authToken?: string;
|
|
129
|
+
allowUnauthenticatedLoopback?: boolean;
|
|
130
|
+
responseTimeoutMs?: number;
|
|
131
|
+
peerPageSize?: number;
|
|
132
|
+
maxPeerPages?: number;
|
|
133
|
+
serverFactory?: GatewayServerFactory;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface ParlantMessage {
|
|
137
|
+
role: "user" | "assistant";
|
|
138
|
+
content: string;
|
|
139
|
+
sender: string;
|
|
140
|
+
senderType: string;
|
|
141
|
+
}
|
|
142
|
+
type ParlantMessages = ParlantMessage[];
|
|
143
|
+
declare class ParlantHistoryConverter implements HistoryConverter<ParlantMessages> {
|
|
144
|
+
convert(raw: Array<Record<string, unknown>>): ParlantMessages;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface OpencodeSessionState {
|
|
148
|
+
sessionId: string | null;
|
|
149
|
+
roomId: string | null;
|
|
150
|
+
createdAt: Date | null;
|
|
151
|
+
replayMessages: string[];
|
|
152
|
+
}
|
|
153
|
+
declare class OpencodeHistoryConverter {
|
|
154
|
+
setAgentName(_name: string): void;
|
|
155
|
+
convert(raw: Array<Record<string, unknown>>): OpencodeSessionState;
|
|
156
|
+
}
|
|
157
|
+
declare function extractOpencodeSessionId(raw: Array<Record<string, unknown>>): string | null;
|
|
158
|
+
|
|
159
|
+
export { type A2AAuth as A, type GatewaySessionState as G, OpencodeHistoryConverter as O, ParlantHistoryConverter as P, type A2AGatewayAdapterOptions as a, type GatewayServerLike as b, type GatewayServerOptions as c, A2AHistoryConverter as d, type A2ASessionState as e, type GatewayA2AMessage as f, type GatewayA2AStatusUpdateEvent as g, type GatewayCancelRequest as h, type GatewayPeer as i, type GatewayRequest as j, type GatewayServerFactory as k, type GatewayTaskState as l, type ParlantMessage as m, type ParlantMessages as n, type PendingA2ATask as o, buildA2AAuthHeaders as p, GoogleADKHistoryConverter as q, type GoogleADKMessage as r, type GoogleADKMessages as s, type OpencodeSessionState as t, extractGoogleAdkSessionId as u, extractOpencodeSessionId as v };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { H as HistoryConverter } from './protocols-DrhzOH6K.js';
|
|
2
|
+
import { R as RestApi } from './types-CxII3XkA.js';
|
|
3
|
+
|
|
4
|
+
interface GoogleADKMessage {
|
|
5
|
+
role: "user" | "model";
|
|
6
|
+
content: string | Array<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
type GoogleADKMessages = GoogleADKMessage[];
|
|
9
|
+
declare class GoogleADKHistoryConverter {
|
|
10
|
+
private agentName;
|
|
11
|
+
constructor(agentName?: string);
|
|
12
|
+
setAgentName(name: string): void;
|
|
13
|
+
convert(raw: Array<Record<string, unknown>>): GoogleADKMessages;
|
|
14
|
+
}
|
|
15
|
+
declare function extractGoogleAdkSessionId(raw: Array<Record<string, unknown>>): string | null;
|
|
16
|
+
|
|
17
|
+
interface A2AAuth {
|
|
18
|
+
apiKey?: string;
|
|
19
|
+
bearerToken?: string;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
interface A2ASessionState {
|
|
23
|
+
contextId: string | null;
|
|
24
|
+
taskId: string | null;
|
|
25
|
+
taskState: string | null;
|
|
26
|
+
}
|
|
27
|
+
declare function buildA2AAuthHeaders(auth?: A2AAuth): Record<string, string>;
|
|
28
|
+
declare class A2AHistoryConverter implements HistoryConverter<A2ASessionState> {
|
|
29
|
+
convert(raw: Array<Record<string, unknown>>): A2ASessionState;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type GatewayTaskState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | "auth-required" | "unknown";
|
|
33
|
+
interface GatewayMessagePart {
|
|
34
|
+
kind?: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
root?: {
|
|
37
|
+
text?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface GatewayA2AMessage {
|
|
41
|
+
kind: "message";
|
|
42
|
+
messageId: string;
|
|
43
|
+
role: "user" | "agent";
|
|
44
|
+
parts: GatewayMessagePart[];
|
|
45
|
+
contextId?: string;
|
|
46
|
+
taskId?: string;
|
|
47
|
+
}
|
|
48
|
+
interface GatewayA2ATaskStatus {
|
|
49
|
+
state: GatewayTaskState;
|
|
50
|
+
timestamp?: string;
|
|
51
|
+
message?: GatewayA2AMessage;
|
|
52
|
+
}
|
|
53
|
+
interface GatewayA2AStatusUpdateEvent {
|
|
54
|
+
kind: "status-update";
|
|
55
|
+
taskId: string;
|
|
56
|
+
contextId: string;
|
|
57
|
+
final: boolean;
|
|
58
|
+
status: GatewayA2ATaskStatus;
|
|
59
|
+
metadata?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
interface GatewayRequest {
|
|
62
|
+
/**
|
|
63
|
+
* Canonical Thenvoi peer id.
|
|
64
|
+
* Legacy clients may still send a slug in this field; adapter-side normalization handles that alias.
|
|
65
|
+
*/
|
|
66
|
+
peerId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional gateway route slug for compatibility/diagnostics.
|
|
69
|
+
*/
|
|
70
|
+
peerSlug?: string;
|
|
71
|
+
taskId: string;
|
|
72
|
+
contextId: string;
|
|
73
|
+
message: GatewayA2AMessage;
|
|
74
|
+
}
|
|
75
|
+
interface GatewayCancelRequest {
|
|
76
|
+
/**
|
|
77
|
+
* Canonical Thenvoi peer id.
|
|
78
|
+
* Legacy clients may still send a slug in this field; adapter-side normalization handles that alias.
|
|
79
|
+
*/
|
|
80
|
+
peerId: string;
|
|
81
|
+
/**
|
|
82
|
+
* Optional gateway route slug for compatibility/diagnostics.
|
|
83
|
+
*/
|
|
84
|
+
peerSlug?: string;
|
|
85
|
+
taskId: string;
|
|
86
|
+
}
|
|
87
|
+
interface GatewayPeer {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
description: string;
|
|
91
|
+
handle?: string | null;
|
|
92
|
+
slug: string;
|
|
93
|
+
}
|
|
94
|
+
interface GatewaySessionState {
|
|
95
|
+
contextToRoom: Record<string, string>;
|
|
96
|
+
roomParticipants: Record<string, string[]>;
|
|
97
|
+
}
|
|
98
|
+
interface PendingA2ATask {
|
|
99
|
+
taskId: string;
|
|
100
|
+
contextId: string;
|
|
101
|
+
peerId: string;
|
|
102
|
+
peerSlug?: string;
|
|
103
|
+
roomId: string;
|
|
104
|
+
enqueue(event: GatewayA2AStatusUpdateEvent): void;
|
|
105
|
+
}
|
|
106
|
+
interface GatewayServerLike {
|
|
107
|
+
start(): Promise<void>;
|
|
108
|
+
stop(): Promise<void>;
|
|
109
|
+
}
|
|
110
|
+
interface GatewayServerOptions {
|
|
111
|
+
peersBySlug: Map<string, GatewayPeer>;
|
|
112
|
+
peersById: Map<string, GatewayPeer>;
|
|
113
|
+
gatewayUrl: string;
|
|
114
|
+
host: string;
|
|
115
|
+
port: number;
|
|
116
|
+
authToken?: string;
|
|
117
|
+
allowUnauthenticatedLoopback?: boolean;
|
|
118
|
+
onRequest: (request: GatewayRequest) => AsyncIterable<GatewayA2AStatusUpdateEvent>;
|
|
119
|
+
onCancel?: (request: GatewayCancelRequest) => Promise<void>;
|
|
120
|
+
loadModules?: () => Promise<unknown>;
|
|
121
|
+
}
|
|
122
|
+
type GatewayServerFactory = (options: GatewayServerOptions) => GatewayServerLike;
|
|
123
|
+
interface A2AGatewayAdapterOptions {
|
|
124
|
+
thenvoiRest: RestApi;
|
|
125
|
+
gatewayUrl?: string;
|
|
126
|
+
host?: string;
|
|
127
|
+
port?: number;
|
|
128
|
+
authToken?: string;
|
|
129
|
+
allowUnauthenticatedLoopback?: boolean;
|
|
130
|
+
responseTimeoutMs?: number;
|
|
131
|
+
peerPageSize?: number;
|
|
132
|
+
maxPeerPages?: number;
|
|
133
|
+
serverFactory?: GatewayServerFactory;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface ParlantMessage {
|
|
137
|
+
role: "user" | "assistant";
|
|
138
|
+
content: string;
|
|
139
|
+
sender: string;
|
|
140
|
+
senderType: string;
|
|
141
|
+
}
|
|
142
|
+
type ParlantMessages = ParlantMessage[];
|
|
143
|
+
declare class ParlantHistoryConverter implements HistoryConverter<ParlantMessages> {
|
|
144
|
+
convert(raw: Array<Record<string, unknown>>): ParlantMessages;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface OpencodeSessionState {
|
|
148
|
+
sessionId: string | null;
|
|
149
|
+
roomId: string | null;
|
|
150
|
+
createdAt: Date | null;
|
|
151
|
+
replayMessages: string[];
|
|
152
|
+
}
|
|
153
|
+
declare class OpencodeHistoryConverter {
|
|
154
|
+
setAgentName(_name: string): void;
|
|
155
|
+
convert(raw: Array<Record<string, unknown>>): OpencodeSessionState;
|
|
156
|
+
}
|
|
157
|
+
declare function extractOpencodeSessionId(raw: Array<Record<string, unknown>>): string | null;
|
|
158
|
+
|
|
159
|
+
export { type A2AAuth as A, type GatewaySessionState as G, OpencodeHistoryConverter as O, ParlantHistoryConverter as P, type A2AGatewayAdapterOptions as a, type GatewayServerLike as b, type GatewayServerOptions as c, A2AHistoryConverter as d, type A2ASessionState as e, type GatewayA2AMessage as f, type GatewayA2AStatusUpdateEvent as g, type GatewayCancelRequest as h, type GatewayPeer as i, type GatewayRequest as j, type GatewayServerFactory as k, type GatewayTaskState as l, type ParlantMessage as m, type ParlantMessages as n, type PendingA2ATask as o, buildA2AAuthHeaders as p, GoogleADKHistoryConverter as q, type GoogleADKMessage as r, type GoogleADKMessages as s, type OpencodeSessionState as t, extractGoogleAdkSessionId as u, extractOpencodeSessionId as v };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { P as PaginatedResponse, a as PaginationMetadata } from './types-CSHFipIc.cjs';
|
|
2
|
+
import { M as MetadataMap } from './dtos-DUpbIu8k.cjs';
|
|
3
|
+
|
|
4
|
+
interface FetchPageRequest {
|
|
5
|
+
page: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
}
|
|
8
|
+
type PaginationStrategy = "auto" | "total_pages" | "until_empty";
|
|
9
|
+
type PaginationMetadataValidation = "strategy_aware" | "strict" | "lossy";
|
|
10
|
+
interface PaginationOptions {
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
maxPages?: number;
|
|
13
|
+
strategy?: PaginationStrategy;
|
|
14
|
+
metadataValidation?: PaginationMetadataValidation;
|
|
15
|
+
}
|
|
16
|
+
interface FetchPaginatedOptions<T extends MetadataMap> extends PaginationOptions {
|
|
17
|
+
fetchPage: (request: FetchPageRequest) => Promise<PaginatedResponse<T>>;
|
|
18
|
+
}
|
|
19
|
+
type PaginationMetadataMode = "strict" | "lossy";
|
|
20
|
+
declare function normalizePaginationMetadata(metadata?: Record<string, unknown> | PaginationMetadata, options?: {
|
|
21
|
+
mode?: PaginationMetadataMode;
|
|
22
|
+
}): PaginationMetadata;
|
|
23
|
+
declare function fetchPaginated<T extends MetadataMap>(options: FetchPaginatedOptions<T>): Promise<T[]>;
|
|
24
|
+
|
|
25
|
+
export { type PaginationOptions as P, fetchPaginated as f, normalizePaginationMetadata as n };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { P as PaginatedResponse, a as PaginationMetadata } from './types-CxII3XkA.js';
|
|
2
|
+
import { M as MetadataMap } from './dtos-DUpbIu8k.js';
|
|
3
|
+
|
|
4
|
+
interface FetchPageRequest {
|
|
5
|
+
page: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
}
|
|
8
|
+
type PaginationStrategy = "auto" | "total_pages" | "until_empty";
|
|
9
|
+
type PaginationMetadataValidation = "strategy_aware" | "strict" | "lossy";
|
|
10
|
+
interface PaginationOptions {
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
maxPages?: number;
|
|
13
|
+
strategy?: PaginationStrategy;
|
|
14
|
+
metadataValidation?: PaginationMetadataValidation;
|
|
15
|
+
}
|
|
16
|
+
interface FetchPaginatedOptions<T extends MetadataMap> extends PaginationOptions {
|
|
17
|
+
fetchPage: (request: FetchPageRequest) => Promise<PaginatedResponse<T>>;
|
|
18
|
+
}
|
|
19
|
+
type PaginationMetadataMode = "strict" | "lossy";
|
|
20
|
+
declare function normalizePaginationMetadata(metadata?: Record<string, unknown> | PaginationMetadata, options?: {
|
|
21
|
+
mode?: PaginationMetadataMode;
|
|
22
|
+
}): PaginationMetadata;
|
|
23
|
+
declare function fetchPaginated<T extends MetadataMap>(options: FetchPaginatedOptions<T>): Promise<T[]>;
|
|
24
|
+
|
|
25
|
+
export { type PaginationOptions as P, fetchPaginated as f, normalizePaginationMetadata as n };
|