@xpert-ai/contracts 3.23.0 → 3.25.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.
- package/index.cjs.js +5295 -368
- package/index.esm.js +5184 -369
- package/package.json +2 -2
- package/src/ai/agent-output-delivery.model.d.ts +10 -10
- package/src/ai/agent-runtime.model.d.ts +24 -24
- package/src/ai/assistant-model.model.d.ts +8 -0
- package/src/ai/assistant-template-dependencies.model.d.ts +1 -1
- package/src/ai/index.d.ts +2 -0
- package/src/ai/mcp-publication.model.d.ts +20 -0
- package/src/ai/model-discovery.model.d.ts +2 -0
- package/src/ai/project-pipeline/analytics.d.ts +1685 -0
- package/src/ai/project-pipeline/budget.schema.d.ts +78 -0
- package/src/ai/project-pipeline/catalog.schema.d.ts +188 -0
- package/src/ai/project-pipeline/catalog.validation.d.ts +4 -0
- package/src/ai/project-pipeline/commands.schema.d.ts +4381 -0
- package/src/ai/project-pipeline/compatibility.d.ts +5 -0
- package/src/ai/project-pipeline/compatibility.schema.d.ts +29 -0
- package/src/ai/project-pipeline/configuration-form.d.ts +17374 -0
- package/src/ai/project-pipeline/configuration.schema.d.ts +3774 -0
- package/src/ai/project-pipeline/contribution.schema.d.ts +6721 -0
- package/src/ai/project-pipeline/dataflow.validation.d.ts +6 -0
- package/src/ai/project-pipeline/definition.schema.d.ts +3808 -0
- package/src/ai/project-pipeline/definition.validation.d.ts +7 -0
- package/src/ai/project-pipeline/execution-statistics.d.ts +267 -0
- package/src/ai/project-pipeline/graph.model.d.ts +89 -0
- package/src/ai/project-pipeline/human-wait-statistics.d.ts +70 -0
- package/src/ai/project-pipeline/human-wait.schema.d.ts +26 -0
- package/src/ai/project-pipeline/index.d.ts +28 -0
- package/src/ai/project-pipeline/model-usage-statistics.d.ts +143 -0
- package/src/ai/project-pipeline/native-source.schema.d.ts +40 -0
- package/src/ai/project-pipeline/node.schema.d.ts +839 -0
- package/src/ai/project-pipeline/operation.schema.d.ts +800 -0
- package/src/ai/project-pipeline/portfolio.schema.d.ts +3817 -0
- package/src/ai/project-pipeline/primitives.schema.d.ts +138 -0
- package/src/ai/project-pipeline/projection.schema.d.ts +4715 -0
- package/src/ai/project-pipeline/provider-actions.schema.d.ts +2030 -0
- package/src/ai/project-pipeline/queue-statistics.d.ts +326 -0
- package/src/ai/project-pipeline/resources.schema.d.ts +73 -0
- package/src/ai/project-pipeline/runtime.schema.d.ts +934 -0
- package/src/ai/project-pipeline/statistics.d.ts +811 -0
- package/src/ai/project-task-graph.model.d.ts +18 -2
- package/src/ai/project-task-runtime.model.d.ts +924 -924
- package/src/ai/provider-credential-validation.model.d.ts +63 -0
- package/src/ai/template-installation.model.d.ts +27 -0
- package/src/ai/types.d.ts +6 -4
- package/src/ai/xpert-project-type.model.d.ts +15 -4
- package/src/ai/xpert-project.model.d.ts +9 -2
- package/src/analytics-query.model.d.ts +5 -0
- package/src/artifact-presentation.model.d.ts +28 -0
- package/src/index.d.ts +1 -0
- package/src/view-extension/model.d.ts +10 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProjectPipelineDefinition } from './definition.schema';
|
|
2
|
+
export interface ProjectPipelineValidationIssue {
|
|
3
|
+
code: string;
|
|
4
|
+
path: Array<string | number>;
|
|
5
|
+
}
|
|
6
|
+
/** Pure semantic checks shared by configuration APIs, plugin registrations and persisted snapshots. */
|
|
7
|
+
export declare function validateProjectPipelineDefinition(definition: ProjectPipelineDefinition): ProjectPipelineValidationIssue[];
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
export declare const pipelineAttemptCountsSchema: z.ZodObject<{
|
|
3
|
+
total: z.ZodNumber;
|
|
4
|
+
queued: z.ZodNumber;
|
|
5
|
+
running: z.ZodNumber;
|
|
6
|
+
waiting: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
succeeded: z.ZodNumber;
|
|
8
|
+
failed: z.ZodNumber;
|
|
9
|
+
cancelled: z.ZodNumber;
|
|
10
|
+
unknown: z.ZodNumber;
|
|
11
|
+
terminal: z.ZodNumber;
|
|
12
|
+
successRate: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
retries: z.ZodNumber;
|
|
14
|
+
additionalAttempts: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
unclassifiedAttempts: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
unknown: number;
|
|
18
|
+
terminal: number;
|
|
19
|
+
total: number;
|
|
20
|
+
queued: number;
|
|
21
|
+
running: number;
|
|
22
|
+
succeeded: number;
|
|
23
|
+
failed: number;
|
|
24
|
+
cancelled: number;
|
|
25
|
+
successRate: number | null;
|
|
26
|
+
retries: number;
|
|
27
|
+
waiting?: number | undefined;
|
|
28
|
+
additionalAttempts?: number | undefined;
|
|
29
|
+
unclassifiedAttempts?: number | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
unknown: number;
|
|
32
|
+
terminal: number;
|
|
33
|
+
total: number;
|
|
34
|
+
queued: number;
|
|
35
|
+
running: number;
|
|
36
|
+
succeeded: number;
|
|
37
|
+
failed: number;
|
|
38
|
+
cancelled: number;
|
|
39
|
+
successRate: number | null;
|
|
40
|
+
retries: number;
|
|
41
|
+
waiting?: number | undefined;
|
|
42
|
+
additionalAttempts?: number | undefined;
|
|
43
|
+
unclassifiedAttempts?: number | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const pipelineExecutionTimingSchema: z.ZodObject<{
|
|
46
|
+
samples: z.ZodNumber;
|
|
47
|
+
unavailable: z.ZodNumber;
|
|
48
|
+
totalMs: z.ZodNullable<z.ZodNumber>;
|
|
49
|
+
meanMs: z.ZodNullable<z.ZodNumber>;
|
|
50
|
+
medianMs: z.ZodNullable<z.ZodNumber>;
|
|
51
|
+
p95Ms: z.ZodNullable<z.ZodNumber>;
|
|
52
|
+
}, "strict", z.ZodTypeAny, {
|
|
53
|
+
samples: number;
|
|
54
|
+
unavailable: number;
|
|
55
|
+
totalMs: number | null;
|
|
56
|
+
meanMs: number | null;
|
|
57
|
+
medianMs: number | null;
|
|
58
|
+
p95Ms: number | null;
|
|
59
|
+
}, {
|
|
60
|
+
samples: number;
|
|
61
|
+
unavailable: number;
|
|
62
|
+
totalMs: number | null;
|
|
63
|
+
meanMs: number | null;
|
|
64
|
+
medianMs: number | null;
|
|
65
|
+
p95Ms: number | null;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const pipelineExecutorStatisticsSchema: z.ZodObject<{
|
|
68
|
+
xpertId: z.ZodNullable<z.ZodString>;
|
|
69
|
+
agentKey: z.ZodNullable<z.ZodString>;
|
|
70
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
71
|
+
toolId: z.ZodNullable<z.ZodString>;
|
|
72
|
+
serviceRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
attempts: z.ZodObject<{
|
|
74
|
+
total: z.ZodNumber;
|
|
75
|
+
queued: z.ZodNumber;
|
|
76
|
+
running: z.ZodNumber;
|
|
77
|
+
waiting: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
succeeded: z.ZodNumber;
|
|
79
|
+
failed: z.ZodNumber;
|
|
80
|
+
cancelled: z.ZodNumber;
|
|
81
|
+
unknown: z.ZodNumber;
|
|
82
|
+
terminal: z.ZodNumber;
|
|
83
|
+
successRate: z.ZodNullable<z.ZodNumber>;
|
|
84
|
+
retries: z.ZodNumber;
|
|
85
|
+
additionalAttempts: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
unclassifiedAttempts: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
}, "strict", z.ZodTypeAny, {
|
|
88
|
+
unknown: number;
|
|
89
|
+
terminal: number;
|
|
90
|
+
total: number;
|
|
91
|
+
queued: number;
|
|
92
|
+
running: number;
|
|
93
|
+
succeeded: number;
|
|
94
|
+
failed: number;
|
|
95
|
+
cancelled: number;
|
|
96
|
+
successRate: number | null;
|
|
97
|
+
retries: number;
|
|
98
|
+
waiting?: number | undefined;
|
|
99
|
+
additionalAttempts?: number | undefined;
|
|
100
|
+
unclassifiedAttempts?: number | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
unknown: number;
|
|
103
|
+
terminal: number;
|
|
104
|
+
total: number;
|
|
105
|
+
queued: number;
|
|
106
|
+
running: number;
|
|
107
|
+
succeeded: number;
|
|
108
|
+
failed: number;
|
|
109
|
+
cancelled: number;
|
|
110
|
+
successRate: number | null;
|
|
111
|
+
retries: number;
|
|
112
|
+
waiting?: number | undefined;
|
|
113
|
+
additionalAttempts?: number | undefined;
|
|
114
|
+
unclassifiedAttempts?: number | undefined;
|
|
115
|
+
}>;
|
|
116
|
+
timing: z.ZodObject<{
|
|
117
|
+
samples: z.ZodNumber;
|
|
118
|
+
unavailable: z.ZodNumber;
|
|
119
|
+
totalMs: z.ZodNullable<z.ZodNumber>;
|
|
120
|
+
meanMs: z.ZodNullable<z.ZodNumber>;
|
|
121
|
+
medianMs: z.ZodNullable<z.ZodNumber>;
|
|
122
|
+
p95Ms: z.ZodNullable<z.ZodNumber>;
|
|
123
|
+
}, "strict", z.ZodTypeAny, {
|
|
124
|
+
samples: number;
|
|
125
|
+
unavailable: number;
|
|
126
|
+
totalMs: number | null;
|
|
127
|
+
meanMs: number | null;
|
|
128
|
+
medianMs: number | null;
|
|
129
|
+
p95Ms: number | null;
|
|
130
|
+
}, {
|
|
131
|
+
samples: number;
|
|
132
|
+
unavailable: number;
|
|
133
|
+
totalMs: number | null;
|
|
134
|
+
meanMs: number | null;
|
|
135
|
+
medianMs: number | null;
|
|
136
|
+
p95Ms: number | null;
|
|
137
|
+
}>;
|
|
138
|
+
}, "strict", z.ZodTypeAny, {
|
|
139
|
+
provider: string | null;
|
|
140
|
+
xpertId: string | null;
|
|
141
|
+
agentKey: string | null;
|
|
142
|
+
toolId: string | null;
|
|
143
|
+
attempts: {
|
|
144
|
+
unknown: number;
|
|
145
|
+
terminal: number;
|
|
146
|
+
total: number;
|
|
147
|
+
queued: number;
|
|
148
|
+
running: number;
|
|
149
|
+
succeeded: number;
|
|
150
|
+
failed: number;
|
|
151
|
+
cancelled: number;
|
|
152
|
+
successRate: number | null;
|
|
153
|
+
retries: number;
|
|
154
|
+
waiting?: number | undefined;
|
|
155
|
+
additionalAttempts?: number | undefined;
|
|
156
|
+
unclassifiedAttempts?: number | undefined;
|
|
157
|
+
};
|
|
158
|
+
timing: {
|
|
159
|
+
samples: number;
|
|
160
|
+
unavailable: number;
|
|
161
|
+
totalMs: number | null;
|
|
162
|
+
meanMs: number | null;
|
|
163
|
+
medianMs: number | null;
|
|
164
|
+
p95Ms: number | null;
|
|
165
|
+
};
|
|
166
|
+
serviceRef?: string | null | undefined;
|
|
167
|
+
}, {
|
|
168
|
+
provider: string | null;
|
|
169
|
+
xpertId: string | null;
|
|
170
|
+
agentKey: string | null;
|
|
171
|
+
toolId: string | null;
|
|
172
|
+
attempts: {
|
|
173
|
+
unknown: number;
|
|
174
|
+
terminal: number;
|
|
175
|
+
total: number;
|
|
176
|
+
queued: number;
|
|
177
|
+
running: number;
|
|
178
|
+
succeeded: number;
|
|
179
|
+
failed: number;
|
|
180
|
+
cancelled: number;
|
|
181
|
+
successRate: number | null;
|
|
182
|
+
retries: number;
|
|
183
|
+
waiting?: number | undefined;
|
|
184
|
+
additionalAttempts?: number | undefined;
|
|
185
|
+
unclassifiedAttempts?: number | undefined;
|
|
186
|
+
};
|
|
187
|
+
timing: {
|
|
188
|
+
samples: number;
|
|
189
|
+
unavailable: number;
|
|
190
|
+
totalMs: number | null;
|
|
191
|
+
meanMs: number | null;
|
|
192
|
+
medianMs: number | null;
|
|
193
|
+
p95Ms: number | null;
|
|
194
|
+
};
|
|
195
|
+
serviceRef?: string | null | undefined;
|
|
196
|
+
}>;
|
|
197
|
+
export type PipelineAttemptFact = {
|
|
198
|
+
id?: string;
|
|
199
|
+
taskId: string;
|
|
200
|
+
agentExecutionId?: string | null;
|
|
201
|
+
invocationId?: string | null;
|
|
202
|
+
xpertId?: string | null;
|
|
203
|
+
agentKey?: string | null;
|
|
204
|
+
runtimeProvider?: string;
|
|
205
|
+
runtimeToolId?: string;
|
|
206
|
+
runtimeServiceRef?: string;
|
|
207
|
+
pipelineAttemptKind?: 'initial' | 'technical_retry';
|
|
208
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
209
|
+
runtimeStatus?: string;
|
|
210
|
+
invocationStatus?: string;
|
|
211
|
+
runtimeStartedAt?: string | null;
|
|
212
|
+
runtimeCompletedAt?: string | null;
|
|
213
|
+
};
|
|
214
|
+
export declare function pipelineAttemptCounts(facts: readonly PipelineAttemptFact[]): {
|
|
215
|
+
total: number;
|
|
216
|
+
queued: number;
|
|
217
|
+
running: number;
|
|
218
|
+
waiting: number;
|
|
219
|
+
succeeded: number;
|
|
220
|
+
failed: number;
|
|
221
|
+
cancelled: number;
|
|
222
|
+
unknown: number;
|
|
223
|
+
terminal: number;
|
|
224
|
+
successRate: number | null;
|
|
225
|
+
retries: number;
|
|
226
|
+
additionalAttempts: number;
|
|
227
|
+
unclassifiedAttempts: number;
|
|
228
|
+
};
|
|
229
|
+
/** Only recorded, terminal runtime intervals contribute. Missing times are not zero-duration runs. */
|
|
230
|
+
export declare function pipelineExecutionTiming(facts: readonly PipelineAttemptFact[]): {
|
|
231
|
+
samples: number;
|
|
232
|
+
unavailable: number;
|
|
233
|
+
totalMs: number | null;
|
|
234
|
+
meanMs: number | null;
|
|
235
|
+
medianMs: number | null;
|
|
236
|
+
p95Ms: number | null;
|
|
237
|
+
};
|
|
238
|
+
export declare function pipelineExecutorStatistics(facts: readonly PipelineAttemptFact[]): {
|
|
239
|
+
attempts: {
|
|
240
|
+
total: number;
|
|
241
|
+
queued: number;
|
|
242
|
+
running: number;
|
|
243
|
+
waiting: number;
|
|
244
|
+
succeeded: number;
|
|
245
|
+
failed: number;
|
|
246
|
+
cancelled: number;
|
|
247
|
+
unknown: number;
|
|
248
|
+
terminal: number;
|
|
249
|
+
successRate: number | null;
|
|
250
|
+
retries: number;
|
|
251
|
+
additionalAttempts: number;
|
|
252
|
+
unclassifiedAttempts: number;
|
|
253
|
+
};
|
|
254
|
+
timing: {
|
|
255
|
+
samples: number;
|
|
256
|
+
unavailable: number;
|
|
257
|
+
totalMs: number | null;
|
|
258
|
+
meanMs: number | null;
|
|
259
|
+
medianMs: number | null;
|
|
260
|
+
p95Ms: number | null;
|
|
261
|
+
};
|
|
262
|
+
xpertId: string | null;
|
|
263
|
+
agentKey: string | null;
|
|
264
|
+
provider: string | null;
|
|
265
|
+
toolId: string | null;
|
|
266
|
+
serviceRef: string | null;
|
|
267
|
+
}[];
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ProjectPipelineStatistics } from './statistics';
|
|
2
|
+
import type { ProjectPipelineDefinition } from './definition.schema';
|
|
3
|
+
import type { ProjectPipelineProjectionNode, ProjectPipelineProjectionEdge } from './projection.schema';
|
|
4
|
+
import type { ProjectTaskGraph } from '../project-task-graph.model';
|
|
5
|
+
import type { ProjectPipelineEvidenceRef } from './runtime.schema';
|
|
6
|
+
export interface ProjectPipelineSummary {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
authority: 'provider' | 'platform';
|
|
10
|
+
ownerRef: string;
|
|
11
|
+
sourceKey: string;
|
|
12
|
+
revision: number;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ProjectPipelineGraph {
|
|
16
|
+
projectId: string;
|
|
17
|
+
instance: ProjectPipelineSummary;
|
|
18
|
+
cursor: string;
|
|
19
|
+
definition: ProjectPipelineDefinition;
|
|
20
|
+
runId: string;
|
|
21
|
+
runState: string;
|
|
22
|
+
roundId: string;
|
|
23
|
+
historical: boolean;
|
|
24
|
+
historyComplete: boolean;
|
|
25
|
+
snapshotAt: string;
|
|
26
|
+
round: {
|
|
27
|
+
sequence: number;
|
|
28
|
+
generation: number;
|
|
29
|
+
state: string;
|
|
30
|
+
inputDigest: string;
|
|
31
|
+
};
|
|
32
|
+
nodes: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
projection: ProjectPipelineProjectionNode;
|
|
35
|
+
taskIds: string[];
|
|
36
|
+
/** Exact attempts owned by this node in roundId. Absence means unknown, never task history. */
|
|
37
|
+
executionIds?: string[];
|
|
38
|
+
}>;
|
|
39
|
+
edges: ProjectPipelineProjectionEdge[];
|
|
40
|
+
executionAttribution?: {
|
|
41
|
+
scope: 'node_round';
|
|
42
|
+
unattributedCount: number;
|
|
43
|
+
};
|
|
44
|
+
statistics: ProjectPipelineStatistics;
|
|
45
|
+
tasks: ProjectTaskGraph;
|
|
46
|
+
refresh: ProjectPipelineRefreshStatus | null;
|
|
47
|
+
/** Absent on older hosts; false prevents new dispatch while recovery remains available. */
|
|
48
|
+
dispatchEnabled?: boolean;
|
|
49
|
+
permissions: {
|
|
50
|
+
canEdit: boolean;
|
|
51
|
+
canManage: boolean;
|
|
52
|
+
};
|
|
53
|
+
attentions: ProjectPipelineAttention[];
|
|
54
|
+
actions: {
|
|
55
|
+
cancel: boolean;
|
|
56
|
+
retries: Array<{
|
|
57
|
+
nodeInstanceId: string;
|
|
58
|
+
operationId: string;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export interface ProjectPipelineAttention {
|
|
63
|
+
/** Provider actions are read-only triage entries, never human decision records. */
|
|
64
|
+
source?: 'coordinator' | 'provider_action';
|
|
65
|
+
id: string;
|
|
66
|
+
nodeInstanceId: string;
|
|
67
|
+
kind: 'human' | 'unknown' | 'blocked';
|
|
68
|
+
state: 'open' | 'resolved' | 'superseded';
|
|
69
|
+
revision: number;
|
|
70
|
+
generation: number;
|
|
71
|
+
inputDigest: string;
|
|
72
|
+
reasonCode: string;
|
|
73
|
+
outcomes: string[];
|
|
74
|
+
inputEvidence: ProjectPipelineEvidenceRef[];
|
|
75
|
+
}
|
|
76
|
+
export interface ProjectPipelineRefreshStatus {
|
|
77
|
+
state: 'queued' | 'running' | 'ready' | 'not_found' | 'failed';
|
|
78
|
+
errorCode: string | null;
|
|
79
|
+
updatedAt: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ProjectPipelineRoundSummary {
|
|
82
|
+
id: string;
|
|
83
|
+
runId: string;
|
|
84
|
+
sequence: number;
|
|
85
|
+
generation: number;
|
|
86
|
+
state: string;
|
|
87
|
+
current: boolean;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
import type { PipelineHumanWaitSnapshot } from './human-wait.schema';
|
|
3
|
+
export declare const pipelineHumanWaitStatisticsSchema: z.ZodObject<{
|
|
4
|
+
scope: z.ZodLiteral<"observed_human_ready_intervals_intersecting_window">;
|
|
5
|
+
intervals: z.ZodNumber;
|
|
6
|
+
ongoing: z.ZodNumber;
|
|
7
|
+
censored: z.ZodNumber;
|
|
8
|
+
observedNodeMs: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
observedUnionMs: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
coverage: z.ZodObject<{
|
|
11
|
+
snapshots: z.ZodNumber;
|
|
12
|
+
missingEvents: z.ZodNumber;
|
|
13
|
+
invalidEvents: z.ZodNumber;
|
|
14
|
+
currentUntrackedNodes: z.ZodNumber;
|
|
15
|
+
observedWindowMs: z.ZodNumber;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
snapshots: number;
|
|
18
|
+
missingEvents: number;
|
|
19
|
+
invalidEvents: number;
|
|
20
|
+
currentUntrackedNodes: number;
|
|
21
|
+
observedWindowMs: number;
|
|
22
|
+
}, {
|
|
23
|
+
snapshots: number;
|
|
24
|
+
missingEvents: number;
|
|
25
|
+
invalidEvents: number;
|
|
26
|
+
currentUntrackedNodes: number;
|
|
27
|
+
observedWindowMs: number;
|
|
28
|
+
}>;
|
|
29
|
+
}, "strict", z.ZodTypeAny, {
|
|
30
|
+
scope: "observed_human_ready_intervals_intersecting_window";
|
|
31
|
+
coverage: {
|
|
32
|
+
snapshots: number;
|
|
33
|
+
missingEvents: number;
|
|
34
|
+
invalidEvents: number;
|
|
35
|
+
currentUntrackedNodes: number;
|
|
36
|
+
observedWindowMs: number;
|
|
37
|
+
};
|
|
38
|
+
intervals: number;
|
|
39
|
+
ongoing: number;
|
|
40
|
+
censored: number;
|
|
41
|
+
observedNodeMs: number | null;
|
|
42
|
+
observedUnionMs: number | null;
|
|
43
|
+
}, {
|
|
44
|
+
scope: "observed_human_ready_intervals_intersecting_window";
|
|
45
|
+
coverage: {
|
|
46
|
+
snapshots: number;
|
|
47
|
+
missingEvents: number;
|
|
48
|
+
invalidEvents: number;
|
|
49
|
+
currentUntrackedNodes: number;
|
|
50
|
+
observedWindowMs: number;
|
|
51
|
+
};
|
|
52
|
+
intervals: number;
|
|
53
|
+
ongoing: number;
|
|
54
|
+
censored: number;
|
|
55
|
+
observedNodeMs: number | null;
|
|
56
|
+
observedUnionMs: number | null;
|
|
57
|
+
}>;
|
|
58
|
+
export type PipelineHumanWaitStatistics = z.output<typeof pipelineHumanWaitStatisticsSchema>;
|
|
59
|
+
export interface PipelineHumanWaitEvent {
|
|
60
|
+
instanceId: string;
|
|
61
|
+
revision: number;
|
|
62
|
+
snapshot: PipelineHumanWaitSnapshot | null;
|
|
63
|
+
invalid?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** Reconstruct only observed ready intervals. A missing event breaks continuity;
|
|
66
|
+
* an initial ready snapshot supplies a lower bound, never a fabricated historical start. */
|
|
67
|
+
export declare function pipelineHumanWaitStatistics(events: readonly PipelineHumanWaitEvent[], currentWaitingNodeIds: readonly string[], window: {
|
|
68
|
+
from: string;
|
|
69
|
+
to: string;
|
|
70
|
+
}, snapshotAt: string): PipelineHumanWaitStatistics;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
import type { ProjectPipelineProjectionNode } from './projection.schema';
|
|
3
|
+
/** This is a host observation, never a claim about when a person started or stopped working. */
|
|
4
|
+
export declare const pipelineHumanWaitSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
5
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
6
|
+
observedAt: z.ZodString;
|
|
7
|
+
nodeIds: z.ZodArray<z.ZodString, "many">;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
schemaVersion: 1;
|
|
10
|
+
observedAt: string;
|
|
11
|
+
nodeIds: string[];
|
|
12
|
+
}, {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
observedAt: string;
|
|
15
|
+
nodeIds: string[];
|
|
16
|
+
}>, {
|
|
17
|
+
schemaVersion: 1;
|
|
18
|
+
observedAt: string;
|
|
19
|
+
nodeIds: string[];
|
|
20
|
+
}, {
|
|
21
|
+
schemaVersion: 1;
|
|
22
|
+
observedAt: string;
|
|
23
|
+
nodeIds: string[];
|
|
24
|
+
}>;
|
|
25
|
+
export type PipelineHumanWaitSnapshot = z.output<typeof pipelineHumanWaitSnapshotSchema>;
|
|
26
|
+
export declare function pipelineNodeNeedsHuman(node: ProjectPipelineProjectionNode, historical?: boolean): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './primitives.schema';
|
|
2
|
+
export * from './node.schema';
|
|
3
|
+
export * from './definition.schema';
|
|
4
|
+
export * from './definition.validation';
|
|
5
|
+
export * from './configuration.schema';
|
|
6
|
+
export * from './runtime.schema';
|
|
7
|
+
export * from './catalog.schema';
|
|
8
|
+
export * from './catalog.validation';
|
|
9
|
+
export * from './projection.schema';
|
|
10
|
+
export * from './graph.model';
|
|
11
|
+
export * from './operation.schema';
|
|
12
|
+
export * from './commands.schema';
|
|
13
|
+
export * from './statistics';
|
|
14
|
+
export * from './configuration-form';
|
|
15
|
+
export * from './provider-actions.schema';
|
|
16
|
+
export * from './execution-statistics';
|
|
17
|
+
export * from './model-usage-statistics';
|
|
18
|
+
export * from './analytics';
|
|
19
|
+
export * from './queue-statistics';
|
|
20
|
+
export * from './human-wait.schema';
|
|
21
|
+
export * from './human-wait-statistics';
|
|
22
|
+
export * from './resources.schema';
|
|
23
|
+
export * from './portfolio.schema';
|
|
24
|
+
export * from './compatibility.schema';
|
|
25
|
+
export * from './compatibility';
|
|
26
|
+
export * from './budget.schema';
|
|
27
|
+
export * from './native-source.schema';
|
|
28
|
+
export * from './contribution.schema';
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
export declare const pipelineModelUsageStatisticsSchema: z.ZodObject<{
|
|
3
|
+
scope: z.ZodLiteral<"linked_native_llm_calls">;
|
|
4
|
+
requestedExecutions: z.ZodNumber;
|
|
5
|
+
executionsWithRecords: z.ZodNumber;
|
|
6
|
+
truncated: z.ZodBoolean;
|
|
7
|
+
rejectedRecords: z.ZodNumber;
|
|
8
|
+
calls: z.ZodNumber;
|
|
9
|
+
inputTokens: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
outputTokens: z.ZodNullable<z.ZodNumber>;
|
|
11
|
+
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
unpricedCalls: z.ZodNumber;
|
|
13
|
+
costs: z.ZodArray<z.ZodObject<{
|
|
14
|
+
currency: z.ZodString;
|
|
15
|
+
amount: z.ZodNumber;
|
|
16
|
+
calls: z.ZodNumber;
|
|
17
|
+
}, "strict", z.ZodTypeAny, {
|
|
18
|
+
calls: number;
|
|
19
|
+
currency: string;
|
|
20
|
+
amount: number;
|
|
21
|
+
}, {
|
|
22
|
+
calls: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
amount: number;
|
|
25
|
+
}>, "many">;
|
|
26
|
+
byModel: z.ZodArray<z.ZodObject<{
|
|
27
|
+
provider: z.ZodString;
|
|
28
|
+
model: z.ZodString;
|
|
29
|
+
calls: z.ZodNumber;
|
|
30
|
+
inputTokens: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
outputTokens: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
}, "strict", z.ZodTypeAny, {
|
|
34
|
+
provider: string;
|
|
35
|
+
calls: number;
|
|
36
|
+
inputTokens: number | null;
|
|
37
|
+
outputTokens: number | null;
|
|
38
|
+
totalTokens: number | null;
|
|
39
|
+
model: string;
|
|
40
|
+
}, {
|
|
41
|
+
provider: string;
|
|
42
|
+
calls: number;
|
|
43
|
+
inputTokens: number | null;
|
|
44
|
+
outputTokens: number | null;
|
|
45
|
+
totalTokens: number | null;
|
|
46
|
+
model: string;
|
|
47
|
+
}>, "many">;
|
|
48
|
+
}, "strict", z.ZodTypeAny, {
|
|
49
|
+
scope: "linked_native_llm_calls";
|
|
50
|
+
calls: number;
|
|
51
|
+
requestedExecutions: number;
|
|
52
|
+
executionsWithRecords: number;
|
|
53
|
+
truncated: boolean;
|
|
54
|
+
rejectedRecords: number;
|
|
55
|
+
inputTokens: number | null;
|
|
56
|
+
outputTokens: number | null;
|
|
57
|
+
totalTokens: number | null;
|
|
58
|
+
unpricedCalls: number;
|
|
59
|
+
costs: {
|
|
60
|
+
calls: number;
|
|
61
|
+
currency: string;
|
|
62
|
+
amount: number;
|
|
63
|
+
}[];
|
|
64
|
+
byModel: {
|
|
65
|
+
provider: string;
|
|
66
|
+
calls: number;
|
|
67
|
+
inputTokens: number | null;
|
|
68
|
+
outputTokens: number | null;
|
|
69
|
+
totalTokens: number | null;
|
|
70
|
+
model: string;
|
|
71
|
+
}[];
|
|
72
|
+
}, {
|
|
73
|
+
scope: "linked_native_llm_calls";
|
|
74
|
+
calls: number;
|
|
75
|
+
requestedExecutions: number;
|
|
76
|
+
executionsWithRecords: number;
|
|
77
|
+
truncated: boolean;
|
|
78
|
+
rejectedRecords: number;
|
|
79
|
+
inputTokens: number | null;
|
|
80
|
+
outputTokens: number | null;
|
|
81
|
+
totalTokens: number | null;
|
|
82
|
+
unpricedCalls: number;
|
|
83
|
+
costs: {
|
|
84
|
+
calls: number;
|
|
85
|
+
currency: string;
|
|
86
|
+
amount: number;
|
|
87
|
+
}[];
|
|
88
|
+
byModel: {
|
|
89
|
+
provider: string;
|
|
90
|
+
calls: number;
|
|
91
|
+
inputTokens: number | null;
|
|
92
|
+
outputTokens: number | null;
|
|
93
|
+
totalTokens: number | null;
|
|
94
|
+
model: string;
|
|
95
|
+
}[];
|
|
96
|
+
}>;
|
|
97
|
+
export type PipelineModelUsageStatistics = z.output<typeof pipelineModelUsageStatisticsSchema>;
|
|
98
|
+
/** Parsed ledger facts only. Request/metric identity is independent of task and parent execution links. */
|
|
99
|
+
export declare const pipelineModelUsageFactSchema: z.ZodObject<{
|
|
100
|
+
originExecutionId: z.ZodString;
|
|
101
|
+
providerScopeId: z.ZodString;
|
|
102
|
+
requestId: z.ZodString;
|
|
103
|
+
metricKey: z.ZodString;
|
|
104
|
+
revision: z.ZodNumber;
|
|
105
|
+
provider: z.ZodString;
|
|
106
|
+
model: z.ZodString;
|
|
107
|
+
promptTokens: z.ZodNullable<z.ZodNumber>;
|
|
108
|
+
completionTokens: z.ZodNullable<z.ZodNumber>;
|
|
109
|
+
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
110
|
+
pricingStatus: z.ZodEnum<["priced", "free", "unpriced"]>;
|
|
111
|
+
priceCurrency: z.ZodNullable<z.ZodString>;
|
|
112
|
+
priceAmount: z.ZodNullable<z.ZodNumber>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
provider: string;
|
|
115
|
+
totalTokens: number | null;
|
|
116
|
+
model: string;
|
|
117
|
+
originExecutionId: string;
|
|
118
|
+
providerScopeId: string;
|
|
119
|
+
requestId: string;
|
|
120
|
+
metricKey: string;
|
|
121
|
+
revision: number;
|
|
122
|
+
promptTokens: number | null;
|
|
123
|
+
completionTokens: number | null;
|
|
124
|
+
pricingStatus: "priced" | "free" | "unpriced";
|
|
125
|
+
priceCurrency: string | null;
|
|
126
|
+
priceAmount: number | null;
|
|
127
|
+
}, {
|
|
128
|
+
provider: string;
|
|
129
|
+
totalTokens: number | null;
|
|
130
|
+
model: string;
|
|
131
|
+
originExecutionId: string;
|
|
132
|
+
providerScopeId: string;
|
|
133
|
+
requestId: string;
|
|
134
|
+
metricKey: string;
|
|
135
|
+
revision: number;
|
|
136
|
+
promptTokens: number | null;
|
|
137
|
+
completionTokens: number | null;
|
|
138
|
+
pricingStatus: "priced" | "free" | "unpriced";
|
|
139
|
+
priceCurrency: string | null;
|
|
140
|
+
priceAmount: number | null;
|
|
141
|
+
}>;
|
|
142
|
+
export type PipelineModelUsageFact = z.output<typeof pipelineModelUsageFactSchema>;
|
|
143
|
+
export declare function pipelineModelUsageStatistics(facts: readonly PipelineModelUsageFact[], coverage: Pick<PipelineModelUsageStatistics, 'requestedExecutions' | 'executionsWithRecords' | 'truncated' | 'rejectedRecords'>): PipelineModelUsageStatistics;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
/** Host-issued dispatch lease; a reference is not authorization until revalidated against durable work. */
|
|
3
|
+
export declare const projectPipelineNativeDispatchSchema: z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"provider_action">;
|
|
5
|
+
operationId: z.ZodString;
|
|
6
|
+
leaseOwner: z.ZodString;
|
|
7
|
+
leaseFence: z.ZodNumber;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
kind: "provider_action";
|
|
10
|
+
operationId: string;
|
|
11
|
+
leaseOwner: string;
|
|
12
|
+
leaseFence: number;
|
|
13
|
+
}, {
|
|
14
|
+
kind: "provider_action";
|
|
15
|
+
operationId: string;
|
|
16
|
+
leaseOwner: string;
|
|
17
|
+
leaseFence: number;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const projectPipelineNativeSourceSchema: z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"provider_action">;
|
|
21
|
+
operationId: z.ZodString;
|
|
22
|
+
leaseOwner: z.ZodString;
|
|
23
|
+
leaseFence: z.ZodNumber;
|
|
24
|
+
} & {
|
|
25
|
+
callKey: z.ZodEffects<z.ZodString, string, string>;
|
|
26
|
+
}, "strict", z.ZodTypeAny, {
|
|
27
|
+
kind: "provider_action";
|
|
28
|
+
operationId: string;
|
|
29
|
+
leaseOwner: string;
|
|
30
|
+
leaseFence: number;
|
|
31
|
+
callKey: string;
|
|
32
|
+
}, {
|
|
33
|
+
kind: "provider_action";
|
|
34
|
+
operationId: string;
|
|
35
|
+
leaseOwner: string;
|
|
36
|
+
leaseFence: number;
|
|
37
|
+
callKey: string;
|
|
38
|
+
}>;
|
|
39
|
+
export type ProjectPipelineNativeDispatch = z.output<typeof projectPipelineNativeDispatchSchema>;
|
|
40
|
+
export type ProjectPipelineNativeSource = z.output<typeof projectPipelineNativeSourceSchema>;
|