@tryvira/sdk 0.1.38 → 0.1.40
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 +36 -0
- package/dist/js-client.d.ts +39 -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 = {
|
|
@@ -682,6 +683,18 @@ var ViraClient = class {
|
|
|
682
683
|
{ idempotencyKey: options.idempotencyKey }
|
|
683
684
|
);
|
|
684
685
|
}
|
|
686
|
+
listConversationArchive(input = {}) {
|
|
687
|
+
return this.request({ method: "GET", path: "/v1/teach/conversations", query: { ...input.limit === void 0 ? {} : { limit: String(input.limit) }, ...input.cursor ? { cursor: input.cursor } : {} } });
|
|
688
|
+
}
|
|
689
|
+
importConversationArchive(conversations, options = {}) {
|
|
690
|
+
if (!Array.isArray(conversations) || !conversations.length) throw new Error("SDK_CONVERSATION_IMPORT_REQUIRED");
|
|
691
|
+
return this.request({ method: "POST", path: "/v1/teach/conversations/import", body: { conversations: [...conversations] } }, { idempotencyKey: options.idempotencyKey });
|
|
692
|
+
}
|
|
693
|
+
revokeConversation(evidenceId, reason, options = {}) {
|
|
694
|
+
required(evidenceId, "SDK_CONVERSATION_ID_REQUIRED");
|
|
695
|
+
required(reason, "SDK_CONVERSATION_REVOCATION_REASON_REQUIRED");
|
|
696
|
+
return this.request({ method: "POST", path: `/v1/teach/conversations/${encodeURIComponent(evidenceId)}/revoke`, body: { reason } }, { idempotencyKey: options.idempotencyKey });
|
|
697
|
+
}
|
|
685
698
|
createTeachAnalysis(evidenceIds, options = {}) {
|
|
686
699
|
if (!Array.isArray(evidenceIds) || evidenceIds.length < 1) throw new Error("SDK_TEACH_ANALYSIS_EVIDENCE_REQUIRED");
|
|
687
700
|
const body = { evidenceIds: [...evidenceIds] };
|
|
@@ -722,6 +735,17 @@ var ViraClient = class {
|
|
|
722
735
|
required(actorId, "SDK_TEACH_RECOMMENDATION_ACTOR_REQUIRED");
|
|
723
736
|
return this.request({ method: "POST", path: `/v1/teach/runs/${encodeURIComponent(teachRunId)}/recommendation/accept`, body: { actorId } }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:recommendation:accept:${teachRunId}` });
|
|
724
737
|
}
|
|
738
|
+
rejectTeachRecommendation(teachRunId, reason, options = {}) {
|
|
739
|
+
required(teachRunId, "SDK_TEACH_RUN_ID_REQUIRED");
|
|
740
|
+
required(reason, "SDK_TEACH_RECOMMENDATION_REASON_REQUIRED");
|
|
741
|
+
return this.request({ method: "POST", path: `/v1/teach/runs/${encodeURIComponent(teachRunId)}/recommendation/reject`, body: { reason } }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:recommendation:reject:${teachRunId}` });
|
|
742
|
+
}
|
|
743
|
+
editTeachRecommendation(teachRunId, input, options = {}) {
|
|
744
|
+
required(teachRunId, "SDK_TEACH_RUN_ID_REQUIRED");
|
|
745
|
+
required(input?.revisionId, "SDK_TEACH_RECOMMENDATION_REVISION_ID_REQUIRED");
|
|
746
|
+
required(input?.reason, "SDK_TEACH_RECOMMENDATION_REASON_REQUIRED");
|
|
747
|
+
return this.request({ method: "POST", path: `/v1/teach/runs/${encodeURIComponent(teachRunId)}/recommendation/edit`, body: input }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:recommendation:edit:${input.revisionId}` });
|
|
748
|
+
}
|
|
725
749
|
transitionTeachProposal(proposalId, transition, input = {}, options = {}) {
|
|
726
750
|
required(proposalId, "SDK_TEACH_PROPOSAL_ID_REQUIRED");
|
|
727
751
|
return this.request({ method: "POST", path: `/v1/teach/proposals/${encodeURIComponent(proposalId)}/${transition}`, body: input }, { idempotencyKey: options.idempotencyKey ?? `sdk:teach:${transition}:${proposalId}` });
|
|
@@ -765,6 +789,12 @@ var ViraClient = class {
|
|
|
765
789
|
path: `/v1/evaluations/${encodeURIComponent(evaluationId)}/comparison`
|
|
766
790
|
});
|
|
767
791
|
}
|
|
792
|
+
reviewComparativeFinding(evaluationId, findingId, input, options = {}) {
|
|
793
|
+
required(evaluationId, "SDK_EVALUATION_ID_REQUIRED");
|
|
794
|
+
required(findingId, "SDK_COMPARATIVE_FINDING_ID_REQUIRED");
|
|
795
|
+
if (!["ACCEPT", "REJECT", "EDIT", "MORE_EVIDENCE"].includes(input?.decision)) throw new Error("SDK_COMPARATIVE_FINDING_DECISION_INVALID");
|
|
796
|
+
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}` });
|
|
797
|
+
}
|
|
768
798
|
createEvaluationPlan(input, options = {}) {
|
|
769
799
|
return this.request({ method: "POST", path: "/v1/evaluation-plans", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
770
800
|
}
|
|
@@ -788,6 +818,12 @@ var ViraClient = class {
|
|
|
788
818
|
required(proposalId, "SDK_IMPROVEMENT_PROPOSAL_ID_REQUIRED");
|
|
789
819
|
return this.request({ method: "POST", path: `/v1/behavior-improvement-proposals/${encodeURIComponent(proposalId)}`, body: { action } }, { idempotencyKey: options.idempotencyKey ?? `sdk:improvement-proposal:${action}:${proposalId}` });
|
|
790
820
|
}
|
|
821
|
+
editImprovementProposalAsNew(proposalId, input, options = {}) {
|
|
822
|
+
required(proposalId, "SDK_IMPROVEMENT_PROPOSAL_ID_REQUIRED");
|
|
823
|
+
required(input?.id, "SDK_IMPROVEMENT_EDIT_ID_REQUIRED");
|
|
824
|
+
required(input?.reason, "SDK_IMPROVEMENT_EDIT_REASON_REQUIRED");
|
|
825
|
+
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}` });
|
|
826
|
+
}
|
|
791
827
|
createBehaviorRevisionCandidate(input, options = {}) {
|
|
792
828
|
return this.request({ method: "POST", path: "/v1/behavior-revision-candidates", body: input }, { idempotencyKey: options.idempotencyKey });
|
|
793
829
|
}
|
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>;
|
|
@@ -402,6 +408,16 @@ export declare class ViraClient {
|
|
|
402
408
|
submitTeachEvidence(evidence: ClientBody, options?: {
|
|
403
409
|
idempotencyKey?: string;
|
|
404
410
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
411
|
+
listConversationArchive(input?: {
|
|
412
|
+
limit?: number;
|
|
413
|
+
cursor?: string;
|
|
414
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
415
|
+
importConversationArchive(conversations: readonly ClientBody[], options?: {
|
|
416
|
+
idempotencyKey?: string;
|
|
417
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
418
|
+
revokeConversation(evidenceId: string, reason: string, options?: {
|
|
419
|
+
idempotencyKey?: string;
|
|
420
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
405
421
|
createTeachAnalysis(evidenceIds: readonly string[], options?: {
|
|
406
422
|
idempotencyKey?: string;
|
|
407
423
|
analysisId?: string;
|
|
@@ -430,6 +446,16 @@ export declare class ViraClient {
|
|
|
430
446
|
acceptTeachRecommendation(teachRunId: string, actorId: string, options?: {
|
|
431
447
|
idempotencyKey?: string;
|
|
432
448
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
449
|
+
rejectTeachRecommendation(teachRunId: string, reason: string, options?: {
|
|
450
|
+
idempotencyKey?: string;
|
|
451
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
452
|
+
editTeachRecommendation(teachRunId: string, input: {
|
|
453
|
+
revisionId: string;
|
|
454
|
+
reason: string;
|
|
455
|
+
behaviorSet: ClientBody;
|
|
456
|
+
}, options?: {
|
|
457
|
+
idempotencyKey?: string;
|
|
458
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
433
459
|
transitionTeachProposal(proposalId: string, transition: 'review' | 'evaluate' | 'promote', input?: ClientBody, options?: {
|
|
434
460
|
idempotencyKey?: string;
|
|
435
461
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -452,6 +478,12 @@ export declare class ViraClient {
|
|
|
452
478
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
453
479
|
getEvaluation(evaluationId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
454
480
|
getEvaluationComparison(evaluationId: string): Promise<ViraResponse<ClientBody> | null>;
|
|
481
|
+
reviewComparativeFinding(evaluationId: string, findingId: string, input: {
|
|
482
|
+
decision: 'ACCEPT' | 'REJECT' | 'EDIT' | 'MORE_EVIDENCE';
|
|
483
|
+
reason?: string;
|
|
484
|
+
}, options?: {
|
|
485
|
+
idempotencyKey?: string;
|
|
486
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
455
487
|
createEvaluationPlan(input: ClientBody, options?: {
|
|
456
488
|
idempotencyKey?: string;
|
|
457
489
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
@@ -466,6 +498,13 @@ export declare class ViraClient {
|
|
|
466
498
|
reviewImprovementProposal(proposalId: string, action?: 'request-review' | 'approve' | 'reject', options?: {
|
|
467
499
|
idempotencyKey?: string;
|
|
468
500
|
}): Promise<ViraResponse<ClientBody> | null>;
|
|
501
|
+
editImprovementProposalAsNew(proposalId: string, input: {
|
|
502
|
+
id: string;
|
|
503
|
+
behaviorSet: ClientBody;
|
|
504
|
+
reason: string;
|
|
505
|
+
}, options?: {
|
|
506
|
+
idempotencyKey?: string;
|
|
507
|
+
}): Promise<ViraResponse<ClientBody> | null>;
|
|
469
508
|
createBehaviorRevisionCandidate(input: ClientBody, options?: {
|
|
470
509
|
idempotencyKey?: string;
|
|
471
510
|
}): 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.40",
|
|
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"},
|