@band-ai/sdk 0.3.3 → 0.4.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 +54 -1
- package/dist/{ClaudeSDKAdapter-CXud2DBE.d.ts → CopilotACPAdapter-BCpbHFB0.d.ts} +240 -19
- package/dist/{ClaudeSDKAdapter-Cx6zhSaG.d.cts → CopilotACPAdapter-D4VWg8lJ.d.cts} +240 -19
- package/dist/{opencode-2YdscIc1.d.cts → acp-client-D-I_5lK-.d.cts} +23 -4
- package/dist/{opencode-Bld62x5t.d.ts → acp-client-DUXyczlF.d.ts} +23 -4
- package/dist/acp-server-BlcYMxKt.d.ts +17 -0
- package/dist/acp-server-CJhclo6P.d.cts +17 -0
- package/dist/adapters.cjs +2217 -973
- package/dist/adapters.d.cts +21 -132
- package/dist/adapters.d.ts +21 -132
- package/dist/adapters.js +26 -1914
- package/dist/{backends-D-dBdDm-.d.ts → backends-CgsPQa9B.d.ts} +2 -2
- package/dist/{backends-ZLxmQrTZ.d.cts → backends-Dh2WXcHQ.d.cts} +2 -2
- package/dist/{chunk-JY75VSQK.js → chunk-4OVNFDD7.js} +14 -1
- package/dist/chunk-6BE2EG5P.js +128 -0
- package/dist/{chunk-U6AFCLYZ.js → chunk-6TGXV5TE.js} +1824 -514
- package/dist/{chunk-OH6VVVKT.js → chunk-CBCHTTUY.js} +10 -0
- package/dist/{chunk-K5KAEYPF.js → chunk-HNWZZXAE.js} +288 -120
- package/dist/chunk-I34SXMTJ.js +6 -0
- package/dist/{chunk-XWHWJP4I.js → chunk-JDW5WSGF.js} +2 -2
- package/dist/{chunk-KXJ74J73.js → chunk-JIZE4EC6.js} +4 -10
- package/dist/chunk-OGOXY43L.js +119 -0
- package/dist/{chunk-W5IAI6Z4.js → chunk-OVXVZUPO.js} +5 -5
- package/dist/{chunk-YJ42AZO4.js → chunk-RJNJUISR.js} +5 -2
- package/dist/{chunk-MQY74R7D.js → chunk-SHZBLLDQ.js} +21 -9
- package/dist/{chunk-JADCAMZY.js → chunk-TGDDFBYS.js} +45 -0
- package/dist/{chunk-US226AS4.js → chunk-UENIC5FJ.js} +14 -11
- package/dist/{chunk-WA7CHXUS.js → chunk-UL3Y5C4J.js} +2 -2
- package/dist/{chunk-WL2HNJZ6.js → chunk-VOMJRQOM.js} +3 -3
- package/dist/{chunk-MQBBWYRP.js → chunk-YF7K4UB3.js} +3352 -572
- package/dist/{chunk-OD2G5LFQ.js → chunk-ZYOXI4JL.js} +41 -2
- package/dist/config.cjs +2 -12
- package/dist/config.js +2 -2
- package/dist/converters.cjs +36 -11
- package/dist/converters.d.cts +7 -5
- package/dist/converters.d.ts +7 -5
- package/dist/converters.js +11 -13
- package/dist/core.cjs +239 -5
- package/dist/core.d.cts +71 -6
- package/dist/core.d.ts +71 -6
- package/dist/core.js +31 -6
- package/dist/{customTools-BzF0IISO.d.cts → customTools-Bfecd0mJ.d.cts} +1 -1
- package/dist/{customTools-BzF0IISO.d.ts → customTools-Bfecd0mJ.d.ts} +1 -1
- package/dist/{disconnectReason-IuADl6TH.d.ts → disconnectReason-Cctmg1SN.d.cts} +1 -1
- package/dist/{disconnectReason-IuADl6TH.d.cts → disconnectReason-Cctmg1SN.d.ts} +1 -1
- package/dist/{dtos-B8KU_q4d.d.ts → dtos-CjQsN1_h.d.cts} +5 -12
- package/dist/{dtos-B8KU_q4d.d.cts → dtos-CjQsN1_h.d.ts} +5 -12
- package/dist/index.cjs +5237 -1474
- package/dist/index.d.cts +61 -22
- package/dist/index.d.ts +61 -22
- package/dist/index.js +151 -43
- package/dist/linear.cjs +45 -7
- package/dist/linear.d.cts +4 -3
- package/dist/linear.d.ts +4 -3
- package/dist/linear.js +10 -10
- package/dist/mcp-claude.cjs +11 -6
- package/dist/mcp-claude.d.cts +4 -3
- package/dist/mcp-claude.d.ts +4 -3
- package/dist/mcp-claude.js +4 -5
- package/dist/mcp.cjs +13 -7
- package/dist/mcp.d.cts +6 -5
- package/dist/mcp.d.ts +6 -5
- package/dist/mcp.js +5 -6
- package/dist/{pagination-DqdkQArT.d.cts → pagination-BZDhB_nO.d.cts} +2 -2
- package/dist/{pagination-BgEx-HeL.d.ts → pagination-CPz0J_vQ.d.ts} +2 -2
- package/dist/{protocols-Bz1rxcUg.d.cts → protocols-CabgO52c.d.cts} +38 -3
- package/dist/{protocols-Bwwcql0h.d.ts → protocols-Dpci6uae.d.ts} +38 -3
- package/dist/rest.cjs +43 -1
- package/dist/rest.d.cts +6 -5
- package/dist/rest.d.ts +6 -5
- package/dist/rest.js +6 -5
- package/dist/runtime.cjs +2113 -597
- package/dist/runtime.d.cts +44 -25
- package/dist/runtime.d.ts +44 -25
- package/dist/runtime.js +11 -11
- package/dist/{schemas-BgJhlqqO.d.cts → schemas-BKnh4fKR.d.cts} +209 -24
- package/dist/{schemas-C4mK1WSs.d.ts → schemas-CDa3V_I5.d.ts} +209 -24
- package/dist/{sdk-BTciSLRQ.d.cts → sdk-CXNqzoY1.d.cts} +1 -1
- package/dist/{sdk-qKJtMma_.d.ts → sdk-Cin80BTC.d.ts} +1 -1
- package/dist/{simpleAdapter-BpT4XbZC.d.cts → simpleAdapter-D75rcz9n.d.cts} +3 -1
- package/dist/{simpleAdapter--wznuoOw.d.ts → simpleAdapter-eLvsAQNo.d.ts} +3 -1
- package/dist/testing.cjs +25 -7
- package/dist/testing.d.cts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/testing.js +9 -6
- package/dist/{types-BivGO7I9.d.ts → types-42-HWeX8.d.cts} +10 -4
- package/dist/types-CKU1N0SK.d.ts +137 -0
- package/dist/{types-BgYFd_Yw.d.cts → types-CjxZekMH.d.ts} +10 -4
- package/dist/types-DtcOLALn.d.cts +137 -0
- package/package.json +25 -26
- package/dist/acp-server-CiUqN3G3.d.ts +0 -24
- package/dist/acp-server-Dlj7D563.d.cts +0 -24
- package/dist/chunk-AVVDPXP4.js +0 -39
- package/dist/chunk-F63TPOI3.js +0 -29
- package/dist/chunk-V5TSWS7P.js +0 -62
- package/dist/types-BNNtOXu3.d.cts +0 -446
- package/dist/types-DFUtpxah.d.ts +0 -446
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { g as ParticipantRecord } from './dtos-CjQsN1_h.js';
|
|
2
|
+
import { P as PlatformMessageLike, A as AdapterToolsProtocol, a as FrameworkAdapterInput, H as HistoryConverter } from './protocols-Dpci6uae.js';
|
|
3
|
+
|
|
4
|
+
interface Payload extends Record<string, unknown> {
|
|
5
|
+
}
|
|
6
|
+
interface MentionPayload extends Payload {
|
|
7
|
+
id: string;
|
|
8
|
+
handle?: string | null;
|
|
9
|
+
name?: string | null;
|
|
10
|
+
username?: string | null;
|
|
11
|
+
}
|
|
12
|
+
interface MessageCreatedPayload extends Payload {
|
|
13
|
+
id: string;
|
|
14
|
+
content: string;
|
|
15
|
+
message_type: string;
|
|
16
|
+
metadata?: Payload & {
|
|
17
|
+
mentions?: MentionPayload[];
|
|
18
|
+
};
|
|
19
|
+
attachments?: unknown[];
|
|
20
|
+
sender_id: string;
|
|
21
|
+
sender_type: string;
|
|
22
|
+
sender_name?: string | null;
|
|
23
|
+
inserted_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
}
|
|
26
|
+
interface RoomPayload extends Payload {
|
|
27
|
+
id: string;
|
|
28
|
+
title?: string | null;
|
|
29
|
+
task_id?: string | null;
|
|
30
|
+
inserted_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
}
|
|
33
|
+
type RoomAddedPayload = RoomPayload;
|
|
34
|
+
type RoomRemovedPayload = RoomPayload;
|
|
35
|
+
interface RoomDeletedPayload extends Payload {
|
|
36
|
+
id: string;
|
|
37
|
+
}
|
|
38
|
+
interface ParticipantPayload extends Payload {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
type: string;
|
|
42
|
+
handle?: string | null;
|
|
43
|
+
}
|
|
44
|
+
type ParticipantAddedPayload = ParticipantPayload;
|
|
45
|
+
type ParticipantRemovedPayload = ParticipantPayload;
|
|
46
|
+
interface ContactRequestReceivedPayload extends Payload {
|
|
47
|
+
id: string;
|
|
48
|
+
from_handle?: string;
|
|
49
|
+
from_name?: string;
|
|
50
|
+
message?: string | null;
|
|
51
|
+
status: string;
|
|
52
|
+
inserted_at: string;
|
|
53
|
+
}
|
|
54
|
+
interface ContactRequestUpdatedPayload extends Payload {
|
|
55
|
+
id: string;
|
|
56
|
+
status: string;
|
|
57
|
+
}
|
|
58
|
+
interface ContactAddedPayload extends Payload {
|
|
59
|
+
id: string;
|
|
60
|
+
handle: string | null;
|
|
61
|
+
name: string | null;
|
|
62
|
+
type: string;
|
|
63
|
+
description?: string | null;
|
|
64
|
+
is_external?: boolean | null;
|
|
65
|
+
is_remote?: boolean | null;
|
|
66
|
+
inserted_at: string;
|
|
67
|
+
}
|
|
68
|
+
interface ContactRemovedPayload extends Payload {
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
71
|
+
interface BaseEvent<TType extends string, TPayload> {
|
|
72
|
+
type: TType;
|
|
73
|
+
roomId: string | null;
|
|
74
|
+
payload: TPayload;
|
|
75
|
+
raw?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
type MessageEvent = BaseEvent<"message_created", MessageCreatedPayload>;
|
|
78
|
+
type RoomAddedEvent = BaseEvent<"room_added", RoomAddedPayload>;
|
|
79
|
+
type RoomRemovedEvent = BaseEvent<"room_removed", RoomRemovedPayload>;
|
|
80
|
+
type ParticipantAddedEvent = BaseEvent<"participant_added", ParticipantAddedPayload>;
|
|
81
|
+
type ParticipantRemovedEvent = BaseEvent<"participant_removed", ParticipantRemovedPayload>;
|
|
82
|
+
type RoomDeletedEvent = BaseEvent<"room_deleted", RoomDeletedPayload>;
|
|
83
|
+
type ContactRequestReceivedEvent = BaseEvent<"contact_request_received", ContactRequestReceivedPayload>;
|
|
84
|
+
type ContactRequestUpdatedEvent = BaseEvent<"contact_request_updated", ContactRequestUpdatedPayload>;
|
|
85
|
+
type ContactAddedEvent = BaseEvent<"contact_added", ContactAddedPayload>;
|
|
86
|
+
type ContactRemovedEvent = BaseEvent<"contact_removed", ContactRemovedPayload>;
|
|
87
|
+
/**
|
|
88
|
+
* Synthetic — never a wire event. Queued once per settled transport
|
|
89
|
+
* reconnect generation, after tracker reconciliation, so a room's
|
|
90
|
+
* `Execution` can re-run its `/next` synchronization boundary.
|
|
91
|
+
*/
|
|
92
|
+
type ReconnectedEvent = BaseEvent<"reconnected", Record<string, never>>;
|
|
93
|
+
type ContactEvent = ContactRequestReceivedEvent | ContactRequestUpdatedEvent | ContactAddedEvent | ContactRemovedEvent;
|
|
94
|
+
type PlatformEvent = MessageEvent | RoomAddedEvent | RoomRemovedEvent | RoomDeletedEvent | ParticipantAddedEvent | ParticipantRemovedEvent | ContactRequestReceivedEvent | ContactRequestUpdatedEvent | ContactAddedEvent | ContactRemovedEvent | ReconnectedEvent;
|
|
95
|
+
|
|
96
|
+
interface AgentConfig {
|
|
97
|
+
autoSubscribeExistingRooms?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface SessionConfig {
|
|
100
|
+
enableContextCache?: boolean;
|
|
101
|
+
contextCacheTtlSeconds?: number;
|
|
102
|
+
maxContextMessages?: number;
|
|
103
|
+
maxMessageRetries?: number;
|
|
104
|
+
enableContextHydration?: boolean;
|
|
105
|
+
}
|
|
106
|
+
type ContactEventStrategy = "disabled" | "callback" | "hub_room";
|
|
107
|
+
type ContactEventCallback = (event: ContactEvent, tools: AdapterToolsProtocol) => Promise<void>;
|
|
108
|
+
interface ContactEventConfig {
|
|
109
|
+
strategy?: ContactEventStrategy;
|
|
110
|
+
hubTaskId?: string;
|
|
111
|
+
broadcastChanges?: boolean;
|
|
112
|
+
onEvent?: ContactEventCallback;
|
|
113
|
+
}
|
|
114
|
+
type PlatformMessage = PlatformMessageLike;
|
|
115
|
+
interface ConversationContext {
|
|
116
|
+
roomId: string;
|
|
117
|
+
messages: Array<Record<string, unknown>>;
|
|
118
|
+
participants: ParticipantRecord[];
|
|
119
|
+
hydratedAt: Date;
|
|
120
|
+
}
|
|
121
|
+
type MessageHandler = (message: PlatformMessage, tools: AdapterToolsProtocol) => Promise<void>;
|
|
122
|
+
declare class HistoryProvider {
|
|
123
|
+
readonly raw: Array<Record<string, unknown>>;
|
|
124
|
+
constructor(raw: Array<Record<string, unknown>>);
|
|
125
|
+
convert<T>(converter: HistoryConverter<T>): T;
|
|
126
|
+
get length(): number;
|
|
127
|
+
}
|
|
128
|
+
interface AgentInput extends Omit<FrameworkAdapterInput, "message" | "history"> {
|
|
129
|
+
message: PlatformMessage;
|
|
130
|
+
history: HistoryProvider;
|
|
131
|
+
}
|
|
132
|
+
declare const SYNTHETIC_SENDER_TYPE = "System";
|
|
133
|
+
declare const SYNTHETIC_CONTACT_EVENTS_SENDER_ID = "contact-events";
|
|
134
|
+
declare const SYNTHETIC_CONTACT_EVENTS_SENDER_NAME = "Contact Events";
|
|
135
|
+
declare function ensureHandlePrefix(handle: string | null | undefined): string | null;
|
|
136
|
+
|
|
137
|
+
export { type AgentConfig as A, type ContactEvent as C, HistoryProvider as H, type MessageHandler as M, type PlatformMessage as P, type ReconnectedEvent as R, type SessionConfig as S, type AgentInput as a, type ContactEventCallback as b, type ContactEventConfig as c, type ContactEventStrategy as d, type ConversationContext as e, type PlatformEvent as f, type MessageEvent as g, SYNTHETIC_CONTACT_EVENTS_SENDER_ID as h, SYNTHETIC_CONTACT_EVENTS_SENDER_NAME as i, SYNTHETIC_SENDER_TYPE as j, ensureHandlePrefix as k, type ParticipantAddedEvent as l, type ParticipantRemovedEvent as m };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ToolOperationResult, M as MetadataMap,
|
|
1
|
+
import { T as ToolOperationResult, M as MetadataMap, a as MentionReference, i as PaginatedList, P as PeerRecord, L as ListContactsArgs, C as ContactRecord, A as AddContactArgs, R as RemoveContactArgs, b as ListContactRequestsArgs, c as ContactRequestsResult, d as RespondContactRequestArgs, e as ListMemoriesArgs, f as MemoryRecord, S as StoreMemoryArgs, k as ContactRequestAction, l as PaginationMetadataLike } from './dtos-CjQsN1_h.js';
|
|
2
2
|
|
|
3
3
|
interface RestRequestOptions {
|
|
4
4
|
maxRetries?: number;
|
|
@@ -7,6 +7,12 @@ interface RestRequestOptions {
|
|
|
7
7
|
}
|
|
8
8
|
declare const DEFAULT_REQUEST_OPTIONS: RestRequestOptions;
|
|
9
9
|
|
|
10
|
+
interface FernMentionRequestItem {
|
|
11
|
+
id?: string;
|
|
12
|
+
handle?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
kind?: string;
|
|
15
|
+
}
|
|
10
16
|
interface AgentIdentity {
|
|
11
17
|
id: string;
|
|
12
18
|
name: string;
|
|
@@ -225,7 +231,7 @@ interface FernBandClientLike {
|
|
|
225
231
|
content: string;
|
|
226
232
|
message_type?: string;
|
|
227
233
|
metadata?: MetadataMap;
|
|
228
|
-
mentions?:
|
|
234
|
+
mentions?: FernMentionRequestItem[];
|
|
229
235
|
};
|
|
230
236
|
}, options?: RestRequestOptions): Promise<unknown>;
|
|
231
237
|
markMessageProcessing?(chatId: string, id: string, options?: RestRequestOptions): Promise<unknown>;
|
|
@@ -246,7 +252,7 @@ interface FernBandClientLike {
|
|
|
246
252
|
content: string;
|
|
247
253
|
message_type?: string;
|
|
248
254
|
metadata?: MetadataMap;
|
|
249
|
-
mentions?:
|
|
255
|
+
mentions?: FernMentionRequestItem[];
|
|
250
256
|
};
|
|
251
257
|
}, options?: RestRequestOptions): Promise<unknown>;
|
|
252
258
|
markAgentMessageProcessing?(chatId: string, id: string, options?: RestRequestOptions): Promise<unknown>;
|
|
@@ -271,7 +277,7 @@ interface FernBandClientLike {
|
|
|
271
277
|
content: string;
|
|
272
278
|
message_type?: string;
|
|
273
279
|
metadata?: MetadataMap;
|
|
274
|
-
mentions?:
|
|
280
|
+
mentions?: FernMentionRequestItem[];
|
|
275
281
|
};
|
|
276
282
|
}, options?: RestRequestOptions): Promise<unknown>;
|
|
277
283
|
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { g as ParticipantRecord } from './dtos-CjQsN1_h.cjs';
|
|
2
|
+
import { P as PlatformMessageLike, A as AdapterToolsProtocol, a as FrameworkAdapterInput, H as HistoryConverter } from './protocols-CabgO52c.cjs';
|
|
3
|
+
|
|
4
|
+
interface Payload extends Record<string, unknown> {
|
|
5
|
+
}
|
|
6
|
+
interface MentionPayload extends Payload {
|
|
7
|
+
id: string;
|
|
8
|
+
handle?: string | null;
|
|
9
|
+
name?: string | null;
|
|
10
|
+
username?: string | null;
|
|
11
|
+
}
|
|
12
|
+
interface MessageCreatedPayload extends Payload {
|
|
13
|
+
id: string;
|
|
14
|
+
content: string;
|
|
15
|
+
message_type: string;
|
|
16
|
+
metadata?: Payload & {
|
|
17
|
+
mentions?: MentionPayload[];
|
|
18
|
+
};
|
|
19
|
+
attachments?: unknown[];
|
|
20
|
+
sender_id: string;
|
|
21
|
+
sender_type: string;
|
|
22
|
+
sender_name?: string | null;
|
|
23
|
+
inserted_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
}
|
|
26
|
+
interface RoomPayload extends Payload {
|
|
27
|
+
id: string;
|
|
28
|
+
title?: string | null;
|
|
29
|
+
task_id?: string | null;
|
|
30
|
+
inserted_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
}
|
|
33
|
+
type RoomAddedPayload = RoomPayload;
|
|
34
|
+
type RoomRemovedPayload = RoomPayload;
|
|
35
|
+
interface RoomDeletedPayload extends Payload {
|
|
36
|
+
id: string;
|
|
37
|
+
}
|
|
38
|
+
interface ParticipantPayload extends Payload {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
type: string;
|
|
42
|
+
handle?: string | null;
|
|
43
|
+
}
|
|
44
|
+
type ParticipantAddedPayload = ParticipantPayload;
|
|
45
|
+
type ParticipantRemovedPayload = ParticipantPayload;
|
|
46
|
+
interface ContactRequestReceivedPayload extends Payload {
|
|
47
|
+
id: string;
|
|
48
|
+
from_handle?: string;
|
|
49
|
+
from_name?: string;
|
|
50
|
+
message?: string | null;
|
|
51
|
+
status: string;
|
|
52
|
+
inserted_at: string;
|
|
53
|
+
}
|
|
54
|
+
interface ContactRequestUpdatedPayload extends Payload {
|
|
55
|
+
id: string;
|
|
56
|
+
status: string;
|
|
57
|
+
}
|
|
58
|
+
interface ContactAddedPayload extends Payload {
|
|
59
|
+
id: string;
|
|
60
|
+
handle: string | null;
|
|
61
|
+
name: string | null;
|
|
62
|
+
type: string;
|
|
63
|
+
description?: string | null;
|
|
64
|
+
is_external?: boolean | null;
|
|
65
|
+
is_remote?: boolean | null;
|
|
66
|
+
inserted_at: string;
|
|
67
|
+
}
|
|
68
|
+
interface ContactRemovedPayload extends Payload {
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
71
|
+
interface BaseEvent<TType extends string, TPayload> {
|
|
72
|
+
type: TType;
|
|
73
|
+
roomId: string | null;
|
|
74
|
+
payload: TPayload;
|
|
75
|
+
raw?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
type MessageEvent = BaseEvent<"message_created", MessageCreatedPayload>;
|
|
78
|
+
type RoomAddedEvent = BaseEvent<"room_added", RoomAddedPayload>;
|
|
79
|
+
type RoomRemovedEvent = BaseEvent<"room_removed", RoomRemovedPayload>;
|
|
80
|
+
type ParticipantAddedEvent = BaseEvent<"participant_added", ParticipantAddedPayload>;
|
|
81
|
+
type ParticipantRemovedEvent = BaseEvent<"participant_removed", ParticipantRemovedPayload>;
|
|
82
|
+
type RoomDeletedEvent = BaseEvent<"room_deleted", RoomDeletedPayload>;
|
|
83
|
+
type ContactRequestReceivedEvent = BaseEvent<"contact_request_received", ContactRequestReceivedPayload>;
|
|
84
|
+
type ContactRequestUpdatedEvent = BaseEvent<"contact_request_updated", ContactRequestUpdatedPayload>;
|
|
85
|
+
type ContactAddedEvent = BaseEvent<"contact_added", ContactAddedPayload>;
|
|
86
|
+
type ContactRemovedEvent = BaseEvent<"contact_removed", ContactRemovedPayload>;
|
|
87
|
+
/**
|
|
88
|
+
* Synthetic — never a wire event. Queued once per settled transport
|
|
89
|
+
* reconnect generation, after tracker reconciliation, so a room's
|
|
90
|
+
* `Execution` can re-run its `/next` synchronization boundary.
|
|
91
|
+
*/
|
|
92
|
+
type ReconnectedEvent = BaseEvent<"reconnected", Record<string, never>>;
|
|
93
|
+
type ContactEvent = ContactRequestReceivedEvent | ContactRequestUpdatedEvent | ContactAddedEvent | ContactRemovedEvent;
|
|
94
|
+
type PlatformEvent = MessageEvent | RoomAddedEvent | RoomRemovedEvent | RoomDeletedEvent | ParticipantAddedEvent | ParticipantRemovedEvent | ContactRequestReceivedEvent | ContactRequestUpdatedEvent | ContactAddedEvent | ContactRemovedEvent | ReconnectedEvent;
|
|
95
|
+
|
|
96
|
+
interface AgentConfig {
|
|
97
|
+
autoSubscribeExistingRooms?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface SessionConfig {
|
|
100
|
+
enableContextCache?: boolean;
|
|
101
|
+
contextCacheTtlSeconds?: number;
|
|
102
|
+
maxContextMessages?: number;
|
|
103
|
+
maxMessageRetries?: number;
|
|
104
|
+
enableContextHydration?: boolean;
|
|
105
|
+
}
|
|
106
|
+
type ContactEventStrategy = "disabled" | "callback" | "hub_room";
|
|
107
|
+
type ContactEventCallback = (event: ContactEvent, tools: AdapterToolsProtocol) => Promise<void>;
|
|
108
|
+
interface ContactEventConfig {
|
|
109
|
+
strategy?: ContactEventStrategy;
|
|
110
|
+
hubTaskId?: string;
|
|
111
|
+
broadcastChanges?: boolean;
|
|
112
|
+
onEvent?: ContactEventCallback;
|
|
113
|
+
}
|
|
114
|
+
type PlatformMessage = PlatformMessageLike;
|
|
115
|
+
interface ConversationContext {
|
|
116
|
+
roomId: string;
|
|
117
|
+
messages: Array<Record<string, unknown>>;
|
|
118
|
+
participants: ParticipantRecord[];
|
|
119
|
+
hydratedAt: Date;
|
|
120
|
+
}
|
|
121
|
+
type MessageHandler = (message: PlatformMessage, tools: AdapterToolsProtocol) => Promise<void>;
|
|
122
|
+
declare class HistoryProvider {
|
|
123
|
+
readonly raw: Array<Record<string, unknown>>;
|
|
124
|
+
constructor(raw: Array<Record<string, unknown>>);
|
|
125
|
+
convert<T>(converter: HistoryConverter<T>): T;
|
|
126
|
+
get length(): number;
|
|
127
|
+
}
|
|
128
|
+
interface AgentInput extends Omit<FrameworkAdapterInput, "message" | "history"> {
|
|
129
|
+
message: PlatformMessage;
|
|
130
|
+
history: HistoryProvider;
|
|
131
|
+
}
|
|
132
|
+
declare const SYNTHETIC_SENDER_TYPE = "System";
|
|
133
|
+
declare const SYNTHETIC_CONTACT_EVENTS_SENDER_ID = "contact-events";
|
|
134
|
+
declare const SYNTHETIC_CONTACT_EVENTS_SENDER_NAME = "Contact Events";
|
|
135
|
+
declare function ensureHandlePrefix(handle: string | null | undefined): string | null;
|
|
136
|
+
|
|
137
|
+
export { type AgentConfig as A, type ContactEvent as C, HistoryProvider as H, type MessageHandler as M, type PlatformMessage as P, type ReconnectedEvent as R, type SessionConfig as S, type AgentInput as a, type ContactEventCallback as b, type ContactEventConfig as c, type ContactEventStrategy as d, type ConversationContext as e, type PlatformEvent as f, type MessageEvent as g, SYNTHETIC_CONTACT_EVENTS_SENDER_ID as h, SYNTHETIC_CONTACT_EVENTS_SENDER_NAME as i, SYNTHETIC_SENDER_TYPE as j, ensureHandlePrefix as k, type ParticipantAddedEvent as l, type ParticipantRemovedEvent as m };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@band-ai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Band TypeScript SDK core runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -88,25 +88,24 @@
|
|
|
88
88
|
"node": ">=22.12"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@band-ai/band-sdk-core": "2.
|
|
92
|
-
"@band-ai/rest-client": "0.0.
|
|
93
|
-
"js-yaml": "^4.
|
|
94
|
-
"phoenix": "^1.8.
|
|
95
|
-
"ws": "^8.
|
|
96
|
-
"zod": "^
|
|
97
|
-
"zod-to-json-schema": "^3.25.1"
|
|
91
|
+
"@band-ai/band-sdk-core": "2.5.0",
|
|
92
|
+
"@band-ai/rest-client": "0.0.143",
|
|
93
|
+
"js-yaml": "^5.4.2",
|
|
94
|
+
"phoenix": "^1.8.14",
|
|
95
|
+
"ws": "^8.21.3",
|
|
96
|
+
"zod": "^4.6.5"
|
|
98
97
|
},
|
|
99
98
|
"peerDependencies": {
|
|
100
99
|
"@a2a-js/sdk": ">=0.3.10",
|
|
101
|
-
"@agentclientprotocol/sdk": ">=
|
|
100
|
+
"@agentclientprotocol/sdk": ">=1.4.0",
|
|
102
101
|
"@anthropic-ai/claude-agent-sdk": ">=0.2.63",
|
|
103
102
|
"@anthropic-ai/sdk": ">=0.78.0",
|
|
104
103
|
"@google/adk": ">=0.5.0",
|
|
105
104
|
"@google/genai": ">=1.44.0",
|
|
106
105
|
"@langchain/core": ">=1.1.31",
|
|
107
106
|
"@langchain/langgraph": ">=1.2.0",
|
|
108
|
-
"@linear/sdk": ">=76.0.0",
|
|
109
107
|
"@letta-ai/letta-client": ">=1.7.0",
|
|
108
|
+
"@linear/sdk": ">=76.0.0",
|
|
110
109
|
"@modelcontextprotocol/sdk": ">=1.10.0",
|
|
111
110
|
"@openai/codex-sdk": ">=0.107.0",
|
|
112
111
|
"@opencode-ai/sdk": ">=1.3.0",
|
|
@@ -169,23 +168,23 @@
|
|
|
169
168
|
}
|
|
170
169
|
},
|
|
171
170
|
"devDependencies": {
|
|
172
|
-
"@agentclientprotocol/sdk": "^
|
|
173
|
-
"@anthropic-ai/claude-agent-sdk": "^0.
|
|
174
|
-
"@linear/sdk": "^
|
|
175
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
176
|
-
"@openai/codex-sdk": "^0.
|
|
177
|
-
"@opencode-ai/sdk": "^1.
|
|
171
|
+
"@agentclientprotocol/sdk": "^1.4.0",
|
|
172
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.270",
|
|
173
|
+
"@linear/sdk": "^95.0.0",
|
|
174
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
175
|
+
"@openai/codex-sdk": "^0.154.0",
|
|
176
|
+
"@opencode-ai/sdk": "^1.18.30",
|
|
178
177
|
"@types/express": "^5.0.6",
|
|
179
|
-
"@types/
|
|
180
|
-
"@
|
|
181
|
-
"@typescript-eslint/
|
|
182
|
-
"@
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"eslint": "^
|
|
186
|
-
"tsup": "^8.
|
|
187
|
-
"tsx": "^4.
|
|
178
|
+
"@types/node": "^26.5.1",
|
|
179
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
180
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
181
|
+
"@vitest/coverage-v8": "5.0.1",
|
|
182
|
+
"ai": "^7.0.99",
|
|
183
|
+
"c8": "12.0.0",
|
|
184
|
+
"eslint": "^10.10.0",
|
|
185
|
+
"tsup": "^8.5.1",
|
|
186
|
+
"tsx": "^4.23.13",
|
|
188
187
|
"typescript": "^5.8.2",
|
|
189
|
-
"vitest": "^
|
|
188
|
+
"vitest": "^5.0.1"
|
|
190
189
|
}
|
|
191
190
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { H as HistoryConverter } from './protocols-Bwwcql0h.js';
|
|
2
|
-
import { G as GatewaySessionState } from './opencode-Bld62x5t.js';
|
|
3
|
-
|
|
4
|
-
declare class GatewayHistoryConverter implements HistoryConverter<GatewaySessionState> {
|
|
5
|
-
convert(raw: Array<Record<string, unknown>>): GatewaySessionState;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ACPClientSessionState {
|
|
9
|
-
roomToSession: Record<string, string>;
|
|
10
|
-
}
|
|
11
|
-
declare class ACPClientHistoryConverter implements HistoryConverter<ACPClientSessionState> {
|
|
12
|
-
convert(raw: Array<Record<string, unknown>>): ACPClientSessionState;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface ACPServerSessionState {
|
|
16
|
-
sessionToRoom: Record<string, string>;
|
|
17
|
-
sessionCwd: Record<string, string>;
|
|
18
|
-
sessionMcpServers: Record<string, Array<Record<string, unknown>>>;
|
|
19
|
-
}
|
|
20
|
-
declare class ACPServerHistoryConverter implements HistoryConverter<ACPServerSessionState> {
|
|
21
|
-
convert(raw: Array<Record<string, unknown>>): ACPServerSessionState;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { type ACPClientSessionState as A, GatewayHistoryConverter as G, type ACPServerSessionState as a, ACPClientHistoryConverter as b, ACPServerHistoryConverter as c };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { H as HistoryConverter } from './protocols-Bz1rxcUg.cjs';
|
|
2
|
-
import { G as GatewaySessionState } from './opencode-2YdscIc1.cjs';
|
|
3
|
-
|
|
4
|
-
declare class GatewayHistoryConverter implements HistoryConverter<GatewaySessionState> {
|
|
5
|
-
convert(raw: Array<Record<string, unknown>>): GatewaySessionState;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ACPClientSessionState {
|
|
9
|
-
roomToSession: Record<string, string>;
|
|
10
|
-
}
|
|
11
|
-
declare class ACPClientHistoryConverter implements HistoryConverter<ACPClientSessionState> {
|
|
12
|
-
convert(raw: Array<Record<string, unknown>>): ACPClientSessionState;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface ACPServerSessionState {
|
|
16
|
-
sessionToRoom: Record<string, string>;
|
|
17
|
-
sessionCwd: Record<string, string>;
|
|
18
|
-
sessionMcpServers: Record<string, Array<Record<string, unknown>>>;
|
|
19
|
-
}
|
|
20
|
-
declare class ACPServerHistoryConverter implements HistoryConverter<ACPServerSessionState> {
|
|
21
|
-
convert(raw: Array<Record<string, unknown>>): ACPServerSessionState;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { type ACPClientSessionState as A, GatewayHistoryConverter as G, type ACPServerSessionState as a, ACPClientHistoryConverter as b, ACPServerHistoryConverter as c };
|
package/dist/chunk-AVVDPXP4.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// src/core/simpleAdapter.ts
|
|
2
|
-
var SimpleAdapter = class {
|
|
3
|
-
historyConverter;
|
|
4
|
-
agentName = "";
|
|
5
|
-
agentDescription = "";
|
|
6
|
-
constructor(options) {
|
|
7
|
-
this.historyConverter = options?.historyConverter;
|
|
8
|
-
}
|
|
9
|
-
async onCleanup(_roomId) {
|
|
10
|
-
}
|
|
11
|
-
async onStarted(agentName, agentDescription) {
|
|
12
|
-
this.agentName = agentName;
|
|
13
|
-
this.agentDescription = agentDescription;
|
|
14
|
-
}
|
|
15
|
-
async onEvent(input) {
|
|
16
|
-
const history = this.convertHistory(input.history);
|
|
17
|
-
await this.onMessage(
|
|
18
|
-
input.message,
|
|
19
|
-
input.tools,
|
|
20
|
-
history,
|
|
21
|
-
input.participantsMessage,
|
|
22
|
-
input.contactsMessage,
|
|
23
|
-
{
|
|
24
|
-
isSessionBootstrap: input.isSessionBootstrap,
|
|
25
|
-
roomId: input.roomId
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
convertHistory(provider) {
|
|
30
|
-
if (!this.historyConverter) {
|
|
31
|
-
return provider;
|
|
32
|
-
}
|
|
33
|
-
return provider.convert(this.historyConverter);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
SimpleAdapter
|
|
39
|
-
};
|
package/dist/chunk-F63TPOI3.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ValidationError
|
|
3
|
-
} from "./chunk-JY75VSQK.js";
|
|
4
|
-
|
|
5
|
-
// src/contracts/chatEvents.ts
|
|
6
|
-
var CHAT_EVENT_TYPES = ["tool_call", "tool_result", "thought", "error", "task"];
|
|
7
|
-
var CHAT_MESSAGE_TYPES = ["text", ...CHAT_EVENT_TYPES];
|
|
8
|
-
function isChatEventType(value) {
|
|
9
|
-
return CHAT_EVENT_TYPES.includes(value);
|
|
10
|
-
}
|
|
11
|
-
function assertChatEventType(value) {
|
|
12
|
-
if (!isChatEventType(value)) {
|
|
13
|
-
throw new ValidationError(
|
|
14
|
-
`Invalid event message_type '${value}'. Expected one of: ${CHAT_EVENT_TYPES.join(", ")}`
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
var VISIBLE_CONTENT_PATTERN = /[\p{L}\p{N}\p{P}\p{S}]/u;
|
|
19
|
-
function isBlankEventContent(content) {
|
|
20
|
-
return !VISIBLE_CONTENT_PATTERN.test(content);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
CHAT_EVENT_TYPES,
|
|
25
|
-
CHAT_MESSAGE_TYPES,
|
|
26
|
-
isChatEventType,
|
|
27
|
-
assertChatEventType,
|
|
28
|
-
isBlankEventContent
|
|
29
|
-
};
|
package/dist/chunk-V5TSWS7P.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// src/converters/acp-client.ts
|
|
2
|
-
var ACPClientHistoryConverter = class {
|
|
3
|
-
convert(raw) {
|
|
4
|
-
const roomToSession = {};
|
|
5
|
-
for (const entry of raw) {
|
|
6
|
-
if (entry.message_type !== "task") {
|
|
7
|
-
continue;
|
|
8
|
-
}
|
|
9
|
-
const metadataRaw = entry.metadata;
|
|
10
|
-
if (!metadataRaw || typeof metadataRaw !== "object" || Array.isArray(metadataRaw)) {
|
|
11
|
-
continue;
|
|
12
|
-
}
|
|
13
|
-
const metadata = metadataRaw;
|
|
14
|
-
const sessionId = metadata.acp_client_session_id;
|
|
15
|
-
const roomId = metadata.acp_client_room_id;
|
|
16
|
-
if (typeof sessionId === "string" && typeof roomId === "string" && sessionId && roomId && roomId === entry.room_id) {
|
|
17
|
-
roomToSession[roomId] = sessionId;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return { roomToSession };
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// src/converters/acp-server.ts
|
|
25
|
-
var ACPServerHistoryConverter = class {
|
|
26
|
-
convert(raw) {
|
|
27
|
-
const sessionToRoom = {};
|
|
28
|
-
const sessionCwd = {};
|
|
29
|
-
const sessionMcpServers = {};
|
|
30
|
-
for (const entry of raw) {
|
|
31
|
-
const metadataRaw = entry.metadata;
|
|
32
|
-
if (!metadataRaw || typeof metadataRaw !== "object" || Array.isArray(metadataRaw)) {
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
const metadata = metadataRaw;
|
|
36
|
-
const sessionId = metadata.acp_session_id;
|
|
37
|
-
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
const roomId = typeof metadata.acp_room_id === "string" ? metadata.acp_room_id : typeof entry.room_id === "string" ? entry.room_id : null;
|
|
41
|
-
if (roomId) {
|
|
42
|
-
sessionToRoom[sessionId] = roomId;
|
|
43
|
-
}
|
|
44
|
-
if (typeof metadata.acp_cwd === "string" && metadata.acp_cwd.length > 0) {
|
|
45
|
-
sessionCwd[sessionId] = metadata.acp_cwd;
|
|
46
|
-
}
|
|
47
|
-
if (Array.isArray(metadata.acp_mcp_servers)) {
|
|
48
|
-
sessionMcpServers[sessionId] = metadata.acp_mcp_servers.filter((server) => !!server && typeof server === "object" && !Array.isArray(server));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
sessionToRoom,
|
|
53
|
-
sessionCwd,
|
|
54
|
-
sessionMcpServers
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
ACPClientHistoryConverter,
|
|
61
|
-
ACPServerHistoryConverter
|
|
62
|
-
};
|