@tryvira/opencode 0.1.61 → 0.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +31 -12
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2,6 +2,12 @@
2
2
  import { createHash as createHash2 } from "node:crypto";
3
3
 
4
4
  // ../../sdks/js-client.ts
5
+ var listQuery = (options) => ({
6
+ ...options.limit === void 0 ? {} : { limit: String(options.limit) },
7
+ ...options.cursor ? { cursor: options.cursor } : {},
8
+ ...options.status ? { status: options.status } : {},
9
+ ...options.search ? { search: options.search } : {}
10
+ });
5
11
  var ViraApiError = class extends Error {
6
12
  status;
7
13
  body;
@@ -172,8 +178,8 @@ var ViraClient = class {
172
178
  idempotencyKey: input.idempotencyKey
173
179
  });
174
180
  }
175
- listAISystems() {
176
- return this.request({ method: "GET", path: "/v1/ai-systems" });
181
+ listAISystems(options = {}) {
182
+ return this.request({ method: "GET", path: "/v1/ai-systems", query: listQuery(options) });
177
183
  }
178
184
  async deleteAISystem(systemId, options = {}) {
179
185
  required(systemId, "SDK_SYSTEM_ID_REQUIRED");
@@ -262,6 +268,10 @@ var ViraClient = class {
262
268
  }
263
269
  };
264
270
  }
271
+ /** Canonical verb-noun name; connectOnce remains for source compatibility. */
272
+ connectAiSystem(input) {
273
+ return this.connectOnce(input);
274
+ }
265
275
  observe(event, options = {}) {
266
276
  buildObservationRequest(event);
267
277
  return (async () => {
@@ -291,6 +301,12 @@ var ViraClient = class {
291
301
  feedback(event, options = {}) {
292
302
  return this.observe({ ...event, eventType: "feedback.user" }, options);
293
303
  }
304
+ recordBusinessOutcome(event, options = {}) {
305
+ return this.outcome(event, options);
306
+ }
307
+ recordUserFeedback(event, options = {}) {
308
+ return this.feedback(event, options);
309
+ }
294
310
  observeBatch(events, options = {}) {
295
311
  if (!Array.isArray(events) || events.length < 1 || events.length > 100)
296
312
  throw new Error("SDK_OBSERVATION_BATCH_INVALID");
@@ -371,10 +387,11 @@ var ViraClient = class {
371
387
  path: `/v1/ai-systems/${encodeURIComponent(systemId)}/inventory`
372
388
  });
373
389
  }
374
- listPacks() {
390
+ listPacks(options = {}) {
375
391
  return this.request({
376
392
  method: "GET",
377
- path: "/v1/packs"
393
+ path: "/v1/packs",
394
+ query: listQuery(options)
378
395
  });
379
396
  }
380
397
  async deletePack(packId, options = {}) {
@@ -580,10 +597,11 @@ var ViraClient = class {
580
597
  required(input.confirmation.acknowledgedAt, "SDK_ACTION_CONFIRMATION_TIME_REQUIRED");
581
598
  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 } : {} } });
582
599
  }
583
- listBehaviorStrategies() {
600
+ listBehaviorStrategies(options = {}) {
584
601
  return this.request({
585
602
  method: "GET",
586
- path: "/v1/behavior-strategies"
603
+ path: "/v1/behavior-strategies",
604
+ query: listQuery(options)
587
605
  });
588
606
  }
589
607
  async deleteBehaviorStrategy(strategyId, options = {}) {
@@ -606,8 +624,8 @@ var ViraClient = class {
606
624
  body: { definition, ...id ? { id } : {} }
607
625
  });
608
626
  }
609
- listSemanticTasks() {
610
- return this.request({ method: "GET", path: "/v1/semantic-tasks" });
627
+ listSemanticTasks(options = {}) {
628
+ return this.request({ method: "GET", path: "/v1/semantic-tasks", query: listQuery(options) });
611
629
  }
612
630
  async deleteSemanticTask(taskId, options = {}) {
613
631
  required(taskId, "SDK_SEMANTIC_TASK_ID_REQUIRED");
@@ -619,8 +637,8 @@ var ViraClient = class {
619
637
  const body = { ...task, ...options.id ? { id: options.id } : {} };
620
638
  return this.request({ method: "POST", path: "/v1/semantic-tasks", body }, { idempotencyKey: options.idempotencyKey ?? await contentIdempotencyKey(`sdk:semantic-task:${task.taskKey}`, body) });
621
639
  }
622
- listBehaviorPoints() {
623
- return this.request({ method: "GET", path: "/v1/behavior-points" });
640
+ listBehaviorPoints(options = {}) {
641
+ return this.request({ method: "GET", path: "/v1/behavior-points", query: listQuery(options) });
624
642
  }
625
643
  async deleteBehaviorPoint(pointId, options = {}) {
626
644
  required(pointId, "SDK_BEHAVIOR_POINT_ID_REQUIRED");
@@ -775,10 +793,11 @@ var ViraClient = class {
775
793
  if (!Number.isInteger(expectedVersion) || expectedVersion < 0) throw new Error("SDK_TASKRUN_STATE_VERSION_REQUIRED");
776
794
  return this.request({ method: "POST", path: `/v1/task-runs/${encodeURIComponent(taskRunId)}/retry`, body: { expectedVersion } }, { idempotencyKey: options.idempotencyKey ?? `sdk:task-run:retry:${taskRunId}:${expectedVersion}` });
777
795
  }
778
- listBehaviorPrograms() {
796
+ listBehaviorPrograms(options = {}) {
779
797
  return this.request({
780
798
  method: "GET",
781
- path: "/v1/behavior-programs"
799
+ path: "/v1/behavior-programs",
800
+ query: listQuery(options)
782
801
  });
783
802
  }
784
803
  listCapabilities(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/opencode",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "description": "OpenCode host lifecycle integration for Vira",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "pack:check": "npm run build && node ../../scripts/opencode-plugin-smoke.mjs && node ../../scripts/opencode-plugin-host-acceptance.mjs"
17
17
  },
18
18
  "dependencies": {
19
- "@tryvira/sdk": "0.1.67"
19
+ "@tryvira/sdk": "0.1.69"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "effect": "^4.0.0"