@kindgi/client 0.1.4-rc.0 → 0.1.4-rc.2

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.d.cts CHANGED
@@ -243,6 +243,20 @@ export interface VersionDerivation {
243
243
  /** For an edit: who made it (`user:<id>`, or the token for a key). */
244
244
  readonly by?: string;
245
245
  }
246
+ /**
247
+ * What every list call answers: the wire's page — `data`, `hasMore` and
248
+ * `nextCursor` — as the API and the Python client have it. `items` is the
249
+ * same list under the name the client used first: readable, but not an
250
+ * own enumerable property, so a page serializes with its list once.
251
+ */
252
+ export interface ListPage<T> extends Page<T> {
253
+ readonly data: readonly T[];
254
+ /** Whether there's another page (`nextCursor` names it). */
255
+ readonly hasMore: boolean;
256
+ readonly nextCursor?: Cursor;
257
+ /** @deprecated Use `data`; removed in 0.2. */
258
+ readonly items: readonly T[];
259
+ }
246
260
  /** Terminal states are `completed`, `failed`, `cancelled`. */
247
261
  export type RunStatus = "pending" | "running" | "suspended" | "completed" | "failed" | "cancelled";
248
262
  /**
@@ -1176,7 +1190,7 @@ export interface SourceRefresh {
1176
1190
  * configured once per type in the memory implementation. There is no
1177
1191
  * per-fact retrieval hint.
1178
1192
  */
