@xpert-ai/contracts 3.16.0 → 3.17.1

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.
Files changed (34) hide show
  1. package/index.cjs.js +197 -35
  2. package/index.esm.js +185 -33
  3. package/package.json +1 -1
  4. package/src/agent/ai-model.d.ts +4 -1
  5. package/src/agent/graph.d.ts +2 -0
  6. package/src/ai/ai-model.model.d.ts +6 -1
  7. package/src/ai/evolution/candidate.d.ts +67 -0
  8. package/src/ai/evolution/capability-version.d.ts +45 -0
  9. package/src/ai/evolution/evaluation.d.ts +93 -0
  10. package/src/ai/evolution/example.d.ts +42 -0
  11. package/src/ai/evolution/experience.d.ts +21 -0
  12. package/src/ai/evolution/governance.d.ts +87 -0
  13. package/src/ai/evolution/index.d.ts +11 -0
  14. package/src/ai/evolution/learning-event.d.ts +69 -0
  15. package/src/ai/evolution/provider.d.ts +30 -0
  16. package/src/ai/evolution/release.d.ts +144 -0
  17. package/src/ai/evolution/runtime.d.ts +81 -0
  18. package/src/ai/evolution/target.d.ts +83 -0
  19. package/src/ai/index.d.ts +3 -0
  20. package/src/ai/knowledge-doc-chunk.model.d.ts +143 -0
  21. package/src/ai/knowledge-doc.model.d.ts +53 -4
  22. package/src/ai/knowledge-filter.model.d.ts +92 -0
  23. package/src/ai/knowledge-retrieval-log.model.d.ts +16 -0
  24. package/src/ai/knowledgebase-task.model.d.ts +3 -1
  25. package/src/ai/knowledgebase.model.d.ts +6 -0
  26. package/src/ai/membership.model.d.ts +40 -7
  27. package/src/ai/model-gateway.model.d.ts +5 -0
  28. package/src/ai/model-usage.model.d.ts +163 -0
  29. package/src/ai/role-permissions.d.ts +4 -1
  30. package/src/ai/xpert-agent-execution.model.d.ts +2 -0
  31. package/src/ai/xpert.model.d.ts +23 -11
  32. package/src/plugin.d.ts +4 -0
  33. package/src/tenant.model.d.ts +1 -1
  34. package/src/view-extension/model.d.ts +12 -1
