@band-ai/sdk 0.3.4 → 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.
Files changed (97) hide show
  1. package/README.md +54 -1
  2. package/dist/{ClaudeSDKAdapter-CXud2DBE.d.ts → CopilotACPAdapter-BCpbHFB0.d.ts} +240 -19
  3. package/dist/{ClaudeSDKAdapter-Cx6zhSaG.d.cts → CopilotACPAdapter-D4VWg8lJ.d.cts} +240 -19
  4. package/dist/{opencode-2YdscIc1.d.cts → acp-client-D-I_5lK-.d.cts} +23 -4
  5. package/dist/{opencode-Bld62x5t.d.ts → acp-client-DUXyczlF.d.ts} +23 -4
  6. package/dist/acp-server-BlcYMxKt.d.ts +17 -0
  7. package/dist/acp-server-CJhclo6P.d.cts +17 -0
  8. package/dist/adapters.cjs +2205 -969
  9. package/dist/adapters.d.cts +21 -132
  10. package/dist/adapters.d.ts +21 -132
  11. package/dist/adapters.js +26 -1922
  12. package/dist/{backends-D-dBdDm-.d.ts → backends-CgsPQa9B.d.ts} +2 -2
  13. package/dist/{backends-ZLxmQrTZ.d.cts → backends-Dh2WXcHQ.d.cts} +2 -2
  14. package/dist/{chunk-JY75VSQK.js → chunk-4OVNFDD7.js} +14 -1
  15. package/dist/chunk-6BE2EG5P.js +128 -0
  16. package/dist/{chunk-U6AFCLYZ.js → chunk-6TGXV5TE.js} +1824 -514
  17. package/dist/{chunk-OH6VVVKT.js → chunk-CBCHTTUY.js} +10 -0
  18. package/dist/{chunk-K5KAEYPF.js → chunk-HNWZZXAE.js} +288 -120
  19. package/dist/chunk-I34SXMTJ.js +6 -0
  20. package/dist/{chunk-XWHWJP4I.js → chunk-JDW5WSGF.js} +2 -2
  21. package/dist/{chunk-KXJ74J73.js → chunk-JIZE4EC6.js} +4 -10
  22. package/dist/chunk-OGOXY43L.js +119 -0
  23. package/dist/{chunk-W5IAI6Z4.js → chunk-OVXVZUPO.js} +5 -5
  24. package/dist/{chunk-YJ42AZO4.js → chunk-RJNJUISR.js} +5 -2
  25. package/dist/{chunk-MQY74R7D.js → chunk-SHZBLLDQ.js} +21 -9
  26. package/dist/{chunk-JADCAMZY.js → chunk-TGDDFBYS.js} +45 -0
  27. package/dist/{chunk-US226AS4.js → chunk-UENIC5FJ.js} +14 -11
  28. package/dist/{chunk-WA7CHXUS.js → chunk-UL3Y5C4J.js} +2 -2
  29. package/dist/{chunk-WL2HNJZ6.js → chunk-VOMJRQOM.js} +3 -3
  30. package/dist/{chunk-MQBBWYRP.js → chunk-YF7K4UB3.js} +3352 -572
  31. package/dist/{chunk-OD2G5LFQ.js → chunk-ZYOXI4JL.js} +41 -2
  32. package/dist/config.cjs +2 -12
  33. package/dist/config.js +2 -2
  34. package/dist/converters.cjs +36 -11
  35. package/dist/converters.d.cts +7 -5
  36. package/dist/converters.d.ts +7 -5
  37. package/dist/converters.js +11 -13
  38. package/dist/core.cjs +239 -5
  39. package/dist/core.d.cts +71 -6
  40. package/dist/core.d.ts +71 -6
  41. package/dist/core.js +31 -6
  42. package/dist/{customTools-BzF0IISO.d.cts → customTools-Bfecd0mJ.d.cts} +1 -1
  43. package/dist/{customTools-BzF0IISO.d.ts → customTools-Bfecd0mJ.d.ts} +1 -1
  44. package/dist/{disconnectReason-IuADl6TH.d.ts → disconnectReason-Cctmg1SN.d.cts} +1 -1
  45. package/dist/{disconnectReason-IuADl6TH.d.cts → disconnectReason-Cctmg1SN.d.ts} +1 -1
  46. package/dist/{dtos-B8KU_q4d.d.ts → dtos-CjQsN1_h.d.cts} +5 -12
  47. package/dist/{dtos-B8KU_q4d.d.cts → dtos-CjQsN1_h.d.ts} +5 -12
  48. package/dist/index.cjs +5237 -1474
  49. package/dist/index.d.cts +61 -22
  50. package/dist/index.d.ts +61 -22
  51. package/dist/index.js +151 -43
  52. package/dist/linear.cjs +45 -7
  53. package/dist/linear.d.cts +4 -3
  54. package/dist/linear.d.ts +4 -3
  55. package/dist/linear.js +10 -10
  56. package/dist/mcp-claude.cjs +11 -6
  57. package/dist/mcp-claude.d.cts +4 -3
  58. package/dist/mcp-claude.d.ts +4 -3
  59. package/dist/mcp-claude.js +4 -5
  60. package/dist/mcp.cjs +13 -7
  61. package/dist/mcp.d.cts +6 -5
  62. package/dist/mcp.d.ts +6 -5
  63. package/dist/mcp.js +5 -6
  64. package/dist/{pagination-DqdkQArT.d.cts → pagination-BZDhB_nO.d.cts} +2 -2
  65. package/dist/{pagination-BgEx-HeL.d.ts → pagination-CPz0J_vQ.d.ts} +2 -2
  66. package/dist/{protocols-Bz1rxcUg.d.cts → protocols-CabgO52c.d.cts} +38 -3
  67. package/dist/{protocols-Bwwcql0h.d.ts → protocols-Dpci6uae.d.ts} +38 -3
  68. package/dist/rest.cjs +43 -1
  69. package/dist/rest.d.cts +6 -5
  70. package/dist/rest.d.ts +6 -5
  71. package/dist/rest.js +6 -5
  72. package/dist/runtime.cjs +2113 -597
  73. package/dist/runtime.d.cts +44 -25
  74. package/dist/runtime.d.ts +44 -25
  75. package/dist/runtime.js +11 -11
  76. package/dist/{schemas-BgJhlqqO.d.cts → schemas-BKnh4fKR.d.cts} +209 -24
  77. package/dist/{schemas-C4mK1WSs.d.ts → schemas-CDa3V_I5.d.ts} +209 -24
  78. package/dist/{sdk-BTciSLRQ.d.cts → sdk-CXNqzoY1.d.cts} +1 -1
  79. package/dist/{sdk-qKJtMma_.d.ts → sdk-Cin80BTC.d.ts} +1 -1
  80. package/dist/{simpleAdapter-BpT4XbZC.d.cts → simpleAdapter-D75rcz9n.d.cts} +3 -1
  81. package/dist/{simpleAdapter--wznuoOw.d.ts → simpleAdapter-eLvsAQNo.d.ts} +3 -1
  82. package/dist/testing.cjs +25 -7
  83. package/dist/testing.d.cts +5 -3
  84. package/dist/testing.d.ts +5 -3
  85. package/dist/testing.js +9 -6
  86. package/dist/{types-BivGO7I9.d.ts → types-42-HWeX8.d.cts} +10 -4
  87. package/dist/types-CKU1N0SK.d.ts +137 -0
  88. package/dist/{types-BgYFd_Yw.d.cts → types-CjxZekMH.d.ts} +10 -4
  89. package/dist/types-DtcOLALn.d.cts +137 -0
  90. package/package.json +25 -26
  91. package/dist/acp-server-CiUqN3G3.d.ts +0 -24
  92. package/dist/acp-server-Dlj7D563.d.cts +0 -24
  93. package/dist/chunk-AVVDPXP4.js +0 -39
  94. package/dist/chunk-F63TPOI3.js +0 -29
  95. package/dist/chunk-V5TSWS7P.js +0 -62
  96. package/dist/types-BNNtOXu3.d.cts +0 -446
  97. package/dist/types-DFUtpxah.d.ts +0 -446
