@tryvira/sdk 0.1.68 → 0.1.70

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.js CHANGED
@@ -1,4 +1,10 @@
1
1
  // ../../sdks/js-client.ts
2
+ var listQuery = (options) => ({
3
+ ...options.limit === void 0 ? {} : { limit: String(options.limit) },
4
+ ...options.cursor ? { cursor: options.cursor } : {},
5
+ ...options.status ? { status: options.status } : {},
6
+ ...options.search ? { search: options.search } : {}
7
+ });
2
8
  var ViraApiError = class extends Error {
3
9
  status;
4
10
  body;
@@ -222,8 +228,8 @@ var ViraClient = class {
222
228
  idempotencyKey: input.idempotencyKey
223
229
  });
224
230
  }
225
- listAISystems() {
226
- return this.request({ method: "GET", path: "/v1/ai-systems" });
231
+ listAISystems(options = {}) {
232
+ return this.request({ method: "GET", path: "/v1/ai-systems", query: listQuery(options) });
227
233
  }
228
234
  async deleteAISystem(systemId, options = {}) {
229
235
  required(systemId, "SDK_SYSTEM_ID_REQUIRED");
@@ -431,10 +437,11 @@ var ViraClient = class {
431
437
  path: `/v1/ai-systems/${encodeURIComponent(systemId)}/inventory`
432
438
  });
433
439
  }