@@ -0,0 +1,93 @@
1
+ import { CapabilityVersionBundle } from './capability-version';
2
+ import { EvolutionProviderContext, EvolutionScope } from './target';
3
+ export interface GoldenCaseRevision {
4
+ caseId: string;
5
+ revision: number;
6
+ input: Record<string, string | number | boolean>;
7
+ expected: Record<string, string | number | boolean>;
8
+ slice: string;
9
+ risk: 'low' | 'medium' | 'high';
10
+ evidenceRef: string;
11
+ }
12
+ export interface DatasetSnapshot {
13
+ snapshotId: string;
14
+ datasetId: string;
15
+ targetId?: string;
16
+ scope?: EvolutionScope;
17
+ name: string;
18
+ evaluatorVersion: string;
19
+ metricDefinitionVersion: string;
20
+ cases: GoldenCaseRevision[];
21
+ snapshotHash: string;
22
+ createdAt: string;
23
+ }
24
+ export interface ReplayCaseRequest {
25
+ context?: EvolutionProviderContext;
26
+ evaluationRunId: string;
27
+ candidateId: string;
28
+ datasetSnapshotId: string;
29
+ caseRevision: GoldenCaseRevision;
30
+ baselineBundle: CapabilityVersionBundle;
31
+ candidateBundle: CapabilityVersionBundle;
32
+ randomSeed: number;
33
+ repeatIndex: number;
34
+ }
35
+ export interface GoldenDataset {
36
+ datasetId: string;
37
+ targetId: string;
38
+ name: string;
39
+ description?: string;
40
+ caseCount: number;
41
+ status: 'draft' | 'ready' | 'archived';
42
+ createdAt: string;
43
+ updatedAt: string;
44
+ }
45
+ export interface ReplayCaseResult {
46
+ caseId: string;
47
+ baselineOutput: Record<string, string | number | boolean>;
48
+ candidateOutput: Record<string, string | number | boolean>;
49
+ expectedOutput: Record<string, string | number | boolean>;
50
+ baselinePassed: boolean;
51
+ candidatePassed: boolean;
52
+ severeError: boolean;
53
+ latencyMs: number;
54
+ cost: number;
55
+ traceRef: string;
56
+ }
57
+ export interface MetricObservation {
58
+ metricKey: string;
59
+ value: number;
60
+ unit: 'ratio' | 'count' | 'milliseconds' | 'currency';
61
+ slice?: string;
62
+ blocking: boolean;
63
+ }
64
+ export interface EvaluationMetrics {
65
+ baselineAccuracy: number;
66
+ candidateAccuracy: number;
67
+ accuracyDelta: number;
68
+ severeErrors: number;
69
+ p95LatencyMs: number;
70
+ averageCost: number;
71
+ totalCases: number;
72
+ passedCases: number;
73
+ }
74
+ export interface EvaluationGateResult {
75
+ passed: boolean;
76
+ decision: 'promote' | 'hold' | 'reject';
77
+ blockingReasons: string[];
78
+ }
79
+ export interface EvaluationRun {
80
+ runId: string;
81
+ targetId?: string;
82
+ scope?: EvolutionScope;
83
+ candidateId: string;
84
+ datasetSnapshotId: string;
85
+ baselineBundle: CapabilityVersionBundle;
86
+ candidateBundle: CapabilityVersionBundle;
87
+ status: 'running' | 'passed' | 'failed';
88
+ metrics: EvaluationMetrics;
89
+ gate: EvaluationGateResult;
90
+ caseResults: ReplayCaseResult[];
91
+ startedAt: string;
92
+ completedAt?: string;
93
+ }
@@ -0,0 +1,42 @@
1
+ export type EvolutionPersistenceTable = 'agent_evolution_target' | 'agent_evolution_capability_version' | 'agent_evolution_capability_bundle' | 'agent_evolution_active_pointer' | 'agent_evolution_learning_event' | 'agent_evolution_proposal' | 'agent_evolution_candidate' | 'agent_evolution_dataset_snapshot' | 'agent_evolution_evaluation_run' | 'agent_evolution_approval' | 'agent_evolution_release_package' | 'agent_evolution_release_deployment' | 'agent_evolution_audit_event';
2
+ export interface EvolutionPersistenceTableEvidence {
3
+ table: EvolutionPersistenceTable;
4
+ expectedCount: number;
5
+ actualCount: number;
6
+ recordIds: string[];
7
+ missingRecordIds: string[];
8
+ }
9
+ export interface EvolutionPersistenceEvidence {
10
+ verified: boolean;
11
+ rowCount: number;
12
+ tables: EvolutionPersistenceTableEvidence[];
13
+ }
14
+ export interface EvolutionExampleDescriptor {
15
+ key: string;
16
+ name: string;
17
+ description: string;
18
+ dataClassification: 'synthetic_test_fixture';
19
+ }
20
+ export interface EvolutionSimulationResult {
21
+ example: EvolutionExampleDescriptor;
22
+ simulationId: string;
23
+ targetId: string;
24
+ eventIds: string[];
25
+ proposalId: string;
26
+ candidateId: string;
27
+ datasetSnapshotId: string;
28
+ evaluationRunId: string;
29
+ approvalId: string;
30
+ releasePackageId: string;
31
+ deploymentIds: string[];
32
+ bundleIds: string[];
33
+ versionIds: string[];
34
+ pointerId: string;
35
+ previousVersionId: string;
36
+ activeVersionId: string;
37
+ pointerRevision: number;
38
+ gatePassed: boolean;
39
+ auditIds: string[];
40
+ auditActions: string[];
41
+ persistence: EvolutionPersistenceEvidence;
42
+ }
@@ -0,0 +1,21 @@
1
+ import type { EvolutionScope } from './target';
2
+ export interface EvolutionExperience {
3
+ experienceId: string;
4
+ targetId: string;
5
+ scope: EvolutionScope;
6
+ sourceReleasePackageId: string;
7
+ sourceCandidateId: string;
8
+ evidence: {
9
+ productionObservationCount: number;
10
+ severeErrors: number;
11
+ stableDays: number;
12
+ evaluationRunId: string;
13
+ };
14
+ summary: string;
15
+ status: 'active' | 'expired';
16
+ createdAt: string;
17
+ createdBy: string;
18
+ }
19
+ export interface CreateEvolutionExperienceRequest {
20
+ releasePackageId: string;
21
+ }
@@ -0,0 +1,87 @@
1
+ export interface EvolutionPageQuery {
2
+ page?: number;
3
+ pageSize?: number;
4
+ search?: string;
5
+ targetId?: string;
6
+ status?: string;
7
+ sort?: 'createdAt' | 'updatedAt' | 'status';
8
+ order?: 'ASC' | 'DESC';
9
+ }
10
+ export interface EvolutionPage<T> {
11
+ items: T[];
12
+ total: number;
13
+ page: number;
14
+ pageSize: number;
15
+ }
16
+ export interface ReviewLearningEventRequest {
17
+ reviewStatus: 'pending' | 'ignored' | 'golden';
18
+ }
19
+ export interface DiagnoseLearningEventsRequest {
20
+ eventIds: string[];
21
+ }
22
+ export interface EvolutionAnalysisResult {
23
+ diagnoses: import('./learning-event').EvolutionDiagnosis[];
24
+ clusters: import('./learning-event').EvolutionEventCluster[];
25
+ }
26
+ export interface CreateImprovementProposalRequest {
27
+ targetId: string;
28
+ scope: import('./target').EvolutionScope;
29
+ eventIds: string[];
30
+ title: string;
31
+ problemStatement: string;
32
+ rootCause: string;
33
+ changeHypothesis: string;
34
+ riskLevel: import('./target').EvolutionRiskLevel;
35
+ }
36
+ export interface BuildCandidateCommand {
37
+ proposalId: string;
38
+ proposalRevision: number;
39
+ changeSet: Record<string, string | number | boolean | string[]>;
40
+ }
41
+ export interface CreateDatasetSnapshotRequest {
42
+ datasetId: string;
43
+ targetId: string;
44
+ scope: import('./target').EvolutionScope;
45
+ name: string;
46
+ evaluatorVersion: string;
47
+ metricDefinitionVersion: string;
48
+ cases: import('./evaluation').GoldenCaseRevision[];
49
+ }
50
+ export interface EvaluateCandidateCommand {
51
+ candidateId: string;
52
+ datasetSnapshotId: string;
53
+ }
54
+ export interface DecideCandidateApprovalRequest {
55
+ evaluationRunId: string;
56
+ decision: 'approved' | 'rejected';
57
+ reason: string;
58
+ }
59
+ export interface CreateReleasePackageRequest {
60
+ candidateId: string;
61
+ evaluationRunId: string;
62
+ approvalIds: string[];
63
+ shadowMinimumSamples?: number;
64
+ }
65
+ export interface StartDeploymentRequest {
66
+ canaryPercent?: 5 | 25 | 50;
67
+ }
68
+ export interface CreateEvolutionCanaryTestOverrideRequest {
69
+ subjectKey: string;
70
+ reason: string;
71
+ /** Defaults to 30 minutes and is capped by the server. */
72
+ expiresInMinutes?: number;
73
+ }
74
+ export type EvolutionJobType = 'evaluation' | 'install' | 'shadow' | 'canary' | 'rollback';
75
+ export type EvolutionJobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
76
+ export interface EvolutionJob {
77
+ jobId: string;
78
+ jobType: EvolutionJobType;
79
+ resourceId: string;
80
+ status: EvolutionJobStatus;
81
+ queueJobId?: string;
82
+ errorCode?: string;
83
+ errorMessage?: string;
84
+ createdAt: string;
85
+ startedAt?: string;
86
+ completedAt?: string;
87
+ }
@@ -0,0 +1,11 @@
1
+ export * from './target';
2
+ export * from './capability-version';
3
+ export * from './learning-event';
4
+ export * from './candidate';
5
+ export * from './evaluation';
6
+ export * from './release';
7
+ export * from './provider';
8
+ export * from './example';
9
+ export * from './runtime';
10
+ export * from './governance';
11
+ export * from './experience';
@@ -0,0 +1,69 @@
1
+ import { EvolutionScope } from './target';
2
+ export type LearningEventType = 'prediction_reviewed' | 'execution_failed' | 'business_outcome';
3
+ export type LearningEventConfidence = 'L1' | 'L2' | 'L3' | 'L4';
4
+ export interface LearningEventInput {
5
+ eventId?: string;
6
+ eventType: LearningEventType;
7
+ schemaVersion: string;
8
+ idempotencyKey: string;
9
+ eventTime: string;
10
+ scope: EvolutionScope;
11
+ executionId?: string;
12
+ threadId?: string;
13
+ traceId?: string;
14
+ targetId: string;
15
+ decisionPoint: string;
16
+ subjectRef: string;
17
+ inputFingerprint: string;
18
+ predictionSummary: string;
19
+ finalOutcomeSummary: string;
20
+ confidence: number;
21
+ reasonCodes: string[];
22
+ capabilityVersionBundleId: string;
23
+ bundleHash: string;
24
+ trustLevel: LearningEventConfidence;
25
+ classification: 'public' | 'internal' | 'confidential';
26
+ redactionStatus: 'not_required' | 'redacted';
27
+ }
28
+ export interface LearningEvent extends LearningEventInput {
29
+ eventId: string;
30
+ createdAt: string;
31
+ reviewStatus?: 'pending' | 'ignored' | 'golden';
32
+ }
33
+ export interface EvolutionDiagnosis {
34
+ diagnosisId: string;
35
+ targetId: string;
36
+ scope: EvolutionScope;
37
+ eventIds: string[];
38
+ rootCause: string;
39
+ correctionSignature: string;
40
+ confidence: number;
41
+ createdAt: string;
42
+ }
43
+ export interface EvolutionEventCluster {
44
+ clusterId: string;
45
+ targetId: string;
46
+ scope: EvolutionScope;
47
+ correctionSignature: string;
48
+ eventIds: string[];
49
+ caseCount: number;
50
+ status: 'collecting' | 'proposal_ready' | 'closed';
51
+ createdAt: string;
52
+ updatedAt: string;
53
+ }
54
+ export interface ImprovementProposal {
55
+ proposalId: string;
56
+ revision: number;
57
+ targetId: string;
58
+ scope: EvolutionScope;
59
+ title: string;
60
+ problemStatement: string;
61
+ rootCause: string;
62
+ changeHypothesis: string;
63
+ evidenceEventIds: string[];
64
+ baseVersionId: string;
65
+ riskLevel: 'R1' | 'R2' | 'R3' | 'R4';
66
+ status: 'draft' | 'ready' | 'candidate_built' | 'rejected';
67
+ createdAt: string;
68
+ createdBy: string;
69
+ }
@@ -0,0 +1,30 @@
1
+ import { BuildEvolutionCandidateRequest, CandidateBuildResult, CandidateValidationResult, ExportEvolutionBaselineRequest, ExportEvolutionBaselineResult, ValidateEvolutionCandidateRequest } from './candidate';
2
+ import { MetricObservation, ReplayCaseRequest, ReplayCaseResult } from './evaluation';
3
+ import { ReleaseProviderReceipt, ReleaseProviderRequest } from './release';
4
+ import { EvolutionTargetDescriptor } from './target';
5
+ export interface EvolutionCandidateBuilder {
6
+ buildCandidate(request: BuildEvolutionCandidateRequest): Promise<CandidateBuildResult>;
7
+ validateCandidate(request: ValidateEvolutionCandidateRequest): Promise<CandidateValidationResult>;
8
+ }
9
+ export interface EvolutionBaselineExporter {
10
+ exportBaseline(request: ExportEvolutionBaselineRequest): Promise<ExportEvolutionBaselineResult>;
11
+ }
12
+ export interface EvolutionReplayEvaluator {
13
+ runReplayCase(request: ReplayCaseRequest): Promise<ReplayCaseResult>;
14
+ evaluateResult(request: ReplayCaseRequest, result: ReplayCaseResult): Promise<MetricObservation[]>;
15
+ }
16
+ export interface EvolutionReleaseProvider {
17
+ install(request: ReleaseProviderRequest): Promise<ReleaseProviderReceipt>;
18
+ activate(request: ReleaseProviderRequest): Promise<ReleaseProviderReceipt>;
19
+ rollback(request: ReleaseProviderRequest): Promise<ReleaseProviderReceipt>;
20
+ }
21
+ export interface EvolutionTargetProvider {
22
+ readonly descriptor: EvolutionTargetDescriptor;
23
+ readonly baselineExporter?: EvolutionBaselineExporter;
24
+ readonly candidateBuilder?: EvolutionCandidateBuilder;
25
+ readonly replayEvaluator?: EvolutionReplayEvaluator;
26
+ readonly releaseProvider?: EvolutionReleaseProvider;
27
+ }
28
+ export interface EvolutionProvider extends EvolutionTargetProvider {
29
+ describeTargets?(): Promise<EvolutionTargetDescriptor[]> | EvolutionTargetDescriptor[];
30
+ }
@@ -0,0 +1,144 @@
1
+ import { EvolutionChannel, EvolutionProviderContext, EvolutionScope } from './target';
2
+ export type EvolutionReleaseStatus = 'draft' | 'pending_approval' | 'approved' | 'installed' | 'shadow' | 'canary' | 'active' | 'paused' | 'rolled_back' | 'superseded';
3
+ export type EvolutionApprovalAuthority = 'standard' | 'administrator';
4
+ export type EvolutionReleaseGateProfile = 'standard' | 'manual_test';
5
+ /**
6
+ * Frozen staged-release gates. `manual_test` is accepted only by a
7
+ * non-production server and requires an administrator for gated actions.
8
+ */
9
+ export interface EvolutionReleaseGatePolicy {
10
+ profile: EvolutionReleaseGateProfile;
11
+ shadowMinimumSamples: number;
12
+ shadowMinimumDurationHours: number;
13
+ canaryMinimumSamples: number;
14
+ canaryMinimumDurationHours: number;
15
+ productionCanaryMinimumSamples: number;
16
+ productionCanaryMinimumDurationHours: number;
17
+ experienceMinimumSamples: number;
18
+ experienceMinimumDurationHours: number;
19
+ }
20
+ export interface ApprovalDecision {
21
+ approvalId: string;
22
+ candidateId: string;
23
+ candidateHash: string;
24
+ evaluationRunId: string;
25
+ scope: EvolutionScope;
26
+ decision: 'approved' | 'rejected';
27
+ actorId: string;
28
+ actorRole: string;
29
+ /** Stable role name recorded at decision time for audit display. */
30
+ actorRoleName?: string;
31
+ /**
32
+ * Administrator approvals are a governed single-approver path. Missing values
33
+ * are treated as `standard` for records created before this field existed.
34
+ */
35
+ approvalAuthority?: EvolutionApprovalAuthority;
36
+ reason: string;
37
+ decidedAt: string;
38
+ }
39
+ export interface ReleasePackage {
40
+ releasePackageId: string;
41
+ candidateId: string;
42
+ candidateHash: string;
43
+ targetId: string;
44
+ targetVersionId: string;
45
+ rollbackVersionId: string;
46
+ evaluationRunId: string;
47
+ scope: EvolutionScope;
48
+ status: EvolutionReleaseStatus;
49
+ approvalIds: string[];
50
+ artifactHash: string;
51
+ providerKey: string;
52
+ providerVersion: string;
53
+ /** Missing only on release packages created before gate policies were frozen. */
54
+ gatePolicy?: EvolutionReleaseGatePolicy;
55
+ /** @deprecated Read `gatePolicy.shadowMinimumSamples` for new release packages. */
56
+ shadowMinimumSamples: number;
57
+ canaryPercent: number;
58
+ createdAt: string;
59
+ createdBy: string;
60
+ }
61
+ export interface ReleaseDeployment {
62
+ deploymentId: string;
63
+ releasePackageId: string;
64
+ channel: EvolutionChannel;
65
+ scope: EvolutionScope;
66
+ status: EvolutionReleaseStatus;
67
+ dataSource: 'deterministic_replay' | 'runtime_telemetry';
68
+ sampleCount: number;
69
+ candidateAccuracy: number;
70
+ severeErrors: number;
71
+ canaryPercent: number;
72
+ observations: ReleaseRuntimeObservation[];
73
+ startedAt: string;
74
+ completedAt?: string;
75
+ }
76
+ export interface ReleaseRuntimeObservation {
77
+ observationId: string;
78
+ observedAt: string;
79
+ sequence: number;
80
+ sampleCount: number;
81
+ baselineAccuracy: number;
82
+ candidateAccuracy: number;
83
+ severeErrors: number;
84
+ p95LatencyMs: number;
85
+ averageCost: number;
86
+ }
87
+ export interface ReleaseProviderRequest {
88
+ context?: EvolutionProviderContext;
89
+ targetId: string;
90
+ versionId: string;
91
+ artifactHash: string;
92
+ scope: EvolutionScope;
93
+ releasePackageId: string;
94
+ actorId: string;
95
+ idempotencyKey: string;
96
+ }
97
+ export interface ReleaseProviderReceipt {
98
+ receiptId: string;
99
+ versionId: string;
100
+ operation: 'install' | 'activate' | 'rollback';
101
+ status: 'ready' | 'completed';
102
+ providerTraceId: string;
103
+ }
104
+ export interface EvolutionAuditEvent {
105
+ auditId: string;
106
+ releasePackageId?: string;
107
+ candidateId?: string;
108
+ action: string;
109
+ actorId: string;
110
+ actorRole: string;
111
+ summary: string;
112
+ metadata?: EvolutionAuditEventMetadata;
113
+ occurredAt: string;
114
+ }
115
+ export interface EvolutionAuditEventMetadata {
116
+ manualTestOverrideId?: string;
117
+ deploymentId?: string;
118
+ subjectKey?: string;
119
+ executionId?: string;
120
+ reason?: string;
121
+ overrideStatus?: EvolutionCanaryTestOverrideStatus;
122
+ }
123
+ export type EvolutionCanaryTestOverrideStatus = 'pending' | 'consumed' | 'expired';
124
+ /**
125
+ * Administrator-created, single-use Candidate assignment for one Canary subject.
126
+ * It is available only to releases frozen with the non-production `manual_test` gate profile.
127
+ */
128
+ export interface EvolutionCanaryTestOverride {
129
+ overrideId: string;
130
+ releasePackageId: string;
131
+ candidateId: string;
132
+ deploymentId: string;
133
+ targetId: string;
134
+ scope: EvolutionScope;
135
+ subjectKey: string;
136
+ status: EvolutionCanaryTestOverrideStatus;
137
+ reason: string;
138
+ createdBy: string;
139
+ createdByRole: string;
140
+ createdAt: string;
141
+ expiresAt: string;
142
+ consumedAt?: string;
143
+ consumedByExecutionId?: string;
144
+ }
@@ -0,0 +1,81 @@
1
+ import { LearningEvent, LearningEventInput } from './learning-event';
2
+ import { CapabilityVersion, CapabilityVersionBundle } from './capability-version';
3
+ import { EvolutionChannel, EvolutionExecutionMode, EvolutionScope } from './target';
4
+ export interface EvolutionRuntimeObservationInput {
5
+ observationId?: string;
6
+ targetId: string;
7
+ scope: EvolutionScope;
8
+ executionId: string;
9
+ bundleId: string;
10
+ deploymentId?: string;
11
+ subjectKey: string;
12
+ channel: EvolutionChannel;
13
+ success: boolean;
14
+ severeError: boolean;
15
+ latencyMs: number;
16
+ cost?: number;
17
+ correctionRequired?: boolean;
18
+ observedAt: string;
19
+ }
20
+ export interface EvolutionRuntimeObservation extends EvolutionRuntimeObservationInput {
21
+ observationId: string;
22
+ createdAt: string;
23
+ }
24
+ export interface ResolveCapabilityExecutionPlanRequest {
25
+ tenantId: string;
26
+ organizationId?: string | null;
27
+ scope: EvolutionScope;
28
+ targetIds: string[];
29
+ subjectKey: string;
30
+ executionId: string;
31
+ }
32
+ export interface CapabilityExecutionAssignment {
33
+ targetId: string;
34
+ channel: EvolutionChannel;
35
+ versionId: string;
36
+ deploymentId?: string;
37
+ selectionReason?: 'manual_test_override';
38
+ manualTestOverrideId?: string;
39
+ }
40
+ export interface CapabilityExecutionManualTestOverride {
41
+ overrideId: string;
42
+ releasePackageId: string;
43
+ deploymentId: string;
44
+ targetId: string;
45
+ consumedAt: string;
46
+ }
47
+ export interface CapabilityExecutionPlan {
48
+ executionId: string;
49
+ executionMode: EvolutionExecutionMode;
50
+ subjectKey: string;
51
+ bundle: CapabilityVersionBundle;
52
+ assignments: CapabilityExecutionAssignment[];
53
+ /** Explicit audit marker; never present for normal deterministic Canary routing. */
54
+ manualTestOverrides?: CapabilityExecutionManualTestOverride[];
55
+ shadowBundle?: CapabilityVersionBundle;
56
+ shadowAssignments?: CapabilityExecutionAssignment[];
57
+ resolvedAt: string;
58
+ }
59
+ export interface EvolutionRuntimeApi {
60
+ ingestLearningEvent(input: {
61
+ tenantId: string;
62
+ organizationId?: string | null;
63
+ event: LearningEventInput;
64
+ }): Promise<LearningEvent>;
65
+ resolveExecutionPlan(request: ResolveCapabilityExecutionPlanRequest): Promise<CapabilityExecutionPlan>;
66
+ getCapabilityBundle(input: {
67
+ tenantId: string;
68
+ organizationId?: string | null;
69
+ bundleId: string;
70
+ }): Promise<CapabilityVersionBundle>;
71
+ getCapabilityVersion(input: {
72
+ tenantId: string;
73
+ organizationId?: string | null;
74
+ versionId: string;
75
+ }): Promise<CapabilityVersion>;
76
+ recordRuntimeObservation(input: {
77
+ tenantId: string;
78
+ organizationId?: string | null;
79
+ observation: EvolutionRuntimeObservationInput;
80
+ }): Promise<EvolutionRuntimeObservation>;
81
+ }
@@ -0,0 +1,83 @@
1
+ import type { I18nText } from '../../i18n.model';
2
+ export type EvolutionTargetType = 'prompt_policy' | 'routing_policy' | 'extraction_policy' | 'test_fixture';
3
+ export type EvolutionScopeType = 'tenant' | 'organization' | 'workspace' | 'project';
4
+ export type EvolutionExecutionMode = 'production' | 'replay' | 'shadow' | 'canary';
5
+ export type EvolutionChannel = 'production' | 'shadow' | 'canary';
6
+ export type EvolutionRiskLevel = 'R1' | 'R2' | 'R3' | 'R4';
7
+ export interface EvolutionScopeDimensions {
8
+ productFamily?: string;
9
+ customerId?: string;
10
+ workspaceId?: string;
11
+ projectId?: string;
12
+ }
13
+ export interface EvolutionScope {
14
+ type: EvolutionScopeType;
15
+ key: string;
16
+ dimensions?: EvolutionScopeDimensions;
17
+ }
18
+ export interface EvolutionActor {
19
+ actorId: string;
20
+ actorType: 'human' | 'agent' | 'system';
21
+ actorRole?: string;
22
+ }
23
+ export interface EvolutionProviderContext {
24
+ tenantId: string;
25
+ organizationId?: string | null;
26
+ targetId: string;
27
+ scope: EvolutionScope;
28
+ correlationId: string;
29
+ executionId?: string;
30
+ actor: EvolutionActor;
31
+ }
32
+ export interface EvolutionTargetCapabilities {
33
+ candidateBuild: boolean;
34
+ replay: boolean;
35
+ shadow: boolean;
36
+ canary: boolean;
37
+ install: boolean;
38
+ rollback: boolean;
39
+ }
40
+ export type EvolutionCandidateChangeFieldType = 'string' | 'number' | 'boolean' | 'string_array' | 'select';
41
+ export interface EvolutionCandidateChangeFieldDescriptor {
42
+ key: string;
43
+ label: I18nText;
44
+ description?: I18nText;
45
+ type: EvolutionCandidateChangeFieldType;
46
+ required?: boolean;
47
+ placeholder?: I18nText;
48
+ defaultValue?: string | number | boolean | string[];
49
+ options?: Array<{
50
+ label: I18nText;
51
+ value: string;
52
+ }>;
53
+ }
54
+ /**
55
+ * Optional, provider-owned description used by the platform to render a
56
+ * domain-neutral Candidate Change Set editor. The platform never interprets
57
+ * the field keys or embeds domain rules of its own.
58
+ */
59
+ export interface EvolutionCandidateFormDescriptor {
60
+ description?: I18nText;
61
+ fields: EvolutionCandidateChangeFieldDescriptor[];
62
+ }
63
+ export interface EvolutionTargetDescriptor {
64
+ targetId: string;
65
+ targetType: EvolutionTargetType;
66
+ displayName: string;
67
+ providerKey: string;
68
+ providerVersion: string;
69
+ artifactSchemaVersion: string;
70
+ supportedScopes: EvolutionScopeType[];
71
+ riskLevel: EvolutionRiskLevel;
72
+ metricSetId: string;
73
+ relatedTargetIds?: string[];
74
+ candidateForm?: EvolutionCandidateFormDescriptor;
75
+ capabilities: EvolutionTargetCapabilities;
76
+ status: 'active' | 'disabled' | 'provider_unavailable';
77
+ }
78
+ export interface EvolutionArtifactRef {
79
+ uri: string;
80
+ hash: string;
81
+ schemaVersion: string;
82
+ mediaType: 'application/json';
83
+ }
package/src/ai/index.d.ts CHANGED
@@ -26,9 +26,11 @@ export * from './feature.model';
26
26
  export * from './membership.model';
27
27
  export * from './model-access.model';
28
28
  export * from './model-gateway.model';
29
+ export * from './model-usage.model';
29
30
  export * from './rag';
30
31
  export * from './rag-web';
31
32
  export * from './knowledgebase.model';
33
+ export * from './knowledge-filter.model';
32
34
  export * from './knowledge-doc.model';
33
35
  export * from './knowledge-doc-page.model';
34
36
  export * from './role-permissions';
@@ -65,3 +67,4 @@ export * from './context-compression.model';
65
67
  export * from './sandbox';
66
68
  export * from './message-content.utils';
67
69
  export * from './mobile.model';
70
+ export * from './evolution';