@tryvira/sdk 0.1.55 → 0.1.57
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/host-lifecycle.d.ts +5 -0
- package/dist/index.js +12 -5
- package/dist/js-client.d.ts +17 -1
- package/package.json +1 -1
package/dist/host-lifecycle.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ export interface HostModelRequest extends HostSessionIdentity {
|
|
|
28
28
|
traceId?: string;
|
|
29
29
|
turnId?: string;
|
|
30
30
|
sequence?: number;
|
|
31
|
+
signalAttestationRefs?: readonly {
|
|
32
|
+
stableKey: string;
|
|
33
|
+
mappingId: string;
|
|
34
|
+
eventId: string;
|
|
35
|
+
}[];
|
|
31
36
|
}
|
|
32
37
|
export interface HostToolProposal extends HostSessionIdentity {
|
|
33
38
|
requestId: string;
|
package/dist/index.js
CHANGED
|
@@ -430,7 +430,8 @@ var ViraClient = class {
|
|
|
430
430
|
body: {
|
|
431
431
|
...input.behaviorPoint ? { behaviorPoint: input.behaviorPoint } : {},
|
|
432
432
|
...input.executionBoundary ? { executionBoundary: input.executionBoundary } : {},
|
|
433
|
-
...input.semanticContext ? { semanticContext: input.semanticContext } : {}
|
|
433
|
+
...input.semanticContext ? { semanticContext: input.semanticContext } : {},
|
|
434
|
+
...input.signalAttestationRefs ? { signalAttestationRefs: input.signalAttestationRefs } : {}
|
|
434
435
|
}
|
|
435
436
|
},
|
|
436
437
|
{
|
|
@@ -479,11 +480,12 @@ var ViraClient = class {
|
|
|
479
480
|
behaviorPoint,
|
|
480
481
|
capsule: firstCapsule,
|
|
481
482
|
...input.requestId ? { requestId: input.requestId } : {},
|
|
482
|
-
...input.sessionId ? { conversationId: input.sessionId } : {}
|
|
483
|
+
...input.sessionId ? { conversationId: input.sessionId } : {},
|
|
484
|
+
...input.signalAttestationRefs ? { signalAttestationRefs: input.signalAttestationRefs } : {}
|
|
483
485
|
},
|
|
484
486
|
idempotencyKey: input.idempotencyKey ? `sdk:runtime:${input.idempotencyKey}` : void 0
|
|
485
487
|
}) : await this.resolveRuntime({
|
|
486
|
-
semanticContext: { taskKey: receipt.taskKey, behaviorPoint, capsule: firstCapsule, ...input.requestId ? { requestId: input.requestId } : {}, ...input.sessionId ? { conversationId: input.sessionId } : {} },
|
|
488
|
+
semanticContext: { taskKey: receipt.taskKey, behaviorPoint, capsule: firstCapsule, ...input.requestId ? { requestId: input.requestId } : {}, ...input.sessionId ? { conversationId: input.sessionId } : {}, ...input.signalAttestationRefs ? { signalAttestationRefs: input.signalAttestationRefs } : {} },
|
|
487
489
|
idempotencyKey: input.idempotencyKey ? `sdk:runtime:${input.idempotencyKey}` : void 0
|
|
488
490
|
});
|
|
489
491
|
return { semantic, runtime };
|
|
@@ -504,7 +506,12 @@ var ViraClient = class {
|
|
|
504
506
|
async createHostActionApproval(input) {
|
|
505
507
|
required(input.sessionId, "SDK_ACTION_SESSION_REQUIRED");
|
|
506
508
|
required(input.dataVersion, "SDK_ACTION_DATA_VERSION_REQUIRED");
|
|
507
|
-
|
|
509
|
+
required(input.confirmation.proposalId, "SDK_ACTION_CONFIRMATION_PROPOSAL_REQUIRED");
|
|
510
|
+
required(input.confirmation.toolName, "SDK_ACTION_CONFIRMATION_TOOL_REQUIRED");
|
|
511
|
+
required(input.confirmation.argumentsDigest, "SDK_ACTION_CONFIRMATION_ARGUMENTS_REQUIRED");
|
|
512
|
+
required(input.confirmation.requestContextDigest, "SDK_ACTION_CONFIRMATION_CONTEXT_REQUIRED");
|
|
513
|
+
required(input.confirmation.acknowledgedAt, "SDK_ACTION_CONFIRMATION_TIME_REQUIRED");
|
|
514
|
+
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 } : {} } });
|
|
508
515
|
}
|
|
509
516
|
listBehaviorStrategies() {
|
|
510
517
|
return this.request({
|
|
@@ -1301,7 +1308,7 @@ function createViraHostRuntime(client, config) {
|
|
|
1301
1308
|
if (mode === "off") return { status: "off" };
|
|
1302
1309
|
if (!capabilities.canInjectContext) return { status: "unavailable", reasonCode: "HOST_CONTEXT_INJECTION_UNSUPPORTED" };
|
|
1303
1310
|
await connectOnce();
|
|
1304
|
-
const semantic = await withTimeout(client.resolveSemanticRuntime({ input: request.input, sessionId: request.sessionId ?? request.conversationId, requestId: request.requestId }), timeoutMs, "SDK_HOST_RESOLVE_TIMEOUT");
|
|
1311
|
+
const semantic = await withTimeout(client.resolveSemanticRuntime({ input: request.input, sessionId: request.sessionId ?? request.conversationId, requestId: request.requestId, signalAttestationRefs: request.signalAttestationRefs }), timeoutMs, "SDK_HOST_RESOLVE_TIMEOUT");
|
|
1305
1312
|
if (!semantic) return { status: "unavailable", reasonCode: "VIRA_SEMANTIC_UNAVAILABLE" };
|
|
1306
1313
|
const semanticBody = bodyOf(semantic.semantic);
|
|
1307
1314
|
const receipt = semanticBody.receipt && typeof semanticBody.receipt === "object" ? semanticBody.receipt : {};
|
package/dist/js-client.d.ts
CHANGED
|
@@ -339,6 +339,11 @@ export declare class ViraClient {
|
|
|
339
339
|
behaviorPoint?: string;
|
|
340
340
|
executionBoundary?: Record<string, unknown>;
|
|
341
341
|
semanticContext?: Record<string, unknown>;
|
|
342
|
+
signalAttestationRefs?: readonly {
|
|
343
|
+
stableKey: string;
|
|
344
|
+
mappingId: string;
|
|
345
|
+
eventId: string;
|
|
346
|
+
}[];
|
|
342
347
|
idempotencyKey?: string;
|
|
343
348
|
}): Promise<ViraResponse<RuntimeResolution> | null>;
|
|
344
349
|
/** Resolve a runtime route from a governed execution boundary and semantic context. */
|
|
@@ -365,6 +370,11 @@ export declare class ViraClient {
|
|
|
365
370
|
timeoutMs?: number;
|
|
366
371
|
requestId?: string;
|
|
367
372
|
executionBoundary?: Record<string, unknown>;
|
|
373
|
+
signalAttestationRefs?: readonly {
|
|
374
|
+
stableKey: string;
|
|
375
|
+
mappingId: string;
|
|
376
|
+
eventId: string;
|
|
377
|
+
}[];
|
|
368
378
|
idempotencyKey?: string;
|
|
369
379
|
}): Promise<{
|
|
370
380
|
semantic: ViraResponse<ClientBody>;
|
|
@@ -387,7 +397,13 @@ export declare class ViraClient {
|
|
|
387
397
|
sessionId: string;
|
|
388
398
|
dataVersion: string;
|
|
389
399
|
proposal: Record<string, unknown>;
|
|
390
|
-
|
|
400
|
+
confirmation: {
|
|
401
|
+
proposalId: string;
|
|
402
|
+
toolName: string;
|
|
403
|
+
argumentsDigest: string;
|
|
404
|
+
requestContextDigest: string;
|
|
405
|
+
acknowledgedAt: string;
|
|
406
|
+
};
|
|
391
407
|
ttlSeconds?: number;
|
|
392
408
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
393
409
|
listBehaviorStrategies(): Promise<ViraResponse<ClientBody> | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryvira/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
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"},
|