@tryvira/sdk 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +104 -70
- package/dist/js-client.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// sdks/js-client.ts
|
|
2
2
|
var ViraApiError = class extends Error {
|
|
3
3
|
status;
|
|
4
4
|
body;
|
|
@@ -15,6 +15,31 @@ var required = (value, code) => {
|
|
|
15
15
|
if (typeof value !== "string" || !value.trim()) throw new Error(code);
|
|
16
16
|
return value;
|
|
17
17
|
};
|
|
18
|
+
var normalizeBaseUrl = (value, allowInsecureLocalhost = false) => {
|
|
19
|
+
let url;
|
|
20
|
+
try {
|
|
21
|
+
url = new URL(required(value, "SDK_BASE_URL_REQUIRED"));
|
|
22
|
+
} catch {
|
|
23
|
+
throw new Error("SDK_BASE_URL_INVALID");
|
|
24
|
+
}
|
|
25
|
+
const hostname = url.hostname.toLowerCase();
|
|
26
|
+
const loopback = hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
27
|
+
if (url.username || url.password || url.search || url.hash) throw new Error("SDK_BASE_URL_INVALID");
|
|
28
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && loopback && allowInsecureLocalhost))
|
|
29
|
+
throw new Error("SDK_HTTPS_REQUIRED");
|
|
30
|
+
return value.replace(/\/$/, "");
|
|
31
|
+
};
|
|
32
|
+
var canonicalJson = (value) => JSON.stringify(
|
|
33
|
+
value,
|
|
34
|
+
(_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([left], [right]) => left.localeCompare(right))) : item
|
|
35
|
+
);
|
|
36
|
+
var contentIdempotencyKey = async (operation, request) => {
|
|
37
|
+
if (!globalThis.crypto?.subtle) throw new Error("SDK_IDEMPOTENCY_CRYPTO_UNAVAILABLE");
|
|
38
|
+
const bytes = new TextEncoder().encode(canonicalJson(request));
|
|
39
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
40
|
+
const hex = [...new Uint8Array(digest)].map((value) => value.toString(16).padStart(2, "0")).join("");
|
|
41
|
+
return `${operation}:${hex}`;
|
|
42
|
+
};
|
|
18
43
|
var wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
19
44
|
var ViraClient = class {
|
|
20
45
|
evaluations;
|
|
@@ -28,10 +53,7 @@ var ViraClient = class {
|
|
|
28
53
|
failureMode;
|
|
29
54
|
defaultHeaders;
|
|
30
55
|
constructor(options) {
|
|
31
|
-
this.baseUrl =
|
|
32
|
-
/\/$/,
|
|
33
|
-
""
|
|
34
|
-
);
|
|
56
|
+
this.baseUrl = normalizeBaseUrl(options.baseUrl, options.allowInsecureLocalhost === true);
|
|
35
57
|
this.apiKey = options.apiKey;
|
|
36
58
|
this.fetcher = options.fetcher ?? fetch;
|
|
37
59
|
this.timeoutMs = Math.max(
|
|
@@ -139,13 +161,15 @@ var ViraClient = class {
|
|
|
139
161
|
listAISystems() {
|
|
140
162
|
return this.request({ method: "GET", path: "/v1/ai-systems" });
|
|
141
163
|
}
|
|
142
|
-
deleteAISystem(systemId, options = {}) {
|
|
164
|
+
async deleteAISystem(systemId, options = {}) {
|
|
143
165
|
required(systemId, "SDK_SYSTEM_ID_REQUIRED");
|
|
144
|
-
|
|
166
|
+
const path = `/v1/ai-systems/${encodeURIComponent(systemId)}`, body = { confirm: options.confirm === true };
|
|
167
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:ai-system:${systemId}`, { path, body }) });
|
|
145
168
|
}
|
|
146
|
-
deleteAISystemCascade(systemId, options = {}) {
|
|
169
|
+
async deleteAISystemCascade(systemId, options = {}) {
|
|
147
170
|
required(systemId, "SDK_SYSTEM_ID_REQUIRED");
|
|
148
|
-
|
|
171
|
+
const path = `/v1/ai-systems/${encodeURIComponent(systemId)}/cleanup`, body = { confirm: options.confirm === true, deleteObservations: options.deleteObservations === true };
|
|
172
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:ai-system-cascade:${systemId}`, { path, body }) });
|
|
149
173
|
}
|
|
150
174
|
getAISystem(systemId) {
|
|
151
175
|
required(systemId, "SDK_SYSTEM_ID_REQUIRED");
|
|
@@ -236,27 +260,30 @@ var ViraClient = class {
|
|
|
236
260
|
query: reviewState ? { reviewState } : void 0
|
|
237
261
|
});
|
|
238
262
|
}
|
|
239
|
-
createSignalDiscoveryProposal(input, options = {}) {
|
|
240
|
-
return this.request({ method: "POST", path: "/v1/signals/discovery-proposals", body: input }, { idempotencyKey: options.idempotencyKey ??
|
|
263
|
+
async createSignalDiscoveryProposal(input, options = {}) {
|
|
264
|
+
return this.request({ method: "POST", path: "/v1/signals/discovery-proposals", body: input }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey("sdk:signal-discovery-proposal", input) });
|
|
241
265
|
}
|
|
242
|
-
reviewSignalDiscoveryProposal(proposalId, decision, options = {}) {
|
|
266
|
+
async reviewSignalDiscoveryProposal(proposalId, decision, options = {}) {
|
|
243
267
|
required(proposalId, "SDK_SIGNAL_PROPOSAL_ID_REQUIRED");
|
|
244
|
-
|
|
268
|
+
const path = `/v1/signals/discovery-proposals/${encodeURIComponent(proposalId)}/review`, body = { decision };
|
|
269
|
+
return this.request({ method: "POST", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`signal-review:${proposalId}`, body) });
|
|
245
270
|
}
|
|
246
|
-
materializeSignalDiscovery(proposalId, input = {}, options = {}) {
|
|
271
|
+
async materializeSignalDiscovery(proposalId, input = {}, options = {}) {
|
|
247
272
|
required(proposalId, "SDK_SIGNAL_PROPOSAL_ID_REQUIRED");
|
|
248
|
-
|
|
273
|
+
const path = `/v1/signals/discovery-proposals/${encodeURIComponent(proposalId)}/materialize`;
|
|
274
|
+
return this.request({ method: "POST", path, body: input }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`signal-materialize:${proposalId}`, input) });
|
|
249
275
|
}
|
|
250
|
-
createSignalMapping(input, options = {}) {
|
|
251
|
-
return this.request({ method: "POST", path: "/v1/signals/mappings", body: input }, { idempotencyKey: options.idempotencyKey ??
|
|
276
|
+
async createSignalMapping(input, options = {}) {
|
|
277
|
+
return this.request({ method: "POST", path: "/v1/signals/mappings", body: input }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey("sdk:signal-mapping", input) });
|
|
252
278
|
}
|
|
253
279
|
getSignalMapping(mappingId) {
|
|
254
280
|
required(mappingId, "SDK_SIGNAL_MAPPING_ID_REQUIRED");
|
|
255
281
|
return this.request({ method: "GET", path: `/v1/signals/mappings/${encodeURIComponent(mappingId)}` });
|
|
256
282
|
}
|
|
257
|
-
reviewSignalMapping(mappingId, input = {}, options = {}) {
|
|
283
|
+
async reviewSignalMapping(mappingId, input = {}, options = {}) {
|
|
258
284
|
required(mappingId, "SDK_SIGNAL_MAPPING_ID_REQUIRED");
|
|
259
|
-
|
|
285
|
+
const path = `/v1/signals/mappings/${encodeURIComponent(mappingId)}/review`;
|
|
286
|
+
return this.request({ method: "POST", path, body: input }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`signal-mapping-review:${mappingId}`, input) });
|
|
260
287
|
}
|
|
261
288
|
connectionHealth(connectionId) {
|
|
262
289
|
required(connectionId, "SDK_CONNECTION_ID_REQUIRED");
|
|
@@ -292,52 +319,48 @@ var ViraClient = class {
|
|
|
292
319
|
path: "/v1/packs"
|
|
293
320
|
});
|
|
294
321
|
}
|
|
295
|
-
deletePack(packId, options = {}) {
|
|
322
|
+
async deletePack(packId, options = {}) {
|
|
296
323
|
required(packId, "SDK_PACK_ID_REQUIRED");
|
|
297
|
-
|
|
324
|
+
const path = `/v1/packs/${encodeURIComponent(packId)}`;
|
|
325
|
+
const body = { confirm: options.confirm === true };
|
|
326
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:pack:${packId}`, { path, body }) });
|
|
298
327
|
}
|
|
299
|
-
importPack(input) {
|
|
328
|
+
async importPack(input) {
|
|
300
329
|
if (!input?.manifest && !input?.archiveBase64)
|
|
301
330
|
throw new Error("SDK_PACK_MANIFEST_OR_ARCHIVE_REQUIRED");
|
|
302
331
|
if (input.archiveBase64 && !input.fileName)
|
|
303
332
|
throw new Error("SDK_PACK_FILE_NAME_REQUIRED");
|
|
333
|
+
const body = {
|
|
334
|
+
...input.manifest ? { manifest: input.manifest } : {},
|
|
335
|
+
objects: input.objects ?? {},
|
|
336
|
+
...input.archiveBase64 ? { archiveBase64: input.archiveBase64, fileName: input.fileName } : {}
|
|
337
|
+
};
|
|
304
338
|
return this.request(
|
|
305
339
|
{
|
|
306
340
|
method: "POST",
|
|
307
341
|
path: "/v1/packs/import",
|
|
308
|
-
body
|
|
309
|
-
...input.manifest ? { manifest: input.manifest } : {},
|
|
310
|
-
objects: input.objects ?? {},
|
|
311
|
-
...input.archiveBase64 ? { archiveBase64: input.archiveBase64, fileName: input.fileName } : {}
|
|
312
|
-
}
|
|
342
|
+
body
|
|
313
343
|
},
|
|
314
|
-
{ idempotencyKey: input.idempotencyKey ??
|
|
344
|
+
{ idempotencyKey: input.idempotencyKey ?? await contentIdempotencyKey("sdk:pack:import", body) }
|
|
315
345
|
);
|
|
316
346
|
}
|
|
317
|
-
installPack(packId, variables = {}) {
|
|
347
|
+
async installPack(packId, variables = {}) {
|
|
318
348
|
required(packId, "SDK_PACK_ID_REQUIRED");
|
|
349
|
+
const path = `/v1/packs/${encodeURIComponent(packId)}/install`;
|
|
350
|
+
const body = { variables };
|
|
319
351
|
return this.request(
|
|
320
|
-
{
|
|
321
|
-
|
|
322
|
-
path: `/v1/packs/${encodeURIComponent(packId)}/install`,
|
|
323
|
-
body: { variables }
|
|
324
|
-
},
|
|
325
|
-
{ idempotencyKey: `sdk:pack:install:${packId}` }
|
|
352
|
+
{ method: "POST", path, body },
|
|
353
|
+
{ idempotencyKey: await contentIdempotencyKey(`sdk:pack:install:${packId}`, body) }
|
|
326
354
|
);
|
|
327
355
|
}
|
|
328
|
-
evaluatePack(packId, input) {
|
|
356
|
+
async evaluatePack(packId, input) {
|
|
329
357
|
required(packId, "SDK_PACK_ID_REQUIRED");
|
|
330
358
|
required(input?.evaluationId, "SDK_EVALUATION_ID_REQUIRED");
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
path: `/v1/packs/${encodeURIComponent(packId)}/evaluate`,
|
|
335
|
-
body: { evaluationId: input.evaluationId }
|
|
336
|
-
},
|
|
337
|
-
{ idempotencyKey: `sdk:pack:evaluate:${packId}` }
|
|
338
|
-
);
|
|
359
|
+
const path = `/v1/packs/${encodeURIComponent(packId)}/evaluate`;
|
|
360
|
+
const body = { evaluationId: input.evaluationId };
|
|
361
|
+
return this.request({ method: "POST", path, body }, { idempotencyKey: await contentIdempotencyKey(`sdk:pack:evaluate:${packId}`, body) });
|
|
339
362
|
}
|
|
340
|
-
approvePack(packId, options = {}) {
|
|
363
|
+
async approvePack(packId, options = {}) {
|
|
341
364
|
required(packId, "SDK_PACK_ID_REQUIRED");
|
|
342
365
|
const body = options.manualApproval ? { manualApproval: true, reason: required(options.reason ?? "", "SDK_MANUAL_PACK_APPROVAL_REASON_REQUIRED") } : {};
|
|
343
366
|
return this.request(
|
|
@@ -346,10 +369,10 @@ var ViraClient = class {
|
|
|
346
369
|
path: `/v1/packs/${encodeURIComponent(packId)}/approve`,
|
|
347
370
|
body
|
|
348
371
|
},
|
|
349
|
-
{ idempotencyKey: `sdk:pack:approve:${packId}
|
|
372
|
+
{ idempotencyKey: await contentIdempotencyKey(`sdk:pack:approve:${packId}`, body) }
|
|
350
373
|
);
|
|
351
374
|
}
|
|
352
|
-
releasePack(packId) {
|
|
375
|
+
async releasePack(packId) {
|
|
353
376
|
required(packId, "SDK_PACK_ID_REQUIRED");
|
|
354
377
|
return this.request(
|
|
355
378
|
{
|
|
@@ -357,10 +380,10 @@ var ViraClient = class {
|
|
|
357
380
|
path: `/v1/packs/${encodeURIComponent(packId)}/release`,
|
|
358
381
|
body: {}
|
|
359
382
|
},
|
|
360
|
-
{ idempotencyKey: `sdk:pack:release:${packId}
|
|
383
|
+
{ idempotencyKey: await contentIdempotencyKey(`sdk:pack:release:${packId}`, {}) }
|
|
361
384
|
);
|
|
362
385
|
}
|
|
363
|
-
previewPackUpgrade(packId, incoming) {
|
|
386
|
+
async previewPackUpgrade(packId, incoming) {
|
|
364
387
|
required(packId, "SDK_PACK_ID_REQUIRED");
|
|
365
388
|
if (!incoming || typeof incoming !== "object")
|
|
366
389
|
throw new Error("SDK_PACK_UPGRADE_INPUT_REQUIRED");
|
|
@@ -370,7 +393,7 @@ var ViraClient = class {
|
|
|
370
393
|
path: `/v1/packs/${encodeURIComponent(packId)}/upgrade-preview`,
|
|
371
394
|
body: { incoming }
|
|
372
395
|
},
|
|
373
|
-
{ idempotencyKey: `sdk:pack:upgrade-preview:${packId}
|
|
396
|
+
{ idempotencyKey: await contentIdempotencyKey(`sdk:pack:upgrade-preview:${packId}`, { incoming }) }
|
|
374
397
|
);
|
|
375
398
|
}
|
|
376
399
|
executeRuntime(input) {
|
|
@@ -457,9 +480,10 @@ var ViraClient = class {
|
|
|
457
480
|
path: "/v1/behavior-strategies"
|
|
458
481
|
});
|
|
459
482
|
}
|
|
460
|
-
deleteBehaviorStrategy(strategyId, options = {}) {
|
|
483
|
+
async deleteBehaviorStrategy(strategyId, options = {}) {
|
|
461
484
|
required(strategyId, "SDK_STRATEGY_ID_REQUIRED");
|
|
462
|
-
|
|
485
|
+
const path = `/v1/behavior-strategies/${encodeURIComponent(strategyId)}`, body = { confirm: options.confirm === true };
|
|
486
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:strategy:${strategyId}`, { path, body }) });
|
|
463
487
|
}
|
|
464
488
|
getBehaviorStrategy(strategyId) {
|
|
465
489
|
required(strategyId, "SDK_STRATEGY_ID_REQUIRED");
|
|
@@ -479,25 +503,29 @@ var ViraClient = class {
|
|
|
479
503
|
listSemanticTasks() {
|
|
480
504
|
return this.request({ method: "GET", path: "/v1/semantic-tasks" });
|
|
481
505
|
}
|
|
482
|
-
deleteSemanticTask(taskId, options = {}) {
|
|
506
|
+
async deleteSemanticTask(taskId, options = {}) {
|
|
483
507
|
required(taskId, "SDK_SEMANTIC_TASK_ID_REQUIRED");
|
|
484
|
-
|
|
508
|
+
const path = `/v1/semantic-tasks/${encodeURIComponent(taskId)}`, body = { confirm: options.confirm === true };
|
|
509
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:semantic-task:${taskId}`, { path, body }) });
|
|
485
510
|
}
|
|
486
|
-
createSemanticTask(task, options = {}) {
|
|
511
|
+
async createSemanticTask(task, options = {}) {
|
|
487
512
|
required(task?.taskKey, "SDK_SEMANTIC_TASK_KEY_REQUIRED");
|
|
488
|
-
|
|
513
|
+
const body = { ...task, ...options.id ? { id: options.id } : {} };
|
|
514
|
+
return this.request({ method: "POST", path: "/v1/semantic-tasks", body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:semantic-task:${task.taskKey}`, body) });
|
|
489
515
|
}
|
|
490
516
|
listBehaviorPoints() {
|
|
491
517
|
return this.request({ method: "GET", path: "/v1/behavior-points" });
|
|
492
518
|
}
|
|
493
|
-
deleteBehaviorPoint(pointId, options = {}) {
|
|
519
|
+
async deleteBehaviorPoint(pointId, options = {}) {
|
|
494
520
|
required(pointId, "SDK_BEHAVIOR_POINT_ID_REQUIRED");
|
|
495
|
-
|
|
521
|
+
const path = `/v1/behavior-points/${encodeURIComponent(pointId)}`, body = { confirm: options.confirm === true };
|
|
522
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:behavior-point:${pointId}`, { path, body }) });
|
|
496
523
|
}
|
|
497
|
-
createBehaviorPoint(point, options = {}) {
|
|
524
|
+
async createBehaviorPoint(point, options = {}) {
|
|
498
525
|
required(point?.key, "SDK_BEHAVIOR_POINT_KEY_REQUIRED");
|
|
499
526
|
if (!point.taskId && !point.taskIds?.length) throw new Error("SDK_BEHAVIOR_POINT_TASK_REQUIRED");
|
|
500
|
-
|
|
527
|
+
const body = { ...point, ...options.id ? { id: options.id } : {} };
|
|
528
|
+
return this.request({ method: "POST", path: "/v1/behavior-points", body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:behavior-point:${point.key}`, body) });
|
|
501
529
|
}
|
|
502
530
|
createBehaviorStrategyVariant(strategyId, variant, options = {}) {
|
|
503
531
|
required(strategyId, "SDK_STRATEGY_ID_REQUIRED");
|
|
@@ -617,13 +645,15 @@ var ViraClient = class {
|
|
|
617
645
|
path: `/v1/behavior-programs/${encodeURIComponent(programId)}`
|
|
618
646
|
});
|
|
619
647
|
}
|
|
620
|
-
deleteBehaviorProgram(programId, options = {}) {
|
|
648
|
+
async deleteBehaviorProgram(programId, options = {}) {
|
|
621
649
|
required(programId, "SDK_PROGRAM_ID_REQUIRED");
|
|
622
|
-
|
|
650
|
+
const path = `/v1/behavior-programs/${encodeURIComponent(programId)}`, body = { confirm: options.confirm === true };
|
|
651
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:behavior-program:${programId}`, { path, body }) });
|
|
623
652
|
}
|
|
624
|
-
deleteBehaviorProgramCascade(programId, options = {}) {
|
|
653
|
+
async deleteBehaviorProgramCascade(programId, options = {}) {
|
|
625
654
|
required(programId, "SDK_PROGRAM_ID_REQUIRED");
|
|
626
|
-
|
|
655
|
+
const path = `/v1/behavior-programs/${encodeURIComponent(programId)}/cascade`, body = { confirm: options.confirm === true, purgeRuntime: options.purgeRuntime === true };
|
|
656
|
+
return this.request({ method: "DELETE", path, body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:delete:behavior-program-cascade:${programId}`, { path, body }) });
|
|
627
657
|
}
|
|
628
658
|
createBehaviorProgram(program, options = {}) {
|
|
629
659
|
if (!program || typeof program !== "object")
|
|
@@ -898,31 +928,35 @@ var ViraClient = class {
|
|
|
898
928
|
{ idempotencyKey: options.idempotencyKey }
|
|
899
929
|
);
|
|
900
930
|
}
|
|
901
|
-
compileBehaviorCapsule(input) {
|
|
931
|
+
async compileBehaviorCapsule(input) {
|
|
902
932
|
required(input.programId, "SDK_PROGRAM_ID_REQUIRED");
|
|
903
933
|
required(input.input, "SDK_RUNTIME_INPUT_REQUIRED");
|
|
934
|
+
const body = { ...input };
|
|
904
935
|
return this.request(
|
|
905
936
|
{
|
|
906
937
|
method: "POST",
|
|
907
938
|
path: "/v1/runtime/behavior-capsule",
|
|
908
|
-
body
|
|
939
|
+
body
|
|
909
940
|
},
|
|
910
941
|
{
|
|
911
|
-
idempotencyKey: input.idempotencyKey ?? `sdk:capsule:${input.programId}
|
|
942
|
+
idempotencyKey: input.idempotencyKey ?? await contentIdempotencyKey(`sdk:capsule:${input.programId}`, body),
|
|
943
|
+
enforcing: true
|
|
912
944
|
}
|
|
913
945
|
);
|
|
914
946
|
}
|
|
915
|
-
serveBehaviorProjection(input) {
|
|
947
|
+
async serveBehaviorProjection(input) {
|
|
916
948
|
required(input.input, "SDK_RUNTIME_INPUT_REQUIRED");
|
|
917
949
|
required(input.provider, "SDK_PROVIDER_REQUIRED");
|
|
950
|
+
const body = { ...input };
|
|
918
951
|
return this.request(
|
|
919
952
|
{
|
|
920
953
|
method: "POST",
|
|
921
954
|
path: "/v1/runtime/behavior-projection",
|
|
922
|
-
body
|
|
955
|
+
body
|
|
923
956
|
},
|
|
924
957
|
{
|
|
925
|
-
idempotencyKey: input.idempotencyKey ?? `sdk:projection:${input.programId ?? "active"}
|
|
958
|
+
idempotencyKey: input.idempotencyKey ?? await contentIdempotencyKey(`sdk:projection:${input.programId ?? "active"}`, body),
|
|
959
|
+
enforcing: true
|
|
926
960
|
}
|
|
927
961
|
);
|
|
928
962
|
}
|
package/dist/js-client.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export interface SdkRequest {
|
|
|
16
16
|
export type SdkFailureMode = "throw" | "open";
|
|
17
17
|
export interface ViraClientOptions {
|
|
18
18
|
baseUrl: string;
|
|
19
|
+
/** Explicit opt-in for plain HTTP on loopback during local development only. */
|
|
20
|
+
allowInsecureLocalhost?: boolean;
|
|
19
21
|
apiKey?: string;
|
|
20
22
|
fetcher?: typeof fetch;
|
|
21
23
|
timeoutMs?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryvira/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43",
|
|
4
4
|
"description": "Typed Vira SDK for connect-once, observation and governed runtime execution.",
|
|
5
5
|
"keywords": ["vira", "ai-governance", "ai-runtime", "semantic-routing"],
|
|
6
6
|
"engines": {"node": ">=20"},
|