@tryvira/sdk 0.1.5 → 0.1.8
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 +37 -0
- package/dist/js-client.d.ts +37 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,6 +112,13 @@ var ViraClient = class {
|
|
|
112
112
|
idempotencyKey: input.idempotencyKey
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
+
listAISystems() {
|
|
116
|
+
return this.request({ method: "GET", path: "/v1/ai-systems" });
|
|
117
|
+
}
|
|
118
|
+
getAISystem(systemId) {
|
|
119
|
+
required(systemId, "SDK_SYSTEM_ID_REQUIRED");
|
|
120
|
+
return this.request({ method: "GET", path: `/v1/ai-systems/${encodeURIComponent(systemId)}` });
|
|
121
|
+
}
|
|
115
122
|
connectAdapter(systemId, input) {
|
|
116
123
|
required(systemId, "SDK_SYSTEM_ID_REQUIRED");
|
|
117
124
|
const body = {
|
|
@@ -406,6 +413,21 @@ var ViraClient = class {
|
|
|
406
413
|
body: { definition, ...id ? { id } : {} }
|
|
407
414
|
});
|
|
408
415
|
}
|
|
416
|
+
listSemanticTasks() {
|
|
417
|
+
return this.request({ method: "GET", path: "/v1/semantic-tasks" });
|
|
418
|
+
}
|
|
419
|
+
createSemanticTask(task, options = {}) {
|
|
420
|
+
required(task?.taskKey, "SDK_SEMANTIC_TASK_KEY_REQUIRED");
|
|
421
|
+
return this.request({ method: "POST", path: "/v1/semantic-tasks", body: { ...task, ...options.id ? { id: options.id } : {} } }, { idempotencyKey: options.idempotencyKey ?? `sdk:semantic-task:${task.taskKey}` });
|
|
422
|
+
}
|
|
423
|
+
listBehaviorPoints() {
|
|
424
|
+
return this.request({ method: "GET", path: "/v1/behavior-points" });
|
|
425
|
+
}
|
|
426
|
+
createBehaviorPoint(point, options = {}) {
|
|
427
|
+
required(point?.key, "SDK_BEHAVIOR_POINT_KEY_REQUIRED");
|
|
428
|
+
if (!point.taskId && !point.taskIds?.length) throw new Error("SDK_BEHAVIOR_POINT_TASK_REQUIRED");
|
|
429
|
+
return this.request({ method: "POST", path: "/v1/behavior-points", body: { ...point, ...options.id ? { id: options.id } : {} } }, { idempotencyKey: options.idempotencyKey ?? `sdk:behavior-point:${point.key}` });
|
|
430
|
+
}
|
|
409
431
|
createBehaviorStrategyVariant(strategyId, variant, options = {}) {
|
|
410
432
|
required(strategyId, "SDK_STRATEGY_ID_REQUIRED");
|
|
411
433
|
if (!variant || typeof variant !== "object")
|
|
@@ -427,6 +449,10 @@ var ViraClient = class {
|
|
|
427
449
|
body: {}
|
|
428
450
|
});
|
|
429
451
|
}
|
|
452
|
+
activateBehaviorStrategy(strategyId) {
|
|
453
|
+
required(strategyId, "SDK_STRATEGY_ID_REQUIRED");
|
|
454
|
+
return this.request({ method: "POST", path: `/v1/behavior-strategies/${encodeURIComponent(strategyId)}/activate`, body: {} });
|
|
455
|
+
}
|
|
430
456
|
simulateBehaviorStrategy(strategyId, initialState = {}) {
|
|
431
457
|
required(strategyId, "SDK_STRATEGY_ID_REQUIRED");
|
|
432
458
|
return this.request({
|
|
@@ -509,6 +535,10 @@ var ViraClient = class {
|
|
|
509
535
|
path: "/v1/behavior-programs"
|
|
510
536
|
});
|
|
511
537
|
}
|
|
538
|
+
listCapabilities(options = {}) {
|
|
539
|
+
const query = options.surface ? `?surface=${encodeURIComponent(options.surface)}` : "";
|
|
540
|
+
return this.request({ method: "GET", path: `/v1/capabilities${query}` });
|
|
541
|
+
}
|
|
512
542
|
getBehaviorProgram(programId) {
|
|
513
543
|
required(programId, "SDK_PROGRAM_ID_REQUIRED");
|
|
514
544
|
return this.request({
|
|
@@ -580,6 +610,13 @@ var ViraClient = class {
|
|
|
580
610
|
{ idempotencyKey: options.idempotencyKey }
|
|
581
611
|
);
|
|
582
612
|
}
|
|
613
|
+
createTeachProposal(input, options = {}) {
|
|
614
|
+
return this.request({ method: "POST", path: "/v1/teach/proposals", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
615
|
+
}
|
|
616
|
+
transitionTeachProposal(proposalId, transition, input = {}, options = {}) {
|
|
617
|
+
required(proposalId, "SDK_TEACH_PROPOSAL_ID_REQUIRED");
|
|
618
|
+
return this.request({ method: "POST", path: `/v1/teach/proposals/${encodeURIComponent(proposalId)}/${transition}`, body: input }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:${transition}:${proposalId}` });
|
|
619
|
+
}
|
|
583
620
|
startEvaluation(input, options = {}) {
|
|
584
621
|
return this.request(
|
|
585
622
|
{ method: "POST", path: "/v1/evaluations", body: input },
|
package/dist/js-client.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export declare class ViraClient {
|
|
|
73
73
|
}): Promise<ViraResponse<{
|
|
74
74
|
system: ClientBody;
|
|
75
75
|
}> | null>;
|
|
76
|
+
listAISystems(): Promise<ViraResponse<ClientBody> | null>;
|
|
77
|
+
getAISystem(systemId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
76
78
|
connectAdapter(systemId: string, input: {
|
|
77
79
|
adapterType: string;
|
|
78
80
|
adapterVersion: string;
|
|
@@ -215,10 +217,33 @@ export declare class ViraClient {
|
|
|
215
217
|
listBehaviorStrategies(): Promise<ViraResponse<ClientBody> | null>;
|
|
216
218
|
getBehaviorStrategy(strategyId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
217
219
|
createBehaviorStrategy(definition: Record<string, unknown>, id?: string): Promise<ViraResponse<ClientBody> | null>;
|
|
220
|
+
listSemanticTasks(): Promise<ViraResponse<ClientBody> | null>;
|
|
221
|
+
createSemanticTask(task: {
|
|
222
|
+
taskKey: string;
|
|
223
|
+
description?: string;
|
|
224
|
+
version?: number;
|
|
225
|
+
aliases?: readonly string[];
|
|
226
|
+
examples?: readonly string[];
|
|
227
|
+
negativeExamples?: readonly string[];
|
|
228
|
+
}, options?: {
|
|
229
|
+
id?: string;
|
|
230
|
+
idempotencyKey?: string;
|
|
231
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
232
|
+
listBehaviorPoints(): Promise<ViraResponse<ClientBody> | null>;
|
|
233
|
+
createBehaviorPoint(point: {
|
|
234
|
+
key: string;
|
|
235
|
+
taskId?: string;
|
|
236
|
+
taskIds?: readonly string[];
|
|
237
|
+
constraints?: unknown;
|
|
238
|
+
}, options?: {
|
|
239
|
+
id?: string;
|
|
240
|
+
idempotencyKey?: string;
|
|
241
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
218
242
|
createBehaviorStrategyVariant(strategyId: string, variant: Record<string, unknown>, options?: {
|
|
219
243
|
idempotencyKey?: string;
|
|
220
244
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
221
245
|
validateBehaviorStrategy(strategyId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
246
|
+
activateBehaviorStrategy(strategyId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
222
247
|
simulateBehaviorStrategy(strategyId: string, initialState?: Record<string, unknown>): Promise<ViraResponse<ClientBody> | null>;
|
|
223
248
|
startStrategyExecution(input: {
|
|
224
249
|
artifactDigest: string;
|
|
@@ -249,6 +274,12 @@ export declare class ViraClient {
|
|
|
249
274
|
listBehaviorPrograms(): Promise<ViraResponse<{
|
|
250
275
|
programs: readonly ClientBody[];
|
|
251
276
|
}> | null>;
|
|
277
|
+
listCapabilities(options?: {
|
|
278
|
+
surface?: 'studio' | 'sdk' | 'python' | 'mcp' | 'api';
|
|
279
|
+
}): Promise<ViraResponse<{
|
|
280
|
+
capabilities: readonly ClientBody[];
|
|
281
|
+
scope: ClientBody;
|
|
282
|
+
}> | null>;
|
|
252
283
|
getBehaviorProgram(programId: string): Promise<ViraResponse<{
|
|
253
284
|
program: ClientBody;
|
|
254
285
|
}> | null>;
|
|
@@ -275,6 +306,12 @@ export declare class ViraClient {
|
|
|
275
306
|
submitTeachEvidence(evidence: ClientBody, options?: {
|
|
276
307
|
idempotencyKey?: string;
|
|
277
308
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
309
|
+
createTeachProposal(input: ClientBody, options?: {
|
|
310
|
+
idempotencyKey?: string;
|
|
311
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
312
|
+
transitionTeachProposal(proposalId: string, transition: 'review' | 'evaluate' | 'promote', input?: ClientBody, options?: {
|
|
313
|
+
idempotencyKey?: string;
|
|
314
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
278
315
|
startEvaluation(input: ClientBody, options?: {
|
|
279
316
|
idempotencyKey?: string;
|
|
280
317
|
}): 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.8",
|
|
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"},
|