434
- listPacks() {
440
+ listPacks(options = {}) {
435
441
  return this.request({
436
442
  method: "GET",
437
- path: "/v1/packs"
443
+ path: "/v1/packs",
444
+ query: listQuery(options)
438
445
  });
439
446
  }
440
447
  async deletePack(packId, options = {}) {
@@ -640,10 +647,11 @@ var ViraClient = class {
640
647
  required(input.confirmation.acknowledgedAt, "SDK_ACTION_CONFIRMATION_TIME_REQUIRED");
641
648
  return this.request({ method: "POST", path: "/v1/runtime/actions/approvals", body: { sessionId: input.sessionId, dataVersion: input.dataVersion, proposal: input.proposal, confirmation: input.confirmation, ...input.ttlSeconds !== void 0 ? { ttlSeconds: input.ttlSeconds } : {} } });
642
649
  }
643
- listBehaviorStrategies() {
650
+ listBehaviorStrategies(options = {}) {
644
651
  return this.request({
645
652
  method: "GET",
646
- path: "/v1/behavior-strategies"
653
+ path: "/v1/behavior-strategies",
654
+ query: listQuery(options)
647
655
  });
648
656
  }
649
657
  async deleteBehaviorStrategy(strategyId, options = {}) {
@@ -666,8 +674,8 @@ var ViraClient = class {
666
674
  body: { definition, ...id ? { id } : {} }
667
675
  });
668
676
  }
669
- listSemanticTasks() {
670
- return this.request({ method: "GET", path: "/v1/semantic-tasks" });
677
+ listSemanticTasks(options = {}) {
678
+ return this.request({ method: "GET", path: "/v1/semantic-tasks", query: listQuery(options) });
671
679
  }
672
680
  async deleteSemanticTask(taskId, options = {}) {
673
681
  required(taskId, "SDK_SEMANTIC_TASK_ID_REQUIRED");
@@ -679,8 +687,8 @@ var ViraClient = class {
679
687
  const body = { ...task, ...options.id ? { id: options.id } : {} };
680
688
  return this.request({ method: "POST", path: "/v1/semantic-tasks", body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:semantic-task:${task.taskKey}`, body) });
681
689
  }
682
- listBehaviorPoints() {
683
- return this.request({ method: "GET", path: "/v1/behavior-points" });
690
+ listBehaviorPoints(options = {}) {
691
+ return this.request({ method: "GET", path: "/v1/behavior-points", query: listQuery(options) });
684
692
  }
685
693
  async deleteBehaviorPoint(pointId, options = {}) {
686
694
  required(pointId, "SDK_BEHAVIOR_POINT_ID_REQUIRED");
@@ -835,10 +843,11 @@ var ViraClient = class {
835
843
  if (!Number.isInteger(expectedVersion) || expectedVersion < 0) throw new Error("SDK_TASKRUN_STATE_VERSION_REQUIRED");
836
844
  return this.request({ method: "POST", path: `/v1/task-runs/${encodeURIComponent(taskRunId)}/retry`, body: { expectedVersion } }, { idempotencyKey: options.idempotencyKey ?? `sdk:task-run:retry:${taskRunId}:${expectedVersion}` });
837
845
  }
838
- listBehaviorPrograms() {
846
+ listBehaviorPrograms(options = {}) {
839
847
  return this.request({
840
848
  method: "GET",
841
- path: "/v1/behavior-programs"
849
+ path: "/v1/behavior-programs",
850
+ query: listQuery(options)
842
851
  });
843
852
  }
844
853
  listCapabilities(options = {}) {
@@ -54,6 +54,12 @@ export interface RuntimeResolution {
54
54
  [key: string]: unknown;
55
55
  }
56
56
  export type TaskRunMode = "SINGLE" | "STRATEGY" | "COMPOUND" | "HYBRID";
57
+ export interface ScopedListOptions {
58
+ limit?: number;
59
+ cursor?: string;
60
+ status?: string;
61
+ search?: string;
62
+ }
57
63
  export type TaskRunRequestedMode = TaskRunMode | "AUTO";
58
64
  export interface TaskRunChildMode {
59
65
  semanticTaskKey: string;
@@ -221,7 +227,7 @@ export declare class ViraClient {
221
227
  }): Promise<ViraResponse<{
222
228
  system: ClientBody;
223
229
  }> | null>;
224
- listAISystems(): Promise<ViraResponse<ClientBody> | null>;
230
+ listAISystems(options?: ScopedListOptions): Promise<ViraResponse<ClientBody> | null>;
225
231
  deleteAISystem(systemId: string, options?: {
226
232
  confirm?: boolean;
227
233
  idempotencyKey?: string;
@@ -335,7 +341,7 @@ export declare class ViraClient {
335
341
  getConnection(connectionId: string): Promise<ViraResponse<ClientBody> | null>;
336
342
  listSystemConnections(systemId: string): Promise<ViraResponse<ClientBody> | null>;
337
343
  inventory(systemId: string): Promise<ViraResponse<ClientBody> | null>;
338
- listPacks(): Promise<ViraResponse<{
344
+ listPacks(options?: ScopedListOptions): Promise<ViraResponse<{
339
345
  packs: readonly ClientBody[];
340
346
  }> | null>;
341
347
  deletePack(packId: string, options?: {
@@ -439,14 +445,14 @@ export declare class ViraClient {
439
445
  };
440
446
  ttlSeconds?: number;
441
447
  }): Promise<ViraResponse<ClientBody> | null>;
442
- listBehaviorStrategies(): Promise<ViraResponse<ClientBody> | null>;
448
+ listBehaviorStrategies(options?: ScopedListOptions): Promise<ViraResponse<ClientBody> | null>;
443
449
  deleteBehaviorStrategy(strategyId: string, options?: {
444
450
  confirm?: boolean;
445
451
  idempotencyKey?: string;
446
452
  }): Promise<ViraResponse<ClientBody> | null>;
447
453
  getBehaviorStrategy(strategyId: string): Promise<ViraResponse<ClientBody> | null>;
448
454
  createBehaviorStrategy(definition: Record<string, unknown>, id?: string): Promise<ViraResponse<ClientBody> | null>;
449
- listSemanticTasks(): Promise<ViraResponse<ClientBody> | null>;
455
+ listSemanticTasks(options?: ScopedListOptions): Promise<ViraResponse<ClientBody> | null>;
450
456
  deleteSemanticTask(taskId: string, options?: {
451
457
  confirm?: boolean;
452
458
  idempotencyKey?: string;
@@ -462,7 +468,7 @@ export declare class ViraClient {
462
468
  id?: string;
463
469
  idempotencyKey?: string;
464
470
  }): Promise<ViraResponse<ClientBody> | null>;
465
- listBehaviorPoints(): Promise<ViraResponse<ClientBody> | null>;
471
+ listBehaviorPoints(options?: ScopedListOptions): Promise<ViraResponse<ClientBody> | null>;
466
472
  deleteBehaviorPoint(pointId: string, options?: {
467
473
  confirm?: boolean;
468
474
  idempotencyKey?: string;
@@ -527,7 +533,7 @@ export declare class ViraClient {
527
533
  retryTaskRun(taskRunId: string, expectedVersion: number, options?: {
528
534
  idempotencyKey?: string;
529
535
  }): Promise<ViraResponse<ClientBody> | null>;
530
- listBehaviorPrograms(): Promise<ViraResponse<{
536
+ listBehaviorPrograms(options?: ScopedListOptions): Promise<ViraResponse<{
531
537
  programs: readonly ClientBody[];
532
538
  }> | null>;
533
539
  listCapabilities(options?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/sdk",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
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"},