@xpert-ai/contracts 3.18.2 → 3.18.4
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/index.cjs.js +440 -70
- package/index.esm.js +403 -71
- package/package.json +2 -2
- package/src/ai/context-compression.model.d.ts +2 -1
- package/src/ai/evolution/candidate.d.ts +3 -0
- package/src/ai/evolution/change.d.ts +221 -0
- package/src/ai/evolution/evaluation.d.ts +1 -0
- package/src/ai/evolution/governance.d.ts +3 -1
- package/src/ai/evolution/index.d.ts +3 -0
- package/src/ai/evolution/learning-event.d.ts +2 -0
- package/src/ai/evolution/persistence.d.ts +82 -0
- package/src/ai/evolution/provider.d.ts +4 -0
- package/src/ai/evolution/release.d.ts +2 -0
- package/src/ai/evolution/strategy.d.ts +62 -0
- package/src/ai/evolution/target.d.ts +8 -5
- package/src/ai/index.d.ts +6 -0
- package/src/ai/knowledge-deletion.model.d.ts +25 -0
- package/src/ai/knowledge-doc.model.d.ts +29 -0
- package/src/ai/knowledge-filter.model.d.ts +3 -1
- package/src/ai/knowledge-graph.model.d.ts +22 -0
- package/src/ai/knowledge-identity.model.d.ts +42 -0
- package/src/ai/knowledge-parser.model.d.ts +15 -0
- package/src/ai/knowledge-pipeline.d.ts +3 -0
- package/src/ai/knowledge-wiki-identity.model.d.ts +11 -0
- package/src/ai/knowledge-wiki-organization.model.d.ts +110 -0
- package/src/ai/knowledge-wiki.model.d.ts +202 -0
- package/src/ai/knowledgebase-task.model.d.ts +2 -0
- package/src/ai/knowledgebase.model.d.ts +47 -2
- package/src/ai/mcp-capability.model.d.ts +7 -0
- package/src/ai/middleware.model.d.ts +2 -0
- package/src/ai/xpert-agent-execution.model.d.ts +1 -1
- package/src/ai/xpert-template.model.d.ts +20 -0
- package/src/ai/xpert.model.d.ts +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/contracts",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.4",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@octokit/types": "13.10.0",
|
|
23
23
|
"@types/json-schema": "^7.0.15",
|
|
24
|
-
"@xpert-ai/chatkit-types": "~0.5.
|
|
24
|
+
"@xpert-ai/chatkit-types": "~0.5.8",
|
|
25
25
|
"zod-to-json-schema": "^3.25.2"
|
|
26
26
|
},
|
|
27
27
|
"types": "./index.d.ts"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ContextCompressionReason } from '@xpert-ai/chatkit-types';
|
|
1
2
|
import type { I18nText } from '../i18n.model';
|
|
2
3
|
export declare const CONTEXT_COMPRESSION_COMPONENT_TYPE = "context-compression";
|
|
3
4
|
export type TContextCompressionComponentStatus = 'running' | 'success' | 'fail';
|
|
4
|
-
export type TContextCompressionComponentReason =
|
|
5
|
+
export type TContextCompressionComponentReason = ContextCompressionReason;
|
|
5
6
|
export type TContextCompressionComponentData = {
|
|
6
7
|
category: 'Tool';
|
|
7
8
|
type: typeof CONTEXT_COMPRESSION_COMPONENT_TYPE;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { EvolutionArtifactRef, EvolutionProviderContext, EvolutionScope } from './target';
|
|
2
2
|
export type EvolutionCandidateStatus = 'building' | 'ready' | 'evaluating' | 'evaluation_failed' | 'pending_approval' | 'approved' | 'rejected' | 'packaged' | 'expired';
|
|
3
3
|
export interface EvolutionCandidate {
|
|
4
|
+
definition?: Omit<import('./change').EvolutionChangeCandidate, 'artifact'>;
|
|
5
|
+
evaluationRunId?: string;
|
|
6
|
+
strategy: import('./strategy').EvolutionStrategySnapshot;
|
|
4
7
|
candidateId: string;
|
|
5
8
|
targetId: string;
|
|
6
9
|
baseVersionId: string;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import type { I18nText } from '../../i18n.model';
|
|
2
|
+
import type { ApprovalDecision } from './release';
|
|
3
|
+
import type { EvolutionArtifactRef, EvolutionProviderContext, EvolutionScope } from './target';
|
|
4
|
+
import type { EvolutionInputKind, EvolutionStrategySnapshot, EvolutionStageRecord } from './strategy';
|
|
5
|
+
export interface EvolutionVersionRef {
|
|
6
|
+
resourceId: string;
|
|
7
|
+
version: string;
|
|
8
|
+
hash: string;
|
|
9
|
+
}
|
|
10
|
+
export interface EvolutionEvidenceRef {
|
|
11
|
+
kind: 'document' | 'execution' | 'feedback' | 'evaluation' | 'artifact';
|
|
12
|
+
subjectKey: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
version: string;
|
|
15
|
+
hash: string;
|
|
16
|
+
locator?: {
|
|
17
|
+
sourceId?: string;
|
|
18
|
+
fragmentId?: string;
|
|
19
|
+
quoteHash?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface EvolutionChangeDelta {
|
|
23
|
+
path: string;
|
|
24
|
+
operation: string;
|
|
25
|
+
summary: string;
|
|
26
|
+
before?: string;
|
|
27
|
+
after: string;
|
|
28
|
+
}
|
|
29
|
+
export interface EvolutionChangeCandidate {
|
|
30
|
+
artifact: EvolutionArtifactRef;
|
|
31
|
+
baseline: EvolutionVersionRef;
|
|
32
|
+
changes: EvolutionChangeDelta[];
|
|
33
|
+
warnings: string[];
|
|
34
|
+
summary: string;
|
|
35
|
+
}
|
|
36
|
+
export interface EvolutionCheck {
|
|
37
|
+
checkId: string;
|
|
38
|
+
title: string;
|
|
39
|
+
kind: string;
|
|
40
|
+
origin: string;
|
|
41
|
+
passed: boolean;
|
|
42
|
+
blocking: boolean;
|
|
43
|
+
details: string;
|
|
44
|
+
evidenceRefs: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface EvolutionReadiness {
|
|
47
|
+
key: string;
|
|
48
|
+
label: I18nText;
|
|
49
|
+
status: 'passed' | 'blocked' | 'unknown';
|
|
50
|
+
reasons: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface EvolutionChangeEvaluation {
|
|
53
|
+
runId: string;
|
|
54
|
+
candidateHash: string;
|
|
55
|
+
baselineHash: string;
|
|
56
|
+
evidenceHash: string;
|
|
57
|
+
datasetVersion: string;
|
|
58
|
+
datasetHash: string;
|
|
59
|
+
checks: EvolutionCheck[];
|
|
60
|
+
readiness: EvolutionReadiness[];
|
|
61
|
+
passed: boolean;
|
|
62
|
+
completedAt: string;
|
|
63
|
+
strategyHash?: string;
|
|
64
|
+
assessment?: 'tested' | 'not_applicable';
|
|
65
|
+
evaluationRuns?: Array<{
|
|
66
|
+
key: string;
|
|
67
|
+
kind: string;
|
|
68
|
+
runId: string;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
export interface EvolutionPublicationReceipt {
|
|
72
|
+
receiptId: string;
|
|
73
|
+
changeId: string;
|
|
74
|
+
candidateHash: string;
|
|
75
|
+
approvalId: string;
|
|
76
|
+
resource: EvolutionVersionRef;
|
|
77
|
+
completedAt: string;
|
|
78
|
+
}
|
|
79
|
+
export interface EvolutionWorkbenchLink {
|
|
80
|
+
xpertId: string;
|
|
81
|
+
viewKey: string;
|
|
82
|
+
selectionId: string;
|
|
83
|
+
parameters: Record<string, string>;
|
|
84
|
+
}
|
|
85
|
+
export interface EvolutionPresentationMetric {
|
|
86
|
+
key: string;
|
|
87
|
+
label: I18nText;
|
|
88
|
+
value: string | number | null;
|
|
89
|
+
total?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface EvolutionChangePresentation {
|
|
92
|
+
title: string;
|
|
93
|
+
resourceLabel: string;
|
|
94
|
+
contextLabel?: string;
|
|
95
|
+
description?: I18nText;
|
|
96
|
+
metrics?: EvolutionPresentationMetric[];
|
|
97
|
+
effect?: {
|
|
98
|
+
status: 'pending' | 'partial' | 'active' | 'unknown';
|
|
99
|
+
label: I18nText;
|
|
100
|
+
description?: I18nText;
|
|
101
|
+
};
|
|
102
|
+
workbench?: EvolutionWorkbenchLink;
|
|
103
|
+
historyWorkbench?: EvolutionWorkbenchLink;
|
|
104
|
+
}
|
|
105
|
+
export type EvolutionChangeStatus = 'preparing' | 'testing' | 'test_failed' | 'pending_approval' | 'approved' | 'publishing' | 'published' | 'rejected' | 'stale' | 'failed';
|
|
106
|
+
export interface EvolutionChange {
|
|
107
|
+
contractVersion: 3;
|
|
108
|
+
strategy: EvolutionStrategySnapshot;
|
|
109
|
+
sourceKind: EvolutionInputKind;
|
|
110
|
+
learningEventIds: string[];
|
|
111
|
+
candidateInput: Record<string, string | number | boolean | string[]>;
|
|
112
|
+
datasetSnapshotIds: Record<string, string>;
|
|
113
|
+
stages: EvolutionStageRecord[];
|
|
114
|
+
changeId: string;
|
|
115
|
+
targetId: string;
|
|
116
|
+
requestId: string;
|
|
117
|
+
scope: EvolutionScope;
|
|
118
|
+
baseline: EvolutionVersionRef;
|
|
119
|
+
evidence: EvolutionEvidenceRef[];
|
|
120
|
+
evidenceHash: string;
|
|
121
|
+
status: EvolutionChangeStatus;
|
|
122
|
+
candidate?: EvolutionChangeCandidate;
|
|
123
|
+
evaluation?: EvolutionChangeEvaluation;
|
|
124
|
+
approval?: ApprovalDecision;
|
|
125
|
+
receipt?: EvolutionPublicationReceipt;
|
|
126
|
+
jobId: string;
|
|
127
|
+
createdBy: string;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
failureReasons?: string[];
|
|
131
|
+
presentation?: EvolutionChangePresentation;
|
|
132
|
+
presentationUnavailable?: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface EvolutionChangeOperation {
|
|
135
|
+
context: EvolutionProviderContext;
|
|
136
|
+
change: EvolutionChange;
|
|
137
|
+
evaluationStep?: import('./strategy').EvolutionEvaluationStep;
|
|
138
|
+
}
|
|
139
|
+
export interface EvolutionChangeProvider {
|
|
140
|
+
describe?(operation: EvolutionChangeOperation): Promise<EvolutionChangePresentation>;
|
|
141
|
+
prepare(operation: EvolutionChangeOperation): Promise<EvolutionChangeCandidate>;
|
|
142
|
+
evaluate(operation: EvolutionChangeOperation): Promise<EvolutionChangeEvaluation>;
|
|
143
|
+
validateCurrent(operation: EvolutionChangeOperation): Promise<{
|
|
144
|
+
valid: boolean;
|
|
145
|
+
reasons: string[];
|
|
146
|
+
}>;
|
|
147
|
+
authorizePublication(operation: EvolutionChangeOperation): Promise<void>;
|
|
148
|
+
publish(operation: EvolutionChangeOperation): Promise<EvolutionPublicationReceipt>;
|
|
149
|
+
}
|
|
150
|
+
export interface EvolutionChangeIdentity {
|
|
151
|
+
tenantId: string;
|
|
152
|
+
organizationId: string;
|
|
153
|
+
}
|
|
154
|
+
export interface SubmitEvolutionChange extends EvolutionChangeIdentity {
|
|
155
|
+
strategyId: string;
|
|
156
|
+
sourceKind: EvolutionInputKind;
|
|
157
|
+
learningEventIds?: string[];
|
|
158
|
+
candidateInput?: Record<string, string | number | boolean | string[]>;
|
|
159
|
+
datasetSnapshotIds?: Record<string, string>;
|
|
160
|
+
targetId: string;
|
|
161
|
+
requestId: string;
|
|
162
|
+
scope: EvolutionScope;
|
|
163
|
+
baseline: EvolutionVersionRef;
|
|
164
|
+
evidence: EvolutionEvidenceRef[];
|
|
165
|
+
}
|
|
166
|
+
export interface EvolutionChangeRuntimeApi {
|
|
167
|
+
prepare(input: SubmitEvolutionChange): Promise<EvolutionChange>;
|
|
168
|
+
get(input: EvolutionChangeIdentity & {
|
|
169
|
+
changeId: string;
|
|
170
|
+
}): Promise<EvolutionChange>;
|
|
171
|
+
list(input: EvolutionChangeIdentity & {
|
|
172
|
+
targetId?: string;
|
|
173
|
+
requestId?: string;
|
|
174
|
+
}): Promise<EvolutionChange[]>;
|
|
175
|
+
decide(input: EvolutionChangeIdentity & {
|
|
176
|
+
changeId: string;
|
|
177
|
+
candidateHash: string;
|
|
178
|
+
evaluationRunId: string;
|
|
179
|
+
decision: 'approved' | 'rejected';
|
|
180
|
+
reason: string;
|
|
181
|
+
}): Promise<EvolutionChange>;
|
|
182
|
+
publish(input: EvolutionChangeIdentity & {
|
|
183
|
+
changeId: string;
|
|
184
|
+
}): Promise<EvolutionChange>;
|
|
185
|
+
}
|
|
186
|
+
/** Assembled from canonical lifecycle entities; adapters retain their evaluation and release gates. */
|
|
187
|
+
export interface EvolutionLifecycleRecord {
|
|
188
|
+
id: string;
|
|
189
|
+
targetId: string;
|
|
190
|
+
title: string;
|
|
191
|
+
scope: EvolutionScope;
|
|
192
|
+
phase: 'preparation' | 'evaluation' | 'review' | 'publication' | 'effective' | 'blocked' | 'closed';
|
|
193
|
+
status: string;
|
|
194
|
+
createdAt: string;
|
|
195
|
+
updatedAt: string;
|
|
196
|
+
strategy: EvolutionStrategySnapshot;
|
|
197
|
+
stages: EvolutionStageRecord[];
|
|
198
|
+
sourceKind: EvolutionInputKind;
|
|
199
|
+
releasePackageId?: string;
|
|
200
|
+
publicationStatus: 'preparing' | 'review' | 'publishing' | 'published' | 'closed' | 'blocked';
|
|
201
|
+
effectStatus: 'pending' | 'partial' | 'active' | 'unknown';
|
|
202
|
+
baseline: EvolutionVersionRef;
|
|
203
|
+
candidate?: EvolutionChangeCandidate;
|
|
204
|
+
evaluation?: EvolutionChangeEvaluation;
|
|
205
|
+
approvals: ApprovalDecision[];
|
|
206
|
+
publication?: {
|
|
207
|
+
status: string;
|
|
208
|
+
version?: EvolutionVersionRef;
|
|
209
|
+
receipt?: EvolutionPublicationReceipt;
|
|
210
|
+
publishedAt?: string;
|
|
211
|
+
};
|
|
212
|
+
presentation?: EvolutionChangePresentation;
|
|
213
|
+
presentationUnavailable?: boolean;
|
|
214
|
+
job?: import('./governance').EvolutionJob;
|
|
215
|
+
capabilities: {
|
|
216
|
+
stagedRollout: boolean;
|
|
217
|
+
evaluate: boolean;
|
|
218
|
+
decide: boolean;
|
|
219
|
+
publish: boolean;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
@@ -17,6 +17,7 @@ export interface ReviewLearningEventRequest {
|
|
|
17
17
|
reviewStatus: 'pending' | 'ignored' | 'golden';
|
|
18
18
|
}
|
|
19
19
|
export interface DiagnoseLearningEventsRequest {
|
|
20
|
+
strategyId: string;
|
|
20
21
|
eventIds: string[];
|
|
21
22
|
}
|
|
22
23
|
export interface EvolutionAnalysisResult {
|
|
@@ -24,6 +25,7 @@ export interface EvolutionAnalysisResult {
|
|
|
24
25
|
clusters: import('./learning-event').EvolutionEventCluster[];
|
|
25
26
|
}
|
|
26
27
|
export interface CreateImprovementProposalRequest {
|
|
28
|
+
strategyId: string;
|
|
27
29
|
targetId: string;
|
|
28
30
|
scope: import('./target').EvolutionScope;
|
|
29
31
|
eventIds: string[];
|
|
@@ -71,7 +73,7 @@ export interface CreateEvolutionCanaryTestOverrideRequest {
|
|
|
71
73
|
/** Defaults to 30 minutes and is capped by the server. */
|
|
72
74
|
expiresInMinutes?: number;
|
|
73
75
|
}
|
|
74
|
-
export type EvolutionJobType = 'evaluation' | 'install' | 'shadow' | 'canary' | 'rollback';
|
|
76
|
+
export type EvolutionJobType = 'change_preparation' | 'evaluation' | 'install' | 'shadow' | 'canary' | 'rollback';
|
|
75
77
|
export type EvolutionJobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
76
78
|
export interface EvolutionJob {
|
|
77
79
|
jobId: string;
|
|
@@ -52,6 +52,8 @@ export interface EvolutionEventCluster {
|
|
|
52
52
|
updatedAt: string;
|
|
53
53
|
}
|
|
54
54
|
export interface ImprovementProposal {
|
|
55
|
+
sourceKind: import('./strategy').EvolutionInputKind;
|
|
56
|
+
strategy: import('./strategy').EvolutionStrategySnapshot;
|
|
55
57
|
proposalId: string;
|
|
56
58
|
revision: number;
|
|
57
59
|
targetId: string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { EvolutionCandidate } from './candidate';
|
|
2
|
+
import type { EvaluationRun } from './evaluation';
|
|
3
|
+
import type { ImprovementProposal } from './learning-event';
|
|
4
|
+
import type { ReleasePackage } from './release';
|
|
5
|
+
import type { EvolutionScope } from './target';
|
|
6
|
+
import type { EvolutionChangeCandidate, EvolutionChangeEvaluation, EvolutionEvidenceRef, EvolutionPublicationReceipt, EvolutionVersionRef } from './change';
|
|
7
|
+
/** Evidence requests share Proposal persistence without fabricating trusted learning events. */
|
|
8
|
+
export interface EvidenceEvolutionProposal extends Pick<ImprovementProposal, 'problemStatement' | 'rootCause' | 'changeHypothesis' | 'riskLevel' | 'evidenceEventIds' | 'baseVersionId'> {
|
|
9
|
+
sourceKind: import('./strategy').EvolutionInputKind;
|
|
10
|
+
strategy: import('./strategy').EvolutionStrategySnapshot;
|
|
11
|
+
stages: import('./strategy').EvolutionStageRecord[];
|
|
12
|
+
learningEventIds: string[];
|
|
13
|
+
candidateInput: Record<string, string | number | boolean | string[]>;
|
|
14
|
+
datasetSnapshotIds: Record<string, string>;
|
|
15
|
+
proposalId: string;
|
|
16
|
+
revision: number;
|
|
17
|
+
targetId: string;
|
|
18
|
+
scope: EvolutionScope;
|
|
19
|
+
requestId: string;
|
|
20
|
+
candidateId: string;
|
|
21
|
+
title: string;
|
|
22
|
+
baseline: EvolutionVersionRef;
|
|
23
|
+
evidence: EvolutionEvidenceRef[];
|
|
24
|
+
evidenceHash: string;
|
|
25
|
+
status: 'draft' | 'ready' | 'candidate_built' | 'rejected';
|
|
26
|
+
preparation: 'queued' | 'completed' | 'failed';
|
|
27
|
+
failureReasons: string[];
|
|
28
|
+
jobId: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
createdBy: string;
|
|
32
|
+
}
|
|
33
|
+
export type StoredEvolutionProposal = ImprovementProposal | EvidenceEvolutionProposal;
|
|
34
|
+
export interface PreparedEvolutionCandidate extends EvolutionCandidate {
|
|
35
|
+
definition: Omit<EvolutionChangeCandidate, 'artifact'>;
|
|
36
|
+
evaluationRunId?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Replay bundles remain required by Replay EvaluationRun, not by every evaluator. */
|
|
39
|
+
export interface ProviderEvaluationRun {
|
|
40
|
+
evaluatorKind: 'strategy_checks';
|
|
41
|
+
runId: string;
|
|
42
|
+
candidateId: string;
|
|
43
|
+
targetId: string;
|
|
44
|
+
scope: EvolutionScope;
|
|
45
|
+
status: 'passed' | 'failed';
|
|
46
|
+
result: EvolutionChangeEvaluation;
|
|
47
|
+
startedAt: string;
|
|
48
|
+
completedAt: string;
|
|
49
|
+
}
|
|
50
|
+
export type StoredEvaluationRun = EvaluationRun | ProviderEvaluationRun;
|
|
51
|
+
interface ProviderReleaseBase {
|
|
52
|
+
publicationKind: 'provider_version';
|
|
53
|
+
releasePackageId: string;
|
|
54
|
+
candidateId: string;
|
|
55
|
+
candidateHash: string;
|
|
56
|
+
targetId: string;
|
|
57
|
+
evaluationRunId: string;
|
|
58
|
+
scope: EvolutionScope;
|
|
59
|
+
approvalIds: string[];
|
|
60
|
+
artifactHash: string;
|
|
61
|
+
providerKey: string;
|
|
62
|
+
providerVersion: string;
|
|
63
|
+
createdAt: string;
|
|
64
|
+
updatedAt: string;
|
|
65
|
+
createdBy: string;
|
|
66
|
+
}
|
|
67
|
+
export type ProviderReleasePackage = ProviderReleaseBase & ({
|
|
68
|
+
status: 'approved' | 'publishing';
|
|
69
|
+
receipt?: never;
|
|
70
|
+
} | {
|
|
71
|
+
status: 'published';
|
|
72
|
+
receipt: EvolutionPublicationReceipt;
|
|
73
|
+
});
|
|
74
|
+
export type StoredReleasePackage = ReleasePackage | ProviderReleasePackage;
|
|
75
|
+
export declare function isEvidenceProposal(value: StoredEvolutionProposal): value is EvidenceEvolutionProposal;
|
|
76
|
+
export declare function isLearningProposal(value: StoredEvolutionProposal): value is ImprovementProposal;
|
|
77
|
+
export declare function isPreparedCandidate(value: EvolutionCandidate): value is PreparedEvolutionCandidate;
|
|
78
|
+
export declare function isProviderEvaluation(value: StoredEvaluationRun): value is ProviderEvaluationRun;
|
|
79
|
+
export declare function isReplayEvaluation(value: StoredEvaluationRun): value is EvaluationRun;
|
|
80
|
+
export declare function isProviderRelease(value: StoredReleasePackage): value is ProviderReleasePackage;
|
|
81
|
+
export declare function isStagedRelease(value: StoredReleasePackage): value is ReleasePackage;
|
|
82
|
+
export {};
|
|
@@ -20,6 +20,10 @@ export interface EvolutionReleaseProvider {
|
|
|
20
20
|
}
|
|
21
21
|
export interface EvolutionTargetProvider {
|
|
22
22
|
readonly descriptor: EvolutionTargetDescriptor;
|
|
23
|
+
readonly draftBuilder?: Pick<import('./change').EvolutionChangeProvider, 'prepare'>;
|
|
24
|
+
readonly checkEvaluator?: Pick<import('./change').EvolutionChangeProvider, 'evaluate'>;
|
|
25
|
+
readonly versionPublisher?: Pick<import('./change').EvolutionChangeProvider, 'validateCurrent' | 'authorizePublication' | 'publish'>;
|
|
26
|
+
readonly presenter?: Pick<import('./change').EvolutionChangeProvider, 'describe'>;
|
|
23
27
|
readonly baselineExporter?: EvolutionBaselineExporter;
|
|
24
28
|
readonly candidateBuilder?: EvolutionCandidateBuilder;
|
|
25
29
|
readonly replayEvaluator?: EvolutionReplayEvaluator;
|
|
@@ -22,6 +22,7 @@ export interface ApprovalDecision {
|
|
|
22
22
|
candidateId: string;
|
|
23
23
|
candidateHash: string;
|
|
24
24
|
evaluationRunId: string;
|
|
25
|
+
strategyHash?: string;
|
|
25
26
|
scope: EvolutionScope;
|
|
26
27
|
decision: 'approved' | 'rejected';
|
|
27
28
|
actorId: string;
|
|
@@ -37,6 +38,7 @@ export interface ApprovalDecision {
|
|
|
37
38
|
decidedAt: string;
|
|
38
39
|
}
|
|
39
40
|
export interface ReleasePackage {
|
|
41
|
+
publicationKind: 'staged_rollout';
|
|
40
42
|
releasePackageId: string;
|
|
41
43
|
candidateId: string;
|
|
42
44
|
candidateHash: string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { I18nText } from '../../i18n.model';
|
|
2
|
+
import type { EvolutionEvidenceRef } from './change';
|
|
3
|
+
import type { EvolutionRiskLevel } from './target';
|
|
4
|
+
export type EvolutionInputKind = 'learning_events' | 'business_evidence' | 'manual';
|
|
5
|
+
export type EvolutionStageKey = 'learning' | 'candidate' | 'evaluation' | 'approval' | 'publication' | 'effect';
|
|
6
|
+
export type EvolutionStageStatus = 'pending' | 'running' | 'passed' | 'failed' | 'not_applicable';
|
|
7
|
+
export interface EvolutionEvaluationStep {
|
|
8
|
+
key: string;
|
|
9
|
+
kind: 'target_checks' | 'golden_replay';
|
|
10
|
+
requiredChecks: Array<{
|
|
11
|
+
kind: string;
|
|
12
|
+
origin?: string;
|
|
13
|
+
blocking?: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
/** Strategies compose stage capabilities; input origin never determines publication. */
|
|
17
|
+
export interface EvolutionStrategy {
|
|
18
|
+
id: string;
|
|
19
|
+
version: string;
|
|
20
|
+
label: I18nText;
|
|
21
|
+
inputs: EvolutionInputKind[];
|
|
22
|
+
learning: {
|
|
23
|
+
mode: 'none';
|
|
24
|
+
} | {
|
|
25
|
+
mode: 'feedback';
|
|
26
|
+
minimumEvents: number;
|
|
27
|
+
minimumSubjects: number;
|
|
28
|
+
maximumAgeDays: number;
|
|
29
|
+
trustLevels: Array<'L2' | 'L3' | 'L4'>;
|
|
30
|
+
};
|
|
31
|
+
evidenceKinds: EvolutionEvidenceRef['kind'][];
|
|
32
|
+
candidate: {
|
|
33
|
+
builder: 'change_set' | 'target_draft';
|
|
34
|
+
};
|
|
35
|
+
evaluations: EvolutionEvaluationStep[];
|
|
36
|
+
approval: 'human';
|
|
37
|
+
publication: {
|
|
38
|
+
mode: 'staged_rollout' | 'version_write';
|
|
39
|
+
effect: 'activation' | 'explicit_adoption';
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface EvolutionStrategySnapshot {
|
|
43
|
+
definition: EvolutionStrategy;
|
|
44
|
+
riskLevel: EvolutionRiskLevel;
|
|
45
|
+
hash: string;
|
|
46
|
+
providerKey: string;
|
|
47
|
+
providerVersion: string;
|
|
48
|
+
}
|
|
49
|
+
export interface EvolutionStageRecord {
|
|
50
|
+
key: EvolutionStageKey;
|
|
51
|
+
status: EvolutionStageStatus;
|
|
52
|
+
reason?: string;
|
|
53
|
+
runIds?: string[];
|
|
54
|
+
}
|
|
55
|
+
export declare const FEEDBACK_LEARNING_STRATEGY: EvolutionStrategy;
|
|
56
|
+
export declare function evidenceDrivenStrategy(input: {
|
|
57
|
+
version: string;
|
|
58
|
+
evidenceKinds: EvolutionEvidenceRef['kind'][];
|
|
59
|
+
requiredChecks: EvolutionEvaluationStep['requiredChecks'];
|
|
60
|
+
effect?: EvolutionStrategy['publication']['effect'];
|
|
61
|
+
}): EvolutionStrategy;
|
|
62
|
+
export declare const HUMAN_PROPOSAL_STRATEGY: EvolutionStrategy;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { I18nText } from '../../i18n.model';
|
|
2
|
-
export type EvolutionTargetType =
|
|
2
|
+
export type EvolutionTargetType = string;
|
|
3
3
|
export type EvolutionScopeType = 'tenant' | 'organization' | 'workspace' | 'project';
|
|
4
4
|
export type EvolutionExecutionMode = 'production' | 'replay' | 'shadow' | 'canary';
|
|
5
5
|
export type EvolutionChannel = 'production' | 'shadow' | 'canary';
|
|
6
6
|
export type EvolutionRiskLevel = 'R1' | 'R2' | 'R3' | 'R4';
|
|
7
|
+
/** Provider-owned scope dimensions; the platform compares the complete frozen map. */
|
|
7
8
|
export interface EvolutionScopeDimensions {
|
|
8
|
-
|
|
9
|
-
customerId?: string;
|
|
10
|
-
workspaceId?: string;
|
|
11
|
-
projectId?: string;
|
|
9
|
+
[key: string]: string | undefined;
|
|
12
10
|
}
|
|
13
11
|
export interface EvolutionScope {
|
|
14
12
|
type: EvolutionScopeType;
|
|
@@ -61,6 +59,11 @@ export interface EvolutionCandidateFormDescriptor {
|
|
|
61
59
|
fields: EvolutionCandidateChangeFieldDescriptor[];
|
|
62
60
|
}
|
|
63
61
|
export interface EvolutionTargetDescriptor {
|
|
62
|
+
strategies: import('./strategy').EvolutionStrategy[];
|
|
63
|
+
category?: {
|
|
64
|
+
key: string;
|
|
65
|
+
label: I18nText;
|
|
66
|
+
};
|
|
64
67
|
targetId: string;
|
|
65
68
|
targetType: EvolutionTargetType;
|
|
66
69
|
displayName: string;
|
package/src/ai/index.d.ts
CHANGED
|
@@ -32,7 +32,10 @@ export * from './model-usage.model';
|
|
|
32
32
|
export * from './rag';
|
|
33
33
|
export * from './rag-web';
|
|
34
34
|
export * from './knowledgebase.model';
|
|
35
|
+
export * from './knowledge-parser.model';
|
|
35
36
|
export * from './knowledge-faq.model';
|
|
37
|
+
export * from './knowledge-wiki.model';
|
|
38
|
+
export * from './knowledge-deletion.model';
|
|
36
39
|
export * from './knowledge-filter.model';
|
|
37
40
|
export * from './knowledge-doc.model';
|
|
38
41
|
export * from './knowledge-doc-page.model';
|
|
@@ -61,6 +64,8 @@ export * from './knowledgebase-task.model';
|
|
|
61
64
|
export * from './knowledge-pipeline';
|
|
62
65
|
export * from './knowledge-retrieval-log.model';
|
|
63
66
|
export * from './knowledge-doc-chunk.model';
|
|
67
|
+
export * from './knowledge-identity.model';
|
|
68
|
+
export * from './knowledge-wiki-identity.model';
|
|
64
69
|
export * from './knowledge-graph.model';
|
|
65
70
|
export * from './skill.model';
|
|
66
71
|
export * from './skill-install-command.model';
|
|
@@ -75,3 +80,4 @@ export * from './mcp-capability.model';
|
|
|
75
80
|
export * from './mcp-publication.model';
|
|
76
81
|
export * from './mcp-auth.model';
|
|
77
82
|
export * from './mcp-audit.model';
|
|
83
|
+
export * from './knowledge-wiki-organization.model';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type KnowledgeDeletionStatus = 'prepared' | 'quiescing' | 'retracting' | 'external_cleanup' | 'finalizing' | 'completed' | 'failed';
|
|
2
|
+
export type KnowledgeDeletionRecoveryAction = {
|
|
3
|
+
canRetry: boolean;
|
|
4
|
+
recommendedAction: 'wait' | 'retry';
|
|
5
|
+
};
|
|
6
|
+
export type KnowledgeDocumentDeletionReceipt = {
|
|
7
|
+
intentId: string;
|
|
8
|
+
documentId: string;
|
|
9
|
+
status: KnowledgeDeletionStatus;
|
|
10
|
+
acceptedAt: Date;
|
|
11
|
+
completedAt?: Date | null;
|
|
12
|
+
failedStage?: string | null;
|
|
13
|
+
errorCode?: string | null;
|
|
14
|
+
canRetry: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type KnowledgebaseDeletionReceipt = {
|
|
17
|
+
intentId: string;
|
|
18
|
+
knowledgebaseIdSnapshot: string;
|
|
19
|
+
status: KnowledgeDeletionStatus;
|
|
20
|
+
acceptedAt: Date;
|
|
21
|
+
completedAt?: Date | null;
|
|
22
|
+
failedStage?: string | null;
|
|
23
|
+
errorCode?: string | null;
|
|
24
|
+
canRetry: boolean;
|
|
25
|
+
};
|
|
@@ -14,6 +14,8 @@ export type DocumentParserConfig = {
|
|
|
14
14
|
replaceWhitespace?: boolean;
|
|
15
15
|
removeSensitive?: boolean;
|
|
16
16
|
textSplitterType?: string;
|
|
17
|
+
/** Ordered literal separators. Unlike the legacy plugin string, commas need no escaping. */
|
|
18
|
+
separators?: string[];
|
|
17
19
|
textSplitter?: {
|
|
18
20
|
[key: string]: unknown;
|
|
19
21
|
};
|
|
@@ -23,6 +25,8 @@ export type DocumentParserConfig = {
|
|
|
23
25
|
[key: string]: unknown;
|
|
24
26
|
};
|
|
25
27
|
imageUnderstandingType?: string;
|
|
28
|
+
/** False is an explicit opt-out; absence retains legacy per-format defaults. */
|
|
29
|
+
imageUnderstandingEnabled?: boolean;
|
|
26
30
|
imageUnderstandingIntegration?: string;
|
|
27
31
|
imageUnderstanding?: {
|
|
28
32
|
[key: string]: unknown;
|
|
@@ -34,6 +38,20 @@ export type DocumentTextParserConfig = DocumentParserConfig & {
|
|
|
34
38
|
chunkSize?: number | null;
|
|
35
39
|
chunkOverlap?: number | null;
|
|
36
40
|
};
|
|
41
|
+
export type DocumentChunkSplitOptions = {
|
|
42
|
+
/** Ordered splitting priorities. An empty list splits only at maxChars; takes precedence over separator. */
|
|
43
|
+
separators?: string[];
|
|
44
|
+
/** Legacy single separator, used when separators is absent. */
|
|
45
|
+
separator?: string;
|
|
46
|
+
/** Maximum character count; this splitter does not count tokens. */
|
|
47
|
+
maxChars?: number;
|
|
48
|
+
};
|
|
49
|
+
export type DocumentParentChildParserConfig = {
|
|
50
|
+
parent: DocumentChunkSplitOptions & {
|
|
51
|
+
mode?: 'paragraph' | 'full';
|
|
52
|
+
};
|
|
53
|
+
child: DocumentChunkSplitOptions;
|
|
54
|
+
};
|
|
37
55
|
export type SpreadsheetInterpretation = 'records' | 'form_document';
|
|
38
56
|
export type SpreadsheetContextUnit = 'row' | 'sheet' | 'workbook';
|
|
39
57
|
export type SpreadsheetOversizePolicy = 'sheet' | 'reject';
|
|
@@ -170,6 +188,12 @@ export type TDocSourceConfig = {
|
|
|
170
188
|
};
|
|
171
189
|
export type TKnowledgeDocument = {
|
|
172
190
|
disabled?: boolean;
|
|
191
|
+
/** Soft-delete marker; ordinary read paths exclude these documents. */
|
|
192
|
+
deletedAt?: Date | null;
|
|
193
|
+
/** Hard-delete writer gate. A pending document is never eligible for read or publication. */
|
|
194
|
+
hardDeletePendingAt?: Date | null;
|
|
195
|
+
/** Monotonic fence captured by every document-derived writer. */
|
|
196
|
+
publicationEpoch?: number;
|
|
173
197
|
knowledgebaseId?: string;
|
|
174
198
|
/**
|
|
175
199
|
* @deprecated use fileUrl instead
|
|
@@ -256,6 +280,8 @@ export type TKnowledgeDocument = {
|
|
|
256
280
|
* The background job id
|
|
257
281
|
*/
|
|
258
282
|
jobId?: string;
|
|
283
|
+
/** Server-owned pipeline attempt allowed to update this document on dispatch failure. */
|
|
284
|
+
processingExecutionId?: string | null;
|
|
259
285
|
options?: TDocumentWebOptions;
|
|
260
286
|
integrationId?: string;
|
|
261
287
|
integration?: IIntegration;
|
|
@@ -296,6 +322,9 @@ export interface StandardDocumentMetadata {
|
|
|
296
322
|
lastIncrementalSync?: KnowledgeDocumentLastIncrementalSync;
|
|
297
323
|
}
|
|
298
324
|
export interface KnowledgeDocumentMetadata extends StandardDocumentMetadata {
|
|
325
|
+
/** Internal index containers are not user-uploaded documents. */
|
|
326
|
+
systemManaged?: boolean;
|
|
327
|
+
systemManagedType?: string;
|
|
299
328
|
transformSnapshot?: KnowledgeDocumentTransformSnapshotRef;
|
|
300
329
|
analysisSnapshot?: KnowledgeDocumentAnalysisSnapshotRef;
|
|
301
330
|
documentAnalysis?: DocumentAnalysisMetadata;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { KnowledgeRetrievalContentScope } from './knowledgebase.model';
|
|
1
2
|
export declare const KNOWLEDGE_FILTER_VERSION: 2;
|
|
2
3
|
export declare const KNOWLEDGE_FILTER_MAX_DEPTH = 3;
|
|
3
4
|
export declare const KNOWLEDGE_FILTER_MAX_CONDITIONS = 20;
|
|
@@ -52,8 +53,9 @@ export type KnowledgeFilterSources = {
|
|
|
52
53
|
dynamic?: KnowledgeFilterNode;
|
|
53
54
|
};
|
|
54
55
|
export type KnowledgeFilterStatus = 'not_applied' | 'applied' | 'dynamic_fallback' | 'failed';
|
|
55
|
-
export type KnowledgeFilterErrorCode = 'invalid_filter' | 'unknown_field' | 'invalid_operator' | 'invalid_value' | 'missing_fixed_variable' | 'filter_too_complex' | 'graph_search_failed' | 'keyword_index_missing' | 'keyword_query_failed' | 'unsupported_backend' | 'unsupported_retrieval_mode';
|
|
56
|
+
export type KnowledgeFilterErrorCode = 'invalid_filter' | 'unknown_field' | 'invalid_operator' | 'invalid_value' | 'missing_fixed_variable' | 'filter_too_complex' | 'graph_search_failed' | 'keyword_index_missing' | 'keyword_query_failed' | 'rerank_failed' | 'unsupported_backend' | 'unsupported_retrieval_mode';
|
|
56
57
|
export type KnowledgeFilterDiagnostics = {
|
|
58
|
+
contentScope?: KnowledgeRetrievalContentScope;
|
|
57
59
|
filterVersion: typeof KNOWLEDGE_FILTER_VERSION;
|
|
58
60
|
fixedFilter?: KnowledgeFilterNode;
|
|
59
61
|
requestFilter?: KnowledgeFilterNode;
|