@tryvira/sdk 0.1.95 → 0.1.96

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 +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1140,6 +1140,9 @@ var ViraClient = class {
1140
1140
  resolveRuntime(input) {
1141
1141
  if (!input.behaviorPoint && !input.executionBoundary && !input.semanticContext)
1142
1142
  throw new Error("SDK_RUNTIME_ROUTE_REQUIRED");
1143
+ const idempotencyKey = input.idempotencyKey ?? `sdk:resolve:${globalThis.crypto.randomUUID()}`;
1144
+ if (!idempotencyKey.trim() || idempotencyKey !== idempotencyKey.trim())
1145
+ throw new Error("SDK_IDEMPOTENCY_KEY_INVALID");
1143
1146
  return this.request(
1144
1147
  {
1145
1148
  method: "POST",
@@ -1152,7 +1155,9 @@ var ViraClient = class {
1152
1155
  }
1153
1156
  },
1154
1157
  {
1155
- idempotencyKey: input.idempotencyKey ?? `sdk:resolve:${input.behaviorPoint ?? "boundary"}`,
1158
+ // One key per logical invocation: transport retries reuse this value,
1159
+ // while a later call for the same BehaviorPoint is billed separately.
1160
+ idempotencyKey,
1156
1161
  enforcing: true
1157
1162
  }
1158
1163
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/sdk",
3
- "version": "0.1.95",
3
+ "version": "0.1.96",
4
4
  "description": "Typed Vira SDK for connect-once, observation and governed runtime execution.",
5
5
  "keywords": [
6
6
  "vira",