@tryvira/sdk 0.1.62 → 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 +17 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // ../../sdks/js-client.ts
1
+ // sdks/js-client.ts
2
2
  var ViraApiError = class extends Error {
3
3
  status;
4
4
  body;
@@ -506,9 +506,21 @@ var ViraClient = class {
506
506
  );
507
507
  }
508
508
  async resolveSemanticRuntime(input) {
509
- const semantic = await this.resolveSemantic(input);
509
+ let semantic = await this.resolveSemantic(input);
510
510
  if (!semantic) return null;
511
- const body = semantic.body;
511
+ let body = semantic.body;
512
+ if (body.replayed === true && !Array.isArray(body.capsules)) {
513
+ const replayRequestId = `${input.requestId ?? "sdk-semantic"}:rehydrate:${Date.now()}`;
514
+ const refreshed = await this.resolveSemantic({
515
+ ...input,
516
+ requestId: replayRequestId,
517
+ idempotencyKey: `sdk:semantic:rehydrate:${replayRequestId}`
518
+ });
519
+ if (refreshed) {
520
+ semantic = refreshed;
521
+ body = refreshed.body;
522
+ }
523
+ }
512
524
  const receipt = body.receipt && typeof body.receipt === "object" ? body.receipt : {};
513
525
  if (receipt.outcome !== "select" || typeof receipt.taskKey !== "string")
514
526
  return { semantic, runtime: null, taskKeys: [], capsules: [], multiTask: false };
@@ -1208,7 +1220,7 @@ function buildObservationRequest(event) {
1208
1220
  });
1209
1221
  }
1210
1222
 
1211
- // ../../sdks/framework-adapters.ts
1223
+ // sdks/framework-adapters.ts
1212
1224
  function createFrameworkRuntimeCore(client) {
1213
1225
  if (!client) throw new Error("SDK_FRAMEWORK_CLIENT_REQUIRED");
1214
1226
  return Object.freeze({
@@ -1292,7 +1304,7 @@ function createFrameworkAdapters(client) {
1292
1304
  return Object.freeze(Object.fromEntries(["openai-agents", "vercel-ai", "langchain", "langgraph", "otel", "mcp"].map((name) => [name, createFrameworkObservationAdapter(client, name)])));
1293
1305
  }
1294
1306
 
1295
- // ../../sdks/host-lifecycle.ts
1307
+ // sdks/host-lifecycle.ts
1296
1308
  import { createHash } from "node:crypto";
1297
1309
  function resolveHostToolBinding(bindings, hostToolName) {
1298
1310
  const name = hostToolName.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/sdk",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
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"},