1179
- export interface Fact<TContent = unknown> {
1193
+ interface Fact<TContent = unknown> {
1180
1194
  readonly id: FactId;
1181
1195
  /**
1182
1196
  * Fact type identifier. Packs define their own; a few general-purpose
@@ -1226,7 +1240,7 @@ declare const REVIEWER_ROLES: readonly [
1226
1240
  "senior",
1227
1241
  "admin"
1228
1242
  ];
1229
- export type ReviewerRole = (typeof REVIEWER_ROLES)[number];
1243
+ type ReviewerRole = (typeof REVIEWER_ROLES)[number];
1230
1244
  /** A tool's gate, and the reviewer role its approvals need. */
1231
1245
  export interface ToolHitlRule {
1232
1246
  readonly mode: ToolHitlMode;
@@ -1268,8 +1282,8 @@ type AgentId$1 = Brand<string, "AgentId">;
1268
1282
  * - `system` — a system-authored instruction (rare; e.g. HITL
1269
1283
  * intervention, out-of-band context injection).
1270
1284
  */
1271
- export type MessageRole = "user" | "agent" | "tool" | "system";
1272
- export interface ConversationMessage {
1285
+ type MessageRole = "user" | "agent" | "tool" | "system";
1286
+ interface ConversationMessage {
1273
1287
  /**
1274
1288
  * Monotonic index within the conversation. Assigned by the writer.
1275
1289
  * Combined with `conversationId` this gives a stable ordering
@@ -1880,7 +1894,7 @@ export interface CheckResult {
1880
1894
  readonly attributes?: Readonly<Record<string, unknown>>;
1881
1895
  }
1882
1896
  /** Result of evaluating a guardrail against a trace, including action to take. */
1883
- export interface EvaluationResult {
1897
+ interface EvaluationResult {
1884
1898
  readonly guardrailId: GuardrailId;
1885
1899
  readonly result: CheckResult;
1886
1900
  /** The action the caller should apply — pre-computed from `guardrail.action`. */
@@ -3390,6 +3404,74 @@ export interface Policy {
3390
3404
  export type PolicyKind = "access-control" | "model-routing" | "adapter-allowlist" | "rate-limit" | "retention" | "compliance" | "tool-errors" | "hitl";
3391
3405
  /** @deprecated The wire has no policy status; policies are selected by `kind`. */
3392
3406
  export type PolicyStatus = "draft" | "active" | "archived";
3407
+ /**
3408
+ * A tombstoning domain a `retention` policy can cover; `*` is the
3409
+ * tenant-wide default. Wire enum — matches
3410
+ * `@kindgi/api/openapi.json#RetentionDomain`.
3411
+ */
3412
+ export type RetentionDomain = "org" | "agent" | "flow" | "tool" | "eval_suite" | "guardrail" | "mcp_endpoint" | "env" | "secret" | "run" | "policy" | "judgment" | "judge_class" | "provider" | "*";
3413
+ /**
3414
+ * One tombstoned row and when a sweep purges it. Matches
3415
+ * `@kindgi/api/openapi.json#RetentionScheduledItem`.
3416
+ */
3417
+ export interface RetentionScheduledItem {
3418
+ readonly domain: RetentionDomain;
3419
+ /** The row's id in its domain. */
3420
+ readonly id: string;
3421
+ readonly unregisteredAt: string;
3422
+ /** `unregisteredAt` plus the policy's grace. */
3423
+ readonly purgeAt: string;
3424
+ /** Whether a sweep would purge it now. */
3425
+ readonly pastGrace: boolean;
3426
+ /** The retention policy that applies. */
3427
+ readonly policyId: string;
3428
+ readonly policyVersion: string;
3429
+ /** `-1`: a hold, never purged. */
3430
+ readonly graceSeconds: number;
3431
+ }
3432
+ /**
3433
+ * A domain more than one retention policy covers. Publishing refuses a
3434
+ * second policy for a domain (`409 policy-scope-taken`), so only
3435
+ * policies stored before that rule can do this. Matches
3436
+ * `@kindgi/api/openapi.json#RetentionPolicyConflict`.
3437
+ */
3438
+ export interface RetentionPolicyConflict {
3439
+ readonly domain: RetentionDomain;
3440
+ /** Every policy id that covers the domain, sorted. */
3441
+ readonly policyIds: readonly string[];
3442
+ /**
3443
+ * The one that applies: the policy whose latest version is highest,
3444
+ * and on equal versions the lower policy id. Unregister the others.
3445
+ */
3446
+ readonly appliedPolicyId: string;
3447
+ }
3448
+ /** Matches `@kindgi/api/openapi.json#RetentionScheduledPage`. */
3449
+ export interface RetentionScheduledPage {
3450
+ readonly data: readonly RetentionScheduledItem[];
3451
+ /** Some domain has more scheduled rows than this page returned (`limit` is per domain). */
3452
+ readonly hasMore: boolean;
3453
+ /** Pass as `cursor` for the next page. Absent when `hasMore` is false, or the runtime can't continue. */
3454
+ readonly nextCursor?: string;
3455
+ /** Covered domains this deployment can't purge (no adapter). */
3456
+ readonly domainsMissingAdapter: readonly RetentionDomain[];
3457
+ /** Domains no retention policy covers: their tombstones are kept. */
3458
+ readonly unpolicedDomains: readonly RetentionDomain[];
3459
+ readonly conflicts?: readonly RetentionPolicyConflict[];
3460
+ }
3461
+ /** Matches `@kindgi/api/openapi.json#RetentionSweepResult`. */
3462
+ export interface RetentionSweepResult {
3463
+ readonly perDomain: readonly {
3464
+ readonly domain: RetentionDomain;
3465
+ readonly purged: number;
3466
+ /** Rows past grace this call left (the `maxPerDomain` cap); sweep again. */
3467
+ readonly remaining: number;
3468
+ readonly policyId?: string;
3469
+ /** This deployment can't purge the domain (no adapter). */
3470
+ readonly missingAdapter?: true;
3471
+ }[];
3472
+ readonly totalPurged: number;
3473
+ readonly conflicts?: readonly RetentionPolicyConflict[];
3474
+ }
3393
3475
  /**
3394
3476
  * Wire body for `POST /v1/policies` per
3395
3477
  * `@kindgi/api/openapi.json#PublishPolicyBody`: `{ kind, description,
@@ -3932,6 +4014,18 @@ export type JudgeClassScope = {
3932
4014
  readonly projectId: string;
3933
4015
  readonly agentId: string;
3934
4016
  };
4017
+ /**
4018
+ * Who may assert a judge class. Each field narrows it; a caller must meet
4019
+ * all that are set. Matches `@kindgi/api/openapi.json#JudgeClassAssertableBy`.
4020
+ */
4021
+ export interface JudgeClassAssertableBy {
4022
+ /** The lowest reviewer role that may assert it: `standard`, `senior` or `admin`. */
4023
+ readonly minReviewerRole?: "standard" | "senior" | "admin";
4024
+ /** People (`user`), service tokens (`service`), or both. */
4025
+ readonly principalKinds?: readonly ("user" | "service")[];
4026
+ /** Only these user or token ids. */
4027
+ readonly principalIds?: readonly string[];
4028
+ }
3935
4029
  /** Matches `@kindgi/api/openapi.json#JudgeClass`. */
3936
4030
  export interface JudgeClass {
3937
4031
  readonly id: string;
@@ -3942,6 +4036,8 @@ export interface JudgeClass {
3942
4036
  /** How much a judgment of this class counts, relative to the others (≥ 0). */
3943
4037
  readonly weight: number;
3944
4038
  readonly description?: string;
4039
+ /** Who may assert it; absent: anyone who may judge the run. */
4040
+ readonly assertableBy?: JudgeClassAssertableBy;
3945
4041
  readonly createdAt: Timestamp;
3946
4042
  readonly updatedAt: Timestamp;
3947
4043
  /** Set when the class was retired. */
@@ -3953,11 +4049,14 @@ export interface CreateJudgeClassInput {
3953
4049
  readonly name: string;
3954
4050
  readonly weight: number;
3955
4051
  readonly description?: string;
4052
+ readonly assertableBy?: JudgeClassAssertableBy;
3956
4053
  }
3957
4054
  /** Input for `PATCH /v1/judge-classes/{judgeClassId}` per `#UpdateJudgeClassBody`. */
3958
4055
  export interface UpdateJudgeClassInput {
3959
4056
  readonly weight?: number;
3960
4057
  readonly description?: string;
4058
+ /** A new restriction; `null` lifts it. */
4059
+ readonly assertableBy?: JudgeClassAssertableBy | null;
3961
4060
  }
3962
4061
  /** What a judged run ran: an agent at a version, or a flow at a version. */
3963
4062
  export interface JudgedSubject {
@@ -3991,6 +4090,11 @@ export interface Judgment {
3991
4090
  readonly reason?: string;
3992
4091
  /** Absent when the judgment is unclassified (it counts with weight 1). */
3993
4092
  readonly judgeClassId?: string;
4093
+ /**
4094
+ * `true` when the class was restricted (`assertableBy`) when the judgment
4095
+ * was recorded, so the judge was checked against it.
4096
+ */
4097
+ readonly restricted?: true;
3994
4098
  readonly assertedBy: JudgmentAssertedBy;
3995
4099
  /** An app's opaque id for its end user who judged, when it judged on their behalf. */
3996
4100
  readonly participantId?: string;
@@ -4063,14 +4167,16 @@ export interface Transport {
4063
4167
  */
4064
4168
  authHeaders(): Readonly<Record<string, string>>;
4065
4169
  }
4170
+ /** One query parameter's value: an array repeats the key (`segment=a&segment=b`). */
4171
+ export type QueryValue = string | number | boolean | readonly string[] | undefined;
4066
4172
  export interface TransportRequest {
4067
4173
  readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
4068
4174
  /** Path beginning with `/` (e.g. `/v1/agents`). Combined with `apiUrl`. */
4069
4175
  readonly path: string;
4070
4176
  /** JSON body (serialized here). Omitted for `GET`/`DELETE` without body. */
4071
4177
  readonly body?: unknown;
4072
- /** Query parameters. `undefined` values are dropped. */
4073
- readonly query?: Readonly<Record<string, string | number | boolean | undefined>>;
4178
+ /** Query parameters. `undefined` values are dropped; an array repeats its key, in order. */
4179
+ readonly query?: Readonly<Record<string, QueryValue>>;
4074
4180
  /** Extra headers merged after `Authorization` + `Content-Type`. */
4075
4181
  readonly headers?: Readonly<Record<string, string>>;
4076
4182
  /** Overrides the client-level timeout. */
@@ -4125,7 +4231,7 @@ export interface AdaptersClient {
4125
4231
  * @wire `GET /v1/adapters` — see
4126
4232
  * `@kindgi/api/openapi.json#/paths/~1v1~1adapters/get`.
4127
4233
  */
4128
- list(filter?: AdapterFilter): Promise<Page<Adapter>>;
4234
+ list(filter?: AdapterFilter): Promise<ListPage<Adapter>>;
4129
4235
  /**
4130
4236
  * Fetch a single wired adapter.
4131
4237
  *
@@ -4224,6 +4330,45 @@ declare namespace Schemas {
4224
4330
  export type HealthResult = {
4225
4331
  ok: true;
4226
4332
  };
4333
+ /**
4334
+ * The agent's default for the whole tenant.
4335
+ */
4336
+ export type LiveScopeTenant = {
4337
+ kind: "tenant";
4338
+ };
4339
+ /**
4340
+ * An org's projects.
4341
+ */
4342
+ export type LiveScopeOrg = {
4343
+ kind: "org";
4344
+ orgId: string;
4345
+ };
4346
+ /**
4347
+ * One project.
4348
+ */
4349
+ export type LiveScopeProject = {
4350
+ kind: "project";
4351
+ projectId: string;
4352
+ };
4353
+ export type ScopeSegment = {
4354
+ /**
4355
+ * Lowercase, like an identifier: `company`, `contact-role`.
4356
+ */
4357
+ key: string;
4358
+ value: string;
4359
+ };
4360
+ /**
4361
+ * A segment path within a project: it covers every run whose path starts with it.
4362
+ */
4363
+ export type LiveScopeSegment = {
4364
+ kind: "segment";
4365
+ projectId: string;
4366
+ path: Array<ScopeSegment>;
4367
+ };
4368
+ /**
4369
+ * Where a live version is pinned, from least to most specific: tenant, org, project, segment path. A run takes the most specific pin that covers it.
4370
+ */
4371
+ export type LiveScope = LiveScopeTenant | LiveScopeOrg | LiveScopeProject | LiveScopeSegment;
4227
4372
  /**
4228
4373
  * Set on an agent's turn (an agent run, or the turn a flow's agent step started): the agent, the version that ran and the conversation. Absent on other runs, and on turns that ran before Kindgi 0.1.3.
4229
4374
  */
@@ -4237,7 +4382,255 @@ declare namespace Schemas {
4237
4382
  */
4238
4383
  version: string;
4239
4384
  conversationId: string;
4385
+ /**
4386
+ * Why this version ran: named by the caller (`explicit`); held by the flow version a flow's agent step runs in (`flow-pin`: the node's `config.version`, else the version the flow version pinned when it was published); the conversation's own (`conversation`); the version live for the run's scope (`live`); or the latest, nothing being live (`latest`). Absent on runs from before Kindgi 0.1.4.
4387
+ */
4388
+ via?: "explicit" | "flow-pin" | "conversation" | "live" | "latest";
4389
+ liveScope?: LiveScope;
4390
+ };
4391
+ export type LiveVersionResolution = {
4392
+ agentId: string;
4393
+ /**
4394
+ * The version a run would use (semver).
4395
+ */
4396
+ version: string;
4397
+ /**
4398
+ * A live pin chose it, or nothing is live on the way up and it is the latest.
4399
+ */
4400
+ via: "live" | "latest";
4401
+ liveScope?: LiveScope;
4402
+ };
4403
+ export type LivePin = {
4404
+ agentId: string;
4405
+ scope: LiveScope;
4406
+ version: string;
4407
+ /**
4408
+ * The promotion that set it.
4409
+ */
4410
+ promotionId: string;
4411
+ setAt: string;
4412
+ };
4413
+ export type LivePinList = {
4414
+ data: Array<LivePin>;
4415
+ };
4416
+ export type GatePolicyRef = {
4417
+ id: string;
4418
+ version: string;
4419
+ };
4420
+ /**
4421
+ * One of a gate's checks, as the promotion records it.
4422
+ */
4423
+ export type GateCheck = {
4424
+ /**
4425
+ * Stable: `comparison.required`, `comparison.status`, `comparison.freshness`, `comparison.suite`, `sameContents`, `baselineIsLive`, `scopeCovered`, `evidence.<metric>.minCases|minWeight|baselineMinCases|baselineMinWeight`, `metric.<metric>.k|minCandidate|maxDrop`, `replay.maxDiverged|maxErrors|maxRefusedWrites|maxStopped`, `classWeights.restrictedOnly`.
4426
+ */
4427
+ name: string;
4428
+ passed: boolean;
4429
+ /**
4430
+ * A plain sentence: what was found against what the policy asks.
4431
+ */
4432
+ message: string;
4433
+ value?: number | string;
4434
+ threshold?: number | string;
4435
+ };
4436
+ /**
4437
+ * One change of a scope's live version, kept for good: what was live before, what is after, who asked and why.
4438
+ */
4439
+ export type Promotion = {
4440
+ id: string;
4441
+ agentId: string;
4442
+ scope: LiveScope;
4443
+ action: "promote" | "rollback" | "unpin";
4444
+ /**
4445
+ * The scope's own pin before; null when it had none.
4446
+ */
4447
+ fromVersion: string | null;
4448
+ /**
4449
+ * The scope's own pin after; null after an unpin.
4450
+ */
4451
+ toVersion: string | null;
4452
+ requestedBy: {
4453
+ kind: "user" | "service";
4454
+ id: string;
4455
+ };
4456
+ reason?: string;
4457
+ /**
4458
+ * The comparison the change was judged on.
4459
+ */
4460
+ evalRunId?: string;
4461
+ createdAt: string;
4462
+ /**
4463
+ * A `promote` row's state: it changes once, from `pending-approval` to its final state. Absent on rollback and unpin rows, and on promotions made before gates (`promoted`).
4464
+ */
4465
+ status?: "promoted" | "pending-approval" | "refused" | "superseded" | "rejected" | "expired";
4466
+ /**
4467
+ * The gate policy that applied; null when none did. Absent before gates.
4468
+ */
4469
+ policy?: GatePolicyRef | null;
4470
+ checks?: Array<GateCheck>;
4471
+ /**
4472
+ * The approval a `pending-approval` promotion waits on (kept once decided).
4473
+ */
4474
+ approvalId?: string;
4475
+ /**
4476
+ * When a `pending-approval` promotion reached its final state.
4477
+ */
4478
+ resolvedAt?: string;
4479
+ };
4480
+ export type PromotionPage = {
4481
+ data: Array<Promotion>;
4482
+ hasMore: boolean;
4483
+ nextCursor?: string;
4484
+ };
4485
+ /**
4486
+ * The approval a passing promotion waits for.
4487
+ */
4488
+ export type GateApproval = {
4489
+ role: "standard" | "senior" | "admin";
4490
+ count: number;
4491
+ /**
4492
+ * Whoever asked for the promotion may not approve it.
4493
+ */
4494
+ separateApprover: boolean;
4495
+ };
4496
+ /**
4497
+ * What a promotion must show. Every part is optional; an empty spec checks nothing. A promotion must name a comparison (`evalRunId`) exactly when the spec has `comparison`, `evidence`, `metrics`, `replay` or `onlyRestrictedClasses`. Unknown keys are refused.
4498
+ */
4499
+ export type GatePolicySpec = Partial<{
4500
+ comparison: Partial<{
4501
+ maxAgeHours: number;
4502
+ suite: {
4503
+ id: string;
4504
+ version?: string;
4505
+ };
4506
+ }>;
4507
+ /**
4508
+ * The judged evidence behind each gated metric; for a metric with `maxDrop`, the baseline's too.
4509
+ */
4510
+ evidence: Partial<{
4511
+ minCases: number;
4512
+ minWeight: number;
4513
+ }>;
4514
+ metrics: Array<{
4515
+ name: "weightedYesShare" | "judgedCoverage" | "weightedPrecisionAtK";
4516
+ /**
4517
+ * `weightedPrecisionAtK` only: the summary's `k` must be this.
4518
+ */
4519
+ k?: number;
4520
+ minCandidate?: number;
4521
+ /**
4522
+ * How far the candidate may fall below the baseline (the live version).
4523
+ */
4524
+ maxDrop?: number;
4525
+ }>;
4526
+ /**
4527
+ * Each knob left out of the block is 0. No block: no replay checks.
4528
+ */
4529
+ replay: Partial<{
4530
+ maxDiverged: number;
4531
+ maxErrors: number;
4532
+ maxRefusedWrites: number;
4533
+ maxStopped: number;
4534
+ }>;
4535
+ /**
4536
+ * A passing promotion waits for a reviewer.
4537
+ */
4538
+ approvals: Partial<{
4539
+ /**
4540
+ * Default `senior`.
4541
+ */
4542
+ role: "standard" | "senior" | "admin";
4543
+ /**
4544
+ * Default `true`.
4545
+ */
4546
+ separateApprover: boolean;
4547
+ }>;
4548
+ /**
4549
+ * Only restricted judge classes count: the comparison must be weighted `restricted-only`, so a class anyone may assert can't move the gate.
4550
+ */
4551
+ onlyRestrictedClasses: boolean;
4552
+ }>;
4553
+ export type GatePolicy = {
4554
+ id: string;
4555
+ version: string;
4556
+ agentId: string;
4557
+ scope: LiveScope;
4558
+ spec: GatePolicySpec;
4559
+ description?: string;
4560
+ createdAt: string;
4561
+ unregisteredAt?: string;
4562
+ };
4563
+ export type GatePolicyPage = {
4564
+ data: Array<GatePolicy>;
4565
+ hasMore: boolean;
4566
+ nextCursor?: string;
4567
+ };
4568
+ export type PublishGatePolicyBody = {
4569
+ /**
4570
+ * Yours to choose, e.g. `acme.drafting-prod`.
4571
+ */
4572
+ id: string;
4573
+ version: string;
4574
+ agentId: string;
4575
+ scope: LiveScope;
4576
+ spec: GatePolicySpec;
4577
+ description?: string;
4578
+ };
4579
+ export type GatePolicyResolution = {
4580
+ /**
4581
+ * The policy that gates a promotion for the scope; null when none does.
4582
+ */
4583
+ policy: GatePolicy | null;
4584
+ };
4585
+ /**
4586
+ * What the gate would say about a promotion. Nothing is recorded.
4587
+ */
4588
+ export type PromotionCheck = {
4589
+ outcome: "would-promote" | "needs-approval" | "gate-failed";
4590
+ /**
4591
+ * The policy that applies; null when none does.
4592
+ */
4593
+ policy: GatePolicyRef | null;
4594
+ checks: Array<GateCheck>;
4595
+ approval?: GateApproval;
4596
+ };
4597
+ export type PromoteBody = {
4598
+ /**
4599
+ * The agent version to make live (registered, active).
4600
+ */
4601
+ version: string;
4602
+ scope: LiveScope;
4603
+ reason?: string;
4604
+ /**
4605
+ * The comparison this promotion was judged on.
4606
+ */
4607
+ evalRunId?: string;
4608
+ };
4609
+ export type RollbackBody = {
4610
+ scope: LiveScope;
4611
+ /**
4612
+ * An earlier version to go back to; omit → the scope's previous live version.
4613
+ */
4614
+ toVersion?: string;
4615
+ reason?: string;
4616
+ };
4617
+ export type UnpinBody = {
4618
+ scope: LiveScope;
4619
+ reason?: string;
4240
4620
  };
4621
+ /**
4622
+ * Agents and tools a flow runs at other exact versions than the flow version's pins ("this flow, with `acme.scorer` at 0.4.0"), without publishing a new flow version: a comparison's flow candidate (`versions` on the start body and the run's `comparison`), and the flow runs that replay it (a run's `versions`). Each id must be an agent or tool the flow uses.
4623
+ */
4624
+ export type FlowVersionOverrides = Partial<{
4625
+ /**
4626
+ * Tool id → exact version.
4627
+ */
4628
+ tools: Record<string, string>;
4629
+ /**
4630
+ * Agent id → exact version, for agent nodes with or without a version of their own.
4631
+ */
4632
+ agents: Record<string, string>;
4633
+ }>;
4241
4634
  export type Run = {
4242
4635
  /**
4243
4636
  * RunId.
@@ -4277,6 +4670,11 @@ declare namespace Schemas {
4277
4670
  * Set on a replay run: the eval run that started it.
4278
4671
  */
4279
4672
  evalRunId?: string;
4673
+ versions?: FlowVersionOverrides;
4674
+ /**
4675
+ * The segment path the run was started with (coarse to fine), which picks live agent versions. A child run has its parent's. Absent when there was none.
4676
+ */
4677
+ segments?: Array<ScopeSegment>;
4280
4678
  /**
4281
4679
  * 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.
4282
4680
  */
@@ -4295,13 +4693,17 @@ declare namespace Schemas {
4295
4693
  */
4296
4694
  agent: string;
4297
4695
  /**
4298
- * Semver; omit → latest.
4696
+ * Semver. Omit → the conversation's own version for a follow-up turn, else the version live for the run's scope, else the latest.
4299
4697
  */
4300
4698
  agentVersion?: string;
4301
4699
  /**
4302
4700
  * Project to run under; omit → the tenant's Default project.
4303
4701
  */
4304
4702
  projectId?: string;
4703
+ /**
4704
+ * The run's segment path below its project, coarse to fine (an app-defined finer scope, e.g. company then role). A version live on a prefix of it serves the run.
4705
+ */
4706
+ segments?: Array<ScopeSegment>;
4305
4707
  /**
4306
4708
  * Opaque payload forwarded to the agent binding.
4307
4709
  */
@@ -4329,6 +4731,10 @@ declare namespace Schemas {
4329
4731
  * Project to run under; omit → the tenant's Default project.
4330
4732
  */
4331
4733
  projectId?: string;
4734
+ /**
4735
+ * The run's segment path below its project, coarse to fine (an app-defined finer scope, e.g. company then role). A version live on a prefix of it serves the run.
4736
+ */
4737
+ segments?: Array<ScopeSegment>;
4332
4738
  /**
4333
4739
  * Opaque payload forwarded to the flow runtime.
4334
4740
  */
@@ -4394,6 +4800,11 @@ declare namespace Schemas {
4394
4800
  * Set on a replay run: the eval run that started it.
4395
4801
  */
4396
4802
  evalRunId?: string;
4803
+ versions?: FlowVersionOverrides;
4804
+ /**
4805
+ * The segment path the run was started with (coarse to fine), which picks live agent versions. A child run has its parent's. Absent when there was none.
4806
+ */
4807
+ segments?: Array<ScopeSegment>;
4397
4808
  /**
4398
4809
  * 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.
4399
4810
  */
@@ -4709,6 +5120,16 @@ declare namespace Schemas {
4709
5120
  * True when the approval had a `waitTokenId` + terminal accept/reject and the run waitpoint was completed as part of this call.
4710
5121
  */
4711
5122
  waitpointResolved: boolean;
5123
+ /**
5124
+ * How the run went on, when this call resumed it (the runtime resumes inline): `ok`, or `failed` with the run's error, e.g. `tool-version-unresolvable` when a tool version the turn started with is gone. The decision stands either way.
5125
+ */
5126
+ resume?: {
5127
+ kind: "ok";
5128
+ } | {
5129
+ kind: "failed";
5130
+ code: string;
5131
+ message: string;
5132
+ };
4712
5133
  };
4713
5134
  /**
4714
5135
  * Reviewer roster row. Deactivation is soft (audit trail survives offboarding). `deactivatedAt` present → reviewer no longer receives approvals.
@@ -4836,6 +5257,23 @@ declare namespace Schemas {
4836
5257
  projectId: string;
4837
5258
  agentId: string;
4838
5259
  };
5260
+ /**
5261
+ * Who may assert the class: every part that is set must hold. A class with one is restricted: a judgment recorded while it is carries `restricted`, and a comparison weighted `restricted-only` counts only those.
5262
+ */
5263
+ export type JudgeClassAssertableBy = Partial<{
5264
+ /**
5265
+ * The caller's reviewer role is at least this (its token's, or the roster's).
5266
+ */
5267
+ minReviewerRole: "standard" | "senior" | "admin";
5268
+ /**
5269
+ * Users, service tokens, or both.
5270
+ */
5271
+ principalKinds: Array<"user" | "service">;
5272
+ /**
5273
+ * Only these principals: user ids, or service token ids.
5274
+ */
5275
+ principalIds: Array<string>;
5276
+ }>;
4839
5277
  export type JudgeClass = {
4840
5278
  id: string;
4841
5279
  tenantId: string;
@@ -4849,6 +5287,7 @@ declare namespace Schemas {
4849
5287
  */
4850
5288
  weight: number;
4851
5289
  description?: string;
5290
+ assertableBy?: JudgeClassAssertableBy;
4852
5291
  createdAt: string;
4853
5292
  updatedAt: string;
4854
5293
  /**
@@ -4869,10 +5308,15 @@ declare namespace Schemas {
4869
5308
  name: string;
4870
5309
  weight: number;
4871
5310
  description?: string;
5311
+ assertableBy?: JudgeClassAssertableBy;
4872
5312
  };
4873
5313
  export type UpdateJudgeClassBody = Partial<{
4874
5314
  weight: number;
4875
5315
  description: string;
5316
+ /**
5317
+ * Who may assert the class; `null` lifts the restriction.
5318
+ */
5319
+ assertableBy: JudgeClassAssertableBy | null;
4876
5320
  }>;
4877
5321
  export type UnregisterJudgeClassResult = {
4878
5322
  judgeClassId: string;
@@ -4926,6 +5370,7 @@ declare namespace Schemas {
4926
5370
  * The judge class the judgment is recorded under. Absent when unclassified (counts with weight 1).
4927
5371
  */
4928
5372
  judgeClassId?: string;
5373
+ restricted?: true;
4929
5374
  assertedBy: JudgmentAssertedBy;
4930
5375
  /**
4931
5376
  * The app's opaque id for its end user who judged, when an app judged on their behalf.
@@ -5075,6 +5520,13 @@ declare namespace Schemas {
5075
5520
  * The weight behind all judgments of the item.
5076
5521
  */
5077
5522
  totalWeight: number;
5523
+ /**
5524
+ * The same weights, counting only judgments recorded while their class was restricted (`Judgment.restricted`), for a comparison weighted `restricted-only`. Absent from a test set built before restrictions.
5525
+ */
5526
+ restricted?: {
5527
+ yesWeight: number;
5528
+ totalWeight: number;
5529
+ };
5078
5530
  /**
5079
5531
  * The reasons given, newest first.
5080
5532
  */
@@ -6904,7 +7356,7 @@ declare namespace Schemas {
6904
7356
  kind: PolicyKind;
6905
7357
  description?: string;
6906
7358
  /**
6907
- * Kind-specific policy body. For `access-control`, matches `@kindgi/specs/policy.schema.json` (rules + defaults). For `model-routing`, matches `TenantPolicy` from `@kindgi/capabilities` (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For `tool-errors`, `ToolErrorsSpec` (maxRetries / retryOn). For `hitl`, `HitlSpec` from `@kindgi/policy-contract` (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or `{ mode, requiredRole }`); it only tightens an agent's approvals. `tool-errors` and `hitl` specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.
7359
+ * Kind-specific policy body. For `access-control`, matches `@kindgi/specs/policy.schema.json` (rules + defaults). For `model-routing`, matches `TenantPolicy` from `@kindgi/capabilities` (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For `tool-errors`, `ToolErrorsSpec` (maxRetries / retryOn). For `hitl`, `HitlSpec` from `@kindgi/policy-contract` (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or `{ mode, requiredRole }`); it only tightens an agent's approvals. For `retention`, `{ v: 1, doc: RetentionSpec }` from `@kindgi/policy-contract` (domain / graceSeconds / mode, which must be `purge`); a tenant has one retention policy per domain, plus one for `*`. `tool-errors`, `hitl` and `retention` specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.
6908
7360
  */
6909
7361
  spec: Record<string, unknown>;
6910
7362
  };
@@ -6923,7 +7375,7 @@ declare namespace Schemas {
6923
7375
  kind: PolicyKind;
6924
7376
  description?: string;
6925
7377
  /**
6926
- * Kind-specific policy body. For `access-control`, matches `@kindgi/specs/policy.schema.json` (rules + defaults). For `model-routing`, matches `TenantPolicy` from `@kindgi/capabilities` (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For `tool-errors`, `ToolErrorsSpec` (maxRetries / retryOn). For `hitl`, `HitlSpec` from `@kindgi/policy-contract` (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or `{ mode, requiredRole }`); it only tightens an agent's approvals. `tool-errors` and `hitl` specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.
7378
+ * Kind-specific policy body. For `access-control`, matches `@kindgi/specs/policy.schema.json` (rules + defaults). For `model-routing`, matches `TenantPolicy` from `@kindgi/capabilities` (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For `tool-errors`, `ToolErrorsSpec` (maxRetries / retryOn). For `hitl`, `HitlSpec` from `@kindgi/policy-contract` (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or `{ mode, requiredRole }`); it only tightens an agent's approvals. For `retention`, `{ v: 1, doc: RetentionSpec }` from `@kindgi/policy-contract` (domain / graceSeconds / mode, which must be `purge`); a tenant has one retention policy per domain, plus one for `*`. `tool-errors`, `hitl` and `retention` specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.
6927
7379
  */
6928
7380
  spec: Record<string, unknown>;
6929
7381
  /**
@@ -6961,6 +7413,99 @@ declare namespace Schemas {
6961
7413
  version: string;
6962
7414
  wasTombstoned: boolean;
6963
7415
  };
7416
+ export type RetentionDomain = "org" | "agent" | "flow" | "tool" | "eval_suite" | "guardrail" | "mcp_endpoint" | "env" | "secret" | "run" | "policy" | "judgment" | "judge_class" | "provider" | "*";
7417
+ export type RetentionPolicyConflict = {
7418
+ domain: RetentionDomain;
7419
+ /**
7420
+ * Every policy id that covers the domain, sorted.
7421
+ */
7422
+ policyIds: Array<string>;
7423
+ /**
7424
+ * The one that applies: the policy whose latest version is highest, and on equal versions the lower policy id. Unregister the others.
7425
+ */
7426
+ appliedPolicyId: string;
7427
+ };
7428
+ export type RetentionScheduledItem = {
7429
+ domain: RetentionDomain;
7430
+ /**
7431
+ * The tombstoned row's id in its domain.
7432
+ */
7433
+ id: string;
7434
+ unregisteredAt: string;
7435
+ /**
7436
+ * `unregisteredAt` plus the policy's grace: when a sweep purges the row.
7437
+ */
7438
+ purgeAt: string;
7439
+ /**
7440
+ * Whether a sweep would purge the row now.
7441
+ */
7442
+ pastGrace: boolean;
7443
+ /**
7444
+ * The retention policy that applies.
7445
+ */
7446
+ policyId: string;
7447
+ policyVersion: string;
7448
+ /**
7449
+ * The policy's grace, in seconds (`-1`: a hold, never purged).
7450
+ */
7451
+ graceSeconds: number;
7452
+ };
7453
+ export type RetentionScheduledPage = {
7454
+ data: Array<RetentionScheduledItem>;
7455
+ /**
7456
+ * Some domain has more scheduled rows than this page returned (`limit` is per domain). Always sent from 0.1.4; a runtime before it sends none.
7457
+ */
7458
+ hasMore?: boolean;
7459
+ /**
7460
+ * The `cursor` for the next page. Absent when `hasMore: false`, or when the runtime cannot continue a page.
7461
+ */
7462
+ nextCursor?: string;
7463
+ /**
7464
+ * Domains a retention policy covers that this deployment can't purge (no adapter is wired).
7465
+ */
7466
+ domainsMissingAdapter: Array<RetentionDomain>;
7467
+ /**
7468
+ * Domains no retention policy covers: their tombstones are kept.
7469
+ */
7470
+ unpolicedDomains: Array<RetentionDomain>;
7471
+ /**
7472
+ * Domains more than one retention policy covers. Absent or empty: none.
7473
+ */
7474
+ conflicts?: Array<RetentionPolicyConflict>;
7475
+ };
7476
+ export type RetentionSweepBody = Partial<{
7477
+ domain: RetentionDomain;
7478
+ /**
7479
+ * The most rows one call purges per domain (default 500); the rest are `remaining`.
7480
+ */
7481
+ maxPerDomain: number;
7482
+ }>;
7483
+ export type RetentionSweepDomainBody = Partial<{
7484
+ /**
7485
+ * The most rows this call purges (default 500); the rest are `remaining`.
7486
+ */
7487
+ maxPerDomain: number;
7488
+ }>;
7489
+ export type RetentionSweepResult = {
7490
+ perDomain: Array<{
7491
+ domain: RetentionDomain;
7492
+ purged: number;
7493
+ /**
7494
+ * Rows past grace this call left (the `maxPerDomain` cap); sweep again.
7495
+ */
7496
+ remaining: number;
7497
+ /**
7498
+ * The retention policy that applied.
7499
+ */
7500
+ policyId?: string;
7501
+ missingAdapter?: true;
7502
+ }>;
7503
+ totalPurged: number;
7504
+ /**
7505
+ * Domains more than one retention policy covers. Absent or empty: none.
7506
+ */
7507
+ conflicts?: Array<RetentionPolicyConflict>;
7508
+ };
6964
7509
  export type EvalKind = "accuracy" | "pairwise" | "regression" | "human-review" | "benchmark" | "custom" | "judged";
6965
7510
  export type EvalSuite = {
6966
7511
  id: string;
@@ -7093,7 +7638,7 @@ declare namespace Schemas {
7093
7638
  version?: string;
7094
7639
  };
7095
7640
  /**
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.
7641
+ * 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? } }`, `segments` a path in the project, coarse to fine). Only `'recorded'` runs today; the others are refused when the run starts.
7097
7642
  */
7098
7643
  export type EvalBaseline = "recorded" | {
7099
7644
  agentId: string;
@@ -7101,8 +7646,11 @@ declare namespace Schemas {
7101
7646
  } | {
7102
7647
  live: Partial<{
7103
7648
  projectId: string;
7104
- segments: Record<string, string>;
7105
- }>;
7649
+ /**
7650
+ * A segment path in `projectId`, coarse to fine, as live versions resolve it. Needs `projectId`.
7651
+ */
7652
+ segments: Array<ScopeSegment>;
7653
+ }>;
7106
7654
  };
7107
7655
  /**
7108
7656
  * A comparison eval run's settings (a `judged` suite).
@@ -7115,6 +7663,211 @@ declare namespace Schemas {
7115
7663
  reads: "recorded" | "live";
7116
7664
  repetitions: number;
7117
7665
  k: number;
7666
+ versions?: FlowVersionOverrides;
7667
+ /**
7668
+ * Which judgments count: each at its class's weight (`as-recorded`, the default), or only those recorded while their class was restricted (`Judgment.restricted`), the others weighing 0 (`restricted-only`).
7669
+ */
7670
+ classWeights?: "as-recorded" | "restricted-only";
7671
+ };
7672
+ /**
7673
+ * One metric, the recorded runs beside the candidate. `null` where a side had no judged evidence; `n` / `weight` are the candidate's evidence (cases with judged items, and the judgment weight behind them), `baselineN` / `baselineWeight` the recorded side's.
7674
+ */
7675
+ export type ComparisonMetric = {
7676
+ baseline: number | null;
7677
+ candidate: number | null;
7678
+ delta: number | null;
7679
+ n: number;
7680
+ weight: number;
7681
+ baselineN: number;
7682
+ baselineWeight: number;
7683
+ direction: "higher";
7684
+ /**
7685
+ * `weightedPrecisionAtK`: the ranked items it looked at.
7686
+ */
7687
+ k?: number;
7688
+ /**
7689
+ * With more than one repetition: the candidate's max − min across them.
7690
+ */
7691
+ spread?: number;
7692
+ };
7693
+ /**
7694
+ * What ran on the cases: an agent version, or a flow version (with any versions it swapped in).
7695
+ */
7696
+ export type ComparisonCandidate = {
7697
+ kind: "agent";
7698
+ agentId: string;
7699
+ version: string;
7700
+ /**
7701
+ * The version's pinsDigest: what it ran, as a promotion gate checks. Absent for a version published before pins, and from a comparison recorded before it.
7702
+ */
7703
+ pinsDigest?: string;
7704
+ } | {
7705
+ kind: "flow";
7706
+ flowId: string;
7707
+ version: string;
7708
+ versions?: FlowVersionOverrides;
7709
+ };
7710
+ /**
7711
+ * What a comparison concluded: the candidate beside the recorded runs, the case counts, and the metrics. What a promotion gate reads.
7712
+ */
7713
+ export type JudgedComparisonSummary = {
7714
+ evalRunId: string;
7715
+ status: "completed" | "partial" | "failed";
7716
+ completedAt: string;
7717
+ suite: {
7718
+ id: string;
7719
+ version: string;
7720
+ };
7721
+ candidate: ComparisonCandidate;
7722
+ /**
7723
+ * What the candidate was compared with: `recorded` (the test set's recorded runs, with the versions that served them), or another version.
7724
+ */
7725
+ baseline: {
7726
+ kind: "recorded";
7727
+ versions: Array<{
7728
+ agentId?: string;
7729
+ flowId?: string;
7730
+ version: string;
7731
+ cases: number;
7732
+ }>;
7733
+ } | {
7734
+ kind: "version";
7735
+ agentId: string;
7736
+ version: string;
7737
+ via: "explicit" | "live";
7738
+ liveScope?: Record<string, unknown>;
7739
+ };
7740
+ /**
7741
+ * Where the test set's judgments came from.
7742
+ */
7743
+ scope: Partial<{
7744
+ projectId: string;
7745
+ }>;
7746
+ cases: number;
7747
+ /**
7748
+ * Cases where a read with no recording ran live under `reads: 'recorded'`.
7749
+ */
7750
+ diverged: number;
7751
+ /**
7752
+ * Tool calls refused across the cases (what the candidate would have done).
7753
+ */
7754
+ refusedWrites: number;
7755
+ /**
7756
+ * Cases none of whose repetitions ran.
7757
+ */
7758
+ errors: number;
7759
+ /**
7760
+ * Flow cases that stopped at a write the replay refused: no output to score, so they're left out of the metrics.
7761
+ */
7762
+ stopped: number;
7763
+ reads: "recorded" | "live";
7764
+ /**
7765
+ * Which judgments counted. Absent from a comparison recorded before restricted classes: `as-recorded`.
7766
+ */
7767
+ classWeights?: "as-recorded" | "restricted-only";
7768
+ sampling: {
7769
+ /**
7770
+ * The models that answered the candidate's replays, and how many replays each.
7771
+ */
7772
+ models: Array<{
7773
+ providerId: string;
7774
+ model: string;
7775
+ runs: number;
7776
+ }>;
7777
+ };
7778
+ repetitions: number;
7779
+ metrics: {
7780
+ weightedYesShare: ComparisonMetric;
7781
+ judgedCoverage: ComparisonMetric;
7782
+ weightedPrecisionAtK: ComparisonMetric;
7783
+ };
7784
+ };
7785
+ /**
7786
+ * One case of a comparison: its replay runs, the scores, the items kept, dropped and new, the tool calls, and why it didn't run when it didn't.
7787
+ */
7788
+ export type ComparisonCaseResult = {
7789
+ caseId: string;
7790
+ /**
7791
+ * The candidate's replay runs, one per repetition.
7792
+ */
7793
+ runIds: Array<string>;
7794
+ /**
7795
+ * An output's score: Σ yesWeight and Σ totalWeight over its judged items, and over those among the first `k` ranked items.
7796
+ */
7797
+ baseline: {
7798
+ yesWeight: number;
7799
+ totalWeight: number;
7800
+ items: number;
7801
+ judgedItems: number;
7802
+ topK: {
7803
+ yesWeight: number;
7804
+ totalWeight: number;
7805
+ };
7806
+ };
7807
+ /**
7808
+ * One per repetition that ran.
7809
+ */
7810
+ candidate: Array<{
7811
+ yesWeight: number;
7812
+ totalWeight: number;
7813
+ items: number;
7814
+ judgedItems: number;
7815
+ topK: {
7816
+ yesWeight: number;
7817
+ totalWeight: number;
7818
+ };
7819
+ }>;
7820
+ /**
7821
+ * The first repetition's items against the judged ones.
7822
+ */
7823
+ changes?: {
7824
+ kept: Array<{
7825
+ key: string;
7826
+ rankBefore?: number;
7827
+ rank?: number;
7828
+ }>;
7829
+ dropped: Array<{
7830
+ key: string;
7831
+ rankBefore?: number;
7832
+ }>;
7833
+ new: Array<{
7834
+ key: string;
7835
+ pointer: string;
7836
+ rank?: number;
7837
+ }>;
7838
+ };
7839
+ /**
7840
+ * The first repetition's tool calls, and what happened to each.
7841
+ */
7842
+ tools?: Array<{
7843
+ step: number;
7844
+ callId: string;
7845
+ toolId: string;
7846
+ toolVersion: string;
7847
+ arguments: unknown;
7848
+ source: "live" | "recorded" | "refused";
7849
+ reason?: string;
7850
+ }>;
7851
+ diverged: boolean;
7852
+ refusedWrites: number;
7853
+ noContext: boolean;
7854
+ approvalSkipped: boolean;
7855
+ error?: string;
7856
+ /**
7857
+ * Set when the replay stopped at a refused write: what it would have done.
7858
+ */
7859
+ stopped?: {
7860
+ toolId: string;
7861
+ arguments: unknown;
7862
+ reason?: string;
7863
+ };
7864
+ };
7865
+ /**
7866
+ * A comparison's `result` (a `judged` eval run's): the summary and each case. `EvalRun.result` stays an open object, since each kind has its own; the clients read it as this (TS `comparisonOf(run)`, Python `comparison_of(run)`).
7867
+ */
7868
+ export type JudgedComparisonResult = {
7869
+ summary: JudgedComparisonSummary;
7870
+ perCase: Array<ComparisonCaseResult>;
7118
7871
  };
7119
7872
  export type EvalRun = {
7120
7873
  runId: string;
@@ -7129,7 +7882,7 @@ declare namespace Schemas {
7129
7882
  startedAt: string;
7130
7883
  completedAt?: string;
7131
7884
  /**
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.
7885
+ * 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, versions? }`), 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.
7133
7886
  */
7134
7887
  result?: Record<string, unknown>;
7135
7888
  error?: string;
@@ -7142,7 +7895,7 @@ declare namespace Schemas {
7142
7895
  hasMore: boolean;
7143
7896
  };
7144
7897
  /**
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.
7898
+ * 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. With `flowRef`, `versions` runs the flow with some of its agents or tools at other versions; an id the flow doesn't use, or a version that isn't published, is refused (`400 validation-failed`, each under `details.issues`).
7146
7899
  */
7147
7900
  export type StartEvalRunBody = {
7148
7901
  /**
@@ -7157,6 +7910,11 @@ declare namespace Schemas {
7157
7910
  reads?: "recorded" | "live";
7158
7911
  repetitions?: number;
7159
7912
  k?: number;
7913
+ versions?: FlowVersionOverrides;
7914
+ /**
7915
+ * Which judgments count: each at its class's weight (`as-recorded`, the default), or only those recorded while their class was restricted (`Judgment.restricted`), the others weighing 0 (`restricted-only`).
7916
+ */
7917
+ classWeights?: "as-recorded" | "restricted-only";
7160
7918
  };
7161
7919
  export type StartEvalRunResult = {
7162
7920
  runId: string;
@@ -7203,6 +7961,10 @@ declare namespace Schemas {
7203
7961
  };
7204
7962
  export type IdentityProviderCollectionPage = {
7205
7963
  data: Array<IdentityProviderConfig>;
7964
+ /**
7965
+ * Always `false`: the list comes whole. Absent from older servers.
7966
+ */
7967
+ hasMore?: boolean;
7206
7968
  };
7207
7969
  export type RegisterIdentityProviderResult = {
7208
7970
  providerId: string;
@@ -7822,6 +8584,10 @@ declare namespace Schemas {
7822
8584
  };
7823
8585
  export type EnvCollectionPage = {
7824
8586
  data: Array<EnvRecord>;
8587
+ /**
8588
+ * Whether there's another page. Absent from older servers: there is one when `nextCursor` is set.
8589
+ */
8590
+ hasMore?: boolean;
7825
8591
  nextCursor?: string;
7826
8592
  };
7827
8593
  export type EnvSetRequest = {
@@ -7837,10 +8603,18 @@ declare namespace Schemas {
7837
8603
  };
7838
8604
  export type SecretCollectionPage = {
7839
8605
  data: Array<SecretRecord>;
8606
+ /**
8607
+ * Whether there's another page. Absent from older servers: there is one when `nextCursor` is set.
8608
+ */
8609
+ hasMore?: boolean;
7840
8610
  nextCursor?: string;
7841
8611
  };
7842
8612
  export type SecretVersionCollectionPage = {
7843
8613
  data: Array<SecretVersionRecord>;
8614
+ /**
8615
+ * Whether there's another page. Absent from older servers: there is one when `nextCursor` is set.
8616
+ */
8617
+ hasMore?: boolean;
7844
8618
  nextCursor?: string;
7845
8619
  };
7846
8620
  export type SecretSetRequest = {
@@ -8212,99 +8986,736 @@ declare namespace Schemas {
8212
8986
  };
8213
8987
  // </Schemas>
8214
8988
  }
8215
- export type RunProgress = Schemas.RunProgress;
8216
- export declare const RunProgress: z.ZodObject<{
8217
- id: z.ZodUUID;
8218
- flowId: z.ZodString;
8219
- flowVersion: z.ZodString;
8220
- status: z.ZodEnum<{
8221
- pending: "pending";
8222
- failed: "failed";
8223
- running: "running";
8224
- completed: "completed";
8225
- cancelled: "cancelled";
8226
- suspended: "suspended";
8227
- }>;
8228
- createdAt: z.ZodISODateTime;
8229
- updatedAt: z.ZodISODateTime;
8230
- completedAt: z.ZodOptional<z.ZodISODateTime>;
8231
- parentRunId: z.ZodOptional<z.ZodUUID>;
8989
+ export type ScopeSegment = Schemas.ScopeSegment;
8990
+ declare const ScopeSegment: z.ZodObject<{
8991
+ key: z.ZodString;
8992
+ value: z.ZodString;
8232
8993
  }, z.core.$strict>;
8233
- export type TrustedSigningKey = Schemas.TrustedSigningKey;
8234
- declare const TrustedSigningKey: z.ZodObject<{
8235
- keyId: z.ZodString;
8236
- tenantId: z.ZodUUID;
8237
- algorithm: z.ZodLiteral<"ed25519">;
8238
- publicKey: z.ZodString;
8239
- label: z.ZodOptional<z.ZodString>;
8240
- createdAt: z.ZodISODateTime;
8241
- revokedAt: z.ZodOptional<z.ZodISODateTime>;
8242
- revokedReason: z.ZodOptional<z.ZodString>;
8994
+ export type LiveScope = Schemas.LiveScope;
8995
+ declare const LiveScope: z.ZodDiscriminatedUnion<[
8996
+ z.ZodObject<{
8997
+ kind: z.ZodLiteral<"tenant">;
8998
+ }, z.core.$strict>,
8999
+ z.ZodObject<{
9000
+ kind: z.ZodLiteral<"org">;
9001
+ orgId: z.ZodUUID;
9002
+ }, z.core.$strict>,
9003
+ z.ZodObject<{
9004
+ kind: z.ZodLiteral<"project">;
9005
+ projectId: z.ZodUUID;
9006
+ }, z.core.$strict>,
9007
+ z.ZodObject<{
9008
+ kind: z.ZodLiteral<"segment">;
9009
+ projectId: z.ZodUUID;
9010
+ path: z.ZodArray<z.ZodObject<{
9011
+ key: z.ZodString;
9012
+ value: z.ZodString;
9013
+ }, z.core.$strict>>;
9014
+ }, z.core.$strict>
9015
+ ], "kind">;
9016
+ export type LiveVersionResolution = Schemas.LiveVersionResolution;
9017
+ declare const LiveVersionResolution: z.ZodObject<{
9018
+ agentId: z.ZodString;
9019
+ version: z.ZodString;
9020
+ via: z.ZodEnum<{
9021
+ live: "live";
9022
+ latest: "latest";
9023
+ }>;
9024
+ liveScope: z.ZodOptional<z.ZodDiscriminatedUnion<[
9025
+ z.ZodObject<{
9026
+ kind: z.ZodLiteral<"tenant">;
9027
+ }, z.core.$strict>,
9028
+ z.ZodObject<{
9029
+ kind: z.ZodLiteral<"org">;
9030
+ orgId: z.ZodUUID;
9031
+ }, z.core.$strict>,
9032
+ z.ZodObject<{
9033
+ kind: z.ZodLiteral<"project">;
9034
+ projectId: z.ZodUUID;
9035
+ }, z.core.$strict>,
9036
+ z.ZodObject<{
9037
+ kind: z.ZodLiteral<"segment">;
9038
+ projectId: z.ZodUUID;
9039
+ path: z.ZodArray<z.ZodObject<{
9040
+ key: z.ZodString;
9041
+ value: z.ZodString;
9042
+ }, z.core.$strict>>;
9043
+ }, z.core.$strict>
9044
+ ], "kind">>;
8243
9045
  }, z.core.$strict>;
8244
- export type TrustSigningKeyBody = Schemas.TrustSigningKeyBody;
8245
- declare const TrustSigningKeyBody: z.ZodObject<{
8246
- keyId: z.ZodString;
8247
- algorithm: z.ZodOptional<z.ZodLiteral<"ed25519">>;
8248
- publicKey: z.ZodString;
8249
- label: z.ZodOptional<z.ZodString>;
9046
+ export type LivePin = Schemas.LivePin;
9047
+ declare const LivePin: z.ZodObject<{
9048
+ agentId: z.ZodString;
9049
+ scope: z.ZodDiscriminatedUnion<[
9050
+ z.ZodObject<{
9051
+ kind: z.ZodLiteral<"tenant">;
9052
+ }, z.core.$strict>,
9053
+ z.ZodObject<{
9054
+ kind: z.ZodLiteral<"org">;
9055
+ orgId: z.ZodUUID;
9056
+ }, z.core.$strict>,
9057
+ z.ZodObject<{
9058
+ kind: z.ZodLiteral<"project">;
9059
+ projectId: z.ZodUUID;
9060
+ }, z.core.$strict>,
9061
+ z.ZodObject<{
9062
+ kind: z.ZodLiteral<"segment">;
9063
+ projectId: z.ZodUUID;
9064
+ path: z.ZodArray<z.ZodObject<{
9065
+ key: z.ZodString;
9066
+ value: z.ZodString;
9067
+ }, z.core.$strict>>;
9068
+ }, z.core.$strict>
9069
+ ], "kind">;
9070
+ version: z.ZodString;
9071
+ promotionId: z.ZodUUID;
9072
+ setAt: z.ZodISODateTime;
8250
9073
  }, z.core.$strict>;
8251
- export type TrustedSigningKeyPage = Schemas.TrustedSigningKeyPage;
8252
- declare const TrustedSigningKeyPage: z.ZodObject<{
9074
+ export type LivePinList = Schemas.LivePinList;
9075
+ declare const LivePinList: z.ZodObject<{
8253
9076
  data: z.ZodArray<z.ZodObject<{
8254
- keyId: z.ZodString;
8255
- tenantId: z.ZodUUID;
8256
- algorithm: z.ZodLiteral<"ed25519">;
8257
- publicKey: z.ZodString;
8258
- label: z.ZodOptional<z.ZodString>;
8259
- createdAt: z.ZodISODateTime;
8260
- revokedAt: z.ZodOptional<z.ZodISODateTime>;
8261
- revokedReason: z.ZodOptional<z.ZodString>;
9077
+ agentId: z.ZodString;
9078
+ scope: z.ZodDiscriminatedUnion<[
9079
+ z.ZodObject<{
9080
+ kind: z.ZodLiteral<"tenant">;
9081
+ }, z.core.$strict>,
9082
+ z.ZodObject<{
9083
+ kind: z.ZodLiteral<"org">;
9084
+ orgId: z.ZodUUID;
9085
+ }, z.core.$strict>,
9086
+ z.ZodObject<{
9087
+ kind: z.ZodLiteral<"project">;
9088
+ projectId: z.ZodUUID;
9089
+ }, z.core.$strict>,
9090
+ z.ZodObject<{
9091
+ kind: z.ZodLiteral<"segment">;
9092
+ projectId: z.ZodUUID;
9093
+ path: z.ZodArray<z.ZodObject<{
9094
+ key: z.ZodString;
9095
+ value: z.ZodString;
9096
+ }, z.core.$strict>>;
9097
+ }, z.core.$strict>
9098
+ ], "kind">;
9099
+ version: z.ZodString;
9100
+ promotionId: z.ZodUUID;
9101
+ setAt: z.ZodISODateTime;
8262
9102
  }, z.core.$strict>>;
8263
- nextCursor: z.ZodOptional<z.ZodString>;
8264
- hasMore: z.ZodBoolean;
8265
- }, z.core.$strict>;
8266
- export type RevokeSigningKeyResult = Schemas.RevokeSigningKeyResult;
8267
- declare const RevokeSigningKeyResult: z.ZodObject<{
8268
- keyId: z.ZodString;
8269
- revoked: z.ZodBoolean;
8270
9103
  }, z.core.$strict>;
8271
- export type MintPublicRunTokenBody = Schemas.MintPublicRunTokenBody;
8272
- declare const MintPublicRunTokenBody: z.ZodObject<{
8273
- runIds: z.ZodArray<z.ZodString>;
8274
- expiresInSeconds: z.ZodOptional<z.ZodNumber>;
9104
+ export type GatePolicyRef = Schemas.GatePolicyRef;
9105
+ declare const GatePolicyRef: z.ZodObject<{
9106
+ id: z.ZodString;
9107
+ version: z.ZodString;
8275
9108
  }, z.core.$strict>;
8276
- export type MintPublicRunTokenResult = Schemas.MintPublicRunTokenResult;
8277
- declare const MintPublicRunTokenResult: z.ZodObject<{
8278
- token: z.ZodString;
8279
- expiresAt: z.ZodISODateTime;
8280
- runIds: z.ZodArray<z.ZodString>;
9109
+ export type GateCheck = Schemas.GateCheck;
9110
+ declare const GateCheck: z.ZodObject<{
9111
+ name: z.ZodString;
9112
+ passed: z.ZodBoolean;
9113
+ message: z.ZodString;
9114
+ value: z.ZodOptional<z.ZodUnion<readonly [
9115
+ z.ZodNumber,
9116
+ z.ZodString
9117
+ ]>>;
9118
+ threshold: z.ZodOptional<z.ZodUnion<readonly [
9119
+ z.ZodNumber,
9120
+ z.ZodString
9121
+ ]>>;
8281
9122
  }, z.core.$strict>;
8282
- export type JudgedEvalCase = Schemas.JudgedEvalCase;
8283
- declare const JudgedEvalCase: z.ZodObject<{
8284
- caseId: z.ZodString;
8285
- subject: z.ZodObject<{
9123
+ export type Promotion = Schemas.Promotion;
9124
+ declare const Promotion: z.ZodObject<{
9125
+ id: z.ZodUUID;
9126
+ agentId: z.ZodString;
9127
+ scope: z.ZodDiscriminatedUnion<[
9128
+ z.ZodObject<{
9129
+ kind: z.ZodLiteral<"tenant">;
9130
+ }, z.core.$strict>,
9131
+ z.ZodObject<{
9132
+ kind: z.ZodLiteral<"org">;
9133
+ orgId: z.ZodUUID;
9134
+ }, z.core.$strict>,
9135
+ z.ZodObject<{
9136
+ kind: z.ZodLiteral<"project">;
9137
+ projectId: z.ZodUUID;
9138
+ }, z.core.$strict>,
9139
+ z.ZodObject<{
9140
+ kind: z.ZodLiteral<"segment">;
9141
+ projectId: z.ZodUUID;
9142
+ path: z.ZodArray<z.ZodObject<{
9143
+ key: z.ZodString;
9144
+ value: z.ZodString;
9145
+ }, z.core.$strict>>;
9146
+ }, z.core.$strict>
9147
+ ], "kind">;
9148
+ action: z.ZodEnum<{
9149
+ promote: "promote";
9150
+ rollback: "rollback";
9151
+ unpin: "unpin";
9152
+ }>;
9153
+ fromVersion: z.ZodNullable<z.ZodString>;
9154
+ toVersion: z.ZodNullable<z.ZodString>;
9155
+ requestedBy: z.ZodObject<{
8286
9156
  kind: z.ZodEnum<{
8287
- agent: "agent";
8288
- flow: "flow";
9157
+ user: "user";
9158
+ service: "service";
8289
9159
  }>;
8290
9160
  id: z.ZodString;
8291
- version: z.ZodString;
8292
9161
  }, 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;
9162
+ reason: z.ZodOptional<z.ZodString>;
9163
+ evalRunId: z.ZodOptional<z.ZodString>;
9164
+ createdAt: z.ZodISODateTime;
9165
+ status: z.ZodOptional<z.ZodEnum<{
9166
+ rejected: "rejected";
9167
+ expired: "expired";
9168
+ promoted: "promoted";
9169
+ "pending-approval": "pending-approval";
9170
+ refused: "refused";
9171
+ superseded: "superseded";
9172
+ }>>;
9173
+ policy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9174
+ id: z.ZodString;
9175
+ version: z.ZodString;
9176
+ }, z.core.$strict>>>;
9177
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
9178
+ name: z.ZodString;
9179
+ passed: z.ZodBoolean;
9180
+ message: z.ZodString;
9181
+ value: z.ZodOptional<z.ZodUnion<readonly [
9182
+ z.ZodNumber,
9183
+ z.ZodString
9184
+ ]>>;
9185
+ threshold: z.ZodOptional<z.ZodUnion<readonly [
9186
+ z.ZodNumber,
9187
+ z.ZodString
9188
+ ]>>;
9189
+ }, z.core.$strict>>>;
9190
+ approvalId: z.ZodOptional<z.ZodString>;
9191
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
9192
+ }, z.core.$strict>;
9193
+ export type PromotionPage = Schemas.PromotionPage;
9194
+ declare const PromotionPage: z.ZodObject<{
9195
+ data: z.ZodArray<z.ZodObject<{
9196
+ id: z.ZodUUID;
9197
+ agentId: z.ZodString;
9198
+ scope: z.ZodDiscriminatedUnion<[
9199
+ z.ZodObject<{
9200
+ kind: z.ZodLiteral<"tenant">;
9201
+ }, z.core.$strict>,
9202
+ z.ZodObject<{
9203
+ kind: z.ZodLiteral<"org">;
9204
+ orgId: z.ZodUUID;
9205
+ }, z.core.$strict>,
9206
+ z.ZodObject<{
9207
+ kind: z.ZodLiteral<"project">;
9208
+ projectId: z.ZodUUID;
9209
+ }, z.core.$strict>,
9210
+ z.ZodObject<{
9211
+ kind: z.ZodLiteral<"segment">;
9212
+ projectId: z.ZodUUID;
9213
+ path: z.ZodArray<z.ZodObject<{
9214
+ key: z.ZodString;
9215
+ value: z.ZodString;
9216
+ }, z.core.$strict>>;
9217
+ }, z.core.$strict>
9218
+ ], "kind">;
9219
+ action: z.ZodEnum<{
9220
+ promote: "promote";
9221
+ rollback: "rollback";
9222
+ unpin: "unpin";
9223
+ }>;
9224
+ fromVersion: z.ZodNullable<z.ZodString>;
9225
+ toVersion: z.ZodNullable<z.ZodString>;
9226
+ requestedBy: z.ZodObject<{
9227
+ kind: z.ZodEnum<{
9228
+ user: "user";
9229
+ service: "service";
9230
+ }>;
9231
+ id: z.ZodString;
9232
+ }, z.core.$strict>;
9233
+ reason: z.ZodOptional<z.ZodString>;
9234
+ evalRunId: z.ZodOptional<z.ZodString>;
9235
+ createdAt: z.ZodISODateTime;
9236
+ status: z.ZodOptional<z.ZodEnum<{
9237
+ rejected: "rejected";
9238
+ expired: "expired";
9239
+ promoted: "promoted";
9240
+ "pending-approval": "pending-approval";
9241
+ refused: "refused";
9242
+ superseded: "superseded";
9243
+ }>>;
9244
+ policy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9245
+ id: z.ZodString;
9246
+ version: z.ZodString;
9247
+ }, z.core.$strict>>>;
9248
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
9249
+ name: z.ZodString;
9250
+ passed: z.ZodBoolean;
9251
+ message: z.ZodString;
9252
+ value: z.ZodOptional<z.ZodUnion<readonly [
9253
+ z.ZodNumber,
9254
+ z.ZodString
9255
+ ]>>;
9256
+ threshold: z.ZodOptional<z.ZodUnion<readonly [
9257
+ z.ZodNumber,
9258
+ z.ZodString
9259
+ ]>>;
9260
+ }, z.core.$strict>>>;
9261
+ approvalId: z.ZodOptional<z.ZodString>;
9262
+ resolvedAt: z.ZodOptional<z.ZodISODateTime>;
9263
+ }, z.core.$strict>>;
9264
+ hasMore: z.ZodBoolean;
9265
+ nextCursor: z.ZodOptional<z.ZodString>;
9266
+ }, z.core.$strict>;
9267
+ export type GateApproval = Schemas.GateApproval;
9268
+ declare const GateApproval: z.ZodObject<{
9269
+ role: z.ZodEnum<{
9270
+ standard: "standard";
9271
+ senior: "senior";
9272
+ admin: "admin";
9273
+ }>;
9274
+ count: z.ZodNumber;
9275
+ separateApprover: z.ZodBoolean;
9276
+ }, z.core.$strict>;
9277
+ export type GatePolicySpec = Schemas.GatePolicySpec;
9278
+ declare const GatePolicySpec: z.ZodObject<{
9279
+ comparison: z.ZodOptional<z.ZodObject<{
9280
+ maxAgeHours: z.ZodOptional<z.ZodNumber>;
9281
+ suite: z.ZodOptional<z.ZodObject<{
9282
+ id: z.ZodString;
9283
+ version: z.ZodOptional<z.ZodString>;
9284
+ }, z.core.$strict>>;
9285
+ }, z.core.$strict>>;
9286
+ evidence: z.ZodOptional<z.ZodObject<{
9287
+ minCases: z.ZodOptional<z.ZodNumber>;
9288
+ minWeight: z.ZodOptional<z.ZodNumber>;
9289
+ }, z.core.$strict>>;
9290
+ metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
9291
+ name: z.ZodEnum<{
9292
+ weightedYesShare: "weightedYesShare";
9293
+ judgedCoverage: "judgedCoverage";
9294
+ weightedPrecisionAtK: "weightedPrecisionAtK";
9295
+ }>;
9296
+ k: z.ZodOptional<z.ZodNumber>;
9297
+ minCandidate: z.ZodOptional<z.ZodNumber>;
9298
+ maxDrop: z.ZodOptional<z.ZodNumber>;
9299
+ }, z.core.$strict>>>;
9300
+ replay: z.ZodOptional<z.ZodObject<{
9301
+ maxDiverged: z.ZodOptional<z.ZodNumber>;
9302
+ maxErrors: z.ZodOptional<z.ZodNumber>;
9303
+ maxRefusedWrites: z.ZodOptional<z.ZodNumber>;
9304
+ maxStopped: z.ZodOptional<z.ZodNumber>;
9305
+ }, z.core.$strict>>;
9306
+ approvals: z.ZodOptional<z.ZodObject<{
9307
+ role: z.ZodOptional<z.ZodEnum<{
9308
+ standard: "standard";
9309
+ senior: "senior";
9310
+ admin: "admin";
9311
+ }>>;
9312
+ separateApprover: z.ZodOptional<z.ZodBoolean>;
9313
+ }, z.core.$strict>>;
9314
+ onlyRestrictedClasses: z.ZodOptional<z.ZodBoolean>;
9315
+ }, z.core.$strict>;
9316
+ export type GatePolicy = Schemas.GatePolicy;
9317
+ declare const GatePolicy: z.ZodObject<{
9318
+ id: z.ZodString;
9319
+ version: z.ZodString;
9320
+ agentId: z.ZodString;
9321
+ scope: z.ZodDiscriminatedUnion<[
9322
+ z.ZodObject<{
9323
+ kind: z.ZodLiteral<"tenant">;
9324
+ }, z.core.$strict>,
9325
+ z.ZodObject<{
9326
+ kind: z.ZodLiteral<"org">;
9327
+ orgId: z.ZodUUID;
9328
+ }, z.core.$strict>,
9329
+ z.ZodObject<{
9330
+ kind: z.ZodLiteral<"project">;
9331
+ projectId: z.ZodUUID;
9332
+ }, z.core.$strict>,
9333
+ z.ZodObject<{
9334
+ kind: z.ZodLiteral<"segment">;
9335
+ projectId: z.ZodUUID;
9336
+ path: z.ZodArray<z.ZodObject<{
9337
+ key: z.ZodString;
9338
+ value: z.ZodString;
9339
+ }, z.core.$strict>>;
9340
+ }, z.core.$strict>
9341
+ ], "kind">;
9342
+ spec: z.ZodObject<{
9343
+ comparison: z.ZodOptional<z.ZodObject<{
9344
+ maxAgeHours: z.ZodOptional<z.ZodNumber>;
9345
+ suite: z.ZodOptional<z.ZodObject<{
9346
+ id: z.ZodString;
9347
+ version: z.ZodOptional<z.ZodString>;
9348
+ }, z.core.$strict>>;
9349
+ }, z.core.$strict>>;
9350
+ evidence: z.ZodOptional<z.ZodObject<{
9351
+ minCases: z.ZodOptional<z.ZodNumber>;
9352
+ minWeight: z.ZodOptional<z.ZodNumber>;
9353
+ }, z.core.$strict>>;
9354
+ metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
9355
+ name: z.ZodEnum<{
9356
+ weightedYesShare: "weightedYesShare";
9357
+ judgedCoverage: "judgedCoverage";
9358
+ weightedPrecisionAtK: "weightedPrecisionAtK";
9359
+ }>;
9360
+ k: z.ZodOptional<z.ZodNumber>;
9361
+ minCandidate: z.ZodOptional<z.ZodNumber>;
9362
+ maxDrop: z.ZodOptional<z.ZodNumber>;
9363
+ }, z.core.$strict>>>;
9364
+ replay: z.ZodOptional<z.ZodObject<{
9365
+ maxDiverged: z.ZodOptional<z.ZodNumber>;
9366
+ maxErrors: z.ZodOptional<z.ZodNumber>;
9367
+ maxRefusedWrites: z.ZodOptional<z.ZodNumber>;
9368
+ maxStopped: z.ZodOptional<z.ZodNumber>;
9369
+ }, z.core.$strict>>;
9370
+ approvals: z.ZodOptional<z.ZodObject<{
9371
+ role: z.ZodOptional<z.ZodEnum<{
9372
+ standard: "standard";
9373
+ senior: "senior";
9374
+ admin: "admin";
9375
+ }>>;
9376
+ separateApprover: z.ZodOptional<z.ZodBoolean>;
9377
+ }, z.core.$strict>>;
9378
+ onlyRestrictedClasses: z.ZodOptional<z.ZodBoolean>;
9379
+ }, z.core.$strict>;
9380
+ description: z.ZodOptional<z.ZodString>;
9381
+ createdAt: z.ZodISODateTime;
9382
+ unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
9383
+ }, z.core.$strict>;
9384
+ export type GatePolicyPage = Schemas.GatePolicyPage;
9385
+ declare const GatePolicyPage: z.ZodObject<{
9386
+ data: z.ZodArray<z.ZodObject<{
9387
+ id: z.ZodString;
9388
+ version: z.ZodString;
9389
+ agentId: z.ZodString;
9390
+ scope: z.ZodDiscriminatedUnion<[
9391
+ z.ZodObject<{
9392
+ kind: z.ZodLiteral<"tenant">;
9393
+ }, z.core.$strict>,
9394
+ z.ZodObject<{
9395
+ kind: z.ZodLiteral<"org">;
9396
+ orgId: z.ZodUUID;
9397
+ }, z.core.$strict>,
9398
+ z.ZodObject<{
9399
+ kind: z.ZodLiteral<"project">;
9400
+ projectId: z.ZodUUID;
9401
+ }, z.core.$strict>,
9402
+ z.ZodObject<{
9403
+ kind: z.ZodLiteral<"segment">;
9404
+ projectId: z.ZodUUID;
9405
+ path: z.ZodArray<z.ZodObject<{
9406
+ key: z.ZodString;
9407
+ value: z.ZodString;
9408
+ }, z.core.$strict>>;
9409
+ }, z.core.$strict>
9410
+ ], "kind">;
9411
+ spec: z.ZodObject<{
9412
+ comparison: z.ZodOptional<z.ZodObject<{
9413
+ maxAgeHours: z.ZodOptional<z.ZodNumber>;
9414
+ suite: z.ZodOptional<z.ZodObject<{
9415
+ id: z.ZodString;
9416
+ version: z.ZodOptional<z.ZodString>;
9417
+ }, z.core.$strict>>;
9418
+ }, z.core.$strict>>;
9419
+ evidence: z.ZodOptional<z.ZodObject<{
9420
+ minCases: z.ZodOptional<z.ZodNumber>;
9421
+ minWeight: z.ZodOptional<z.ZodNumber>;
9422
+ }, z.core.$strict>>;
9423
+ metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
9424
+ name: z.ZodEnum<{
9425
+ weightedYesShare: "weightedYesShare";
9426
+ judgedCoverage: "judgedCoverage";
9427
+ weightedPrecisionAtK: "weightedPrecisionAtK";
9428
+ }>;
9429
+ k: z.ZodOptional<z.ZodNumber>;
9430
+ minCandidate: z.ZodOptional<z.ZodNumber>;
9431
+ maxDrop: z.ZodOptional<z.ZodNumber>;
9432
+ }, z.core.$strict>>>;
9433
+ replay: z.ZodOptional<z.ZodObject<{
9434
+ maxDiverged: z.ZodOptional<z.ZodNumber>;
9435
+ maxErrors: z.ZodOptional<z.ZodNumber>;
9436
+ maxRefusedWrites: z.ZodOptional<z.ZodNumber>;
9437
+ maxStopped: z.ZodOptional<z.ZodNumber>;
9438
+ }, z.core.$strict>>;
9439
+ approvals: z.ZodOptional<z.ZodObject<{
9440
+ role: z.ZodOptional<z.ZodEnum<{
9441
+ standard: "standard";
9442
+ senior: "senior";
9443
+ admin: "admin";
9444
+ }>>;
9445
+ separateApprover: z.ZodOptional<z.ZodBoolean>;
9446
+ }, z.core.$strict>>;
9447
+ onlyRestrictedClasses: z.ZodOptional<z.ZodBoolean>;
9448
+ }, z.core.$strict>;
9449
+ description: z.ZodOptional<z.ZodString>;
9450
+ createdAt: z.ZodISODateTime;
9451
+ unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
9452
+ }, z.core.$strict>>;
9453
+ hasMore: z.ZodBoolean;
9454
+ nextCursor: z.ZodOptional<z.ZodString>;
9455
+ }, z.core.$strict>;
9456
+ export type PublishGatePolicyBody = Schemas.PublishGatePolicyBody;
9457
+ declare const PublishGatePolicyBody: z.ZodObject<{
9458
+ id: z.ZodString;
9459
+ version: z.ZodString;
9460
+ agentId: z.ZodString;
9461
+ scope: z.ZodDiscriminatedUnion<[
9462
+ z.ZodObject<{
9463
+ kind: z.ZodLiteral<"tenant">;
9464
+ }, z.core.$strict>,
9465
+ z.ZodObject<{
9466
+ kind: z.ZodLiteral<"org">;
9467
+ orgId: z.ZodUUID;
9468
+ }, z.core.$strict>,
9469
+ z.ZodObject<{
9470
+ kind: z.ZodLiteral<"project">;
9471
+ projectId: z.ZodUUID;
9472
+ }, z.core.$strict>,
9473
+ z.ZodObject<{
9474
+ kind: z.ZodLiteral<"segment">;
9475
+ projectId: z.ZodUUID;
9476
+ path: z.ZodArray<z.ZodObject<{
9477
+ key: z.ZodString;
9478
+ value: z.ZodString;
9479
+ }, z.core.$strict>>;
9480
+ }, z.core.$strict>
9481
+ ], "kind">;
9482
+ spec: z.ZodObject<{
9483
+ comparison: z.ZodOptional<z.ZodObject<{
9484
+ maxAgeHours: z.ZodOptional<z.ZodNumber>;
9485
+ suite: z.ZodOptional<z.ZodObject<{
9486
+ id: z.ZodString;
9487
+ version: z.ZodOptional<z.ZodString>;
9488
+ }, z.core.$strict>>;
9489
+ }, z.core.$strict>>;
9490
+ evidence: z.ZodOptional<z.ZodObject<{
9491
+ minCases: z.ZodOptional<z.ZodNumber>;
9492
+ minWeight: z.ZodOptional<z.ZodNumber>;
9493
+ }, z.core.$strict>>;
9494
+ metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
9495
+ name: z.ZodEnum<{
9496
+ weightedYesShare: "weightedYesShare";
9497
+ judgedCoverage: "judgedCoverage";
9498
+ weightedPrecisionAtK: "weightedPrecisionAtK";
9499
+ }>;
9500
+ k: z.ZodOptional<z.ZodNumber>;
9501
+ minCandidate: z.ZodOptional<z.ZodNumber>;
9502
+ maxDrop: z.ZodOptional<z.ZodNumber>;
9503
+ }, z.core.$strict>>>;
9504
+ replay: z.ZodOptional<z.ZodObject<{
9505
+ maxDiverged: z.ZodOptional<z.ZodNumber>;
9506
+ maxErrors: z.ZodOptional<z.ZodNumber>;
9507
+ maxRefusedWrites: z.ZodOptional<z.ZodNumber>;
9508
+ maxStopped: z.ZodOptional<z.ZodNumber>;
9509
+ }, z.core.$strict>>;
9510
+ approvals: z.ZodOptional<z.ZodObject<{
9511
+ role: z.ZodOptional<z.ZodEnum<{
9512
+ standard: "standard";
9513
+ senior: "senior";
9514
+ admin: "admin";
9515
+ }>>;
9516
+ separateApprover: z.ZodOptional<z.ZodBoolean>;
9517
+ }, z.core.$strict>>;
9518
+ onlyRestrictedClasses: z.ZodOptional<z.ZodBoolean>;
9519
+ }, z.core.$strict>;
9520
+ description: z.ZodOptional<z.ZodString>;
9521
+ }, z.core.$strict>;
9522
+ export type GatePolicyResolution = Schemas.GatePolicyResolution;
9523
+ declare const GatePolicyResolution: z.ZodObject<{
9524
+ policy: z.ZodNullable<z.ZodObject<{
9525
+ id: z.ZodString;
9526
+ version: z.ZodString;
9527
+ agentId: z.ZodString;
9528
+ scope: z.ZodDiscriminatedUnion<[
9529
+ z.ZodObject<{
9530
+ kind: z.ZodLiteral<"tenant">;
9531
+ }, z.core.$strict>,
9532
+ z.ZodObject<{
9533
+ kind: z.ZodLiteral<"org">;
9534
+ orgId: z.ZodUUID;
9535
+ }, z.core.$strict>,
9536
+ z.ZodObject<{
9537
+ kind: z.ZodLiteral<"project">;
9538
+ projectId: z.ZodUUID;
9539
+ }, z.core.$strict>,
9540
+ z.ZodObject<{
9541
+ kind: z.ZodLiteral<"segment">;
9542
+ projectId: z.ZodUUID;
9543
+ path: z.ZodArray<z.ZodObject<{
9544
+ key: z.ZodString;
9545
+ value: z.ZodString;
9546
+ }, z.core.$strict>>;
9547
+ }, z.core.$strict>
9548
+ ], "kind">;
9549
+ spec: z.ZodObject<{
9550
+ comparison: z.ZodOptional<z.ZodObject<{
9551
+ maxAgeHours: z.ZodOptional<z.ZodNumber>;
9552
+ suite: z.ZodOptional<z.ZodObject<{
9553
+ id: z.ZodString;
9554
+ version: z.ZodOptional<z.ZodString>;
9555
+ }, z.core.$strict>>;
9556
+ }, z.core.$strict>>;
9557
+ evidence: z.ZodOptional<z.ZodObject<{
9558
+ minCases: z.ZodOptional<z.ZodNumber>;
9559
+ minWeight: z.ZodOptional<z.ZodNumber>;
9560
+ }, z.core.$strict>>;
9561
+ metrics: z.ZodOptional<z.ZodArray<z.ZodObject<{
9562
+ name: z.ZodEnum<{
9563
+ weightedYesShare: "weightedYesShare";
9564
+ judgedCoverage: "judgedCoverage";
9565
+ weightedPrecisionAtK: "weightedPrecisionAtK";
9566
+ }>;
9567
+ k: z.ZodOptional<z.ZodNumber>;
9568
+ minCandidate: z.ZodOptional<z.ZodNumber>;
9569
+ maxDrop: z.ZodOptional<z.ZodNumber>;
9570
+ }, z.core.$strict>>>;
9571
+ replay: z.ZodOptional<z.ZodObject<{
9572
+ maxDiverged: z.ZodOptional<z.ZodNumber>;
9573
+ maxErrors: z.ZodOptional<z.ZodNumber>;
9574
+ maxRefusedWrites: z.ZodOptional<z.ZodNumber>;
9575
+ maxStopped: z.ZodOptional<z.ZodNumber>;
9576
+ }, z.core.$strict>>;
9577
+ approvals: z.ZodOptional<z.ZodObject<{
9578
+ role: z.ZodOptional<z.ZodEnum<{
9579
+ standard: "standard";
9580
+ senior: "senior";
9581
+ admin: "admin";
9582
+ }>>;
9583
+ separateApprover: z.ZodOptional<z.ZodBoolean>;
9584
+ }, z.core.$strict>>;
9585
+ onlyRestrictedClasses: z.ZodOptional<z.ZodBoolean>;
9586
+ }, z.core.$strict>;
9587
+ description: z.ZodOptional<z.ZodString>;
9588
+ createdAt: z.ZodISODateTime;
9589
+ unregisteredAt: z.ZodOptional<z.ZodISODateTime>;
9590
+ }, z.core.$strict>>;
9591
+ }, z.core.$strict>;
9592
+ export type PromotionCheck = Schemas.PromotionCheck;
9593
+ declare const PromotionCheck: z.ZodObject<{
9594
+ outcome: z.ZodEnum<{
9595
+ "would-promote": "would-promote";
9596
+ "needs-approval": "needs-approval";
9597
+ "gate-failed": "gate-failed";
9598
+ }>;
9599
+ policy: z.ZodNullable<z.ZodObject<{
9600
+ id: z.ZodString;
9601
+ version: z.ZodString;
9602
+ }, z.core.$strict>>;
9603
+ checks: z.ZodArray<z.ZodObject<{
9604
+ name: z.ZodString;
9605
+ passed: z.ZodBoolean;
9606
+ message: z.ZodString;
9607
+ value: z.ZodOptional<z.ZodUnion<readonly [
9608
+ z.ZodNumber,
9609
+ z.ZodString
9610
+ ]>>;
9611
+ threshold: z.ZodOptional<z.ZodUnion<readonly [
9612
+ z.ZodNumber,
9613
+ z.ZodString
9614
+ ]>>;
9615
+ }, z.core.$strict>>;
9616
+ approval: z.ZodOptional<z.ZodObject<{
9617
+ role: z.ZodEnum<{
9618
+ standard: "standard";
9619
+ senior: "senior";
9620
+ admin: "admin";
9621
+ }>;
9622
+ count: z.ZodNumber;
9623
+ separateApprover: z.ZodBoolean;
9624
+ }, z.core.$strict>>;
9625
+ }, z.core.$strict>;
9626
+ export type RunProgress = Schemas.RunProgress;
9627
+ declare const RunProgress: z.ZodObject<{
9628
+ id: z.ZodUUID;
9629
+ flowId: z.ZodString;
9630
+ flowVersion: z.ZodString;
9631
+ status: z.ZodEnum<{
9632
+ pending: "pending";
9633
+ failed: "failed";
9634
+ running: "running";
9635
+ completed: "completed";
9636
+ cancelled: "cancelled";
9637
+ suspended: "suspended";
9638
+ }>;
9639
+ createdAt: z.ZodISODateTime;
9640
+ updatedAt: z.ZodISODateTime;
9641
+ completedAt: z.ZodOptional<z.ZodISODateTime>;
9642
+ parentRunId: z.ZodOptional<z.ZodUUID>;
9643
+ }, z.core.$strict>;
9644
+ type TrustedSigningKey = Schemas.TrustedSigningKey;
9645
+ declare const TrustedSigningKey: z.ZodObject<{
9646
+ keyId: z.ZodString;
9647
+ tenantId: z.ZodUUID;
9648
+ algorithm: z.ZodLiteral<"ed25519">;
9649
+ publicKey: z.ZodString;
9650
+ label: z.ZodOptional<z.ZodString>;
9651
+ createdAt: z.ZodISODateTime;
9652
+ revokedAt: z.ZodOptional<z.ZodISODateTime>;
9653
+ revokedReason: z.ZodOptional<z.ZodString>;
9654
+ }, z.core.$strict>;
9655
+ export type TrustSigningKeyBody = Schemas.TrustSigningKeyBody;
9656
+ declare const TrustSigningKeyBody: z.ZodObject<{
9657
+ keyId: z.ZodString;
9658
+ algorithm: z.ZodOptional<z.ZodLiteral<"ed25519">>;
9659
+ publicKey: z.ZodString;
9660
+ label: z.ZodOptional<z.ZodString>;
9661
+ }, z.core.$strict>;
9662
+ export type TrustedSigningKeyPage = Schemas.TrustedSigningKeyPage;
9663
+ declare const TrustedSigningKeyPage: z.ZodObject<{
9664
+ data: z.ZodArray<z.ZodObject<{
9665
+ keyId: z.ZodString;
9666
+ tenantId: z.ZodUUID;
9667
+ algorithm: z.ZodLiteral<"ed25519">;
9668
+ publicKey: z.ZodString;
9669
+ label: z.ZodOptional<z.ZodString>;
9670
+ createdAt: z.ZodISODateTime;
9671
+ revokedAt: z.ZodOptional<z.ZodISODateTime>;
9672
+ revokedReason: z.ZodOptional<z.ZodString>;
9673
+ }, z.core.$strict>>;
9674
+ nextCursor: z.ZodOptional<z.ZodString>;
9675
+ hasMore: z.ZodBoolean;
9676
+ }, z.core.$strict>;
9677
+ type RevokeSigningKeyResult = Schemas.RevokeSigningKeyResult;
9678
+ declare const RevokeSigningKeyResult: z.ZodObject<{
9679
+ keyId: z.ZodString;
9680
+ revoked: z.ZodBoolean;
9681
+ }, z.core.$strict>;
9682
+ export type MintPublicRunTokenBody = Schemas.MintPublicRunTokenBody;
9683
+ declare const MintPublicRunTokenBody: z.ZodObject<{
9684
+ runIds: z.ZodArray<z.ZodString>;
9685
+ expiresInSeconds: z.ZodOptional<z.ZodNumber>;
9686
+ }, z.core.$strict>;
9687
+ export type MintPublicRunTokenResult = Schemas.MintPublicRunTokenResult;
9688
+ declare const MintPublicRunTokenResult: z.ZodObject<{
9689
+ token: z.ZodString;
9690
+ expiresAt: z.ZodISODateTime;
9691
+ runIds: z.ZodArray<z.ZodString>;
9692
+ }, z.core.$strict>;
9693
+ export type JudgedEvalCase = Schemas.JudgedEvalCase;
9694
+ declare const JudgedEvalCase: z.ZodObject<{
9695
+ caseId: z.ZodString;
9696
+ subject: z.ZodObject<{
9697
+ kind: z.ZodEnum<{
9698
+ agent: "agent";
9699
+ flow: "flow";
9700
+ }>;
9701
+ id: z.ZodString;
9702
+ version: z.ZodString;
9703
+ }, z.core.$strict>;
9704
+ input: z.ZodUnknown;
9705
+ context: z.ZodOptional<z.ZodObject<{
9706
+ history: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
9707
+ historyTruncated: z.ZodOptional<z.ZodBoolean>;
9708
+ retrieved: z.ZodOptional<z.ZodUnknown>;
9709
+ sessionApproval: z.ZodOptional<z.ZodObject<{
9710
+ approved: z.ZodBoolean;
9711
+ rationale: z.ZodOptional<z.ZodString>;
9712
+ }, z.core.$strict>>;
9713
+ flow: z.ZodOptional<z.ZodObject<{
9714
+ calls: z.ZodArray<z.ZodObject<{
9715
+ runId: z.ZodString;
9716
+ nodeId: z.ZodOptional<z.ZodString>;
9717
+ scope: z.ZodOptional<z.ZodString>;
9718
+ toolId: z.ZodString;
8308
9719
  arguments: z.ZodOptional<z.ZodUnknown>;
8309
9720
  result: z.ZodOptional<z.ZodUnknown>;
8310
9721
  }, z.core.$strict>>;
@@ -8328,6 +9739,10 @@ declare const JudgedEvalCase: z.ZodObject<{
8328
9739
  no: z.ZodNumber;
8329
9740
  yesWeight: z.ZodNumber;
8330
9741
  totalWeight: z.ZodNumber;
9742
+ restricted: z.ZodOptional<z.ZodObject<{
9743
+ yesWeight: z.ZodNumber;
9744
+ totalWeight: z.ZodNumber;
9745
+ }, z.core.$strict>>;
8331
9746
  reasons: z.ZodArray<z.ZodObject<{
8332
9747
  verdict: z.ZodEnum<{
8333
9748
  yes: "yes";
@@ -8387,6 +9802,10 @@ declare const JudgedEvalCaseCollectionPage: z.ZodObject<{
8387
9802
  no: z.ZodNumber;
8388
9803
  yesWeight: z.ZodNumber;
8389
9804
  totalWeight: z.ZodNumber;
9805
+ restricted: z.ZodOptional<z.ZodObject<{
9806
+ yesWeight: z.ZodNumber;
9807
+ totalWeight: z.ZodNumber;
9808
+ }, z.core.$strict>>;
8390
9809
  reasons: z.ZodArray<z.ZodObject<{
8391
9810
  verdict: z.ZodEnum<{
8392
9811
  yes: "yes";
@@ -8886,12 +10305,12 @@ declare const ReinstateEvalSuiteVersionResult: z.ZodObject<{
8886
10305
  wasTombstoned: z.ZodBoolean;
8887
10306
  }, z.core.$strict>;
8888
10307
  export type BlockKind = Schemas.BlockKind;
8889
- export declare const BlockKind: z.ZodEnum<{
10308
+ declare const BlockKind: z.ZodEnum<{
8890
10309
  prompt: "prompt";
8891
10310
  settings: "settings";
8892
10311
  }>;
8893
10312
  export type Block = Schemas.Block;
8894
- export declare const Block: z.ZodObject<{
10313
+ declare const Block: z.ZodObject<{
8895
10314
  id: z.ZodString;
8896
10315
  version: z.ZodString;
8897
10316
  kind: z.ZodEnum<{
@@ -8984,41 +10403,429 @@ declare const PublishBlockBody: z.ZodObject<{
8984
10403
  boolean: "boolean";
8985
10404
  date: "date";
8986
10405
  }>;
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;
10406
+ required: z.ZodOptional<z.ZodBoolean>;
10407
+ default: z.ZodOptional<z.ZodUnknown>;
10408
+ }, z.core.$strict>>>;
10409
+ }, z.core.$strict>,
10410
+ z.ZodObject<{
10411
+ values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
10412
+ schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10413
+ }, z.core.$strict>
10414
+ ]>;
10415
+ }, z.core.$strict>;
10416
+ export type PublishBlockResult = Schemas.PublishBlockResult;
10417
+ declare const PublishBlockResult: z.ZodObject<{
10418
+ blockId: z.ZodString;
10419
+ version: z.ZodString;
10420
+ }, z.core.$strict>;
10421
+ export type UnregisterBlockResult = Schemas.UnregisterBlockResult;
10422
+ declare const UnregisterBlockResult: z.ZodObject<{
10423
+ blockId: z.ZodString;
10424
+ version: z.ZodString;
10425
+ unregistered: z.ZodLiteral<true>;
10426
+ }, z.core.$strict>;
10427
+ export type ReinstateBlockResult = Schemas.ReinstateBlockResult;
10428
+ declare const ReinstateBlockResult: z.ZodObject<{
10429
+ blockId: z.ZodString;
10430
+ version: z.ZodString;
10431
+ wasTombstoned: z.ZodBoolean;
10432
+ }, z.core.$strict>;
10433
+ export type EvalRunStatus = Schemas.EvalRunStatus;
10434
+ declare const EvalRunStatus: z.ZodEnum<{
10435
+ pending: "pending";
10436
+ failed: "failed";
10437
+ running: "running";
10438
+ completed: "completed";
10439
+ cancelled: "cancelled";
10440
+ }>;
10441
+ export type ComparisonMetric = Schemas.ComparisonMetric;
10442
+ declare const ComparisonMetric: z.ZodObject<{
10443
+ baseline: z.ZodNullable<z.ZodNumber>;
10444
+ candidate: z.ZodNullable<z.ZodNumber>;
10445
+ delta: z.ZodNullable<z.ZodNumber>;
10446
+ n: z.ZodNumber;
10447
+ weight: z.ZodNumber;
10448
+ baselineN: z.ZodNumber;
10449
+ baselineWeight: z.ZodNumber;
10450
+ direction: z.ZodLiteral<"higher">;
10451
+ k: z.ZodOptional<z.ZodNumber>;
10452
+ spread: z.ZodOptional<z.ZodNumber>;
10453
+ }, z.core.$strict>;
10454
+ export type ComparisonCandidate = Schemas.ComparisonCandidate;
10455
+ declare const ComparisonCandidate: z.ZodUnion<readonly [
10456
+ z.ZodObject<{
10457
+ kind: z.ZodLiteral<"agent">;
10458
+ agentId: z.ZodString;
10459
+ version: z.ZodString;
10460
+ pinsDigest: z.ZodOptional<z.ZodString>;
10461
+ }, z.core.$strict>,
10462
+ z.ZodObject<{
10463
+ kind: z.ZodLiteral<"flow">;
10464
+ flowId: z.ZodString;
10465
+ version: z.ZodString;
10466
+ versions: z.ZodOptional<z.ZodObject<{
10467
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10468
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10469
+ }, z.core.$strict>>;
10470
+ }, z.core.$strict>
10471
+ ]>;
10472
+ export type JudgedComparisonSummary = Schemas.JudgedComparisonSummary;
10473
+ declare const JudgedComparisonSummary: z.ZodObject<{
10474
+ evalRunId: z.ZodString;
10475
+ status: z.ZodEnum<{
10476
+ failed: "failed";
10477
+ completed: "completed";
10478
+ partial: "partial";
10479
+ }>;
10480
+ completedAt: z.ZodISODateTime;
10481
+ suite: z.ZodObject<{
10482
+ id: z.ZodString;
10483
+ version: z.ZodString;
10484
+ }, z.core.$strict>;
10485
+ candidate: z.ZodUnion<readonly [
10486
+ z.ZodObject<{
10487
+ kind: z.ZodLiteral<"agent">;
10488
+ agentId: z.ZodString;
10489
+ version: z.ZodString;
10490
+ pinsDigest: z.ZodOptional<z.ZodString>;
10491
+ }, z.core.$strict>,
10492
+ z.ZodObject<{
10493
+ kind: z.ZodLiteral<"flow">;
10494
+ flowId: z.ZodString;
10495
+ version: z.ZodString;
10496
+ versions: z.ZodOptional<z.ZodObject<{
10497
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10498
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10499
+ }, z.core.$strict>>;
10500
+ }, z.core.$strict>
10501
+ ]>;
10502
+ baseline: z.ZodUnion<readonly [
10503
+ z.ZodObject<{
10504
+ kind: z.ZodLiteral<"recorded">;
10505
+ versions: z.ZodArray<z.ZodObject<{
10506
+ agentId: z.ZodOptional<z.ZodString>;
10507
+ flowId: z.ZodOptional<z.ZodString>;
10508
+ version: z.ZodString;
10509
+ cases: z.ZodNumber;
10510
+ }, z.core.$strict>>;
10511
+ }, z.core.$strict>,
10512
+ z.ZodObject<{
10513
+ kind: z.ZodLiteral<"version">;
10514
+ agentId: z.ZodString;
10515
+ version: z.ZodString;
10516
+ via: z.ZodEnum<{
10517
+ explicit: "explicit";
10518
+ live: "live";
10519
+ }>;
10520
+ liveScope: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10521
+ }, z.core.$strict>
10522
+ ]>;
10523
+ scope: z.ZodObject<{
10524
+ projectId: z.ZodOptional<z.ZodString>;
10525
+ }, z.core.$strict>;
10526
+ cases: z.ZodNumber;
10527
+ diverged: z.ZodNumber;
10528
+ refusedWrites: z.ZodNumber;
10529
+ errors: z.ZodNumber;
10530
+ stopped: z.ZodNumber;
10531
+ reads: z.ZodEnum<{
10532
+ live: "live";
10533
+ recorded: "recorded";
10534
+ }>;
10535
+ classWeights: z.ZodOptional<z.ZodEnum<{
10536
+ "as-recorded": "as-recorded";
10537
+ "restricted-only": "restricted-only";
10538
+ }>>;
10539
+ sampling: z.ZodObject<{
10540
+ models: z.ZodArray<z.ZodObject<{
10541
+ providerId: z.ZodString;
10542
+ model: z.ZodString;
10543
+ runs: z.ZodNumber;
10544
+ }, z.core.$strict>>;
10545
+ }, z.core.$strict>;
10546
+ repetitions: z.ZodNumber;
10547
+ metrics: z.ZodObject<{
10548
+ weightedYesShare: z.ZodObject<{
10549
+ baseline: z.ZodNullable<z.ZodNumber>;
10550
+ candidate: z.ZodNullable<z.ZodNumber>;
10551
+ delta: z.ZodNullable<z.ZodNumber>;
10552
+ n: z.ZodNumber;
10553
+ weight: z.ZodNumber;
10554
+ baselineN: z.ZodNumber;
10555
+ baselineWeight: z.ZodNumber;
10556
+ direction: z.ZodLiteral<"higher">;
10557
+ k: z.ZodOptional<z.ZodNumber>;
10558
+ spread: z.ZodOptional<z.ZodNumber>;
10559
+ }, z.core.$strict>;
10560
+ judgedCoverage: z.ZodObject<{
10561
+ baseline: z.ZodNullable<z.ZodNumber>;
10562
+ candidate: z.ZodNullable<z.ZodNumber>;
10563
+ delta: z.ZodNullable<z.ZodNumber>;
10564
+ n: z.ZodNumber;
10565
+ weight: z.ZodNumber;
10566
+ baselineN: z.ZodNumber;
10567
+ baselineWeight: z.ZodNumber;
10568
+ direction: z.ZodLiteral<"higher">;
10569
+ k: z.ZodOptional<z.ZodNumber>;
10570
+ spread: z.ZodOptional<z.ZodNumber>;
10571
+ }, z.core.$strict>;
10572
+ weightedPrecisionAtK: z.ZodObject<{
10573
+ baseline: z.ZodNullable<z.ZodNumber>;
10574
+ candidate: z.ZodNullable<z.ZodNumber>;
10575
+ delta: z.ZodNullable<z.ZodNumber>;
10576
+ n: z.ZodNumber;
10577
+ weight: z.ZodNumber;
10578
+ baselineN: z.ZodNumber;
10579
+ baselineWeight: z.ZodNumber;
10580
+ direction: z.ZodLiteral<"higher">;
10581
+ k: z.ZodOptional<z.ZodNumber>;
10582
+ spread: z.ZodOptional<z.ZodNumber>;
10583
+ }, z.core.$strict>;
10584
+ }, z.core.$strict>;
10585
+ }, z.core.$strict>;
10586
+ export type ComparisonCaseResult = Schemas.ComparisonCaseResult;
10587
+ declare const ComparisonCaseResult: z.ZodObject<{
10588
+ caseId: z.ZodString;
10589
+ runIds: z.ZodArray<z.ZodString>;
10590
+ baseline: z.ZodObject<{
10591
+ yesWeight: z.ZodNumber;
10592
+ totalWeight: z.ZodNumber;
10593
+ items: z.ZodNumber;
10594
+ judgedItems: z.ZodNumber;
10595
+ topK: z.ZodObject<{
10596
+ yesWeight: z.ZodNumber;
10597
+ totalWeight: z.ZodNumber;
10598
+ }, z.core.$strict>;
10599
+ }, z.core.$strict>;
10600
+ candidate: z.ZodArray<z.ZodObject<{
10601
+ yesWeight: z.ZodNumber;
10602
+ totalWeight: z.ZodNumber;
10603
+ items: z.ZodNumber;
10604
+ judgedItems: z.ZodNumber;
10605
+ topK: z.ZodObject<{
10606
+ yesWeight: z.ZodNumber;
10607
+ totalWeight: z.ZodNumber;
10608
+ }, z.core.$strict>;
10609
+ }, z.core.$strict>>;
10610
+ changes: z.ZodOptional<z.ZodObject<{
10611
+ kept: z.ZodArray<z.ZodObject<{
10612
+ key: z.ZodString;
10613
+ rankBefore: z.ZodOptional<z.ZodNumber>;
10614
+ rank: z.ZodOptional<z.ZodNumber>;
10615
+ }, z.core.$strict>>;
10616
+ dropped: z.ZodArray<z.ZodObject<{
10617
+ key: z.ZodString;
10618
+ rankBefore: z.ZodOptional<z.ZodNumber>;
10619
+ }, z.core.$strict>>;
10620
+ new: z.ZodArray<z.ZodObject<{
10621
+ key: z.ZodString;
10622
+ pointer: z.ZodString;
10623
+ rank: z.ZodOptional<z.ZodNumber>;
10624
+ }, z.core.$strict>>;
10625
+ }, z.core.$strict>>;
10626
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
10627
+ step: z.ZodNumber;
10628
+ callId: z.ZodString;
10629
+ toolId: z.ZodString;
10630
+ toolVersion: z.ZodString;
10631
+ arguments: z.ZodUnknown;
10632
+ source: z.ZodEnum<{
10633
+ live: "live";
10634
+ refused: "refused";
10635
+ recorded: "recorded";
10636
+ }>;
10637
+ reason: z.ZodOptional<z.ZodString>;
10638
+ }, z.core.$strict>>>;
10639
+ diverged: z.ZodBoolean;
10640
+ refusedWrites: z.ZodNumber;
10641
+ noContext: z.ZodBoolean;
10642
+ approvalSkipped: z.ZodBoolean;
10643
+ error: z.ZodOptional<z.ZodString>;
10644
+ stopped: z.ZodOptional<z.ZodObject<{
10645
+ toolId: z.ZodString;
10646
+ arguments: z.ZodUnknown;
10647
+ reason: z.ZodOptional<z.ZodString>;
10648
+ }, z.core.$strict>>;
10649
+ }, z.core.$strict>;
10650
+ export type JudgedComparisonResult = Schemas.JudgedComparisonResult;
10651
+ declare const JudgedComparisonResult: z.ZodObject<{
10652
+ summary: z.ZodObject<{
10653
+ evalRunId: z.ZodString;
10654
+ status: z.ZodEnum<{
10655
+ failed: "failed";
10656
+ completed: "completed";
10657
+ partial: "partial";
10658
+ }>;
10659
+ completedAt: z.ZodISODateTime;
10660
+ suite: z.ZodObject<{
10661
+ id: z.ZodString;
10662
+ version: z.ZodString;
10663
+ }, z.core.$strict>;
10664
+ candidate: z.ZodUnion<readonly [
10665
+ z.ZodObject<{
10666
+ kind: z.ZodLiteral<"agent">;
10667
+ agentId: z.ZodString;
10668
+ version: z.ZodString;
10669
+ pinsDigest: z.ZodOptional<z.ZodString>;
10670
+ }, z.core.$strict>,
10671
+ z.ZodObject<{
10672
+ kind: z.ZodLiteral<"flow">;
10673
+ flowId: z.ZodString;
10674
+ version: z.ZodString;
10675
+ versions: z.ZodOptional<z.ZodObject<{
10676
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10677
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10678
+ }, z.core.$strict>>;
10679
+ }, z.core.$strict>
10680
+ ]>;
10681
+ baseline: z.ZodUnion<readonly [
10682
+ z.ZodObject<{
10683
+ kind: z.ZodLiteral<"recorded">;
10684
+ versions: z.ZodArray<z.ZodObject<{
10685
+ agentId: z.ZodOptional<z.ZodString>;
10686
+ flowId: z.ZodOptional<z.ZodString>;
10687
+ version: z.ZodString;
10688
+ cases: z.ZodNumber;
10689
+ }, z.core.$strict>>;
10690
+ }, z.core.$strict>,
10691
+ z.ZodObject<{
10692
+ kind: z.ZodLiteral<"version">;
10693
+ agentId: z.ZodString;
10694
+ version: z.ZodString;
10695
+ via: z.ZodEnum<{
10696
+ explicit: "explicit";
10697
+ live: "live";
10698
+ }>;
10699
+ liveScope: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10700
+ }, z.core.$strict>
10701
+ ]>;
10702
+ scope: z.ZodObject<{
10703
+ projectId: z.ZodOptional<z.ZodString>;
10704
+ }, z.core.$strict>;
10705
+ cases: z.ZodNumber;
10706
+ diverged: z.ZodNumber;
10707
+ refusedWrites: z.ZodNumber;
10708
+ errors: z.ZodNumber;
10709
+ stopped: z.ZodNumber;
10710
+ reads: z.ZodEnum<{
10711
+ live: "live";
10712
+ recorded: "recorded";
10713
+ }>;
10714
+ classWeights: z.ZodOptional<z.ZodEnum<{
10715
+ "as-recorded": "as-recorded";
10716
+ "restricted-only": "restricted-only";
10717
+ }>>;
10718
+ sampling: z.ZodObject<{
10719
+ models: z.ZodArray<z.ZodObject<{
10720
+ providerId: z.ZodString;
10721
+ model: z.ZodString;
10722
+ runs: z.ZodNumber;
10723
+ }, z.core.$strict>>;
10724
+ }, z.core.$strict>;
10725
+ repetitions: z.ZodNumber;
10726
+ metrics: z.ZodObject<{
10727
+ weightedYesShare: z.ZodObject<{
10728
+ baseline: z.ZodNullable<z.ZodNumber>;
10729
+ candidate: z.ZodNullable<z.ZodNumber>;
10730
+ delta: z.ZodNullable<z.ZodNumber>;
10731
+ n: z.ZodNumber;
10732
+ weight: z.ZodNumber;
10733
+ baselineN: z.ZodNumber;
10734
+ baselineWeight: z.ZodNumber;
10735
+ direction: z.ZodLiteral<"higher">;
10736
+ k: z.ZodOptional<z.ZodNumber>;
10737
+ spread: z.ZodOptional<z.ZodNumber>;
10738
+ }, z.core.$strict>;
10739
+ judgedCoverage: z.ZodObject<{
10740
+ baseline: z.ZodNullable<z.ZodNumber>;
10741
+ candidate: z.ZodNullable<z.ZodNumber>;
10742
+ delta: z.ZodNullable<z.ZodNumber>;
10743
+ n: z.ZodNumber;
10744
+ weight: z.ZodNumber;
10745
+ baselineN: z.ZodNumber;
10746
+ baselineWeight: z.ZodNumber;
10747
+ direction: z.ZodLiteral<"higher">;
10748
+ k: z.ZodOptional<z.ZodNumber>;
10749
+ spread: z.ZodOptional<z.ZodNumber>;
10750
+ }, z.core.$strict>;
10751
+ weightedPrecisionAtK: z.ZodObject<{
10752
+ baseline: z.ZodNullable<z.ZodNumber>;
10753
+ candidate: z.ZodNullable<z.ZodNumber>;
10754
+ delta: z.ZodNullable<z.ZodNumber>;
10755
+ n: z.ZodNumber;
10756
+ weight: z.ZodNumber;
10757
+ baselineN: z.ZodNumber;
10758
+ baselineWeight: z.ZodNumber;
10759
+ direction: z.ZodLiteral<"higher">;
10760
+ k: z.ZodOptional<z.ZodNumber>;
10761
+ spread: z.ZodOptional<z.ZodNumber>;
10762
+ }, z.core.$strict>;
10763
+ }, z.core.$strict>;
10764
+ }, z.core.$strict>;
10765
+ perCase: z.ZodArray<z.ZodObject<{
10766
+ caseId: z.ZodString;
10767
+ runIds: z.ZodArray<z.ZodString>;
10768
+ baseline: z.ZodObject<{
10769
+ yesWeight: z.ZodNumber;
10770
+ totalWeight: z.ZodNumber;
10771
+ items: z.ZodNumber;
10772
+ judgedItems: z.ZodNumber;
10773
+ topK: z.ZodObject<{
10774
+ yesWeight: z.ZodNumber;
10775
+ totalWeight: z.ZodNumber;
10776
+ }, z.core.$strict>;
10777
+ }, z.core.$strict>;
10778
+ candidate: z.ZodArray<z.ZodObject<{
10779
+ yesWeight: z.ZodNumber;
10780
+ totalWeight: z.ZodNumber;
10781
+ items: z.ZodNumber;
10782
+ judgedItems: z.ZodNumber;
10783
+ topK: z.ZodObject<{
10784
+ yesWeight: z.ZodNumber;
10785
+ totalWeight: z.ZodNumber;
10786
+ }, z.core.$strict>;
10787
+ }, z.core.$strict>>;
10788
+ changes: z.ZodOptional<z.ZodObject<{
10789
+ kept: z.ZodArray<z.ZodObject<{
10790
+ key: z.ZodString;
10791
+ rankBefore: z.ZodOptional<z.ZodNumber>;
10792
+ rank: z.ZodOptional<z.ZodNumber>;
10793
+ }, z.core.$strict>>;
10794
+ dropped: z.ZodArray<z.ZodObject<{
10795
+ key: z.ZodString;
10796
+ rankBefore: z.ZodOptional<z.ZodNumber>;
10797
+ }, z.core.$strict>>;
10798
+ new: z.ZodArray<z.ZodObject<{
10799
+ key: z.ZodString;
10800
+ pointer: z.ZodString;
10801
+ rank: z.ZodOptional<z.ZodNumber>;
10802
+ }, z.core.$strict>>;
10803
+ }, z.core.$strict>>;
10804
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
10805
+ step: z.ZodNumber;
10806
+ callId: z.ZodString;
10807
+ toolId: z.ZodString;
10808
+ toolVersion: z.ZodString;
10809
+ arguments: z.ZodUnknown;
10810
+ source: z.ZodEnum<{
10811
+ live: "live";
10812
+ refused: "refused";
10813
+ recorded: "recorded";
10814
+ }>;
10815
+ reason: z.ZodOptional<z.ZodString>;
10816
+ }, z.core.$strict>>>;
10817
+ diverged: z.ZodBoolean;
10818
+ refusedWrites: z.ZodNumber;
10819
+ noContext: z.ZodBoolean;
10820
+ approvalSkipped: z.ZodBoolean;
10821
+ error: z.ZodOptional<z.ZodString>;
10822
+ stopped: z.ZodOptional<z.ZodObject<{
10823
+ toolId: z.ZodString;
10824
+ arguments: z.ZodUnknown;
10825
+ reason: z.ZodOptional<z.ZodString>;
10826
+ }, z.core.$strict>>;
10827
+ }, z.core.$strict>>;
9013
10828
  }, z.core.$strict>;
9014
- export type EvalRunStatus = Schemas.EvalRunStatus;
9015
- declare const EvalRunStatus: z.ZodEnum<{
9016
- pending: "pending";
9017
- failed: "failed";
9018
- running: "running";
9019
- completed: "completed";
9020
- cancelled: "cancelled";
9021
- }>;
9022
10829
  export type EvalRun = Schemas.EvalRun;
9023
10830
  declare const EvalRun: z.ZodObject<{
9024
10831
  runId: z.ZodUUID;
@@ -9065,16 +10872,27 @@ declare const EvalRun: z.ZodObject<{
9065
10872
  z.ZodObject<{
9066
10873
  live: z.ZodObject<{
9067
10874
  projectId: z.ZodOptional<z.ZodString>;
9068
- segments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10875
+ segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
10876
+ key: z.ZodString;
10877
+ value: z.ZodString;
10878
+ }, z.core.$strict>>>;
9069
10879
  }, z.core.$strict>;
9070
10880
  }, z.core.$strict>
9071
10881
  ]>;
9072
10882
  reads: z.ZodEnum<{
9073
- recorded: "recorded";
9074
10883
  live: "live";
10884
+ recorded: "recorded";
9075
10885
  }>;
9076
10886
  repetitions: z.ZodNumber;
9077
10887
  k: z.ZodNumber;
10888
+ versions: z.ZodOptional<z.ZodObject<{
10889
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10890
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10891
+ }, z.core.$strict>>;
10892
+ classWeights: z.ZodOptional<z.ZodEnum<{
10893
+ "as-recorded": "as-recorded";
10894
+ "restricted-only": "restricted-only";
10895
+ }>>;
9078
10896
  }, z.core.$strict>>;
9079
10897
  }, z.core.$strict>;
9080
10898
  export type EvalRunCollectionPage = Schemas.EvalRunCollectionPage;
@@ -9124,16 +10942,27 @@ declare const EvalRunCollectionPage: z.ZodObject<{
9124
10942
  z.ZodObject<{
9125
10943
  live: z.ZodObject<{
9126
10944
  projectId: z.ZodOptional<z.ZodString>;
9127
- segments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10945
+ segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
10946
+ key: z.ZodString;
10947
+ value: z.ZodString;
10948
+ }, z.core.$strict>>>;
9128
10949
  }, z.core.$strict>;
9129
10950
  }, z.core.$strict>
9130
10951
  ]>;
9131
10952
  reads: z.ZodEnum<{
9132
- recorded: "recorded";
9133
10953
  live: "live";
10954
+ recorded: "recorded";
9134
10955
  }>;
9135
10956
  repetitions: z.ZodNumber;
9136
10957
  k: z.ZodNumber;
10958
+ versions: z.ZodOptional<z.ZodObject<{
10959
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10960
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10961
+ }, z.core.$strict>>;
10962
+ classWeights: z.ZodOptional<z.ZodEnum<{
10963
+ "as-recorded": "as-recorded";
10964
+ "restricted-only": "restricted-only";
10965
+ }>>;
9137
10966
  }, z.core.$strict>>;
9138
10967
  }, z.core.$strict>>;
9139
10968
  nextCursor: z.ZodOptional<z.ZodString>;
@@ -9161,16 +10990,27 @@ declare const StartEvalRunBody: z.ZodObject<{
9161
10990
  z.ZodObject<{
9162
10991
  live: z.ZodObject<{
9163
10992
  projectId: z.ZodOptional<z.ZodString>;
9164
- segments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10993
+ segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
10994
+ key: z.ZodString;
10995
+ value: z.ZodString;
10996
+ }, z.core.$strict>>>;
9165
10997
  }, z.core.$strict>;
9166
10998
  }, z.core.$strict>
9167
10999
  ]>>;
9168
11000
  reads: z.ZodOptional<z.ZodEnum<{
9169
- recorded: "recorded";
9170
11001
  live: "live";
11002
+ recorded: "recorded";
9171
11003
  }>>;
9172
11004
  repetitions: z.ZodOptional<z.ZodNumber>;
9173
11005
  k: z.ZodOptional<z.ZodNumber>;
11006
+ versions: z.ZodOptional<z.ZodObject<{
11007
+ tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11008
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11009
+ }, z.core.$strict>>;
11010
+ classWeights: z.ZodOptional<z.ZodEnum<{
11011
+ "as-recorded": "as-recorded";
11012
+ "restricted-only": "restricted-only";
11013
+ }>>;
9174
11014
  }, z.core.$strict>;
9175
11015
  export type StartEvalRunResult = Schemas.StartEvalRunResult;
9176
11016
  declare const StartEvalRunResult: z.ZodObject<{
@@ -9230,6 +11070,7 @@ declare const IdentityProviderCollectionPage: z.ZodObject<{
9230
11070
  }, z.core.$strict>>;
9231
11071
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9232
11072
  }, z.core.$strict>>;
11073
+ hasMore: z.ZodOptional<z.ZodBoolean>;
9233
11074
  }, z.core.$strict>;
9234
11075
  export type RegisterIdentityProviderResult = Schemas.RegisterIdentityProviderResult;
9235
11076
  declare const RegisterIdentityProviderResult: z.ZodObject<{
@@ -9855,8 +11696,8 @@ declare const Tenant$1: z.ZodObject<{
9855
11696
  export type TenantConfigKind = Schemas.TenantConfigKind;
9856
11697
  declare const TenantConfigKind: z.ZodEnum<{
9857
11698
  env: "env";
9858
- config: "config";
9859
11699
  secret: "secret";
11700
+ config: "config";
9860
11701
  }>;
9861
11702
  export type TenantConfigCollectionPage = Schemas.TenantConfigCollectionPage;
9862
11703
  declare const TenantConfigCollectionPage: z.ZodObject<{
@@ -9864,8 +11705,8 @@ declare const TenantConfigCollectionPage: z.ZodObject<{
9864
11705
  tenantId: z.ZodString;
9865
11706
  kind: z.ZodEnum<{
9866
11707
  env: "env";
9867
- config: "config";
9868
11708
  secret: "secret";
11709
+ config: "config";
9869
11710
  }>;
9870
11711
  key: z.ZodString;
9871
11712
  value: z.ZodString;
@@ -9880,8 +11721,8 @@ export type UpsertTenantConfigBody = Schemas.UpsertTenantConfigBody;
9880
11721
  declare const UpsertTenantConfigBody: z.ZodObject<{
9881
11722
  kind: z.ZodEnum<{
9882
11723
  env: "env";
9883
- config: "config";
9884
11724
  secret: "secret";
11725
+ config: "config";
9885
11726
  }>;
9886
11727
  key: z.ZodString;
9887
11728
  value: z.ZodString;
@@ -9894,8 +11735,8 @@ declare const UpsertTenantConfigResult: z.ZodObject<{
9894
11735
  tenantId: z.ZodString;
9895
11736
  kind: z.ZodEnum<{
9896
11737
  env: "env";
9897
- config: "config";
9898
11738
  secret: "secret";
11739
+ config: "config";
9899
11740
  }>;
9900
11741
  key: z.ZodString;
9901
11742
  value: z.ZodString;
@@ -10095,12 +11936,12 @@ declare const WebhookTriggerUnregisterResult: z.ZodObject<{
10095
11936
  triggerId: z.ZodString;
10096
11937
  unregistered: z.ZodBoolean;
10097
11938
  }, z.core.$strict>;
10098
- export type WebhookSecretRef = Schemas.WebhookSecretRef;
11939
+ type WebhookSecretRef = Schemas.WebhookSecretRef;
10099
11940
  declare const WebhookSecretRef: z.ZodObject<{
10100
11941
  envName: z.ZodString;
10101
11942
  name: z.ZodString;
10102
11943
  }, z.core.$strict>;
10103
- export type WebhookEndpoint = Schemas.WebhookEndpoint;
11944
+ type WebhookEndpoint = Schemas.WebhookEndpoint;
10104
11945
  declare const WebhookEndpoint: z.ZodObject<{
10105
11946
  endpointId: z.ZodString;
10106
11947
  url: z.ZodURL;
@@ -10118,7 +11959,7 @@ declare const WebhookEndpoint: z.ZodObject<{
10118
11959
  createdAt: z.ZodISODateTime;
10119
11960
  updatedAt: z.ZodISODateTime;
10120
11961
  }, z.core.$strict>;
10121
- export type GeneratedWebhookSecret = Schemas.GeneratedWebhookSecret;
11962
+ type GeneratedWebhookSecret = Schemas.GeneratedWebhookSecret;
10122
11963
  declare const GeneratedWebhookSecret: z.ZodObject<{
10123
11964
  secret: z.ZodString;
10124
11965
  }, z.core.$strict>;
@@ -10179,7 +12020,7 @@ declare const WebhookEndpointUnregisterResult: z.ZodObject<{
10179
12020
  endpointId: z.ZodString;
10180
12021
  unregistered: z.ZodBoolean;
10181
12022
  }, z.core.$strict>;
10182
- export type RunFinishedEvent = Schemas.RunFinishedEvent;
12023
+ type RunFinishedEvent = Schemas.RunFinishedEvent;
10183
12024
  declare const RunFinishedEvent: z.ZodObject<{
10184
12025
  id: z.ZodString;
10185
12026
  type: z.ZodLiteral<"run.finished">;
@@ -10213,7 +12054,7 @@ declare const RunFinishedEvent: z.ZodObject<{
10213
12054
  }, z.core.$strict>;
10214
12055
  }, z.core.$strict>;
10215
12056
  }, z.core.$strict>;
10216
- export type WebhookTestEvent = Schemas.WebhookTestEvent;
12057
+ type WebhookTestEvent = Schemas.WebhookTestEvent;
10217
12058
  declare const WebhookTestEvent: z.ZodObject<{
10218
12059
  id: z.ZodString;
10219
12060
  type: z.ZodLiteral<"webhook.test">;
@@ -10222,7 +12063,7 @@ declare const WebhookTestEvent: z.ZodObject<{
10222
12063
  endpointId: z.ZodString;
10223
12064
  }, z.core.$strict>;
10224
12065
  }, z.core.$strict>;
10225
- export type WebhookEvent = Schemas.WebhookEvent;
12066
+ type WebhookEvent = Schemas.WebhookEvent;
10226
12067
  declare const WebhookEvent: z.ZodDiscriminatedUnion<[
10227
12068
  z.ZodObject<{
10228
12069
  id: z.ZodString;
@@ -10266,13 +12107,13 @@ declare const WebhookEvent: z.ZodDiscriminatedUnion<[
10266
12107
  type: z.ZodLiteral<"webhook.test">;
10267
12108
  }, z.core.$strict>
10268
12109
  ], "type">;
10269
- export type WebhookDeliveryStatus = Schemas.WebhookDeliveryStatus;
12110
+ type WebhookDeliveryStatus = Schemas.WebhookDeliveryStatus;
10270
12111
  declare const WebhookDeliveryStatus: z.ZodEnum<{
10271
12112
  pending: "pending";
10272
12113
  failed: "failed";
10273
12114
  delivered: "delivered";
10274
12115
  }>;
10275
- export type WebhookDelivery = Schemas.WebhookDelivery;
12116
+ type WebhookDelivery = Schemas.WebhookDelivery;
10276
12117
  declare const WebhookDelivery: z.ZodObject<{
10277
12118
  deliveryId: z.ZodString;
10278
12119
  endpointId: z.ZodString;
@@ -10426,9 +12267,16 @@ export interface AgentsClient {
10426
12267
  /** @wire GET /v1/agents/:agentId — latest active version */
10427
12268
  get(agentId: AgentId): Promise<Agent$1>;
10428
12269
  readonly versions: AgentVersionsClient;
12270
+ /** Which version runs where: live versions per scope, rollback and unpin. */
12271
+ readonly live: AgentLiveClient;
12272
+ /** Making a version live for a scope, and the history of those changes. */
12273
+ readonly promotions: AgentPromotionsClient;
12274
+ /** The gate policy a promotion for a scope is checked against. */
12275
+ readonly gatePolicy: AgentGatePolicyClient;
10429
12276
  /**
10430
12277
  * Un-tombstone a specific previously-unregistered version.
10431
12278
  *
12279
+ * @deprecated Use `agents.versions.reinstate`; removed in 0.2.
10432
12280
  * @wire POST /v1/agents/:agentId/versions/:version/reinstate
10433
12281
  */
10434
12282
  reinstateVersion(agentId: AgentId, version: Semver, options?: MutationOptions): Promise<ReinstateAgentVersionResult>;
@@ -10440,12 +12288,19 @@ export interface AgentVersionsClient {
10440
12288
  get(agentId: AgentId, version: Semver): Promise<Agent$1>;
10441
12289
  /**
10442
12290
  * Tombstone a specific version. Reversible via
10443
- * `agents.reinstateVersion`. Unregistering an unknown or
12291
+ * `agents.versions.reinstate`. Unregistering an unknown or
10444
12292
  * already-tombstoned version fails with `404 agent-not-found`.
10445
12293
  *
10446
12294
  * @wire POST /v1/agents/:agentId/versions/:version/unregister
10447
12295
  */
10448
12296
  unregister(agentId: AgentId, version: Semver, options?: MutationOptions): Promise<UnregisterAgentResult>;
12297
+ /**
12298
+ * Un-tombstone a specific previously-unregistered version. Idempotent:
12299
+ * reinstating an active version returns `wasTombstoned: false`.
12300
+ *
12301
+ * @wire POST /v1/agents/:agentId/versions/:version/reinstate
12302
+ */
12303
+ reinstate(agentId: AgentId, version: Semver, options?: MutationOptions): Promise<ReinstateAgentVersionResult>;
10449
12304
  /**
10450
12305
  * Derive a new version from a pinned one with some data-block pins
10451
12306
  * swapped (an expert's edit, no code change). Numbered the next free
@@ -10457,6 +12312,104 @@ export interface AgentVersionsClient {
10457
12312
  }
10458
12313
  /** Body of `POST /v1/agents/{agentId}/versions`. */
10459
12314
  export type DeriveAgentVersionInput = DeriveAgentVersionBody;
12315
+ /**
12316
+ * Live versions. A run that doesn't name its version uses the live
12317
+ * version of the most specific scope that has one (segment path,
12318
+ * project, org, tenant), else the latest registered version.
12319
+ */
12320
+ export interface AgentLiveClient {
12321
+ /**
12322
+ * The version a run would use for a project and segment path, and why
12323
+ * (`via: 'live'` with the scope, or `via: 'latest'`).
12324
+ *
12325
+ * @wire GET /v1/agents/:agentId/live
12326
+ */
12327
+ resolve(agentId: AgentId | string, where?: LiveWhere): Promise<LiveVersionResolution>;
12328
+ /** @wire GET /v1/agents/:agentId/live-versions — every scope with a pin */
12329
+ list(agentId: AgentId | string): Promise<LivePinList>;
12330
+ /**
12331
+ * Back to the scope's previous live version, or `toVersion`.
12332
+ * `409 nothing-to-roll-back` when there is none; `409 not-pinned`
12333
+ * when the scope has no pin.
12334
+ *
12335
+ * @wire POST /v1/agents/:agentId/live/rollback
12336
+ */
12337
+ rollback(agentId: AgentId | string, input: RollbackLiveInput, options?: MutationOptions): Promise<Promotion>;
12338
+ /**
12339
+ * Remove the scope's own pin: its runs use the next scope up.
12340
+ * `409 not-pinned` when it has none.
12341
+ *
12342
+ * @wire POST /v1/agents/:agentId/live/unpin
12343
+ */
12344
+ unpin(agentId: AgentId | string, input: UnpinLiveInput, options?: MutationOptions): Promise<Promotion>;
12345
+ }
12346
+ export interface AgentPromotionsClient {
12347
+ /**
12348
+ * Make `version` live for `scope`, from the next run. Open
12349
+ * conversations keep their version. `404 agent-version-not-found`
12350
+ * when the version isn't registered and active.
12351
+ *
12352
+ * With a gate policy for the scope, the promotion is checked first,
12353
+ * against the comparison named by `evalRunId`. The answer's `status`
12354
+ * says what happened: `promoted`, or `pending-approval` (a reviewer
12355
+ * must approve it; `approvalId`). A refusal throws a `KindgiApiError`
12356
+ * whose `error.serverCode` is `gate-failed`, with `promotionId`,
12357
+ * `policy` and every check in `error.fields`.
12358
+ *
12359
+ * @wire POST /v1/agents/:agentId/promotions
12360
+ */
12361
+ create(agentId: AgentId | string, input: PromoteInput, options?: MutationOptions): Promise<Promotion>;
12362
+ /**
12363
+ * What `create` with the same input would do, recording nothing:
12364
+ * `would-promote`, `needs-approval` (with the approval it needs) or
12365
+ * `gate-failed`, with every check.
12366
+ *
12367
+ * @wire POST /v1/agents/:agentId/promotions/check
12368
+ */
12369
+ check(agentId: AgentId | string, input: PromoteInput): Promise<PromotionCheck>;
12370
+ /** @wire GET /v1/agents/:agentId/promotions — newest first */
12371
+ list(agentId: AgentId | string, filter?: ListPromotionsFilter): Promise<PromotionPage>;
12372
+ /** @wire GET /v1/agents/:agentId/promotions/:promotionId */
12373
+ get(agentId: AgentId | string, promotionId: string): Promise<Promotion>;
12374
+ }
12375
+ export interface AgentGatePolicyClient {
12376
+ /**
12377
+ * The gate policy a promotion for `scope` is checked against: the most
12378
+ * specific scope with one, at its latest active version; `policy: null`
12379
+ * when none applies.
12380
+ *
12381
+ * @wire GET /v1/agents/:agentId/gate-policy
12382
+ */
12383
+ resolve(agentId: AgentId | string, scope: LiveScope): Promise<GatePolicyResolution>;
12384
+ }
12385
+ /** Where a run would happen: its project and segment path (coarse to fine). */
12386
+ export interface LiveWhere {
12387
+ readonly projectId?: string;
12388
+ readonly segments?: readonly ScopeSegment[];
12389
+ }
12390
+ export interface PromoteInput {
12391
+ readonly version: string;
12392
+ readonly scope: LiveScope;
12393
+ readonly reason?: string;
12394
+ /** The eval run behind the decision, kept on the record. */
12395
+ readonly evalRunId?: string;
12396
+ }
12397
+ export interface RollbackLiveInput {
12398
+ readonly scope: LiveScope;
12399
+ /** An earlier version to go back to; default: the scope's previous live version. */
12400
+ readonly toVersion?: string;
12401
+ readonly reason?: string;
12402
+ }
12403
+ export interface UnpinLiveInput {
12404
+ readonly scope: LiveScope;
12405
+ readonly reason?: string;
12406
+ }
12407
+ export interface ListPromotionsFilter {
12408
+ /** Only this scope's history. */
12409
+ readonly scope?: LiveScope;
12410
+ readonly limit?: number;
12411
+ readonly cursor?: string;
12412
+ }
10460
12413
  export interface ListAgentsFilter {
10461
12414
  readonly limit?: number;
10462
12415
  readonly cursor?: string;
@@ -10510,7 +12463,7 @@ export interface ApprovalsClient {
10510
12463
  * @wire `GET /v1/approvals` — see
10511
12464
  * `@kindgi/api/openapi.json#/paths/~1v1~1approvals/get`. Role-scoped.
10512
12465
  */
10513
- list(filter?: ApprovalFilter): Promise<Page<Approval>>;
12466
+ list(filter?: ApprovalFilter): Promise<ListPage<Approval>>;
10514
12467
  /**
10515
12468
  * @wire `GET /v1/approvals/{approvalId}` — see
10516
12469
  * `@kindgi/api/openapi.json#/paths/~1v1~1approvals~1{approvalId}/get`.
@@ -10574,7 +12527,7 @@ export interface ReviewersClient {
10574
12527
  * @wire `GET /v1/approvals/reviewers` — see
10575
12528
  * `@kindgi/api/openapi.json#/paths/~1v1~1approvals~1reviewers/get`.
10576
12529
  */
10577
- list(filter?: ReviewerFilter): Promise<Page<Reviewer>>;
12530
+ list(filter?: ReviewerFilter): Promise<ListPage<Reviewer>>;
10578
12531
  /**
10579
12532
  * @wire `GET /v1/approvals/reviewers/{reviewerId}` — see
10580
12533
  * `@kindgi/api/openapi.json#/paths/~1v1~1approvals~1reviewers~1{reviewerId}/get`.
@@ -10627,7 +12580,7 @@ export interface AuditClient {
10627
12580
  * @unwired The API has no `GET /v1/audit-bundles` route — bundles
10628
12581
  * are not stored server-side (see `get`).
10629
12582
  */
10630
- list(filter?: Filter): Promise<Page<AuditBundleMeta>>;
12583
+ list(filter?: Filter): Promise<ListPage<AuditBundleMeta>>;
10631
12584
  /**
10632
12585
  * Verify a bundle's Ed25519 signature client-side.
10633
12586
  *
@@ -10715,7 +12668,7 @@ export interface ArtifactsClient {
10715
12668
  * @wire `GET /v1/artifacts` — see
10716
12669
  * `@kindgi/api/openapi.json#/paths/~1v1~1artifacts/get`.
10717
12670
  */
10718
- list(filter?: ArtifactFilter): Promise<Page<BlobMeta>>;
12671
+ list(filter?: ArtifactFilter): Promise<ListPage<BlobMeta>>;
10719
12672
  /**
10720
12673
  * Delete an artifact. First delete returns `deleted: true`; a repeat
10721
12674
  * against an already-gone id returns `deleted: false` (idempotent —
@@ -10781,6 +12734,8 @@ export interface ListAuthzDecisionsFilter {
10781
12734
  readonly runId?: string;
10782
12735
  readonly from?: string;
10783
12736
  readonly to?: string;
12737
+ /** `asc` (absent): oldest first. `desc`: newest first. */
12738
+ readonly order?: "asc" | "desc";
10784
12739
  }
10785
12740
  export interface AuthzAuditClient {
10786
12741
  /** @wire GET /v1/audit/authz */
@@ -10789,7 +12744,10 @@ export interface AuthzAuditClient {
10789
12744
  export interface AuditResourceClient {
10790
12745
  readonly authz: AuthzAuditClient;
10791
12746
  }
10792
- export type IdentityProviderPage = IdentityProviderCollectionPage;
12747
+ /** Every identity provider: the list comes whole, so `hasMore` is `false`. */
12748
+ export interface IdentityProviderPage extends IdentityProviderCollectionPage {
12749
+ readonly hasMore: boolean;
12750
+ }
10793
12751
  export type IdentityProviderRegisterInput = IdentityProviderConfig;
10794
12752
  export type IdentityProviderRegisterOutcome = RegisterIdentityProviderResult;
10795
12753
  export type IdentityProviderUnregisterOutcome = UnregisterIdentityProviderResult;
@@ -10930,7 +12888,7 @@ export interface CapabilitiesClient {
10930
12888
  * @wire `GET /v1/capabilities` — see
10931
12889
  * `@kindgi/api/openapi.json#/paths/~1v1~1capabilities/get`.
10932
12890
  */
10933
- list(filter?: CapabilityFilter): Promise<Page<CapabilityDeclaration>>;
12891
+ list(filter?: CapabilityFilter): Promise<ListPage<CapabilityDeclaration>>;
10934
12892
  /**
10935
12893
  * Fetch a single capability declaration by id.
10936
12894
  *
@@ -10945,14 +12903,14 @@ export interface CapabilitiesClient {
10945
12903
  route(needs: readonly CapabilityNeed[]): Promise<RouteResult>;
10946
12904
  readonly providers: ProvidersClient;
10947
12905
  }
10948
- export interface ProvidersClient {
12906
+ interface ProvidersClient {
10949
12907
  /**
10950
12908
  * Paginated list of registered providers.
10951
12909
  *
10952
12910
  * @wire `GET /v1/providers` — see
10953
12911
  * `@kindgi/api/openapi.json#/paths/~1v1~1providers/get`.
10954
12912
  */
10955
- list(filter?: ProviderFilter): Promise<Page<LegacyCapabilitiesProvider>>;
12913
+ list(filter?: ProviderFilter): Promise<ListPage<LegacyCapabilitiesProvider>>;
10956
12914
  /**
10957
12915
  * @wire `GET /v1/providers/{providerId}` — see
10958
12916
  * `@kindgi/api/openapi.json#/paths/~1v1~1providers~1{providerId}/get`.
@@ -11056,9 +13014,9 @@ export interface EvidenceClient {
11056
13014
  * Flow:
11057
13015
  * 1. `open()` — establishes the thread; returns the full
11058
13016
  * `Conversation` row (wire returns 201 with the row body).
11059
- * 2. Each turn: `runs.start({ agent, input, conversation })` — the
11060
- * SDK's runs surface accepts a conversation reference so the
11061
- * turn appends to the same thread.
13017
+ * 2. Each turn: `runs.start({ agent, input: { userMessage,
13018
+ * conversationId } })` — an agent run's input names the
13019
+ * conversation, and the turn appends to it.
11062
13020
  * 3. `messages(id)` — read the accumulated message history.
11063
13021
  * 4. `close(id)` — freezes the thread; subsequent turns rejected.
11064
13022
  *
@@ -11090,7 +13048,7 @@ export interface ConversationsClient {
11090
13048
  * @wire `GET /v1/conversations` — see
11091
13049
  * `@kindgi/api/openapi.json#/paths/~1v1~1conversations/get`.
11092
13050
  */
11093
- list(filter?: ConversationFilter): Promise<Page<Conversation>>;
13051
+ list(filter?: ConversationFilter): Promise<ListPage<Conversation>>;
11094
13052
  /**
11095
13053
  * Close a conversation. Idempotent on already-closed threads — the
11096
13054
  * wire returns the current row unchanged in that case (no error, no
@@ -11117,7 +13075,7 @@ export interface ConversationsClient {
11117
13075
  * `role` / `sinceTurn` are accepted but have no effect: the SDK does
11118
13076
  * not send them and the API does not filter by them.
11119
13077
  */
11120
- messages(id: ThreadId, filter?: MessageFilter): Promise<Page<ConversationMessage$1>>;
13078
+ messages(id: ThreadId, filter?: MessageFilter): Promise<ListPage<ConversationMessage$1>>;
11121
13079
  }
11122
13080
  export interface ConversationFilter extends Omit<Filter<ConversationStatus>, "status"> {
11123
13081
  /**
@@ -11129,6 +13087,12 @@ export interface ConversationFilter extends Omit<Filter<ConversationStatus>, "st
11129
13087
  readonly scope?: ScopeRef;
11130
13088
  readonly agent?: AgentId;
11131
13089
  readonly participantId?: string;
13090
+ /**
13091
+ * Replay conversations (a comparison's replays, `metadata.replayOf`):
13092
+ * left out by default (`exclude`); `include` lists them with the
13093
+ * others, `only` lists just them.
13094
+ */
13095
+ readonly replays?: "exclude" | "include" | "only";
11132
13096
  }
11133
13097
  export interface MessageFilter extends Filter {
11134
13098
  readonly role?: MessageRole$1;
@@ -11157,7 +13121,7 @@ export interface UsageClient {
11157
13121
  * @wire `GET /v1/cost/records` — see
11158
13122
  * `@kindgi/api/openapi.json#/paths/~1v1~1cost~1records/get`.
11159
13123
  */
11160
- query(filter?: CostRecordFilter): Promise<Page<CostRecord>>;
13124
+ query(filter?: CostRecordFilter): Promise<ListPage<CostRecord>>;
11161
13125
  /**
11162
13126
  * Fetch a single cost record.
11163
13127
  *
@@ -11183,6 +13147,13 @@ export interface UsageSummaryInput extends Omit<CostRecordFilter, "from" | "to"
11183
13147
  /** Exclusive. */
11184
13148
  readonly to: Timestamp;
11185
13149
  readonly groupBy?: readonly CostGroupDimension[];
13150
+ /**
13151
+ * The most groups to return: the most expensive ones, highest first.
13152
+ * 1 to 10000; the server's default is 1000. When there were more, the
13153
+ * result's `truncated` is `true` and `totalGroups` says how many; the
13154
+ * totals still cover every record.
13155
+ */
13156
+ readonly limit?: number;
11186
13157
  }
11187
13158
  export interface BudgetsClient {
11188
13159
  /**
@@ -11312,6 +13283,8 @@ export interface EnvRecord {
11312
13283
  }
11313
13284
  export interface EnvListPage {
11314
13285
  readonly data: readonly EnvRecord[];
13286
+ /** Whether there's another page (`nextCursor` names it). */
13287
+ readonly hasMore: boolean;
11315
13288
  readonly nextCursor?: Cursor;
11316
13289
  }
11317
13290
  /**
@@ -11338,6 +13311,13 @@ export type EvalRunPage = EvalRunCollectionPage;
11338
13311
  */
11339
13312
  export type StartEvalRunInput = Omit<StartEvalRunBody, "projectId">;
11340
13313
  export type StartEvalRunOutcome = StartEvalRunResult;
13314
+ /**
13315
+ * A comparison's result, typed from the OpenAPI `JudgedComparisonResult`:
13316
+ * its summary and each case. `run` is a `judged` eval run (a test set
13317
+ * compared with a version); `undefined` for another kind of eval run, a
13318
+ * dry run, or one that hasn't finished.
13319
+ */
13320
+ export declare function comparisonOf(run: EvalRunRecord): JudgedComparisonResult | undefined;
11341
13321
  export interface StartEvalRunOptions {
11342
13322
  /** Project the eval run belongs to. The route requires it. */
11343
13323
  readonly projectId: string;
@@ -11533,13 +13513,13 @@ export interface EventsClient {
11533
13513
  /**
11534
13514
  * @unwired The API has no `GET /v1/events` route for event history.
11535
13515
  */
11536
- query(filter?: EventListFilter): Promise<Page<Event$1>>;
13516
+ query(filter?: EventListFilter): Promise<ListPage<Event$1>>;
11537
13517
  }
11538
13518
  export interface SubscriptionsClient {
11539
13519
  /**
11540
13520
  * @unwired The API has no `GET /v1/events/subscriptions` route.
11541
13521
  */
11542
- list(): Promise<Page<Subscription>>;
13522
+ list(): Promise<ListPage<Subscription>>;
11543
13523
  /**
11544
13524
  * @unwired The API has no `GET /v1/events/subscriptions/{id}` route.
11545
13525
  */
@@ -11603,44 +13583,67 @@ export interface FlowsClient {
11603
13583
  * @wire `GET /v1/flows` — see
11604
13584
  * `@kindgi/api/openapi.json#/paths/~1v1~1flows/get`.
11605
13585
  */
11606
- list(filter?: FlowFilter): Promise<Page<Flow>>;
13586
+ list(filter?: FlowFilter): Promise<ListPage<Flow>>;
13587
+ /**
13588
+ * A flow's versions: list, get, unregister and reinstate. Calling it
13589
+ * directly lists them (deprecated: use `flows.versions.list`).
13590
+ */
13591
+ readonly versions: FlowVersionsClient;
13592
+ /** @deprecated Use `flows.versions.get`; removed in 0.2. */
13593
+ getVersion(id: FlowId, version: string): Promise<Flow>;
13594
+ /** @deprecated Use `flows.versions.unregister`; removed in 0.2. */
13595
+ delete(id: FlowId, version: string, options?: {
13596
+ readonly idempotencyKey?: string;
13597
+ }): Promise<void>;
13598
+ /** @deprecated Use `flows.versions.reinstate`; removed in 0.2. */
13599
+ reinstateVersion(id: FlowId, version: string, options?: {
13600
+ readonly idempotencyKey?: string;
13601
+ }): Promise<ReinstateFlowVersionResult>;
13602
+ }
13603
+ export interface FlowVersionsClient {
13604
+ /** @deprecated Use `flows.versions.list`; removed in 0.2. */
13605
+ (id: FlowId, filter?: PageFilter): Promise<ListPage<Flow>>;
11607
13606
  /**
11608
13607
  * Historical versions of a flow.id.
11609
13608
  *
11610
13609
  * @wire `GET /v1/flows/{flowId}/versions` — see
11611
13610
  * `@kindgi/api/openapi.json#/paths/~1v1~1flows~1{flowId}~1versions/get`.
11612
13611
  */
11613
- versions(id: FlowId, filter?: PageFilter): Promise<Page<Flow>>;
13612
+ list(id: FlowId, filter?: PageFilter): Promise<ListPage<Flow>>;
11614
13613
  /**
11615
13614
  * Fetch a specific version of a flow.
11616
13615
  *
11617
13616
  * @wire `GET /v1/flows/{flowId}/versions/{version}` — see
11618
13617
  * `@kindgi/api/openapi.json#/paths/~1v1~1flows~1{flowId}~1versions~1{version}/get`.
11619
13618
  */
11620
- getVersion(id: FlowId, version: string): Promise<Flow>;
13619
+ get(id: FlowId, version: string): Promise<Flow>;
11621
13620
  /**
11622
13621
  * Unregister a specific version (an explicit version is required —
11623
13622
  * flows are versioned). Historical runs remain in the journal; only
11624
13623
  * future `runs.start` calls against this `(flowId, version)` fail
11625
- * with `not-found/flow`.
13624
+ * with `not-found/flow`. Reversible via `flows.versions.reinstate`.
11626
13625
  *
11627
13626
  * @wire `POST /v1/flows/{flowId}/versions/{version}/unregister` —
11628
13627
  * see `@kindgi/api/openapi.json#/paths/~1v1~1flows~1{flowId}~1versions~1{version}~1unregister/post`.
11629
13628
  */
11630
- delete(id: FlowId, version: string, options?: {
13629
+ unregister(id: FlowId, version: string, options?: {
11631
13630
  readonly idempotencyKey?: string;
11632
- }): Promise<void>;
13631
+ }): Promise<UnregisterFlowVersionResult>;
11633
13632
  /**
11634
- * Un-tombstone a previously-unregistered version — the reverse of
11635
- * `delete`. Idempotent — reinstating an active version returns
11636
- * `wasTombstoned: false`.
13633
+ * Un-tombstone a previously-unregistered version. Idempotent —
13634
+ * reinstating an active version returns `wasTombstoned: false`.
11637
13635
  *
11638
13636
  * @wire `POST /v1/flows/{flowId}/versions/{version}/reinstate`
11639
13637
  */
11640
- reinstateVersion(id: FlowId, version: string, options?: {
13638
+ reinstate(id: FlowId, version: string, options?: {
11641
13639
  readonly idempotencyKey?: string;
11642
13640
  }): Promise<ReinstateFlowVersionResult>;
11643
13641
  }
13642
+ export interface UnregisterFlowVersionResult {
13643
+ readonly flowId: FlowId;
13644
+ readonly version: string;
13645
+ readonly unregistered: boolean;
13646
+ }
11644
13647
  export interface ReinstateFlowVersionResult {
11645
13648
  readonly flowId: FlowId;
11646
13649
  readonly version: string;
@@ -11667,6 +13670,56 @@ export interface FlowValidateResult {
11667
13670
  readonly message: string;
11668
13671
  }[];
11669
13672
  }
13673
+ /**
13674
+ * Gate policies (evals step 4b): what a promotion of an agent must show
13675
+ * before a version goes live for a scope. One policy per agent and scope;
13676
+ * the caller names the policy and its semver versions. Writes need
13677
+ * `admin` on the tenant.
13678
+ */
13679
+ export interface GatePoliciesClient {
13680
+ /**
13681
+ * Each policy's latest active version.
13682
+ *
13683
+ * @wire GET /v1/gate-policies
13684
+ */
13685
+ list(filter?: GatePolicyFilter): Promise<GatePolicyPage>;
13686
+ /**
13687
+ * The policy's latest active version.
13688
+ *
13689
+ * @wire GET /v1/gate-policies/:policyId
13690
+ */
13691
+ get(policyId: string): Promise<GatePolicy>;
13692
+ /**
13693
+ * Register a policy, or a new version of one. `409
13694
+ * gate-policy-scope-taken` when another policy gates the agent for the
13695
+ * scope (`details.heldBy`); `409 gate-policy-scope-changed` when a new
13696
+ * version names another agent or scope.
13697
+ *
13698
+ * @wire POST /v1/gate-policies
13699
+ */
13700
+ publish(input: PublishGatePolicyInput, options?: {
13701
+ idempotencyKey?: string;
13702
+ }): Promise<GatePolicy>;
13703
+ readonly versions: GatePolicyVersionsClient;
13704
+ }
13705
+ export interface GatePolicyVersionsClient {
13706
+ /** @wire GET /v1/gate-policies/:policyId/versions — oldest first, unregistered ones too */
13707
+ list(policyId: string): Promise<GatePolicyPage>;
13708
+ /** @wire GET /v1/gate-policies/:policyId/versions/:version */
13709
+ get(policyId: string, version: string): Promise<GatePolicy>;
13710
+ /** @wire POST /v1/gate-policies/:policyId/versions/:version/unregister */
13711
+ unregister(policyId: string, version: string): Promise<GatePolicy>;
13712
+ /** @wire POST /v1/gate-policies/:policyId/versions/:version/reinstate */
13713
+ reinstate(policyId: string, version: string): Promise<GatePolicy>;
13714
+ }
13715
+ export interface GatePolicyFilter {
13716
+ readonly agentId?: string;
13717
+ /** Only the policy of exactly this scope. */
13718
+ readonly scope?: LiveScope;
13719
+ readonly limit?: number;
13720
+ readonly cursor?: string;
13721
+ }
13722
+ export type PublishGatePolicyInput = PublishGatePolicyBody;
11670
13723
  /**
11671
13724
  * Guardrails resource — declarative rules that gate runs.
11672
13725
  *
@@ -11708,7 +13761,7 @@ export interface GuardrailsClient {
11708
13761
  * @wire `GET /v1/guardrails` — see
11709
13762
  * `@kindgi/api/openapi.json#/paths/~1v1~1guardrails/get`.
11710
13763
  */
11711
- list(filter?: GuardrailFilter): Promise<Page<Guardrail>>;
13764
+ list(filter?: GuardrailFilter): Promise<ListPage<Guardrail>>;
11712
13765
  /**
11713
13766
  * Retire a guardrail. Idempotent on already-unregistered ids —
11714
13767
  * returns `unregistered: true` in either case; only unknown ids
@@ -11729,12 +13782,12 @@ export interface GuardrailsClient {
11729
13782
  * per id; supersession via `unregister` + re-`register`), with no
11730
13783
  * version history.
11731
13784
  */
11732
- versions(id: GuardrailId): Promise<Page<Guardrail>>;
13785
+ versions(id: GuardrailId): Promise<ListPage<Guardrail>>;
11733
13786
  /**
11734
13787
  * @unwired The API has no `GET /v1/guardrails/built-ins` route for
11735
13788
  * the built-in check catalog.
11736
13789
  */
11737
- builtIns(): Promise<Page<BuiltInGuardrail>>;
13790
+ builtIns(): Promise<ListPage<BuiltInGuardrail>>;
11738
13791
  /**
11739
13792
  * @unwired The API has no `POST /v1/guardrails/{id}/evaluate`
11740
13793
  * route — guardrails are evaluated inline during a run
@@ -11801,7 +13854,7 @@ export interface JudgeClassesClient {
11801
13854
  * @wire `GET /v1/judge-classes` — see
11802
13855
  * `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes/get`.
11803
13856
  */
11804
- list(filter?: JudgeClassFilter): Promise<Page<JudgeClass>>;
13857
+ list(filter?: JudgeClassFilter): Promise<ListPage<JudgeClass>>;
11805
13858
  /**
11806
13859
  * One class, also a retired one (`unregisteredAt` set).
11807
13860
  *
@@ -11810,7 +13863,7 @@ export interface JudgeClassesClient {
11810
13863
  */
11811
13864
  get(judgeClassId: string): Promise<JudgeClass>;
11812
13865
  /**
11813
- * Change a live class's weight or description.
13866
+ * Change a live class's weight, description or who may assert it.
11814
13867
  *
11815
13868
  * @wire `PATCH /v1/judge-classes/{judgeClassId}` — see
11816
13869
  * `@kindgi/api/openapi.json#/paths/~1v1~1judge-classes~1{judgeClassId}/patch`.
@@ -11855,7 +13908,7 @@ export interface JudgmentsClient {
11855
13908
  *
11856
13909
  * @wire `GET /v1/judgments` — see `@kindgi/api/openapi.json#/paths/~1v1~1judgments/get`.
11857
13910
  */
11858
- list(filter?: JudgmentFilter): Promise<Page<Judgment>>;
13911
+ list(filter?: JudgmentFilter): Promise<ListPage<Judgment>>;
11859
13912
  /**
11860
13913
  * One judgment with the stored copies of what was judged.
11861
13914
  *
@@ -11916,12 +13969,12 @@ export interface McpClient {
11916
13969
  * `client.tools.list()` — the wire `Tool` shape is the MCP
11917
13970
  * manifest.
11918
13971
  */
11919
- tools(): Promise<Page<ToolManifest>>;
13972
+ tools(): Promise<ListPage<ToolManifest>>;
11920
13973
  /**
11921
13974
  * @unwired No `GET /v1/mcp/agents` route. List agents with
11922
13975
  * `client.agents.list()`.
11923
13976
  */
11924
- agents(): Promise<Page<McpAgentExposure>>;
13977
+ agents(): Promise<ListPage<McpAgentExposure>>;
11925
13978
  /**
11926
13979
  * @unwired No `POST /v1/mcp/invoke-tool` route; tools run inside
11927
13980
  * agent and flow runs (`client.runs.start`).
@@ -11945,7 +13998,7 @@ export interface McpEndpointsClient {
11945
13998
  * @wire `GET /v1/mcp/endpoints` — see
11946
13999
  * `@kindgi/api/openapi.json#/paths/~1v1~1mcp~1endpoints/get`.
11947
14000
  */
11948
- list(filter?: McpEndpointFilter): Promise<Page<McpEndpoint>>;
14001
+ list(filter?: McpEndpointFilter): Promise<ListPage<McpEndpoint>>;
11949
14002
  /**
11950
14003
  * Register an outbound MCP endpoint.
11951
14004
  *
@@ -12070,7 +14123,7 @@ export interface FactsClient {
12070
14123
  * is serialized as a JSON-encoded `?scope=` query param per the
12071
14124
  * server-side parser (`parseScopeParam`).
12072
14125
  */
12073
- list(filter?: FactFilter): Promise<Page<Fact$1>>;
14126
+ list(filter?: FactFilter): Promise<ListPage<Fact$1>>;
12074
14127
  /**
12075
14128
  * Soft-delete a fact via supersession. Facts are append-only on the
12076
14129
  * wire. Returns the wire envelope `{ factId, superseded: true }`;
@@ -12094,7 +14147,7 @@ export interface LogsClient {
12094
14147
  /**
12095
14148
  * @unwired No `GET /v1/memory/logs` route.
12096
14149
  */
12097
- list(filter?: LogFilter): Promise<Page<LogEntry>>;
14150
+ list(filter?: LogFilter): Promise<ListPage<LogEntry>>;
12098
14151
  /**
12099
14152
  * @unwired No `POST /v1/memory/logs/verify` route. Verifying the
12100
14153
  * hash chain needs the log entries, which the API does not
@@ -12121,7 +14174,7 @@ export interface ObservationsClient {
12121
14174
  *
12122
14175
  * @wire `GET /v1/observations` — see `@kindgi/api/openapi.json#/paths/~1v1~1observations/get`.
12123
14176
  */
12124
- query(filter?: ObservationFilter): Promise<Page<Observation>>;
14177
+ query(filter?: ObservationFilter): Promise<ListPage<Observation>>;
12125
14178
  /**
12126
14179
  * @unwired No `/v1/observations/patterns` route.
12127
14180
  */
@@ -12195,11 +14248,11 @@ export interface PacksClient {
12195
14248
  */
12196
14249
  install(input: PackInstallInput): Promise<InstallationId>;
12197
14250
  /** @unwired No `GET /v1/packs/installed` route. */
12198
- installed(filter?: PackFilter): Promise<Page<InstalledPack>>;
14251
+ installed(filter?: PackFilter): Promise<ListPage<InstalledPack>>;
12199
14252
  /** @unwired No `GET /v1/packs/{id}` route. */
12200
14253
  get(id: PackId): Promise<Pack>;
12201
14254
  /** @unwired No `GET /v1/packs/{id}/versions` route. */
12202
- versions(id: PackId): Promise<Page<Pack>>;
14255
+ versions(id: PackId): Promise<ListPage<Pack>>;
12203
14256
  /** @unwired No `PATCH /v1/pack-installations/{id}/config` route. */
12204
14257
  configure(id: InstallationId, config: Readonly<Record<string, unknown>>): Promise<void>;
12205
14258
  /** @unwired No `POST /v1/pack-installations/{id}/disable` route. */
@@ -12217,9 +14270,9 @@ export interface PacksClient {
12217
14270
  */
12218
14271
  export interface RegistryClient {
12219
14272
  /** @unwired No `GET /v1/packs/registry` route. */
12220
- browse(filter?: RegistryFilter): Promise<Page<Pack>>;
14273
+ browse(filter?: RegistryFilter): Promise<ListPage<Pack>>;
12221
14274
  /** @unwired No `GET /v1/packs/registry/configured` route. */
12222
- configured(): Promise<Page<{
14275
+ configured(): Promise<ListPage<{
12223
14276
  readonly url: string;
12224
14277
  readonly name: string;
12225
14278
  }>>;
@@ -12235,7 +14288,8 @@ export interface RegistryFilter extends Filter {
12235
14288
  * Policies resource — versioned tenant policy registry.
12236
14289
  *
12237
14290
  * Each policy carries a `kind` (`access-control`, `model-routing`,
12238
- * `adapter-allowlist`, `rate-limit`, `retention`, `compliance`) and a
14291
+ * `adapter-allowlist`, `rate-limit`, `retention`, `compliance`,
14292
+ * `tool-errors`, `hitl`) and a
12239
14293
  * `spec` object whose shape that kind defines. The API stores and
12240
14294
  * versions policies (semver per id); enforcement happens where each
12241
14295
  * kind is consumed, not in this resource.
@@ -12247,16 +14301,31 @@ export interface RegistryFilter extends Filter {
12247
14301
  export interface PoliciesClient {
12248
14302
  /**
12249
14303
  * Publish a policy version. The server validates the top-level
12250
- * shape (id, semver version, `kind`, `spec` object) — failures return
12251
- * `400 validation-failed` with the issue list; deeper validation of
12252
- * `spec` belongs to the consumer of that kind. Publishing the same
14304
+ * shape (id, semver version, `kind`, `spec` object), and `spec` for
14305
+ * `tool-errors`, `hitl` and `retention` — failures return
14306
+ * `400 validation-failed` with the issue list (a retention policy with
14307
+ * an unknown domain, or `mode: 'archive'`, is refused). Other kinds'
14308
+ * specs belong to the consumer of that kind. Publishing the same
12253
14309
  * `(id, version)` twice returns `409 policy-already-registered`.
12254
14310
  *
14311
+ * A tenant has one retention policy per domain, plus one for `*`: a
14312
+ * second policy id for a covered domain returns
14313
+ * `409 policy-scope-taken` (`details.heldBy` names the one that covers
14314
+ * it; publish a new version of that one instead), and a new version
14315
+ * can't move a policy to another domain (`409 policy-scope-changed`).
14316
+ *
12255
14317
  * @wire `POST /v1/policies` — see
12256
14318
  * `@kindgi/api/openapi.json#/paths/~1v1~1policies/post`.
12257
14319
  *
12258
14320
  * The wire action is publish; there is no draft lifecycle.
12259
14321
  */
14322
+ publish(spec: PolicySpec, options?: {
14323
+ readonly idempotencyKey?: string;
14324
+ }): Promise<{
14325
+ readonly policyId: PolicyId;
14326
+ readonly version: string;
14327
+ }>;
14328
+ /** @deprecated Use `policies.publish`; removed in 0.2. */
12260
14329
  author(spec: PolicySpec, options?: {
12261
14330
  readonly idempotencyKey?: string;
12262
14331
  }): Promise<{
@@ -12272,7 +14341,7 @@ export interface PoliciesClient {
12272
14341
  * @wire `GET /v1/policies` — see
12273
14342
  * `@kindgi/api/openapi.json#/paths/~1v1~1policies/get`.
12274
14343
  */
12275
- list(filter?: PolicyListFilter): Promise<Page<Policy>>;
14344
+ list(filter?: PolicyListFilter): Promise<ListPage<Policy>>;
12276
14345
  /**
12277
14346
  * Historical versions of a policy.id. Defaults to active-only. Pass
12278
14347
  * `filter.includeTombstoned = true` to include soft-tombstoned rows
@@ -12282,7 +14351,7 @@ export interface PoliciesClient {
12282
14351
  * @wire `GET /v1/policies/{policyId}/versions` — see
12283
14352
  * `@kindgi/api/openapi.json#/paths/~1v1~1policies~1{policyId}~1versions/get`.
12284
14353
  */
12285
- versions(id: PolicyId, filter?: PolicyVersionsFilter): Promise<Page<PolicyVersionRow>>;
14354
+ versions(id: PolicyId, filter?: PolicyVersionsFilter): Promise<ListPage<PolicyVersionRow>>;
12286
14355
  /**
12287
14356
  * Fetch a specific version of a policy.
12288
14357
  *
@@ -12421,7 +14490,7 @@ export interface ProvenanceClient {
12421
14490
  * @wire `GET /v1/provenance` — see
12422
14491
  * `@kindgi/api/openapi.json#/paths/~1v1~1provenance/get`.
12423
14492
  */
12424
- query(filter?: ProvenanceQueryFilter): Promise<Page<ProvenanceRecordMetadata>>;
14493
+ query(filter?: ProvenanceQueryFilter): Promise<ListPage<ProvenanceRecordMetadata>>;
12425
14494
  /**
12426
14495
  * Export a signed JSON bundle for a run. The server canonicalizes the
12427
14496
  * DAG + optional messages, signs with the Ed25519 key named by
@@ -12481,6 +14550,52 @@ interface ProvidersClient$1 {
12481
14550
  readonly idempotencyKey?: string;
12482
14551
  }): Promise<UnregisterProviderOutcome>;
12483
14552
  }
14553
+ /**
14554
+ * Retention resource — what happens to deleted rows. Deleting most
14555
+ * things is a tombstone; a `retention` policy per domain (published with
14556
+ * `policies.author`) sets how long a tombstone stays before a sweep
14557
+ * purges it for good. Nothing sweeps on its own: call `sweep` from a
14558
+ * schedule. Both need `admin` on the tenant.
14559
+ */
14560
+ export interface RetentionClient {
14561
+ /**
14562
+ * The tombstoned rows in every domain a retention policy covers, each
14563
+ * with when it is purged (`purgeAt`) and the policy that decides it.
14564
+ * The page also names the covered domains this deployment can't purge
14565
+ * (`domainsMissingAdapter`), the ones no policy covers
14566
+ * (`unpolicedDomains`), and any domain two policies cover
14567
+ * (`conflicts`).
14568
+ *
14569
+ * @wire `GET /v1/retention/scheduled` — see
14570
+ * `@kindgi/api/openapi.json#/paths/~1v1~1retention~1scheduled/get`.
14571
+ */
14572
+ scheduled(filter?: RetentionScheduledFilter): Promise<RetentionScheduledPage>;
14573
+ /**
14574
+ * Purge, for good, the tombstoned rows past their policy's grace: in
14575
+ * every domain, or only `domain`. At most `maxPerDomain` per domain
14576
+ * per call (default 500); `remaining` counts the rest. Idempotent.
14577
+ *
14578
+ * @wire `POST /v1/retention/sweep`, or with `domain`
14579
+ * `POST /v1/retention/sweep/{domain}` — see
14580
+ * `@kindgi/api/openapi.json#/paths/~1v1~1retention~1sweep/post`.
14581
+ */
14582
+ sweep(input?: RetentionSweepInput): Promise<RetentionSweepResult>;
14583
+ }
14584
+ export interface RetentionScheduledFilter {
14585
+ readonly domain?: RetentionDomain;
14586
+ /** Only the rows a sweep would purge now. */
14587
+ readonly pastGraceOnly?: boolean;
14588
+ /** Rows per domain at most: 1..100, default 25. */
14589
+ readonly limit?: number;
14590
+ /** A previous page's `nextCursor`, to continue where it stopped. */
14591
+ readonly cursor?: string;
14592
+ }
14593
+ export interface RetentionSweepInput {
14594
+ /** One domain (not `*`). Absent: every domain. */
14595
+ readonly domain?: Exclude<RetentionDomain, "*">;
14596
+ /** 1..10000, default 500. */
14597
+ readonly maxPerDomain?: number;
14598
+ }
12484
14599
  /**
12485
14600
  * A run event without its payload: what happened, on which node, when
12486
14601
  * (`RunProgressEvent` in the OpenAPI document). What
@@ -12720,9 +14835,15 @@ export interface RunPage {
12720
14835
  */
12721
14836
  export type StartRunInput = {
12722
14837
  readonly agent: AgentId | string;
14838
+ /**
14839
+ * Omit to use the live version for this project and segment path
14840
+ * (or, in a conversation, the version its earlier turns used).
14841
+ */
12723
14842
  readonly agentVersion?: string;
12724
14843
  /** Project the run belongs to. Omit to use the tenant's default project. */
12725
14844
  readonly projectId?: string;
14845
+ /** Where the run happens, coarse to fine (e.g. company, then role); picks the live version. */
14846
+ readonly segments?: readonly ScopeSegment[];
12726
14847
  readonly input: unknown;
12727
14848
  readonly options?: StartRunOptions;
12728
14849
  readonly idempotencyKey?: string;
@@ -12731,6 +14852,8 @@ export type StartRunInput = {
12731
14852
  readonly flowVersion?: string;
12732
14853
  /** Project the run belongs to. Optional; when omitted, the API's run handler chooses. */
12733
14854
  readonly projectId?: string;
14855
+ /** Where the run happens; picks the live version of each agent step. */
14856
+ readonly segments?: readonly ScopeSegment[];
12734
14857
  readonly input: unknown;
12735
14858
  readonly options?: StartRunOptions;
12736
14859
  readonly idempotencyKey?: string;
@@ -12759,6 +14882,16 @@ export interface RunAgent {
12759
14882
  readonly id: string;
12760
14883
  readonly version: string;
12761
14884
  readonly conversationId: string;
14885
+ /**
14886
+ * How the version was chosen: named on the run (`explicit`), held by the
14887
+ * flow version a flow's agent step runs in (`flow-pin`: the node's
14888
+ * `config.version`, else the flow version's pin), the conversation's
14889
+ * version (`conversation`), a live version (`live`), or the latest
14890
+ * (`latest`). Absent on turns from before 0.1.4.
14891
+ */
14892
+ readonly via?: "explicit" | "flow-pin" | "conversation" | "live" | "latest";
14893
+ /** With `via: 'live'`: the scope whose live version ran. */
14894
+ readonly liveScope?: LiveScope;
12762
14895
  }
12763
14896
  /**
12764
14897
  * Wire shape — matches `@kindgi/api/openapi.json#Run`. Runs are
@@ -12789,6 +14922,8 @@ export interface Run {
12789
14922
  * started). Absent on other runs, and on turns from before 0.1.3.
12790
14923
  */
12791
14924
  readonly agent?: RunAgent;
14925
+ /** The segment path the run was started with; a child run has its parent's. */
14926
+ readonly segments?: readonly ScopeSegment[];
12792
14927
  }
12793
14928
  /**
12794
14929
  * What `runs.start` returns: the run, plus a public run token when the
@@ -13035,10 +15170,14 @@ export interface SecretVersionRecord {
13035
15170
  }
13036
15171
  export interface SecretListPage {
13037
15172
  readonly data: readonly SecretRecord[];
15173
+ /** Whether there's another page (`nextCursor` names it). */
15174
+ readonly hasMore: boolean;
13038
15175
  readonly nextCursor?: Cursor;
13039
15176
  }
13040
15177
  export interface SecretVersionPage {
13041
15178
  readonly data: readonly SecretVersionRecord[];
15179
+ /** Whether there's another page (`nextCursor` names it). */
15180
+ readonly hasMore: boolean;
13042
15181
  readonly nextCursor?: Cursor;
13043
15182
  }
13044
15183
  export type SecretSetOutcome = {
@@ -13189,9 +15328,9 @@ export interface SupervisorClient {
13189
15328
  /** @unwired No `GET /v1/supervisors/{id}` route. */
13190
15329
  get(id: SupervisorId): Promise<Supervisor>;
13191
15330
  /** @unwired No `GET /v1/supervisors` route. */
13192
- list(filter?: Filter): Promise<Page<Supervisor>>;
15331
+ list(filter?: Filter): Promise<ListPage<Supervisor>>;
13193
15332
  /** @unwired No `GET /v1/supervisors/{id}/versions` route. */
13194
- versions(id: SupervisorId): Promise<Page<Supervisor>>;
15333
+ versions(id: SupervisorId): Promise<ListPage<Supervisor>>;
13195
15334
  /** @unwired No `DELETE /v1/supervisors/{id}` route. */
13196
15335
  delete(id: SupervisorId): Promise<void>;
13197
15336
  readonly proposals: ProposalsClient;
@@ -13215,7 +15354,7 @@ export interface ProposalsClient {
13215
15354
  * @wire `GET /v1/proposals` — see
13216
15355
  * `@kindgi/api/openapi.json#/paths/~1v1~1proposals/get`.
13217
15356
  */
13218
- list(input: ProposalListInput): Promise<Page<FixProposal>>;
15357
+ list(input: ProposalListInput): Promise<ListPage<FixProposal>>;
13219
15358
  /**
13220
15359
  * @wire `GET /v1/proposals/{proposalId}` — see
13221
15360
  * `@kindgi/api/openapi.json#/paths/~1v1~1proposals~1{proposalId}/get`.
@@ -13427,7 +15566,7 @@ export interface TokensClient {
13427
15566
  * @wire `GET /v1/tokens` — see
13428
15567
  * `@kindgi/api/openapi.json#/paths/~1v1~1tokens/get`.
13429
15568
  */
13430
- list(filter?: TokenFilter): Promise<Page<ApiToken>>;
15569
+ list(filter?: TokenFilter): Promise<ListPage<ApiToken>>;
13431
15570
  /**
13432
15571
  * Read one API key. Never returns the secret.
13433
15572
  *
@@ -13488,7 +15627,7 @@ export interface ToolsClient {
13488
15627
  * @wire `GET /v1/tools` — see
13489
15628
  * `@kindgi/api/openapi.json#/paths/~1v1~1tools/get`.
13490
15629
  */
13491
- list(filter?: ToolFilter): Promise<Page<Tool>>;
15630
+ list(filter?: ToolFilter): Promise<ListPage<Tool>>;
13492
15631
  /**
13493
15632
  * Fetch the latest active version of a tool.
13494
15633
  *
@@ -13502,6 +15641,49 @@ export interface ToolsClient {
13502
15641
  * `@kindgi/api/openapi.json#/paths/~1v1~1tools~1{toolId}/get`.
13503
15642
  */
13504
15643
  get(id: ToolId): Promise<Tool>;
15644
+ /**
15645
+ * Register a tool manifest (the tool minus its handler) at its version,
15646
+ * in a project. Metadata only: the handler isn't uploaded, and must
15647
+ * already be available to the runtime. Registering a version again is
15648
+ * `409 tool-already-registered`; a registry that takes no writes
15649
+ * (under `kindgi dev`, the pack's files are the source) is
15650
+ * `409 registry-read-only`.
15651
+ *
15652
+ * @wire `POST /v1/tools` — see
15653
+ * `@kindgi/api/openapi.json#/paths/~1v1~1tools/post`.
15654
+ */
15655
+ register(manifest: Tool, options: {
15656
+ readonly projectId: string;
15657
+ readonly idempotencyKey?: string;
15658
+ }): Promise<{
15659
+ readonly toolId: ToolId;
15660
+ }>;
15661
+ /** A tool's versions: list, get, unregister and reinstate. */
15662
+ readonly versions: ToolVersionsClient;
15663
+ /** @deprecated Use `tools.versions.list`; removed in 0.2. */
15664
+ listVersions(id: ToolId, filter?: ToolVersionFilter): Promise<ListPage<ToolVersionRow>>;
15665
+ /** @deprecated Use `tools.versions.get`; removed in 0.2. */
15666
+ getVersion(id: ToolId, version: string): Promise<Tool>;
15667
+ /** @deprecated Use `tools.versions.reinstate`; removed in 0.2. */
15668
+ reinstateVersion(id: ToolId, version: string, options?: {
15669
+ readonly idempotencyKey?: string;
15670
+ }): Promise<ReinstateToolVersionResult>;
15671
+ /** @deprecated Use `tools.versions.unregister`; removed in 0.2. */
15672
+ unregisterVersion(id: ToolId, version: string, options?: {
15673
+ readonly idempotencyKey?: string;
15674
+ }): Promise<UnregisterToolVersionResult>;
15675
+ /**
15676
+ * @unwired No `POST /v1/tools/{toolId}/invoke` route; tools run
15677
+ * inside agent and flow runs.
15678
+ */
15679
+ invoke(id: ToolId, input: unknown): Promise<never>;
15680
+ /**
15681
+ * @unwired No separate manifests route — the wire `Tool` shape is
15682
+ * the manifest; use `list`.
15683
+ */
15684
+ manifests(filter?: ToolFilter): Promise<never>;
15685
+ }
15686
+ export interface ToolVersionsClient {
13505
15687
  /**
13506
15688
  * Cursor-paginated list of tool versions. Defaults to active-only.
13507
15689
  * Pass `filter.includeTombstoned = true` to include soft-tombstoned
@@ -13510,7 +15692,7 @@ export interface ToolsClient {
13510
15692
  *
13511
15693
  * @wire `GET /v1/tools/{toolId}/versions`
13512
15694
  */
13513
- listVersions(id: ToolId, filter?: ToolVersionFilter): Promise<Page<ToolVersionRow>>;
15695
+ list(id: ToolId, filter?: ToolVersionFilter): Promise<ListPage<ToolVersionRow>>;
13514
15696
  /**
13515
15697
  * Fetch a specific tool version by exact semver. Returns
13516
15698
  * `404 tool-not-found` when the (id, version) pair isn't registered
@@ -13518,7 +15700,16 @@ export interface ToolsClient {
13518
15700
  *
13519
15701
  * @wire `GET /v1/tools/{toolId}/versions/{version}`
13520
15702
  */
13521
- getVersion(id: ToolId, version: string): Promise<Tool>;
15703
+ get(id: ToolId, version: string): Promise<Tool>;
15704
+ /**
15705
+ * Tombstone a specific version. Reversible via `tools.versions.reinstate`.
15706
+ * Idempotent — repeat call returns `unregistered: false`.
15707
+ *
15708
+ * @wire `POST /v1/tools/{toolId}/versions/{version}/unregister`
15709
+ */
15710
+ unregister(id: ToolId, version: string, options?: {
15711
+ readonly idempotencyKey?: string;
15712
+ }): Promise<UnregisterToolVersionResult>;
13522
15713
  /**
13523
15714
  * Un-tombstone a specific previously-unregistered version.
13524
15715
  * Restores the manifest bytes verbatim (semver hygiene: reinstate
@@ -13533,28 +15724,9 @@ export interface ToolsClient {
13533
15724
  *
13534
15725
  * @wire `POST /v1/tools/{toolId}/versions/{version}/reinstate`
13535
15726
  */
13536
- reinstateVersion(id: ToolId, version: string, options?: {
15727
+ reinstate(id: ToolId, version: string, options?: {
13537
15728
  readonly idempotencyKey?: string;
13538
15729
  }): Promise<ReinstateToolVersionResult>;
13539
- /**
13540
- * Tombstone a specific version. Reversible via `reinstateVersion`.
13541
- * Idempotent — repeat call returns `unregistered: false`.
13542
- *
13543
- * @wire `POST /v1/tools/{toolId}/versions/{version}/unregister`
13544
- */
13545
- unregisterVersion(id: ToolId, version: string, options?: {
13546
- readonly idempotencyKey?: string;
13547
- }): Promise<UnregisterToolVersionResult>;
13548
- /**
13549
- * @unwired No `POST /v1/tools/{toolId}/invoke` route; tools run
13550
- * inside agent and flow runs.
13551
- */
13552
- invoke(id: ToolId, input: unknown): Promise<never>;
13553
- /**
13554
- * @unwired No separate manifests route — the wire `Tool` shape is
13555
- * the manifest; use `list`.
13556
- */
13557
- manifests(filter?: ToolFilter): Promise<never>;
13558
15730
  }
13559
15731
  export interface ToolFilter {
13560
15732
  readonly limit?: number;
@@ -13648,7 +15820,7 @@ export interface UsersClient {
13648
15820
  * @wire `GET /v1/identity/users` — see
13649
15821
  * `@kindgi/api/openapi.json#/paths/~1v1~1identity~1users/get`.
13650
15822
  */
13651
- list(filter?: UserFilter): Promise<Page<User>>;
15823
+ list(filter?: UserFilter): Promise<ListPage<User>>;
13652
15824
  /**
13653
15825
  * @unwired No user-update route — users live in the deployment's
13654
15826
  * identity directory.
@@ -13669,7 +15841,7 @@ export interface SessionsClient {
13669
15841
  * @wire `GET /v1/identity/users/{userId}/sessions` — see
13670
15842
  * `@kindgi/api/openapi.json#/paths/~1v1~1identity~1users~1{userId}~1sessions/get`.
13671
15843
  */
13672
- list(userId: UserId): Promise<Page<Session>>;
15844
+ list(userId: UserId): Promise<ListPage<Session>>;
13673
15845
  /**
13674
15846
  * Revoke ALL sessions for a user. Admin-scope. Idempotent on
13675
15847
  * already-revoked sets (returns `revokedCount: 0`).
@@ -13792,6 +15964,9 @@ export interface KindgiClient {
13792
15964
  readonly adapters: AdaptersClient;
13793
15965
  readonly providers: ProvidersClient$1;
13794
15966
  readonly policies: PoliciesClient;
15967
+ /** Gate policies: what a promotion must show before a version goes live (evals step 4b). */
15968
+ readonly gatePolicies: GatePoliciesClient;
15969
+ readonly retention: RetentionClient;
13795
15970
  readonly projects: ProjectsClient;
13796
15971
  readonly env: EnvClient;
13797
15972
  readonly secrets: SecretsClient;
@@ -13863,17 +16038,23 @@ export interface NetworkError {
13863
16038
  }
13864
16039
  export interface AuthError {
13865
16040
  readonly code: "auth";
16041
+ /** The server's own error code (the wire `code`), when the error came from the server. */
16042
+ readonly serverCode?: string;
13866
16043
  readonly message: string;
13867
16044
  readonly reason: "unauthenticated" | "forbidden" | "token-expired";
13868
16045
  }
13869
16046
  export interface RateLimitedError {
13870
16047
  readonly code: "rate-limited";
16048
+ /** The server's own error code (the wire `code`), when the error came from the server. */
16049
+ readonly serverCode?: string;
13871
16050
  readonly message: string;
13872
16051
  /** Suggested seconds to wait before retry (from server `Retry-After`). */
13873
16052
  readonly retryAfterSeconds?: number;
13874
16053
  }
13875
16054
  export interface NotFoundError {
13876
16055
  readonly code: "not-found";
16056
+ /** The server's own error code (the wire `code`), when the error came from the server. */
16057
+ readonly serverCode?: string;
13877
16058
  readonly message: string;
13878
16059
  readonly resource: {
13879
16060
  readonly kind: string;
@@ -13882,11 +16063,15 @@ export interface NotFoundError {
13882
16063
  }
13883
16064
  export interface ConflictError {
13884
16065
  readonly code: "conflict";
16066
+ /** The server's own error code (the wire `code`), when the error came from the server. */
16067
+ readonly serverCode?: string;
13885
16068
  readonly message: string;
13886
16069
  readonly reason: string;
13887
16070
  }
13888
16071
  export interface InvalidRequestError {
13889
16072
  readonly code: "invalid-request";
16073
+ /** The server's own error code (the wire `code`), when the error came from the server. */
16074
+ readonly serverCode?: string;
13890
16075
  readonly message: string;
13891
16076
  /** JSON-pointer issues, matching the shape used across `packages/*` validators. */
13892
16077
  readonly issues: readonly {
@@ -13901,6 +16086,8 @@ export interface InvalidRequestError {
13901
16086
  */
13902
16087
  export interface GuardrailViolationError {
13903
16088
  readonly code: "guardrail-violation";
16089
+ /** The server's own error code (the wire `code`), when the error came from the server. */
16090
+ readonly serverCode?: string;
13904
16091
  readonly message: string;
13905
16092
  readonly violations: readonly GuardrailViolation[];
13906
16093
  /**
@@ -13926,12 +16113,14 @@ export interface GuardrailViolation {
13926
16113
  /**
13927
16114
  * Passthrough for server-side errors that have no dedicated SDK
13928
16115
  * variant (for example `KernelError` or `MemoryError` codes). `fromWire`
13929
- * maps any unrecognized wire `code` to `{ code: 'server', serverCode:
13930
- * <wire code>, message, fields: <wire details> }`.
16116
+ * maps a wire `code` it doesn't list to `{ code: 'server', serverCode:
16117
+ * <wire code>, message, fields: <wire details> }` — unless its HTTP
16118
+ * status names a family (404/410 not-found, 401/403 auth, 429
16119
+ * rate-limited, 400 invalid request; 409 and 422 stay `server`).
13931
16120
  *
13932
16121
  * Callers match `err.code === 'server' && err.serverCode === '...'` to
13933
- * handle specific primitive errors. Keeps the SDK's top-level `code`
13934
- * space small while preserving fidelity.
16122
+ * handle specific primitive errors. Every error from the server carries
16123
+ * `serverCode`, so matching on it alone works whatever the family.
13935
16124
  */
13936
16125
  export interface ServerError {
13937
16126
  readonly code: "server";
@@ -13973,13 +16162,16 @@ export declare function notYetWired(method: string, reason: string): NotYetWired
13973
16162
  * `{ code, message, details?, requestId }` inside its `{ error }`
13974
16163
  * envelope, which the transport unwraps before calling this. This
13975
16164
  * function reads `code` and projects the rest of the object (including
13976
- * `details`) into the matching variant. Unknown codes fall back to
13977
- * `ServerError` with the raw code preserved as `serverCode` — later SDK
13978
- * releases can add explicit variants without breaking older consumers.
16165
+ * `details`) into the matching variant. A code this client doesn't list
16166
+ * (a newer server's) is read by the HTTP `status` instead: 404/410 a
16167
+ * not-found, 400 an invalid request, 401/403 an auth error, 429
16168
+ * rate-limited. 409 and 422 stay `ServerError`: the docs match their
16169
+ * codes there (`budget-exceeded`, `agent-version-mismatch`). Every
16170
+ * error from the server keeps the raw code as `serverCode`.
13979
16171
  *
13980
16172
  * `code` is the discriminant.
13981
16173
  */
13982
- export declare function fromWire(body: unknown): KindgiError;
16174
+ export declare function fromWire(body: unknown, status?: number): KindgiError;
13983
16175
  /**
13984
16176
  * Wrap a wire error as a JS `Error` so it can be `throw`n by SDK
13985
16177
  * methods. The typed payload rides on the `.error` property; callers