@@ -1,22 +1,52 @@
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, g as MessageEvent, h as ParticipantAddedEvent, i as ParticipantRemovedEvent, C as ContactEvent, a as AgentInput } from './types-BNNtOXu3.cjs';
3
- import { M as MetadataMap, P as ParticipantRecord } from './dtos-B8KU_q4d.cjs';
1
+ import { j as AgentToolsCapabilities, P as PlatformMessageLike, A as AdapterToolsProtocol, h as Preprocessor, F as FrameworkAdapter, q as PreprocessorContext } from './protocols-CabgO52c.cjs';
2
+ import { f as PlatformEvent, P as PlatformMessage, e as ConversationContext, S as SessionConfig, c as ContactEventConfig, A as AgentConfig, g as MessageEvent, l as ParticipantAddedEvent, m as ParticipantRemovedEvent, R as ReconnectedEvent, C as ContactEvent, a as AgentInput } from './types-DtcOLALn.cjs';
3
+ import { M as MetadataMap, g as ParticipantRecord } from './dtos-CjQsN1_h.cjs';
4
4
  import { L as Logger } from './logger-CABQOnlR.cjs';
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';
5
+ import { B as BandLinkRestApi, b as RestRequestOptions, P as PaginatedResponse, e as AgentToolsRestApi } from './types-42-HWeX8.cjs';
6
+ import { P as PaginationOptions } from './pagination-BZDhB_nO.cjs';
7
+ import { W as WebSocketConflictPolicy, b as WebSocketDisconnectReason } from './disconnectReason-Cctmg1SN.cjs';
8
+ import * as _band_ai_band_sdk_core from '@band-ai/band-sdk-core';
8
9
  import { RetryTracker, RoomRoster } from '@band-ai/band-sdk-core';
