@xpert-ai/contracts 3.35.0 → 3.37.0

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 (105) hide show
  1. package/context-event.cjs.default.js +1 -0
  2. package/context-event.cjs.js +26 -0
  3. package/context-event.cjs.mjs +2 -0
  4. package/context-event.d.ts +1 -0
  5. package/context-event.esm.js +24 -0
  6. package/index.cjs.default.js +1 -0
  7. package/index.cjs.js +1165 -805
  8. package/index.cjs.mjs +2 -0
  9. package/index.esm.js +1140 -801
  10. package/package.json +18 -2
  11. package/src/agent-plugin.d.ts +4 -29
  12. package/src/ai/agent-output-delivery.model.d.ts +22 -1
  13. package/src/ai/agent-runtime.model.d.ts +4 -4
  14. package/src/ai/assistant-capability.model.d.ts +0 -1
  15. package/src/ai/assistant-template-manifest.model.d.ts +272 -308
  16. package/src/ai/assistant-template-overview.model.d.ts +0 -4
  17. package/src/ai/assistant-template.model.d.ts +0 -4
  18. package/src/ai/bosi.model.d.ts +1 -1
  19. package/src/ai/chat-activity.model.d.ts +13 -0
  20. package/src/ai/chat-message.model.d.ts +0 -11
  21. package/src/ai/chat.model.d.ts +3 -0
  22. package/src/ai/cli-execution.model.d.ts +88 -0
  23. package/src/ai/conversation-trail.model.d.ts +274 -274
  24. package/src/ai/copilot-store.model.d.ts +0 -13
  25. package/src/ai/evolution/entities.d.ts +164 -0
  26. package/src/ai/evolution/evaluation.d.ts +7 -0
  27. package/src/ai/evolution/execution-review.d.ts +68 -0
  28. package/src/ai/evolution/index.d.ts +2 -0
  29. package/src/ai/evolution/provider.d.ts +1 -0
  30. package/src/ai/evolution/target.d.ts +5 -0
  31. package/src/ai/execution-activity.model.d.ts +362 -362
  32. package/src/ai/execution-control-evidence.schema.d.ts +26 -26
  33. package/src/ai/execution-observability.model.d.ts +160 -160
  34. package/src/ai/execution-source.model.d.ts +45 -0
  35. package/src/ai/index.d.ts +2 -0
  36. package/src/ai/middleware.model.d.ts +1 -0
  37. package/src/ai/model-execution.model.d.ts +5 -108
  38. package/src/ai/model-replacement.model.d.ts +12 -12
  39. package/src/ai/project-configuration-view.model.d.ts +1 -0
  40. package/src/ai/project-pipeline/analytics.d.ts +288 -288
  41. package/src/ai/project-pipeline/budget.schema.d.ts +4 -4
  42. package/src/ai/project-pipeline/commands.schema.d.ts +519 -476
  43. package/src/ai/project-pipeline/configuration-declaration.schema.d.ts +3815 -0
  44. package/src/ai/project-pipeline/configuration-form.d.ts +1903 -1759
  45. package/src/ai/project-pipeline/configuration.schema.d.ts +425 -388
  46. package/src/ai/project-pipeline/contribution.schema.d.ts +764 -612
  47. package/src/ai/project-pipeline/definition.schema.d.ts +382 -338
  48. package/src/ai/project-pipeline/execution-statistics.d.ts +30 -30
  49. package/src/ai/project-pipeline/graph.model.d.ts +7 -2
  50. package/src/ai/project-pipeline/human-wait-statistics.d.ts +2 -2
  51. package/src/ai/project-pipeline/index.d.ts +1 -0
  52. package/src/ai/project-pipeline/model-usage-statistics.d.ts +6 -6
  53. package/src/ai/project-pipeline/node.schema.d.ts +57 -44
  54. package/src/ai/project-pipeline/operation.schema.d.ts +378 -378
  55. package/src/ai/project-pipeline/plugin-deployment.schema.d.ts +6 -6
  56. package/src/ai/project-pipeline/portfolio.schema.d.ts +684 -684
  57. package/src/ai/project-pipeline/primitives.schema.d.ts +4 -4
  58. package/src/ai/project-pipeline/projection.schema.d.ts +674 -637
  59. package/src/ai/project-pipeline/provider-actions.schema.d.ts +120 -120
  60. package/src/ai/project-pipeline/queue-statistics.d.ts +34 -34
  61. package/src/ai/project-pipeline/runtime.schema.d.ts +89 -89
  62. package/src/ai/project-pipeline/statistics.d.ts +142 -142
  63. package/src/ai/project-task-runtime.model.d.ts +265 -789
  64. package/src/ai/sandbox-execution-control.schema.d.ts +6 -6
  65. package/src/ai/template-installation.model.d.ts +13 -13
  66. package/src/ai/template-lifecycle.model.d.ts +4 -4
  67. package/src/ai/xpert-agent-execution.model.d.ts +33 -0
  68. package/src/ai/xpert-project.model.d.ts +2 -1
  69. package/src/ai/xpert-tool.model.d.ts +12 -0
  70. package/src/ai/xpert.model.d.ts +0 -34
  71. package/src/ai/xpert.utils.d.ts +0 -1
  72. package/src/always-on/agent-event.model.d.ts +121 -0
  73. package/src/always-on/agent-event.schema.d.ts +139 -0
  74. package/src/always-on/agent-output-reference.schema.d.ts +27 -0
  75. package/src/always-on/agent-output.model.d.ts +411 -0
  76. package/src/always-on/human-decision.model.d.ts +204 -0
  77. package/src/always-on/index.d.ts +3 -0
  78. package/src/always-on/output-workbench.schema.d.ts +154 -0
  79. package/src/analytics/analysis-evidence.model.d.ts +29 -0
  80. package/src/analytics/analytics-certification.model.d.ts +17 -0
  81. package/src/{analytics-definition.model.d.ts → analytics/analytics-definition.model.d.ts} +1 -1
  82. package/src/{analytics-diagnostic.d.ts → analytics/analytics-diagnostic.d.ts} +8 -8
  83. package/src/{analytics-query.model.d.ts → analytics/analytics-query.model.d.ts} +9 -1
  84. package/src/analytics/index.d.ts +7 -0
  85. package/src/{resource-analysis.model.d.ts → analytics/resource-analysis.model.d.ts} +6 -1
  86. package/src/app-platform.d.ts +14 -14
  87. package/src/{artifact-group-reference.model.d.ts → artifacts/artifact-group-reference.model.d.ts} +1 -1
  88. package/src/{artifact-presentation.model.d.ts → artifacts/artifact-presentation.model.d.ts} +1 -1
  89. package/src/{artifact-use-grant-command.d.ts → artifacts/artifact-use-grant-command.d.ts} +1 -1
  90. package/src/{artifact-use-grant.model.d.ts → artifacts/artifact-use-grant.model.d.ts} +2 -2
  91. package/src/{artifact.model.d.ts → artifacts/artifact.model.d.ts} +4 -2
  92. package/src/artifacts/index.d.ts +5 -0
  93. package/src/collaboration.model.d.ts +31 -11
  94. package/src/{content-document.model.d.ts → content/content-document.model.d.ts} +2 -0
  95. package/src/{content-resource.model.d.ts → content/content-resource.model.d.ts} +7 -3
  96. package/src/content/content-transfer.model.d.ts +21 -0
  97. package/src/content/index.d.ts +4 -0
  98. package/src/execution-control-admission.schema.d.ts +2 -2
  99. package/src/icon-definition.schema.d.ts +6 -10
  100. package/src/index.d.ts +5 -14
  101. package/src/secret-token.model.d.ts +4 -4
  102. package/src/user-notification.schema.d.ts +1300 -471
  103. package/src/view-extension/client-commands.d.ts +24 -0
  104. /package/src/{analytics-source.model.d.ts → analytics/analytics-source.model.d.ts} +0 -0
  105. /package/src/{content-reference.model.d.ts → content/content-reference.model.d.ts} +0 -0
