@tangle-network/agent-interface 0.22.0 → 0.24.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/dist/agent-candidate-execution-plan-schema.d.ts +24 -0
- package/dist/agent-candidate-execution-plan-schema.js +57 -1
- package/dist/agent-candidate-outcome-schema.d.ts +229 -4
- package/dist/agent-candidate-outcome-schema.js +68 -5
- package/dist/agent-candidate-receipt-schema.d.ts +160 -4
- package/dist/agent-candidate.d.ts +29 -1
- package/package.json +1 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const agentCandidateModelAccessNetworkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
mode: z.ZodLiteral<"disabled">;
|
|
4
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5
|
+
mode: z.ZodLiteral<"gateway-only">;
|
|
6
|
+
domains: z.ZodArray<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>], "mode">;
|
|
2
8
|
export declare const agentCandidateResolvedModelSchema: z.ZodObject<{
|
|
3
9
|
requested: z.ZodString;
|
|
4
10
|
provider: z.ZodString;
|
|
@@ -359,6 +365,12 @@ export declare const agentCandidateExecutionPlanMaterialSchema: z.ZodObject<{
|
|
|
359
365
|
access: z.ZodObject<{
|
|
360
366
|
kind: z.ZodLiteral<"evaluator-mediated">;
|
|
361
367
|
grantDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
368
|
+
network: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
369
|
+
mode: z.ZodLiteral<"disabled">;
|
|
370
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
371
|
+
mode: z.ZodLiteral<"gateway-only">;
|
|
372
|
+
domains: z.ZodArray<z.ZodString>;
|
|
373
|
+
}, z.core.$strict>], "mode">;
|
|
362
374
|
}, z.core.$strict>;
|
|
363
375
|
routes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
364
376
|
kind: z.ZodLiteral<"primary">;
|
|
@@ -684,6 +696,12 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
|
|
|
684
696
|
access: {
|
|
685
697
|
kind: "evaluator-mediated";
|
|
686
698
|
grantDigest: `sha256:${string}`;
|
|
699
|
+
network: {
|
|
700
|
+
mode: "disabled";
|
|
701
|
+
} | {
|
|
702
|
+
mode: "gateway-only";
|
|
703
|
+
domains: string[];
|
|
704
|
+
};
|
|
687
705
|
};
|
|
688
706
|
routes: ({
|
|
689
707
|
kind: "primary";
|
|
@@ -989,6 +1007,12 @@ export declare const agentCandidateExecutionPlanEvidenceSchema: z.ZodObject<{
|
|
|
989
1007
|
access: {
|
|
990
1008
|
kind: "evaluator-mediated";
|
|
991
1009
|
grantDigest: `sha256:${string}`;
|
|
1010
|
+
network: {
|
|
1011
|
+
mode: "disabled";
|
|
1012
|
+
} | {
|
|
1013
|
+
mode: "gateway-only";
|
|
1014
|
+
domains: string[];
|
|
1015
|
+
};
|
|
992
1016
|
};
|
|
993
1017
|
routes: ({
|
|
994
1018
|
kind: "primary";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { agentCandidateCapturedArtifactSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, } from "./agent-candidate-artifact-schema.js";
|
|
3
3
|
import { agentCandidateContainerSchema, agentCandidateInstructionDeliverySchema, agentCandidateWorkingDirectorySchema, } from "./agent-candidate-code-schema.js";
|
|
4
|
-
import { addDuplicateIssues, agentCandidateConfigValueSchema, environmentConfigSchema, gitObjectSchema, isCanonicalJsonValue, isSafeExecutable, isSafeRelativePath, sameGitObjectFormat, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
|
|
4
|
+
import { addDuplicateIssues, agentCandidateConfigValueSchema, environmentConfigSchema, gitObjectSchema, isCanonicalJsonValue, isObviouslyPrivateHostname, isSafeExecutable, isSafeRelativePath, sameGitObjectFormat, sha256DigestSchema, } from "./agent-candidate-schema-common.js";
|
|
5
5
|
import { harnessTypeSchema } from "./harness.js";
|
|
6
6
|
const reasoningEffortSchema = z.enum([
|
|
7
7
|
"none",
|
|
@@ -21,6 +21,34 @@ function isCanonicalAbsolutePath(value) {
|
|
|
21
21
|
function pathsOverlap(left, right) {
|
|
22
22
|
return left === right || left.startsWith(`${right}/`) || right.startsWith(`${left}/`);
|
|
23
23
|
}
|
|
24
|
+
function isExactPublicGatewayDomain(value) {
|
|
25
|
+
if (value.length > 253 ||
|
|
26
|
+
value !== value.toLowerCase() ||
|
|
27
|
+
value.endsWith(".") ||
|
|
28
|
+
value.includes(":") ||
|
|
29
|
+
isObviouslyPrivateHostname(value)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const labels = value.split(".");
|
|
33
|
+
return (labels.length >= 2 &&
|
|
34
|
+
labels.every((label) => label.length >= 1 &&
|
|
35
|
+
label.length <= 63 &&
|
|
36
|
+
/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label)) &&
|
|
37
|
+
/[a-z]/.test(labels.at(-1) ?? ""));
|
|
38
|
+
}
|
|
39
|
+
export const agentCandidateModelAccessNetworkSchema = z.discriminatedUnion("mode", [
|
|
40
|
+
z.object({ mode: z.literal("disabled") }).strict(),
|
|
41
|
+
z
|
|
42
|
+
.object({
|
|
43
|
+
mode: z.literal("gateway-only"),
|
|
44
|
+
domains: z
|
|
45
|
+
.array(z
|
|
46
|
+
.string()
|
|
47
|
+
.refine(isExactPublicGatewayDomain, "model gateway must be an exact lowercase public DNS name"))
|
|
48
|
+
.min(1),
|
|
49
|
+
})
|
|
50
|
+
.strict(),
|
|
51
|
+
]);
|
|
24
52
|
export const agentCandidateResolvedModelSchema = z
|
|
25
53
|
.object({
|
|
26
54
|
requested: z.string().min(1),
|
|
@@ -195,6 +223,7 @@ export const agentCandidateExecutionPlanMaterialSchema = z
|
|
|
195
223
|
.object({
|
|
196
224
|
kind: z.literal("evaluator-mediated"),
|
|
197
225
|
grantDigest: sha256DigestSchema,
|
|
226
|
+
network: agentCandidateModelAccessNetworkSchema,
|
|
198
227
|
})
|
|
199
228
|
.strict(),
|
|
200
229
|
routes: z
|
|
@@ -300,6 +329,33 @@ export const agentCandidateExecutionPlanMaterialSchema = z
|
|
|
300
329
|
});
|
|
301
330
|
}
|
|
302
331
|
}
|
|
332
|
+
const modelNetwork = material.model.access.network;
|
|
333
|
+
if (material.limits.maxModelCalls === 0 && modelNetwork.mode !== "disabled") {
|
|
334
|
+
ctx.addIssue({
|
|
335
|
+
code: "custom",
|
|
336
|
+
path: ["model", "access", "network"],
|
|
337
|
+
message: "zero-call plans cannot expose a model gateway",
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
if (material.limits.maxModelCalls > 0 && modelNetwork.mode !== "gateway-only") {
|
|
341
|
+
ctx.addIssue({
|
|
342
|
+
code: "custom",
|
|
343
|
+
path: ["model", "access", "network"],
|
|
344
|
+
message: "model-calling plans require one frozen gateway allowlist",
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
if (modelNetwork.mode === "gateway-only") {
|
|
348
|
+
addDuplicateIssues(modelNetwork.domains, ["model", "access", "network", "domains"], ctx);
|
|
349
|
+
for (let index = 1; index < modelNetwork.domains.length; index++) {
|
|
350
|
+
if ((modelNetwork.domains[index - 1] ?? "") >= (modelNetwork.domains[index] ?? "")) {
|
|
351
|
+
ctx.addIssue({
|
|
352
|
+
code: "custom",
|
|
353
|
+
path: ["model", "access", "network", "domains", index],
|
|
354
|
+
message: "model gateway domains must be lexicographically sorted",
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
303
359
|
const activeCode = material.codeKind !== "disabled";
|
|
304
360
|
if (activeCode !== (material.candidateWorkspace !== undefined)) {
|
|
305
361
|
ctx.addIssue({
|
|
@@ -18,8 +18,34 @@ export declare const agentCandidateModelSettlementCallSchema: z.ZodObject<{
|
|
|
18
18
|
reasoningTokens: z.ZodNumber;
|
|
19
19
|
costUsdNanos: z.ZodNumber;
|
|
20
20
|
}, z.core.$strict>;
|
|
21
|
-
export declare const
|
|
22
|
-
|
|
21
|
+
export declare const agentCandidateModelSettlementCallV2Schema: z.ZodObject<{
|
|
22
|
+
callId: z.ZodString;
|
|
23
|
+
generationId: z.ZodString;
|
|
24
|
+
traceSpanId: z.ZodString;
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
succeeded: "succeeded";
|
|
27
|
+
failed: "failed";
|
|
28
|
+
}>;
|
|
29
|
+
model: z.ZodString;
|
|
30
|
+
startedAtMs: z.ZodNumber;
|
|
31
|
+
endedAtMs: z.ZodNumber;
|
|
32
|
+
inputTokens: z.ZodNumber;
|
|
33
|
+
outputTokens: z.ZodNumber;
|
|
34
|
+
cachedInputTokens: z.ZodNumber;
|
|
35
|
+
reasoningTokens: z.ZodNumber;
|
|
36
|
+
costUsdNanos: z.ZodNumber;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export declare const agentCandidateModelSettlementMaterialV1Schema: z.ZodObject<{
|
|
39
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
40
|
+
callId: z.ZodString;
|
|
41
|
+
traceSpanId: z.ZodString;
|
|
42
|
+
model: z.ZodString;
|
|
43
|
+
inputTokens: z.ZodNumber;
|
|
44
|
+
outputTokens: z.ZodNumber;
|
|
45
|
+
cachedInputTokens: z.ZodNumber;
|
|
46
|
+
reasoningTokens: z.ZodNumber;
|
|
47
|
+
costUsdNanos: z.ZodNumber;
|
|
48
|
+
}, z.core.$strict>>;
|
|
23
49
|
kind: z.ZodLiteral<"agent-candidate-model-settlement-material">;
|
|
24
50
|
executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
25
51
|
preparationId: z.ZodString;
|
|
@@ -40,16 +66,54 @@ export declare const agentCandidateModelSettlementMaterialSchema: z.ZodObject<{
|
|
|
40
66
|
ultracode: "ultracode";
|
|
41
67
|
}>;
|
|
42
68
|
}, z.core.$strict>;
|
|
69
|
+
usage: z.ZodObject<{
|
|
70
|
+
inputTokens: z.ZodNumber;
|
|
71
|
+
outputTokens: z.ZodNumber;
|
|
72
|
+
cachedInputTokens: z.ZodNumber;
|
|
73
|
+
reasoningTokens: z.ZodNumber;
|
|
74
|
+
modelCalls: z.ZodNumber;
|
|
75
|
+
costUsdNanos: z.ZodNumber;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export declare const agentCandidateModelSettlementMaterialV2Schema: z.ZodObject<{
|
|
43
80
|
calls: z.ZodArray<z.ZodObject<{
|
|
44
81
|
callId: z.ZodString;
|
|
82
|
+
generationId: z.ZodString;
|
|
45
83
|
traceSpanId: z.ZodString;
|
|
84
|
+
status: z.ZodEnum<{
|
|
85
|
+
succeeded: "succeeded";
|
|
86
|
+
failed: "failed";
|
|
87
|
+
}>;
|
|
46
88
|
model: z.ZodString;
|
|
89
|
+
startedAtMs: z.ZodNumber;
|
|
90
|
+
endedAtMs: z.ZodNumber;
|
|
47
91
|
inputTokens: z.ZodNumber;
|
|
48
92
|
outputTokens: z.ZodNumber;
|
|
49
93
|
cachedInputTokens: z.ZodNumber;
|
|
50
94
|
reasoningTokens: z.ZodNumber;
|
|
51
95
|
costUsdNanos: z.ZodNumber;
|
|
52
96
|
}, z.core.$strict>>;
|
|
97
|
+
kind: z.ZodLiteral<"agent-candidate-model-settlement-material">;
|
|
98
|
+
executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
99
|
+
preparationId: z.ZodString;
|
|
100
|
+
grantDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
101
|
+
closed: z.ZodLiteral<true>;
|
|
102
|
+
resolved: z.ZodObject<{
|
|
103
|
+
requested: z.ZodString;
|
|
104
|
+
provider: z.ZodString;
|
|
105
|
+
model: z.ZodString;
|
|
106
|
+
snapshot: z.ZodString;
|
|
107
|
+
reasoningEffort: z.ZodEnum<{
|
|
108
|
+
none: "none";
|
|
109
|
+
minimal: "minimal";
|
|
110
|
+
low: "low";
|
|
111
|
+
medium: "medium";
|
|
112
|
+
high: "high";
|
|
113
|
+
xhigh: "xhigh";
|
|
114
|
+
ultracode: "ultracode";
|
|
115
|
+
}>;
|
|
116
|
+
}, z.core.$strict>;
|
|
53
117
|
usage: z.ZodObject<{
|
|
54
118
|
inputTokens: z.ZodNumber;
|
|
55
119
|
outputTokens: z.ZodNumber;
|
|
@@ -58,13 +122,111 @@ export declare const agentCandidateModelSettlementMaterialSchema: z.ZodObject<{
|
|
|
58
122
|
modelCalls: z.ZodNumber;
|
|
59
123
|
costUsdNanos: z.ZodNumber;
|
|
60
124
|
}, z.core.$strict>;
|
|
125
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
61
126
|
}, z.core.$strict>;
|
|
127
|
+
export declare const agentCandidateModelSettlementMaterialSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
128
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
129
|
+
callId: z.ZodString;
|
|
130
|
+
traceSpanId: z.ZodString;
|
|
131
|
+
model: z.ZodString;
|
|
132
|
+
inputTokens: z.ZodNumber;
|
|
133
|
+
outputTokens: z.ZodNumber;
|
|
134
|
+
cachedInputTokens: z.ZodNumber;
|
|
135
|
+
reasoningTokens: z.ZodNumber;
|
|
136
|
+
costUsdNanos: z.ZodNumber;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
kind: z.ZodLiteral<"agent-candidate-model-settlement-material">;
|
|
139
|
+
executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
140
|
+
preparationId: z.ZodString;
|
|
141
|
+
grantDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
142
|
+
closed: z.ZodLiteral<true>;
|
|
143
|
+
resolved: z.ZodObject<{
|
|
144
|
+
requested: z.ZodString;
|
|
145
|
+
provider: z.ZodString;
|
|
146
|
+
model: z.ZodString;
|
|
147
|
+
snapshot: z.ZodString;
|
|
148
|
+
reasoningEffort: z.ZodEnum<{
|
|
149
|
+
none: "none";
|
|
150
|
+
minimal: "minimal";
|
|
151
|
+
low: "low";
|
|
152
|
+
medium: "medium";
|
|
153
|
+
high: "high";
|
|
154
|
+
xhigh: "xhigh";
|
|
155
|
+
ultracode: "ultracode";
|
|
156
|
+
}>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
usage: z.ZodObject<{
|
|
159
|
+
inputTokens: z.ZodNumber;
|
|
160
|
+
outputTokens: z.ZodNumber;
|
|
161
|
+
cachedInputTokens: z.ZodNumber;
|
|
162
|
+
reasoningTokens: z.ZodNumber;
|
|
163
|
+
modelCalls: z.ZodNumber;
|
|
164
|
+
costUsdNanos: z.ZodNumber;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
167
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
168
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
169
|
+
callId: z.ZodString;
|
|
170
|
+
generationId: z.ZodString;
|
|
171
|
+
traceSpanId: z.ZodString;
|
|
172
|
+
status: z.ZodEnum<{
|
|
173
|
+
succeeded: "succeeded";
|
|
174
|
+
failed: "failed";
|
|
175
|
+
}>;
|
|
176
|
+
model: z.ZodString;
|
|
177
|
+
startedAtMs: z.ZodNumber;
|
|
178
|
+
endedAtMs: z.ZodNumber;
|
|
179
|
+
inputTokens: z.ZodNumber;
|
|
180
|
+
outputTokens: z.ZodNumber;
|
|
181
|
+
cachedInputTokens: z.ZodNumber;
|
|
182
|
+
reasoningTokens: z.ZodNumber;
|
|
183
|
+
costUsdNanos: z.ZodNumber;
|
|
184
|
+
}, z.core.$strict>>;
|
|
185
|
+
kind: z.ZodLiteral<"agent-candidate-model-settlement-material">;
|
|
186
|
+
executionPlanDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
187
|
+
preparationId: z.ZodString;
|
|
188
|
+
grantDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
189
|
+
closed: z.ZodLiteral<true>;
|
|
190
|
+
resolved: z.ZodObject<{
|
|
191
|
+
requested: z.ZodString;
|
|
192
|
+
provider: z.ZodString;
|
|
193
|
+
model: z.ZodString;
|
|
194
|
+
snapshot: z.ZodString;
|
|
195
|
+
reasoningEffort: z.ZodEnum<{
|
|
196
|
+
none: "none";
|
|
197
|
+
minimal: "minimal";
|
|
198
|
+
low: "low";
|
|
199
|
+
medium: "medium";
|
|
200
|
+
high: "high";
|
|
201
|
+
xhigh: "xhigh";
|
|
202
|
+
ultracode: "ultracode";
|
|
203
|
+
}>;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
usage: z.ZodObject<{
|
|
206
|
+
inputTokens: z.ZodNumber;
|
|
207
|
+
outputTokens: z.ZodNumber;
|
|
208
|
+
cachedInputTokens: z.ZodNumber;
|
|
209
|
+
reasoningTokens: z.ZodNumber;
|
|
210
|
+
modelCalls: z.ZodNumber;
|
|
211
|
+
costUsdNanos: z.ZodNumber;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
schemaVersion: z.ZodLiteral<2>;
|
|
214
|
+
}, z.core.$strict>]>;
|
|
62
215
|
export declare const agentCandidateModelSettlementEvidenceSchema: z.ZodObject<{
|
|
63
216
|
schemaVersion: z.ZodLiteral<1>;
|
|
64
217
|
kind: z.ZodLiteral<"agent-candidate-model-settlement">;
|
|
65
218
|
digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
66
219
|
material: z.ZodType<{
|
|
67
|
-
|
|
220
|
+
calls: {
|
|
221
|
+
callId: string;
|
|
222
|
+
traceSpanId: string;
|
|
223
|
+
model: string;
|
|
224
|
+
inputTokens: number;
|
|
225
|
+
outputTokens: number;
|
|
226
|
+
cachedInputTokens: number;
|
|
227
|
+
reasoningTokens: number;
|
|
228
|
+
costUsdNanos: number;
|
|
229
|
+
}[];
|
|
68
230
|
kind: "agent-candidate-model-settlement-material";
|
|
69
231
|
executionPlanDigest: `sha256:${string}`;
|
|
70
232
|
preparationId: string;
|
|
@@ -77,16 +239,42 @@ export declare const agentCandidateModelSettlementEvidenceSchema: z.ZodObject<{
|
|
|
77
239
|
snapshot: string;
|
|
78
240
|
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
79
241
|
};
|
|
242
|
+
usage: {
|
|
243
|
+
inputTokens: number;
|
|
244
|
+
outputTokens: number;
|
|
245
|
+
cachedInputTokens: number;
|
|
246
|
+
reasoningTokens: number;
|
|
247
|
+
modelCalls: number;
|
|
248
|
+
costUsdNanos: number;
|
|
249
|
+
};
|
|
250
|
+
schemaVersion: 1;
|
|
251
|
+
} | {
|
|
80
252
|
calls: {
|
|
81
253
|
callId: string;
|
|
254
|
+
generationId: string;
|
|
82
255
|
traceSpanId: string;
|
|
256
|
+
status: "succeeded" | "failed";
|
|
83
257
|
model: string;
|
|
258
|
+
startedAtMs: number;
|
|
259
|
+
endedAtMs: number;
|
|
84
260
|
inputTokens: number;
|
|
85
261
|
outputTokens: number;
|
|
86
262
|
cachedInputTokens: number;
|
|
87
263
|
reasoningTokens: number;
|
|
88
264
|
costUsdNanos: number;
|
|
89
265
|
}[];
|
|
266
|
+
kind: "agent-candidate-model-settlement-material";
|
|
267
|
+
executionPlanDigest: `sha256:${string}`;
|
|
268
|
+
preparationId: string;
|
|
269
|
+
grantDigest: `sha256:${string}`;
|
|
270
|
+
closed: true;
|
|
271
|
+
resolved: {
|
|
272
|
+
requested: string;
|
|
273
|
+
provider: string;
|
|
274
|
+
model: string;
|
|
275
|
+
snapshot: string;
|
|
276
|
+
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
277
|
+
};
|
|
90
278
|
usage: {
|
|
91
279
|
inputTokens: number;
|
|
92
280
|
outputTokens: number;
|
|
@@ -95,8 +283,18 @@ export declare const agentCandidateModelSettlementEvidenceSchema: z.ZodObject<{
|
|
|
95
283
|
modelCalls: number;
|
|
96
284
|
costUsdNanos: number;
|
|
97
285
|
};
|
|
286
|
+
schemaVersion: 2;
|
|
98
287
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
99
|
-
|
|
288
|
+
calls: {
|
|
289
|
+
callId: string;
|
|
290
|
+
traceSpanId: string;
|
|
291
|
+
model: string;
|
|
292
|
+
inputTokens: number;
|
|
293
|
+
outputTokens: number;
|
|
294
|
+
cachedInputTokens: number;
|
|
295
|
+
reasoningTokens: number;
|
|
296
|
+
costUsdNanos: number;
|
|
297
|
+
}[];
|
|
100
298
|
kind: "agent-candidate-model-settlement-material";
|
|
101
299
|
executionPlanDigest: `sha256:${string}`;
|
|
102
300
|
preparationId: string;
|
|
@@ -109,16 +307,42 @@ export declare const agentCandidateModelSettlementEvidenceSchema: z.ZodObject<{
|
|
|
109
307
|
snapshot: string;
|
|
110
308
|
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
111
309
|
};
|
|
310
|
+
usage: {
|
|
311
|
+
inputTokens: number;
|
|
312
|
+
outputTokens: number;
|
|
313
|
+
cachedInputTokens: number;
|
|
314
|
+
reasoningTokens: number;
|
|
315
|
+
modelCalls: number;
|
|
316
|
+
costUsdNanos: number;
|
|
317
|
+
};
|
|
318
|
+
schemaVersion: 1;
|
|
319
|
+
} | {
|
|
112
320
|
calls: {
|
|
113
321
|
callId: string;
|
|
322
|
+
generationId: string;
|
|
114
323
|
traceSpanId: string;
|
|
324
|
+
status: "succeeded" | "failed";
|
|
115
325
|
model: string;
|
|
326
|
+
startedAtMs: number;
|
|
327
|
+
endedAtMs: number;
|
|
116
328
|
inputTokens: number;
|
|
117
329
|
outputTokens: number;
|
|
118
330
|
cachedInputTokens: number;
|
|
119
331
|
reasoningTokens: number;
|
|
120
332
|
costUsdNanos: number;
|
|
121
333
|
}[];
|
|
334
|
+
kind: "agent-candidate-model-settlement-material";
|
|
335
|
+
executionPlanDigest: `sha256:${string}`;
|
|
336
|
+
preparationId: string;
|
|
337
|
+
grantDigest: `sha256:${string}`;
|
|
338
|
+
closed: true;
|
|
339
|
+
resolved: {
|
|
340
|
+
requested: string;
|
|
341
|
+
provider: string;
|
|
342
|
+
model: string;
|
|
343
|
+
snapshot: string;
|
|
344
|
+
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
345
|
+
};
|
|
122
346
|
usage: {
|
|
123
347
|
inputTokens: number;
|
|
124
348
|
outputTokens: number;
|
|
@@ -127,6 +351,7 @@ export declare const agentCandidateModelSettlementEvidenceSchema: z.ZodObject<{
|
|
|
127
351
|
modelCalls: number;
|
|
128
352
|
costUsdNanos: number;
|
|
129
353
|
};
|
|
354
|
+
schemaVersion: 2;
|
|
130
355
|
}, unknown>>;
|
|
131
356
|
artifact: z.ZodUnion<readonly [z.ZodObject<{
|
|
132
357
|
locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -8,6 +8,7 @@ const safeCountSchema = z
|
|
|
8
8
|
.nonnegative()
|
|
9
9
|
.refine(Number.isSafeInteger, "value must be a nonnegative safe integer");
|
|
10
10
|
const boundedIdentifierSchema = z.string().min(1).max(256);
|
|
11
|
+
const positiveTimestampSchema = safeCountSchema.positive();
|
|
11
12
|
const normalizedDimensionNameSchema = z
|
|
12
13
|
.string()
|
|
13
14
|
.regex(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/, "dimension names must be normalized lowercase identifiers");
|
|
@@ -34,22 +35,71 @@ export const agentCandidateModelSettlementCallSchema = z
|
|
|
34
35
|
costUsdNanos: safeCountSchema,
|
|
35
36
|
})
|
|
36
37
|
.strict();
|
|
37
|
-
export const
|
|
38
|
+
export const agentCandidateModelSettlementCallV2Schema = z
|
|
38
39
|
.object({
|
|
39
|
-
|
|
40
|
+
callId: boundedIdentifierSchema,
|
|
41
|
+
generationId: boundedIdentifierSchema,
|
|
42
|
+
traceSpanId: boundedIdentifierSchema,
|
|
43
|
+
status: z.enum(["succeeded", "failed"]),
|
|
44
|
+
model: boundedIdentifierSchema,
|
|
45
|
+
startedAtMs: positiveTimestampSchema,
|
|
46
|
+
endedAtMs: positiveTimestampSchema,
|
|
47
|
+
inputTokens: safeCountSchema,
|
|
48
|
+
outputTokens: safeCountSchema,
|
|
49
|
+
cachedInputTokens: safeCountSchema,
|
|
50
|
+
reasoningTokens: safeCountSchema,
|
|
51
|
+
costUsdNanos: safeCountSchema,
|
|
52
|
+
})
|
|
53
|
+
.strict()
|
|
54
|
+
.superRefine((call, ctx) => {
|
|
55
|
+
if (call.traceSpanId !== call.generationId) {
|
|
56
|
+
ctx.addIssue({
|
|
57
|
+
code: "custom",
|
|
58
|
+
path: ["traceSpanId"],
|
|
59
|
+
message: "model settlement trace span id must equal the router generation id",
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (call.endedAtMs < call.startedAtMs) {
|
|
63
|
+
ctx.addIssue({
|
|
64
|
+
code: "custom",
|
|
65
|
+
path: ["endedAtMs"],
|
|
66
|
+
message: "model settlement call cannot end before it starts",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const modelSettlementMaterialShape = {
|
|
40
71
|
kind: z.literal("agent-candidate-model-settlement-material"),
|
|
41
72
|
executionPlanDigest: sha256DigestSchema,
|
|
42
73
|
preparationId: boundedIdentifierSchema,
|
|
43
74
|
grantDigest: sha256DigestSchema,
|
|
44
75
|
closed: z.literal(true),
|
|
45
76
|
resolved: agentCandidateResolvedModelSchema,
|
|
46
|
-
calls: z.array(agentCandidateModelSettlementCallSchema),
|
|
47
77
|
usage: agentCandidateFixedSpendSchema,
|
|
78
|
+
};
|
|
79
|
+
export const agentCandidateModelSettlementMaterialV1Schema = z
|
|
80
|
+
.object({
|
|
81
|
+
schemaVersion: z.literal(1),
|
|
82
|
+
...modelSettlementMaterialShape,
|
|
83
|
+
calls: z.array(agentCandidateModelSettlementCallSchema),
|
|
48
84
|
})
|
|
49
85
|
.strict()
|
|
50
|
-
.superRefine(
|
|
86
|
+
.superRefine(refineModelSettlementMaterial);
|
|
87
|
+
export const agentCandidateModelSettlementMaterialV2Schema = z
|
|
88
|
+
.object({
|
|
89
|
+
schemaVersion: z.literal(2),
|
|
90
|
+
...modelSettlementMaterialShape,
|
|
91
|
+
calls: z.array(agentCandidateModelSettlementCallV2Schema),
|
|
92
|
+
})
|
|
93
|
+
.strict()
|
|
94
|
+
.superRefine(refineModelSettlementMaterial);
|
|
95
|
+
export const agentCandidateModelSettlementMaterialSchema = z.union([
|
|
96
|
+
agentCandidateModelSettlementMaterialV1Schema,
|
|
97
|
+
agentCandidateModelSettlementMaterialV2Schema,
|
|
98
|
+
]);
|
|
99
|
+
function refineModelSettlementMaterial(material, ctx) {
|
|
51
100
|
const callIds = new Set();
|
|
52
101
|
const traceSpanIds = new Set();
|
|
102
|
+
const generationIds = new Set();
|
|
53
103
|
const totals = {
|
|
54
104
|
inputTokens: 0,
|
|
55
105
|
outputTokens: 0,
|
|
@@ -75,6 +125,19 @@ export const agentCandidateModelSettlementMaterialSchema = z
|
|
|
75
125
|
});
|
|
76
126
|
}
|
|
77
127
|
traceSpanIds.add(call.traceSpanId);
|
|
128
|
+
const generationId = "generationId" in call && typeof call.generationId === "string"
|
|
129
|
+
? call.generationId
|
|
130
|
+
: undefined;
|
|
131
|
+
if (generationId !== undefined) {
|
|
132
|
+
if (generationIds.has(generationId)) {
|
|
133
|
+
ctx.addIssue({
|
|
134
|
+
code: "custom",
|
|
135
|
+
path: ["calls", index, "generationId"],
|
|
136
|
+
message: "model settlement generation ids must be unique",
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
generationIds.add(generationId);
|
|
140
|
+
}
|
|
78
141
|
if (call.model !== material.resolved.model) {
|
|
79
142
|
ctx.addIssue({
|
|
80
143
|
code: "custom",
|
|
@@ -115,7 +178,7 @@ export const agentCandidateModelSettlementMaterialSchema = z
|
|
|
115
178
|
message: "model settlement material must contain only RFC 8785 JSON values",
|
|
116
179
|
});
|
|
117
180
|
}
|
|
118
|
-
}
|
|
181
|
+
}
|
|
119
182
|
export const agentCandidateModelSettlementEvidenceSchema = evidenceSchema("agent-candidate-model-settlement", agentCandidateModelSettlementMaterialSchema, "model settlement");
|
|
120
183
|
export const agentCandidateRepositoryStateSchema = z
|
|
121
184
|
.object({
|
|
@@ -319,6 +319,12 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
|
|
|
319
319
|
access: {
|
|
320
320
|
kind: "evaluator-mediated";
|
|
321
321
|
grantDigest: `sha256:${string}`;
|
|
322
|
+
network: {
|
|
323
|
+
mode: "disabled";
|
|
324
|
+
} | {
|
|
325
|
+
mode: "gateway-only";
|
|
326
|
+
domains: string[];
|
|
327
|
+
};
|
|
322
328
|
};
|
|
323
329
|
routes: ({
|
|
324
330
|
kind: "primary";
|
|
@@ -624,6 +630,12 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
|
|
|
624
630
|
access: {
|
|
625
631
|
kind: "evaluator-mediated";
|
|
626
632
|
grantDigest: `sha256:${string}`;
|
|
633
|
+
network: {
|
|
634
|
+
mode: "disabled";
|
|
635
|
+
} | {
|
|
636
|
+
mode: "gateway-only";
|
|
637
|
+
domains: string[];
|
|
638
|
+
};
|
|
627
639
|
};
|
|
628
640
|
routes: ({
|
|
629
641
|
kind: "primary";
|
|
@@ -1228,7 +1240,16 @@ export declare const agentCandidateRunReceiptV2Schema: z.ZodObject<{
|
|
|
1228
1240
|
kind: z.ZodLiteral<"agent-candidate-model-settlement">;
|
|
1229
1241
|
digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
1230
1242
|
material: z.ZodType<{
|
|
1231
|
-
|
|
1243
|
+
calls: {
|
|
1244
|
+
callId: string;
|
|
1245
|
+
traceSpanId: string;
|
|
1246
|
+
model: string;
|
|
1247
|
+
inputTokens: number;
|
|
1248
|
+
outputTokens: number;
|
|
1249
|
+
cachedInputTokens: number;
|
|
1250
|
+
reasoningTokens: number;
|
|
1251
|
+
costUsdNanos: number;
|
|
1252
|
+
}[];
|
|
1232
1253
|
kind: "agent-candidate-model-settlement-material";
|
|
1233
1254
|
executionPlanDigest: `sha256:${string}`;
|
|
1234
1255
|
preparationId: string;
|
|
@@ -1241,16 +1262,42 @@ export declare const agentCandidateRunReceiptV2Schema: z.ZodObject<{
|
|
|
1241
1262
|
snapshot: string;
|
|
1242
1263
|
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
1243
1264
|
};
|
|
1265
|
+
usage: {
|
|
1266
|
+
inputTokens: number;
|
|
1267
|
+
outputTokens: number;
|
|
1268
|
+
cachedInputTokens: number;
|
|
1269
|
+
reasoningTokens: number;
|
|
1270
|
+
modelCalls: number;
|
|
1271
|
+
costUsdNanos: number;
|
|
1272
|
+
};
|
|
1273
|
+
schemaVersion: 1;
|
|
1274
|
+
} | {
|
|
1244
1275
|
calls: {
|
|
1245
1276
|
callId: string;
|
|
1277
|
+
generationId: string;
|
|
1246
1278
|
traceSpanId: string;
|
|
1279
|
+
status: "succeeded" | "failed";
|
|
1247
1280
|
model: string;
|
|
1281
|
+
startedAtMs: number;
|
|
1282
|
+
endedAtMs: number;
|
|
1248
1283
|
inputTokens: number;
|
|
1249
1284
|
outputTokens: number;
|
|
1250
1285
|
cachedInputTokens: number;
|
|
1251
1286
|
reasoningTokens: number;
|
|
1252
1287
|
costUsdNanos: number;
|
|
1253
1288
|
}[];
|
|
1289
|
+
kind: "agent-candidate-model-settlement-material";
|
|
1290
|
+
executionPlanDigest: `sha256:${string}`;
|
|
1291
|
+
preparationId: string;
|
|
1292
|
+
grantDigest: `sha256:${string}`;
|
|
1293
|
+
closed: true;
|
|
1294
|
+
resolved: {
|
|
1295
|
+
requested: string;
|
|
1296
|
+
provider: string;
|
|
1297
|
+
model: string;
|
|
1298
|
+
snapshot: string;
|
|
1299
|
+
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
1300
|
+
};
|
|
1254
1301
|
usage: {
|
|
1255
1302
|
inputTokens: number;
|
|
1256
1303
|
outputTokens: number;
|
|
@@ -1259,8 +1306,18 @@ export declare const agentCandidateRunReceiptV2Schema: z.ZodObject<{
|
|
|
1259
1306
|
modelCalls: number;
|
|
1260
1307
|
costUsdNanos: number;
|
|
1261
1308
|
};
|
|
1309
|
+
schemaVersion: 2;
|
|
1262
1310
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
1263
|
-
|
|
1311
|
+
calls: {
|
|
1312
|
+
callId: string;
|
|
1313
|
+
traceSpanId: string;
|
|
1314
|
+
model: string;
|
|
1315
|
+
inputTokens: number;
|
|
1316
|
+
outputTokens: number;
|
|
1317
|
+
cachedInputTokens: number;
|
|
1318
|
+
reasoningTokens: number;
|
|
1319
|
+
costUsdNanos: number;
|
|
1320
|
+
}[];
|
|
1264
1321
|
kind: "agent-candidate-model-settlement-material";
|
|
1265
1322
|
executionPlanDigest: `sha256:${string}`;
|
|
1266
1323
|
preparationId: string;
|
|
@@ -1273,16 +1330,42 @@ export declare const agentCandidateRunReceiptV2Schema: z.ZodObject<{
|
|
|
1273
1330
|
snapshot: string;
|
|
1274
1331
|
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
1275
1332
|
};
|
|
1333
|
+
usage: {
|
|
1334
|
+
inputTokens: number;
|
|
1335
|
+
outputTokens: number;
|
|
1336
|
+
cachedInputTokens: number;
|
|
1337
|
+
reasoningTokens: number;
|
|
1338
|
+
modelCalls: number;
|
|
1339
|
+
costUsdNanos: number;
|
|
1340
|
+
};
|
|
1341
|
+
schemaVersion: 1;
|
|
1342
|
+
} | {
|
|
1276
1343
|
calls: {
|
|
1277
1344
|
callId: string;
|
|
1345
|
+
generationId: string;
|
|
1278
1346
|
traceSpanId: string;
|
|
1347
|
+
status: "succeeded" | "failed";
|
|
1279
1348
|
model: string;
|
|
1349
|
+
startedAtMs: number;
|
|
1350
|
+
endedAtMs: number;
|
|
1280
1351
|
inputTokens: number;
|
|
1281
1352
|
outputTokens: number;
|
|
1282
1353
|
cachedInputTokens: number;
|
|
1283
1354
|
reasoningTokens: number;
|
|
1284
1355
|
costUsdNanos: number;
|
|
1285
1356
|
}[];
|
|
1357
|
+
kind: "agent-candidate-model-settlement-material";
|
|
1358
|
+
executionPlanDigest: `sha256:${string}`;
|
|
1359
|
+
preparationId: string;
|
|
1360
|
+
grantDigest: `sha256:${string}`;
|
|
1361
|
+
closed: true;
|
|
1362
|
+
resolved: {
|
|
1363
|
+
requested: string;
|
|
1364
|
+
provider: string;
|
|
1365
|
+
model: string;
|
|
1366
|
+
snapshot: string;
|
|
1367
|
+
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
1368
|
+
};
|
|
1286
1369
|
usage: {
|
|
1287
1370
|
inputTokens: number;
|
|
1288
1371
|
outputTokens: number;
|
|
@@ -1291,6 +1374,7 @@ export declare const agentCandidateRunReceiptV2Schema: z.ZodObject<{
|
|
|
1291
1374
|
modelCalls: number;
|
|
1292
1375
|
costUsdNanos: number;
|
|
1293
1376
|
};
|
|
1377
|
+
schemaVersion: 2;
|
|
1294
1378
|
}, unknown>>;
|
|
1295
1379
|
artifact: z.ZodUnion<readonly [z.ZodObject<{
|
|
1296
1380
|
locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -2060,7 +2144,16 @@ export declare const agentCandidateRunReceiptAnyVersionSchema: z.ZodUnion<readon
|
|
|
2060
2144
|
kind: z.ZodLiteral<"agent-candidate-model-settlement">;
|
|
2061
2145
|
digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
2062
2146
|
material: z.ZodType<{
|
|
2063
|
-
|
|
2147
|
+
calls: {
|
|
2148
|
+
callId: string;
|
|
2149
|
+
traceSpanId: string;
|
|
2150
|
+
model: string;
|
|
2151
|
+
inputTokens: number;
|
|
2152
|
+
outputTokens: number;
|
|
2153
|
+
cachedInputTokens: number;
|
|
2154
|
+
reasoningTokens: number;
|
|
2155
|
+
costUsdNanos: number;
|
|
2156
|
+
}[];
|
|
2064
2157
|
kind: "agent-candidate-model-settlement-material";
|
|
2065
2158
|
executionPlanDigest: `sha256:${string}`;
|
|
2066
2159
|
preparationId: string;
|
|
@@ -2073,16 +2166,42 @@ export declare const agentCandidateRunReceiptAnyVersionSchema: z.ZodUnion<readon
|
|
|
2073
2166
|
snapshot: string;
|
|
2074
2167
|
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
2075
2168
|
};
|
|
2169
|
+
usage: {
|
|
2170
|
+
inputTokens: number;
|
|
2171
|
+
outputTokens: number;
|
|
2172
|
+
cachedInputTokens: number;
|
|
2173
|
+
reasoningTokens: number;
|
|
2174
|
+
modelCalls: number;
|
|
2175
|
+
costUsdNanos: number;
|
|
2176
|
+
};
|
|
2177
|
+
schemaVersion: 1;
|
|
2178
|
+
} | {
|
|
2076
2179
|
calls: {
|
|
2077
2180
|
callId: string;
|
|
2181
|
+
generationId: string;
|
|
2078
2182
|
traceSpanId: string;
|
|
2183
|
+
status: "succeeded" | "failed";
|
|
2079
2184
|
model: string;
|
|
2185
|
+
startedAtMs: number;
|
|
2186
|
+
endedAtMs: number;
|
|
2080
2187
|
inputTokens: number;
|
|
2081
2188
|
outputTokens: number;
|
|
2082
2189
|
cachedInputTokens: number;
|
|
2083
2190
|
reasoningTokens: number;
|
|
2084
2191
|
costUsdNanos: number;
|
|
2085
2192
|
}[];
|
|
2193
|
+
kind: "agent-candidate-model-settlement-material";
|
|
2194
|
+
executionPlanDigest: `sha256:${string}`;
|
|
2195
|
+
preparationId: string;
|
|
2196
|
+
grantDigest: `sha256:${string}`;
|
|
2197
|
+
closed: true;
|
|
2198
|
+
resolved: {
|
|
2199
|
+
requested: string;
|
|
2200
|
+
provider: string;
|
|
2201
|
+
model: string;
|
|
2202
|
+
snapshot: string;
|
|
2203
|
+
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
2204
|
+
};
|
|
2086
2205
|
usage: {
|
|
2087
2206
|
inputTokens: number;
|
|
2088
2207
|
outputTokens: number;
|
|
@@ -2091,8 +2210,18 @@ export declare const agentCandidateRunReceiptAnyVersionSchema: z.ZodUnion<readon
|
|
|
2091
2210
|
modelCalls: number;
|
|
2092
2211
|
costUsdNanos: number;
|
|
2093
2212
|
};
|
|
2213
|
+
schemaVersion: 2;
|
|
2094
2214
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
2095
|
-
|
|
2215
|
+
calls: {
|
|
2216
|
+
callId: string;
|
|
2217
|
+
traceSpanId: string;
|
|
2218
|
+
model: string;
|
|
2219
|
+
inputTokens: number;
|
|
2220
|
+
outputTokens: number;
|
|
2221
|
+
cachedInputTokens: number;
|
|
2222
|
+
reasoningTokens: number;
|
|
2223
|
+
costUsdNanos: number;
|
|
2224
|
+
}[];
|
|
2096
2225
|
kind: "agent-candidate-model-settlement-material";
|
|
2097
2226
|
executionPlanDigest: `sha256:${string}`;
|
|
2098
2227
|
preparationId: string;
|
|
@@ -2105,16 +2234,42 @@ export declare const agentCandidateRunReceiptAnyVersionSchema: z.ZodUnion<readon
|
|
|
2105
2234
|
snapshot: string;
|
|
2106
2235
|
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
2107
2236
|
};
|
|
2237
|
+
usage: {
|
|
2238
|
+
inputTokens: number;
|
|
2239
|
+
outputTokens: number;
|
|
2240
|
+
cachedInputTokens: number;
|
|
2241
|
+
reasoningTokens: number;
|
|
2242
|
+
modelCalls: number;
|
|
2243
|
+
costUsdNanos: number;
|
|
2244
|
+
};
|
|
2245
|
+
schemaVersion: 1;
|
|
2246
|
+
} | {
|
|
2108
2247
|
calls: {
|
|
2109
2248
|
callId: string;
|
|
2249
|
+
generationId: string;
|
|
2110
2250
|
traceSpanId: string;
|
|
2251
|
+
status: "succeeded" | "failed";
|
|
2111
2252
|
model: string;
|
|
2253
|
+
startedAtMs: number;
|
|
2254
|
+
endedAtMs: number;
|
|
2112
2255
|
inputTokens: number;
|
|
2113
2256
|
outputTokens: number;
|
|
2114
2257
|
cachedInputTokens: number;
|
|
2115
2258
|
reasoningTokens: number;
|
|
2116
2259
|
costUsdNanos: number;
|
|
2117
2260
|
}[];
|
|
2261
|
+
kind: "agent-candidate-model-settlement-material";
|
|
2262
|
+
executionPlanDigest: `sha256:${string}`;
|
|
2263
|
+
preparationId: string;
|
|
2264
|
+
grantDigest: `sha256:${string}`;
|
|
2265
|
+
closed: true;
|
|
2266
|
+
resolved: {
|
|
2267
|
+
requested: string;
|
|
2268
|
+
provider: string;
|
|
2269
|
+
model: string;
|
|
2270
|
+
snapshot: string;
|
|
2271
|
+
reasoningEffort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "ultracode";
|
|
2272
|
+
};
|
|
2118
2273
|
usage: {
|
|
2119
2274
|
inputTokens: number;
|
|
2120
2275
|
outputTokens: number;
|
|
@@ -2123,6 +2278,7 @@ export declare const agentCandidateRunReceiptAnyVersionSchema: z.ZodUnion<readon
|
|
|
2123
2278
|
modelCalls: number;
|
|
2124
2279
|
costUsdNanos: number;
|
|
2125
2280
|
};
|
|
2281
|
+
schemaVersion: 2;
|
|
2126
2282
|
}, unknown>>;
|
|
2127
2283
|
artifact: z.ZodUnion<readonly [z.ZodObject<{
|
|
2128
2284
|
locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -352,6 +352,13 @@ export interface AgentCandidateProfileApplication {
|
|
|
352
352
|
targetWorkspace: AgentCandidateWorkingDirectory["workspace"];
|
|
353
353
|
mountPaths: string[];
|
|
354
354
|
}
|
|
355
|
+
/** Evaluator-owned network exception for the one frozen model gateway. */
|
|
356
|
+
export type AgentCandidateModelAccessNetwork = {
|
|
357
|
+
mode: "disabled";
|
|
358
|
+
} | {
|
|
359
|
+
mode: "gateway-only";
|
|
360
|
+
domains: string[];
|
|
361
|
+
};
|
|
355
362
|
/**
|
|
356
363
|
* Canonical, digest-free per-task execution identity document.
|
|
357
364
|
*
|
|
@@ -405,6 +412,7 @@ export interface AgentCandidateExecutionPlanMaterialV1 {
|
|
|
405
412
|
access: {
|
|
406
413
|
kind: "evaluator-mediated";
|
|
407
414
|
grantDigest: Sha256Digest;
|
|
415
|
+
network: AgentCandidateModelAccessNetwork;
|
|
408
416
|
};
|
|
409
417
|
routes: Array<{
|
|
410
418
|
kind: "primary";
|
|
@@ -534,6 +542,13 @@ export interface AgentCandidateModelSettlementCall {
|
|
|
534
542
|
reasoningTokens: number;
|
|
535
543
|
costUsdNanos: number;
|
|
536
544
|
}
|
|
545
|
+
/** Router-authored call identity, timing, and terminal status. */
|
|
546
|
+
export interface AgentCandidateModelSettlementCallV2 extends AgentCandidateModelSettlementCall {
|
|
547
|
+
generationId: string;
|
|
548
|
+
status: "succeeded" | "failed";
|
|
549
|
+
startedAtMs: number;
|
|
550
|
+
endedAtMs: number;
|
|
551
|
+
}
|
|
537
552
|
/** Canonical model-access ledger after the evaluator has revoked the grant. */
|
|
538
553
|
export interface AgentCandidateModelSettlementMaterialV1 {
|
|
539
554
|
schemaVersion: 1;
|
|
@@ -546,11 +561,24 @@ export interface AgentCandidateModelSettlementMaterialV1 {
|
|
|
546
561
|
calls: AgentCandidateModelSettlementCall[];
|
|
547
562
|
usage: AgentCandidateFixedSpend;
|
|
548
563
|
}
|
|
564
|
+
/** Canonical ledger whose LLM spans can be reproduced only from router facts. */
|
|
565
|
+
export interface AgentCandidateModelSettlementMaterialV2 {
|
|
566
|
+
schemaVersion: 2;
|
|
567
|
+
kind: "agent-candidate-model-settlement-material";
|
|
568
|
+
executionPlanDigest: Sha256Digest;
|
|
569
|
+
preparationId: string;
|
|
570
|
+
grantDigest: Sha256Digest;
|
|
571
|
+
closed: true;
|
|
572
|
+
resolved: AgentCandidateResolvedModel;
|
|
573
|
+
calls: AgentCandidateModelSettlementCallV2[];
|
|
574
|
+
usage: AgentCandidateFixedSpend;
|
|
575
|
+
}
|
|
576
|
+
export type AgentCandidateModelSettlementMaterial = AgentCandidateModelSettlementMaterialV1 | AgentCandidateModelSettlementMaterialV2;
|
|
549
577
|
export interface AgentCandidateModelSettlementEvidence {
|
|
550
578
|
schemaVersion: 1;
|
|
551
579
|
kind: "agent-candidate-model-settlement";
|
|
552
580
|
digest: Sha256Digest;
|
|
553
|
-
material:
|
|
581
|
+
material: AgentCandidateModelSettlementMaterial;
|
|
554
582
|
artifact: AgentCandidateCapturedArtifact;
|
|
555
583
|
}
|
|
556
584
|
/** Git identity before or after a task execution. */
|