@tryvira/sdk 0.1.38 → 0.1.39
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 +24 -0
- package/dist/js-client.d.ts +29 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45,6 +45,7 @@ var ViraClient = class {
|
|
|
45
45
|
createPlan: (input, options2 = {}) => this.createEvaluationPlan(input, options2),
|
|
46
46
|
get: (id) => this.getEvaluation(id),
|
|
47
47
|
compare: (id) => this.getEvaluationComparison(id),
|
|
48
|
+
reviewFinding: (evaluationId, findingId, input, options2 = {}) => this.reviewComparativeFinding(evaluationId, findingId, input, options2),
|
|
48
49
|
proposeImprovement: (id, input, options2 = {}) => this.createImprovementProposal(id, input, options2)
|
|
49
50
|
};
|
|
50
51
|
this.teach = {
|
|
@@ -722,6 +723,17 @@ var ViraClient = class {
|
|
|
722
723
|
required(actorId, "SDK_TEACH_RECOMMENDATION_ACTOR_REQUIRED");
|
|
723
724
|
return this.request({ method: "POST", path: `/v1/teach/runs/${encodeURIComponent(teachRunId)}/recommendation/accept`, body: { actorId } }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:recommendation:accept:${teachRunId}` });
|
|
724
725
|
}
|
|
726
|
+
rejectTeachRecommendation(teachRunId, reason, options = {}) {
|
|
727
|
+
required(teachRunId, "SDK_TEACH_RUN_ID_REQUIRED");
|
|
728
|
+
required(reason, "SDK_TEACH_RECOMMENDATION_REASON_REQUIRED");
|
|
729
|
+
return this.request({ method: "POST", path: `/v1/teach/runs/${encodeURIComponent(teachRunId)}/recommendation/reject`, body: { reason } }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:recommendation:reject:${teachRunId}` });
|
|
730
|
+
}
|
|
731
|
+
editTeachRecommendation(teachRunId, input, options = {}) {
|
|
732
|
+
required(teachRunId, "SDK_TEACH_RUN_ID_REQUIRED");
|
|
733
|
+
required(input?.revisionId, "SDK_TEACH_RECOMMENDATION_REVISION_ID_REQUIRED");
|
|
734
|
+
required(input?.reason, "SDK_TEACH_RECOMMENDATION_REASON_REQUIRED");
|
|
735
|
+
return this.request({ method: "POST", path: `/v1/teach/runs/${encodeURIComponent(teachRunId)}/recommendation/edit`, body: input }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:recommendation:edit:${input.revisionId}` });
|
|
736
|
+
}
|
|
725
737
|
transitionTeachProposal(proposalId, transition, input = {}, options = {}) {
|
|
726
738
|
required(proposalId, "SDK_TEACH_PROPOSAL_ID_REQUIRED");
|
|
727
739
|
return this.request({ method: "POST", path: `/v1/teach/proposals/${encodeURIComponent(proposalId)}/${transition}`, body: input }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:${transition}:${proposalId}` });
|
|
@@ -765,6 +777,12 @@ var ViraClient = class {
|
|
|
765
777
|
path: `/v1/evaluations/${encodeURIComponent(evaluationId)}/comparison`
|
|
766
778
|
});
|
|
767
779
|
}
|
|
780
|
+
reviewComparativeFinding(evaluationId, findingId, input, options = {}) {
|
|
781
|
+
required(evaluationId, "SDK_EVALUATION_ID_REQUIRED");
|
|
782
|
+
required(findingId, "SDK_COMPARATIVE_FINDING_ID_REQUIRED");
|
|
783
|
+
if (!["ACCEPT", "REJECT", "EDIT", "MORE_EVIDENCE"].includes(input?.decision)) throw new Error("SDK_COMPARATIVE_FINDING_DECISION_INVALID");
|
|
784
|
+
return this.request({ method: "POST", path: `/v1/evaluations/${encodeURIComponent(evaluationId)}/comparison/findings/${encodeURIComponent(findingId)}/review`, body: { ...input } }, { idempotencyKey: options.idempotencyKey ?? `sdk:comparison:finding:${evaluationId}:${findingId}` });
|
|
785
|
+
}
|
|
768
786
|
createEvaluationPlan(input, options = {}) {
|
|
769
787
|
return this.request({ method: "POST", path: "/v1/evaluation-plans", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
770
788
|
}
|
|
@@ -788,6 +806,12 @@ var ViraClient = class {
|
|
|
788
806
|
required(proposalId, "SDK_IMPROVEMENT_PROPOSAL_ID_REQUIRED");
|
|
789
807
|
return this.request({ method: "POST", path: `/v1/behavior-improvement-proposals/${encodeURIComponent(proposalId)}`, body: { action } }, { idempotencyKey: options.idempotencyKey ?? `sdk:improvement-proposal:${action}:${proposalId}` });
|
|
790
808
|
}
|
|
809
|
+
editImprovementProposalAsNew(proposalId, input, options = {}) {
|
|
810
|
+
required(proposalId, "SDK_IMPROVEMENT_PROPOSAL_ID_REQUIRED");
|
|
811
|
+
required(input?.id, "SDK_IMPROVEMENT_EDIT_ID_REQUIRED");
|
|
812
|
+
required(input?.reason, "SDK_IMPROVEMENT_EDIT_REASON_REQUIRED");
|
|
813
|
+
return this.request({ method: "POST", path: `/v1/behavior-improvement-proposals/${encodeURIComponent(proposalId)}`, body: { ...input, action: "edit" } }, { idempotencyKey: options.idempotencyKey ?? `sdk:improvement-proposal:edit:${input.id}` });
|
|
814
|
+
}
|
|
791
815
|
createBehaviorRevisionCandidate(input, options = {}) {
|
|
792
816
|
return this.request({ method: "POST", path: "/v1/behavior-revision-candidates", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
793
817
|
}
|
package/dist/js-client.d.ts
CHANGED
|
@@ -66,6 +66,12 @@ export type ViraLearningNamespaces = {
|
|
|
66
66
|
}) => Promise<ViraResponse<ClientBody> | null>;
|
|
67
67
|
get: (id: string) => Promise<ViraResponse<ClientBody> | null>;
|
|
68
68
|
compare: (id: string) => Promise<ViraResponse<ClientBody> | null>;
|
|
69
|
+
reviewFinding: (evaluationId: string, findingId: string, input: {
|
|
70
|
+
decision: 'ACCEPT' | 'REJECT' | 'EDIT' | 'MORE_EVIDENCE';
|
|
71
|
+
reason?: string;
|
|
72
|
+
}, options?: {
|
|
73
|
+
idempotencyKey?: string;
|
|
74
|
+
}) => Promise<ViraResponse<ClientBody> | null>;
|
|
69
75
|
proposeImprovement: (id: string, input: ClientBody, options?: {
|
|
70
76
|
idempotencyKey?: string;
|
|
71
77
|
}) => Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -430,6 +436,16 @@ export declare class ViraClient {
|
|
|
430
436
|
acceptTeachRecommendation(teachRunId: string, actorId: string, options?: {
|
|
431
437
|
idempotencyKey?: string;
|
|
432
438
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
439
|
+
rejectTeachRecommendation(teachRunId: string, reason: string, options?: {
|
|
440
|
+
idempotencyKey?: string;
|
|
441
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
442
|
+
editTeachRecommendation(teachRunId: string, input: {
|
|
443
|
+
revisionId: string;
|
|
444
|
+
reason: string;
|
|
445
|
+
behaviorSet: ClientBody;
|
|
446
|
+
}, options?: {
|
|
447
|
+
idempotencyKey?: string;
|
|
448
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
433
449
|
transitionTeachProposal(proposalId: string, transition: 'review' | 'evaluate' | 'promote', input?: ClientBody, options?: {
|
|
434
450
|
idempotencyKey?: string;
|
|
435
451
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -452,6 +468,12 @@ export declare class ViraClient {
|
|
|
452
468
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
453
469
|
getEvaluation(evaluationId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
454
470
|
getEvaluationComparison(evaluationId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
471
|
+
reviewComparativeFinding(evaluationId: string, findingId: string, input: {
|
|
472
|
+
decision: 'ACCEPT' | 'REJECT' | 'EDIT' | 'MORE_EVIDENCE';
|
|
473
|
+
reason?: string;
|
|
474
|
+
}, options?: {
|
|
475
|
+
idempotencyKey?: string;
|
|
476
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
455
477
|
createEvaluationPlan(input: ClientBody, options?: {
|
|
456
478
|
idempotencyKey?: string;
|
|
457
479
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -466,6 +488,13 @@ export declare class ViraClient {
|
|
|
466
488
|
reviewImprovementProposal(proposalId: string, action?: 'request-review' | 'approve' | 'reject', options?: {
|
|
467
489
|
idempotencyKey?: string;
|
|
468
490
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
491
|
+
editImprovementProposalAsNew(proposalId: string, input: {
|
|
492
|
+
id: string;
|
|
493
|
+
behaviorSet: ClientBody;
|
|
494
|
+
reason: string;
|
|
495
|
+
}, options?: {
|
|
496
|
+
idempotencyKey?: string;
|
|
497
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
469
498
|
createBehaviorRevisionCandidate(input: ClientBody, options?: {
|
|
470
499
|
idempotencyKey?: string;
|
|
471
500
|
}): 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.39",
|
|
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"},
|