@@ -0,0 +1,164 @@
1
+ import type { IBasePerTenantAndOrganizationEntityModel } from '../../base-entity.model';
2
+ import type { EvolutionCandidate } from './candidate';
3
+ import type { ActiveCapabilityPointer, CapabilityVersion, CapabilityVersionBundle } from './capability-version';
4
+ import type { DatasetSnapshot, EvaluationRun } from './evaluation';
5
+ import type { ExecutionReviewReceipt } from './execution-review';
6
+ import type { EvolutionExperience } from './experience';
7
+ import type { EvolutionJob, EvolutionJobStatus, EvolutionJobType } from './governance';
8
+ import type { EvolutionDiagnosis, EvolutionEventCluster, ImprovementProposal, LearningEvent } from './learning-event';
9
+ import type { StoredEvaluationRun, StoredEvolutionProposal, StoredReleasePackage } from './persistence';
10
+ import type { ApprovalDecision, EvolutionAuditEvent, EvolutionCanaryTestOverride, EvolutionReleaseStatus, ReleaseDeployment } from './release';
11
+ import type { EvolutionRuntimeObservation } from './runtime';
12
+ import type { EvolutionScopeType, EvolutionTargetDescriptor } from './target';
13
+ export interface IEvolutionScopedEntity extends IBasePerTenantAndOrganizationEntityModel {
14
+ scopeType: EvolutionScopeType;
15
+ scopeKey: string;
16
+ }
17
+ export interface IEvolutionTarget extends IBasePerTenantAndOrganizationEntityModel {
18
+ targetId: string;
19
+ providerKey: string;
20
+ status: EvolutionTargetDescriptor['status'];
21
+ descriptor: EvolutionTargetDescriptor;
22
+ }
23
+ export interface ICapabilityVersion extends IBasePerTenantAndOrganizationEntityModel {
24
+ versionId: string;
25
+ targetId: string;
26
+ sequence: number;
27
+ artifactHash: string;
28
+ sourceCandidateId?: string | null;
29
+ value: CapabilityVersion;
30
+ }
31
+ export interface ICapabilityVersionBundle extends IBasePerTenantAndOrganizationEntityModel {
32
+ bundleId: string;
33
+ bundleHash: string;
34
+ value: CapabilityVersionBundle;
35
+ }
36
+ export interface IActiveCapabilityPointer extends IEvolutionScopedEntity {
37
+ pointerId: string;
38
+ targetId: string;
39
+ channel: ActiveCapabilityPointer['channel'];
40
+ activeVersionId: string;
41
+ revision: number;
42
+ value: ActiveCapabilityPointer;
43
+ }
44
+ export interface ILearningEvent extends IEvolutionScopedEntity {
45
+ eventId: string;
46
+ idempotencyKey: string;
47
+ targetId: string;
48
+ bundleHash: string;
49
+ value: LearningEvent;
50
+ }
51
+ export interface IEvolutionDiagnosis extends IEvolutionScopedEntity {
52
+ diagnosisId: string;
53
+ targetId: string;
54
+ correctionSignature: string;
55
+ value: EvolutionDiagnosis;
56
+ }
57
+ export interface IEvolutionEventCluster extends IEvolutionScopedEntity {
58
+ clusterId: string;
59
+ targetId: string;
60
+ correctionSignature: string;
61
+ status: EvolutionEventCluster['status'];
62
+ value: EvolutionEventCluster;
63
+ }
64
+ export interface IEvolutionExperience extends IEvolutionScopedEntity {
65
+ experienceId: string;
66
+ targetId: string;
67
+ sourceReleasePackageId: string;
68
+ status: EvolutionExperience['status'];
69
+ value: EvolutionExperience;
70
+ }
71
+ export interface IImprovementProposal extends IEvolutionScopedEntity {
72
+ requestId?: string | null;
73
+ proposalId: string;
74
+ revision: number;
75
+ targetId: string;
76
+ status: ImprovementProposal['status'];
77
+ value: StoredEvolutionProposal;
78
+ }
79
+ export interface IEvolutionCandidate extends IEvolutionScopedEntity {
80
+ candidateId: string;
81
+ targetId: string;
82
+ artifactHash: string;
83
+ status: EvolutionCandidate['status'];
84
+ value: EvolutionCandidate;
85
+ }
86
+ export interface IDatasetSnapshot extends IBasePerTenantAndOrganizationEntityModel {
87
+ snapshotId: string;
88
+ datasetId: string;
89
+ snapshotHash: string;
90
+ value: DatasetSnapshot;
91
+ }
92
+ export interface IEvaluationRun extends IBasePerTenantAndOrganizationEntityModel {
93
+ runId: string;
94
+ candidateId: string;
95
+ status: EvaluationRun['status'];
96
+ gatePassed: boolean;
97
+ value: StoredEvaluationRun;
98
+ }
99
+ export interface IApprovalDecision extends IEvolutionScopedEntity {
100
+ approvalId: string;
101
+ candidateId: string;
102
+ candidateHash: string;
103
+ decision: ApprovalDecision['decision'];
104
+ value: ApprovalDecision;
105
+ }
106
+ export interface IReleasePackage extends IEvolutionScopedEntity {
107
+ releasePackageId: string;
108
+ candidateId: string;
109
+ targetId: string;
110
+ status: StoredReleasePackage['status'];
111
+ value: StoredReleasePackage;
112
+ }
113
+ export interface IReleaseDeployment extends IEvolutionScopedEntity {
114
+ deploymentId: string;
115
+ releasePackageId: string;
116
+ channel: ReleaseDeployment['channel'];
117
+ status: EvolutionReleaseStatus;
118
+ value: ReleaseDeployment;
119
+ }
120
+ export interface IEvolutionCanaryTestOverride extends IEvolutionScopedEntity {
121
+ overrideId: string;
122
+ releasePackageId: string;
123
+ candidateId: string;
124
+ deploymentId: string;
125
+ targetId: string;
126
+ subjectKey: string;
127
+ activeKey?: string | null;
128
+ status: EvolutionCanaryTestOverride['status'];
129
+ expiresAt: Date;
130
+ value: EvolutionCanaryTestOverride;
131
+ }
132
+ export interface IEvolutionAuditEvent extends IBasePerTenantAndOrganizationEntityModel {
133
+ auditId: string;
134
+ releasePackageId?: string | null;
135
+ candidateId?: string | null;
136
+ action: string;
137
+ value: EvolutionAuditEvent;
138
+ }
139
+ export interface IEvolutionRuntimeObservation extends IEvolutionScopedEntity {
140
+ observationId: string;
141
+ targetId: string;
142
+ deploymentId?: string | null;
143
+ executionId: string;
144
+ severeError: boolean;
145
+ value: EvolutionRuntimeObservation;
146
+ }
147
+ export interface IEvolutionJob extends IBasePerTenantAndOrganizationEntityModel {
148
+ jobId: string;
149
+ jobType: EvolutionJobType;
150
+ resourceId: string;
151
+ status: EvolutionJobStatus;
152
+ value: EvolutionJob;
153
+ }
154
+ export interface IExecutionReview extends IBasePerTenantAndOrganizationEntityModel {
155
+ id: string;
156
+ tenantId: string;
157
+ organizationId: string;
158
+ targetId: string;
159
+ executionId: string;
160
+ projectId: string;
161
+ conversationId: string;
162
+ bundleHash: string;
163
+ receipt: ExecutionReviewReceipt;
164
+ }
@@ -113,6 +113,13 @@ export interface EvaluationRun {
113
113
  candidateBundle: CapabilityVersionBundle;
114
114
  status: 'running' | 'passed' | 'failed';
115
115
  metrics: EvaluationMetrics;
116
+ /** Paired accuracy is null for an empty slice. Older runs have no slice summary. */
117
+ sliceMetrics?: Array<{
118
+ slice: string;
119
+ totalCases: number;
120
+ baselineAccuracy: number | null;
121
+ candidateAccuracy: number | null;
122
+ }>;
116
123
  gate: EvaluationGateResult;
117
124
  caseResults: ReplayCaseResult[];
118
125
  startedAt: string;
@@ -0,0 +1,68 @@
1
+ import type { EvolutionFeedbackExecution } from './provider';
2
+ import type { LearningEventInput } from './learning-event';
3
+ import type { EvolutionRuntimeObservationInput } from './runtime';
4
+ export type ExecutionReviewDisposition = 'confirmed' | 'corrected' | 'insufficient';
5
+ export type ExecutionReviewUse = 'case_only' | 'similar_cases';
6
+ export interface ExecutionReviewDecision {
7
+ disposition: ExecutionReviewDisposition;
8
+ expectedLabel?: string;
9
+ reason?: string;
10
+ use: ExecutionReviewUse;
11
+ }
12
+ export interface ExecutionReviewSubmission extends ExecutionReviewDecision {
13
+ executionId: string;
14
+ bundleHash: string;
15
+ }
16
+ export interface ExecutionReviewReceipt extends ExecutionReviewDecision {
17
+ receiptId: string;
18
+ executionId: string;
19
+ originalLabel: string;
20
+ versionId: string;
21
+ reviewerId: string;
22
+ reviewedAt: string;
23
+ learningEventId?: string;
24
+ }
25
+ export interface ExecutionReviewSnapshot {
26
+ originalLabel: string;
27
+ versionId: string;
28
+ bundleHash: string;
29
+ sourceMessageId?: string;
30
+ }
31
+ export interface ExecutionReviewItem extends ExecutionReviewSnapshot {
32
+ executionId: string;
33
+ conversationId: string;
34
+ threadId: string;
35
+ sourceText: string | null;
36
+ createdAt: string;
37
+ receipt?: ExecutionReviewReceipt;
38
+ }
39
+ export type ExecutionReviewQueue = 'pending' | 'reviewed' | 'insufficient';
40
+ export interface ExecutionReviewQuery {
41
+ queue: ExecutionReviewQueue;
42
+ page: number;
43
+ pageSize: number;
44
+ }
45
+ export interface ExecutionReviewApi {
46
+ list(target: string, query: ExecutionReviewQuery): Promise<{
47
+ items: ExecutionReviewItem[];
48
+ total: number;
49
+ }>;
50
+ get(target: string, executionId: string): Promise<ExecutionReviewItem>;
51
+ submit(target: string, input: ExecutionReviewSubmission): Promise<ExecutionReviewReceipt>;
52
+ }
53
+ /** Domain interpretation of an execution and the human feedback on that decision. */
54
+ export interface ExecutionReviewAdapter {
55
+ readonly feature: string;
56
+ snapshot(execution: EvolutionFeedbackExecution): ExecutionReviewSnapshot;
57
+ sourceMatches(execution: EvolutionFeedbackExecution, text: string): boolean;
58
+ prepare(execution: EvolutionFeedbackExecution, decision: ExecutionReviewDecision, context: {
59
+ organizationId: string;
60
+ conversationId: string;
61
+ reviewedAt: string;
62
+ }): {
63
+ event?: LearningEventInput;
64
+ observations: EvolutionRuntimeObservationInput[];
65
+ };
66
+ matchesLegacy(input: unknown, receipt: ExecutionReviewReceipt): boolean;
67
+ legacyKey(executionId: string): string;
68
+ }
@@ -6,6 +6,7 @@ export * from './candidate';
6
6
  export * from './evaluation';
7
7
  export * from './release';
8
8
  export * from './provider';
9
+ export * from './execution-review';
9
10
  export * from './example';
10
11
  export * from './runtime';
11
12
  export * from './governance';
@@ -14,3 +15,4 @@ export * from './change';
14
15
  export * from './persistence';
15
16
  export * from './strategy';
16
17
  export * from './baseline';
18
+ export * from './entities';
@@ -38,6 +38,7 @@ export interface EvolutionFeedbackProvider {
38
38
  readonly routeKey: string;
39
39
  /** Discriminator of execution records this adapter can interpret. */
40
40
  readonly executionType: string;
41
+ readonly workbench?: import('./execution-review').ExecutionReviewAdapter;
41
42
  /** Validates untrusted review input against the scoped execution and returns the recorded learning event. */
42
43
  review(identity: {
43
44
  tenantId: string;
@@ -88,6 +88,11 @@ export interface EvolutionTargetDescriptor {
88
88
  supportedScopes: EvolutionScopeType[];
89
89
  riskLevel: EvolutionRiskLevel;
90
90
  metricSetId: string;
91
+ /** Show paired accuracy for cases whose evaluator observations explicitly identify one of these slices. */
92
+ replaySlices?: Array<{
93
+ key: string;
94
+ label: I18nText;
95
+ }>;
91
96
  relatedTargetIds?: string[];
92
97
  /** Provider vocabulary for feedback emitted by this target, including previously recorded events. */
93
98
  feedbackVocabulary?: {