@tryvira/sdk 0.1.95 → 0.1.97
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 +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Compound execution plans can be persisted with `saveCompoundTaskPlan(plan, {idem
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install @tryvira/sdk@0.1.
|
|
18
|
+
npm install @tryvira/sdk@0.1.97
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Configure the organization, project, and environment for every request. Keep the API
|
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
|
-
|
|
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
|
);
|