@tryvira/sdk 0.1.63 → 0.1.64
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/index.js +9 -2
- package/dist/js-client.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -741,7 +741,7 @@ var ViraClient = class {
|
|
|
741
741
|
if (input.input === void 0 || input.input === null) throw new Error("SDK_TASKRUN_INPUT_REQUIRED");
|
|
742
742
|
const id = () => globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
743
743
|
const requestId = input.requestId ?? `sdk-task-run-${id()}`;
|
|
744
|
-
return this.startTaskRun({ taskRunId: input.taskRunId ?? `task-run-${id()}`, requestId, input: input.input, ...input.conversationId ? { conversationId: input.conversationId } : {}, ...input.episodeId ? { episodeId: input.episodeId } : {}, ...input.traceRootRef ? { traceRootRef: input.traceRootRef } : {}, ...input.budget ? { budget: input.budget } : {}, ...input.connectionId ? { connectionId: input.connectionId } : {} }, options);
|
|
744
|
+
return this.startTaskRun({ taskRunId: input.taskRunId ?? `task-run-${id()}`, requestId, input: input.input, ...input.conversationId ? { conversationId: input.conversationId } : {}, ...input.episodeId ? { episodeId: input.episodeId } : {}, ...input.traceRootRef ? { traceRootRef: input.traceRootRef } : {}, ...input.budget ? { budget: input.budget } : {}, ...input.connectionId ? { connectionId: input.connectionId } : {}, ...input.hostCapabilities ? { hostCapabilities: [...input.hostCapabilities] } : {} }, options);
|
|
745
745
|
}
|
|
746
746
|
getTaskRun(taskRunId) {
|
|
747
747
|
required(taskRunId, "SDK_TASKRUN_ID_REQUIRED");
|
|
@@ -1440,7 +1440,14 @@ function createViraHostRuntime(client, config) {
|
|
|
1440
1440
|
if (!semantic) return { status: "unavailable", reasonCode: "VIRA_SEMANTIC_UNAVAILABLE" };
|
|
1441
1441
|
if (semantic.multiTask === true && semantic.taskKeys?.length > 1 && typeof client.startTaskRunFromPrompt === "function") {
|
|
1442
1442
|
try {
|
|
1443
|
-
const
|
|
1443
|
+
const hostCapabilities = [
|
|
1444
|
+
...capabilities.canObserveModel ? ["conversation_input", "conversation_output", "model_call"] : [],
|
|
1445
|
+
...capabilities.canInjectContext ? ["behavior_projection"] : [],
|
|
1446
|
+
...capabilities.canInterceptToolBefore ? ["tool_selection", "tool_execution"] : [],
|
|
1447
|
+
...capabilities.canPreventSideEffect ? ["external_action"] : [],
|
|
1448
|
+
...capabilities.canInspectToolAfter ? ["tool_result"] : []
|
|
1449
|
+
];
|
|
1450
|
+
const admitted = await withTimeout(client.startTaskRunFromPrompt({ input: request.input, taskRunId: `host-task-run-${request.requestId}`, requestId: request.requestId, conversationId: request.conversationId, traceRootRef: request.traceId, hostCapabilities }), timeoutMs, "SDK_HOST_TASKRUN_ADMISSION_TIMEOUT");
|
|
1444
1451
|
const admittedBody = bodyOf(admitted);
|
|
1445
1452
|
const taskRun = admittedBody.taskRun && typeof admittedBody.taskRun === "object" ? admittedBody.taskRun : {};
|
|
1446
1453
|
const taskRunId = typeof taskRun.taskRunId === "string" ? taskRun.taskRunId : `host-task-run-${request.requestId}`;
|
package/dist/js-client.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryvira/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
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"},
|