@tryvira/sdk 0.1.37 → 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 +29 -0
- package/dist/js-client.d.ts +32 -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,10 +723,26 @@ 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}` });
|
|
728
740
|
}
|
|
741
|
+
requestTeachProposalChanges(proposalId, feedback, options = {}) {
|
|
742
|
+
required(proposalId, "SDK_TEACH_PROPOSAL_ID_REQUIRED");
|
|
743
|
+
required(feedback, "SDK_TEACH_REQUEST_CHANGES_FEEDBACK_REQUIRED");
|
|
744
|
+
return this.request({ method: "POST", path: `/v1/teach/proposals/${encodeURIComponent(proposalId)}/request-changes`, body: { feedback } }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:request-changes:${proposalId}:${feedback}` });
|
|
745
|
+
}
|
|
729
746
|
startEvaluation(input, options = {}) {
|
|
730
747
|
return this.request(
|
|
731
748
|
{ method: "POST", path: "/v1/evaluations", body: input },
|
|
@@ -760,6 +777,12 @@ var ViraClient = class {
|
|
|
760
777
|
path: `/v1/evaluations/${encodeURIComponent(evaluationId)}/comparison`
|
|
761
778
|
});
|
|
762
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
|
+
}
|
|
763
786
|
createEvaluationPlan(input, options = {}) {
|
|
764
787
|
return this.request({ method: "POST", path: "/v1/evaluation-plans", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
765
788
|
}
|
|
@@ -783,6 +806,12 @@ var ViraClient = class {
|
|
|
783
806
|
required(proposalId, "SDK_IMPROVEMENT_PROPOSAL_ID_REQUIRED");
|
|
784
807
|
return this.request({ method: "POST", path: `/v1/behavior-improvement-proposals/${encodeURIComponent(proposalId)}`, body: { action } }, { idempotencyKey: options.idempotencyKey ?? `sdk:improvement-proposal:${action}:${proposalId}` });
|
|
785
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
|
+
}
|
|
786
815
|
createBehaviorRevisionCandidate(input, options = {}) {
|
|
787
816
|
return this.request({ method: "POST", path: "/v1/behavior-revision-candidates", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
788
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,9 +436,22 @@ 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
|
+
requestTeachProposalChanges(proposalId: string, feedback: string, options?: {
|
|
453
|
+
idempotencyKey?: string;
|
|
454
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
436
455
|
startEvaluation(input: ClientBody, options?: {
|
|
437
456
|
idempotencyKey?: string;
|
|
438
457
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -449,6 +468,12 @@ export declare class ViraClient {
|
|
|
449
468
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
450
469
|
getEvaluation(evaluationId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
451
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>;
|
|
452
477
|
createEvaluationPlan(input: ClientBody, options?: {
|
|
453
478
|
idempotencyKey?: string;
|
|
454
479
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -463,6 +488,13 @@ export declare class ViraClient {
|
|
|
463
488
|
reviewImprovementProposal(proposalId: string, action?: 'request-review' | 'approve' | 'reject', options?: {
|
|
464
489
|
idempotencyKey?: string;
|
|
465
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>;
|
|
466
498
|
createBehaviorRevisionCandidate(input: ClientBody, options?: {
|
|
467
499
|
idempotencyKey?: string;
|
|
468
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"},
|