@kindgi/client 0.1.3 → 0.1.4-rc.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/index.cjs +210 -0
- package/dist/index.d.cts +1723 -118
- package/dist/index.d.ts +1723 -118
- package/dist/index.js +210 -0
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -218,8 +218,54 @@ export interface Page<T> {
|
|
|
218
218
|
* The brand prevents mixing free-form strings with validated semver values.
|
|
219
219
|
*/
|
|
220
220
|
export type Semver = Brand<string, "Semver">;
|
|
221
|
+
/**
|
|
222
|
+
* Why the runtime registered a version of an agent or flow under another
|
|
223
|
+
* number than its definition names. Versions never change, so a deploy
|
|
224
|
+
* whose definition's version is registered already with other content
|
|
225
|
+
* registers the next free version in its line instead:
|
|
226
|
+
*
|
|
227
|
+
* - `pins-changed`: the definition's version is registered with other
|
|
228
|
+
* pins (a block it uses has a new version);
|
|
229
|
+
* - `unpinned`: the definition's version was published before pins
|
|
230
|
+
* existed, so it has none;
|
|
231
|
+
* - `version-taken`: the definition's version holds another definition;
|
|
232
|
+
* - `edited`: derived from an existing version with some data-block pins
|
|
233
|
+
* swapped (an expert's edit), not from a definition at all.
|
|
234
|
+
*/
|
|
235
|
+
export type VersionDerivationReason = "pins-changed" | "unpinned" | "version-taken" | "edited";
|
|
236
|
+
/** The version a version was registered in place of (or derived from), and why. */
|
|
237
|
+
export interface VersionDerivation {
|
|
238
|
+
/** The version the definition names, or the one an edit derived from. */
|
|
239
|
+
readonly version: string;
|
|
240
|
+
readonly reason: VersionDerivationReason;
|
|
241
|
+
/** For an edit: a short label for the version (e.g. "warmer tone"). */
|
|
242
|
+
readonly label?: string;
|
|
243
|
+
/** For an edit: who made it (`user:<id>`, or the token for a key). */
|
|
244
|
+
readonly by?: string;
|
|
245
|
+
}
|
|
221
246
|
/** Terminal states are `completed`, `failed`, `cancelled`. */
|
|
222
247
|
export type RunStatus = "pending" | "running" | "suspended" | "completed" | "failed" | "cancelled";
|
|
248
|
+
/**
|
|
249
|
+
* The exact version of each block a flow version runs: its lockfile.
|
|
250
|
+
*
|
|
251
|
+
* A flow names its tools by id (a tool node's `ref`, a fanout branch's
|
|
252
|
+
* `handler`) and its agents by id, with an exact `config.version` or
|
|
253
|
+
* none. When a version of the flow is published, the runtime pins each
|
|
254
|
+
* tool, and each agent that names no version, to its latest version
|
|
255
|
+
* then, and every run of that flow version uses those versions. So a
|
|
256
|
+
* new tool or agent version reaches the flow only through a new flow
|
|
257
|
+
* version.
|
|
258
|
+
*
|
|
259
|
+
* Set by the runtime at publish, never authored. A flow version
|
|
260
|
+
* published before pins existed has none and binds the latest versions
|
|
261
|
+
* per run.
|
|
262
|
+
*/
|
|
263
|
+
export interface FlowPins {
|
|
264
|
+
/** Tool id → the exact version this flow version runs. */
|
|
265
|
+
readonly tools: Readonly<Record<string, string>>;
|
|
266
|
+
/** Agent id → the exact version its agent nodes that name none run. */
|
|
267
|
+
readonly agents: Readonly<Record<string, string>>;
|
|
268
|
+
}
|
|
223
269
|
/**
|
|
224
270
|
* A path into the run's addressable state. Dot-separated segments, always
|
|
225
271
|
* starting with a recognized root. Path syntax is deliberately narrow — no
|
|
@@ -928,6 +974,20 @@ export interface Flow {
|
|
|
928
974
|
* `$end` edge (the lowest-id taken one when several fire).
|
|
929
975
|
*/
|
|
930
976
|
readonly output?: FlowOutputSpec;
|
|
977
|
+
/**
|
|
978
|
+
* The exact tool and agent versions this flow version runs, resolved by
|
|
979
|
+
* the runtime when the version was published (see `FlowPins`). Never
|
|
980
|
+
* authored: `loadFlow` refuses it. Absent on a flow version published
|
|
981
|
+
* before pins existed; it binds the latest versions per run.
|
|
982
|
+
*/
|
|
983
|
+
readonly pins?: FlowPins;
|
|
984
|
+
/** `flowPinsDigest(pins)`, recorded when the version was published. */
|
|
985
|
+
readonly pinsDigest?: string;
|
|
986
|
+
/**
|
|
987
|
+
* Set by the runtime on a version a deploy registered under another
|
|
988
|
+
* number than the definition's (see `VersionDerivation`). Never authored.
|
|
989
|
+
*/
|
|
990
|
+
readonly derivedFrom?: VersionDerivation;
|
|
931
991
|
}
|
|
932
992
|
/**
|
|
933
993
|
* A flow's declared output: what the run returns, built from the
|
|
@@ -1172,6 +1232,29 @@ export interface ToolHitlRule {
|
|
|
1172
1232
|
readonly mode: ToolHitlMode;
|
|
1173
1233
|
readonly requiredRole?: ReviewerRole;
|
|
1174
1234
|
}
|
|
1235
|
+
/**
|
|
1236
|
+
* The exact version of each block an agent version runs: its lockfile.
|
|
1237
|
+
*
|
|
1238
|
+
* An agent names its tools by range (`{ id: 'acme.lookup', version:
|
|
1239
|
+
* '^1.0.0' }`), like `package.json`. When a version of the agent is
|
|
1240
|
+
* published, the runtime resolves each range once, and every run of that
|
|
1241
|
+
* version uses the versions recorded here. So a new tool version reaches
|
|
1242
|
+
* an agent only through a new agent version, and two runs of one agent
|
|
1243
|
+
* version always run the same blocks.
|
|
1244
|
+
*
|
|
1245
|
+
* Set by the runtime at publish, never authored. A version published
|
|
1246
|
+
* before pins existed has none and resolves its ranges per run.
|
|
1247
|
+
*/
|
|
1248
|
+
export interface AgentPins {
|
|
1249
|
+
/** Tool id → the exact version this agent version runs. */
|
|
1250
|
+
readonly tools: Readonly<Record<string, string>>;
|
|
1251
|
+
/** Prompt block id → exact version. Empty until the agent references prompt blocks. */
|
|
1252
|
+
readonly prompts: Readonly<Record<string, string>>;
|
|
1253
|
+
/** Settings block id → exact version. Empty until the agent references settings blocks. */
|
|
1254
|
+
readonly settings: Readonly<Record<string, string>>;
|
|
1255
|
+
}
|
|
1256
|
+
/** The version an agent version was registered in place of, and why. */
|
|
1257
|
+
export type AgentDerivation = VersionDerivation;
|
|
1175
1258
|
type AgentId$1 = Brand<string, "AgentId">;
|
|
1176
1259
|
/**
|
|
1177
1260
|
* A single message inside a conversation. Persisted as a `Fact` in
|
|
@@ -1269,6 +1352,20 @@ export interface ToolRef {
|
|
|
1269
1352
|
readonly id: string;
|
|
1270
1353
|
readonly version: string;
|
|
1271
1354
|
}
|
|
1355
|
+
/**
|
|
1356
|
+
* A prompt block an agent's instructions come from: its id and a semver
|
|
1357
|
+
* range, resolved like a tool's (`pickVersion`) and pinned when the
|
|
1358
|
+
* agent version is published.
|
|
1359
|
+
*/
|
|
1360
|
+
export interface PromptRef {
|
|
1361
|
+
readonly prompt: string;
|
|
1362
|
+
readonly version: string;
|
|
1363
|
+
}
|
|
1364
|
+
/** A settings block an agent reads: its id and a semver range, pinned at publish. */
|
|
1365
|
+
export interface BlockRef {
|
|
1366
|
+
readonly id: string;
|
|
1367
|
+
readonly version: string;
|
|
1368
|
+
}
|
|
1272
1369
|
/**
|
|
1273
1370
|
* Per-agent behavior for multi-turn conversations. The agent chooses:
|
|
1274
1371
|
* - How many prior messages to load (`historyLimit`; unset = all).
|
|
@@ -1413,8 +1510,13 @@ export interface Agent {
|
|
|
1413
1510
|
* unresolved reference fails the turn at invoke time
|
|
1414
1511
|
* (`model-invocation-failed` whose `cause` is the `missing-parameter`
|
|
1415
1512
|
* render error), never a silent empty string.
|
|
1513
|
+
*
|
|
1514
|
+
* Or a prompt block, by range (`{ prompt: 'acme.intake-prompt',
|
|
1515
|
+
* version: '^1.0.0' }`): its template renders here instead, with the
|
|
1516
|
+
* parameters it declares, and the version that runs is pinned when the
|
|
1517
|
+
* agent version is published (`pins.prompts`).
|
|
1416
1518
|
*/
|
|
1417
|
-
readonly instructions: string;
|
|
1519
|
+
readonly instructions: string | PromptRef;
|
|
1418
1520
|
/**
|
|
1419
1521
|
* Typed parameters the caller supplies at invoke time. The UI reads
|
|
1420
1522
|
* this to build a "configure agent" form; the runtime validates each
|
|
@@ -1526,6 +1628,35 @@ export interface Agent {
|
|
|
1526
1628
|
* A tenant's `tool-errors` policy can lower it. See `ToolErrorsSpec`.
|
|
1527
1629
|
*/
|
|
1528
1630
|
readonly toolErrors?: ToolErrorsSpec;
|
|
1631
|
+
/**
|
|
1632
|
+
* The exact block versions this agent version runs, resolved by the
|
|
1633
|
+
* runtime when the version was published (see `AgentPins`). Never
|
|
1634
|
+
* authored: `defineAgent` doesn't take it. Absent on an agent defined
|
|
1635
|
+
* in code and on a version published before pins existed; its tool
|
|
1636
|
+
* ranges then resolve per run.
|
|
1637
|
+
*/
|
|
1638
|
+
readonly pins?: AgentPins;
|
|
1639
|
+
/**
|
|
1640
|
+
* Settings blocks the agent reads, by range. Each block's values reach
|
|
1641
|
+
* its tools as `ToolContext.settings[<block id>]` and its templates as
|
|
1642
|
+
* `settings.<block id>.<key>`; the versions are pinned at publish
|
|
1643
|
+
* (`pins.settings`).
|
|
1644
|
+
*/
|
|
1645
|
+
readonly settings?: readonly BlockRef[];
|
|
1646
|
+
/**
|
|
1647
|
+
* A settings block of model settings (`MODEL_SETTINGS_SCHEMA`:
|
|
1648
|
+
* `temperature`, `maxOutputTokens`) the turn's model calls use. Pinned
|
|
1649
|
+
* at publish with the other settings.
|
|
1650
|
+
*/
|
|
1651
|
+
readonly modelSettings?: BlockRef;
|
|
1652
|
+
/** `pinsDigest(pins)`, recorded when the version was published. */
|
|
1653
|
+
readonly pinsDigest?: string;
|
|
1654
|
+
/**
|
|
1655
|
+
* Set by the runtime on a version it registered under another number
|
|
1656
|
+
* than the definition's, when a deploy couldn't register that number
|
|
1657
|
+
* as it was (see `AgentDerivation`). Never authored.
|
|
1658
|
+
*/
|
|
1659
|
+
readonly derivedFrom?: AgentDerivation;
|
|
1529
1660
|
}
|
|
1530
1661
|
/** A retrieved fact + the retrieval intent that pulled it. */
|
|
1531
1662
|
export interface RetrievedFact {
|
|
@@ -1616,8 +1747,16 @@ export interface DefineAgentSpec {
|
|
|
1616
1747
|
* The system prompt. Sent to the model with every turn as the
|
|
1617
1748
|
* baseline instructions. Load-bearing — this is where you shape
|
|
1618
1749
|
* the agent's behavior (persona, output format, tool-use policy).
|
|
1750
|
+
*
|
|
1751
|
+
* Or a prompt block by range (`{ prompt: 'acme.intake-prompt',
|
|
1752
|
+
* version: '^1.0.0' }`), whose template and parameters are used
|
|
1753
|
+
* instead; then `parameters` stays unset (the block declares them).
|
|
1619
1754
|
*/
|
|
1620
|
-
readonly instructions: string;
|
|
1755
|
+
readonly instructions: string | PromptRef;
|
|
1756
|
+
/** Settings blocks the agent reads, by range (see `Agent.settings`). */
|
|
1757
|
+
readonly settings?: readonly BlockRef[];
|
|
1758
|
+
/** A model-settings block, by range (see `Agent.modelSettings`). */
|
|
1759
|
+
readonly modelSettings?: BlockRef;
|
|
1621
1760
|
/**
|
|
1622
1761
|
* Required capabilities the agent needs from a `ModelProvider`.
|
|
1623
1762
|
* Typically one entry: `[{ needs: [{ feature: 'tool-use' }] }]`
|
|
@@ -1812,6 +1951,11 @@ export interface ToolCompletedEvent {
|
|
|
1812
1951
|
readonly invocationId: string;
|
|
1813
1952
|
readonly output: unknown;
|
|
1814
1953
|
readonly durationMs: number;
|
|
1954
|
+
/**
|
|
1955
|
+
* In a replay turn: whether the tool ran (`live`), the past run's result
|
|
1956
|
+
* was used (`recorded`), or the call was refused (`refused`).
|
|
1957
|
+
*/
|
|
1958
|
+
readonly replay?: "live" | "recorded" | "refused";
|
|
1815
1959
|
}
|
|
1816
1960
|
export interface ToolFailedEvent {
|
|
1817
1961
|
readonly kind: "tool.failed";
|
|
@@ -3772,6 +3916,130 @@ export interface ClientOptions {
|
|
|
3772
3916
|
/** Overridable fetch impl for testing. Defaults to global `fetch`. */
|
|
3773
3917
|
readonly fetch?: typeof fetch;
|
|
3774
3918
|
}
|
|
3919
|
+
/** The verdict of a judgment. */
|
|
3920
|
+
export type Verdict = "yes" | "no";
|
|
3921
|
+
/**
|
|
3922
|
+
* Where a judge class applies: the whole tenant, one project, or one
|
|
3923
|
+
* agent in a project. Matches `@kindgi/api/openapi.json#JudgeClassScope`.
|
|
3924
|
+
*/
|
|
3925
|
+
export type JudgeClassScope = {
|
|
3926
|
+
readonly kind: "tenant";
|
|
3927
|
+
} | {
|
|
3928
|
+
readonly kind: "project";
|
|
3929
|
+
readonly projectId: string;
|
|
3930
|
+
} | {
|
|
3931
|
+
readonly kind: "agent";
|
|
3932
|
+
readonly projectId: string;
|
|
3933
|
+
readonly agentId: string;
|
|
3934
|
+
};
|
|
3935
|
+
/** Matches `@kindgi/api/openapi.json#JudgeClass`. */
|
|
3936
|
+
export interface JudgeClass {
|
|
3937
|
+
readonly id: string;
|
|
3938
|
+
readonly tenantId: string;
|
|
3939
|
+
readonly scope: JudgeClassScope;
|
|
3940
|
+
/** The deployment's own word for the class: "expert", "user", "arbitrator". */
|
|
3941
|
+
readonly name: string;
|
|
3942
|
+
/** How much a judgment of this class counts, relative to the others (≥ 0). */
|
|
3943
|
+
readonly weight: number;
|
|
3944
|
+
readonly description?: string;
|
|
3945
|
+
readonly createdAt: Timestamp;
|
|
3946
|
+
readonly updatedAt: Timestamp;
|
|
3947
|
+
/** Set when the class was retired. */
|
|
3948
|
+
readonly unregisteredAt?: Timestamp;
|
|
3949
|
+
}
|
|
3950
|
+
/** Input for `POST /v1/judge-classes` per `#CreateJudgeClassBody`. */
|
|
3951
|
+
export interface CreateJudgeClassInput {
|
|
3952
|
+
readonly scope: JudgeClassScope;
|
|
3953
|
+
readonly name: string;
|
|
3954
|
+
readonly weight: number;
|
|
3955
|
+
readonly description?: string;
|
|
3956
|
+
}
|
|
3957
|
+
/** Input for `PATCH /v1/judge-classes/{judgeClassId}` per `#UpdateJudgeClassBody`. */
|
|
3958
|
+
export interface UpdateJudgeClassInput {
|
|
3959
|
+
readonly weight?: number;
|
|
3960
|
+
readonly description?: string;
|
|
3961
|
+
}
|
|
3962
|
+
/** What a judged run ran: an agent at a version, or a flow at a version. */
|
|
3963
|
+
export interface JudgedSubject {
|
|
3964
|
+
readonly kind: "agent" | "flow";
|
|
3965
|
+
readonly id: string;
|
|
3966
|
+
readonly version: string;
|
|
3967
|
+
}
|
|
3968
|
+
/** The judged item of a run's output. */
|
|
3969
|
+
export interface JudgedItem {
|
|
3970
|
+
/** Your stable id for the item, e.g. a matched case's id. */
|
|
3971
|
+
readonly key: string;
|
|
3972
|
+
/** Where the item is in the run's output, as a JSON Pointer (RFC 6901), e.g. `/matches/2`. */
|
|
3973
|
+
readonly pointer?: string;
|
|
3974
|
+
/** The item's position in a ranked list (0 = first). */
|
|
3975
|
+
readonly rank?: number;
|
|
3976
|
+
}
|
|
3977
|
+
/** Who asserted a judgment: the authenticated caller, never a typed name. */
|
|
3978
|
+
export interface JudgmentAssertedBy {
|
|
3979
|
+
readonly kind: "user" | "service";
|
|
3980
|
+
readonly id: string;
|
|
3981
|
+
}
|
|
3982
|
+
/** Matches `@kindgi/api/openapi.json#Judgment`. */
|
|
3983
|
+
export interface Judgment {
|
|
3984
|
+
readonly id: string;
|
|
3985
|
+
readonly tenantId: string;
|
|
3986
|
+
readonly projectId: string;
|
|
3987
|
+
readonly runId: string;
|
|
3988
|
+
readonly subject: JudgedSubject;
|
|
3989
|
+
readonly item: JudgedItem;
|
|
3990
|
+
readonly verdict: Verdict;
|
|
3991
|
+
readonly reason?: string;
|
|
3992
|
+
/** Absent when the judgment is unclassified (it counts with weight 1). */
|
|
3993
|
+
readonly judgeClassId?: string;
|
|
3994
|
+
readonly assertedBy: JudgmentAssertedBy;
|
|
3995
|
+
/** An app's opaque id for its end user who judged, when it judged on their behalf. */
|
|
3996
|
+
readonly participantId?: string;
|
|
3997
|
+
readonly createdAt: Timestamp;
|
|
3998
|
+
/** Set when the judgment was removed or superseded. */
|
|
3999
|
+
readonly unregisteredAt?: Timestamp;
|
|
4000
|
+
/** The judgment that replaced this one. */
|
|
4001
|
+
readonly supersededBy?: string;
|
|
4002
|
+
}
|
|
4003
|
+
/**
|
|
4004
|
+
* What a judged agent turn read besides its input, captured when it was
|
|
4005
|
+
* first judged: the conversation before it and what its retrievals returned.
|
|
4006
|
+
*/
|
|
4007
|
+
export interface JudgedRunContext {
|
|
4008
|
+
/** The conversation's messages before the turn, oldest first (at most the last 200). */
|
|
4009
|
+
readonly history?: readonly unknown[];
|
|
4010
|
+
/** Whether older messages were left out of `history`. */
|
|
4011
|
+
readonly historyTruncated?: boolean;
|
|
4012
|
+
/** What the turn's retrievals returned. */
|
|
4013
|
+
readonly retrieved?: unknown;
|
|
4014
|
+
}
|
|
4015
|
+
/** The stored copy of a judged run's input and output. */
|
|
4016
|
+
export interface JudgedRunCopy {
|
|
4017
|
+
readonly runId: string;
|
|
4018
|
+
readonly subject: JudgedSubject;
|
|
4019
|
+
readonly input: unknown;
|
|
4020
|
+
/** Absent for runs judged before context was captured, and for flow runs. */
|
|
4021
|
+
readonly context?: JudgedRunContext;
|
|
4022
|
+
readonly output: unknown;
|
|
4023
|
+
readonly capturedAt: Timestamp;
|
|
4024
|
+
}
|
|
4025
|
+
/** Matches `@kindgi/api/openapi.json#JudgmentWithCopies`. */
|
|
4026
|
+
export interface JudgmentWithCopies extends Judgment {
|
|
4027
|
+
/** The run's input and output as they were when it was first judged. */
|
|
4028
|
+
readonly run: JudgedRunCopy;
|
|
4029
|
+
/** The judged item's value, when the judgment pointed at it. */
|
|
4030
|
+
readonly itemValue?: unknown;
|
|
4031
|
+
}
|
|
4032
|
+
/** Input for `POST /v1/judgments` per `#CreateJudgmentBody`. */
|
|
4033
|
+
export interface CreateJudgmentInput {
|
|
4034
|
+
readonly runId: string;
|
|
4035
|
+
readonly item: JudgedItem;
|
|
4036
|
+
readonly verdict: Verdict;
|
|
4037
|
+
readonly reason?: string;
|
|
4038
|
+
/** Optional. When given it must exist and apply to the run. */
|
|
4039
|
+
readonly judgeClassId?: string;
|
|
4040
|
+
/** Your opaque id for the end user who judged, when judging on their behalf. */
|
|
4041
|
+
readonly participantId?: string;
|
|
4042
|
+
}
|
|
3775
4043
|
/** Signature the resource clients call into. */
|
|
3776
4044
|
export interface Transport {
|
|
3777
4045
|
/** Base URL, no trailing slash. */
|
|
@@ -4001,6 +4269,14 @@ declare namespace Schemas {
|
|
|
4001
4269
|
*/
|
|
4002
4270
|
parentNodeId?: string;
|
|
4003
4271
|
agent?: RunAgent;
|
|
4272
|
+
/**
|
|
4273
|
+
* Set on a replay run (an eval run re-running a past run): the run it replays.
|
|
4274
|
+
*/
|
|
4275
|
+
replayOf?: string;
|
|
4276
|
+
/**
|
|
4277
|
+
* Set on a replay run: the eval run that started it.
|
|
4278
|
+
*/
|
|
4279
|
+
evalRunId?: string;
|
|
4004
4280
|
/**
|
|
4005
4281
|
* Only in the response to `POST /v1/runs`, when the deployment issues public run tokens: a read-only token for this run (and its descendants) to hand to a browser, for `GET /v1/runs/{runId}/progress` and its stream.
|
|
4006
4282
|
*/
|
|
@@ -4110,6 +4386,14 @@ declare namespace Schemas {
|
|
|
4110
4386
|
*/
|
|
4111
4387
|
parentNodeId?: string;
|
|
4112
4388
|
agent?: RunAgent;
|
|
4389
|
+
/**
|
|
4390
|
+
* Set on a replay run (an eval run re-running a past run): the run it replays.
|
|
4391
|
+
*/
|
|
4392
|
+
replayOf?: string;
|
|
4393
|
+
/**
|
|
4394
|
+
* Set on a replay run: the eval run that started it.
|
|
4395
|
+
*/
|
|
4396
|
+
evalRunId?: string;
|
|
4113
4397
|
/**
|
|
4114
4398
|
* Only in the response to `POST /v1/runs`, when the deployment issues public run tokens: a read-only token for this run (and its descendants) to hand to a browser, for `GET /v1/runs/{runId}/progress` and its stream.
|
|
4115
4399
|
*/
|
|
@@ -4539,156 +4823,630 @@ declare namespace Schemas {
|
|
|
4539
4823
|
nextCursor?: string;
|
|
4540
4824
|
hasMore: boolean;
|
|
4541
4825
|
};
|
|
4542
|
-
|
|
4826
|
+
/**
|
|
4827
|
+
* Where a judge class applies: the whole tenant, one project, or one agent in a project.
|
|
4828
|
+
*/
|
|
4829
|
+
export type JudgeClassScope = {
|
|
4830
|
+
kind: "tenant";
|
|
4831
|
+
} | {
|
|
4832
|
+
kind: "project";
|
|
4833
|
+
projectId: string;
|
|
4834
|
+
} | {
|
|
4835
|
+
kind: "agent";
|
|
4836
|
+
projectId: string;
|
|
4837
|
+
agentId: string;
|
|
4838
|
+
};
|
|
4839
|
+
export type JudgeClass = {
|
|
4840
|
+
id: string;
|
|
4841
|
+
tenantId: string;
|
|
4842
|
+
scope: JudgeClassScope;
|
|
4843
|
+
/**
|
|
4844
|
+
* The deployment's own word for the class: "expert", "user", "arbitrator".
|
|
4845
|
+
*/
|
|
4543
4846
|
name: string;
|
|
4847
|
+
/**
|
|
4848
|
+
* How much a judgment of this class counts, relative to the others.
|
|
4849
|
+
*/
|
|
4850
|
+
weight: number;
|
|
4544
4851
|
description?: string;
|
|
4545
|
-
|
|
4546
|
-
|
|
4852
|
+
createdAt: string;
|
|
4853
|
+
updatedAt: string;
|
|
4547
4854
|
/**
|
|
4548
|
-
*
|
|
4855
|
+
* Set when the class was retired.
|
|
4549
4856
|
*/
|
|
4550
|
-
|
|
4857
|
+
unregisteredAt?: string;
|
|
4551
4858
|
};
|
|
4552
|
-
export type
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4859
|
+
export type JudgeClassCollectionPage = {
|
|
4860
|
+
data: Array<JudgeClass>;
|
|
4861
|
+
/**
|
|
4862
|
+
* Opaque cursor. Treat as opaque on the client.
|
|
4863
|
+
*/
|
|
4864
|
+
nextCursor?: string;
|
|
4865
|
+
hasMore: boolean;
|
|
4557
4866
|
};
|
|
4558
|
-
export type
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4867
|
+
export type CreateJudgeClassBody = {
|
|
4868
|
+
scope: JudgeClassScope;
|
|
4869
|
+
name: string;
|
|
4870
|
+
weight: number;
|
|
4871
|
+
description?: string;
|
|
4872
|
+
};
|
|
4873
|
+
export type UpdateJudgeClassBody = Partial<{
|
|
4874
|
+
weight: number;
|
|
4875
|
+
description: string;
|
|
4567
4876
|
}>;
|
|
4877
|
+
export type UnregisterJudgeClassResult = {
|
|
4878
|
+
judgeClassId: string;
|
|
4879
|
+
unregistered: true;
|
|
4880
|
+
};
|
|
4568
4881
|
/**
|
|
4569
|
-
*
|
|
4570
|
-
*/
|
|
4571
|
-
export type Capability = Record<string, unknown>;
|
|
4572
|
-
/**
|
|
4573
|
-
* Typed tool reference. `version` is a semver **range** (npm-style: `1.2.3` exact pin, `^1.2.3` compatible-updates, `~1.2.3` patch-updates-only, `>=1.0.0 <2.0.0` explicit range). Dispatch resolves the range to a concrete active version via `semver.maxSatisfying` at run start. No implicit "latest" — every tool ref names both id and range.
|
|
4882
|
+
* What a judged run ran: an agent at a version, or a flow at a version.
|
|
4574
4883
|
*/
|
|
4575
|
-
export type
|
|
4884
|
+
export type JudgedSubject = {
|
|
4885
|
+
kind: "agent" | "flow";
|
|
4576
4886
|
id: string;
|
|
4577
4887
|
version: string;
|
|
4578
4888
|
};
|
|
4579
|
-
|
|
4889
|
+
/**
|
|
4890
|
+
* The judged item of a run's output.
|
|
4891
|
+
*/
|
|
4892
|
+
export type JudgedItem = {
|
|
4580
4893
|
/**
|
|
4581
|
-
*
|
|
4894
|
+
* The caller's stable id for the item.
|
|
4582
4895
|
*/
|
|
4583
|
-
|
|
4896
|
+
key: string;
|
|
4584
4897
|
/**
|
|
4585
|
-
*
|
|
4898
|
+
* Where the item is in the run's output, as a JSON Pointer (RFC 6901), e.g. `/matches/2`. `""` is the whole output.
|
|
4586
4899
|
*/
|
|
4587
|
-
|
|
4900
|
+
pointer?: string;
|
|
4588
4901
|
/**
|
|
4589
|
-
*
|
|
4902
|
+
* The item's position in a ranked list (0 = first).
|
|
4590
4903
|
*/
|
|
4591
|
-
|
|
4904
|
+
rank?: number;
|
|
4592
4905
|
};
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4906
|
+
/**
|
|
4907
|
+
* Who asserted a judgment: the authenticated caller, never a typed name.
|
|
4908
|
+
*/
|
|
4909
|
+
export type JudgmentAssertedBy = {
|
|
4910
|
+
kind: "user" | "service";
|
|
4598
4911
|
/**
|
|
4599
|
-
*
|
|
4912
|
+
* A user id, or for a service token its token or session id.
|
|
4600
4913
|
*/
|
|
4601
|
-
|
|
4602
|
-
}
|
|
4603
|
-
export type
|
|
4914
|
+
id: string;
|
|
4915
|
+
};
|
|
4916
|
+
export type Judgment = {
|
|
4917
|
+
id: string;
|
|
4918
|
+
tenantId: string;
|
|
4919
|
+
projectId: string;
|
|
4920
|
+
runId: string;
|
|
4921
|
+
subject: JudgedSubject;
|
|
4922
|
+
item: JudgedItem;
|
|
4923
|
+
verdict: "yes" | "no";
|
|
4924
|
+
reason?: string;
|
|
4604
4925
|
/**
|
|
4605
|
-
*
|
|
4926
|
+
* The judge class the judgment is recorded under. Absent when unclassified (counts with weight 1).
|
|
4606
4927
|
*/
|
|
4607
|
-
|
|
4928
|
+
judgeClassId?: string;
|
|
4929
|
+
assertedBy: JudgmentAssertedBy;
|
|
4608
4930
|
/**
|
|
4609
|
-
*
|
|
4931
|
+
* The app's opaque id for its end user who judged, when an app judged on their behalf.
|
|
4610
4932
|
*/
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
description?: string;
|
|
4614
|
-
instructions: string;
|
|
4615
|
-
parameters?: Array<PromptParameter>;
|
|
4616
|
-
capabilities: Array<Capability>;
|
|
4617
|
-
tools: Array<ToolRef>;
|
|
4618
|
-
retrieval: Array<RetrievalIntent>;
|
|
4619
|
-
guardrails: Array<string>;
|
|
4933
|
+
participantId?: string;
|
|
4934
|
+
createdAt: string;
|
|
4620
4935
|
/**
|
|
4621
|
-
*
|
|
4936
|
+
* Set when the judgment was removed or superseded.
|
|
4622
4937
|
*/
|
|
4623
|
-
|
|
4938
|
+
unregisteredAt?: string;
|
|
4624
4939
|
/**
|
|
4625
|
-
*
|
|
4940
|
+
* The judgment that replaced this one.
|
|
4626
4941
|
*/
|
|
4627
|
-
|
|
4628
|
-
conversationPolicy?: ConversationPolicy;
|
|
4629
|
-
budget?: TurnBudget;
|
|
4630
|
-
tags?: Array<string>;
|
|
4631
|
-
output?: AgentOutputSpec;
|
|
4632
|
-
toolErrors?: ToolErrorsSpec;
|
|
4942
|
+
supersededBy?: string;
|
|
4633
4943
|
};
|
|
4634
4944
|
/**
|
|
4635
|
-
*
|
|
4945
|
+
* What a judged run needs besides its input to be replayed, captured when it was first judged. For an agent turn: the conversation before it, what its retrievals returned, and the decision at its session approval gate. For a flow run: its tool calls with their results.
|
|
4636
4946
|
*/
|
|
4637
|
-
export type
|
|
4638
|
-
id: string;
|
|
4639
|
-
version: string;
|
|
4640
|
-
name: string;
|
|
4641
|
-
description?: string;
|
|
4947
|
+
export type JudgedRunContext = Partial<{
|
|
4642
4948
|
/**
|
|
4643
|
-
*
|
|
4949
|
+
* The conversation's messages before the turn, oldest first (at most the last 200).
|
|
4644
4950
|
*/
|
|
4645
|
-
|
|
4646
|
-
instructions: string;
|
|
4647
|
-
parameters?: Array<PromptParameter>;
|
|
4648
|
-
capabilities: Array<Capability>;
|
|
4649
|
-
tools: Array<ToolRef>;
|
|
4650
|
-
retrieval: Array<RetrievalIntent>;
|
|
4651
|
-
guardrails: Array<string>;
|
|
4951
|
+
history: Array<unknown>;
|
|
4652
4952
|
/**
|
|
4653
|
-
*
|
|
4953
|
+
* Whether older messages were left out of `history`.
|
|
4654
4954
|
*/
|
|
4655
|
-
|
|
4955
|
+
historyTruncated: boolean;
|
|
4656
4956
|
/**
|
|
4657
|
-
*
|
|
4957
|
+
* What the turn's retrievals returned.
|
|
4658
4958
|
*/
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4959
|
+
retrieved: unknown;
|
|
4960
|
+
/**
|
|
4961
|
+
* The reviewer's decision at the turn's session approval gate, when the turn waited on one. A replay of the turn follows it.
|
|
4962
|
+
*/
|
|
4963
|
+
sessionApproval: {
|
|
4964
|
+
approved: boolean;
|
|
4965
|
+
/**
|
|
4966
|
+
* The reviewer's reason for a rejection.
|
|
4967
|
+
*/
|
|
4968
|
+
rationale?: string;
|
|
4969
|
+
};
|
|
4970
|
+
/**
|
|
4971
|
+
* For a flow run: what it did, kept at its first judgment so it can be replayed. Every tool call it made with its result (at its tool nodes, in its agent steps' turns and in its sub-flows), at most 500, and its agent steps.
|
|
4972
|
+
*/
|
|
4973
|
+
flow: {
|
|
4974
|
+
calls: Array<{
|
|
4975
|
+
/**
|
|
4976
|
+
* The run that made it: the flow run, a sub-flow's, or an agent step's turn.
|
|
4977
|
+
*/
|
|
4978
|
+
runId: string;
|
|
4979
|
+
/**
|
|
4980
|
+
* The tool node that made it, or the agent step whose turn did.
|
|
4981
|
+
*/
|
|
4982
|
+
nodeId?: string;
|
|
4983
|
+
/**
|
|
4984
|
+
* The loop iteration, in a loop body.
|
|
4985
|
+
*/
|
|
4986
|
+
scope?: string;
|
|
4987
|
+
toolId: string;
|
|
4988
|
+
arguments?: unknown;
|
|
4989
|
+
result?: unknown;
|
|
4990
|
+
}>;
|
|
4991
|
+
steps: Array<{
|
|
4992
|
+
runId: string;
|
|
4993
|
+
nodeId?: string;
|
|
4994
|
+
scope?: string;
|
|
4995
|
+
agentId: string;
|
|
4996
|
+
agentVersion: string;
|
|
4997
|
+
/**
|
|
4998
|
+
* What the step's turn retrieved.
|
|
4999
|
+
*/
|
|
5000
|
+
retrieved?: unknown;
|
|
5001
|
+
}>;
|
|
5002
|
+
/**
|
|
5003
|
+
* More calls were made than were kept.
|
|
5004
|
+
*/
|
|
5005
|
+
truncated?: boolean;
|
|
5006
|
+
};
|
|
5007
|
+
}>;
|
|
5008
|
+
/**
|
|
5009
|
+
* The stored copy of a judged run's input and output, taken when it was first judged.
|
|
5010
|
+
*/
|
|
5011
|
+
export type JudgedRunCopy = {
|
|
5012
|
+
runId: string;
|
|
5013
|
+
subject: JudgedSubject;
|
|
5014
|
+
input: unknown;
|
|
5015
|
+
context?: JudgedRunContext;
|
|
5016
|
+
output: unknown;
|
|
5017
|
+
capturedAt: string;
|
|
4674
5018
|
};
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
5019
|
+
/**
|
|
5020
|
+
* A judgment with the stored copies of what was judged.
|
|
5021
|
+
*/
|
|
5022
|
+
export type JudgmentWithCopies = Judgment & {
|
|
5023
|
+
run: JudgedRunCopy;
|
|
4678
5024
|
/**
|
|
4679
|
-
*
|
|
5025
|
+
* The judged item's value, when the judgment pointed at it.
|
|
4680
5026
|
*/
|
|
4681
|
-
|
|
5027
|
+
itemValue?: unknown;
|
|
4682
5028
|
};
|
|
4683
|
-
export type
|
|
4684
|
-
data: Array<
|
|
5029
|
+
export type JudgmentCollectionPage = {
|
|
5030
|
+
data: Array<Judgment>;
|
|
4685
5031
|
/**
|
|
4686
|
-
* Opaque cursor
|
|
5032
|
+
* Opaque cursor. Treat as opaque on the client.
|
|
4687
5033
|
*/
|
|
4688
5034
|
nextCursor?: string;
|
|
4689
5035
|
hasMore: boolean;
|
|
4690
5036
|
};
|
|
4691
|
-
export type
|
|
5037
|
+
export type CreateJudgmentBody = {
|
|
5038
|
+
runId: string;
|
|
5039
|
+
item: JudgedItem;
|
|
5040
|
+
verdict: "yes" | "no";
|
|
5041
|
+
reason?: string;
|
|
5042
|
+
/**
|
|
5043
|
+
* Optional. When given it must exist and apply to the run.
|
|
5044
|
+
*/
|
|
5045
|
+
judgeClassId?: string;
|
|
5046
|
+
/**
|
|
5047
|
+
* An app's opaque id for its end user, when judging on their behalf.
|
|
5048
|
+
*/
|
|
5049
|
+
participantId?: string;
|
|
5050
|
+
};
|
|
5051
|
+
export type UnregisterJudgmentResult = {
|
|
5052
|
+
judgmentId: string;
|
|
5053
|
+
unregistered: true;
|
|
5054
|
+
};
|
|
5055
|
+
/**
|
|
5056
|
+
* The judgments of one item of a case's output, summed up.
|
|
5057
|
+
*/
|
|
5058
|
+
export type JudgedItemSummary = {
|
|
5059
|
+
key: string;
|
|
5060
|
+
pointer?: string;
|
|
5061
|
+
rank?: number;
|
|
5062
|
+
/**
|
|
5063
|
+
* How many judgments said yes.
|
|
5064
|
+
*/
|
|
5065
|
+
yes: number;
|
|
5066
|
+
/**
|
|
5067
|
+
* How many judgments said no.
|
|
5068
|
+
*/
|
|
5069
|
+
no: number;
|
|
5070
|
+
/**
|
|
5071
|
+
* The weight behind "yes" (an unclassified judgment counts 1).
|
|
5072
|
+
*/
|
|
5073
|
+
yesWeight: number;
|
|
5074
|
+
/**
|
|
5075
|
+
* The weight behind all judgments of the item.
|
|
5076
|
+
*/
|
|
5077
|
+
totalWeight: number;
|
|
5078
|
+
/**
|
|
5079
|
+
* The reasons given, newest first.
|
|
5080
|
+
*/
|
|
5081
|
+
reasons: Array<{
|
|
5082
|
+
verdict: "yes" | "no";
|
|
5083
|
+
reason: string;
|
|
5084
|
+
}>;
|
|
5085
|
+
};
|
|
5086
|
+
/**
|
|
5087
|
+
* One case of a `judged` eval suite: a copy of a judged run with its items' judgments summed up.
|
|
5088
|
+
*/
|
|
5089
|
+
export type JudgedEvalCase = {
|
|
5090
|
+
/**
|
|
5091
|
+
* The judged run's id.
|
|
5092
|
+
*/
|
|
5093
|
+
caseId: string;
|
|
5094
|
+
subject: JudgedSubject;
|
|
5095
|
+
input: unknown;
|
|
5096
|
+
context?: JudgedRunContext;
|
|
5097
|
+
output: unknown;
|
|
5098
|
+
items: Array<JudgedItemSummary>;
|
|
5099
|
+
};
|
|
5100
|
+
export type JudgedEvalCaseCollectionPage = {
|
|
5101
|
+
data: Array<JudgedEvalCase>;
|
|
5102
|
+
/**
|
|
5103
|
+
* Opaque cursor. Treat as opaque on the client.
|
|
5104
|
+
*/
|
|
5105
|
+
nextCursor?: string;
|
|
5106
|
+
hasMore: boolean;
|
|
5107
|
+
};
|
|
5108
|
+
/**
|
|
5109
|
+
* Name the agent (`agentId`) or the flow (`flowId`) whose judged runs to use.
|
|
5110
|
+
*/
|
|
5111
|
+
export type BuildJudgedSuiteBody = {
|
|
5112
|
+
/**
|
|
5113
|
+
* Semver version to publish, e.g. `1.0.0`.
|
|
5114
|
+
*/
|
|
5115
|
+
version: string;
|
|
5116
|
+
projectId: string;
|
|
5117
|
+
agentId?: string;
|
|
5118
|
+
/**
|
|
5119
|
+
* Needs `agentId`.
|
|
5120
|
+
*/
|
|
5121
|
+
agentVersion?: string;
|
|
5122
|
+
flowId?: string;
|
|
5123
|
+
/**
|
|
5124
|
+
* Runs first judged at or after this time.
|
|
5125
|
+
*/
|
|
5126
|
+
since?: string;
|
|
5127
|
+
/**
|
|
5128
|
+
* Runs first judged before this time.
|
|
5129
|
+
*/
|
|
5130
|
+
until?: string;
|
|
5131
|
+
/**
|
|
5132
|
+
* Count only judgments recorded under these judge classes.
|
|
5133
|
+
*/
|
|
5134
|
+
judgeClassIds?: Array<string>;
|
|
5135
|
+
/**
|
|
5136
|
+
* Leave out runs with fewer counted judgments. Default 1.
|
|
5137
|
+
*/
|
|
5138
|
+
minJudgments?: number;
|
|
5139
|
+
description?: string;
|
|
5140
|
+
};
|
|
5141
|
+
export type BuildJudgedSuiteResult = {
|
|
5142
|
+
suiteId: string;
|
|
5143
|
+
version: string;
|
|
5144
|
+
kind: "judged";
|
|
5145
|
+
caseCount: number;
|
|
5146
|
+
/**
|
|
5147
|
+
* Whether more judged runs matched than the 1000 cases a set holds.
|
|
5148
|
+
*/
|
|
5149
|
+
truncated: boolean;
|
|
5150
|
+
};
|
|
5151
|
+
export type PromptParameter = {
|
|
5152
|
+
name: string;
|
|
5153
|
+
description?: string;
|
|
5154
|
+
type: "string" | "number" | "boolean" | "date";
|
|
5155
|
+
required?: boolean;
|
|
5156
|
+
/**
|
|
5157
|
+
* Default value used when the caller omits this parameter.
|
|
5158
|
+
*/
|
|
5159
|
+
default?: unknown;
|
|
5160
|
+
};
|
|
5161
|
+
export type RetrievalIntent = {
|
|
5162
|
+
types: Array<string>;
|
|
5163
|
+
scope: "same-conversation" | "same-project" | "tenant";
|
|
5164
|
+
limit?: number;
|
|
5165
|
+
mode?: "keyword" | "semantic" | "both";
|
|
5166
|
+
};
|
|
5167
|
+
export type ConversationPolicy = Partial<{
|
|
5168
|
+
historyLimit: number;
|
|
5169
|
+
autoCloseAfterInactiveSeconds: number;
|
|
5170
|
+
hitlAfterTurns: number;
|
|
5171
|
+
}>;
|
|
5172
|
+
export type TurnBudget = Partial<{
|
|
5173
|
+
maxSteps: number;
|
|
5174
|
+
maxCostUsd: number;
|
|
5175
|
+
maxWallMs: number;
|
|
5176
|
+
}>;
|
|
5177
|
+
/**
|
|
5178
|
+
* Capability declaration — see `@kindgi/capabilities`. Additional properties are permitted so new capability kinds do not require a wire change.
|
|
5179
|
+
*/
|
|
5180
|
+
export type Capability = Record<string, unknown>;
|
|
5181
|
+
/**
|
|
5182
|
+
* Typed tool reference. `version` is a semver **range** (npm-style: `1.2.3` exact pin, `^1.2.3` compatible-updates, `~1.2.3` patch-updates-only, `>=1.0.0 <2.0.0` explicit range). Dispatch resolves the range to a concrete active version via `semver.maxSatisfying` at run start. No implicit "latest" — every tool ref names both id and range.
|
|
5183
|
+
*/
|
|
5184
|
+
export type ToolRef = {
|
|
5185
|
+
id: string;
|
|
5186
|
+
version: string;
|
|
5187
|
+
};
|
|
5188
|
+
export type AgentOutputSpec = {
|
|
5189
|
+
/**
|
|
5190
|
+
* JSON Schema (draft 2020-12) the final answer must match.
|
|
5191
|
+
*/
|
|
5192
|
+
schema: Record<string, unknown>;
|
|
5193
|
+
/**
|
|
5194
|
+
* A name for the output, shown to the model and in errors. Default `output`.
|
|
5195
|
+
*/
|
|
5196
|
+
name?: string;
|
|
5197
|
+
/**
|
|
5198
|
+
* How many times the model is asked to repair an invalid answer. Default 1.
|
|
5199
|
+
*/
|
|
5200
|
+
maxRepairs?: number;
|
|
5201
|
+
};
|
|
5202
|
+
export type ToolErrorsSpec = Partial<{
|
|
5203
|
+
/**
|
|
5204
|
+
* Failed calls sent back to the model per turn. Default 1.
|
|
5205
|
+
*/
|
|
5206
|
+
maxRetries: number;
|
|
5207
|
+
/**
|
|
5208
|
+
* Which failures are sent back: arguments that don't fit the input schema (`invalid-arguments`), a tool the agent doesn't have (`unknown-tool`), a tool that ran and failed (`tool-error`). Default `invalid-arguments`, `unknown-tool`.
|
|
5209
|
+
*/
|
|
5210
|
+
retryOn: Array<"invalid-arguments" | "unknown-tool" | "tool-error">;
|
|
5211
|
+
}>;
|
|
5212
|
+
/**
|
|
5213
|
+
* A prompt block an agent's instructions come from, by id and semver range.
|
|
5214
|
+
*/
|
|
5215
|
+
export type PromptRef = {
|
|
5216
|
+
/**
|
|
5217
|
+
* The prompt block id.
|
|
5218
|
+
*/
|
|
5219
|
+
prompt: string;
|
|
5220
|
+
/**
|
|
5221
|
+
* A semver range (`^1.0.0`, `1.2.0`).
|
|
5222
|
+
*/
|
|
5223
|
+
version: string;
|
|
5224
|
+
};
|
|
5225
|
+
/**
|
|
5226
|
+
* A settings block an agent reads, by id and semver range.
|
|
5227
|
+
*/
|
|
5228
|
+
export type BlockRef = {
|
|
5229
|
+
/**
|
|
5230
|
+
* The settings block id.
|
|
5231
|
+
*/
|
|
5232
|
+
id: string;
|
|
5233
|
+
/**
|
|
5234
|
+
* A semver range (`^1.0.0`, `1.2.0`).
|
|
5235
|
+
*/
|
|
5236
|
+
version: string;
|
|
5237
|
+
};
|
|
5238
|
+
/**
|
|
5239
|
+
* The exact block versions an agent version runs: its lockfile. Set by the runtime when the version is published, never in the publish body: each tool range resolves once to the version every run of that agent version uses, so a new tool version reaches the agent only through a new agent version. Absent on a version published before pins existed (its ranges resolve per run).
|
|
5240
|
+
*/
|
|
5241
|
+
export type AgentPins = {
|
|
5242
|
+
/**
|
|
5243
|
+
* Tool id → exact version.
|
|
5244
|
+
*/
|
|
5245
|
+
tools: Record<string, string>;
|
|
5246
|
+
/**
|
|
5247
|
+
* Prompt block id → exact version.
|
|
5248
|
+
*/
|
|
5249
|
+
prompts: Record<string, string>;
|
|
5250
|
+
/**
|
|
5251
|
+
* Settings block id → exact version.
|
|
5252
|
+
*/
|
|
5253
|
+
settings: Record<string, string>;
|
|
5254
|
+
};
|
|
5255
|
+
/**
|
|
5256
|
+
* Set by the runtime on an agent or flow version a deploy registered in place of the definition's version, which was registered already with other pins or content (versions never change). Never in the publish body.
|
|
5257
|
+
*/
|
|
5258
|
+
export type VersionDerivation = {
|
|
5259
|
+
/**
|
|
5260
|
+
* The version the definition names.
|
|
5261
|
+
*/
|
|
5262
|
+
version: string;
|
|
5263
|
+
/**
|
|
5264
|
+
* `pins-changed`: a block it uses has a new version; `unpinned`: the definition's version was published before pins existed; `version-taken`: the definition's version holds another definition; `edited`: derived from `version` with some data-block pins swapped (`POST /v1/agents/{agentId}/versions`).
|
|
5265
|
+
*/
|
|
5266
|
+
reason: "pins-changed" | "unpinned" | "version-taken" | "edited";
|
|
5267
|
+
/**
|
|
5268
|
+
* For `edited`: a short label for the version.
|
|
5269
|
+
*/
|
|
5270
|
+
label?: string;
|
|
5271
|
+
/**
|
|
5272
|
+
* For `edited`: who derived it (`user:<id>`).
|
|
5273
|
+
*/
|
|
5274
|
+
by?: string;
|
|
5275
|
+
};
|
|
5276
|
+
export type Agent = {
|
|
5277
|
+
/**
|
|
5278
|
+
* AgentId — dotted namespace (e.g. `acme.drafting`).
|
|
5279
|
+
*/
|
|
5280
|
+
id: string;
|
|
5281
|
+
/**
|
|
5282
|
+
* Semver.
|
|
5283
|
+
*/
|
|
5284
|
+
version: string;
|
|
5285
|
+
name: string;
|
|
5286
|
+
description?: string;
|
|
5287
|
+
/**
|
|
5288
|
+
* The system prompt (a Liquid template), or a prompt block by range whose template and parameters are used instead (pinned at publish, `pins.prompts`).
|
|
5289
|
+
*/
|
|
5290
|
+
instructions: string | PromptRef;
|
|
5291
|
+
parameters?: Array<PromptParameter>;
|
|
5292
|
+
/**
|
|
5293
|
+
* Settings blocks the agent reads, by range: tools read them as `ToolContext.settings['<id>']`, templates as `settings["<id>"]`. Pinned at publish (`pins.settings`).
|
|
5294
|
+
*/
|
|
5295
|
+
settings?: Array<BlockRef>;
|
|
5296
|
+
modelSettings?: BlockRef;
|
|
5297
|
+
capabilities: Array<Capability>;
|
|
5298
|
+
tools: Array<ToolRef>;
|
|
5299
|
+
retrieval: Array<RetrievalIntent>;
|
|
5300
|
+
guardrails: Array<string>;
|
|
5301
|
+
/**
|
|
5302
|
+
* Soft hint — the router prefers this provider by id (e.g. `anthropic`) when at least one of its models satisfies `capabilities.needs` + tenant policy. Combine with `preferredModel` to pin the exact (provider, model) tuple. Falls back to capability-based ranking when the pinned provider is unregistered or filtered out.
|
|
5303
|
+
*/
|
|
5304
|
+
preferredProvider?: string;
|
|
5305
|
+
/**
|
|
5306
|
+
* Soft hint at the model level (`ModelInfo.name`, e.g. `claude-sonnet-4-6`). Combined with `preferredProvider`: both set → promote the exact tuple; only `preferredModel` → promote any provider exposing that model; only `preferredProvider` → promote every model of that provider.
|
|
5307
|
+
*/
|
|
5308
|
+
preferredModel?: string;
|
|
5309
|
+
conversationPolicy?: ConversationPolicy;
|
|
5310
|
+
budget?: TurnBudget;
|
|
5311
|
+
tags?: Array<string>;
|
|
5312
|
+
output?: AgentOutputSpec;
|
|
5313
|
+
toolErrors?: ToolErrorsSpec;
|
|
5314
|
+
pins?: AgentPins;
|
|
5315
|
+
derivedFrom?: VersionDerivation;
|
|
5316
|
+
/**
|
|
5317
|
+
* Present only on an unregistered version (`GET …/versions/{version}` reads those too). Unregister stops a version being chosen, not the pins that hold it: a new run naming it is refused, while a resumed run and a published version that pins it still run it.
|
|
5318
|
+
*/
|
|
5319
|
+
unregisteredAt?: string;
|
|
5320
|
+
/**
|
|
5321
|
+
* Set by the runtime with `pins`: `sha256:<hex>` of the pins' canonical JSON (sorted keys, no whitespace). Two agent versions with the same digest run the same blocks.
|
|
5322
|
+
*/
|
|
5323
|
+
pinsDigest?: string;
|
|
5324
|
+
};
|
|
5325
|
+
/**
|
|
5326
|
+
* One pin that differs between two versions of an agent or a flow.
|
|
5327
|
+
*/
|
|
5328
|
+
export type PinChange = {
|
|
5329
|
+
kind: "tool" | "prompt" | "setting" | "agent";
|
|
5330
|
+
id: string;
|
|
5331
|
+
/**
|
|
5332
|
+
* The earlier version's pin; absent when it had none.
|
|
5333
|
+
*/
|
|
5334
|
+
from?: string;
|
|
5335
|
+
/**
|
|
5336
|
+
* The later version's pin; absent when it has none.
|
|
5337
|
+
*/
|
|
5338
|
+
to?: string;
|
|
5339
|
+
};
|
|
5340
|
+
/**
|
|
5341
|
+
* The data-block pins to swap, by block id → exact version. Only blocks the version already references; tool pins come from code.
|
|
5342
|
+
*/
|
|
5343
|
+
export type AgentPinSwaps = Partial<{
|
|
5344
|
+
/**
|
|
5345
|
+
* Prompt block id → exact version.
|
|
5346
|
+
*/
|
|
5347
|
+
prompts: Record<string, string>;
|
|
5348
|
+
/**
|
|
5349
|
+
* Settings block id → exact version.
|
|
5350
|
+
*/
|
|
5351
|
+
settings: Record<string, string>;
|
|
5352
|
+
}>;
|
|
5353
|
+
/**
|
|
5354
|
+
* Derive a new agent version from a pinned one with some data-block pins swapped: an expert's edit reaching an agent with no code change.
|
|
5355
|
+
*/
|
|
5356
|
+
export type DeriveAgentVersionBody = {
|
|
5357
|
+
/**
|
|
5358
|
+
* The version to derive from (it must be pinned).
|
|
5359
|
+
*/
|
|
5360
|
+
from: string;
|
|
5361
|
+
pins: AgentPinSwaps;
|
|
5362
|
+
/**
|
|
5363
|
+
* A short label for the new version.
|
|
5364
|
+
*/
|
|
5365
|
+
label?: string;
|
|
5366
|
+
/**
|
|
5367
|
+
* The agent's project, when the runtime doesn't record it on the version.
|
|
5368
|
+
*/
|
|
5369
|
+
projectId?: string;
|
|
5370
|
+
};
|
|
5371
|
+
/**
|
|
5372
|
+
* The exact tool and agent versions a flow version runs: its lockfile. Set by the runtime when the version is published, never in the publish body: each tool the flow runs, and each agent it runs at no named version, resolves once to its latest version then, which every run of that flow version uses. Absent on a version published before pins existed (it binds the latest versions per run).
|
|
5373
|
+
*/
|
|
5374
|
+
export type FlowPins = {
|
|
5375
|
+
/**
|
|
5376
|
+
* Tool id → exact version.
|
|
5377
|
+
*/
|
|
5378
|
+
tools: Record<string, string>;
|
|
5379
|
+
/**
|
|
5380
|
+
* Agent id → exact version, for agent nodes that name no version.
|
|
5381
|
+
*/
|
|
5382
|
+
agents: Record<string, string>;
|
|
5383
|
+
};
|
|
5384
|
+
/**
|
|
5385
|
+
* Full `defineAgent` spec. Validated server-side via `@kindgi/agents.defineAgent` — validation failures return `400 validation-failed` with the issue list under `details.issues`.
|
|
5386
|
+
*/
|
|
5387
|
+
export type PublishAgentBody = {
|
|
5388
|
+
id: string;
|
|
5389
|
+
version: string;
|
|
5390
|
+
name: string;
|
|
5391
|
+
description?: string;
|
|
5392
|
+
/**
|
|
5393
|
+
* Project this belongs to (its content scope). Required: missing, or not a project in the caller's tenant → `400 bad-input`.
|
|
5394
|
+
*/
|
|
5395
|
+
projectId: string;
|
|
5396
|
+
/**
|
|
5397
|
+
* The system prompt (a Liquid template), or a prompt block by range whose template and parameters are used instead (pinned at publish, `pins.prompts`).
|
|
5398
|
+
*/
|
|
5399
|
+
instructions: string | PromptRef;
|
|
5400
|
+
parameters?: Array<PromptParameter>;
|
|
5401
|
+
/**
|
|
5402
|
+
* Settings blocks the agent reads, by range: tools read them as `ToolContext.settings['<id>']`, templates as `settings["<id>"]`. Pinned at publish (`pins.settings`).
|
|
5403
|
+
*/
|
|
5404
|
+
settings?: Array<BlockRef>;
|
|
5405
|
+
modelSettings?: BlockRef;
|
|
5406
|
+
capabilities: Array<Capability>;
|
|
5407
|
+
tools: Array<ToolRef>;
|
|
5408
|
+
retrieval: Array<RetrievalIntent>;
|
|
5409
|
+
guardrails: Array<string>;
|
|
5410
|
+
/**
|
|
5411
|
+
* Soft hint — the router prefers this provider by id (e.g. `anthropic`) when at least one of its models satisfies `capabilities.needs` + tenant policy. Combine with `preferredModel` to pin the exact (provider, model) tuple.
|
|
5412
|
+
*/
|
|
5413
|
+
preferredProvider?: string;
|
|
5414
|
+
/**
|
|
5415
|
+
* Soft hint at the model level (`ModelInfo.name`). Combined with `preferredProvider` to pin an exact tuple; alone to select a model across every provider that exposes it.
|
|
5416
|
+
*/
|
|
5417
|
+
preferredModel?: string;
|
|
5418
|
+
conversationPolicy?: ConversationPolicy;
|
|
5419
|
+
budget?: TurnBudget;
|
|
5420
|
+
tags?: Array<string>;
|
|
5421
|
+
output?: AgentOutputSpec;
|
|
5422
|
+
toolErrors?: ToolErrorsSpec;
|
|
5423
|
+
};
|
|
5424
|
+
export type PublishAgentResult = {
|
|
5425
|
+
agentId: string;
|
|
5426
|
+
version: string;
|
|
5427
|
+
};
|
|
5428
|
+
export type UnregisterAgentResult = {
|
|
5429
|
+
agentId: string;
|
|
5430
|
+
version: string;
|
|
5431
|
+
unregistered: true;
|
|
5432
|
+
};
|
|
5433
|
+
export type ReinstateAgentVersionResult = {
|
|
5434
|
+
agentId: string;
|
|
5435
|
+
version: string;
|
|
5436
|
+
/**
|
|
5437
|
+
* `true` when this call un-tombstoned the version; `false` when it was already active (idempotent no-op).
|
|
5438
|
+
*/
|
|
5439
|
+
wasTombstoned: boolean;
|
|
5440
|
+
};
|
|
5441
|
+
export type AgentCollectionPage = {
|
|
5442
|
+
data: Array<Agent>;
|
|
5443
|
+
/**
|
|
5444
|
+
* Opaque cursor for the next page. Absent when `hasMore: false`.
|
|
5445
|
+
*/
|
|
5446
|
+
nextCursor?: string;
|
|
5447
|
+
hasMore: boolean;
|
|
5448
|
+
};
|
|
5449
|
+
export type FlowNode = {
|
|
4692
5450
|
id: string;
|
|
4693
5451
|
kind: "tool" | "agent" | "loop" | "fanout" | "subgraph";
|
|
4694
5452
|
/**
|
|
@@ -4731,6 +5489,16 @@ declare namespace Schemas {
|
|
|
4731
5489
|
edges: Array<FlowEdge>;
|
|
4732
5490
|
maxParallelism?: number;
|
|
4733
5491
|
metadata?: Record<string, unknown>;
|
|
5492
|
+
pins?: FlowPins;
|
|
5493
|
+
/**
|
|
5494
|
+
* Set by the runtime with `pins`: `sha256:<hex>` of the pins' canonical JSON (sorted keys, no whitespace).
|
|
5495
|
+
*/
|
|
5496
|
+
pinsDigest?: string;
|
|
5497
|
+
derivedFrom?: VersionDerivation;
|
|
5498
|
+
/**
|
|
5499
|
+
* Present only on an unregistered version (`GET …/versions/{version}` reads those too). Unregister stops a version being chosen, not the pins that hold it: a new run naming it is refused, while a resumed run and a published version that pins it still run it.
|
|
5500
|
+
*/
|
|
5501
|
+
unregisteredAt?: string;
|
|
4734
5502
|
};
|
|
4735
5503
|
/**
|
|
4736
5504
|
* Full flow definition. Validated server-side via `@kindgi/flow.loadFlow` — validation failures return `400 validation-failed` with the issue list under `details.issues`.
|
|
@@ -5741,6 +6509,10 @@ declare namespace Schemas {
|
|
|
5741
6509
|
* A fallback serves a capability only when no other provider satisfies it (e.g. `kindgi dev`'s scripted `dev-echo`); an agent turn routed to one carries a `fallback-provider` warning. Absent = `false`.
|
|
5742
6510
|
*/
|
|
5743
6511
|
fallback?: boolean;
|
|
6512
|
+
/**
|
|
6513
|
+
* Bookkeeping, such as who manages the provider; the router ignores labels. At most 32 keys; a key is 1-63 lowercase letters and digits, with `.`, `-`, `_` or `/` inside; a value is at most 256 characters. The convention key `kindgi.com/managed-by` names the manager (`kindgi-dev`, `kindgi-deploy:<environment>`). Out of bounds: `400 invalid-provider`, reason `invalid-labels`.
|
|
6514
|
+
*/
|
|
6515
|
+
labels?: Record<string, string>;
|
|
5744
6516
|
};
|
|
5745
6517
|
export type ProviderCollectionPage = {
|
|
5746
6518
|
data: Array<ProviderMetadata>;
|
|
@@ -6056,7 +6828,18 @@ declare namespace Schemas {
|
|
|
6056
6828
|
tokens: CostTokenTotals;
|
|
6057
6829
|
};
|
|
6058
6830
|
export type CostAggregateResult = {
|
|
6831
|
+
/**
|
|
6832
|
+
* The most expensive groups first (`totalUsd` descending, ties by key), at most `limit`.
|
|
6833
|
+
*/
|
|
6059
6834
|
groups: Array<CostAggregateGroup>;
|
|
6835
|
+
/**
|
|
6836
|
+
* How many groups there were before the `limit` cap. Absent from a runtime before 0.1.5.
|
|
6837
|
+
*/
|
|
6838
|
+
totalGroups?: number;
|
|
6839
|
+
/**
|
|
6840
|
+
* `true` when there were more groups than `limit`: `groups` holds the most expensive ones, and `totalUsd` / `totalRecords` / `tokens` still cover every record. Absent from a runtime before 0.1.5.
|
|
6841
|
+
*/
|
|
6842
|
+
truncated?: boolean;
|
|
6060
6843
|
totalUsd: number;
|
|
6061
6844
|
totalRecords: number;
|
|
6062
6845
|
tokens: CostTokenTotals;
|
|
@@ -6178,7 +6961,7 @@ declare namespace Schemas {
|
|
|
6178
6961
|
version: string;
|
|
6179
6962
|
wasTombstoned: boolean;
|
|
6180
6963
|
};
|
|
6181
|
-
export type EvalKind = "accuracy" | "pairwise" | "regression" | "human-review" | "benchmark" | "custom";
|
|
6964
|
+
export type EvalKind = "accuracy" | "pairwise" | "regression" | "human-review" | "benchmark" | "custom" | "judged";
|
|
6182
6965
|
export type EvalSuite = {
|
|
6183
6966
|
id: string;
|
|
6184
6967
|
tenantId: string;
|
|
@@ -6227,6 +7010,79 @@ declare namespace Schemas {
|
|
|
6227
7010
|
version: string;
|
|
6228
7011
|
wasTombstoned: boolean;
|
|
6229
7012
|
};
|
|
7013
|
+
/**
|
|
7014
|
+
* `prompt`: a Liquid template an agent renders as its instructions. `settings`: a JSON object tools and templates read.
|
|
7015
|
+
*/
|
|
7016
|
+
export type BlockKind = "prompt" | "settings";
|
|
7017
|
+
export type PromptBlockContent = {
|
|
7018
|
+
/**
|
|
7019
|
+
* Liquid, rendered as an agent's instructions are (same parameters and auto-injected variables).
|
|
7020
|
+
*/
|
|
7021
|
+
template: string;
|
|
7022
|
+
parameters?: Array<PromptParameter>;
|
|
7023
|
+
};
|
|
7024
|
+
export type SettingsBlockContent = {
|
|
7025
|
+
/**
|
|
7026
|
+
* What tools read (`ToolContext.settings[<block id>]`) and templates read (`settings.<block id>.<key>`).
|
|
7027
|
+
*/
|
|
7028
|
+
values: Record<string, unknown>;
|
|
7029
|
+
/**
|
|
7030
|
+
* JSON Schema (draft 2020-12) the values must satisfy. A later version's values must satisfy the latest version's schema too.
|
|
7031
|
+
*/
|
|
7032
|
+
schema?: Record<string, unknown>;
|
|
7033
|
+
};
|
|
7034
|
+
/**
|
|
7035
|
+
* A data block version: a prompt or settings, versioned like a tool (immutable versions, soft unregister). An agent version pins the block versions it uses when it is published. Belongs to one project and is authorized through it.
|
|
7036
|
+
*/
|
|
7037
|
+
export type Block = {
|
|
7038
|
+
/**
|
|
7039
|
+
* Dotted lowercase id (e.g. `acme.intake-prompt`).
|
|
7040
|
+
*/
|
|
7041
|
+
id: string;
|
|
7042
|
+
version: string;
|
|
7043
|
+
kind: BlockKind;
|
|
7044
|
+
description?: string;
|
|
7045
|
+
/**
|
|
7046
|
+
* `PromptBlockContent` for a prompt, `SettingsBlockContent` for settings.
|
|
7047
|
+
*/
|
|
7048
|
+
content: PromptBlockContent | SettingsBlockContent;
|
|
7049
|
+
projectId: string;
|
|
7050
|
+
publishedAt: string;
|
|
7051
|
+
/**
|
|
7052
|
+
* Present only on an unregistered version; agent versions that pin it still read it.
|
|
7053
|
+
*/
|
|
7054
|
+
unregisteredAt?: string;
|
|
7055
|
+
};
|
|
7056
|
+
export type BlockCollectionPage = {
|
|
7057
|
+
data: Array<Block>;
|
|
7058
|
+
nextCursor?: string;
|
|
7059
|
+
hasMore: boolean;
|
|
7060
|
+
};
|
|
7061
|
+
export type PublishBlockBody = {
|
|
7062
|
+
/**
|
|
7063
|
+
* Project this belongs to (its content scope). Required: missing, or not a project in the caller's tenant → `400 bad-input`.
|
|
7064
|
+
*/
|
|
7065
|
+
projectId: string;
|
|
7066
|
+
id: string;
|
|
7067
|
+
version: string;
|
|
7068
|
+
kind: BlockKind;
|
|
7069
|
+
description?: string;
|
|
7070
|
+
content: PromptBlockContent | SettingsBlockContent;
|
|
7071
|
+
};
|
|
7072
|
+
export type PublishBlockResult = {
|
|
7073
|
+
blockId: string;
|
|
7074
|
+
version: string;
|
|
7075
|
+
};
|
|
7076
|
+
export type UnregisterBlockResult = {
|
|
7077
|
+
blockId: string;
|
|
7078
|
+
version: string;
|
|
7079
|
+
unregistered: true;
|
|
7080
|
+
};
|
|
7081
|
+
export type ReinstateBlockResult = {
|
|
7082
|
+
blockId: string;
|
|
7083
|
+
version: string;
|
|
7084
|
+
wasTombstoned: boolean;
|
|
7085
|
+
};
|
|
6230
7086
|
export type EvalRunStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
6231
7087
|
export type EvalRunAgentRef = {
|
|
6232
7088
|
agentId: string;
|
|
@@ -6236,6 +7092,30 @@ declare namespace Schemas {
|
|
|
6236
7092
|
flowId: string;
|
|
6237
7093
|
version?: string;
|
|
6238
7094
|
};
|
|
7095
|
+
/**
|
|
7096
|
+
* What a comparison compares the candidate against: `'recorded'` (each case's recorded output, what was judged), a version (`{ agentId, version }`, replayed under the same rules), or the version live in a scope (`{ live: { projectId?, segments? } }`). Only `'recorded'` runs today; the others are refused when the run starts.
|
|
7097
|
+
*/
|
|
7098
|
+
export type EvalBaseline = "recorded" | {
|
|
7099
|
+
agentId: string;
|
|
7100
|
+
version: string;
|
|
7101
|
+
} | {
|
|
7102
|
+
live: Partial<{
|
|
7103
|
+
projectId: string;
|
|
7104
|
+
segments: Record<string, string>;
|
|
7105
|
+
}>;
|
|
7106
|
+
};
|
|
7107
|
+
/**
|
|
7108
|
+
* A comparison eval run's settings (a `judged` suite).
|
|
7109
|
+
*/
|
|
7110
|
+
export type EvalComparison = {
|
|
7111
|
+
baseline: EvalBaseline;
|
|
7112
|
+
/**
|
|
7113
|
+
* Whether replayed reads use the past run's results when it has them (`recorded`), or run live.
|
|
7114
|
+
*/
|
|
7115
|
+
reads: "recorded" | "live";
|
|
7116
|
+
repetitions: number;
|
|
7117
|
+
k: number;
|
|
7118
|
+
};
|
|
6239
7119
|
export type EvalRun = {
|
|
6240
7120
|
runId: string;
|
|
6241
7121
|
tenantId: string;
|
|
@@ -6249,11 +7129,12 @@ declare namespace Schemas {
|
|
|
6249
7129
|
startedAt: string;
|
|
6250
7130
|
completedAt?: string;
|
|
6251
7131
|
/**
|
|
6252
|
-
* Kind-specific opaque JSON. For `accuracy`, contains `{ passCount, totalCount, meanScore, perCase[] }`. Other kinds define their own shapes as their dispatchers ship.
|
|
7132
|
+
* Kind-specific opaque JSON. For `accuracy`, contains `{ passCount, totalCount, meanScore, perCase[] }`. For `judged` (a comparison), `{ summary, perCase[] }`: the summary has the baseline (the versions behind the recorded runs) and the candidate (`{ kind: "agent", agentId, version }` or `{ kind: "flow", flowId, version }`), the case counts (`cases`, `diverged`, `refusedWrites`, `errors`, and `stopped`: flow cases that stopped at a write the replay refused, left out of the metrics), the models that answered, and `metrics` (`weightedYesShare`, `judgedCoverage`, `weightedPrecisionAtK`, each `{ baseline, candidate, delta, n, weight, baselineN, baselineWeight, direction, k?, spread? }`); each case has its replay runs, the scores, the items kept, dropped and new, the tool calls with what happened to each, and `stopped` (what it would have done) when it stopped. Other kinds define their own shapes as their dispatchers ship.
|
|
6253
7133
|
*/
|
|
6254
7134
|
result?: Record<string, unknown>;
|
|
6255
7135
|
error?: string;
|
|
6256
7136
|
correlationId?: string;
|
|
7137
|
+
comparison?: EvalComparison;
|
|
6257
7138
|
};
|
|
6258
7139
|
export type EvalRunCollectionPage = {
|
|
6259
7140
|
data: Array<EvalRun>;
|
|
@@ -6261,7 +7142,7 @@ declare namespace Schemas {
|
|
|
6261
7142
|
hasMore: boolean;
|
|
6262
7143
|
};
|
|
6263
7144
|
/**
|
|
6264
|
-
* Exactly one of `agentRef` or `flowRef` MUST be supplied. `dryRun: true` returns a plan preview without invoking the subject.
|
|
7145
|
+
* Exactly one of `agentRef` or `flowRef` MUST be supplied. `dryRun: true` returns a plan preview without invoking the subject. For a `judged` suite (a test set), the run is a comparison: `agentRef` or `flowRef` with its `version` is the candidate, replayed on each case without doing anything the past run didn't (a flow stops at a write the replay refuses); `baseline` (default `'recorded'`), `reads` (default `recorded`), `repetitions` (default 1) and `k` (default 10) set how.
|
|
6265
7146
|
*/
|
|
6266
7147
|
export type StartEvalRunBody = {
|
|
6267
7148
|
/**
|
|
@@ -6272,6 +7153,10 @@ declare namespace Schemas {
|
|
|
6272
7153
|
flowRef?: EvalRunFlowRef;
|
|
6273
7154
|
dryRun?: boolean;
|
|
6274
7155
|
correlationId?: string;
|
|
7156
|
+
baseline?: EvalBaseline;
|
|
7157
|
+
reads?: "recorded" | "live";
|
|
7158
|
+
repetitions?: number;
|
|
7159
|
+
k?: number;
|
|
6275
7160
|
};
|
|
6276
7161
|
export type StartEvalRunResult = {
|
|
6277
7162
|
runId: string;
|
|
@@ -6443,16 +7328,48 @@ declare namespace Schemas {
|
|
|
6443
7328
|
agents: Array<{
|
|
6444
7329
|
id: string;
|
|
6445
7330
|
/**
|
|
6446
|
-
*
|
|
7331
|
+
* The version the agent is registered as.
|
|
6447
7332
|
*/
|
|
6448
|
-
version
|
|
7333
|
+
version: string;
|
|
7334
|
+
/**
|
|
7335
|
+
* The version the agent's or flow's definition names, present when it differs from `version`: that version was registered already with other pins or content, and versions never change, so the deploy registered the next free version in its line (or an earlier deploy did).
|
|
7336
|
+
*/
|
|
7337
|
+
authoredVersion?: string;
|
|
7338
|
+
/**
|
|
7339
|
+
* Why `version` differs from `authoredVersion`: `pins-changed` (a tool or agent it uses has a new version), `unpinned` (`authoredVersion` was published before pins existed), `version-taken` (`authoredVersion` is registered with other content).
|
|
7340
|
+
*/
|
|
7341
|
+
reason?: "pins-changed" | "unpinned" | "version-taken";
|
|
7342
|
+
/**
|
|
7343
|
+
* `true`: this deploy registered `version`; `false`: an earlier deploy did.
|
|
7344
|
+
*/
|
|
7345
|
+
newVersion?: boolean;
|
|
7346
|
+
/**
|
|
7347
|
+
* For `pins-changed`: the pins that differ from `authoredVersion`'s.
|
|
7348
|
+
*/
|
|
7349
|
+
pinChanges?: Array<PinChange>;
|
|
6449
7350
|
}>;
|
|
6450
7351
|
flows: Array<{
|
|
6451
7352
|
id: string;
|
|
6452
7353
|
/**
|
|
6453
|
-
*
|
|
7354
|
+
* The version the agent is registered as.
|
|
6454
7355
|
*/
|
|
6455
|
-
version
|
|
7356
|
+
version: string;
|
|
7357
|
+
/**
|
|
7358
|
+
* The version the agent's or flow's definition names, present when it differs from `version`: that version was registered already with other pins or content, and versions never change, so the deploy registered the next free version in its line (or an earlier deploy did).
|
|
7359
|
+
*/
|
|
7360
|
+
authoredVersion?: string;
|
|
7361
|
+
/**
|
|
7362
|
+
* Why `version` differs from `authoredVersion`: `pins-changed` (a tool or agent it uses has a new version), `unpinned` (`authoredVersion` was published before pins existed), `version-taken` (`authoredVersion` is registered with other content).
|
|
7363
|
+
*/
|
|
7364
|
+
reason?: "pins-changed" | "unpinned" | "version-taken";
|
|
7365
|
+
/**
|
|
7366
|
+
* `true`: this deploy registered `version`; `false`: an earlier deploy did.
|
|
7367
|
+
*/
|
|
7368
|
+
newVersion?: boolean;
|
|
7369
|
+
/**
|
|
7370
|
+
* For `pins-changed`: the pins that differ from `authoredVersion`'s.
|
|
7371
|
+
*/
|
|
7372
|
+
pinChanges?: Array<PinChange>;
|
|
6456
7373
|
}>;
|
|
6457
7374
|
};
|
|
6458
7375
|
export type DeploymentRecord = {
|
|
@@ -7362,13 +8279,160 @@ declare const MintPublicRunTokenResult: z.ZodObject<{
|
|
|
7362
8279
|
expiresAt: z.ZodISODateTime;
|
|
7363
8280
|
runIds: z.ZodArray<z.ZodString>;
|
|
7364
8281
|
}, z.core.$strict>;
|
|
8282
|
+
export type JudgedEvalCase = Schemas.JudgedEvalCase;
|
|
8283
|
+
declare const JudgedEvalCase: z.ZodObject<{
|
|
8284
|
+
caseId: z.ZodString;
|
|
8285
|
+
subject: z.ZodObject<{
|
|
8286
|
+
kind: z.ZodEnum<{
|
|
8287
|
+
agent: "agent";
|
|
8288
|
+
flow: "flow";
|
|
8289
|
+
}>;
|
|
8290
|
+
id: z.ZodString;
|
|
8291
|
+
version: z.ZodString;
|
|
8292
|
+
}, z.core.$strict>;
|
|
8293
|
+
input: z.ZodUnknown;
|
|
8294
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
8295
|
+
history: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
8296
|
+
historyTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
8297
|
+
retrieved: z.ZodOptional<z.ZodUnknown>;
|
|
8298
|
+
sessionApproval: z.ZodOptional<z.ZodObject<{
|
|
8299
|
+
approved: z.ZodBoolean;
|
|
8300
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
8301
|
+
}, z.core.$strict>>;
|
|
8302
|
+
flow: z.ZodOptional<z.ZodObject<{
|
|
8303
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
8304
|
+
runId: z.ZodString;
|
|
8305
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
8306
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
8307
|
+
toolId: z.ZodString;
|
|
8308
|
+
arguments: z.ZodOptional<z.ZodUnknown>;
|
|
8309
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
8310
|
+
}, z.core.$strict>>;
|
|
8311
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
8312
|
+
runId: z.ZodString;
|
|
8313
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
8314
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
8315
|
+
agentId: z.ZodString;
|
|
8316
|
+
agentVersion: z.ZodString;
|
|
8317
|
+
retrieved: z.ZodOptional<z.ZodUnknown>;
|
|
8318
|
+
}, z.core.$strict>>;
|
|
8319
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
8320
|
+
}, z.core.$strict>>;
|
|
8321
|
+
}, z.core.$strict>>;
|
|
8322
|
+
output: z.ZodUnknown;
|
|
8323
|
+
items: z.ZodArray<z.ZodObject<{
|
|
8324
|
+
key: z.ZodString;
|
|
8325
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
8326
|
+
rank: z.ZodOptional<z.ZodNumber>;
|
|
8327
|
+
yes: z.ZodNumber;
|
|
8328
|
+
no: z.ZodNumber;
|
|
8329
|
+
yesWeight: z.ZodNumber;
|
|
8330
|
+
totalWeight: z.ZodNumber;
|
|
8331
|
+
reasons: z.ZodArray<z.ZodObject<{
|
|
8332
|
+
verdict: z.ZodEnum<{
|
|
8333
|
+
yes: "yes";
|
|
8334
|
+
no: "no";
|
|
8335
|
+
}>;
|
|
8336
|
+
reason: z.ZodString;
|
|
8337
|
+
}, z.core.$strict>>;
|
|
8338
|
+
}, z.core.$strict>>;
|
|
8339
|
+
}, z.core.$strict>;
|
|
8340
|
+
export type JudgedEvalCaseCollectionPage = Schemas.JudgedEvalCaseCollectionPage;
|
|
8341
|
+
declare const JudgedEvalCaseCollectionPage: z.ZodObject<{
|
|
8342
|
+
data: z.ZodArray<z.ZodObject<{
|
|
8343
|
+
caseId: z.ZodString;
|
|
8344
|
+
subject: z.ZodObject<{
|
|
8345
|
+
kind: z.ZodEnum<{
|
|
8346
|
+
agent: "agent";
|
|
8347
|
+
flow: "flow";
|
|
8348
|
+
}>;
|
|
8349
|
+
id: z.ZodString;
|
|
8350
|
+
version: z.ZodString;
|
|
8351
|
+
}, z.core.$strict>;
|
|
8352
|
+
input: z.ZodUnknown;
|
|
8353
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
8354
|
+
history: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
8355
|
+
historyTruncated: z.ZodOptional<z.ZodBoolean>;
|
|
8356
|
+
retrieved: z.ZodOptional<z.ZodUnknown>;
|
|
8357
|
+
sessionApproval: z.ZodOptional<z.ZodObject<{
|
|
8358
|
+
approved: z.ZodBoolean;
|
|
8359
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
8360
|
+
}, z.core.$strict>>;
|
|
8361
|
+
flow: z.ZodOptional<z.ZodObject<{
|
|
8362
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
8363
|
+
runId: z.ZodString;
|
|
8364
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
8365
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
8366
|
+
toolId: z.ZodString;
|
|
8367
|
+
arguments: z.ZodOptional<z.ZodUnknown>;
|
|
8368
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
8369
|
+
}, z.core.$strict>>;
|
|
8370
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
8371
|
+
runId: z.ZodString;
|
|
8372
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
8373
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
8374
|
+
agentId: z.ZodString;
|
|
8375
|
+
agentVersion: z.ZodString;
|
|
8376
|
+
retrieved: z.ZodOptional<z.ZodUnknown>;
|
|
8377
|
+
}, z.core.$strict>>;
|
|
8378
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
8379
|
+
}, z.core.$strict>>;
|
|
8380
|
+
}, z.core.$strict>>;
|
|
8381
|
+
output: z.ZodUnknown;
|
|
8382
|
+
items: z.ZodArray<z.ZodObject<{
|
|
8383
|
+
key: z.ZodString;
|
|
8384
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
8385
|
+
rank: z.ZodOptional<z.ZodNumber>;
|
|
8386
|
+
yes: z.ZodNumber;
|
|
8387
|
+
no: z.ZodNumber;
|
|
8388
|
+
yesWeight: z.ZodNumber;
|
|
8389
|
+
totalWeight: z.ZodNumber;
|
|
8390
|
+
reasons: z.ZodArray<z.ZodObject<{
|
|
8391
|
+
verdict: z.ZodEnum<{
|
|
8392
|
+
yes: "yes";
|
|
8393
|
+
no: "no";
|
|
8394
|
+
}>;
|
|
8395
|
+
reason: z.ZodString;
|
|
8396
|
+
}, z.core.$strict>>;
|
|
8397
|
+
}, z.core.$strict>>;
|
|
8398
|
+
}, z.core.$strict>>;
|
|
8399
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
8400
|
+
hasMore: z.ZodBoolean;
|
|
8401
|
+
}, z.core.$strict>;
|
|
8402
|
+
export type BuildJudgedSuiteBody = Schemas.BuildJudgedSuiteBody;
|
|
8403
|
+
declare const BuildJudgedSuiteBody: z.ZodObject<{
|
|
8404
|
+
version: z.ZodString;
|
|
8405
|
+
projectId: z.ZodString;
|
|
8406
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
8407
|
+
agentVersion: z.ZodOptional<z.ZodString>;
|
|
8408
|
+
flowId: z.ZodOptional<z.ZodString>;
|
|
8409
|
+
since: z.ZodOptional<z.ZodISODateTime>;
|
|
8410
|
+
until: z.ZodOptional<z.ZodISODateTime>;
|
|
8411
|
+
judgeClassIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8412
|
+
minJudgments: z.ZodOptional<z.ZodNumber>;
|
|
8413
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8414
|
+
}, z.core.$strict>;
|
|
8415
|
+
export type BuildJudgedSuiteResult = Schemas.BuildJudgedSuiteResult;
|
|
8416
|
+
declare const BuildJudgedSuiteResult: z.ZodObject<{
|
|
8417
|
+
suiteId: z.ZodString;
|
|
8418
|
+
version: z.ZodString;
|
|
8419
|
+
kind: z.ZodLiteral<"judged">;
|
|
8420
|
+
caseCount: z.ZodNumber;
|
|
8421
|
+
truncated: z.ZodBoolean;
|
|
8422
|
+
}, z.core.$strict>;
|
|
7365
8423
|
type Agent$1 = Schemas.Agent;
|
|
7366
8424
|
declare const Agent$1: z.ZodObject<{
|
|
7367
8425
|
id: z.ZodString;
|
|
7368
8426
|
version: z.ZodString;
|
|
7369
8427
|
name: z.ZodString;
|
|
7370
8428
|
description: z.ZodOptional<z.ZodString>;
|
|
7371
|
-
instructions: z.
|
|
8429
|
+
instructions: z.ZodUnion<readonly [
|
|
8430
|
+
z.ZodString,
|
|
8431
|
+
z.ZodObject<{
|
|
8432
|
+
prompt: z.ZodString;
|
|
8433
|
+
version: z.ZodString;
|
|
8434
|
+
}, z.core.$strict>
|
|
8435
|
+
]>;
|
|
7372
8436
|
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7373
8437
|
name: z.ZodString;
|
|
7374
8438
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -7381,6 +8445,14 @@ declare const Agent$1: z.ZodObject<{
|
|
|
7381
8445
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
7382
8446
|
default: z.ZodOptional<z.ZodUnknown>;
|
|
7383
8447
|
}, z.core.$strict>>>;
|
|
8448
|
+
settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8449
|
+
id: z.ZodString;
|
|
8450
|
+
version: z.ZodString;
|
|
8451
|
+
}, z.core.$strict>>>;
|
|
8452
|
+
modelSettings: z.ZodOptional<z.ZodObject<{
|
|
8453
|
+
id: z.ZodString;
|
|
8454
|
+
version: z.ZodString;
|
|
8455
|
+
}, z.core.$strict>>;
|
|
7384
8456
|
capabilities: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7385
8457
|
tools: z.ZodArray<z.ZodObject<{
|
|
7386
8458
|
id: z.ZodString;
|
|
@@ -7427,6 +8499,34 @@ declare const Agent$1: z.ZodObject<{
|
|
|
7427
8499
|
"unknown-tool": "unknown-tool";
|
|
7428
8500
|
}>>>;
|
|
7429
8501
|
}, z.core.$strict>>;
|
|
8502
|
+
pins: z.ZodOptional<z.ZodObject<{
|
|
8503
|
+
tools: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8504
|
+
prompts: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8505
|
+
settings: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8506
|
+
}, z.core.$strict>>;
|
|
8507
|
+
derivedFrom: z.ZodOptional<z.ZodObject<{
|
|
8508
|
+
version: z.ZodString;
|
|
8509
|
+
reason: z.ZodEnum<{
|
|
8510
|
+
"pins-changed": "pins-changed";
|
|
8511
|
+
unpinned: "unpinned";
|
|
8512
|
+
"version-taken": "version-taken";
|
|
8513
|
+
edited: "edited";
|
|
8514
|
+
}>;
|
|
8515
|
+
label: z.ZodOptional<z.ZodString>;
|
|
8516
|
+
by: z.ZodOptional<z.ZodString>;
|
|
8517
|
+
}, z.core.$strict>>;
|
|
8518
|
+
unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
8519
|
+
pinsDigest: z.ZodOptional<z.ZodString>;
|
|
8520
|
+
}, z.core.$strict>;
|
|
8521
|
+
export type DeriveAgentVersionBody = Schemas.DeriveAgentVersionBody;
|
|
8522
|
+
declare const DeriveAgentVersionBody: z.ZodObject<{
|
|
8523
|
+
from: z.ZodString;
|
|
8524
|
+
pins: z.ZodObject<{
|
|
8525
|
+
prompts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8526
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8527
|
+
}, z.core.$strict>;
|
|
8528
|
+
label: z.ZodOptional<z.ZodString>;
|
|
8529
|
+
projectId: z.ZodOptional<z.ZodUUID>;
|
|
7430
8530
|
}, z.core.$strict>;
|
|
7431
8531
|
export type UnregisterAgentResult = Schemas.UnregisterAgentResult;
|
|
7432
8532
|
declare const UnregisterAgentResult: z.ZodObject<{
|
|
@@ -7441,7 +8541,13 @@ declare const AgentCollectionPage: z.ZodObject<{
|
|
|
7441
8541
|
version: z.ZodString;
|
|
7442
8542
|
name: z.ZodString;
|
|
7443
8543
|
description: z.ZodOptional<z.ZodString>;
|
|
7444
|
-
instructions: z.
|
|
8544
|
+
instructions: z.ZodUnion<readonly [
|
|
8545
|
+
z.ZodString,
|
|
8546
|
+
z.ZodObject<{
|
|
8547
|
+
prompt: z.ZodString;
|
|
8548
|
+
version: z.ZodString;
|
|
8549
|
+
}, z.core.$strict>
|
|
8550
|
+
]>;
|
|
7445
8551
|
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7446
8552
|
name: z.ZodString;
|
|
7447
8553
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -7454,6 +8560,14 @@ declare const AgentCollectionPage: z.ZodObject<{
|
|
|
7454
8560
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
7455
8561
|
default: z.ZodOptional<z.ZodUnknown>;
|
|
7456
8562
|
}, z.core.$strict>>>;
|
|
8563
|
+
settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8564
|
+
id: z.ZodString;
|
|
8565
|
+
version: z.ZodString;
|
|
8566
|
+
}, z.core.$strict>>>;
|
|
8567
|
+
modelSettings: z.ZodOptional<z.ZodObject<{
|
|
8568
|
+
id: z.ZodString;
|
|
8569
|
+
version: z.ZodString;
|
|
8570
|
+
}, z.core.$strict>>;
|
|
7457
8571
|
capabilities: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7458
8572
|
tools: z.ZodArray<z.ZodObject<{
|
|
7459
8573
|
id: z.ZodString;
|
|
@@ -7500,6 +8614,24 @@ declare const AgentCollectionPage: z.ZodObject<{
|
|
|
7500
8614
|
"unknown-tool": "unknown-tool";
|
|
7501
8615
|
}>>>;
|
|
7502
8616
|
}, z.core.$strict>>;
|
|
8617
|
+
pins: z.ZodOptional<z.ZodObject<{
|
|
8618
|
+
tools: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8619
|
+
prompts: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8620
|
+
settings: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
8621
|
+
}, z.core.$strict>>;
|
|
8622
|
+
derivedFrom: z.ZodOptional<z.ZodObject<{
|
|
8623
|
+
version: z.ZodString;
|
|
8624
|
+
reason: z.ZodEnum<{
|
|
8625
|
+
"pins-changed": "pins-changed";
|
|
8626
|
+
unpinned: "unpinned";
|
|
8627
|
+
"version-taken": "version-taken";
|
|
8628
|
+
edited: "edited";
|
|
8629
|
+
}>;
|
|
8630
|
+
label: z.ZodOptional<z.ZodString>;
|
|
8631
|
+
by: z.ZodOptional<z.ZodString>;
|
|
8632
|
+
}, z.core.$strict>>;
|
|
8633
|
+
unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
8634
|
+
pinsDigest: z.ZodOptional<z.ZodString>;
|
|
7503
8635
|
}, z.core.$strict>>;
|
|
7504
8636
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
7505
8637
|
hasMore: z.ZodBoolean;
|
|
@@ -7538,6 +8670,7 @@ declare const ProviderMetadata: z.ZodObject<{
|
|
|
7538
8670
|
description: z.ZodOptional<z.ZodString>;
|
|
7539
8671
|
capabilityKind: z.ZodOptional<z.ZodString>;
|
|
7540
8672
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
8673
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7541
8674
|
}, z.core.$strict>;
|
|
7542
8675
|
export type ProviderCollectionPage = Schemas.ProviderCollectionPage;
|
|
7543
8676
|
declare const ProviderCollectionPage: z.ZodObject<{
|
|
@@ -7574,6 +8707,7 @@ declare const ProviderCollectionPage: z.ZodObject<{
|
|
|
7574
8707
|
description: z.ZodOptional<z.ZodString>;
|
|
7575
8708
|
capabilityKind: z.ZodOptional<z.ZodString>;
|
|
7576
8709
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
8710
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7577
8711
|
}, z.core.$strict>>;
|
|
7578
8712
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
7579
8713
|
hasMore: z.ZodBoolean;
|
|
@@ -7613,6 +8747,7 @@ declare const RegisterProviderBody: z.ZodObject<{
|
|
|
7613
8747
|
description: z.ZodOptional<z.ZodString>;
|
|
7614
8748
|
capabilityKind: z.ZodOptional<z.ZodString>;
|
|
7615
8749
|
fallback: z.ZodOptional<z.ZodBoolean>;
|
|
8750
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7616
8751
|
}, z.core.$strict>;
|
|
7617
8752
|
adapter_id: z.ZodString;
|
|
7618
8753
|
secret_ref: z.ZodOptional<z.ZodObject<{
|
|
@@ -7675,6 +8810,7 @@ declare const EvalKind: z.ZodEnum<{
|
|
|
7675
8810
|
"human-review": "human-review";
|
|
7676
8811
|
benchmark: "benchmark";
|
|
7677
8812
|
custom: "custom";
|
|
8813
|
+
judged: "judged";
|
|
7678
8814
|
}>;
|
|
7679
8815
|
export type EvalSuite = Schemas.EvalSuite;
|
|
7680
8816
|
declare const EvalSuite: z.ZodObject<{
|
|
@@ -7688,6 +8824,7 @@ declare const EvalSuite: z.ZodObject<{
|
|
|
7688
8824
|
"human-review": "human-review";
|
|
7689
8825
|
benchmark: "benchmark";
|
|
7690
8826
|
custom: "custom";
|
|
8827
|
+
judged: "judged";
|
|
7691
8828
|
}>;
|
|
7692
8829
|
description: z.ZodOptional<z.ZodString>;
|
|
7693
8830
|
spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -7705,6 +8842,7 @@ declare const EvalSuiteCollectionPage: z.ZodObject<{
|
|
|
7705
8842
|
"human-review": "human-review";
|
|
7706
8843
|
benchmark: "benchmark";
|
|
7707
8844
|
custom: "custom";
|
|
8845
|
+
judged: "judged";
|
|
7708
8846
|
}>;
|
|
7709
8847
|
description: z.ZodOptional<z.ZodString>;
|
|
7710
8848
|
spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -7725,6 +8863,7 @@ declare const PublishEvalSuiteBody: z.ZodObject<{
|
|
|
7725
8863
|
"human-review": "human-review";
|
|
7726
8864
|
benchmark: "benchmark";
|
|
7727
8865
|
custom: "custom";
|
|
8866
|
+
judged: "judged";
|
|
7728
8867
|
}>;
|
|
7729
8868
|
description: z.ZodOptional<z.ZodString>;
|
|
7730
8869
|
spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -7746,6 +8885,132 @@ declare const ReinstateEvalSuiteVersionResult: z.ZodObject<{
|
|
|
7746
8885
|
version: z.ZodString;
|
|
7747
8886
|
wasTombstoned: z.ZodBoolean;
|
|
7748
8887
|
}, z.core.$strict>;
|
|
8888
|
+
export type BlockKind = Schemas.BlockKind;
|
|
8889
|
+
export declare const BlockKind: z.ZodEnum<{
|
|
8890
|
+
prompt: "prompt";
|
|
8891
|
+
settings: "settings";
|
|
8892
|
+
}>;
|
|
8893
|
+
export type Block = Schemas.Block;
|
|
8894
|
+
export declare const Block: z.ZodObject<{
|
|
8895
|
+
id: z.ZodString;
|
|
8896
|
+
version: z.ZodString;
|
|
8897
|
+
kind: z.ZodEnum<{
|
|
8898
|
+
prompt: "prompt";
|
|
8899
|
+
settings: "settings";
|
|
8900
|
+
}>;
|
|
8901
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8902
|
+
content: z.ZodUnion<readonly [
|
|
8903
|
+
z.ZodObject<{
|
|
8904
|
+
template: z.ZodString;
|
|
8905
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8906
|
+
name: z.ZodString;
|
|
8907
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8908
|
+
type: z.ZodEnum<{
|
|
8909
|
+
string: "string";
|
|
8910
|
+
number: "number";
|
|
8911
|
+
boolean: "boolean";
|
|
8912
|
+
date: "date";
|
|
8913
|
+
}>;
|
|
8914
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
8915
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
8916
|
+
}, z.core.$strict>>>;
|
|
8917
|
+
}, z.core.$strict>,
|
|
8918
|
+
z.ZodObject<{
|
|
8919
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8920
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8921
|
+
}, z.core.$strict>
|
|
8922
|
+
]>;
|
|
8923
|
+
projectId: z.ZodUUID;
|
|
8924
|
+
publishedAt: z.ZodISODateTime;
|
|
8925
|
+
unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
8926
|
+
}, z.core.$strict>;
|
|
8927
|
+
export type BlockCollectionPage = Schemas.BlockCollectionPage;
|
|
8928
|
+
declare const BlockCollectionPage: z.ZodObject<{
|
|
8929
|
+
data: z.ZodArray<z.ZodObject<{
|
|
8930
|
+
id: z.ZodString;
|
|
8931
|
+
version: z.ZodString;
|
|
8932
|
+
kind: z.ZodEnum<{
|
|
8933
|
+
prompt: "prompt";
|
|
8934
|
+
settings: "settings";
|
|
8935
|
+
}>;
|
|
8936
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8937
|
+
content: z.ZodUnion<readonly [
|
|
8938
|
+
z.ZodObject<{
|
|
8939
|
+
template: z.ZodString;
|
|
8940
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8941
|
+
name: z.ZodString;
|
|
8942
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8943
|
+
type: z.ZodEnum<{
|
|
8944
|
+
string: "string";
|
|
8945
|
+
number: "number";
|
|
8946
|
+
boolean: "boolean";
|
|
8947
|
+
date: "date";
|
|
8948
|
+
}>;
|
|
8949
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
8950
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
8951
|
+
}, z.core.$strict>>>;
|
|
8952
|
+
}, z.core.$strict>,
|
|
8953
|
+
z.ZodObject<{
|
|
8954
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8955
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8956
|
+
}, z.core.$strict>
|
|
8957
|
+
]>;
|
|
8958
|
+
projectId: z.ZodUUID;
|
|
8959
|
+
publishedAt: z.ZodISODateTime;
|
|
8960
|
+
unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
8961
|
+
}, z.core.$strict>>;
|
|
8962
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
8963
|
+
hasMore: z.ZodBoolean;
|
|
8964
|
+
}, z.core.$strict>;
|
|
8965
|
+
export type PublishBlockBody = Schemas.PublishBlockBody;
|
|
8966
|
+
declare const PublishBlockBody: z.ZodObject<{
|
|
8967
|
+
projectId: z.ZodUUID;
|
|
8968
|
+
id: z.ZodString;
|
|
8969
|
+
version: z.ZodString;
|
|
8970
|
+
kind: z.ZodEnum<{
|
|
8971
|
+
prompt: "prompt";
|
|
8972
|
+
settings: "settings";
|
|
8973
|
+
}>;
|
|
8974
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8975
|
+
content: z.ZodUnion<readonly [
|
|
8976
|
+
z.ZodObject<{
|
|
8977
|
+
template: z.ZodString;
|
|
8978
|
+
parameters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8979
|
+
name: z.ZodString;
|
|
8980
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8981
|
+
type: z.ZodEnum<{
|
|
8982
|
+
string: "string";
|
|
8983
|
+
number: "number";
|
|
8984
|
+
boolean: "boolean";
|
|
8985
|
+
date: "date";
|
|
8986
|
+
}>;
|
|
8987
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
8988
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
8989
|
+
}, z.core.$strict>>>;
|
|
8990
|
+
}, z.core.$strict>,
|
|
8991
|
+
z.ZodObject<{
|
|
8992
|
+
values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8993
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8994
|
+
}, z.core.$strict>
|
|
8995
|
+
]>;
|
|
8996
|
+
}, z.core.$strict>;
|
|
8997
|
+
export type PublishBlockResult = Schemas.PublishBlockResult;
|
|
8998
|
+
export declare const PublishBlockResult: z.ZodObject<{
|
|
8999
|
+
blockId: z.ZodString;
|
|
9000
|
+
version: z.ZodString;
|
|
9001
|
+
}, z.core.$strict>;
|
|
9002
|
+
export type UnregisterBlockResult = Schemas.UnregisterBlockResult;
|
|
9003
|
+
export declare const UnregisterBlockResult: z.ZodObject<{
|
|
9004
|
+
blockId: z.ZodString;
|
|
9005
|
+
version: z.ZodString;
|
|
9006
|
+
unregistered: z.ZodLiteral<true>;
|
|
9007
|
+
}, z.core.$strict>;
|
|
9008
|
+
export type ReinstateBlockResult = Schemas.ReinstateBlockResult;
|
|
9009
|
+
export declare const ReinstateBlockResult: z.ZodObject<{
|
|
9010
|
+
blockId: z.ZodString;
|
|
9011
|
+
version: z.ZodString;
|
|
9012
|
+
wasTombstoned: z.ZodBoolean;
|
|
9013
|
+
}, z.core.$strict>;
|
|
7749
9014
|
export type EvalRunStatus = Schemas.EvalRunStatus;
|
|
7750
9015
|
declare const EvalRunStatus: z.ZodEnum<{
|
|
7751
9016
|
pending: "pending";
|
|
@@ -7767,6 +9032,7 @@ declare const EvalRun: z.ZodObject<{
|
|
|
7767
9032
|
"human-review": "human-review";
|
|
7768
9033
|
benchmark: "benchmark";
|
|
7769
9034
|
custom: "custom";
|
|
9035
|
+
judged: "judged";
|
|
7770
9036
|
}>;
|
|
7771
9037
|
agentRef: z.ZodOptional<z.ZodObject<{
|
|
7772
9038
|
agentId: z.ZodString;
|
|
@@ -7789,6 +9055,27 @@ declare const EvalRun: z.ZodObject<{
|
|
|
7789
9055
|
result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7790
9056
|
error: z.ZodOptional<z.ZodString>;
|
|
7791
9057
|
correlationId: z.ZodOptional<z.ZodString>;
|
|
9058
|
+
comparison: z.ZodOptional<z.ZodObject<{
|
|
9059
|
+
baseline: z.ZodUnion<readonly [
|
|
9060
|
+
z.ZodLiteral<"recorded">,
|
|
9061
|
+
z.ZodObject<{
|
|
9062
|
+
agentId: z.ZodString;
|
|
9063
|
+
version: z.ZodString;
|
|
9064
|
+
}, z.core.$strict>,
|
|
9065
|
+
z.ZodObject<{
|
|
9066
|
+
live: z.ZodObject<{
|
|
9067
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
9068
|
+
segments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
9069
|
+
}, z.core.$strict>;
|
|
9070
|
+
}, z.core.$strict>
|
|
9071
|
+
]>;
|
|
9072
|
+
reads: z.ZodEnum<{
|
|
9073
|
+
recorded: "recorded";
|
|
9074
|
+
live: "live";
|
|
9075
|
+
}>;
|
|
9076
|
+
repetitions: z.ZodNumber;
|
|
9077
|
+
k: z.ZodNumber;
|
|
9078
|
+
}, z.core.$strict>>;
|
|
7792
9079
|
}, z.core.$strict>;
|
|
7793
9080
|
export type EvalRunCollectionPage = Schemas.EvalRunCollectionPage;
|
|
7794
9081
|
declare const EvalRunCollectionPage: z.ZodObject<{
|
|
@@ -7804,6 +9091,7 @@ declare const EvalRunCollectionPage: z.ZodObject<{
|
|
|
7804
9091
|
"human-review": "human-review";
|
|
7805
9092
|
benchmark: "benchmark";
|
|
7806
9093
|
custom: "custom";
|
|
9094
|
+
judged: "judged";
|
|
7807
9095
|
}>;
|
|
7808
9096
|
agentRef: z.ZodOptional<z.ZodObject<{
|
|
7809
9097
|
agentId: z.ZodString;
|
|
@@ -7826,6 +9114,27 @@ declare const EvalRunCollectionPage: z.ZodObject<{
|
|
|
7826
9114
|
result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7827
9115
|
error: z.ZodOptional<z.ZodString>;
|
|
7828
9116
|
correlationId: z.ZodOptional<z.ZodString>;
|
|
9117
|
+
comparison: z.ZodOptional<z.ZodObject<{
|
|
9118
|
+
baseline: z.ZodUnion<readonly [
|
|
9119
|
+
z.ZodLiteral<"recorded">,
|
|
9120
|
+
z.ZodObject<{
|
|
9121
|
+
agentId: z.ZodString;
|
|
9122
|
+
version: z.ZodString;
|
|
9123
|
+
}, z.core.$strict>,
|
|
9124
|
+
z.ZodObject<{
|
|
9125
|
+
live: z.ZodObject<{
|
|
9126
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
9127
|
+
segments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
9128
|
+
}, z.core.$strict>;
|
|
9129
|
+
}, z.core.$strict>
|
|
9130
|
+
]>;
|
|
9131
|
+
reads: z.ZodEnum<{
|
|
9132
|
+
recorded: "recorded";
|
|
9133
|
+
live: "live";
|
|
9134
|
+
}>;
|
|
9135
|
+
repetitions: z.ZodNumber;
|
|
9136
|
+
k: z.ZodNumber;
|
|
9137
|
+
}, z.core.$strict>>;
|
|
7829
9138
|
}, z.core.$strict>>;
|
|
7830
9139
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
7831
9140
|
hasMore: z.ZodBoolean;
|
|
@@ -7843,6 +9152,25 @@ declare const StartEvalRunBody: z.ZodObject<{
|
|
|
7843
9152
|
}, z.core.$strict>>;
|
|
7844
9153
|
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
7845
9154
|
correlationId: z.ZodOptional<z.ZodString>;
|
|
9155
|
+
baseline: z.ZodOptional<z.ZodUnion<readonly [
|
|
9156
|
+
z.ZodLiteral<"recorded">,
|
|
9157
|
+
z.ZodObject<{
|
|
9158
|
+
agentId: z.ZodString;
|
|
9159
|
+
version: z.ZodString;
|
|
9160
|
+
}, z.core.$strict>,
|
|
9161
|
+
z.ZodObject<{
|
|
9162
|
+
live: z.ZodObject<{
|
|
9163
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
9164
|
+
segments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
9165
|
+
}, z.core.$strict>;
|
|
9166
|
+
}, z.core.$strict>
|
|
9167
|
+
]>>;
|
|
9168
|
+
reads: z.ZodOptional<z.ZodEnum<{
|
|
9169
|
+
recorded: "recorded";
|
|
9170
|
+
live: "live";
|
|
9171
|
+
}>>;
|
|
9172
|
+
repetitions: z.ZodOptional<z.ZodNumber>;
|
|
9173
|
+
k: z.ZodOptional<z.ZodNumber>;
|
|
7846
9174
|
}, z.core.$strict>;
|
|
7847
9175
|
export type StartEvalRunResult = Schemas.StartEvalRunResult;
|
|
7848
9176
|
declare const StartEvalRunResult: z.ZodObject<{
|
|
@@ -8041,11 +9369,47 @@ declare const DeploymentRecord: z.ZodObject<{
|
|
|
8041
9369
|
}, z.core.$strict>>;
|
|
8042
9370
|
agents: z.ZodArray<z.ZodObject<{
|
|
8043
9371
|
id: z.ZodString;
|
|
8044
|
-
version: z.
|
|
9372
|
+
version: z.ZodString;
|
|
9373
|
+
authoredVersion: z.ZodOptional<z.ZodString>;
|
|
9374
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
9375
|
+
"pins-changed": "pins-changed";
|
|
9376
|
+
unpinned: "unpinned";
|
|
9377
|
+
"version-taken": "version-taken";
|
|
9378
|
+
}>>;
|
|
9379
|
+
newVersion: z.ZodOptional<z.ZodBoolean>;
|
|
9380
|
+
pinChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9381
|
+
kind: z.ZodEnum<{
|
|
9382
|
+
tool: "tool";
|
|
9383
|
+
prompt: "prompt";
|
|
9384
|
+
agent: "agent";
|
|
9385
|
+
setting: "setting";
|
|
9386
|
+
}>;
|
|
9387
|
+
id: z.ZodString;
|
|
9388
|
+
from: z.ZodOptional<z.ZodString>;
|
|
9389
|
+
to: z.ZodOptional<z.ZodString>;
|
|
9390
|
+
}, z.core.$strict>>>;
|
|
8045
9391
|
}, z.core.$strict>>;
|
|
8046
9392
|
flows: z.ZodArray<z.ZodObject<{
|
|
8047
9393
|
id: z.ZodString;
|
|
8048
|
-
version: z.
|
|
9394
|
+
version: z.ZodString;
|
|
9395
|
+
authoredVersion: z.ZodOptional<z.ZodString>;
|
|
9396
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
9397
|
+
"pins-changed": "pins-changed";
|
|
9398
|
+
unpinned: "unpinned";
|
|
9399
|
+
"version-taken": "version-taken";
|
|
9400
|
+
}>>;
|
|
9401
|
+
newVersion: z.ZodOptional<z.ZodBoolean>;
|
|
9402
|
+
pinChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9403
|
+
kind: z.ZodEnum<{
|
|
9404
|
+
tool: "tool";
|
|
9405
|
+
prompt: "prompt";
|
|
9406
|
+
agent: "agent";
|
|
9407
|
+
setting: "setting";
|
|
9408
|
+
}>;
|
|
9409
|
+
id: z.ZodString;
|
|
9410
|
+
from: z.ZodOptional<z.ZodString>;
|
|
9411
|
+
to: z.ZodOptional<z.ZodString>;
|
|
9412
|
+
}, z.core.$strict>>>;
|
|
8049
9413
|
}, z.core.$strict>>;
|
|
8050
9414
|
}, z.core.$strict>;
|
|
8051
9415
|
}, z.core.$strict>;
|
|
@@ -8090,11 +9454,47 @@ declare const DeploymentCollectionPage: z.ZodObject<{
|
|
|
8090
9454
|
}, z.core.$strict>>;
|
|
8091
9455
|
agents: z.ZodArray<z.ZodObject<{
|
|
8092
9456
|
id: z.ZodString;
|
|
8093
|
-
version: z.
|
|
9457
|
+
version: z.ZodString;
|
|
9458
|
+
authoredVersion: z.ZodOptional<z.ZodString>;
|
|
9459
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
9460
|
+
"pins-changed": "pins-changed";
|
|
9461
|
+
unpinned: "unpinned";
|
|
9462
|
+
"version-taken": "version-taken";
|
|
9463
|
+
}>>;
|
|
9464
|
+
newVersion: z.ZodOptional<z.ZodBoolean>;
|
|
9465
|
+
pinChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9466
|
+
kind: z.ZodEnum<{
|
|
9467
|
+
tool: "tool";
|
|
9468
|
+
prompt: "prompt";
|
|
9469
|
+
agent: "agent";
|
|
9470
|
+
setting: "setting";
|
|
9471
|
+
}>;
|
|
9472
|
+
id: z.ZodString;
|
|
9473
|
+
from: z.ZodOptional<z.ZodString>;
|
|
9474
|
+
to: z.ZodOptional<z.ZodString>;
|
|
9475
|
+
}, z.core.$strict>>>;
|
|
8094
9476
|
}, z.core.$strict>>;
|
|
8095
9477
|
flows: z.ZodArray<z.ZodObject<{
|
|
8096
9478
|
id: z.ZodString;
|
|
8097
|
-
version: z.
|
|
9479
|
+
version: z.ZodString;
|
|
9480
|
+
authoredVersion: z.ZodOptional<z.ZodString>;
|
|
9481
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
9482
|
+
"pins-changed": "pins-changed";
|
|
9483
|
+
unpinned: "unpinned";
|
|
9484
|
+
"version-taken": "version-taken";
|
|
9485
|
+
}>>;
|
|
9486
|
+
newVersion: z.ZodOptional<z.ZodBoolean>;
|
|
9487
|
+
pinChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9488
|
+
kind: z.ZodEnum<{
|
|
9489
|
+
tool: "tool";
|
|
9490
|
+
prompt: "prompt";
|
|
9491
|
+
agent: "agent";
|
|
9492
|
+
setting: "setting";
|
|
9493
|
+
}>;
|
|
9494
|
+
id: z.ZodString;
|
|
9495
|
+
from: z.ZodOptional<z.ZodString>;
|
|
9496
|
+
to: z.ZodOptional<z.ZodString>;
|
|
9497
|
+
}, z.core.$strict>>>;
|
|
8098
9498
|
}, z.core.$strict>>;
|
|
8099
9499
|
}, z.core.$strict>;
|
|
8100
9500
|
}, z.core.$strict>>;
|
|
@@ -9046,7 +10446,17 @@ export interface AgentVersionsClient {
|
|
|
9046
10446
|
* @wire POST /v1/agents/:agentId/versions/:version/unregister
|
|
9047
10447
|
*/
|
|
9048
10448
|
unregister(agentId: AgentId, version: Semver, options?: MutationOptions): Promise<UnregisterAgentResult>;
|
|
10449
|
+
/**
|
|
10450
|
+
* Derive a new version from a pinned one with some data-block pins
|
|
10451
|
+
* swapped (an expert's edit, no code change). Numbered the next free
|
|
10452
|
+
* patch after the agent's highest version. Needs `publish` on the agent.
|
|
10453
|
+
*
|
|
10454
|
+
* @wire POST /v1/agents/:agentId/versions
|
|
10455
|
+
*/
|
|
10456
|
+
derive(agentId: AgentId, input: DeriveAgentVersionInput, options?: MutationOptions): Promise<Agent$1>;
|
|
9049
10457
|
}
|
|
10458
|
+
/** Body of `POST /v1/agents/{agentId}/versions`. */
|
|
10459
|
+
export type DeriveAgentVersionInput = DeriveAgentVersionBody;
|
|
9050
10460
|
export interface ListAgentsFilter {
|
|
9051
10461
|
readonly limit?: number;
|
|
9052
10462
|
readonly cursor?: string;
|
|
@@ -9435,6 +10845,59 @@ export interface AuthProvidersClient {
|
|
|
9435
10845
|
readonly idempotencyKey?: string;
|
|
9436
10846
|
}): Promise<IdentityProviderUnregisterOutcome>;
|
|
9437
10847
|
}
|
|
10848
|
+
export type BlockPage = BlockCollectionPage;
|
|
10849
|
+
/**
|
|
10850
|
+
* The block fields of `POST /v1/blocks`. The project travels as
|
|
10851
|
+
* `PublishBlockOptions.projectId`, so the input stays the block itself.
|
|
10852
|
+
*/
|
|
10853
|
+
export type PublishBlockInput = Omit<PublishBlockBody, "projectId">;
|
|
10854
|
+
export interface PublishBlockOptions {
|
|
10855
|
+
/** The project the block belongs to. Its versions all stay there. */
|
|
10856
|
+
readonly projectId: string;
|
|
10857
|
+
readonly idempotencyKey?: string;
|
|
10858
|
+
}
|
|
10859
|
+
export interface ListBlocksFilter {
|
|
10860
|
+
readonly limit?: number;
|
|
10861
|
+
readonly cursor?: string;
|
|
10862
|
+
readonly kind?: BlockKind;
|
|
10863
|
+
/** Prefix match on the block id. */
|
|
10864
|
+
readonly name?: string;
|
|
10865
|
+
/** Only the blocks of this project, or of every project in this org. */
|
|
10866
|
+
readonly scope?: ScopeRef;
|
|
10867
|
+
}
|
|
10868
|
+
export interface ListBlockVersionsFilter {
|
|
10869
|
+
readonly limit?: number;
|
|
10870
|
+
readonly cursor?: string;
|
|
10871
|
+
/** Include unregistered versions, each with `unregisteredAt`. */
|
|
10872
|
+
readonly includeTombstoned?: boolean;
|
|
10873
|
+
}
|
|
10874
|
+
export interface BlocksClient {
|
|
10875
|
+
/**
|
|
10876
|
+
* Publish a block version into a project. Needs `write` on it.
|
|
10877
|
+
*
|
|
10878
|
+
* @wire POST /v1/blocks
|
|
10879
|
+
*/
|
|
10880
|
+
publish(input: PublishBlockInput, options: PublishBlockOptions): Promise<PublishBlockResult>;
|
|
10881
|
+
/** @wire GET /v1/blocks */
|
|
10882
|
+
list(filter?: ListBlocksFilter): Promise<BlockPage>;
|
|
10883
|
+
/** @wire GET /v1/blocks/:blockId */
|
|
10884
|
+
get(blockId: string): Promise<Block>;
|
|
10885
|
+
readonly versions: BlockVersionsClient;
|
|
10886
|
+
}
|
|
10887
|
+
export interface BlockVersionsClient {
|
|
10888
|
+
/** @wire GET /v1/blocks/:blockId/versions */
|
|
10889
|
+
list(blockId: string, filter?: ListBlockVersionsFilter): Promise<BlockPage>;
|
|
10890
|
+
/** @wire GET /v1/blocks/:blockId/versions/:version */
|
|
10891
|
+
get(blockId: string, version: string): Promise<Block>;
|
|
10892
|
+
/** @wire POST /v1/blocks/:blockId/versions/:version/unregister */
|
|
10893
|
+
unregister(blockId: string, version: string, options?: {
|
|
10894
|
+
readonly idempotencyKey?: string;
|
|
10895
|
+
}): Promise<UnregisterBlockResult>;
|
|
10896
|
+
/** @wire POST /v1/blocks/:blockId/versions/:version/reinstate */
|
|
10897
|
+
reinstate(blockId: string, version: string, options?: {
|
|
10898
|
+
readonly idempotencyKey?: string;
|
|
10899
|
+
}): Promise<ReinstateBlockResult>;
|
|
10900
|
+
}
|
|
9438
10901
|
/**
|
|
9439
10902
|
* Capabilities resource — capability declarations + model router +
|
|
9440
10903
|
* provider configuration.
|
|
@@ -9927,6 +11390,16 @@ export type PublishSuiteInput = Omit<PublishEvalSuiteBody, "projectId">;
|
|
|
9927
11390
|
export type PublishSuiteResult = PublishEvalSuiteResult;
|
|
9928
11391
|
export type UnregisterSuiteVersionResult = UnregisterEvalSuiteResult;
|
|
9929
11392
|
export type ReinstateSuiteVersionResult = ReinstateEvalSuiteVersionResult;
|
|
11393
|
+
/** Body of `POST /v1/eval-suites/{suiteId}/versions/from-judgments`. */
|
|
11394
|
+
export type BuildFromJudgmentsInput = BuildJudgedSuiteBody;
|
|
11395
|
+
export type BuildFromJudgmentsResult = BuildJudgedSuiteResult;
|
|
11396
|
+
/** One case of a `judged` suite: a copy of a judged run with its items' judgments summed up. */
|
|
11397
|
+
export type SuiteCase = JudgedEvalCase;
|
|
11398
|
+
export type SuiteCasePage = JudgedEvalCaseCollectionPage;
|
|
11399
|
+
export interface ListSuiteCasesQuery {
|
|
11400
|
+
readonly limit?: number;
|
|
11401
|
+
readonly cursor?: string;
|
|
11402
|
+
}
|
|
9930
11403
|
export interface PublishSuiteOptions {
|
|
9931
11404
|
/** Project the suite is published into. `POST /v1/eval-suites` requires it. */
|
|
9932
11405
|
readonly projectId: string;
|
|
@@ -9958,6 +11431,22 @@ export interface EvalSuitesClient {
|
|
|
9958
11431
|
list(filter?: ListSuitesFilter): Promise<SuitePage>;
|
|
9959
11432
|
/** @wire GET /v1/eval-suites/:suiteId */
|
|
9960
11433
|
get(suiteId: string): Promise<Suite>;
|
|
11434
|
+
/**
|
|
11435
|
+
* Publish a `judged` suite version whose cases are copies of judged runs
|
|
11436
|
+
* of an agent or flow, with each item's judgments summed up. Needs
|
|
11437
|
+
* `admin` on `input.projectId`.
|
|
11438
|
+
*
|
|
11439
|
+
* @wire POST /v1/eval-suites/:suiteId/versions/from-judgments
|
|
11440
|
+
*/
|
|
11441
|
+
buildFromJudgments(suiteId: string, input: BuildFromJudgmentsInput, options?: {
|
|
11442
|
+
readonly idempotencyKey?: string;
|
|
11443
|
+
}): Promise<BuildFromJudgmentsResult>;
|
|
11444
|
+
/**
|
|
11445
|
+
* The cases of a `judged` suite version, in stored order.
|
|
11446
|
+
*
|
|
11447
|
+
* @wire GET /v1/eval-suites/:suiteId/versions/:version/cases
|
|
11448
|
+
*/
|
|
11449
|
+
listCases(suiteId: string, version: string, query?: ListSuiteCasesQuery): Promise<SuiteCasePage>;
|
|
9961
11450
|
readonly versions: EvalSuiteVersionsClient;
|
|
9962
11451
|
}
|
|
9963
11452
|
export interface EvalSuiteVersionsClient {
|
|
@@ -10290,6 +11779,114 @@ export interface IdentityUsersClient {
|
|
|
10290
11779
|
readonly idempotencyKey?: string;
|
|
10291
11780
|
}): Promise<RevokeSessionsOutcome>;
|
|
10292
11781
|
}
|
|
11782
|
+
/**
|
|
11783
|
+
* Judge classes resource: the deployment's named kinds of judge
|
|
11784
|
+
* ("expert", "user", ...), each with a weight, scoped to the tenant, a
|
|
11785
|
+
* project, or an agent in a project.
|
|
11786
|
+
*/
|
|
11787
|
+
export interface JudgeClassesClient {
|
|
11788
|
+
/**
|
|
11789
|
+
* Create a class. Names are unique among the live classes of a scope
|
|
11790
|
+
* (`409 judge-class-name-taken`).
|
|
11791
|
+
*
|
|
11792
|
+
* @wire `POST /v1/judge-classes` — see
|
|
11793
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes/post`.
|
|
11794
|
+
*/
|
|
11795
|
+
create(input: CreateJudgeClassInput, options?: {
|
|
11796
|
+
readonly idempotencyKey?: string;
|
|
11797
|
+
}): Promise<JudgeClass>;
|
|
11798
|
+
/**
|
|
11799
|
+
* Live classes, newest first. `scope` narrows to one scope.
|
|
11800
|
+
*
|
|
11801
|
+
* @wire `GET /v1/judge-classes` — see
|
|
11802
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes/get`.
|
|
11803
|
+
*/
|
|
11804
|
+
list(filter?: JudgeClassFilter): Promise<Page<JudgeClass>>;
|
|
11805
|
+
/**
|
|
11806
|
+
* One class, also a retired one (`unregisteredAt` set).
|
|
11807
|
+
*
|
|
11808
|
+
* @wire `GET /v1/judge-classes/{judgeClassId}` — see
|
|
11809
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes~1{judgeClassId}/get`.
|
|
11810
|
+
*/
|
|
11811
|
+
get(judgeClassId: string): Promise<JudgeClass>;
|
|
11812
|
+
/**
|
|
11813
|
+
* Change a live class's weight or description.
|
|
11814
|
+
*
|
|
11815
|
+
* @wire `PATCH /v1/judge-classes/{judgeClassId}` — see
|
|
11816
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes~1{judgeClassId}/patch`.
|
|
11817
|
+
*/
|
|
11818
|
+
update(judgeClassId: string, input: UpdateJudgeClassInput, options?: {
|
|
11819
|
+
readonly idempotencyKey?: string;
|
|
11820
|
+
}): Promise<JudgeClass>;
|
|
11821
|
+
/**
|
|
11822
|
+
* Retire a class: no new judgments may name it.
|
|
11823
|
+
*
|
|
11824
|
+
* @wire `POST /v1/judge-classes/{judgeClassId}/unregister` — see
|
|
11825
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes~1{judgeClassId}~1unregister/post`.
|
|
11826
|
+
*/
|
|
11827
|
+
unregister(judgeClassId: string, options?: {
|
|
11828
|
+
readonly idempotencyKey?: string;
|
|
11829
|
+
}): Promise<void>;
|
|
11830
|
+
}
|
|
11831
|
+
export interface JudgeClassFilter {
|
|
11832
|
+
readonly limit?: number;
|
|
11833
|
+
readonly cursor?: Cursor;
|
|
11834
|
+
readonly scope?: JudgeClassScope;
|
|
11835
|
+
}
|
|
11836
|
+
/**
|
|
11837
|
+
* Judgments resource: yes or no, with an optional reason, about one item
|
|
11838
|
+
* of a finished run's output.
|
|
11839
|
+
*
|
|
11840
|
+
* Who judged comes from the token you call with, never from the input.
|
|
11841
|
+
* Judging again as the same caller for the same run, item key and
|
|
11842
|
+
* `participantId` supersedes the earlier judgment, which stays as history.
|
|
11843
|
+
*/
|
|
11844
|
+
export interface JudgmentsClient {
|
|
11845
|
+
/**
|
|
11846
|
+
* Judge an item of a finished run.
|
|
11847
|
+
*
|
|
11848
|
+
* @wire `POST /v1/judgments` — see `@kindgi/api/openapi.json#/paths/~1v1~1judgments/post`.
|
|
11849
|
+
*/
|
|
11850
|
+
create(input: CreateJudgmentInput, options?: {
|
|
11851
|
+
readonly idempotencyKey?: string;
|
|
11852
|
+
}): Promise<Judgment>;
|
|
11853
|
+
/**
|
|
11854
|
+
* Live judgments, newest first.
|
|
11855
|
+
*
|
|
11856
|
+
* @wire `GET /v1/judgments` — see `@kindgi/api/openapi.json#/paths/~1v1~1judgments/get`.
|
|
11857
|
+
*/
|
|
11858
|
+
list(filter?: JudgmentFilter): Promise<Page<Judgment>>;
|
|
11859
|
+
/**
|
|
11860
|
+
* One judgment with the stored copies of what was judged.
|
|
11861
|
+
*
|
|
11862
|
+
* @wire `GET /v1/judgments/{judgmentId}` — see
|
|
11863
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judgments~1{judgmentId}/get`.
|
|
11864
|
+
*/
|
|
11865
|
+
get(judgmentId: string): Promise<JudgmentWithCopies>;
|
|
11866
|
+
/**
|
|
11867
|
+
* Remove a judgment. Unknown ids fail with `404 judgment-not-found`.
|
|
11868
|
+
*
|
|
11869
|
+
* @wire `POST /v1/judgments/{judgmentId}/unregister` — see
|
|
11870
|
+
* `@kindgi/api/openapi.json#/paths/~1v1~1judgments~1{judgmentId}~1unregister/post`.
|
|
11871
|
+
*/
|
|
11872
|
+
unregister(judgmentId: string, options?: {
|
|
11873
|
+
readonly idempotencyKey?: string;
|
|
11874
|
+
}): Promise<void>;
|
|
11875
|
+
}
|
|
11876
|
+
export interface JudgmentFilter {
|
|
11877
|
+
readonly limit?: number;
|
|
11878
|
+
readonly cursor?: Cursor;
|
|
11879
|
+
readonly runId?: string;
|
|
11880
|
+
readonly agentId?: string;
|
|
11881
|
+
/** Needs `agentId`. */
|
|
11882
|
+
readonly agentVersion?: string;
|
|
11883
|
+
readonly flowId?: string;
|
|
11884
|
+
readonly verdict?: Verdict;
|
|
11885
|
+
readonly judgeClassId?: string;
|
|
11886
|
+
readonly participantId?: string;
|
|
11887
|
+
/** Narrow to a project (or org). */
|
|
11888
|
+
readonly scope?: ScopeRef;
|
|
11889
|
+
}
|
|
10293
11890
|
/**
|
|
10294
11891
|
* MCP resource — Model Context Protocol interop.
|
|
10295
11892
|
*
|
|
@@ -11104,6 +12701,10 @@ export interface ListRunsFilter {
|
|
|
11104
12701
|
readonly topLevel?: boolean;
|
|
11105
12702
|
/** Only this agent's turns, at any version (turns from before 0.1.3 don't name their agent). */
|
|
11106
12703
|
readonly agentId?: AgentId | string;
|
|
12704
|
+
/** Replay runs (an eval run re-running a past run): `exclude` (the default) leaves them out, `include` lists them too, `only` lists just them. */
|
|
12705
|
+
readonly replays?: "exclude" | "include" | "only";
|
|
12706
|
+
/** Only the replay runs of this eval run (implies replays are included). */
|
|
12707
|
+
readonly evalRunId?: string;
|
|
11107
12708
|
/** Include each run's `output` (omitted from lists by default). */
|
|
11108
12709
|
readonly includeOutput?: boolean;
|
|
11109
12710
|
}
|
|
@@ -12198,7 +13799,11 @@ export interface KindgiClient {
|
|
|
12198
13799
|
readonly compliance: ComplianceClient;
|
|
12199
13800
|
readonly audit: AuditResourceClient;
|
|
12200
13801
|
readonly evalSuites: EvalSuitesClient;
|
|
13802
|
+
/** Data blocks: versioned prompts and settings an agent version pins. */
|
|
13803
|
+
readonly blocks: BlocksClient;
|
|
12201
13804
|
readonly evalRuns: EvalRunsClient;
|
|
13805
|
+
readonly judgments: JudgmentsClient;
|
|
13806
|
+
readonly judgeClasses: JudgeClassesClient;
|
|
12202
13807
|
readonly users: UsersClient;
|
|
12203
13808
|
readonly identity: IdentityClient;
|
|
12204
13809
|
readonly auth: AuthClient;
|