9
10
 
10
11
  interface TopicHandlers {
11
12
  [event: string]: (payload: Record<string, unknown>) => Promise<void> | void;
12
13
  }
14
+ interface JoinOptions {
15
+ /**
16
+ * Exempts this topic's event delivery from any reconnect-buffering window
17
+ * a transport may hold events behind. Only a channel whose events must
18
+ * never wait on reconciliation (e.g. a control channel carrying session
19
+ * supersede notices) should set this.
20
+ */
21
+ exemptFromBuffering?: boolean;
22
+ }
23
+ /**
24
+ * One settled outcome of an automatic transport-level reconnect: every topic
25
+ * the transport owned when the socket reopened has since either rejoined or
26
+ * failed to. `attemptedTopics` fixes that generation's membership boundary;
27
+ * `joinedTopics` is its successful subset. Carries no transport-specific
28
+ * objects so every transport implementation can produce one.
29
+ */
30
+ interface ReconnectSnapshot {
31
+ generation: number;
32
+ attemptedTopics: ReadonlySet<string>;
33
+ joinedTopics: ReadonlySet<string>;
34
+ }
35
+ type ReconnectObserver = (snapshot: ReconnectSnapshot) => Promise<void> | void;
13
36
  interface StreamingTransport {
14
37
  connect(): Promise<void>;
15
38
  disconnect(): Promise<void>;
16
- join(topic: string, handlers: TopicHandlers): Promise<void>;
39
+ join(topic: string, handlers: TopicHandlers, options?: JoinOptions): Promise<void>;
17
40
  leave(topic: string): Promise<void>;
18
41
  runForever(signal: AbortSignal): Promise<void>;
19
42
  isConnected(): boolean;
43
+ /**
44
+ * Optional: a transport that can observe its own automatic reconnects
45
+ * registers here. Omitted by transports (and test doubles) with no
46
+ * reconnect story of their own, so existing injected transports stay
47
+ * source-compatible. Returns an unsubscribe function.
48
+ */
49
+ onReconnected?(observer: ReconnectObserver): () => void;
20
50
  }
21
51
 
