@amigo-ai/platform-sdk 0.23.0 → 0.25.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/api.md +8 -2
- package/dist/core/errors.js +155 -9
- package/dist/core/errors.js.map +1 -1
- package/dist/core/reconnecting-websocket.js +371 -0
- package/dist/core/reconnecting-websocket.js.map +1 -0
- package/dist/index.cjs +1021 -17
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1021 -17
- package/dist/index.mjs.map +4 -4
- package/dist/resources/events.js +588 -0
- package/dist/resources/events.js.map +1 -0
- package/dist/resources/integrations.js +25 -0
- package/dist/resources/integrations.js.map +1 -1
- package/dist/resources/observers.js +238 -0
- package/dist/resources/observers.js.map +1 -0
- package/dist/resources/workspaces.js +4 -8
- package/dist/resources/workspaces.js.map +1 -1
- package/dist/types/core/errors.d.ts +93 -1
- package/dist/types/core/errors.d.ts.map +1 -1
- package/dist/types/core/reconnecting-websocket.d.ts +156 -0
- package/dist/types/core/reconnecting-websocket.d.ts.map +1 -0
- package/dist/types/generated/api.d.ts +628 -104
- package/dist/types/generated/api.d.ts.map +1 -1
- package/dist/types/index.d.cts +45 -2
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +45 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/resources/events.d.ts +193 -0
- package/dist/types/resources/events.d.ts.map +1 -0
- package/dist/types/resources/functions.d.ts.map +1 -1
- package/dist/types/resources/integrations.d.ts +33 -0
- package/dist/types/resources/integrations.d.ts.map +1 -1
- package/dist/types/resources/metrics.d.ts.map +1 -1
- package/dist/types/resources/observers.d.ts +148 -0
- package/dist/types/resources/observers.d.ts.map +1 -0
- package/dist/types/resources/operators.d.ts.map +1 -1
- package/dist/types/resources/settings.d.ts.map +1 -1
- package/dist/types/resources/workspaces.d.ts +4 -15
- package/dist/types/resources/workspaces.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real-time workspace event streaming via Server-Sent Events.
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to ``GET /v1/{workspace_id}/events/stream`` and yields typed
|
|
5
|
+
* {@link WorkspaceSSEEvent} values. The platform-api endpoint:
|
|
6
|
+
*
|
|
7
|
+
* - Streams ``text/event-stream`` over HTTP/1.1
|
|
8
|
+
* - Sends ``retry: 3000`` directive as the first frame
|
|
9
|
+
* - Tags every event with ``id: <millisecond-timestamp>`` for replay
|
|
10
|
+
* - Buffers the last 5 minutes of events in Valkey for gapless reconnect
|
|
11
|
+
* - Pops the discriminator (``event_type``) out of the JSON ``data:``
|
|
12
|
+
* payload and into the SSE ``event:`` line — this helper reattaches
|
|
13
|
+
* it before yielding the typed union member
|
|
14
|
+
*
|
|
15
|
+
* Implementation choice: this helper uses the SDK's own fetch transport
|
|
16
|
+
* (with auth + retry middleware applied) rather than the WHATWG
|
|
17
|
+
* ``EventSource`` API or the ``eventsource`` polyfill. The reasons are:
|
|
18
|
+
*
|
|
19
|
+
* 1. ``EventSource`` cannot send ``Authorization`` headers — the polyfill
|
|
20
|
+
* can, but adds a runtime dep and bypasses the SDK's BFF-proxy /
|
|
21
|
+
* custom-fetch / mock-fetch composition.
|
|
22
|
+
* 2. Reusing the existing ``createTurnStream`` pattern keeps a single
|
|
23
|
+
* SSE parser in the SDK and shares the auth middleware that already
|
|
24
|
+
* attaches the bearer token on every request.
|
|
25
|
+
* 3. The SDK ships with two runtime deps (``openapi-fetch`` +
|
|
26
|
+
* ``openapi-typescript-helpers``); adding ``eventsource`` would inflate
|
|
27
|
+
* bundle size for a feature that fetch streaming handles cleanly.
|
|
28
|
+
*
|
|
29
|
+
* The trade-off is that we reimplement the reconnect loop. The platform-api
|
|
30
|
+
* advertises ``retry: 3000`` and we honor that as the initial backoff,
|
|
31
|
+
* doubling with full jitter on each successive failure up to ``maxDelayMs``.
|
|
32
|
+
*
|
|
33
|
+
* @see ConversationsResource.streamTurn for the analogous turn-stream helper.
|
|
34
|
+
*/
|
|
35
|
+
import { WorkspaceScopedResource } from './base.js';
|
|
36
|
+
/**
|
|
37
|
+
* Structured error surfaced through {@link SubscribeToWorkspaceOptions.onError}.
|
|
38
|
+
*
|
|
39
|
+
* Subclasses ``Error`` so existing consumers using ``err.message`` continue
|
|
40
|
+
* to work, while adding ``code`` + ``retryable`` + raw ``frame`` for
|
|
41
|
+
* deterministic branching. Inspect with ``isWorkspaceEventStreamError``.
|
|
42
|
+
*/
|
|
43
|
+
export class WorkspaceEventStreamError extends Error {
|
|
44
|
+
code;
|
|
45
|
+
retryable;
|
|
46
|
+
/** Raw decoded ``error`` frame body (or ``undefined`` for transport errors). */
|
|
47
|
+
frame;
|
|
48
|
+
constructor(message, code, retryable, frame) {
|
|
49
|
+
super(message);
|
|
50
|
+
this.name = 'WorkspaceEventStreamError';
|
|
51
|
+
this.code = code;
|
|
52
|
+
this.retryable = retryable;
|
|
53
|
+
this.frame = frame;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function isWorkspaceEventStreamError(value) {
|
|
57
|
+
return value instanceof WorkspaceEventStreamError;
|
|
58
|
+
}
|
|
59
|
+
const DEFAULT_INITIAL_DELAY_MS = 3000;
|
|
60
|
+
const DEFAULT_MAX_DELAY_MS = 30000;
|
|
61
|
+
const DEFAULT_MAX_RECONNECTS = 10;
|
|
62
|
+
// Hard ceiling on a single SSE field value to defend against a misbehaving
|
|
63
|
+
// upstream that streams without ever emitting a frame terminator. 1 MiB is
|
|
64
|
+
// far above any legitimate platform event payload (most are <2 KiB).
|
|
65
|
+
const MAX_FRAME_BYTES = 1_048_576;
|
|
66
|
+
/**
|
|
67
|
+
* Real-time event stream resource.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const handle = client.events.subscribeToWorkspace({
|
|
72
|
+
* onEvent: (event) => {
|
|
73
|
+
* switch (event.event_type) {
|
|
74
|
+
* case 'call.started':
|
|
75
|
+
* console.log('Call started:', event.call_sid)
|
|
76
|
+
* break
|
|
77
|
+
* case 'pipeline.error':
|
|
78
|
+
* console.error('Pipeline error:', event)
|
|
79
|
+
* break
|
|
80
|
+
* }
|
|
81
|
+
* },
|
|
82
|
+
* onError: (err) => console.error('Stream error:', err),
|
|
83
|
+
* onReconnect: (attempt) => console.warn(`Reconnect #${attempt}`),
|
|
84
|
+
* })
|
|
85
|
+
*
|
|
86
|
+
* // Later, to stop:
|
|
87
|
+
* handle.unsubscribe()
|
|
88
|
+
* await handle.done
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export class EventsResource extends WorkspaceScopedResource {
|
|
92
|
+
constructor(client, workspaceId) {
|
|
93
|
+
super(client, workspaceId);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Subscribe to the workspace event stream.
|
|
97
|
+
*
|
|
98
|
+
* Establishes an SSE connection to ``/v1/{workspace_id}/events/stream``
|
|
99
|
+
* and invokes ``onEvent`` once per typed {@link WorkspaceSSEEvent}.
|
|
100
|
+
* Unrecoverable failures (auth errors, exhausted reconnect budget,
|
|
101
|
+
* caller abort) surface through ``onError``.
|
|
102
|
+
*
|
|
103
|
+
* Reconnection is automatic: on a network drop or 5xx, the helper
|
|
104
|
+
* backs off (initial delay derived from the ``retry:`` directive,
|
|
105
|
+
* default 3s, doubling with full jitter up to ``maxDelayMs``) and
|
|
106
|
+
* resumes with the most recently seen ``Last-Event-ID``. The platform
|
|
107
|
+
* buffers 5 minutes of events for gapless replay.
|
|
108
|
+
*
|
|
109
|
+
* @returns a {@link SubscriptionHandle} for cleanup. Aborting the
|
|
110
|
+
* caller's ``signal`` is equivalent to calling ``unsubscribe()``.
|
|
111
|
+
*/
|
|
112
|
+
subscribeToWorkspace(options) {
|
|
113
|
+
const localController = new AbortController();
|
|
114
|
+
const cleanups = [];
|
|
115
|
+
if (options.signal) {
|
|
116
|
+
if (options.signal.aborted) {
|
|
117
|
+
localController.abort(options.signal.reason);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const onAbort = () => localController.abort(options.signal?.reason);
|
|
121
|
+
options.signal.addEventListener('abort', onAbort, { once: true });
|
|
122
|
+
cleanups.push(() => options.signal?.removeEventListener('abort', onAbort));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const done = runSubscription(this.client, this.workspaceId, options, localController.signal).finally(() => {
|
|
126
|
+
for (const cleanup of cleanups)
|
|
127
|
+
cleanup();
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
done,
|
|
131
|
+
unsubscribe: () => localController.abort(),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Server-sent ``error`` event frames that the SDK should treat as terminal
|
|
137
|
+
* (do NOT auto-retry). Mirror the ``code`` taxonomy emitted by
|
|
138
|
+
* ``platform-api/src/routes/event_stream.py``.
|
|
139
|
+
*/
|
|
140
|
+
const TERMINAL_SERVER_ERROR_CODES = {
|
|
141
|
+
too_many_streams: 'too_many_streams',
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Server-sent ``error`` event frames that are recoverable — surface them as
|
|
145
|
+
* transport errors so the reconnect loop kicks in. ``stream_unavailable``
|
|
146
|
+
* fires when Valkey is down; ``stream_error`` is the generic catch-all from
|
|
147
|
+
* the server-side ``except Exception`` branch.
|
|
148
|
+
*/
|
|
149
|
+
const RECOVERABLE_SERVER_ERROR_CODES = {
|
|
150
|
+
stream_unavailable: 'stream_unavailable',
|
|
151
|
+
stream_error: 'stream_error',
|
|
152
|
+
};
|
|
153
|
+
async function runSubscription(client, workspaceId, options, signal) {
|
|
154
|
+
let lastEventId = options.lastEventId;
|
|
155
|
+
let attempt = 0;
|
|
156
|
+
let delayMs = options.initialDelayMs ?? DEFAULT_INITIAL_DELAY_MS;
|
|
157
|
+
const maxDelayMs = options.maxDelayMs ?? DEFAULT_MAX_DELAY_MS;
|
|
158
|
+
const maxReconnects = options.maxReconnects ?? DEFAULT_MAX_RECONNECTS;
|
|
159
|
+
let errorReported = false;
|
|
160
|
+
const reportError = (error) => {
|
|
161
|
+
if (errorReported)
|
|
162
|
+
return;
|
|
163
|
+
errorReported = true;
|
|
164
|
+
try {
|
|
165
|
+
options.onError?.(error);
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
// Consumer-supplied callback raised — swallow to keep teardown clean.
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
while (!signal.aborted) {
|
|
172
|
+
if (attempt > 0) {
|
|
173
|
+
try {
|
|
174
|
+
options.onReconnect?.(attempt);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// Consumer-supplied callback raised — swallow to keep teardown clean.
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
let outcome;
|
|
181
|
+
try {
|
|
182
|
+
outcome = await runOneConnection({
|
|
183
|
+
client,
|
|
184
|
+
workspaceId,
|
|
185
|
+
lastEventId,
|
|
186
|
+
signal,
|
|
187
|
+
onEvent: options.onEvent,
|
|
188
|
+
onIdAdvance: (id) => {
|
|
189
|
+
lastEventId = id;
|
|
190
|
+
},
|
|
191
|
+
onRetryDirective: (ms) => {
|
|
192
|
+
// Server-sent retry directive resets the backoff floor.
|
|
193
|
+
delayMs = clampDelay(ms, options.initialDelayMs, maxDelayMs);
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
// runOneConnection surfaces only terminal auth errors via throw;
|
|
199
|
+
// everything else is a StreamOutcome. Preserve the original Error
|
|
200
|
+
// (typically ``AuthenticationError`` with ``statusCode``) so consumers
|
|
201
|
+
// that branch on ``err.statusCode`` keep working.
|
|
202
|
+
reportError(err instanceof Error ? err : new Error(String(err)));
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (signal.aborted || outcome.kind === 'aborted') {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (outcome.kind === 'auth-error') {
|
|
209
|
+
// 401 / 403 — never auto-retry. The token is invalid and the
|
|
210
|
+
// stream cannot succeed without operator intervention. Surface the
|
|
211
|
+
// original ``AuthenticationError`` so consumers checking
|
|
212
|
+
// ``err.statusCode`` keep working.
|
|
213
|
+
reportError(outcome.error);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (outcome.kind === 'terminal-server-error') {
|
|
217
|
+
// Server emitted a structured ``error`` frame with a code that the
|
|
218
|
+
// SDK recognizes as terminal (e.g., ``too_many_streams``). Surface
|
|
219
|
+
// it as a typed ``WorkspaceEventStreamError`` so consumers can branch
|
|
220
|
+
// on ``error.code`` without parsing free-form text.
|
|
221
|
+
reportError(new WorkspaceEventStreamError(outcome.message, outcome.code, outcome.retryable, outcome.frame));
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (attempt >= maxReconnects) {
|
|
225
|
+
reportError(new WorkspaceEventStreamError(`SSE subscription exhausted reconnect budget (${maxReconnects}): ${outcome.reason}`, 'transport_exhausted', true));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
attempt += 1;
|
|
229
|
+
const sleepMs = jitter(delayMs);
|
|
230
|
+
delayMs = Math.min(delayMs * 2, maxDelayMs);
|
|
231
|
+
const slept = await abortableSleep(sleepMs, signal);
|
|
232
|
+
if (!slept)
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async function runOneConnection(args) {
|
|
237
|
+
const headers = { Accept: 'text/event-stream' };
|
|
238
|
+
if (args.lastEventId !== undefined) {
|
|
239
|
+
headers['Last-Event-ID'] = args.lastEventId;
|
|
240
|
+
}
|
|
241
|
+
let result;
|
|
242
|
+
try {
|
|
243
|
+
result = await args.client.GET('/v1/{workspace_id}/events/stream', {
|
|
244
|
+
params: { path: { workspace_id: args.workspaceId } },
|
|
245
|
+
headers,
|
|
246
|
+
parseAs: 'stream',
|
|
247
|
+
signal: args.signal,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
if (args.signal.aborted)
|
|
252
|
+
return { kind: 'aborted' };
|
|
253
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
254
|
+
// 4xx (including 401 / 403) are surfaced as thrown AmigoErrors by the
|
|
255
|
+
// SDK error middleware. Distinguish those from transport failures.
|
|
256
|
+
const status = readStatus(error);
|
|
257
|
+
if (status === 401 || status === 403) {
|
|
258
|
+
return { kind: 'auth-error', error };
|
|
259
|
+
}
|
|
260
|
+
return { kind: 'transport-error', reason: error.message };
|
|
261
|
+
}
|
|
262
|
+
if (result.error !== undefined) {
|
|
263
|
+
// openapi-fetch surfaces non-OK responses as `error`. The SDK error
|
|
264
|
+
// middleware should have thrown — fall through defensively.
|
|
265
|
+
return { kind: 'transport-error', reason: `API error: ${safeStringify(result.error)}` };
|
|
266
|
+
}
|
|
267
|
+
const body = result.data;
|
|
268
|
+
if (!(body instanceof ReadableStream)) {
|
|
269
|
+
return { kind: 'transport-error', reason: 'Expected ReadableStream body for SSE' };
|
|
270
|
+
}
|
|
271
|
+
try {
|
|
272
|
+
for await (const frame of parseSSEFrames(body, args.signal)) {
|
|
273
|
+
if (args.signal.aborted)
|
|
274
|
+
return { kind: 'aborted' };
|
|
275
|
+
if (frame.retry !== undefined) {
|
|
276
|
+
args.onRetryDirective(frame.retry);
|
|
277
|
+
}
|
|
278
|
+
if (frame.id !== undefined) {
|
|
279
|
+
args.onIdAdvance(frame.id);
|
|
280
|
+
}
|
|
281
|
+
if (frame.event === 'error' && frame.data !== undefined) {
|
|
282
|
+
// Structured error frame — branch on ``code`` from the server. We
|
|
283
|
+
// distinguish three buckets: terminal (don't retry), recoverable
|
|
284
|
+
// (let the reconnect loop run), and unknown (default to recoverable
|
|
285
|
+
// so a future server code does not strand consumers without auto-
|
|
286
|
+
// retry).
|
|
287
|
+
const errOutcome = interpretServerErrorFrame(frame.data);
|
|
288
|
+
if (errOutcome.terminal) {
|
|
289
|
+
return {
|
|
290
|
+
kind: 'terminal-server-error',
|
|
291
|
+
code: errOutcome.code,
|
|
292
|
+
message: errOutcome.message,
|
|
293
|
+
retryable: errOutcome.retryable,
|
|
294
|
+
frame: errOutcome.frame,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
return { kind: 'transport-error', reason: errOutcome.message };
|
|
298
|
+
}
|
|
299
|
+
if (frame.event && frame.data !== undefined) {
|
|
300
|
+
const event = parseWorkspaceFrame(frame.event, frame.data);
|
|
301
|
+
if (event) {
|
|
302
|
+
try {
|
|
303
|
+
args.onEvent(event);
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
// Consumer threw during onEvent; do not let it kill the
|
|
307
|
+
// subscription. The stream is still healthy.
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
catch (err) {
|
|
314
|
+
if (args.signal.aborted)
|
|
315
|
+
return { kind: 'aborted' };
|
|
316
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
317
|
+
return { kind: 'transport-error', reason };
|
|
318
|
+
}
|
|
319
|
+
if (args.signal.aborted)
|
|
320
|
+
return { kind: 'aborted' };
|
|
321
|
+
// Reader closed cleanly — server EOF. Treat as recoverable; reconnect
|
|
322
|
+
// with whatever Last-Event-ID we have.
|
|
323
|
+
return { kind: 'transport-error', reason: 'Stream closed by server' };
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Parses an SSE byte stream into structured frames.
|
|
327
|
+
*
|
|
328
|
+
* Forks the parser in {@link ConversationsResource.streamTurn} to also
|
|
329
|
+
* surface ``id:`` and ``retry:`` lines that the workspace event stream
|
|
330
|
+
* relies on for gapless reconnect.
|
|
331
|
+
*/
|
|
332
|
+
async function* parseSSEFrames(stream, signal) {
|
|
333
|
+
const reader = stream.getReader();
|
|
334
|
+
const decoder = new TextDecoder();
|
|
335
|
+
let buffer = '';
|
|
336
|
+
// When the caller aborts, cancel the reader so any in-flight
|
|
337
|
+
// ``reader.read()`` resolves immediately with ``{done: true}`` (or rejects
|
|
338
|
+
// with ``AbortError``, which we trap in the consumer). Without this, an
|
|
339
|
+
// idle SSE stream keeps the read pending indefinitely after abort.
|
|
340
|
+
let cancelled = false;
|
|
341
|
+
const onAbort = () => {
|
|
342
|
+
if (cancelled)
|
|
343
|
+
return;
|
|
344
|
+
cancelled = true;
|
|
345
|
+
void reader.cancel().catch(() => {
|
|
346
|
+
// Already cancelled or locked elsewhere; safe to ignore.
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
let removeAbortHandler;
|
|
350
|
+
if (signal.aborted) {
|
|
351
|
+
onAbort();
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
355
|
+
removeAbortHandler = () => signal.removeEventListener('abort', onAbort);
|
|
356
|
+
}
|
|
357
|
+
function* drain(text) {
|
|
358
|
+
buffer += text;
|
|
359
|
+
if (buffer.length > MAX_FRAME_BYTES) {
|
|
360
|
+
throw new Error(`SSE frame buffer exceeded ${MAX_FRAME_BYTES} bytes without terminator`);
|
|
361
|
+
}
|
|
362
|
+
while (true) {
|
|
363
|
+
const idx = findFrameTerminator(buffer);
|
|
364
|
+
if (idx === null)
|
|
365
|
+
break;
|
|
366
|
+
const block = buffer.slice(0, idx.terminatorStart);
|
|
367
|
+
buffer = buffer.slice(idx.terminatorEnd);
|
|
368
|
+
const frame = parseSSEBlock(block);
|
|
369
|
+
if (frame)
|
|
370
|
+
yield frame;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
try {
|
|
374
|
+
while (true) {
|
|
375
|
+
const { done, value } = await reader.read();
|
|
376
|
+
if (done)
|
|
377
|
+
break;
|
|
378
|
+
yield* drain(decoder.decode(value, { stream: true }));
|
|
379
|
+
}
|
|
380
|
+
yield* drain(decoder.decode());
|
|
381
|
+
if (buffer.trim().length > 0) {
|
|
382
|
+
const frame = parseSSEBlock(buffer);
|
|
383
|
+
if (frame)
|
|
384
|
+
yield frame;
|
|
385
|
+
buffer = '';
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
finally {
|
|
389
|
+
removeAbortHandler?.();
|
|
390
|
+
try {
|
|
391
|
+
reader.releaseLock();
|
|
392
|
+
}
|
|
393
|
+
catch {
|
|
394
|
+
// releaseLock can throw if the reader is already detached; ignore.
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function findFrameTerminator(s) {
|
|
399
|
+
const lf = s.indexOf('\n\n');
|
|
400
|
+
const crlf = s.indexOf('\r\n\r\n');
|
|
401
|
+
if (lf < 0 && crlf < 0)
|
|
402
|
+
return null;
|
|
403
|
+
if (lf < 0)
|
|
404
|
+
return { terminatorStart: crlf, terminatorEnd: crlf + 4 };
|
|
405
|
+
if (crlf < 0)
|
|
406
|
+
return { terminatorStart: lf, terminatorEnd: lf + 2 };
|
|
407
|
+
return lf < crlf
|
|
408
|
+
? { terminatorStart: lf, terminatorEnd: lf + 2 }
|
|
409
|
+
: { terminatorStart: crlf, terminatorEnd: crlf + 4 };
|
|
410
|
+
}
|
|
411
|
+
function parseSSEBlock(block) {
|
|
412
|
+
let event = '';
|
|
413
|
+
let id;
|
|
414
|
+
let retry;
|
|
415
|
+
const dataLines = [];
|
|
416
|
+
for (const line of block.split(/\r?\n/)) {
|
|
417
|
+
if (line === '' || line.startsWith(':'))
|
|
418
|
+
continue;
|
|
419
|
+
const colon = line.indexOf(':');
|
|
420
|
+
const field = colon < 0 ? line : line.slice(0, colon);
|
|
421
|
+
let value = colon < 0 ? '' : line.slice(colon + 1);
|
|
422
|
+
if (value.startsWith(' '))
|
|
423
|
+
value = value.slice(1);
|
|
424
|
+
if (field === 'event') {
|
|
425
|
+
event = value;
|
|
426
|
+
}
|
|
427
|
+
else if (field === 'data') {
|
|
428
|
+
dataLines.push(value);
|
|
429
|
+
}
|
|
430
|
+
else if (field === 'id') {
|
|
431
|
+
id = value;
|
|
432
|
+
}
|
|
433
|
+
else if (field === 'retry') {
|
|
434
|
+
const parsed = Number.parseInt(value, 10);
|
|
435
|
+
if (Number.isFinite(parsed) && parsed >= 0)
|
|
436
|
+
retry = parsed;
|
|
437
|
+
}
|
|
438
|
+
// Unknown fields are ignored per the SSE spec.
|
|
439
|
+
}
|
|
440
|
+
// Surface metadata-only frames (id-only or retry-only) so the reconnect
|
|
441
|
+
// loop can observe ``Last-Event-ID`` advances and server-sent retry hints
|
|
442
|
+
// even on heartbeats / replay-position markers.
|
|
443
|
+
if (!event && dataLines.length === 0 && id === undefined && retry === undefined) {
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
return {
|
|
447
|
+
event,
|
|
448
|
+
data: dataLines.length > 0 ? dataLines.join('\n') : undefined,
|
|
449
|
+
id,
|
|
450
|
+
retry,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Validate and reattach the discriminator to a frame's JSON payload.
|
|
455
|
+
*
|
|
456
|
+
* The platform-api SSE serializer pops ``event_type`` out of the JSON body
|
|
457
|
+
* (it lives in the SSE ``event:`` line). Reattach it so the resulting
|
|
458
|
+
* value is a well-formed {@link WorkspaceSSEEvent} union member.
|
|
459
|
+
*
|
|
460
|
+
* Drift-tolerant: an unparseable payload, non-object payload, or unknown
|
|
461
|
+
* ``event:`` discriminator is silently dropped (returns ``null``), matching
|
|
462
|
+
* the behavior of the analogous turn-stream parser.
|
|
463
|
+
*/
|
|
464
|
+
function parseWorkspaceFrame(eventName, dataJson) {
|
|
465
|
+
let payload;
|
|
466
|
+
try {
|
|
467
|
+
payload = JSON.parse(dataJson);
|
|
468
|
+
}
|
|
469
|
+
catch {
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
472
|
+
if (typeof payload !== 'object' || payload === null || Array.isArray(payload))
|
|
473
|
+
return null;
|
|
474
|
+
// The discriminator is whatever the server's `event:` line says. We trust
|
|
475
|
+
// the platform-api union: anything outside the generated literal type is
|
|
476
|
+
// dropped at the static-type boundary by the consumer's `switch`.
|
|
477
|
+
return {
|
|
478
|
+
...payload,
|
|
479
|
+
event_type: eventName,
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Decode a server-sent ``error`` frame body into either a terminal or
|
|
484
|
+
* recoverable outcome.
|
|
485
|
+
*
|
|
486
|
+
* The platform-api event stream emits these shapes:
|
|
487
|
+
*
|
|
488
|
+
* { code: "too_many_streams", message: "...", max_streams: 50 }
|
|
489
|
+
* { code: "stream_unavailable", message: "Event streaming unavailable" }
|
|
490
|
+
* { code: "stream_error", message: "Stream error, please reconnect" }
|
|
491
|
+
*
|
|
492
|
+
* Unknown codes default to recoverable so a server-side addition does not
|
|
493
|
+
* strand SDK consumers without auto-retry.
|
|
494
|
+
*/
|
|
495
|
+
function interpretServerErrorFrame(dataJson) {
|
|
496
|
+
let payload;
|
|
497
|
+
try {
|
|
498
|
+
payload = JSON.parse(dataJson);
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
return {
|
|
502
|
+
terminal: false,
|
|
503
|
+
code: 'stream_error',
|
|
504
|
+
message: 'Server sent malformed error frame',
|
|
505
|
+
retryable: true,
|
|
506
|
+
frame: {},
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
if (typeof payload !== 'object' || payload === null || Array.isArray(payload)) {
|
|
510
|
+
return {
|
|
511
|
+
terminal: false,
|
|
512
|
+
code: 'stream_error',
|
|
513
|
+
message: 'Server sent non-object error frame',
|
|
514
|
+
retryable: true,
|
|
515
|
+
frame: {},
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
const obj = payload;
|
|
519
|
+
const rawCode = typeof obj['code'] === 'string' ? obj['code'] : '';
|
|
520
|
+
const message = typeof obj['message'] === 'string' ? obj['message'] : 'Stream error';
|
|
521
|
+
if (rawCode in TERMINAL_SERVER_ERROR_CODES) {
|
|
522
|
+
return {
|
|
523
|
+
terminal: true,
|
|
524
|
+
code: TERMINAL_SERVER_ERROR_CODES[rawCode],
|
|
525
|
+
message,
|
|
526
|
+
retryable: false,
|
|
527
|
+
frame: obj,
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
if (rawCode in RECOVERABLE_SERVER_ERROR_CODES) {
|
|
531
|
+
return {
|
|
532
|
+
terminal: false,
|
|
533
|
+
code: RECOVERABLE_SERVER_ERROR_CODES[rawCode],
|
|
534
|
+
message,
|
|
535
|
+
retryable: true,
|
|
536
|
+
frame: obj,
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
return {
|
|
540
|
+
terminal: false,
|
|
541
|
+
code: 'unknown',
|
|
542
|
+
message: rawCode ? `${message} (code=${rawCode})` : message,
|
|
543
|
+
retryable: true,
|
|
544
|
+
frame: obj,
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function readStatus(error) {
|
|
548
|
+
if (typeof error !== 'object' || error === null)
|
|
549
|
+
return undefined;
|
|
550
|
+
const status = error.statusCode;
|
|
551
|
+
return typeof status === 'number' ? status : undefined;
|
|
552
|
+
}
|
|
553
|
+
function safeStringify(value) {
|
|
554
|
+
try {
|
|
555
|
+
return JSON.stringify(value);
|
|
556
|
+
}
|
|
557
|
+
catch {
|
|
558
|
+
return String(value);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function jitter(ms) {
|
|
562
|
+
// Full jitter: pick a random delay in [0, ms]. Avoids reconnect stampedes
|
|
563
|
+
// when many clients reconnect simultaneously after a deploy.
|
|
564
|
+
return Math.floor(Math.random() * Math.max(1, ms));
|
|
565
|
+
}
|
|
566
|
+
function clampDelay(ms, floor, ceiling) {
|
|
567
|
+
const lo = floor ?? DEFAULT_INITIAL_DELAY_MS;
|
|
568
|
+
if (!Number.isFinite(ms) || ms <= 0)
|
|
569
|
+
return lo;
|
|
570
|
+
return Math.min(Math.max(ms, lo), ceiling);
|
|
571
|
+
}
|
|
572
|
+
async function abortableSleep(ms, signal) {
|
|
573
|
+
if (signal.aborted)
|
|
574
|
+
return false;
|
|
575
|
+
return new Promise((resolve) => {
|
|
576
|
+
const timer = setTimeout(() => {
|
|
577
|
+
signal.removeEventListener('abort', onAbort);
|
|
578
|
+
resolve(true);
|
|
579
|
+
}, ms);
|
|
580
|
+
const onAbort = () => {
|
|
581
|
+
clearTimeout(timer);
|
|
582
|
+
signal.removeEventListener('abort', onAbort);
|
|
583
|
+
resolve(false);
|
|
584
|
+
};
|
|
585
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/resources/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAsCnD;;;;;;GAMG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACzC,IAAI,CAA+B;IACnC,SAAS,CAAS;IAC3B,gFAAgF;IACvE,KAAK,CAAqC;IAEnD,YACE,OAAe,EACf,IAAmC,EACnC,SAAkB,EAClB,KAA+B;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF;AAED,MAAM,UAAU,2BAA2B,CACzC,KAAc;IAEd,OAAO,KAAK,YAAY,yBAAyB,CAAA;AACnD,CAAC;AAgFD,MAAM,wBAAwB,GAAG,IAAI,CAAA;AACrC,MAAM,oBAAoB,GAAG,KAAK,CAAA;AAClC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACjC,2EAA2E;AAC3E,2EAA2E;AAC3E,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
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Probe an integration's connection + auth without invoking any specific
|
|
60
|
+
* endpoint. Exercises auth resolution end-to-end (SSM lookups, OAuth2 token
|
|
61
|
+
* mints, JWT signing) and sends a HEAD request to ``base_url`` (REST/FHIR)
|
|
62
|
+
* or ``mcp_url`` (MCP). Safe on production integrations — HEAD carries no
|
|
63
|
+
* side effects.
|
|
64
|
+
*
|
|
65
|
+
* The most recent probe outcome is persisted on the integration so
|
|
66
|
+
* subsequent ``get`` / ``list`` responses surface ``last_tested_at`` +
|
|
67
|
+
* ``last_test_status`` without re-probing.
|
|
68
|
+
*
|
|
69
|
+
* @returns ``status`` is one of ``healthy`` / ``auth_failed`` /
|
|
70
|
+
* ``unreachable`` / ``timeout`` / ``ssl_error`` / ``misconfigured``,
|
|
71
|
+
* each mapping to a distinct, actionable user message.
|
|
72
|
+
*/
|
|
73
|
+
async testConnection(integrationId) {
|
|
74
|
+
return extractData(await this.client.POST('/v1/{workspace_id}/integrations/{integration_id}/test-connection', {
|
|
75
|
+
params: {
|
|
76
|
+
path: {
|
|
77
|
+
workspace_id: this.workspaceId,
|
|
78
|
+
integration_id: integrationId,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
58
83
|
/** Check health of all integrations in the workspace */
|
|
59
84
|
async getHealthCheck() {
|
|
60
85
|
return extractData(await this.client.GET('/v1/{workspace_id}/integrations/health-check', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/resources/integrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAShE;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,uBAAuB;IAC/D,+BAA+B;IAC/B,KAAK,CAAC,MAAM,CAAC,IAAuD;QAClE,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,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AAC,MAAM,CAAC,MAAM,CAAC,kDAAkD,EAAE;YAC3E,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,EAAE;SACpF,CAAC,CAAA;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY,CAChB,aAAqC,EACrC,YAAoB,EACpB,IAAkD;QAElD,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACpB,iFAAiF,EACjF;YACE,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,YAAY,EAAE,IAAI,CAAC,WAAW;oBAC9B,cAAc,EAAE,aAAa;oBAC7B,aAAa,EAAE,YAAY;iBAC5B;aACF;YACD,IAAI;SACL,CACF,CACF,CAAA;IACH,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,cAAc;QAClB,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,8CAA8C,EAAE;YACpE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE;SACrD,CAAC,CACH,CAAA;IACH,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/resources/integrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAShE;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,uBAAuB;IAC/D,+BAA+B;IAC/B,KAAK,CAAC,MAAM,CAAC,IAAuD;QAClE,OAAO,WAAW,CAChB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE;YACxD,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE;YACpD,IAAI;SACL,CAAC,CACH,CAAA;IACH,CAAC;IAED,wBAA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