@nebula-ai/sdk 1.2.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1268 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ //#region src/runtime/errors.ts
6
+ var NebulaError = class extends Error {
7
+ name = "NebulaError";
8
+ constructor(message, options) {
9
+ super(message, options);
10
+ }
11
+ };
12
+ var NebulaConnectionError = class extends NebulaError {
13
+ name = "NebulaConnectionError";
14
+ };
15
+ var NebulaTimeoutError = class extends NebulaError {
16
+ name = "NebulaTimeoutError";
17
+ };
18
+ function isEnvelope(body) {
19
+ return typeof body === "object" && body !== null && typeof body.type === "string" && typeof body.message === "string";
20
+ }
21
+ var NebulaAPIError = class extends NebulaError {
22
+ name = "NebulaAPIError";
23
+ status;
24
+ requestId;
25
+ body;
26
+ type;
27
+ code;
28
+ details;
29
+ constructor(payload, message) {
30
+ const envelope = isEnvelope(payload.body) ? payload.body : void 0;
31
+ super(message ?? envelope?.message ?? `Nebula API error (status ${payload.status})`);
32
+ this.status = payload.status;
33
+ const envCode = typeof envelope?.code === "string" ? envelope.code : void 0;
34
+ const envRid = typeof envelope?.request_id === "string" ? envelope.request_id : void 0;
35
+ this.requestId = envRid ?? payload.requestId;
36
+ this.body = payload.body;
37
+ this.type = envelope?.type;
38
+ this.code = envCode;
39
+ this.details = envelope?.details ?? void 0;
40
+ }
41
+ };
42
+ var NebulaBadRequestError = class extends NebulaAPIError {
43
+ name = "NebulaBadRequestError";
44
+ };
45
+ var NebulaUnauthorizedError = class extends NebulaAPIError {
46
+ name = "NebulaUnauthorizedError";
47
+ };
48
+ var NebulaForbiddenError = class extends NebulaAPIError {
49
+ name = "NebulaForbiddenError";
50
+ };
51
+ var NebulaNotFoundError = class extends NebulaAPIError {
52
+ name = "NebulaNotFoundError";
53
+ };
54
+ var NebulaConflictError = class extends NebulaAPIError {
55
+ name = "NebulaConflictError";
56
+ };
57
+ var NebulaValidationError = class extends NebulaAPIError {
58
+ name = "NebulaValidationError";
59
+ };
60
+ var NebulaRateLimitError = class extends NebulaAPIError {
61
+ name = "NebulaRateLimitError";
62
+ retryAfter;
63
+ constructor(payload, retryAfter) {
64
+ super(payload);
65
+ this.retryAfter = retryAfter;
66
+ }
67
+ };
68
+ var NebulaServerError = class extends NebulaAPIError {
69
+ name = "NebulaServerError";
70
+ };
71
+ const STATUS_TO_CLASS = {
72
+ 400: NebulaBadRequestError,
73
+ 401: NebulaUnauthorizedError,
74
+ 403: NebulaForbiddenError,
75
+ 404: NebulaNotFoundError,
76
+ 409: NebulaConflictError,
77
+ 422: NebulaValidationError
78
+ };
79
+ function errorFromResponse(payload, retryAfter) {
80
+ if (payload.status === 429) return new NebulaRateLimitError(payload, retryAfter);
81
+ const cls = STATUS_TO_CLASS[payload.status];
82
+ if (cls) return new cls(payload);
83
+ if (payload.status >= 500) return new NebulaServerError(payload);
84
+ return new NebulaAPIError(payload);
85
+ }
86
+ //#endregion
87
+ //#region src/runtime/retry.ts
88
+ const DEFAULT_RETRY = {
89
+ maxRetries: 2,
90
+ baseMs: 250,
91
+ maxMs: 8e3
92
+ };
93
+ const RETRYABLE_STATUSES = new Set([
94
+ 408,
95
+ 429,
96
+ 502,
97
+ 503,
98
+ 504
99
+ ]);
100
+ function isRetryableStatus(status) {
101
+ return RETRYABLE_STATUSES.has(status);
102
+ }
103
+ function backoffMs(attempt, policy, retryAfterSec) {
104
+ if (retryAfterSec != null && Number.isFinite(retryAfterSec)) return Math.min(retryAfterSec * 1e3, policy.maxMs);
105
+ const exp = Math.min(policy.baseMs * 2 ** attempt, policy.maxMs);
106
+ return Math.floor(Math.random() * exp);
107
+ }
108
+ function sleep(ms, signal) {
109
+ if (ms <= 0) return Promise.resolve();
110
+ return new Promise((resolveSleep, reject) => {
111
+ const handle = setTimeout(resolveSleep, ms);
112
+ if (signal) {
113
+ const onAbort = () => {
114
+ clearTimeout(handle);
115
+ reject(signal.reason ?? /* @__PURE__ */ new Error("aborted"));
116
+ };
117
+ if (signal.aborted) onAbort();
118
+ else signal.addEventListener("abort", onAbort, { once: true });
119
+ }
120
+ });
121
+ }
122
+ //#endregion
123
+ //#region src/runtime/client.ts
124
+ const DEFAULT_BASE_URL = "https://api.zeroset.com";
125
+ const DEFAULT_TIMEOUT_MS = 6e4;
126
+ var NebulaCore = class {
127
+ baseUrl;
128
+ apiKey;
129
+ bearerToken;
130
+ defaultHeaders;
131
+ fetchImpl;
132
+ fetchOptions;
133
+ timeoutMs;
134
+ retry;
135
+ userAgent;
136
+ constructor(options = {}) {
137
+ this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, "");
138
+ this.apiKey = options.apiKey;
139
+ this.bearerToken = options.bearerToken;
140
+ this.defaultHeaders = filterNullishHeaders(options.defaultHeaders);
141
+ this.fetchImpl = options.fetchImpl ?? globalThis.fetch.bind(globalThis);
142
+ this.fetchOptions = options.fetchOptions ?? {};
143
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
144
+ this.retry = {
145
+ ...DEFAULT_RETRY,
146
+ ...options.retry ?? {}
147
+ };
148
+ this.userAgent = options.userAgent ?? "nebula-sdk-js/0.0.1";
149
+ }
150
+ buildUrl(path, pathParams, query) {
151
+ let resolved = path;
152
+ if (pathParams) for (const [k, v] of Object.entries(pathParams)) resolved = resolved.replace(`{${k}}`, encodeURIComponent(String(v)));
153
+ const url = new URL(this.baseUrl + resolved);
154
+ if (query) for (const [k, v] of Object.entries(query)) {
155
+ if (v === void 0 || v === null) continue;
156
+ if (Array.isArray(v)) for (const item of v) url.searchParams.append(k, String(item));
157
+ else url.searchParams.set(k, String(v));
158
+ }
159
+ return url.toString();
160
+ }
161
+ buildHeaders(perRequest, hasBody = false) {
162
+ const headers = new Headers(this.defaultHeaders);
163
+ headers.set("User-Agent", this.userAgent);
164
+ headers.set("Accept", "application/json");
165
+ if (hasBody) headers.set("Content-Type", "application/json");
166
+ if (this.apiKey) headers.set("X-API-Key", this.apiKey);
167
+ if (this.bearerToken) headers.set("Authorization", `Bearer ${this.bearerToken}`);
168
+ if (perRequest) for (const [k, v] of Object.entries(perRequest)) headers.set(k, v);
169
+ return headers;
170
+ }
171
+ async request(args) {
172
+ const url = this.buildUrl(args.path, args.pathParams, args.query);
173
+ const hasBody = args.body !== void 0 && args.body !== null;
174
+ const headers = this.buildHeaders(args.headers, hasBody);
175
+ const init = {
176
+ ...this.fetchOptions,
177
+ method: args.method,
178
+ headers,
179
+ body: hasBody ? JSON.stringify(args.body) : void 0
180
+ };
181
+ const maxAttempts = args.idempotent ?? false ? this.retry.maxRetries + 1 : 1;
182
+ let lastError;
183
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
184
+ const controller = new AbortController();
185
+ const timeoutHandle = setTimeout(() => controller.abort(/* @__PURE__ */ new Error("timeout")), this.timeoutMs);
186
+ const { signal: composedSignal, dispose: disposeAbort } = composeAbort(controller.signal, args.signal);
187
+ try {
188
+ const response = await this.fetchImpl(url, {
189
+ ...init,
190
+ signal: composedSignal
191
+ });
192
+ if (response.ok) {
193
+ if (response.status === 204) return void 0;
194
+ return await response.json();
195
+ }
196
+ const text = await safeReadText(response);
197
+ const parsed = safeParseJSON(text);
198
+ const retryAfter = parseRetryAfter(response.headers.get("Retry-After"));
199
+ const err = errorFromResponse({
200
+ status: response.status,
201
+ requestId: response.headers.get("X-Request-Id") ?? void 0,
202
+ body: parsed ?? text
203
+ }, retryAfter);
204
+ if (isRetryableStatus(response.status) && attempt + 1 < maxAttempts) {
205
+ await sleep(backoffMs(attempt, this.retry, retryAfter), args.signal);
206
+ lastError = err;
207
+ continue;
208
+ }
209
+ throw err;
210
+ } catch (rawError) {
211
+ if (rawError instanceof Error && rawError.name === "AbortError") {
212
+ if (args.signal?.aborted) throw rawError;
213
+ throw new NebulaTimeoutError(`Request timed out after ${this.timeoutMs}ms`, { cause: rawError });
214
+ }
215
+ if (rawError instanceof NebulaAPIError || rawError instanceof NebulaConnectionError) throw rawError;
216
+ if (attempt + 1 < maxAttempts) {
217
+ await sleep(backoffMs(attempt, this.retry), args.signal);
218
+ lastError = rawError;
219
+ continue;
220
+ }
221
+ if (rawError instanceof Error) throw new NebulaConnectionError(rawError.message, { cause: rawError });
222
+ throw rawError;
223
+ } finally {
224
+ clearTimeout(timeoutHandle);
225
+ disposeAbort();
226
+ }
227
+ }
228
+ throw lastError ?? new NebulaConnectionError("retry budget exhausted");
229
+ }
230
+ };
231
+ function composeAbort(timeoutSignal, userSignal) {
232
+ if (!userSignal) return {
233
+ signal: timeoutSignal,
234
+ dispose: () => {}
235
+ };
236
+ const controller = new AbortController();
237
+ const onTimeoutAbort = () => controller.abort(timeoutSignal.reason ?? /* @__PURE__ */ new Error("aborted"));
238
+ const onUserAbort = () => controller.abort(userSignal.reason ?? /* @__PURE__ */ new Error("aborted"));
239
+ if (timeoutSignal.aborted) controller.abort(timeoutSignal.reason);
240
+ if (userSignal.aborted) controller.abort(userSignal.reason);
241
+ timeoutSignal.addEventListener("abort", onTimeoutAbort, { once: true });
242
+ userSignal.addEventListener("abort", onUserAbort, { once: true });
243
+ const dispose = () => {
244
+ timeoutSignal.removeEventListener("abort", onTimeoutAbort);
245
+ userSignal.removeEventListener("abort", onUserAbort);
246
+ };
247
+ return {
248
+ signal: controller.signal,
249
+ dispose
250
+ };
251
+ }
252
+ async function safeReadText(response) {
253
+ try {
254
+ return await response.text();
255
+ } catch {
256
+ return "";
257
+ }
258
+ }
259
+ function safeParseJSON(text) {
260
+ if (!text) return void 0;
261
+ try {
262
+ return JSON.parse(text);
263
+ } catch {
264
+ return;
265
+ }
266
+ }
267
+ function filterNullishHeaders(headers) {
268
+ if (!headers) return {};
269
+ const out = {};
270
+ for (const [k, v] of Object.entries(headers)) if (v !== null && v !== void 0) out[k] = v;
271
+ return out;
272
+ }
273
+ function parseRetryAfter(header) {
274
+ if (!header) return void 0;
275
+ const asNumber = Number.parseFloat(header);
276
+ if (Number.isFinite(asNumber)) return asNumber;
277
+ const asDate = Date.parse(header);
278
+ if (Number.isFinite(asDate)) return Math.max(0, (asDate - Date.now()) / 1e3);
279
+ }
280
+ //#endregion
281
+ //#region src/resources/client.ts
282
+ var ClientResource = class {
283
+ core;
284
+ constructor(core) {
285
+ this.core = core;
286
+ }
287
+ /**
288
+ *
289
+ * Health probe
290
+ *
291
+ * Lightweight liveness probe. Returns a 200 with a fixed message when the API process is up. Does not verify downstream dependencies (database, storage, workers) — use the internal status endpoints for those.
292
+ * @operationId client.health
293
+ * @endpoint GET /v1/health
294
+ */
295
+ async health(options) {
296
+ return this.core.request({
297
+ method: "GET",
298
+ path: "/v1/health",
299
+ pathParams: {},
300
+ query: void 0,
301
+ idempotent: true,
302
+ signal: options?.signal
303
+ });
304
+ }
305
+ };
306
+ //#endregion
307
+ //#region src/resources/collections.ts
308
+ var CollectionsResource = class {
309
+ core;
310
+ constructor(core) {
311
+ this.core = core;
312
+ }
313
+ /**
314
+ *
315
+ * Create a new collection
316
+ *
317
+ * Create a new collection and automatically add the creating user
318
+ * to it.
319
+ *
320
+ * This endpoint allows authenticated users to create a new collection
321
+ * with a specified name and optional description. The user creating
322
+ * the collection is automatically added as a member.
323
+ * @operationId collections.create
324
+ * @endpoint POST /v1/collections
325
+ */
326
+ async create(params, options) {
327
+ return this.core.request({
328
+ method: "POST",
329
+ path: "/v1/collections",
330
+ pathParams: {},
331
+ query: void 0,
332
+ body: params.body,
333
+ idempotent: false,
334
+ signal: options?.signal
335
+ });
336
+ }
337
+ /**
338
+ *
339
+ * Delete collection
340
+ *
341
+ * Delete an existing collection.
342
+ *
343
+ * This endpoint allows deletion of a collection identified by its
344
+ * UUID. The user must have appropriate permissions to delete the
345
+ * collection. Deleting a collection removes all associations but does
346
+ * not delete the engrams within it.
347
+ * @operationId collections.delete
348
+ * @endpoint DELETE /v1/collections/{id}
349
+ */
350
+ async delete(id, options) {
351
+ return this.core.request({
352
+ method: "DELETE",
353
+ path: "/v1/collections/{id}",
354
+ pathParams: { id },
355
+ query: void 0,
356
+ idempotent: true,
357
+ signal: options?.signal
358
+ });
359
+ }
360
+ /**
361
+ *
362
+ * List collections
363
+ *
364
+ * Returns a cursor-paginated list of collections the authenticated
365
+ * user has access to.
366
+ *
367
+ * Results can be filtered by providing specific collection IDs.
368
+ * Regular users will only see collections they own or have access to.
369
+ * Superusers can see all collections.
370
+ *
371
+ * The collections are returned in order of last modification, with
372
+ * most recent first.
373
+ * @operationId collections.list
374
+ * @endpoint GET /v1/collections
375
+ */
376
+ async list(params = {}, options) {
377
+ return this.core.request({
378
+ method: "GET",
379
+ path: "/v1/collections",
380
+ pathParams: {},
381
+ query: {
382
+ ids: params.ids,
383
+ name: params.name,
384
+ cursor: params.cursor,
385
+ limit: params.limit,
386
+ owner_only: params.ownerOnly,
387
+ workspace_id: params.workspaceId
388
+ },
389
+ idempotent: true,
390
+ signal: options?.signal
391
+ });
392
+ }
393
+ /**
394
+ *
395
+ * Get collection details
396
+ *
397
+ * Get details of a specific collection.
398
+ *
399
+ * This endpoint retrieves detailed information about a single
400
+ * collection identified by its UUID. The user must have access to the
401
+ * collection to view its details.
402
+ * @operationId collections.retrieve
403
+ * @endpoint GET /v1/collections/{id}
404
+ */
405
+ async retrieve(id, options) {
406
+ return this.core.request({
407
+ method: "GET",
408
+ path: "/v1/collections/{id}",
409
+ pathParams: { id },
410
+ query: void 0,
411
+ idempotent: true,
412
+ signal: options?.signal
413
+ });
414
+ }
415
+ /**
416
+ *
417
+ * Get a collection by name
418
+ *
419
+ * Retrieve a collection by its (owner_id, name) combination.
420
+ *
421
+ * The authenticated user can only fetch collections they own, or, if
422
+ * superuser, from anyone.
423
+ * @operationId collections.retrieveByName
424
+ * @endpoint GET /v1/collections/name/{collection_name}
425
+ */
426
+ async retrieveByName(params, options) {
427
+ return this.core.request({
428
+ method: "GET",
429
+ path: "/v1/collections/name/{collection_name}",
430
+ pathParams: { collection_name: params.collectionName },
431
+ query: { owner_id: params.ownerId },
432
+ idempotent: true,
433
+ signal: options?.signal
434
+ });
435
+ }
436
+ /**
437
+ *
438
+ * Update collection
439
+ *
440
+ * Update an existing collection's configuration.
441
+ *
442
+ * This endpoint allows updating the name, description, and access settings of an
443
+ * existing collection. The user must have appropriate permissions to
444
+ * modify the collection.
445
+ * @operationId collections.update
446
+ * @endpoint POST /v1/collections/{id}
447
+ */
448
+ async update(params, options) {
449
+ return this.core.request({
450
+ method: "POST",
451
+ path: "/v1/collections/{id}",
452
+ pathParams: { id: params.id },
453
+ query: void 0,
454
+ body: params.body,
455
+ idempotent: false,
456
+ signal: options?.signal
457
+ });
458
+ }
459
+ };
460
+ //#endregion
461
+ //#region src/resources/connectors.ts
462
+ var ConnectorsResource = class {
463
+ core;
464
+ constructor(core) {
465
+ this.core = core;
466
+ }
467
+ /**
468
+ *
469
+ * Start OAuth connection flow
470
+ *
471
+ * Start the OAuth connection flow for the given external provider. Returns the authorization URL the user should visit to grant Nebula access. After consent the provider redirects back to Nebula and the connection becomes active.
472
+ * @operationId connectors.connect
473
+ * @endpoint POST /v1/connectors/{provider}/connect
474
+ */
475
+ async connect(params, options) {
476
+ return this.core.request({
477
+ method: "POST",
478
+ path: "/v1/connectors/{provider}/connect",
479
+ pathParams: { provider: params.provider },
480
+ query: void 0,
481
+ body: params.body,
482
+ idempotent: false,
483
+ signal: options?.signal
484
+ });
485
+ }
486
+ /**
487
+ *
488
+ * Disconnect an external data source
489
+ *
490
+ * Disconnect the named connection, revoking the stored OAuth credentials and stopping future syncs. Optionally pass `delete_memories=true` to also remove every memory this connection had ingested.
491
+ * @operationId connectors.disconnect
492
+ * @endpoint DELETE /v1/connectors/{connection_id}
493
+ */
494
+ async disconnect(params, options) {
495
+ return this.core.request({
496
+ method: "DELETE",
497
+ path: "/v1/connectors/{connection_id}",
498
+ pathParams: { connection_id: params.connectionId },
499
+ query: { delete_memories: params.deleteMemories },
500
+ idempotent: true,
501
+ signal: options?.signal
502
+ });
503
+ }
504
+ /**
505
+ *
506
+ * List active connections for a collection
507
+ *
508
+ * Return every connector connection associated with the given collection, with encrypted credentials redacted. Useful for showing the user which third-party data sources are wired up to a collection.
509
+ * @operationId connectors.list
510
+ * @endpoint GET /v1/connectors
511
+ */
512
+ async list(params, options) {
513
+ return this.core.request({
514
+ method: "GET",
515
+ path: "/v1/connectors",
516
+ pathParams: {},
517
+ query: { collection_id: params.collectionId },
518
+ idempotent: true,
519
+ signal: options?.signal
520
+ });
521
+ }
522
+ /**
523
+ *
524
+ * List available connector providers
525
+ *
526
+ * Return the set of connector provider identifiers (e.g. `google_drive`, `slack`) that this Nebula instance is configured to expose. Pass one of these to `POST /connectors/{provider}/connect` to start an OAuth flow.
527
+ * @operationId connectors.listProviders
528
+ * @endpoint GET /v1/connectors/providers
529
+ */
530
+ async listProviders(options) {
531
+ return this.core.request({
532
+ method: "GET",
533
+ path: "/v1/connectors/providers",
534
+ pathParams: {},
535
+ query: void 0,
536
+ idempotent: true,
537
+ signal: options?.signal
538
+ });
539
+ }
540
+ /**
541
+ *
542
+ * Get a single connection by ID
543
+ *
544
+ * Fetch a single connector connection by its UUID. Returns the connection metadata plus whether the underlying subscription is active. Encrypted credentials are never returned to clients.
545
+ * @operationId connectors.retrieve
546
+ * @endpoint GET /v1/connectors/{connection_id}
547
+ */
548
+ async retrieve(connectionId, options) {
549
+ return this.core.request({
550
+ method: "GET",
551
+ path: "/v1/connectors/{connection_id}",
552
+ pathParams: { connection_id: connectionId },
553
+ query: void 0,
554
+ idempotent: true,
555
+ signal: options?.signal
556
+ });
557
+ }
558
+ /**
559
+ *
560
+ * Manually trigger a sync
561
+ *
562
+ * Schedule an immediate sync for an active connection, bypassing the normal cadence. Returns 409 if a sync is already in progress and 400 if the connection isn't in the `active` state.
563
+ * @operationId connectors.sync
564
+ * @endpoint POST /v1/connectors/{connection_id}/sync
565
+ */
566
+ async sync(connectionId, options) {
567
+ return this.core.request({
568
+ method: "POST",
569
+ path: "/v1/connectors/{connection_id}/sync",
570
+ pathParams: { connection_id: connectionId },
571
+ query: void 0,
572
+ idempotent: true,
573
+ signal: options?.signal
574
+ });
575
+ }
576
+ };
577
+ //#endregion
578
+ //#region src/resources/memories.ts
579
+ var MemoriesResource = class {
580
+ core;
581
+ constructor(core) {
582
+ this.core = core;
583
+ }
584
+ /**
585
+ *
586
+ * Append content to an engram
587
+ *
588
+ * Append content to an existing engram.
589
+ *
590
+ * **For conversation engrams:**
591
+ * - Provide `messages` array with content, role, and optional metadata
592
+ * - Works like `/conversations/{id}/messages` endpoint
593
+ *
594
+ * **For document engrams:**
595
+ * - Provide either `raw_text` or `chunks` to append additional content
596
+ * - Content will be processed and added to the engram
597
+ * @operationId memories.append
598
+ * @endpoint POST /v1/memories/{id}/append
599
+ */
600
+ async append(params, options) {
601
+ return this.core.request({
602
+ method: "POST",
603
+ path: "/v1/memories/{id}/append",
604
+ pathParams: { id: params.id },
605
+ query: void 0,
606
+ body: params.body,
607
+ idempotent: false,
608
+ signal: options?.signal
609
+ });
610
+ }
611
+ /**
612
+ *
613
+ * Create a new memory (conversation or document)
614
+ *
615
+ * Create a new memory (conversation or document) using clean JSON body.
616
+ *
617
+ * - Use `collection_id` (UUID)
618
+ * - `kind` is optional and inferred from payload shape:
619
+ * - If `messages` present -> conversation
620
+ * - Otherwise -> document
621
+ * - For conversations: provide `messages` array
622
+ * - For documents: provide `raw_text` or `chunks`
623
+ * - Use `snapshot` for device-memory mode (mutually exclusive with collection_id)
624
+ * @operationId memories.create
625
+ * @endpoint POST /v1/memories
626
+ */
627
+ async create(params, options) {
628
+ return this.core.request({
629
+ method: "POST",
630
+ path: "/v1/memories",
631
+ pathParams: {},
632
+ query: void 0,
633
+ body: params.body,
634
+ idempotent: false,
635
+ signal: options?.signal
636
+ });
637
+ }
638
+ /**
639
+ *
640
+ * Get presigned URL for large file upload
641
+ *
642
+ * Get a presigned URL for uploading large files directly to S3.
643
+ *
644
+ * Use this for files larger than 5MB that cannot be sent inline as base64.
645
+ * After uploading, reference the file in memory creation using S3FileReference.
646
+ *
647
+ * Args:
648
+ * filename: Original filename (e.g., "image.jpg")
649
+ * content_type: MIME type (e.g., "image/jpeg", "application/pdf")
650
+ * file_size: Expected file size in bytes (max 100MB)
651
+ *
652
+ * Returns:
653
+ * dict with:
654
+ * - upload_url: Presigned URL for PUT request (expires in 1 hour)
655
+ * - upload_headers: Headers that must be sent with the presigned PUT request
656
+ * - s3_key: The S3 key to reference in memory creation
657
+ * - bucket: S3 bucket name
658
+ * - expires_in: Seconds until URL expires
659
+ * - max_size: Maximum allowed file size
660
+ * @operationId memories.createUpload
661
+ * @endpoint POST /v1/memories/upload
662
+ */
663
+ async createUpload(params, options) {
664
+ return this.core.request({
665
+ method: "POST",
666
+ path: "/v1/memories/upload",
667
+ pathParams: {},
668
+ query: {
669
+ filename: params.filename,
670
+ content_type: params.contentType,
671
+ file_size: params.fileSize
672
+ },
673
+ idempotent: false,
674
+ signal: options?.signal
675
+ });
676
+ }
677
+ /**
678
+ *
679
+ * Delete an engram
680
+ *
681
+ * Delete a specific engram with graph awareness. All chunks corresponding to the
682
+ * engram are deleted, and graph components (entities/relationships) are updated
683
+ * or deleted based on remaining chunk references from other engrams.
684
+ *
685
+ * This method now properly handles graph components and maintains graph integrity
686
+ * for search operations.
687
+ * @operationId memories.delete
688
+ * @endpoint DELETE /v1/memories/{id}
689
+ */
690
+ async delete(id, options) {
691
+ return this.core.request({
692
+ method: "DELETE",
693
+ path: "/v1/memories/{id}",
694
+ pathParams: { id },
695
+ query: void 0,
696
+ idempotent: false,
697
+ signal: options?.signal
698
+ });
699
+ }
700
+ /**
701
+ *
702
+ * Delete one or more engrams
703
+ *
704
+ * Delete one or more engrams.
705
+ *
706
+ * This endpoint efficiently handles both single and batch deletions.
707
+ * When multiple IDs are provided, it uses optimized batch operations.
708
+ *
709
+ * Args:
710
+ * ids: Either a single UUID or a list of UUIDs to delete
711
+ *
712
+ * Returns:
713
+ * For single deletion: boolean success response
714
+ * For batch deletion: detailed results with successful and failed deletions
715
+ * @operationId memories.deleteMany
716
+ * @endpoint POST /v1/memories/delete
717
+ */
718
+ async deleteMany(params, options) {
719
+ return this.core.request({
720
+ method: "POST",
721
+ path: "/v1/memories/delete",
722
+ pathParams: {},
723
+ query: void 0,
724
+ body: params.body,
725
+ idempotent: false,
726
+ signal: options?.signal
727
+ });
728
+ }
729
+ /**
730
+ *
731
+ * Delete a previously uploaded S3 file
732
+ *
733
+ * Delete a file from S3 that was uploaded via a presigned URL.
734
+ * Verifies the caller owns the file via S3 object metadata.
735
+ * @operationId memories.deleteUpload
736
+ * @endpoint DELETE /v1/memories/upload
737
+ */
738
+ async deleteUpload(params, options) {
739
+ return this.core.request({
740
+ method: "DELETE",
741
+ path: "/v1/memories/upload",
742
+ pathParams: {},
743
+ query: { s3_key: params.s3Key },
744
+ idempotent: true,
745
+ signal: options?.signal
746
+ });
747
+ }
748
+ /**
749
+ *
750
+ * List engrams
751
+ *
752
+ * Returns a cursor-paginated list of engrams the authenticated user
753
+ * has access to.
754
+ *
755
+ * Results can be filtered by providing specific engram IDs or collection IDs.
756
+ * Regular users will only see engrams they own or have access to through
757
+ * collections. Superusers can see all engrams.
758
+ *
759
+ * The engrams are returned in order of creation time, most recent
760
+ * first. The response includes the engram's text field if available.
761
+ * @operationId memories.list
762
+ * @endpoint GET /v1/memories
763
+ */
764
+ async list(params = {}, options) {
765
+ return this.core.request({
766
+ method: "GET",
767
+ path: "/v1/memories",
768
+ pathParams: {},
769
+ query: {
770
+ ids: params.ids,
771
+ cursor: params.cursor,
772
+ limit: params.limit,
773
+ chunks_limit: params.chunksLimit,
774
+ owner_only: params.ownerOnly,
775
+ collection_ids: params.collectionIds,
776
+ metadata_filters: params.metadataFilters,
777
+ min_applied_wal_seq: params.minAppliedWalSeq
778
+ },
779
+ idempotent: true,
780
+ signal: options?.signal
781
+ });
782
+ }
783
+ /**
784
+ *
785
+ * Recall workflow patterns by intent
786
+ *
787
+ * Workflow-pattern recall over 5 intents.
788
+ *
789
+ * * ``cursor`` -- match the caller's anchor against pattern
790
+ * canonical states, return ranked patterns + position.
791
+ * * ``predict`` -- like cursor but include the predicted next
792
+ * trace from each pattern's canonical instance.
793
+ * * ``resume`` -- like cursor, biased toward longer patterns.
794
+ * * ``evidence`` -- expand a specific pattern via
795
+ * ``hydrate_pattern``.
796
+ * * ``bootstrap`` -- top-K patterns by confidence with no anchor.
797
+ * @operationId memories.recallWorkflow
798
+ * @endpoint POST /v1/memories/workflow/recall
799
+ */
800
+ async recallWorkflow(params, options) {
801
+ return this.core.request({
802
+ method: "POST",
803
+ path: "/v1/memories/workflow/recall",
804
+ pathParams: {},
805
+ query: void 0,
806
+ body: params.body,
807
+ idempotent: false,
808
+ signal: options?.signal
809
+ });
810
+ }
811
+ /**
812
+ *
813
+ * Retrieve an engram
814
+ *
815
+ * Retrieves detailed information about a specific engram by its
816
+ * ID.
817
+ *
818
+ * This endpoint returns the engram's metadata, status, and system information. It does not
819
+ * return the engram's content - use the `/engrams/{id}/download` endpoint for that.
820
+ *
821
+ * Users can only retrieve engrams they own or have access to through collections.
822
+ * Superusers can retrieve any engram.
823
+ * @operationId memories.retrieve
824
+ * @endpoint GET /v1/memories/{id}
825
+ */
826
+ async retrieve(id, options) {
827
+ return this.core.request({
828
+ method: "GET",
829
+ path: "/v1/memories/{id}",
830
+ pathParams: { id },
831
+ query: void 0,
832
+ idempotent: true,
833
+ signal: options?.signal
834
+ });
835
+ }
836
+ /**
837
+ *
838
+ * Search memories
839
+ *
840
+ * Perform a search query across your memories.
841
+ *
842
+ * **Standard mode** (collection_ids or readable-scope search): returns hierarchical MemoryRecall
843
+ * with semantics, episodes, procedures, and sources.
844
+ *
845
+ * **Snapshot mode** (snapshot field): returns graph-search results with
846
+ * {entities, relationships} from stateless in-memory traversal.
847
+ * @operationId memories.search
848
+ * @endpoint POST /v1/memories/search
849
+ */
850
+ async search(params, options) {
851
+ return this.core.request({
852
+ method: "POST",
853
+ path: "/v1/memories/search",
854
+ pathParams: {},
855
+ query: void 0,
856
+ body: params.body,
857
+ idempotent: false,
858
+ signal: options?.signal
859
+ });
860
+ }
861
+ /**
862
+ *
863
+ * Update a memory
864
+ *
865
+ * Update memory-level properties including name, metadata, and collection associations.
866
+ *
867
+ * This endpoint allows updating properties of an entire memory (document or conversation)
868
+ * without modifying its content:
869
+ * - **name**: Updates the authoritative engram title
870
+ * - **metadata**: Can replace or merge with existing metadata
871
+ * - **collection_ids**: Updates authoritative engram collection associations
872
+ *
873
+ * Users can only update memories they own or have access to through collections.
874
+ * At least one collection association must be maintained.
875
+ *
876
+ * If collection_id is provided and the engram is shared across collections, a copy-on-write
877
+ * will be performed to create a collection-specific copy before modification.
878
+ * @operationId memories.update
879
+ * @endpoint PATCH /v1/memories/{id}
880
+ */
881
+ async update(params, options) {
882
+ return this.core.request({
883
+ method: "PATCH",
884
+ path: "/v1/memories/{id}",
885
+ pathParams: { id: params.id },
886
+ query: { collection_id: params.collectionId },
887
+ body: params.body,
888
+ idempotent: false,
889
+ signal: options?.signal
890
+ });
891
+ }
892
+ };
893
+ //#endregion
894
+ //#region src/resources/snapshots.ts
895
+ var SnapshotsResource = class {
896
+ core;
897
+ constructor(core) {
898
+ this.core = core;
899
+ }
900
+ /**
901
+ *
902
+ * Export a collection snapshot
903
+ *
904
+ * Export a collection's full graph state as a
905
+ * portable SnapshotEnvelope.
906
+ * @operationId snapshots.export
907
+ * @endpoint POST /v1/device-memory/snapshot/export
908
+ */
909
+ async export(params, options) {
910
+ return this.core.request({
911
+ method: "POST",
912
+ path: "/v1/device-memory/snapshot/export",
913
+ pathParams: {},
914
+ query: void 0,
915
+ body: params.body,
916
+ idempotent: true,
917
+ signal: options?.signal
918
+ });
919
+ }
920
+ /**
921
+ *
922
+ * Import a snapshot into an ephemeral collection
923
+ *
924
+ * Import a SnapshotEnvelope into an ephemeral
925
+ * collection. Returns the ephemeral collection UUID.
926
+ * @operationId snapshots.import
927
+ * @endpoint POST /v1/device-memory/snapshot/import
928
+ */
929
+ async import(params, options) {
930
+ return this.core.request({
931
+ method: "POST",
932
+ path: "/v1/device-memory/snapshot/import",
933
+ pathParams: {},
934
+ query: void 0,
935
+ body: params.body,
936
+ idempotent: false,
937
+ signal: options?.signal
938
+ });
939
+ }
940
+ };
941
+ //#endregion
942
+ //#region src/client.ts
943
+ var NebulaClient = class {
944
+ core;
945
+ client;
946
+ collections;
947
+ connectors;
948
+ memories;
949
+ snapshots;
950
+ constructor(options = {}) {
951
+ this.core = new NebulaCore(options);
952
+ this.client = new ClientResource(this.core);
953
+ this.collections = new CollectionsResource(this.core);
954
+ this.connectors = new ConnectorsResource(this.core);
955
+ this.memories = new MemoriesResource(this.core);
956
+ this.snapshots = new SnapshotsResource(this.core);
957
+ }
958
+ };
959
+ //#endregion
960
+ //#region src/lib/_dx_generated.ts
961
+ /** Strip a `results` envelope at runtime; matches `Unwrapped<>`. */
962
+ function unwrap$1(p) {
963
+ return p.then((r) => {
964
+ if (r !== null && typeof r === "object" && "results" in r) return r.results;
965
+ return r;
966
+ });
967
+ }
968
+ /**
969
+ * Generated DX layer: simple unwrap/passthrough convenience methods.
970
+ * Signatures are derived from the underlying resource methods so
971
+ * callers see the same arg names + types in IDE hover.
972
+ */
973
+ var NebulaDX = class extends NebulaClient {
974
+ /** Retrieve a single memory by id and return just the data. (generated from dx-extensions.yaml). */
975
+ async getMemory(...args) {
976
+ return unwrap$1(this.memories.retrieve(...args));
977
+ }
978
+ /** Update a memory by id; returns the updated record. (generated from dx-extensions.yaml). */
979
+ async updateMemory(...args) {
980
+ return unwrap$1(this.memories.update(...args));
981
+ }
982
+ /** Liveness probe with the wire envelope unwrapped. (generated from dx-extensions.yaml). */
983
+ async healthCheck(...args) {
984
+ return unwrap$1(this.client.health(...args));
985
+ }
986
+ /** unwrap → collections.create (generated from dx-extensions.yaml). */
987
+ async createCollection(...args) {
988
+ return unwrap$1(this.collections.create(...args));
989
+ }
990
+ /** unwrap → collections.retrieve (generated from dx-extensions.yaml). */
991
+ async getCollection(...args) {
992
+ return unwrap$1(this.collections.retrieve(...args));
993
+ }
994
+ /** unwrap → collections.retrieveByName (generated from dx-extensions.yaml). */
995
+ async getCollectionByName(...args) {
996
+ return unwrap$1(this.collections.retrieveByName(...args));
997
+ }
998
+ /** unwrap → collections.list (generated from dx-extensions.yaml). */
999
+ async listCollections(...args) {
1000
+ return unwrap$1(this.collections.list(...args));
1001
+ }
1002
+ /** unwrap → collections.update (generated from dx-extensions.yaml). */
1003
+ async updateCollection(...args) {
1004
+ return unwrap$1(this.collections.update(...args));
1005
+ }
1006
+ /** unwrap → connectors.listProviders (generated from dx-extensions.yaml). */
1007
+ async listProviders(...args) {
1008
+ return unwrap$1(this.connectors.listProviders(...args));
1009
+ }
1010
+ /** unwrap → connectors.retrieve (generated from dx-extensions.yaml). */
1011
+ async getConnection(...args) {
1012
+ return unwrap$1(this.connectors.retrieve(...args));
1013
+ }
1014
+ /** unwrap → connectors.sync (generated from dx-extensions.yaml). */
1015
+ async triggerSync(...args) {
1016
+ return unwrap$1(this.connectors.sync(...args));
1017
+ }
1018
+ /** unwrap → memories.createUpload (generated from dx-extensions.yaml). */
1019
+ async getUploadUrl(...args) {
1020
+ return unwrap$1(this.memories.createUpload(...args));
1021
+ }
1022
+ /** unwrap → snapshots.export (generated from dx-extensions.yaml). */
1023
+ async exportSnapshot(...args) {
1024
+ return unwrap$1(this.snapshots.export(...args));
1025
+ }
1026
+ /** unwrap → snapshots.import (generated from dx-extensions.yaml). */
1027
+ async importSnapshot(...args) {
1028
+ return unwrap$1(this.snapshots.import(...args));
1029
+ }
1030
+ };
1031
+ //#endregion
1032
+ //#region src/lib/dx.ts
1033
+ var Nebula = class extends NebulaDX {
1034
+ constructor(options = {}) {
1035
+ super(normalizeAuthOptions(normalizeClientOptions(options)));
1036
+ }
1037
+ /**
1038
+ * Polymorphic memory creator: dispatches to memories.create or memories.append
1039
+ * based on whether `memory_id` is set on the input. Returns the new memory's
1040
+ * id (string), or — when `snapshot` is set — the updated snapshot envelope.
1041
+ */
1042
+ async storeMemory(memory, options) {
1043
+ if ("memory_id" in memory && memory.memory_id != null) {
1044
+ const memoryID = memory.memory_id;
1045
+ await this.memories.append({
1046
+ id: memoryID,
1047
+ body: toMemoryAppendParams(memory)
1048
+ }, options);
1049
+ return memoryID;
1050
+ }
1051
+ const result = unwrapResults(await this.memories.create({ body: toMemoryCreateParams(memory) }, options));
1052
+ if (isSnapshotResult(result)) return result.snapshot ?? result;
1053
+ return extractID(result);
1054
+ }
1055
+ /**
1056
+ * Bulk parallel version of storeMemory with a concurrency cap.
1057
+ *
1058
+ * Default 8 concurrent in-flight requests matches the Python DX's
1059
+ * `asyncio.Semaphore(max_concurrency)` pattern. Use `maxConcurrency: 1`
1060
+ * for strictly serial submission; higher values risk overwhelming the
1061
+ * server when memories[] is large.
1062
+ */
1063
+ async storeMemories(memories, options) {
1064
+ const cap = Math.max(1, options?.maxConcurrency ?? 8);
1065
+ const signal = options?.signal;
1066
+ const results = new Array(memories.length);
1067
+ let nextIndex = 0;
1068
+ const worker = async () => {
1069
+ while (true) {
1070
+ const i = nextIndex++;
1071
+ if (i >= memories.length) return;
1072
+ results[i] = await this.storeMemory(memories[i], { signal });
1073
+ }
1074
+ };
1075
+ await Promise.all(Array.from({ length: Math.min(cap, memories.length) }, () => worker()));
1076
+ return results;
1077
+ }
1078
+ /**
1079
+ * List memories scoped to one or more collection ids (string | string[])
1080
+ * or a full MemoryListParams object.
1081
+ */
1082
+ async listMemories(query, options) {
1083
+ const normalized = typeof query === "string" || Array.isArray(query) ? { collectionIds: arrayify(query) } : query;
1084
+ return unwrap(this.memories.list(normalized, options));
1085
+ }
1086
+ /**
1087
+ * Memory search shortcut: unwraps `results`. (Affinity-header injection
1088
+ * is a planned enhancement; currently delegates straight to the resource.)
1089
+ */
1090
+ async search(body, options) {
1091
+ return unwrap(this.memories.search({ body }, options));
1092
+ }
1093
+ /**
1094
+ * deleteCollection coerces the wire {success: bool} envelope into a Python-
1095
+ * style boolean return.
1096
+ */
1097
+ async deleteCollection(id, options) {
1098
+ const result = unwrapResults(await this.collections.delete(id, options));
1099
+ return Boolean(result.success);
1100
+ }
1101
+ createCluster = this.createCollection;
1102
+ getCluster = this.getCollection;
1103
+ getClusterByName = this.getCollectionByName;
1104
+ listClusters = this.listCollections;
1105
+ updateCluster = this.updateCollection;
1106
+ deleteCluster = this.deleteCollection;
1107
+ /**
1108
+ * Positional `connectProvider(provider, collectionID, config?)` — wraps the
1109
+ * generated `connectors.connect({provider, body})` to build the body shape.
1110
+ */
1111
+ async connectProvider(provider, collectionID, config, options) {
1112
+ const body = {
1113
+ collection_id: collectionID,
1114
+ ...config !== void 0 ? { config } : {}
1115
+ };
1116
+ return unwrap(this.connectors.connect({
1117
+ provider,
1118
+ body
1119
+ }, options));
1120
+ }
1121
+ /** Positional listConnections(collectionID) — wraps the query wrapper. */
1122
+ async listConnections(collectionID, options) {
1123
+ return unwrap(this.connectors.list({ collectionId: collectionID }, options));
1124
+ }
1125
+ /** Positional disconnect(connectionID, deleteMemories?). */
1126
+ async disconnectConnection(connectionID, deleteMemories = false, options) {
1127
+ return unwrap(this.connectors.disconnect({
1128
+ connectionId: connectionID,
1129
+ deleteMemories
1130
+ }, options));
1131
+ }
1132
+ /** Alias for disconnectConnection (same arg shape). */
1133
+ async disconnect(connectionID, deleteMemories = false, options) {
1134
+ return unwrap(this.connectors.disconnect({
1135
+ connectionId: connectionID,
1136
+ deleteMemories
1137
+ }, options));
1138
+ }
1139
+ /** Single-id delete; coerces 204 to boolean true. */
1140
+ async deleteMemory(memoryID, options) {
1141
+ await this.memories.delete(memoryID, options);
1142
+ return true;
1143
+ }
1144
+ /** Bulk delete by ids. */
1145
+ async deleteMemories(memoryIDs, options) {
1146
+ return this.memories.deleteMany({ body: memoryIDs }, options);
1147
+ }
1148
+ /**
1149
+ * Polymorphic delete: dispatches based on argument type.
1150
+ * - `delete("/some/path")` -> raw HTTP DELETE (escape hatch; not implemented)
1151
+ * - `delete("memory-id")` -> deleteMemory
1152
+ * - `delete(["id1", "id2"])` -> deleteMemories (bulk)
1153
+ */
1154
+ async delete(pathOrMemoryIDs, options) {
1155
+ if (Array.isArray(pathOrMemoryIDs)) return this.deleteMemories(pathOrMemoryIDs, options);
1156
+ if (isRequestPath(pathOrMemoryIDs)) throw new Error(`delete("${pathOrMemoryIDs}") raw-path escape hatch is not implemented in this SDK yet`);
1157
+ return this.deleteMemory(pathOrMemoryIDs, options);
1158
+ }
1159
+ };
1160
+ function normalizeAuthOptions(options) {
1161
+ if (options.apiKey != null && options.bearerToken == null && !looksLikeNebulaAPIKey(options.apiKey)) return {
1162
+ ...options,
1163
+ apiKey: void 0,
1164
+ bearerToken: options.apiKey
1165
+ };
1166
+ return options;
1167
+ }
1168
+ function normalizeClientOptions(options) {
1169
+ const { api_key: apiKeyAlias, apiKey, baseUrl: baseUrlAlias, baseURL: baseURLCapAlias, base_url: baseUrlSnakeAlias, timeout: timeoutAlias, bearerToken, bearer_token: bearerTokenAlias, accessToken, access_token: accessTokenAlias, ...rest } = options;
1170
+ const restClientOptions = rest;
1171
+ return {
1172
+ ...restClientOptions,
1173
+ apiKey: firstDefined(apiKey, apiKeyAlias) ?? void 0,
1174
+ bearerToken: firstDefined(bearerToken, bearerTokenAlias, accessToken, accessTokenAlias) ?? void 0,
1175
+ baseUrl: firstDefined(restClientOptions.baseUrl, baseUrlAlias, baseURLCapAlias, baseUrlSnakeAlias) ?? void 0,
1176
+ timeoutMs: firstDefined(restClientOptions.timeoutMs, timeoutAlias) ?? void 0
1177
+ };
1178
+ }
1179
+ function firstDefined(...values) {
1180
+ return values.find((value) => value !== void 0);
1181
+ }
1182
+ function looksLikeNebulaAPIKey(token) {
1183
+ const parts = token.split(".");
1184
+ if (parts.length !== 2) return false;
1185
+ const [publicPart, rawPart] = parts;
1186
+ return Boolean(rawPart) && (publicPart.startsWith("key_") || publicPart.startsWith("neb_"));
1187
+ }
1188
+ function toMemoryCreateParams(memory) {
1189
+ const collectionID = memory.collection_id ?? memory.collectionId ?? void 0;
1190
+ const { collectionId: _ignore, content, memory_id: _ignoreMemoryID, ...rest } = memory;
1191
+ const params = { ...rest };
1192
+ if (collectionID !== void 0) params.collection_id = collectionID;
1193
+ if (content != null) if (typeof content === "string") params.raw_text = content;
1194
+ else params.content_parts = content;
1195
+ if (params.messages != null && !params.engram_type) params.engram_type = "conversation";
1196
+ return params;
1197
+ }
1198
+ function toMemoryAppendParams(memory) {
1199
+ const collectionID = memory.collection_id ?? memory.collectionId ?? void 0;
1200
+ if (!collectionID) throw new Error("collection_id is required when appending to an existing memory");
1201
+ const params = { collection_id: collectionID };
1202
+ for (const key of [
1203
+ "metadata",
1204
+ "ingestion_config",
1205
+ "ingestion_mode",
1206
+ "raw_text",
1207
+ "chunks",
1208
+ "messages"
1209
+ ]) {
1210
+ const value = memory[key];
1211
+ if (value != null) params[key] = value;
1212
+ }
1213
+ const content = memory.content;
1214
+ if (content != null) {
1215
+ if (typeof content === "string") params.raw_text = content;
1216
+ else if (Array.isArray(content) && content.every((item) => typeof item === "string")) params.chunks = content;
1217
+ else if (Array.isArray(content)) params.messages = content;
1218
+ }
1219
+ return params;
1220
+ }
1221
+ function unwrap(promise) {
1222
+ return Promise.resolve(promise).then((response) => unwrapResults(response));
1223
+ }
1224
+ function unwrapResults(response) {
1225
+ if (response !== null && typeof response === "object" && "results" in response) return response.results;
1226
+ return response;
1227
+ }
1228
+ function extractID(value) {
1229
+ if (typeof value === "object" && value !== null) {
1230
+ const record = value;
1231
+ const id = record["id"] ?? record["memory_id"] ?? record["engram_id"] ?? record["ephemeral_collection_id"];
1232
+ if (typeof id === "string") return id;
1233
+ }
1234
+ throw new Error("Nebula memory create response did not include an id");
1235
+ }
1236
+ function isSnapshotResult(value) {
1237
+ return typeof value === "object" && value !== null && "snapshot" in value;
1238
+ }
1239
+ function arrayify(value) {
1240
+ return Array.isArray(value) ? value : [value];
1241
+ }
1242
+ function isRequestPath(value) {
1243
+ return value.startsWith("/") || /^https?:\/\//i.test(value);
1244
+ }
1245
+ //#endregion
1246
+ exports.DEFAULT_RETRY = DEFAULT_RETRY;
1247
+ exports.Nebula = Nebula;
1248
+ exports.NebulaAPIError = NebulaAPIError;
1249
+ exports.NebulaBadRequestError = NebulaBadRequestError;
1250
+ exports.NebulaClient = NebulaClient;
1251
+ exports.NebulaConflictError = NebulaConflictError;
1252
+ exports.NebulaConnectionError = NebulaConnectionError;
1253
+ exports.NebulaCore = NebulaCore;
1254
+ exports.NebulaError = NebulaError;
1255
+ exports.NebulaForbiddenError = NebulaForbiddenError;
1256
+ exports.NebulaNotFoundError = NebulaNotFoundError;
1257
+ exports.NebulaRateLimitError = NebulaRateLimitError;
1258
+ exports.NebulaServerError = NebulaServerError;
1259
+ exports.NebulaTimeoutError = NebulaTimeoutError;
1260
+ exports.NebulaUnauthorizedError = NebulaUnauthorizedError;
1261
+ exports.NebulaValidationError = NebulaValidationError;
1262
+ exports.backoffMs = backoffMs;
1263
+ exports.default = Nebula;
1264
+ exports.errorFromResponse = errorFromResponse;
1265
+ exports.isRetryableStatus = isRetryableStatus;
1266
+ exports.sleep = sleep;
1267
+
1268
+ //# sourceMappingURL=index.cjs.map