22
52
  interface BandLinkOptions {
@@ -43,17 +73,22 @@ declare class BandLink implements AsyncIterable<PlatformEvent> {
43
73
  readonly capabilities: AgentToolsCapabilities;
44
74
  private readonly logger;
45
75
  private readonly transport;
46
- private readonly subscribedRooms;
76
+ private readonly subscriptionManager;
47
77
  private readonly eventQueue;
48
78
  private readonly waiters;
49
79
  private connected;
50
80
  private lastDisconnectReason;
51
81
  private terminalDisconnectError;
82
+ private readonly connectFlight;
83
+ private readonly disconnectFlight;
84
+ private readonly session;
52
85
  constructor(options: BandLinkOptions);
53
86
  isConnected(): boolean;
54
87
  getDisconnectReason(): WebSocketDisconnectReason | null;
55
88
  connect(): Promise<void>;
89
+ private connectSession;
56
90
  disconnect(): Promise<void>;
91
+ private disconnectSession;
57
92
  runForever(signal: AbortSignal): Promise<void>;
58
93
  private recordDisconnectReason;
59
94
  private recordDisconnectError;
@@ -61,7 +96,6 @@ declare class BandLink implements AsyncIterable<PlatformEvent> {
61
96
  subscribeAgentRooms(): Promise<void>;
62
97
  subscribeRoom(roomId: string): Promise<void>;
63
98
  unsubscribeRoom(roomId: string): Promise<void>;
64
- private joinRoomTopics;
65
99
  subscribeAgentContacts(): Promise<void>;
66
100
  unsubscribeAgentContacts(): Promise<void>;
67
101
  nextEvent(signal?: AbortSignal): Promise<PlatformEvent | null>;
@@ -80,6 +114,13 @@ declare class BandLink implements AsyncIterable<PlatformEvent> {
80
114
  private emit;
81
115
  }
82
116
 
117
+ /**
118
+ * Per-turn activity indicator for a room's context.
119
+ *
120
+ * Not a lifecycle — see `ExecutionLifecycleState` in `runtime/lifecycle.ts` for
121
+ * whether the room's `Execution` is alive. The two vocabularies deliberately do
122
+ * not overlap.
123
+ */
83
124
  type ExecutionState = "starting" | "idle" | "processing";
84
125
  interface ExecutionContextLink {
85
126
  rest: AgentToolsRestApi;
@@ -117,6 +158,17 @@ declare class ExecutionContext {
117
158
  private _llmInitialized;
118
159
  private readonly _pendingSystemMessages;
119
160
  constructor(options: ExecutionContextOptions);
161
+ /**
162
+ * What this room's turn handler is currently doing.
163
+ *
164
+ * This is the *per-turn activity* axis, not a lifecycle: it flips to
165
+ * `"processing"` while the adapter handles an event and back to `"idle"`
166
+ * afterwards. To ask whether the room's `Execution` is still alive at all,
167
+ * read `Execution.state` instead, which reports
168
+ * `"running" | "stopping" | "stopped" | "failed"`.
169
+ *
170
+ * @see Execution.state
171
+ */
120
172
  get state(): ExecutionState;
121
173
  setState(state: ExecutionState): void;
122
174
  getRetryTracker(): RetryTracker;
@@ -147,6 +199,66 @@ declare class ExecutionContext {
147
199
  private trackDedup;
148
200
  }
149
201
 
202
+ /**
203
+ * Lifecycle of a startable/stoppable runtime owner.
204
+ *
205
+ * Shared by {@link Agent}, {@link PlatformRuntime} and {@link AgentRuntime}: the
206
+ * three components that expose an explicit `start()`/`stop()` pair.
207
+ *
208
+ * This describes whether the component is *alive*, not what it is currently
209
+ * doing for a single turn — see `ExecutionState` in `ExecutionContext.ts` for
210
+ * that other axis.
211
+ *
212
+ * Legal transitions:
213
+ *
214
+ * ```text
215
+ * not_started ─▶ starting ─▶ running ─▶ stopping ─▶ stopped ─┐
216
+ * │ │ │ │
217
+ * └───────────┴──────────┴──▶ failed ─────┤
218
+ * │
219
+ * starting ◀──────────────────────────────┘
220
+ * ```
221
+ *
222
+ * `stopped` and `failed` are re-startable: a subsequent `start()` moves back to
223
+ * `starting`, which is what makes a previously failed teardown recoverable.
224
+ */
225
+ type RuntimeLifecycleState = {
226
+ readonly status: "not_started";
227
+ } | {
228
+ readonly status: "starting";
229
+ } | {
230
+ readonly status: "running";
231
+ } | {
232
+ readonly status: "stopping";
233
+ } | {
234
+ readonly status: "stopped";
235
+ } | {
236
+ readonly status: "failed";
237
+ readonly error: Error;
238
+ };
239
+ /**
240
+ * Lifecycle of a single room's {@link Execution}.
241
+ *
242
+ * Narrower than {@link RuntimeLifecycleState} on purpose: an `Execution` starts
243
+ * processing in its constructor, so it can never occupy a `not_started` or
244
+ * `starting` state, and it is never restarted. Its state names deliberately do
245
+ * not overlap with `ExecutionState` (`"starting" | "idle" | "processing"`) so a
246
+ * bare status string is always attributable to one axis or the other.
247
+ */
248
+ type ExecutionLifecycleState = {
249
+ readonly status: "running";
250
+ } | {
251
+ readonly status: "stopping";
252
+ }
253
+ /** `graceful` is `false` when `stop(timeoutMs)` timed out and detached the process loop. */
254
+ | {
255
+ readonly status: "stopped";
256
+ readonly graceful: boolean;
257
+ } | {
258
+ readonly status: "failed";
259
+ readonly error: Error;
260
+ };
261
+
150
262
  interface PlatformRuntimeOptions {
151
263
  agentId: string;
152
264
  apiKey: string;
@@ -184,27 +296,60 @@ declare class PlatformRuntime implements AsyncDisposable {
184
296
  private readonly _onParticipantRemoved?;
185
297
  private readonly _roomFilter?;
186
298
  private readonly _contextFactory?;
299
+ private readonly lifecycle;
187
300
  private linkInstance?;
188
301
  private initPromise;
189
302
  private runtime?;
190
303
  private contactHandler?;
191
304
  private activeAdapter?;
192
- private stopping;
305
+ private readonly startGate;
306
+ private readonly stopGate;
193
307
  private _agentName;
194
308
  private _agentDescription;
195
309
  private contactsSubscribed;
196
310
  constructor(options: PlatformRuntimeOptions);
311
+ /** Current lifecycle state of this runtime. */
312
+ get state(): RuntimeLifecycleState;
197
313
  get link(): BandLink;
198
314
  get name(): string;
199
315
  get agentId(): string;
200
316
  get description(): string;
201
317
  get contactConfiguration(): ContactEventConfig | undefined;
318
+ /**
319
+ * Whether the contacts channel subscription is currently held.
320
+ *
321
+ * @deprecated Read {@link PlatformRuntime.state} for lifecycle questions: this
322
+ * flag is only ever `true` while the runtime is running and is cleared on
323
+ * teardown, so it conflates "contacts are subscribed" with "the runtime is
324
+ * alive".
325
+ */
202
326
  get isContactsSubscribed(): boolean;
203
327
  initialize(): Promise<void>;
204
328
  private doInitialize;
329
+ /**
330
+ * Connect the adapter to the platform.
331
+ *
332
+ * Repeated or concurrent calls join the in-flight start. Calling `start()`
333
+ * while a `stop()` is still in flight rejects with a {@link RuntimeStateError}.
334
+ * A successful start also re-arms teardown, so a runtime whose previous
335
+ * `stop()` failed can be shut down properly on the next attempt.
336
+ */
205
337
  start(adapter: FrameworkAdapter): Promise<void>;
338
+ private runStart;
339
+ private doStart;
340
+ /**
341
+ * Tear the runtime down and release the platform connection.
342
+ *
343
+ * A concurrent second call joins the in-flight teardown and mirrors its
344
+ * outcome — including rejecting with the *same* `Error` instance — rather than
345
+ * reporting a graceful shutdown it did not perform. A failed teardown does not
346
+ * disable future ones: a subsequent `start()` re-arms `stop()`.
347
+ */
206
348
  stop(timeoutMs?: number): Promise<boolean>;
349
+ private beginStop;
350
+ private runStop;
207
351
  [Symbol.asyncDispose](): Promise<void>;
352
+ private recordStopFailure;
208
353
  runForever(): Promise<void>;
209
354
  bootstrapRoomMessage(roomId: string, message: PlatformMessage): Promise<void>;
210
355
  resetRoomSession(roomId: string, timeoutMs?: number): Promise<boolean>;
@@ -220,7 +365,7 @@ interface RoomPresenceOptions {
220
365
  }
221
366
  type RoomPresenceJoinHandler = (roomId: string, payload: MetadataMap) => Promise<void>;
222
367
  type RoomPresenceLeaveHandler = (roomId: string) => Promise<void>;
223
- type RoomPresenceEventHandler = (roomId: string, event: MessageEvent | ParticipantAddedEvent | ParticipantRemovedEvent) => Promise<void>;
368
+ type RoomPresenceEventHandler = (roomId: string, event: MessageEvent | ParticipantAddedEvent | ParticipantRemovedEvent | ReconnectedEvent) => Promise<void>;
224
369
  type RoomPresenceContactHandler = (event: ContactEvent) => Promise<void>;
225
370
  declare class RoomPresence implements AsyncDisposable {
226
371
  readonly roster: RoomRoster;
@@ -235,7 +380,7 @@ declare class RoomPresence implements AsyncDisposable {
235
380
  private eventController;
236
381
  private eventTask;
237
382
  private contactsSubscribed;
238
- private lifecycle;
383
+ private readonly lifecycle;
239
384
  private readonly admissionInFlight;
240
385
  private readonly lastSubscribeError;
241
386
  constructor(options: RoomPresenceOptions);
@@ -250,13 +395,24 @@ declare class RoomPresence implements AsyncDisposable {
250
395
  private awaitInFlightAdmission;
251
396
  private performAdmission;
252
397
  private completeAdmission;
253
- private serialize;
254
398
  private startBody;
399
+ private contextualWarnMessage;
400
+ private subscribeAgentRoomsChannel;
255
401
  private subscribeContacts;
256
402
  private stopBody;
257
403
  private consumeEvents;
258
404
  private handleRoomAdded;
259
405
  private handleRoomRemoved;
406
+ /** Unsubscribes the transport topic and clears any remembered subscribe failure for `roomId`. */
407
+ private leaveRoomTracking;
408
+ /**
409
+ * A REST fetch failure here must not blank the roster — it forwards the
410
+ * reconnect to every currently tracked room regardless, so each room's
411
+ * `Execution` can still re-run its `/next` synchronization even when
412
+ * membership reconciliation itself has to wait for the next reconnect.
413
+ */
414
+ private handleReconnected;
415
+ private reconcileRoomsWithSnapshot;
260
416
  private unsubscribeRoom;
261
417
  private subscribeExistingRooms;
262
418
  }
@@ -296,15 +452,44 @@ declare class AgentRuntime {
296
452
  private readonly executions;
297
453
  private readonly executionWatchers;
298
454
  private readonly logger;
299
- private running;
300
- private stopping;
301
- private fatalError;
455
+ private readonly stoppedSignal;
456
+ private readonly lifecycle;
457
+ private readonly startGate;
458
+ private readonly stopGate;
302
459
  constructor(options: AgentRuntimeOptions);
460
+ /** Current lifecycle state of this runtime. */
461
+ get state(): RuntimeLifecycleState;
462
+ /**
463
+ * Connect, subscribe, and begin consuming platform events.
464
+ *
465
+ * Repeated or concurrent calls join the in-flight start instead of starting a
466
+ * second consume loop. Calling `start()` while a `stop()` is still in flight
467
+ * rejects with a `RuntimeStateError`.
468
+ */
303
469
  start(): Promise<void>;
470
+ private runStart;
471
+ private finishFailedStart;
304
472
  private handleStartFailure;
473
+ /**
474
+ * Tear the runtime down.
475
+ *
476
+ * A concurrent second call joins the in-flight teardown and mirrors its
477
+ * outcome — including rejecting with the *same* `Error` instance — instead of
478
+ * reporting a shutdown it did not perform.
479
+ */
305
480
  stop(timeoutMs?: number): Promise<boolean>;
481
+ private runStop;
482
+ private performStop;
306
483
  getContext(roomId: string): ExecutionContext | undefined;
484
+ /**
485
+ * Resolve once the runtime has actually stopped, or reject with the fatal
486
+ * error that ended it.
487
+ *
488
+ * A runtime that was never started stays pending until it stops or fails;
489
+ * starting it does not resolve a pending wait.
490
+ */
307
491
  waitUntilStopped(): Promise<void>;
492
+ private markFailed;
308
493
  getContexts(): ExecutionContext[];
309
494
  enqueueEvent(roomId: string, event: PlatformEvent): Promise<void>;
310
495
  bootstrapRoomMessage(roomId: string, message: PlatformMessage): Promise<void>;
@@ -508,12 +693,12 @@ declare const TOOL_MODELS: {
508
693
  };
509
694
  readonly scope: {
510
695
  readonly type: "string";
511
- readonly enum: readonly ["subject", "organization", "all"];
512
- readonly description: "Filter by scope.";
696
+ readonly enum: readonly ["agent", "subject", "organization", "all"];
697
+ readonly description: string;
513
698
  };
514
699
  readonly system: {
515
700
  readonly type: "string";
516
- readonly enum: readonly ("sensory" | "working" | "long_term")[];
701
+ readonly enum: readonly _band_ai_band_sdk_core.MemorySystem[];
517
702
  readonly description: "Filter by memory system.";
518
703
  };
519
704
  readonly type: {
@@ -553,7 +738,7 @@ declare const TOOL_MODELS: {
553
738
  };
554
739
  readonly system: {
555
740
  readonly type: "string";
556
- readonly enum: readonly ("sensory" | "working" | "long_term")[];
741
+ readonly enum: readonly _band_ai_band_sdk_core.MemorySystem[];
557
742
  readonly description: "Memory system tier.";
558
743
  };
559
744
  readonly type: {
@@ -572,12 +757,12 @@ declare const TOOL_MODELS: {
572
757
  };
573
758
  readonly scope: {
574
759
  readonly type: "string";
575
- readonly enum: readonly ["subject", "organization"];
576
- readonly description: "Visibility scope.";
760
+ readonly enum: readonly ["agent", "subject", "organization"];
761
+ readonly description: string;
577
762
  };
578
763
  readonly subject_id: {
579
764
  readonly type: "string";
580
- readonly description: "UUID of the subject this memory is about (required for subject scope).";
765
+ readonly description: "UUID of the subject this memory is about (required for subject scope; omit for agent scope).";
581
766
  };
582
767
  readonly metadata: {
583
768
  readonly type: "object";
@@ -628,4 +813,4 @@ declare const MCP_SERVER_NAME = "band";
628
813
  declare function mcpToolNames(names: Set<string>): string[];
629
814
  declare function getToolDescription(name: string): string;
630
815
 
631
- 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, RoomPresence as R, 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 };
816
+ 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, type RuntimeLifecycleState as R, TOOL_MODELS as T, type PlatformRuntimeOptions as a, type ExecutionLifecycleState as b, MCP_TOOL_PREFIX as c, deriveDefaultRestUrl as d, ExecutionContext as e, ALL_TOOL_NAMES as f, BASE_TOOL_NAMES as g, CONTACT_TOOL_NAMES as h, type ExecutionState as i, MEMORY_TOOL_NAMES as j, RoomPresence as k, getToolDescription as l, mcpToolNames as m };