@band-ai/sdk 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +372 -0
- package/dist/{ClaudeSDKAdapter-CRq4R-WB.d.cts → ClaudeSDKAdapter-BY4zEbCl.d.cts} +14 -10
- package/dist/{ClaudeSDKAdapter-BHOkjN3X.d.ts → ClaudeSDKAdapter-Cna5P1dR.d.ts} +14 -10
- package/dist/{acp-server-B1Da7L6u.d.ts → acp-server-CiUqN3G3.d.ts} +2 -2
- package/dist/{acp-server-BdRz9_UN.d.cts → acp-server-Dlj7D563.d.cts} +2 -2
- package/dist/adapters.cjs +734 -279
- package/dist/adapters.d.cts +21 -19
- package/dist/adapters.d.ts +21 -19
- package/dist/adapters.js +65 -44
- package/dist/backends-D-dBdDm-.d.ts +27 -0
- package/dist/backends-ZLxmQrTZ.d.cts +27 -0
- package/dist/{chunk-MSL6CWHY.js → chunk-4IAXZBXX.js} +77 -37
- package/dist/{chunk-SG4WLD2H.js → chunk-EAI2M3WM.js} +38 -94
- package/dist/{chunk-YR3BOQNW.js → chunk-JY75VSQK.js} +7 -7
- package/dist/{chunk-INA6YZTZ.js → chunk-LBWKISBS.js} +51 -31
- package/dist/{chunk-I5EZG52P.js → chunk-N2QTUMGO.js} +532 -327
- package/dist/{chunk-RHVH2GZR.js → chunk-NMZLX7TP.js} +110 -56
- package/dist/{chunk-EDPKUUJL.js → chunk-NT7TBFX2.js} +9 -1
- package/dist/{chunk-GVEQ3RAH.js → chunk-RV76SKFT.js} +169 -54
- package/dist/{chunk-W5NDZSYE.js → chunk-TLBCKDQO.js} +23 -23
- package/dist/chunk-US226AS4.js +130 -0
- package/dist/{chunk-IZPV6QS6.js → chunk-WL2HNJZ6.js} +38 -11
- package/dist/chunk-WLCM2OXG.js +181 -0
- package/dist/config.cjs +40 -13
- package/dist/config.d.cts +7 -1
- package/dist/config.d.ts +7 -1
- package/dist/config.js +2 -2
- package/dist/converters.cjs +491 -35
- package/dist/converters.d.cts +5 -5
- package/dist/converters.d.ts +5 -5
- package/dist/converters.js +4 -3
- package/dist/core.cjs +53 -10
- package/dist/core.d.cts +10 -9
- package/dist/core.d.ts +10 -9
- package/dist/core.js +8 -4
- package/dist/disconnectReason-IuADl6TH.d.cts +34 -0
- package/dist/disconnectReason-IuADl6TH.d.ts +34 -0
- package/dist/{dtos-DUpbIu8k.d.ts → dtos-B8KU_q4d.d.cts} +26 -6
- package/dist/{dtos-DUpbIu8k.d.cts → dtos-B8KU_q4d.d.ts} +26 -6
- package/dist/index.cjs +1510 -735
- package/dist/index.d.cts +18 -16
- package/dist/index.d.ts +18 -16
- package/dist/index.js +21 -13
- package/dist/linear.cjs +1044 -112
- package/dist/linear.d.cts +146 -16
- package/dist/linear.d.ts +146 -16
- package/dist/linear.js +1031 -110
- package/dist/mcp-claude.cjs +338 -66
- package/dist/mcp-claude.d.cts +3 -3
- package/dist/mcp-claude.d.ts +3 -3
- package/dist/mcp-claude.js +215 -16
- package/dist/mcp.cjs +414 -105
- package/dist/mcp.d.cts +29 -16
- package/dist/mcp.d.ts +29 -16
- package/dist/mcp.js +14 -14
- package/dist/{opencode-BBcDchcN.d.cts → opencode-2YdscIc1.d.cts} +5 -5
- package/dist/{opencode-DthQQUsZ.d.ts → opencode-Bld62x5t.d.ts} +5 -5
- package/dist/{pagination-CcDkVFxK.d.ts → pagination-BgEx-HeL.d.ts} +2 -2
- package/dist/{pagination-BPiys10t.d.cts → pagination-DqdkQArT.d.cts} +2 -2
- package/dist/{protocols-DrhzOH6K.d.ts → protocols-Bwwcql0h.d.ts} +1 -1
- package/dist/{protocols-CInhtFpA.d.cts → protocols-Bz1rxcUg.d.cts} +1 -1
- package/dist/rest.cjs +41 -97
- package/dist/rest.d.cts +7 -7
- package/dist/rest.d.ts +7 -7
- package/dist/rest.js +2 -2
- package/dist/runtime.cjs +998 -620
- package/dist/runtime.d.cts +22 -29
- package/dist/runtime.d.ts +22 -29
- package/dist/runtime.js +19 -67
- package/dist/{schemas-BpEBkq5V.d.cts → schemas-BotL3ZLH.d.cts} +51 -56
- package/dist/{schemas-vos1AaBc.d.ts → schemas-DBsC4J1g.d.ts} +51 -56
- package/dist/{sdk-CwTAxhwI.d.cts → sdk-BTciSLRQ.d.cts} +35 -5
- package/dist/{sdk-CcnQ5OUC.d.ts → sdk-qKJtMma_.d.ts} +35 -5
- package/dist/{simpleAdapter-9OE_p6QW.d.ts → simpleAdapter--wznuoOw.d.ts} +1 -1
- package/dist/{simpleAdapter-DqhvjsGr.d.cts → simpleAdapter-BpT4XbZC.d.cts} +1 -1
- package/dist/testing.d.cts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/{types-7jVzOeOP.d.ts → types-BTN_ZETM.d.ts} +2 -2
- package/dist/{types-CxII3XkA.d.ts → types-BgYFd_Yw.d.cts} +5 -5
- package/dist/{types-CSHFipIc.d.cts → types-BivGO7I9.d.ts} +5 -5
- package/dist/{types-CovcHpYf.d.cts → types-D958TC71.d.cts} +2 -2
- package/package.json +25 -23
- package/dist/backends-CzDbiQar.d.ts +0 -20
- package/dist/backends-SVMT-7l4.d.cts +0 -20
- package/dist/chunk-SFVKOEQH.js +0 -103
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { h as AgentToolsCapabilities, g as PlatformMessageLike, A as AdapterToolsProtocol, e as Preprocessor, F as FrameworkAdapter, i as PreprocessorContext } from './protocols-
|
|
2
|
-
import { f as PlatformEvent, P as PlatformMessage, e as ConversationContext, S as SessionConfig, c as ContactEventConfig, A as AgentConfig, C as ContactEvent, a as AgentInput } from './types-
|
|
3
|
-
import { M as MetadataMap, P as ParticipantRecord } from './dtos-
|
|
1
|
+
import { h as AgentToolsCapabilities, g as PlatformMessageLike, A as AdapterToolsProtocol, e as Preprocessor, F as FrameworkAdapter, i as PreprocessorContext } from './protocols-Bz1rxcUg.cjs';
|
|
2
|
+
import { f as PlatformEvent, P as PlatformMessage, e as ConversationContext, S as SessionConfig, c as ContactEventConfig, A as AgentConfig, C as ContactEvent, a as AgentInput } from './types-D958TC71.cjs';
|
|
3
|
+
import { M as MetadataMap, P as ParticipantRecord } from './dtos-B8KU_q4d.cjs';
|
|
4
4
|
import { L as Logger } from './logger-CABQOnlR.cjs';
|
|
5
|
-
import {
|
|
6
|
-
import { P as PaginationOptions } from './pagination-
|
|
5
|
+
import { B as BandLinkRestApi, b as RestRequestOptions, P as PaginatedResponse, e as AgentToolsRestApi } from './types-BgYFd_Yw.cjs';
|
|
6
|
+
import { P as PaginationOptions } from './pagination-DqdkQArT.cjs';
|
|
7
|
+
import { W as WebSocketConflictPolicy, b as WebSocketDisconnectReason } from './disconnectReason-IuADl6TH.cjs';
|
|
8
|
+
import { RetryTracker } from '@band-ai/band-sdk-core';
|
|
7
9
|
|
|
8
10
|
interface TopicHandlers {
|
|
9
11
|
[event: string]: (payload: Record<string, unknown>) => Promise<void> | void;
|
|
@@ -17,25 +19,27 @@ interface StreamingTransport {
|
|
|
17
19
|
isConnected(): boolean;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
interface
|
|
22
|
+
interface BandLinkOptions {
|
|
21
23
|
agentId: string;
|
|
22
24
|
apiKey: string;
|
|
23
25
|
wsUrl?: string;
|
|
24
26
|
restUrl?: string;
|
|
25
|
-
restApi?:
|
|
27
|
+
restApi?: BandLinkRestApi;
|
|
26
28
|
transport?: StreamingTransport;
|
|
27
29
|
logger?: Logger;
|
|
28
30
|
capabilities?: Partial<AgentToolsCapabilities>;
|
|
31
|
+
conflictPolicy?: WebSocketConflictPolicy;
|
|
29
32
|
}
|
|
33
|
+
declare function deriveDefaultRestUrl(wsUrl: string): string;
|
|
30
34
|
interface MessageMarkOptions {
|
|
31
35
|
bestEffort?: boolean;
|
|
32
36
|
}
|
|
33
|
-
declare class
|
|
37
|
+
declare class BandLink implements AsyncIterable<PlatformEvent> {
|
|
34
38
|
readonly agentId: string;
|
|
35
39
|
private readonly apiKey;
|
|
36
40
|
readonly wsUrl: string;
|
|
37
41
|
readonly restUrl: string;
|
|
38
|
-
readonly rest:
|
|
42
|
+
readonly rest: BandLinkRestApi;
|
|
39
43
|
readonly capabilities: AgentToolsCapabilities;
|
|
40
44
|
private readonly logger;
|
|
41
45
|
private readonly transport;
|
|
@@ -43,15 +47,21 @@ declare class ThenvoiLink implements AsyncIterable<PlatformEvent> {
|
|
|
43
47
|
private readonly eventQueue;
|
|
44
48
|
private readonly waiters;
|
|
45
49
|
private connected;
|
|
46
|
-
|
|
50
|
+
private lastDisconnectReason;
|
|
51
|
+
private terminalDisconnectError;
|
|
52
|
+
constructor(options: BandLinkOptions);
|
|
47
53
|
isConnected(): boolean;
|
|
54
|
+
getDisconnectReason(): WebSocketDisconnectReason | null;
|
|
48
55
|
connect(): Promise<void>;
|
|
49
56
|
disconnect(): Promise<void>;
|
|
50
57
|
runForever(signal: AbortSignal): Promise<void>;
|
|
58
|
+
private recordDisconnectReason;
|
|
59
|
+
private recordDisconnectError;
|
|
51
60
|
queueEvent(event: PlatformEvent): void;
|
|
52
61
|
subscribeAgentRooms(): Promise<void>;
|
|
53
62
|
subscribeRoom(roomId: string): Promise<void>;
|
|
54
63
|
unsubscribeRoom(roomId: string): Promise<void>;
|
|
64
|
+
private joinRoomTopics;
|
|
55
65
|
subscribeAgentContacts(): Promise<void>;
|
|
56
66
|
unsubscribeAgentContacts(): Promise<void>;
|
|
57
67
|
nextEvent(signal?: AbortSignal): Promise<PlatformEvent | null>;
|
|
@@ -70,21 +80,6 @@ declare class ThenvoiLink implements AsyncIterable<PlatformEvent> {
|
|
|
70
80
|
private emit;
|
|
71
81
|
}
|
|
72
82
|
|
|
73
|
-
declare class MessageRetryTracker {
|
|
74
|
-
private readonly maxRetriesValue;
|
|
75
|
-
private readonly maxTracked;
|
|
76
|
-
private attempts;
|
|
77
|
-
private failed;
|
|
78
|
-
constructor(maxRetries?: number, maxTracked?: number);
|
|
79
|
-
get maxRetries(): number;
|
|
80
|
-
isPermanentlyFailed(messageId: string): boolean;
|
|
81
|
-
recordAttempt(messageId: string): [number, boolean];
|
|
82
|
-
markSuccess(messageId: string): void;
|
|
83
|
-
markPermanentlyFailed(messageId: string): void;
|
|
84
|
-
private evictMapIfNeeded;
|
|
85
|
-
private evictSetIfNeeded;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
83
|
type ExecutionState = "starting" | "idle" | "processing";
|
|
89
84
|
interface ExecutionContextLink {
|
|
90
85
|
rest: AgentToolsRestApi;
|
|
@@ -109,11 +104,10 @@ declare class ExecutionContext {
|
|
|
109
104
|
private readonly history;
|
|
110
105
|
private messageIds;
|
|
111
106
|
private readonly dedupCache;
|
|
112
|
-
private
|
|
107
|
+
private readonly roster;
|
|
113
108
|
private readonly tools;
|
|
114
109
|
private readonly adapterTools;
|
|
115
110
|
private participantsMessage;
|
|
116
|
-
private lastSentParticipantIds;
|
|
117
111
|
private contactsMessage;
|
|
118
112
|
private contextCache;
|
|
119
113
|
private contextCacheExpiresAt;
|
|
@@ -124,7 +118,7 @@ declare class ExecutionContext {
|
|
|
124
118
|
constructor(options: ExecutionContextOptions);
|
|
125
119
|
get state(): ExecutionState;
|
|
126
120
|
setState(state: ExecutionState): void;
|
|
127
|
-
getRetryTracker():
|
|
121
|
+
getRetryTracker(): RetryTracker;
|
|
128
122
|
get isLlmInitialized(): boolean;
|
|
129
123
|
markLlmInitialized(): void;
|
|
130
124
|
injectSystemMessage(message: string): void;
|
|
@@ -134,14 +128,13 @@ declare class ExecutionContext {
|
|
|
134
128
|
recordMessage(message: PlatformMessage): void;
|
|
135
129
|
getRawHistory(): MetadataMap[];
|
|
136
130
|
setParticipants(participants: ParticipantRecord[]): void;
|
|
137
|
-
addParticipant(participant: ParticipantRecord): void;
|
|
131
|
+
addParticipant(participant: Partial<ParticipantRecord> & Pick<ParticipantRecord, "id">): void;
|
|
138
132
|
removeParticipant(participantId: string): void;
|
|
139
133
|
setContactsMessage(message: string | null): void;
|
|
140
134
|
consumeParticipantsMessage(): string | null;
|
|
141
135
|
consumeContactsMessage(): string | null;
|
|
142
136
|
getHydratedHistory(excludeMessageId?: string): Promise<MetadataMap[]>;
|
|
143
137
|
hydrateContext(forceRefresh?: boolean): Promise<ConversationContext>;
|
|
144
|
-
private replaceParticipants;
|
|
145
138
|
private buildLocalContext;
|
|
146
139
|
private loadParticipants;
|
|
147
140
|
private loadHydratedMessages;
|
|
@@ -158,8 +151,8 @@ interface PlatformRuntimeOptions {
|
|
|
158
151
|
apiKey: string;
|
|
159
152
|
wsUrl?: string;
|
|
160
153
|
restUrl?: string;
|
|
161
|
-
link?:
|
|
162
|
-
linkOptions?: Omit<
|
|
154
|
+
link?: BandLink;
|
|
155
|
+
linkOptions?: Omit<BandLinkOptions, "agentId" | "apiKey">;
|
|
163
156
|
preprocessor?: Preprocessor<PlatformEvent>;
|
|
164
157
|
sessionConfig?: SessionConfig;
|
|
165
158
|
contactConfig?: ContactEventConfig;
|
|
@@ -200,7 +193,7 @@ declare class PlatformRuntime {
|
|
|
200
193
|
private _agentDescription;
|
|
201
194
|
private contactsSubscribed;
|
|
202
195
|
constructor(options: PlatformRuntimeOptions);
|
|
203
|
-
get link():
|
|
196
|
+
get link(): BandLink;
|
|
204
197
|
get name(): string;
|
|
205
198
|
get agentId(): string;
|
|
206
199
|
get description(): string;
|
|
@@ -218,7 +211,7 @@ declare class PlatformRuntime {
|
|
|
218
211
|
}
|
|
219
212
|
|
|
220
213
|
interface AgentRuntimeOptions {
|
|
221
|
-
link:
|
|
214
|
+
link: BandLink;
|
|
222
215
|
agentId: string;
|
|
223
216
|
onExecute: (context: ExecutionContext, event: PlatformEvent) => Promise<void>;
|
|
224
217
|
onSessionCleanup?: (roomId: string) => Promise<void>;
|
|
@@ -284,7 +277,7 @@ declare class DefaultPreprocessor implements Preprocessor<PlatformEvent> {
|
|
|
284
277
|
}
|
|
285
278
|
|
|
286
279
|
declare const TOOL_MODELS: {
|
|
287
|
-
readonly
|
|
280
|
+
readonly band_send_message: {
|
|
288
281
|
readonly description: string;
|
|
289
282
|
readonly properties: {
|
|
290
283
|
readonly content: {
|
|
@@ -302,7 +295,7 @@ declare const TOOL_MODELS: {
|
|
|
302
295
|
};
|
|
303
296
|
readonly required: readonly ["content", "mentions"];
|
|
304
297
|
};
|
|
305
|
-
readonly
|
|
298
|
+
readonly band_send_event: {
|
|
306
299
|
readonly description: string;
|
|
307
300
|
readonly properties: {
|
|
308
301
|
readonly content: {
|
|
@@ -321,12 +314,12 @@ declare const TOOL_MODELS: {
|
|
|
321
314
|
};
|
|
322
315
|
readonly required: readonly ["content", "message_type"];
|
|
323
316
|
};
|
|
324
|
-
readonly
|
|
317
|
+
readonly band_add_participant: {
|
|
325
318
|
readonly description: string;
|
|
326
319
|
readonly properties: {
|
|
327
320
|
readonly name: {
|
|
328
321
|
readonly type: "string";
|
|
329
|
-
readonly description: "Name of participant to add (must match a name from
|
|
322
|
+
readonly description: "Name of participant to add (must match a name from band_lookup_peers).";
|
|
330
323
|
};
|
|
331
324
|
readonly role: {
|
|
332
325
|
readonly type: "string";
|
|
@@ -336,7 +329,7 @@ declare const TOOL_MODELS: {
|
|
|
336
329
|
};
|
|
337
330
|
readonly required: readonly ["name"];
|
|
338
331
|
};
|
|
339
|
-
readonly
|
|
332
|
+
readonly band_remove_participant: {
|
|
340
333
|
readonly description: "Remove a participant from the chat room by name.";
|
|
341
334
|
readonly properties: {
|
|
342
335
|
readonly name: {
|
|
@@ -346,12 +339,12 @@ declare const TOOL_MODELS: {
|
|
|
346
339
|
};
|
|
347
340
|
readonly required: readonly ["name"];
|
|
348
341
|
};
|
|
349
|
-
readonly
|
|
342
|
+
readonly band_get_participants: {
|
|
350
343
|
readonly description: "Get a list of all participants in the current chat room.";
|
|
351
344
|
readonly properties: {};
|
|
352
345
|
readonly required: readonly [];
|
|
353
346
|
};
|
|
354
|
-
readonly
|
|
347
|
+
readonly band_lookup_peers: {
|
|
355
348
|
readonly description: string;
|
|
356
349
|
readonly properties: {
|
|
357
350
|
readonly page: {
|
|
@@ -366,7 +359,7 @@ declare const TOOL_MODELS: {
|
|
|
366
359
|
};
|
|
367
360
|
readonly required: readonly [];
|
|
368
361
|
};
|
|
369
|
-
readonly
|
|
362
|
+
readonly band_create_chatroom: {
|
|
370
363
|
readonly description: "Create a new chat room for a specific task or conversation.";
|
|
371
364
|
readonly properties: {
|
|
372
365
|
readonly task_id: {
|
|
@@ -376,7 +369,7 @@ declare const TOOL_MODELS: {
|
|
|
376
369
|
};
|
|
377
370
|
readonly required: readonly [];
|
|
378
371
|
};
|
|
379
|
-
readonly
|
|
372
|
+
readonly band_list_contacts: {
|
|
380
373
|
readonly description: "List agent's contacts with pagination.";
|
|
381
374
|
readonly properties: {
|
|
382
375
|
readonly page: {
|
|
@@ -393,7 +386,7 @@ declare const TOOL_MODELS: {
|
|
|
393
386
|
};
|
|
394
387
|
readonly required: readonly [];
|
|
395
388
|
};
|
|
396
|
-
readonly
|
|
389
|
+
readonly band_add_contact: {
|
|
397
390
|
readonly description: string;
|
|
398
391
|
readonly properties: {
|
|
399
392
|
readonly handle: {
|
|
@@ -407,7 +400,7 @@ declare const TOOL_MODELS: {
|
|
|
407
400
|
};
|
|
408
401
|
readonly required: readonly ["handle"];
|
|
409
402
|
};
|
|
410
|
-
readonly
|
|
403
|
+
readonly band_remove_contact: {
|
|
411
404
|
readonly description: "Remove an existing contact by handle or ID.";
|
|
412
405
|
readonly properties: {
|
|
413
406
|
readonly handle: {
|
|
@@ -421,7 +414,7 @@ declare const TOOL_MODELS: {
|
|
|
421
414
|
};
|
|
422
415
|
readonly required: readonly [];
|
|
423
416
|
};
|
|
424
|
-
readonly
|
|
417
|
+
readonly band_list_contact_requests: {
|
|
425
418
|
readonly description: string;
|
|
426
419
|
readonly properties: {
|
|
427
420
|
readonly page: {
|
|
@@ -443,7 +436,7 @@ declare const TOOL_MODELS: {
|
|
|
443
436
|
};
|
|
444
437
|
readonly required: readonly [];
|
|
445
438
|
};
|
|
446
|
-
readonly
|
|
439
|
+
readonly band_respond_contact_request: {
|
|
447
440
|
readonly description: string;
|
|
448
441
|
readonly properties: {
|
|
449
442
|
readonly action: {
|
|
@@ -462,7 +455,7 @@ declare const TOOL_MODELS: {
|
|
|
462
455
|
};
|
|
463
456
|
readonly required: readonly ["action"];
|
|
464
457
|
};
|
|
465
|
-
readonly
|
|
458
|
+
readonly band_list_memories: {
|
|
466
459
|
readonly description: string;
|
|
467
460
|
readonly properties: {
|
|
468
461
|
readonly subject_id: {
|
|
@@ -476,7 +469,7 @@ declare const TOOL_MODELS: {
|
|
|
476
469
|
};
|
|
477
470
|
readonly system: {
|
|
478
471
|
readonly type: "string";
|
|
479
|
-
readonly enum: readonly
|
|
472
|
+
readonly enum: readonly ("sensory" | "working" | "long_term")[];
|
|
480
473
|
readonly description: "Filter by memory system.";
|
|
481
474
|
};
|
|
482
475
|
readonly type: {
|
|
@@ -507,7 +500,7 @@ declare const TOOL_MODELS: {
|
|
|
507
500
|
};
|
|
508
501
|
readonly required: readonly [];
|
|
509
502
|
};
|
|
510
|
-
readonly
|
|
503
|
+
readonly band_store_memory: {
|
|
511
504
|
readonly description: string;
|
|
512
505
|
readonly properties: {
|
|
513
506
|
readonly content: {
|
|
@@ -516,7 +509,7 @@ declare const TOOL_MODELS: {
|
|
|
516
509
|
};
|
|
517
510
|
readonly system: {
|
|
518
511
|
readonly type: "string";
|
|
519
|
-
readonly enum: readonly
|
|
512
|
+
readonly enum: readonly ("sensory" | "working" | "long_term")[];
|
|
520
513
|
readonly description: "Memory system tier.";
|
|
521
514
|
};
|
|
522
515
|
readonly type: {
|
|
@@ -549,7 +542,7 @@ declare const TOOL_MODELS: {
|
|
|
549
542
|
};
|
|
550
543
|
readonly required: readonly ["content", "system", "type", "segment", "thought"];
|
|
551
544
|
};
|
|
552
|
-
readonly
|
|
545
|
+
readonly band_get_memory: {
|
|
553
546
|
readonly description: "Retrieve a specific memory by ID.";
|
|
554
547
|
readonly properties: {
|
|
555
548
|
readonly memory_id: {
|
|
@@ -559,7 +552,7 @@ declare const TOOL_MODELS: {
|
|
|
559
552
|
};
|
|
560
553
|
readonly required: readonly ["memory_id"];
|
|
561
554
|
};
|
|
562
|
-
readonly
|
|
555
|
+
readonly band_supersede_memory: {
|
|
563
556
|
readonly description: string;
|
|
564
557
|
readonly properties: {
|
|
565
558
|
readonly memory_id: {
|
|
@@ -569,7 +562,7 @@ declare const TOOL_MODELS: {
|
|
|
569
562
|
};
|
|
570
563
|
readonly required: readonly ["memory_id"];
|
|
571
564
|
};
|
|
572
|
-
readonly
|
|
565
|
+
readonly band_archive_memory: {
|
|
573
566
|
readonly description: string;
|
|
574
567
|
readonly properties: {
|
|
575
568
|
readonly memory_id: {
|
|
@@ -585,8 +578,10 @@ declare const MEMORY_TOOL_NAMES: Set<string>;
|
|
|
585
578
|
declare const CONTACT_TOOL_NAMES: Set<string>;
|
|
586
579
|
declare const BASE_TOOL_NAMES: Set<string>;
|
|
587
580
|
declare const CHAT_TOOL_NAMES: Set<string>;
|
|
588
|
-
declare const MCP_TOOL_PREFIX = "
|
|
581
|
+
declare const MCP_TOOL_PREFIX = "mcp__band__";
|
|
582
|
+
/** The single Band MCP server name; owns every server-name default and integration. */
|
|
583
|
+
declare const MCP_SERVER_NAME = "band";
|
|
589
584
|
declare function mcpToolNames(names: Set<string>): string[];
|
|
590
585
|
declare function getToolDescription(name: string): string;
|
|
591
586
|
|
|
592
|
-
export { AgentRuntime as A,
|
|
587
|
+
export { AgentRuntime as A, BandLink as B, CHAT_TOOL_NAMES as C, DefaultPreprocessor as D, type ExecutionContextOptions as E, MCP_SERVER_NAME as M, PlatformRuntime as P, TOOL_MODELS as T, type PlatformRuntimeOptions as a, MCP_TOOL_PREFIX as b, ExecutionContext as c, deriveDefaultRestUrl as d, ALL_TOOL_NAMES as e, BASE_TOOL_NAMES as f, CONTACT_TOOL_NAMES as g, type ExecutionState as h, MEMORY_TOOL_NAMES as i, getToolDescription as j, mcpToolNames as m };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { h as AgentToolsCapabilities, g as PlatformMessageLike, A as AdapterToolsProtocol, e as Preprocessor, F as FrameworkAdapter, i as PreprocessorContext } from './protocols-
|
|
2
|
-
import { f as PlatformEvent, P as PlatformMessage, e as ConversationContext, S as SessionConfig, c as ContactEventConfig, A as AgentConfig, C as ContactEvent, a as AgentInput } from './types-
|
|
3
|
-
import { M as MetadataMap, P as ParticipantRecord } from './dtos-
|
|
1
|
+
import { h as AgentToolsCapabilities, g as PlatformMessageLike, A as AdapterToolsProtocol, e as Preprocessor, F as FrameworkAdapter, i as PreprocessorContext } from './protocols-Bwwcql0h.js';
|
|
2
|
+
import { f as PlatformEvent, P as PlatformMessage, e as ConversationContext, S as SessionConfig, c as ContactEventConfig, A as AgentConfig, C as ContactEvent, a as AgentInput } from './types-BTN_ZETM.js';
|
|
3
|
+
import { M as MetadataMap, P as ParticipantRecord } from './dtos-B8KU_q4d.js';
|
|
4
4
|
import { L as Logger } from './logger-CABQOnlR.js';
|
|
5
|
-
import {
|
|
6
|
-
import { P as PaginationOptions } from './pagination-
|
|
5
|
+
import { B as BandLinkRestApi, b as RestRequestOptions, P as PaginatedResponse, e as AgentToolsRestApi } from './types-BivGO7I9.js';
|
|
6
|
+
import { P as PaginationOptions } from './pagination-BgEx-HeL.js';
|
|
7
|
+
import { W as WebSocketConflictPolicy, b as WebSocketDisconnectReason } from './disconnectReason-IuADl6TH.js';
|
|
8
|
+
import { RetryTracker } from '@band-ai/band-sdk-core';
|
|
7
9
|
|
|
8
10
|
interface TopicHandlers {
|
|
9
11
|
[event: string]: (payload: Record<string, unknown>) => Promise<void> | void;
|
|
@@ -17,25 +19,27 @@ interface StreamingTransport {
|
|
|
17
19
|
isConnected(): boolean;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
interface
|
|
22
|
+
interface BandLinkOptions {
|
|
21
23
|
agentId: string;
|
|
22
24
|
apiKey: string;
|
|
23
25
|
wsUrl?: string;
|
|
24
26
|
restUrl?: string;
|
|
25
|
-
restApi?:
|
|
27
|
+
restApi?: BandLinkRestApi;
|
|
26
28
|
transport?: StreamingTransport;
|
|
27
29
|
logger?: Logger;
|
|
28
30
|
capabilities?: Partial<AgentToolsCapabilities>;
|
|
31
|
+
conflictPolicy?: WebSocketConflictPolicy;
|
|
29
32
|
}
|
|
33
|
+
declare function deriveDefaultRestUrl(wsUrl: string): string;
|
|
30
34
|
interface MessageMarkOptions {
|
|
31
35
|
bestEffort?: boolean;
|
|
32
36
|
}
|
|
33
|
-
declare class
|
|
37
|
+
declare class BandLink implements AsyncIterable<PlatformEvent> {
|
|
34
38
|
readonly agentId: string;
|
|
35
39
|
private readonly apiKey;
|
|
36
40
|
readonly wsUrl: string;
|
|
37
41
|
readonly restUrl: string;
|
|
38
|
-
readonly rest:
|
|
42
|
+
readonly rest: BandLinkRestApi;
|
|
39
43
|
readonly capabilities: AgentToolsCapabilities;
|
|
40
44
|
private readonly logger;
|
|
41
45
|
private readonly transport;
|
|
@@ -43,15 +47,21 @@ declare class ThenvoiLink implements AsyncIterable<PlatformEvent> {
|
|
|
43
47
|
private readonly eventQueue;
|
|
44
48
|
private readonly waiters;
|
|
45
49
|
private connected;
|
|
46
|
-
|
|
50
|
+
private lastDisconnectReason;
|
|
51
|
+
private terminalDisconnectError;
|
|
52
|
+
constructor(options: BandLinkOptions);
|
|
47
53
|
isConnected(): boolean;
|
|
54
|
+
getDisconnectReason(): WebSocketDisconnectReason | null;
|
|
48
55
|
connect(): Promise<void>;
|
|
49
56
|
disconnect(): Promise<void>;
|
|
50
57
|
runForever(signal: AbortSignal): Promise<void>;
|
|
58
|
+
private recordDisconnectReason;
|
|
59
|
+
private recordDisconnectError;
|
|
51
60
|
queueEvent(event: PlatformEvent): void;
|
|
52
61
|
subscribeAgentRooms(): Promise<void>;
|
|
53
62
|
subscribeRoom(roomId: string): Promise<void>;
|
|
54
63
|
unsubscribeRoom(roomId: string): Promise<void>;
|
|
64
|
+
private joinRoomTopics;
|
|
55
65
|
subscribeAgentContacts(): Promise<void>;
|
|
56
66
|
unsubscribeAgentContacts(): Promise<void>;
|
|
57
67
|
nextEvent(signal?: AbortSignal): Promise<PlatformEvent | null>;
|
|
@@ -70,21 +80,6 @@ declare class ThenvoiLink implements AsyncIterable<PlatformEvent> {
|
|
|
70
80
|
private emit;
|
|
71
81
|
}
|
|
72
82
|
|
|
73
|
-
declare class MessageRetryTracker {
|
|
74
|
-
private readonly maxRetriesValue;
|
|
75
|
-
private readonly maxTracked;
|
|
76
|
-
private attempts;
|
|
77
|
-
private failed;
|
|
78
|
-
constructor(maxRetries?: number, maxTracked?: number);
|
|
79
|
-
get maxRetries(): number;
|
|
80
|
-
isPermanentlyFailed(messageId: string): boolean;
|
|
81
|
-
recordAttempt(messageId: string): [number, boolean];
|
|
82
|
-
markSuccess(messageId: string): void;
|
|
83
|
-
markPermanentlyFailed(messageId: string): void;
|
|
84
|
-
private evictMapIfNeeded;
|
|
85
|
-
private evictSetIfNeeded;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
83
|
type ExecutionState = "starting" | "idle" | "processing";
|
|
89
84
|
interface ExecutionContextLink {
|
|
90
85
|
rest: AgentToolsRestApi;
|
|
@@ -109,11 +104,10 @@ declare class ExecutionContext {
|
|
|
109
104
|
private readonly history;
|
|
110
105
|
private messageIds;
|
|
111
106
|
private readonly dedupCache;
|
|
112
|
-
private
|
|
107
|
+
private readonly roster;
|
|
113
108
|
private readonly tools;
|
|
114
109
|
private readonly adapterTools;
|
|
115
110
|
private participantsMessage;
|
|
116
|
-
private lastSentParticipantIds;
|
|
117
111
|
private contactsMessage;
|
|
118
112
|
private contextCache;
|
|
119
113
|
private contextCacheExpiresAt;
|
|
@@ -124,7 +118,7 @@ declare class ExecutionContext {
|
|
|
124
118
|
constructor(options: ExecutionContextOptions);
|
|
125
119
|
get state(): ExecutionState;
|
|
126
120
|
setState(state: ExecutionState): void;
|
|
127
|
-
getRetryTracker():
|
|
121
|
+
getRetryTracker(): RetryTracker;
|
|
128
122
|
get isLlmInitialized(): boolean;
|
|
129
123
|
markLlmInitialized(): void;
|
|
130
124
|
injectSystemMessage(message: string): void;
|
|
@@ -134,14 +128,13 @@ declare class ExecutionContext {
|
|
|
134
128
|
recordMessage(message: PlatformMessage): void;
|
|
135
129
|
getRawHistory(): MetadataMap[];
|
|
136
130
|
setParticipants(participants: ParticipantRecord[]): void;
|
|
137
|
-
addParticipant(participant: ParticipantRecord): void;
|
|
131
|
+
addParticipant(participant: Partial<ParticipantRecord> & Pick<ParticipantRecord, "id">): void;
|
|
138
132
|
removeParticipant(participantId: string): void;
|
|
139
133
|
setContactsMessage(message: string | null): void;
|
|
140
134
|
consumeParticipantsMessage(): string | null;
|
|
141
135
|
consumeContactsMessage(): string | null;
|
|
142
136
|
getHydratedHistory(excludeMessageId?: string): Promise<MetadataMap[]>;
|
|
143
137
|
hydrateContext(forceRefresh?: boolean): Promise<ConversationContext>;
|
|
144
|
-
private replaceParticipants;
|
|
145
138
|
private buildLocalContext;
|
|
146
139
|
private loadParticipants;
|
|
147
140
|
private loadHydratedMessages;
|
|
@@ -158,8 +151,8 @@ interface PlatformRuntimeOptions {
|
|
|
158
151
|
apiKey: string;
|
|
159
152
|
wsUrl?: string;
|
|
160
153
|
restUrl?: string;
|
|
161
|
-
link?:
|
|
162
|
-
linkOptions?: Omit<
|
|
154
|
+
link?: BandLink;
|
|
155
|
+
linkOptions?: Omit<BandLinkOptions, "agentId" | "apiKey">;
|
|
163
156
|
preprocessor?: Preprocessor<PlatformEvent>;
|
|
164
157
|
sessionConfig?: SessionConfig;
|
|
165
158
|
contactConfig?: ContactEventConfig;
|
|
@@ -200,7 +193,7 @@ declare class PlatformRuntime {
|
|
|
200
193
|
private _agentDescription;
|
|
201
194
|
private contactsSubscribed;
|
|
202
195
|
constructor(options: PlatformRuntimeOptions);
|
|
203
|
-
get link():
|
|
196
|
+
get link(): BandLink;
|
|
204
197
|
get name(): string;
|
|
205
198
|
get agentId(): string;
|
|
206
199
|
get description(): string;
|
|
@@ -218,7 +211,7 @@ declare class PlatformRuntime {
|
|
|
218
211
|
}
|
|
219
212
|
|
|
220
213
|
interface AgentRuntimeOptions {
|
|
221
|
-
link:
|
|
214
|
+
link: BandLink;
|
|
222
215
|
agentId: string;
|
|
223
216
|
onExecute: (context: ExecutionContext, event: PlatformEvent) => Promise<void>;
|
|
224
217
|
onSessionCleanup?: (roomId: string) => Promise<void>;
|
|
@@ -284,7 +277,7 @@ declare class DefaultPreprocessor implements Preprocessor<PlatformEvent> {
|
|
|
284
277
|
}
|
|
285
278
|
|
|
286
279
|
declare const TOOL_MODELS: {
|
|
287
|
-
readonly
|
|
280
|
+
readonly band_send_message: {
|
|
288
281
|
readonly description: string;
|
|
289
282
|
readonly properties: {
|
|
290
283
|
readonly content: {
|
|
@@ -302,7 +295,7 @@ declare const TOOL_MODELS: {
|
|
|
302
295
|
};
|
|
303
296
|
readonly required: readonly ["content", "mentions"];
|
|
304
297
|
};
|
|
305
|
-
readonly
|
|
298
|
+
readonly band_send_event: {
|
|
306
299
|
readonly description: string;
|
|
307
300
|
readonly properties: {
|
|
308
301
|
readonly content: {
|
|
@@ -321,12 +314,12 @@ declare const TOOL_MODELS: {
|
|
|
321
314
|
};
|
|
322
315
|
readonly required: readonly ["content", "message_type"];
|
|
323
316
|
};
|
|
324
|
-
readonly
|
|
317
|
+
readonly band_add_participant: {
|
|
325
318
|
readonly description: string;
|
|
326
319
|
readonly properties: {
|
|
327
320
|
readonly name: {
|
|
328
321
|
readonly type: "string";
|
|
329
|
-
readonly description: "Name of participant to add (must match a name from
|
|
322
|
+
readonly description: "Name of participant to add (must match a name from band_lookup_peers).";
|
|
330
323
|
};
|
|
331
324
|
readonly role: {
|
|
332
325
|
readonly type: "string";
|
|
@@ -336,7 +329,7 @@ declare const TOOL_MODELS: {
|
|
|
336
329
|
};
|
|
337
330
|
readonly required: readonly ["name"];
|
|
338
331
|
};
|
|
339
|
-
readonly
|
|
332
|
+
readonly band_remove_participant: {
|
|
340
333
|
readonly description: "Remove a participant from the chat room by name.";
|
|
341
334
|
readonly properties: {
|
|
342
335
|
readonly name: {
|
|
@@ -346,12 +339,12 @@ declare const TOOL_MODELS: {
|
|
|
346
339
|
};
|
|
347
340
|
readonly required: readonly ["name"];
|
|
348
341
|
};
|
|
349
|
-
readonly
|
|
342
|
+
readonly band_get_participants: {
|
|
350
343
|
readonly description: "Get a list of all participants in the current chat room.";
|
|
351
344
|
readonly properties: {};
|
|
352
345
|
readonly required: readonly [];
|
|
353
346
|
};
|
|
354
|
-
readonly
|
|
347
|
+
readonly band_lookup_peers: {
|
|
355
348
|
readonly description: string;
|
|
356
349
|
readonly properties: {
|
|
357
350
|
readonly page: {
|
|
@@ -366,7 +359,7 @@ declare const TOOL_MODELS: {
|
|
|
366
359
|
};
|
|
367
360
|
readonly required: readonly [];
|
|
368
361
|
};
|
|
369
|
-
readonly
|
|
362
|
+
readonly band_create_chatroom: {
|
|
370
363
|
readonly description: "Create a new chat room for a specific task or conversation.";
|
|
371
364
|
readonly properties: {
|
|
372
365
|
readonly task_id: {
|
|
@@ -376,7 +369,7 @@ declare const TOOL_MODELS: {
|
|
|
376
369
|
};
|
|
377
370
|
readonly required: readonly [];
|
|
378
371
|
};
|
|
379
|
-
readonly
|
|
372
|
+
readonly band_list_contacts: {
|
|
380
373
|
readonly description: "List agent's contacts with pagination.";
|
|
381
374
|
readonly properties: {
|
|
382
375
|
readonly page: {
|
|
@@ -393,7 +386,7 @@ declare const TOOL_MODELS: {
|
|
|
393
386
|
};
|
|
394
387
|
readonly required: readonly [];
|
|
395
388
|
};
|
|
396
|
-
readonly
|
|
389
|
+
readonly band_add_contact: {
|
|
397
390
|
readonly description: string;
|
|
398
391
|
readonly properties: {
|
|
399
392
|
readonly handle: {
|
|
@@ -407,7 +400,7 @@ declare const TOOL_MODELS: {
|
|
|
407
400
|
};
|
|
408
401
|
readonly required: readonly ["handle"];
|
|
409
402
|
};
|
|
410
|
-
readonly
|
|
403
|
+
readonly band_remove_contact: {
|
|
411
404
|
readonly description: "Remove an existing contact by handle or ID.";
|
|
412
405
|
readonly properties: {
|
|
413
406
|
readonly handle: {
|
|
@@ -421,7 +414,7 @@ declare const TOOL_MODELS: {
|
|
|
421
414
|
};
|
|
422
415
|
readonly required: readonly [];
|
|
423
416
|
};
|
|
424
|
-
readonly
|
|
417
|
+
readonly band_list_contact_requests: {
|
|
425
418
|
readonly description: string;
|
|
426
419
|
readonly properties: {
|
|
427
420
|
readonly page: {
|
|
@@ -443,7 +436,7 @@ declare const TOOL_MODELS: {
|
|
|
443
436
|
};
|
|
444
437
|
readonly required: readonly [];
|
|
445
438
|
};
|
|
446
|
-
readonly
|
|
439
|
+
readonly band_respond_contact_request: {
|
|
447
440
|
readonly description: string;
|
|
448
441
|
readonly properties: {
|
|
449
442
|
readonly action: {
|
|
@@ -462,7 +455,7 @@ declare const TOOL_MODELS: {
|
|
|
462
455
|
};
|
|
463
456
|
readonly required: readonly ["action"];
|
|
464
457
|
};
|
|
465
|
-
readonly
|
|
458
|
+
readonly band_list_memories: {
|
|
466
459
|
readonly description: string;
|
|
467
460
|
readonly properties: {
|
|
468
461
|
readonly subject_id: {
|
|
@@ -476,7 +469,7 @@ declare const TOOL_MODELS: {
|
|
|
476
469
|
};
|
|
477
470
|
readonly system: {
|
|
478
471
|
readonly type: "string";
|
|
479
|
-
readonly enum: readonly
|
|
472
|
+
readonly enum: readonly ("sensory" | "working" | "long_term")[];
|
|
480
473
|
readonly description: "Filter by memory system.";
|
|
481
474
|
};
|
|
482
475
|
readonly type: {
|
|
@@ -507,7 +500,7 @@ declare const TOOL_MODELS: {
|
|
|
507
500
|
};
|
|
508
501
|
readonly required: readonly [];
|
|
509
502
|
};
|
|
510
|
-
readonly
|
|
503
|
+
readonly band_store_memory: {
|
|
511
504
|
readonly description: string;
|
|
512
505
|
readonly properties: {
|
|
513
506
|
readonly content: {
|
|
@@ -516,7 +509,7 @@ declare const TOOL_MODELS: {
|
|
|
516
509
|
};
|
|
517
510
|
readonly system: {
|
|
518
511
|
readonly type: "string";
|
|
519
|
-
readonly enum: readonly
|
|
512
|
+
readonly enum: readonly ("sensory" | "working" | "long_term")[];
|
|
520
513
|
readonly description: "Memory system tier.";
|
|
521
514
|
};
|
|
522
515
|
readonly type: {
|
|
@@ -549,7 +542,7 @@ declare const TOOL_MODELS: {
|
|
|
549
542
|
};
|
|
550
543
|
readonly required: readonly ["content", "system", "type", "segment", "thought"];
|
|
551
544
|
};
|
|
552
|
-
readonly
|
|
545
|
+
readonly band_get_memory: {
|
|
553
546
|
readonly description: "Retrieve a specific memory by ID.";
|
|
554
547
|
readonly properties: {
|
|
555
548
|
readonly memory_id: {
|
|
@@ -559,7 +552,7 @@ declare const TOOL_MODELS: {
|
|
|
559
552
|
};
|
|
560
553
|
readonly required: readonly ["memory_id"];
|
|
561
554
|
};
|
|
562
|
-
readonly
|
|
555
|
+
readonly band_supersede_memory: {
|
|
563
556
|
readonly description: string;
|
|
564
557
|
readonly properties: {
|
|
565
558
|
readonly memory_id: {
|
|
@@ -569,7 +562,7 @@ declare const TOOL_MODELS: {
|
|
|
569
562
|
};
|
|
570
563
|
readonly required: readonly ["memory_id"];
|
|
571
564
|
};
|
|
572
|
-
readonly
|
|
565
|
+
readonly band_archive_memory: {
|
|
573
566
|
readonly description: string;
|
|
574
567
|
readonly properties: {
|
|
575
568
|
readonly memory_id: {
|
|
@@ -585,8 +578,10 @@ declare const MEMORY_TOOL_NAMES: Set<string>;
|
|
|
585
578
|
declare const CONTACT_TOOL_NAMES: Set<string>;
|
|
586
579
|
declare const BASE_TOOL_NAMES: Set<string>;
|
|
587
580
|
declare const CHAT_TOOL_NAMES: Set<string>;
|
|
588
|
-
declare const MCP_TOOL_PREFIX = "
|
|
581
|
+
declare const MCP_TOOL_PREFIX = "mcp__band__";
|
|
582
|
+
/** The single Band MCP server name; owns every server-name default and integration. */
|
|
583
|
+
declare const MCP_SERVER_NAME = "band";
|
|
589
584
|
declare function mcpToolNames(names: Set<string>): string[];
|
|
590
585
|
declare function getToolDescription(name: string): string;
|
|
591
586
|
|
|
592
|
-
export { AgentRuntime as A,
|
|
587
|
+
export { AgentRuntime as A, BandLink as B, CHAT_TOOL_NAMES as C, DefaultPreprocessor as D, type ExecutionContextOptions as E, MCP_SERVER_NAME as M, PlatformRuntime as P, TOOL_MODELS as T, type PlatformRuntimeOptions as a, MCP_TOOL_PREFIX as b, ExecutionContext as c, deriveDefaultRestUrl as d, ALL_TOOL_NAMES as e, BASE_TOOL_NAMES as f, CONTACT_TOOL_NAMES as g, type ExecutionState as h, MEMORY_TOOL_NAMES as i, getToolDescription as j, mcpToolNames as m };
|