@kindgi/api 0.1.4-rc.1 → 0.1.4-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-binding.d.ts +12 -2
- package/dist/agent-binding.d.ts.map +1 -1
- package/dist/agent-pins.d.ts.map +1 -1
- package/dist/agent-pins.js +4 -1
- package/dist/agent-pins.js.map +1 -1
- package/dist/app.d.ts +8 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +23 -4
- package/dist/app.js.map +1 -1
- package/dist/deploy-versions.d.ts +8 -5
- package/dist/deploy-versions.d.ts.map +1 -1
- package/dist/deploy-versions.js +3 -9
- package/dist/deploy-versions.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -1
- package/dist/eval-case-binding.d.ts +10 -0
- package/dist/eval-case-binding.d.ts.map +1 -1
- package/dist/eval-run-binding.d.ts +14 -3
- package/dist/eval-run-binding.d.ts.map +1 -1
- package/dist/eval-run-binding.js.map +1 -1
- package/dist/flow-pins.d.ts +20 -7
- package/dist/flow-pins.d.ts.map +1 -1
- package/dist/flow-pins.js +36 -11
- package/dist/flow-pins.js.map +1 -1
- package/dist/gate-policy-binding.d.ts +164 -0
- package/dist/gate-policy-binding.d.ts.map +1 -0
- package/dist/gate-policy-binding.js +12 -0
- package/dist/gate-policy-binding.js.map +1 -0
- package/dist/gate.d.ts +56 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +359 -0
- package/dist/gate.js.map +1 -0
- package/dist/handler-binding.d.ts +14 -2
- package/dist/handler-binding.d.ts.map +1 -1
- package/dist/hitl-binding.d.ts +5 -0
- package/dist/hitl-binding.d.ts.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/judged-dispatcher.d.ts +16 -1
- package/dist/judged-dispatcher.d.ts.map +1 -1
- package/dist/judged-dispatcher.js +45 -6
- package/dist/judged-dispatcher.js.map +1 -1
- package/dist/judgment-binding.d.ts +38 -0
- package/dist/judgment-binding.d.ts.map +1 -1
- package/dist/judgment-binding.js +19 -0
- package/dist/judgment-binding.js.map +1 -1
- package/dist/live-version-binding.d.ts +206 -0
- package/dist/live-version-binding.d.ts.map +1 -0
- package/dist/live-version-binding.js +4 -0
- package/dist/live-version-binding.js.map +1 -0
- package/dist/middleware/authorize.d.ts.map +1 -1
- package/dist/middleware/authorize.js +13 -2
- package/dist/middleware/authorize.js.map +1 -1
- package/dist/middleware/project-ref.d.ts +25 -0
- package/dist/middleware/project-ref.d.ts.map +1 -0
- package/dist/middleware/project-ref.js +72 -0
- package/dist/middleware/project-ref.js.map +1 -0
- package/dist/openapi/generate.d.ts.map +1 -1
- package/dist/openapi/generate.js +4 -0
- package/dist/openapi/generate.js.map +1 -1
- package/dist/openapi/operations.d.ts +6 -0
- package/dist/openapi/operations.d.ts.map +1 -1
- package/dist/openapi/operations.js +512 -22
- package/dist/openapi/operations.js.map +1 -1
- package/dist/openapi/schemas.d.ts +37 -0
- package/dist/openapi/schemas.d.ts.map +1 -1
- package/dist/openapi/schemas.js +709 -5
- package/dist/openapi/schemas.js.map +1 -1
- package/dist/publish-refused.d.ts +18 -0
- package/dist/publish-refused.d.ts.map +1 -0
- package/dist/publish-refused.js +22 -0
- package/dist/publish-refused.js.map +1 -0
- package/dist/retention-binding.d.ts +29 -0
- package/dist/retention-binding.d.ts.map +1 -1
- package/dist/routes/agent-releases.d.ts +40 -0
- package/dist/routes/agent-releases.d.ts.map +1 -0
- package/dist/routes/agent-releases.js +462 -0
- package/dist/routes/agent-releases.js.map +1 -0
- package/dist/routes/agents.d.ts +7 -1
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/agents.js +31 -3
- package/dist/routes/agents.js.map +1 -1
- package/dist/routes/approvals.d.ts.map +1 -1
- package/dist/routes/approvals.js +40 -9
- package/dist/routes/approvals.js.map +1 -1
- package/dist/routes/audit.d.ts.map +1 -1
- package/dist/routes/audit.js +7 -0
- package/dist/routes/audit.js.map +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/auth.js.map +1 -1
- package/dist/routes/conversations.d.ts +0 -7
- package/dist/routes/conversations.d.ts.map +1 -1
- package/dist/routes/conversations.js +19 -3
- package/dist/routes/conversations.js.map +1 -1
- package/dist/routes/deployments.d.ts +6 -0
- package/dist/routes/deployments.d.ts.map +1 -1
- package/dist/routes/deployments.js +33 -5
- package/dist/routes/deployments.js.map +1 -1
- package/dist/routes/env.d.ts.map +1 -1
- package/dist/routes/env.js +1 -0
- package/dist/routes/env.js.map +1 -1
- package/dist/routes/eval-comparison.d.ts +2 -1
- package/dist/routes/eval-comparison.d.ts.map +1 -1
- package/dist/routes/eval-comparison.js +22 -9
- package/dist/routes/eval-comparison.js.map +1 -1
- package/dist/routes/flows.d.ts +14 -7
- package/dist/routes/flows.d.ts.map +1 -1
- package/dist/routes/flows.js +10 -8
- package/dist/routes/flows.js.map +1 -1
- package/dist/routes/gate-policies.d.ts +19 -0
- package/dist/routes/gate-policies.d.ts.map +1 -0
- package/dist/routes/gate-policies.js +191 -0
- package/dist/routes/gate-policies.js.map +1 -0
- package/dist/routes/gate-policy-spec.d.ts +17 -0
- package/dist/routes/gate-policy-spec.d.ts.map +1 -0
- package/dist/routes/gate-policy-spec.js +192 -0
- package/dist/routes/gate-policy-spec.js.map +1 -0
- package/dist/routes/gate-policy-wire.d.ts +3 -0
- package/dist/routes/gate-policy-wire.d.ts.map +1 -0
- package/dist/routes/gate-policy-wire.js +18 -0
- package/dist/routes/gate-policy-wire.js.map +1 -0
- package/dist/routes/hierarchy-errors.d.ts +11 -0
- package/dist/routes/hierarchy-errors.d.ts.map +1 -1
- package/dist/routes/hierarchy-errors.js +13 -0
- package/dist/routes/hierarchy-errors.js.map +1 -1
- package/dist/routes/judged-suites.js +7 -0
- package/dist/routes/judged-suites.js.map +1 -1
- package/dist/routes/judgments.d.ts +4 -1
- package/dist/routes/judgments.d.ts.map +1 -1
- package/dist/routes/judgments.js +92 -19
- package/dist/routes/judgments.js.map +1 -1
- package/dist/routes/live-scope-wire.d.ts +32 -0
- package/dist/routes/live-scope-wire.d.ts.map +1 -0
- package/dist/routes/live-scope-wire.js +71 -0
- package/dist/routes/live-scope-wire.js.map +1 -0
- package/dist/routes/policies.d.ts +6 -3
- package/dist/routes/policies.d.ts.map +1 -1
- package/dist/routes/policies.js +55 -3
- package/dist/routes/policies.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +47 -3
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/retention.d.ts.map +1 -1
- package/dist/routes/retention.js +18 -2
- package/dist/routes/retention.js.map +1 -1
- package/dist/routes/reviewers.d.ts +8 -1
- package/dist/routes/reviewers.d.ts.map +1 -1
- package/dist/routes/reviewers.js +20 -3
- package/dist/routes/reviewers.js.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +22 -13
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/secrets.d.ts.map +1 -1
- package/dist/routes/secrets.js +2 -0
- package/dist/routes/secrets.js.map +1 -1
- package/dist/routes/segments.d.ts +17 -0
- package/dist/routes/segments.d.ts.map +1 -0
- package/dist/routes/segments.js +68 -0
- package/dist/routes/segments.js.map +1 -0
- package/dist/routes/teams.d.ts.map +1 -1
- package/dist/routes/teams.js +42 -3
- package/dist/routes/teams.js.map +1 -1
- package/dist/routes/uuid-param.d.ts +11 -0
- package/dist/routes/uuid-param.d.ts.map +1 -0
- package/dist/routes/uuid-param.js +19 -0
- package/dist/routes/uuid-param.js.map +1 -0
- package/openapi.json +7008 -3624
- package/package.json +21 -21
- package/src/agent-binding.ts +12 -2
- package/src/agent-pins.ts +3 -1
- package/src/app.ts +37 -3
- package/src/deploy-versions.ts +11 -14
- package/src/errors.ts +25 -0
- package/src/eval-case-binding.ts +7 -0
- package/src/eval-run-binding.ts +24 -3
- package/src/flow-pins.ts +49 -9
- package/src/gate-policy-binding.ts +171 -0
- package/src/gate.ts +467 -0
- package/src/handler-binding.ts +14 -2
- package/src/hitl-binding.ts +5 -0
- package/src/index.ts +46 -1
- package/src/judged-dispatcher.ts +74 -6
- package/src/judgment-binding.ts +62 -0
- package/src/live-version-binding.ts +237 -0
- package/src/middleware/authorize.ts +18 -2
- package/src/middleware/project-ref.ts +88 -0
- package/src/openapi/generate.ts +5 -0
- package/src/openapi/operations.ts +619 -22
- package/src/openapi/schemas.ts +788 -5
- package/src/publish-refused.ts +31 -0
- package/src/retention-binding.ts +30 -0
- package/src/routes/agent-releases.ts +581 -0
- package/src/routes/agents.ts +43 -2
- package/src/routes/approvals.ts +58 -8
- package/src/routes/audit.ts +10 -0
- package/src/routes/auth.ts +1 -1
- package/src/routes/conversations.ts +31 -3
- package/src/routes/deployments.ts +50 -5
- package/src/routes/env.ts +1 -0
- package/src/routes/eval-comparison.ts +24 -10
- package/src/routes/flows.ts +27 -11
- package/src/routes/gate-policies.ts +226 -0
- package/src/routes/gate-policy-spec.ts +229 -0
- package/src/routes/gate-policy-wire.ts +20 -0
- package/src/routes/hierarchy-errors.ts +14 -0
- package/src/routes/judged-suites.ts +5 -0
- package/src/routes/judgments.ts +107 -23
- package/src/routes/live-scope-wire.ts +90 -0
- package/src/routes/policies.ts +61 -3
- package/src/routes/projects.ts +54 -2
- package/src/routes/retention.ts +21 -2
- package/src/routes/reviewers.ts +23 -4
- package/src/routes/runs.ts +33 -20
- package/src/routes/secrets.ts +2 -0
- package/src/routes/segments.ts +75 -0
- package/src/routes/teams.ts +53 -3
- package/src/routes/uuid-param.ts +28 -0
|
@@ -91,6 +91,13 @@ const RunReplaysQueryParam = {
|
|
|
91
91
|
description: 'Replay runs (an eval run re-running a past run). `exclude` (default) leaves them out; `include` lists them with the other runs; `only` lists just them.',
|
|
92
92
|
schema: { type: 'string', enum: ['exclude', 'include', 'only'], default: 'exclude' },
|
|
93
93
|
};
|
|
94
|
+
const ConversationReplaysQueryParam = {
|
|
95
|
+
name: 'replays',
|
|
96
|
+
in: 'query',
|
|
97
|
+
required: false,
|
|
98
|
+
description: "Replay conversations (opened by a comparison's replay turn; `metadata.replayOf` names the run it replays). `exclude` (default) leaves them out; `include` lists them with the others; `only` lists just them.",
|
|
99
|
+
schema: { type: 'string', enum: ['exclude', 'include', 'only'], default: 'exclude' },
|
|
100
|
+
};
|
|
94
101
|
const RunEvalRunIdQueryParam = {
|
|
95
102
|
name: 'evalRunId',
|
|
96
103
|
in: 'query',
|
|
@@ -98,6 +105,34 @@ const RunEvalRunIdQueryParam = {
|
|
|
98
105
|
description: 'Only the replay runs of this eval run. Implies replays are included; cannot be combined with `replays=exclude`.',
|
|
99
106
|
schema: { type: 'string', minLength: 1 },
|
|
100
107
|
};
|
|
108
|
+
const LiveProjectQueryParam = {
|
|
109
|
+
name: 'projectId',
|
|
110
|
+
in: 'query',
|
|
111
|
+
required: false,
|
|
112
|
+
description: "The run's project; omit → only the agent's tenant-wide pin applies.",
|
|
113
|
+
schema: { type: 'string', format: 'uuid' },
|
|
114
|
+
};
|
|
115
|
+
const SegmentQueryParam = {
|
|
116
|
+
name: 'segment',
|
|
117
|
+
in: 'query',
|
|
118
|
+
required: false,
|
|
119
|
+
description: 'One step of the segment path, `key:value`; repeat it in order, coarse to fine.',
|
|
120
|
+
schema: { type: 'array', items: { type: 'string' } },
|
|
121
|
+
segmentPath: true,
|
|
122
|
+
};
|
|
123
|
+
const PromotionScopeKindQueryParam = {
|
|
124
|
+
name: 'scopeKind',
|
|
125
|
+
in: 'query',
|
|
126
|
+
required: false,
|
|
127
|
+
description: 'Only one scope: `tenant`, `org` or `project` (with `scopeId`), or `segment` (with `scopeId` and `segment`).',
|
|
128
|
+
schema: { type: 'string', enum: ['tenant', 'org', 'project', 'segment'] },
|
|
129
|
+
};
|
|
130
|
+
const PromotionIdPathParam = {
|
|
131
|
+
name: 'promotionId',
|
|
132
|
+
in: 'path',
|
|
133
|
+
required: true,
|
|
134
|
+
schema: { type: 'string', format: 'uuid' },
|
|
135
|
+
};
|
|
101
136
|
const RunIncludeQueryParam = {
|
|
102
137
|
name: 'include',
|
|
103
138
|
in: 'query',
|
|
@@ -126,6 +161,20 @@ const LastEventIdParam = {
|
|
|
126
161
|
description: 'Resume marker (`<runId>:<sequence>`). Server replays events with `sequence > lastSeen` before entering live-poll.',
|
|
127
162
|
schema: { type: 'string' },
|
|
128
163
|
};
|
|
164
|
+
const GatePolicyIdPathParam = {
|
|
165
|
+
name: 'policyId',
|
|
166
|
+
in: 'path',
|
|
167
|
+
required: true,
|
|
168
|
+
description: 'The gate policy id.',
|
|
169
|
+
schema: { type: 'string' },
|
|
170
|
+
};
|
|
171
|
+
const GatePolicyVersionPathParam = {
|
|
172
|
+
name: 'version',
|
|
173
|
+
in: 'path',
|
|
174
|
+
required: true,
|
|
175
|
+
description: 'A semver version of the gate policy.',
|
|
176
|
+
schema: { type: 'string' },
|
|
177
|
+
};
|
|
129
178
|
const AgentIdPathParam = {
|
|
130
179
|
name: 'agentId',
|
|
131
180
|
in: 'path',
|
|
@@ -231,6 +280,13 @@ const ApprovalRequiredRoleQueryParam = {
|
|
|
231
280
|
description: 'Filter by required reviewer role. Caller must have a rank ≥ the value — else 403.',
|
|
232
281
|
schema: { $ref: '#/components/schemas/ReviewerRole' },
|
|
233
282
|
};
|
|
283
|
+
const WaitTokenIdQueryParam = {
|
|
284
|
+
name: 'waitTokenId',
|
|
285
|
+
in: 'query',
|
|
286
|
+
required: false,
|
|
287
|
+
description: "Only approvals linked to one of these run waits (an approval's `waitTokenId`; a run's journal names its open waits in `wait.suspended` entries). Repeat it for several, at most 50.",
|
|
288
|
+
schema: { type: 'array', items: { type: 'string', minLength: 1 }, maxItems: 50 },
|
|
289
|
+
};
|
|
234
290
|
const CreatedAfterQueryParam = {
|
|
235
291
|
name: 'createdAfter',
|
|
236
292
|
in: 'query',
|
|
@@ -271,6 +327,34 @@ const SupervisorIdQueryParam = {
|
|
|
271
327
|
required: false,
|
|
272
328
|
schema: { type: 'string' },
|
|
273
329
|
};
|
|
330
|
+
const ObservationAgentVersionQueryParam = {
|
|
331
|
+
name: 'agentVersion',
|
|
332
|
+
in: 'query',
|
|
333
|
+
required: false,
|
|
334
|
+
description: 'Only the observations of this agent version (with `agentId`).',
|
|
335
|
+
schema: { type: 'string' },
|
|
336
|
+
};
|
|
337
|
+
const ObservationConversationIdQueryParam = {
|
|
338
|
+
name: 'conversationId',
|
|
339
|
+
in: 'query',
|
|
340
|
+
required: false,
|
|
341
|
+
description: 'Only the observations of turns in this conversation.',
|
|
342
|
+
schema: { type: 'string' },
|
|
343
|
+
};
|
|
344
|
+
const ObservationSinceQueryParam = {
|
|
345
|
+
name: 'since',
|
|
346
|
+
in: 'query',
|
|
347
|
+
required: false,
|
|
348
|
+
description: 'Only the observations at or after this time (ISO 8601).',
|
|
349
|
+
schema: { type: 'string', format: 'date-time' },
|
|
350
|
+
};
|
|
351
|
+
const ObservationUntilQueryParam = {
|
|
352
|
+
name: 'until',
|
|
353
|
+
in: 'query',
|
|
354
|
+
required: false,
|
|
355
|
+
description: 'Only the observations at or before this time (ISO 8601).',
|
|
356
|
+
schema: { type: 'string', format: 'date-time' },
|
|
357
|
+
};
|
|
274
358
|
const FactIdPathParam = {
|
|
275
359
|
name: 'factId',
|
|
276
360
|
in: 'path',
|
|
@@ -345,7 +429,7 @@ const ProvenanceAgentIdQueryParam = {
|
|
|
345
429
|
name: 'agentId',
|
|
346
430
|
in: 'query',
|
|
347
431
|
required: false,
|
|
348
|
-
description:
|
|
432
|
+
description: "Only the records of this agent's turns, at any version: the agent the record's run names, as `GET /v1/runs?agentId=` matches it. Turns that ran before Kindgi 0.1.3 don't name their agent and aren't matched.",
|
|
349
433
|
schema: { type: 'string' },
|
|
350
434
|
};
|
|
351
435
|
const ProvenanceCreatedAfterQueryParam = {
|
|
@@ -603,7 +687,7 @@ const PolicyKindFilterQueryParam = {
|
|
|
603
687
|
name: 'kind',
|
|
604
688
|
in: 'query',
|
|
605
689
|
required: false,
|
|
606
|
-
description: 'Filter to policies of a single kind. Values: `access-control | model-routing | adapter-allowlist | rate-limit | retention | compliance`.',
|
|
690
|
+
description: 'Filter to policies of a single kind. Values: `access-control | model-routing | adapter-allowlist | rate-limit | retention | compliance | tool-errors | hitl`.',
|
|
607
691
|
schema: { $ref: '#/components/schemas/PolicyKind' },
|
|
608
692
|
};
|
|
609
693
|
const PolicyNameFilterQueryParam = {
|
|
@@ -613,6 +697,28 @@ const PolicyNameFilterQueryParam = {
|
|
|
613
697
|
description: 'Prefix match on `Policy.id`. Dotted namespaces are the natural filter shape.',
|
|
614
698
|
schema: { type: 'string' },
|
|
615
699
|
};
|
|
700
|
+
// Admin plane — retention.
|
|
701
|
+
const RetentionDomainQueryParam = {
|
|
702
|
+
name: 'domain',
|
|
703
|
+
in: 'query',
|
|
704
|
+
required: false,
|
|
705
|
+
description: 'Only this domain. Absent: every domain.',
|
|
706
|
+
schema: { $ref: '#/components/schemas/RetentionDomain' },
|
|
707
|
+
};
|
|
708
|
+
const RetentionPastGraceOnlyQueryParam = {
|
|
709
|
+
name: 'pastGraceOnly',
|
|
710
|
+
in: 'query',
|
|
711
|
+
required: false,
|
|
712
|
+
description: '`true`: only rows past their grace, the ones a sweep would purge now.',
|
|
713
|
+
schema: { type: 'boolean', default: false },
|
|
714
|
+
};
|
|
715
|
+
const RetentionDomainPathParam = {
|
|
716
|
+
name: 'domain',
|
|
717
|
+
in: 'path',
|
|
718
|
+
required: true,
|
|
719
|
+
description: 'The domain to sweep (not `*`).',
|
|
720
|
+
schema: { $ref: '#/components/schemas/RetentionDomain' },
|
|
721
|
+
};
|
|
616
722
|
// Admin plane — eval suites.
|
|
617
723
|
const EvalSuiteIdPathParam = {
|
|
618
724
|
name: 'suiteId',
|
|
@@ -887,8 +993,9 @@ export const OPERATIONS = [
|
|
|
887
993
|
schema: ref('Run'),
|
|
888
994
|
},
|
|
889
995
|
...CommonMutationErrors,
|
|
890
|
-
'404': ErrorResponse('Agent or flow not found.'),
|
|
996
|
+
'404': ErrorResponse('Agent or flow not found; or `projectId` names no project of this tenant (`project-not-found`).'),
|
|
891
997
|
'422': ErrorResponse('Guardrail violation or budget exceeded.'),
|
|
998
|
+
'400': ErrorResponse("Malformed request body, or the body's `projectId` isn't a project id (a UUID)."),
|
|
892
999
|
},
|
|
893
1000
|
},
|
|
894
1001
|
{
|
|
@@ -1144,6 +1251,8 @@ export const OPERATIONS = [
|
|
|
1144
1251
|
'201': { description: 'Token minted.', schema: ref('MintTokenResult') },
|
|
1145
1252
|
...CommonMutationErrors,
|
|
1146
1253
|
'403': ErrorResponse('Not a tenant admin, or a capability the caller does not hold.'),
|
|
1254
|
+
'400': ErrorResponse("Malformed request body, or the body's `projectId` isn't a project id (a UUID)."),
|
|
1255
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
1147
1256
|
},
|
|
1148
1257
|
},
|
|
1149
1258
|
{
|
|
@@ -1234,6 +1343,7 @@ export const OPERATIONS = [
|
|
|
1234
1343
|
ApprovalStatusQueryParam,
|
|
1235
1344
|
ApprovalRequiredRoleQueryParam,
|
|
1236
1345
|
CreatedAfterQueryParam,
|
|
1346
|
+
WaitTokenIdQueryParam,
|
|
1237
1347
|
],
|
|
1238
1348
|
responses: {
|
|
1239
1349
|
'200': { description: 'Page of approvals.', schema: ref('ApprovalCollectionPage') },
|
|
@@ -1326,6 +1436,7 @@ export const OPERATIONS = [
|
|
|
1326
1436
|
responses: {
|
|
1327
1437
|
'201': { description: 'Reviewer registered.', schema: ref('Reviewer') },
|
|
1328
1438
|
...CommonMutationErrors,
|
|
1439
|
+
'403': ErrorResponse('With authorization enforced, the caller is not an admin of the tenant.'),
|
|
1329
1440
|
},
|
|
1330
1441
|
},
|
|
1331
1442
|
{
|
|
@@ -1342,6 +1453,7 @@ export const OPERATIONS = [
|
|
|
1342
1453
|
'200': { description: 'Unregistered.', schema: ref('UnregisterReviewerResult') },
|
|
1343
1454
|
...CommonMutationErrors,
|
|
1344
1455
|
'404': ErrorResponse('No reviewer with that id under this tenant.'),
|
|
1456
|
+
'403': ErrorResponse('With authorization enforced, the caller is not an admin of the tenant.'),
|
|
1345
1457
|
},
|
|
1346
1458
|
},
|
|
1347
1459
|
{
|
|
@@ -1436,8 +1548,8 @@ export const OPERATIONS = [
|
|
|
1436
1548
|
'201': { description: 'The derived agent version.', schema: ref('Agent') },
|
|
1437
1549
|
...CommonMutationErrors,
|
|
1438
1550
|
'409': ErrorResponse("Idempotency-Key was reused with a different body, or resource-state conflict. Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead."),
|
|
1439
|
-
'400': ErrorResponse("`validation-failed`: `from` has no pins, a swap names a block it doesn't reference, or a version that isn't published, active or the right kind (see `details.issues`)."),
|
|
1440
|
-
'404': ErrorResponse('`agent-not-found`: no agent at `from
|
|
1551
|
+
'400': ErrorResponse("`validation-failed`: `from` has no pins, a swap names a block it doesn't reference, or a version that isn't published, active or the right kind (see `details.issues`); or `projectId` isn't a project id (a UUID)."),
|
|
1552
|
+
'404': ErrorResponse('`agent-not-found`: no agent at `from`; or `projectId` names no project of this tenant (`project-not-found`).'),
|
|
1441
1553
|
},
|
|
1442
1554
|
},
|
|
1443
1555
|
{
|
|
@@ -1469,8 +1581,9 @@ export const OPERATIONS = [
|
|
|
1469
1581
|
responses: {
|
|
1470
1582
|
'201': { description: 'Agent published.', schema: ref('PublishAgentResult') },
|
|
1471
1583
|
...CommonMutationErrors,
|
|
1472
|
-
'400': ErrorResponse(
|
|
1584
|
+
'400': ErrorResponse("Validation failed (see `details.issues`); or `projectId` isn't a project id (a UUID)."),
|
|
1473
1585
|
'409': ErrorResponse("Agent already registered at that (id, version). Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead."),
|
|
1586
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
1474
1587
|
},
|
|
1475
1588
|
},
|
|
1476
1589
|
{
|
|
@@ -1485,7 +1598,7 @@ export const OPERATIONS = [
|
|
|
1485
1598
|
responses: {
|
|
1486
1599
|
'200': { description: 'Unregistered.', schema: ref('UnregisterAgentResult') },
|
|
1487
1600
|
...CommonMutationErrors,
|
|
1488
|
-
'409': ErrorResponse("Idempotency-Key was reused with a different body, or resource-state conflict. Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead."),
|
|
1601
|
+
'409': ErrorResponse("Idempotency-Key was reused with a different body, or resource-state conflict. Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead. Or `agent-version-live`: the version is the live version of the scopes in `details.scopes`; roll back, unpin, or promote another version there first."),
|
|
1489
1602
|
'404': ErrorResponse('No agent at that (id, version) under this tenant.'),
|
|
1490
1603
|
},
|
|
1491
1604
|
},
|
|
@@ -1506,6 +1619,300 @@ export const OPERATIONS = [
|
|
|
1506
1619
|
'404': ErrorResponse('No agent at that (id, version) under this tenant.'),
|
|
1507
1620
|
},
|
|
1508
1621
|
},
|
|
1622
|
+
{
|
|
1623
|
+
method: 'get',
|
|
1624
|
+
honoPath: '/v1/agents/:agentId/live',
|
|
1625
|
+
openapiPath: '/v1/agents/{agentId}/live',
|
|
1626
|
+
operationId: 'agents.live.resolve',
|
|
1627
|
+
summary: 'The version a run would use',
|
|
1628
|
+
description: "Resolves the version a run of this agent would use for a project and segment path: the most specific live version (segment path, project, org, tenant), else the latest registered. A run that names its version, or a follow-up turn in a conversation, isn't resolved this way.",
|
|
1629
|
+
tags: ['agents'],
|
|
1630
|
+
security: 'bearer',
|
|
1631
|
+
parameters: [AgentIdPathParam, LiveProjectQueryParam, SegmentQueryParam],
|
|
1632
|
+
responses: {
|
|
1633
|
+
'200': { description: 'The resolved version.', schema: ref('LiveVersionResolution') },
|
|
1634
|
+
...CommonAuthErrors,
|
|
1635
|
+
'400': ErrorResponse('A malformed project id or segment, or a segment without a project.'),
|
|
1636
|
+
'404': ErrorResponse('No agent with that id.'),
|
|
1637
|
+
},
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
method: 'get',
|
|
1641
|
+
honoPath: '/v1/agents/:agentId/live-versions',
|
|
1642
|
+
openapiPath: '/v1/agents/{agentId}/live-versions',
|
|
1643
|
+
operationId: 'agents.live.list',
|
|
1644
|
+
summary: "List an agent's live versions",
|
|
1645
|
+
description: 'Every scope with a live version pinned, and the promotion that set it.',
|
|
1646
|
+
tags: ['agents'],
|
|
1647
|
+
security: 'bearer',
|
|
1648
|
+
parameters: [AgentIdPathParam],
|
|
1649
|
+
responses: {
|
|
1650
|
+
'200': { description: 'The pins.', schema: ref('LivePinList') },
|
|
1651
|
+
...CommonAuthErrors,
|
|
1652
|
+
},
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
method: 'post',
|
|
1656
|
+
honoPath: '/v1/agents/:agentId/promotions',
|
|
1657
|
+
openapiPath: '/v1/agents/{agentId}/promotions',
|
|
1658
|
+
operationId: 'agents.promotions.create',
|
|
1659
|
+
summary: 'Make a version live for a scope',
|
|
1660
|
+
description: "Pins `version` live for `scope`: runs in that scope that don't name a version use it, from the next run. Open conversations keep their version. The version must be registered and active. Every promotion is recorded, with who asked and why. Needs `promote` on the agent.\n\nWith a gate policy for the scope (`GET …/gate-policy`), the promotion is checked first against the comparison named by `evalRunId`: `201` promoted; `202` the gate passed and the policy wants a reviewer's approval (a HITL approval, subject `agent-promotion`; the live version moves once it's approved, if nothing changed meanwhile); `422 gate-failed` with `details.promotionId`, `details.policy` and every check in `details.checks`. A refused promotion is recorded too.",
|
|
1661
|
+
tags: ['agents'],
|
|
1662
|
+
security: 'bearer',
|
|
1663
|
+
parameters: [AgentIdPathParam, IdempotencyKeyParam],
|
|
1664
|
+
requestBody: { required: true, schema: ref('PromoteBody') },
|
|
1665
|
+
responses: {
|
|
1666
|
+
'201': { description: 'Promoted.', schema: ref('Promotion') },
|
|
1667
|
+
'202': {
|
|
1668
|
+
description: 'The gate passed; the promotion waits for an approval (`approvalId`).',
|
|
1669
|
+
schema: ref('Promotion'),
|
|
1670
|
+
},
|
|
1671
|
+
...CommonMutationErrors,
|
|
1672
|
+
'404': ErrorResponse('The version is not registered, or was unregistered; or the eval run is not found.'),
|
|
1673
|
+
'409': ErrorResponse("`promotion-superseded`: the scope's live version changed while the gate ran; check again."),
|
|
1674
|
+
'422': ErrorResponse('`gate-failed`: the gate refused it. `details.checks` has every check; the refusal is recorded (`details.promotionId`).'),
|
|
1675
|
+
'501': ErrorResponse("`promotion-gate-unsupported`: a gate policy applies, and the deployment can't record a gated promotion."),
|
|
1676
|
+
},
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
method: 'post',
|
|
1680
|
+
honoPath: '/v1/agents/:agentId/promotions/check',
|
|
1681
|
+
openapiPath: '/v1/agents/{agentId}/promotions/check',
|
|
1682
|
+
operationId: 'agents.promotions.check',
|
|
1683
|
+
summary: 'Check a promotion against its gate',
|
|
1684
|
+
description: 'What `POST …/promotions` with the same body would do, with nothing recorded: `would-promote`, `needs-approval` (with the approval it needs) or `gate-failed`, with every check. For a pipeline: evaluate, check, promote. Needs `read` on the agent.',
|
|
1685
|
+
tags: ['agents'],
|
|
1686
|
+
security: 'bearer',
|
|
1687
|
+
parameters: [AgentIdPathParam],
|
|
1688
|
+
requestBody: { required: true, schema: ref('PromoteBody') },
|
|
1689
|
+
responses: {
|
|
1690
|
+
'200': { description: "The gate's answer.", schema: ref('PromotionCheck') },
|
|
1691
|
+
...CommonAuthErrors,
|
|
1692
|
+
'400': ErrorResponse('Malformed body, or the eval run is not a finished comparison.'),
|
|
1693
|
+
'404': ErrorResponse('The version, the agent or the eval run is not found.'),
|
|
1694
|
+
},
|
|
1695
|
+
},
|
|
1696
|
+
{
|
|
1697
|
+
method: 'get',
|
|
1698
|
+
honoPath: '/v1/agents/:agentId/gate-policy',
|
|
1699
|
+
openapiPath: '/v1/agents/{agentId}/gate-policy',
|
|
1700
|
+
operationId: 'agents.gatePolicy.resolve',
|
|
1701
|
+
summary: 'The gate policy for a scope',
|
|
1702
|
+
description: "The gate policy a promotion of the agent for the scope would be checked against: the most specific scope with an active policy (a segment path's longer prefixes first, then its project, the project's org, the tenant), at its latest active version. `policy: null` when none applies.",
|
|
1703
|
+
tags: ['agents'],
|
|
1704
|
+
security: 'bearer',
|
|
1705
|
+
parameters: [
|
|
1706
|
+
AgentIdPathParam,
|
|
1707
|
+
PromotionScopeKindQueryParam,
|
|
1708
|
+
ScopeIdQueryParam,
|
|
1709
|
+
SegmentQueryParam,
|
|
1710
|
+
],
|
|
1711
|
+
responses: {
|
|
1712
|
+
'200': { description: 'The policy, or null.', schema: ref('GatePolicyResolution') },
|
|
1713
|
+
...CommonAuthErrors,
|
|
1714
|
+
'400': ErrorResponse('Missing or malformed scope.'),
|
|
1715
|
+
},
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
method: 'get',
|
|
1719
|
+
honoPath: '/v1/gate-policies',
|
|
1720
|
+
openapiPath: '/v1/gate-policies',
|
|
1721
|
+
operationId: 'gatePolicies.list',
|
|
1722
|
+
summary: 'List gate policies',
|
|
1723
|
+
description: "Each gate policy's latest active version. `agentId` narrows it to one agent's; `scopeKind` (with `scopeId` and `segment`) to one scope's.",
|
|
1724
|
+
tags: ['gate-policies'],
|
|
1725
|
+
security: 'bearer',
|
|
1726
|
+
parameters: [
|
|
1727
|
+
LimitQueryParam,
|
|
1728
|
+
CursorQueryParam,
|
|
1729
|
+
{
|
|
1730
|
+
name: 'agentId',
|
|
1731
|
+
in: 'query',
|
|
1732
|
+
required: false,
|
|
1733
|
+
description: 'Only the policies gating this agent.',
|
|
1734
|
+
schema: { type: 'string' },
|
|
1735
|
+
},
|
|
1736
|
+
PromotionScopeKindQueryParam,
|
|
1737
|
+
ScopeIdQueryParam,
|
|
1738
|
+
SegmentQueryParam,
|
|
1739
|
+
],
|
|
1740
|
+
responses: {
|
|
1741
|
+
'200': { description: 'Page of gate policies.', schema: ref('GatePolicyPage') },
|
|
1742
|
+
...CommonAuthErrors,
|
|
1743
|
+
'400': ErrorResponse('Malformed scope or cursor.'),
|
|
1744
|
+
},
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
method: 'post',
|
|
1748
|
+
honoPath: '/v1/gate-policies',
|
|
1749
|
+
openapiPath: '/v1/gate-policies',
|
|
1750
|
+
operationId: 'gatePolicies.publish',
|
|
1751
|
+
summary: 'Publish a gate policy',
|
|
1752
|
+
description: "Registers a gate policy, or a new version of one: what a promotion of `agentId` for `scope` must show. One policy per agent and scope: another policy id for a scope that has one is refused with `409 gate-policy-scope-taken` (`details.heldBy` names it; publish a new version of that one instead), and a new version can't change the agent or scope (`409 gate-policy-scope-changed`). The `spec` is checked strictly: an unknown key is refused (`400 validation-failed`, `details.issues`). Needs `admin` on the tenant: whoever may promote can't loosen their own gate.",
|
|
1753
|
+
tags: ['gate-policies'],
|
|
1754
|
+
security: 'bearer',
|
|
1755
|
+
parameters: [IdempotencyKeyParam],
|
|
1756
|
+
requestBody: { required: true, schema: ref('PublishGatePolicyBody') },
|
|
1757
|
+
responses: {
|
|
1758
|
+
'201': { description: 'Gate policy published.', schema: ref('GatePolicy') },
|
|
1759
|
+
...CommonMutationErrors,
|
|
1760
|
+
'400': ErrorResponse('Validation failed (see `details.issues`).'),
|
|
1761
|
+
'409': ErrorResponse('`gate-policy-already-registered`: that (id, version) exists. `gate-policy-scope-taken`: another policy gates the agent for the scope (`details.heldBy`). `gate-policy-scope-changed`: the version would change the agent or scope. `gate-policy-scope-unpinned`: nothing covering the scope is pinned, so a published version would go live there ungated; pin a version for the scope, or one above it, first.'),
|
|
1762
|
+
},
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
method: 'get',
|
|
1766
|
+
honoPath: '/v1/gate-policies/:policyId',
|
|
1767
|
+
openapiPath: '/v1/gate-policies/{policyId}',
|
|
1768
|
+
operationId: 'gatePolicies.get',
|
|
1769
|
+
summary: 'Get a gate policy',
|
|
1770
|
+
description: "The policy's latest active version.",
|
|
1771
|
+
tags: ['gate-policies'],
|
|
1772
|
+
security: 'bearer',
|
|
1773
|
+
parameters: [GatePolicyIdPathParam],
|
|
1774
|
+
responses: {
|
|
1775
|
+
'200': { description: 'The gate policy.', schema: ref('GatePolicy') },
|
|
1776
|
+
...CommonAuthErrors,
|
|
1777
|
+
'404': ErrorResponse('No active gate policy with that id.'),
|
|
1778
|
+
},
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
method: 'get',
|
|
1782
|
+
honoPath: '/v1/gate-policies/:policyId/versions',
|
|
1783
|
+
openapiPath: '/v1/gate-policies/{policyId}/versions',
|
|
1784
|
+
operationId: 'gatePolicies.versions.list',
|
|
1785
|
+
summary: "List a gate policy's versions",
|
|
1786
|
+
description: 'Every version, oldest first, unregistered ones too (with `unregisteredAt`).',
|
|
1787
|
+
tags: ['gate-policies'],
|
|
1788
|
+
security: 'bearer',
|
|
1789
|
+
parameters: [GatePolicyIdPathParam],
|
|
1790
|
+
responses: {
|
|
1791
|
+
'200': { description: 'The versions.', schema: ref('GatePolicyPage') },
|
|
1792
|
+
...CommonAuthErrors,
|
|
1793
|
+
'404': ErrorResponse('No gate policy with that id.'),
|
|
1794
|
+
},
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
method: 'get',
|
|
1798
|
+
honoPath: '/v1/gate-policies/:policyId/versions/:version',
|
|
1799
|
+
openapiPath: '/v1/gate-policies/{policyId}/versions/{version}',
|
|
1800
|
+
operationId: 'gatePolicies.versions.get',
|
|
1801
|
+
summary: 'Get a gate policy version',
|
|
1802
|
+
tags: ['gate-policies'],
|
|
1803
|
+
security: 'bearer',
|
|
1804
|
+
parameters: [GatePolicyIdPathParam, GatePolicyVersionPathParam],
|
|
1805
|
+
responses: {
|
|
1806
|
+
'200': { description: 'The version.', schema: ref('GatePolicy') },
|
|
1807
|
+
...CommonAuthErrors,
|
|
1808
|
+
'404': ErrorResponse('No such version.'),
|
|
1809
|
+
},
|
|
1810
|
+
},
|
|
1811
|
+
{
|
|
1812
|
+
method: 'post',
|
|
1813
|
+
honoPath: '/v1/gate-policies/:policyId/versions/:version/unregister',
|
|
1814
|
+
openapiPath: '/v1/gate-policies/{policyId}/versions/{version}/unregister',
|
|
1815
|
+
operationId: 'gatePolicies.versions.unregister',
|
|
1816
|
+
summary: 'Unregister a gate policy version',
|
|
1817
|
+
description: "The version stops applying; the policy's latest remaining active version applies, or, with none, the scope above's policy. Promotions keep the version they were checked against. Needs `admin` on the tenant.",
|
|
1818
|
+
tags: ['gate-policies'],
|
|
1819
|
+
security: 'bearer',
|
|
1820
|
+
parameters: [GatePolicyIdPathParam, GatePolicyVersionPathParam],
|
|
1821
|
+
responses: {
|
|
1822
|
+
'200': { description: 'The unregistered version.', schema: ref('GatePolicy') },
|
|
1823
|
+
...CommonMutationErrors,
|
|
1824
|
+
'404': ErrorResponse('No such version.'),
|
|
1825
|
+
},
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
method: 'post',
|
|
1829
|
+
honoPath: '/v1/gate-policies/:policyId/versions/:version/reinstate',
|
|
1830
|
+
openapiPath: '/v1/gate-policies/{policyId}/versions/{version}/reinstate',
|
|
1831
|
+
operationId: 'gatePolicies.versions.reinstate',
|
|
1832
|
+
summary: 'Reinstate a gate policy version',
|
|
1833
|
+
description: 'Needs `admin` on the tenant.',
|
|
1834
|
+
tags: ['gate-policies'],
|
|
1835
|
+
security: 'bearer',
|
|
1836
|
+
parameters: [GatePolicyIdPathParam, GatePolicyVersionPathParam],
|
|
1837
|
+
responses: {
|
|
1838
|
+
'200': { description: 'The reinstated version.', schema: ref('GatePolicy') },
|
|
1839
|
+
...CommonMutationErrors,
|
|
1840
|
+
'404': ErrorResponse('No such version.'),
|
|
1841
|
+
},
|
|
1842
|
+
},
|
|
1843
|
+
{
|
|
1844
|
+
method: 'get',
|
|
1845
|
+
honoPath: '/v1/agents/:agentId/promotions',
|
|
1846
|
+
openapiPath: '/v1/agents/{agentId}/promotions',
|
|
1847
|
+
operationId: 'agents.promotions.list',
|
|
1848
|
+
summary: "List an agent's promotions",
|
|
1849
|
+
description: 'The history of live-version changes (promotions, rollbacks, unpins), newest first. `scopeKind` (`tenant`, `org`, `project`, `segment`) with `scopeId` and `segment` narrows it to one scope.',
|
|
1850
|
+
tags: ['agents'],
|
|
1851
|
+
security: 'bearer',
|
|
1852
|
+
parameters: [
|
|
1853
|
+
AgentIdPathParam,
|
|
1854
|
+
LimitQueryParam,
|
|
1855
|
+
CursorQueryParam,
|
|
1856
|
+
PromotionScopeKindQueryParam,
|
|
1857
|
+
ScopeIdQueryParam,
|
|
1858
|
+
SegmentQueryParam,
|
|
1859
|
+
],
|
|
1860
|
+
responses: {
|
|
1861
|
+
'200': { description: 'Page of promotions.', schema: ref('PromotionPage') },
|
|
1862
|
+
...CommonAuthErrors,
|
|
1863
|
+
'400': ErrorResponse('Malformed scope or cursor.'),
|
|
1864
|
+
},
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
method: 'get',
|
|
1868
|
+
honoPath: '/v1/agents/:agentId/promotions/:promotionId',
|
|
1869
|
+
openapiPath: '/v1/agents/{agentId}/promotions/{promotionId}',
|
|
1870
|
+
operationId: 'agents.promotions.get',
|
|
1871
|
+
summary: 'Get a promotion',
|
|
1872
|
+
tags: ['agents'],
|
|
1873
|
+
security: 'bearer',
|
|
1874
|
+
parameters: [AgentIdPathParam, PromotionIdPathParam],
|
|
1875
|
+
responses: {
|
|
1876
|
+
'200': { description: 'The promotion.', schema: ref('Promotion') },
|
|
1877
|
+
...CommonAuthErrors,
|
|
1878
|
+
'404': ErrorResponse('No such promotion for this agent.'),
|
|
1879
|
+
},
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
method: 'post',
|
|
1883
|
+
honoPath: '/v1/agents/:agentId/live/rollback',
|
|
1884
|
+
openapiPath: '/v1/agents/{agentId}/live/rollback',
|
|
1885
|
+
operationId: 'agents.live.rollback',
|
|
1886
|
+
summary: 'Roll a scope back to its previous live version',
|
|
1887
|
+
description: "Back to the scope's previous live version, or `toVersion`. Recorded like a promotion. Needs `promote` on the agent.",
|
|
1888
|
+
tags: ['agents'],
|
|
1889
|
+
security: 'bearer',
|
|
1890
|
+
parameters: [AgentIdPathParam, IdempotencyKeyParam],
|
|
1891
|
+
requestBody: { required: true, schema: ref('RollbackBody') },
|
|
1892
|
+
responses: {
|
|
1893
|
+
'200': { description: 'Rolled back.', schema: ref('Promotion') },
|
|
1894
|
+
...CommonMutationErrors,
|
|
1895
|
+
'404': ErrorResponse('`toVersion` is not registered, or was unregistered.'),
|
|
1896
|
+
'409': ErrorResponse('The scope has no pin, or no earlier version to go back to.'),
|
|
1897
|
+
},
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
method: 'post',
|
|
1901
|
+
honoPath: '/v1/agents/:agentId/live/unpin',
|
|
1902
|
+
openapiPath: '/v1/agents/{agentId}/live/unpin',
|
|
1903
|
+
operationId: 'agents.live.unpin',
|
|
1904
|
+
summary: "Remove a scope's live version",
|
|
1905
|
+
description: "Removes the scope's own pin: its runs use the next scope up (and the latest when nothing is pinned). Recorded like a promotion. Needs `promote` on the agent.",
|
|
1906
|
+
tags: ['agents'],
|
|
1907
|
+
security: 'bearer',
|
|
1908
|
+
parameters: [AgentIdPathParam, IdempotencyKeyParam],
|
|
1909
|
+
requestBody: { required: true, schema: ref('UnpinBody') },
|
|
1910
|
+
responses: {
|
|
1911
|
+
'200': { description: 'Unpinned.', schema: ref('Promotion') },
|
|
1912
|
+
...CommonMutationErrors,
|
|
1913
|
+
'409': ErrorResponse('`not-pinned`: the scope has no pin of its own. `gate-policy-needs-pin`: unpinning would leave a scope a gate policy applies to on the latest version, where publishing goes live ungated.'),
|
|
1914
|
+
},
|
|
1915
|
+
},
|
|
1509
1916
|
// ---------- flows ----------
|
|
1510
1917
|
{
|
|
1511
1918
|
method: 'get',
|
|
@@ -1590,8 +1997,9 @@ export const OPERATIONS = [
|
|
|
1590
1997
|
responses: {
|
|
1591
1998
|
'201': { description: 'Flow published.', schema: ref('PublishFlowResult') },
|
|
1592
1999
|
...CommonMutationErrors,
|
|
1593
|
-
'400': ErrorResponse(
|
|
2000
|
+
'400': ErrorResponse("Validation failed (see `details.issues`); or `projectId` isn't a project id (a UUID)."),
|
|
1594
2001
|
'409': ErrorResponse("Flow already registered at that (id, version). Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead."),
|
|
2002
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
1595
2003
|
},
|
|
1596
2004
|
},
|
|
1597
2005
|
{
|
|
@@ -1713,8 +2121,9 @@ export const OPERATIONS = [
|
|
|
1713
2121
|
responses: {
|
|
1714
2122
|
'201': { description: 'Tool registered.', schema: ref('RegisterToolResult') },
|
|
1715
2123
|
...CommonMutationErrors,
|
|
1716
|
-
'400': ErrorResponse(
|
|
2124
|
+
'400': ErrorResponse("Validation failed (see `details.issues`); or `projectId` isn't a project id (a UUID)."),
|
|
1717
2125
|
'409': ErrorResponse("Tool already registered at that id. Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead."),
|
|
2126
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
1718
2127
|
},
|
|
1719
2128
|
},
|
|
1720
2129
|
{
|
|
@@ -1803,8 +2212,9 @@ export const OPERATIONS = [
|
|
|
1803
2212
|
responses: {
|
|
1804
2213
|
'201': { description: 'Guardrail registered.', schema: ref('RegisterGuardrailResult') },
|
|
1805
2214
|
...CommonMutationErrors,
|
|
1806
|
-
'400': ErrorResponse(
|
|
2215
|
+
'400': ErrorResponse("Validation failed (see `details.issues`); or `projectId` isn't a project id (a UUID)."),
|
|
1807
2216
|
'409': ErrorResponse("Guardrail already registered at that id. Or `registry-read-only`: this registry takes no writes (under `kindgi dev`, the pack's files are the source); the message says what to do instead."),
|
|
2217
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
1808
2218
|
},
|
|
1809
2219
|
},
|
|
1810
2220
|
{
|
|
@@ -1830,7 +2240,7 @@ export const OPERATIONS = [
|
|
|
1830
2240
|
openapiPath: '/v1/conversations',
|
|
1831
2241
|
operationId: 'conversations.list',
|
|
1832
2242
|
summary: 'List conversations',
|
|
1833
|
-
description: "Cursor-paginated. Fixed sort: `openedAt desc, id desc`. Filters: `?agentId=`, `?status=open|closed`, and `scopeKind`/`scopeId` for one project's conversations, or every project's in an org. Conversations from before Kindgi 0.1.3 have no project and are listed only without a scope.",
|
|
2243
|
+
description: "Cursor-paginated. Fixed sort: `openedAt desc, id desc`. Filters: `?agentId=`, `?status=open|closed`, `?replays=exclude|include|only` (default `exclude`: a comparison's replay conversations are left out), and `scopeKind`/`scopeId` for one project's conversations, or every project's in an org. Conversations from before Kindgi 0.1.3 have no project and are listed only without a scope.",
|
|
1834
2244
|
tags: ['conversations'],
|
|
1835
2245
|
security: 'bearer',
|
|
1836
2246
|
parameters: [
|
|
@@ -1840,6 +2250,7 @@ export const OPERATIONS = [
|
|
|
1840
2250
|
ScopeIdQueryParam,
|
|
1841
2251
|
AgentIdQueryParam,
|
|
1842
2252
|
ConversationStatusQueryParam,
|
|
2253
|
+
ConversationReplaysQueryParam,
|
|
1843
2254
|
],
|
|
1844
2255
|
responses: {
|
|
1845
2256
|
'200': {
|
|
@@ -1862,6 +2273,7 @@ export const OPERATIONS = [
|
|
|
1862
2273
|
responses: {
|
|
1863
2274
|
'200': { description: 'Conversation.', schema: ref('Conversation') },
|
|
1864
2275
|
...CommonAuthErrors,
|
|
2276
|
+
'400': ErrorResponse('`conversationId` is not a conversation id (a UUID).'),
|
|
1865
2277
|
'404': ErrorResponse('No conversation with that id under this tenant.'),
|
|
1866
2278
|
},
|
|
1867
2279
|
},
|
|
@@ -1897,6 +2309,7 @@ export const OPERATIONS = [
|
|
|
1897
2309
|
schema: ref('Conversation'),
|
|
1898
2310
|
},
|
|
1899
2311
|
...CommonMutationErrors,
|
|
2312
|
+
'400': ErrorResponse('`conversationId` is not a conversation id (a UUID).'),
|
|
1900
2313
|
'404': ErrorResponse('No conversation with that id under this tenant.'),
|
|
1901
2314
|
},
|
|
1902
2315
|
},
|
|
@@ -1916,7 +2329,7 @@ export const OPERATIONS = [
|
|
|
1916
2329
|
schema: ref('ConversationMessageCollectionPage'),
|
|
1917
2330
|
},
|
|
1918
2331
|
...CommonAuthErrors,
|
|
1919
|
-
'400': ErrorResponse('Malformed cursor.'),
|
|
2332
|
+
'400': ErrorResponse('Malformed cursor, or `conversationId` is not a conversation id (a UUID).'),
|
|
1920
2333
|
'404': ErrorResponse('No conversation with that id under this tenant.'),
|
|
1921
2334
|
},
|
|
1922
2335
|
},
|
|
@@ -2373,7 +2786,11 @@ export const OPERATIONS = [
|
|
|
2373
2786
|
CursorQueryParam,
|
|
2374
2787
|
ObservationStatusQueryParam,
|
|
2375
2788
|
AgentIdQueryParam,
|
|
2789
|
+
ObservationAgentVersionQueryParam,
|
|
2376
2790
|
SupervisorIdQueryParam,
|
|
2791
|
+
ObservationConversationIdQueryParam,
|
|
2792
|
+
ObservationSinceQueryParam,
|
|
2793
|
+
ObservationUntilQueryParam,
|
|
2377
2794
|
],
|
|
2378
2795
|
responses: {
|
|
2379
2796
|
'200': {
|
|
@@ -2521,7 +2938,7 @@ export const OPERATIONS = [
|
|
|
2521
2938
|
'201': { description: 'Judgment recorded.', schema: ref('Judgment') },
|
|
2522
2939
|
...CommonMutationErrors,
|
|
2523
2940
|
'400': ErrorResponse('Malformed body, or `item-not-found` (the pointer resolves to nothing in the output), or `judge-class-not-applicable`.'),
|
|
2524
|
-
'403': ErrorResponse('`permission-denied`: not allowed to judge this run.'),
|
|
2941
|
+
'403': ErrorResponse('`permission-denied`: not allowed to judge this run. `judge-class-not-allowed`: the judge class is restricted (`assertableBy`) and the caller may not assert it.'),
|
|
2525
2942
|
'404': ErrorResponse('`run-not-found`.'),
|
|
2526
2943
|
'409': ErrorResponse('`run-not-finished`: the run has no output to judge yet.'),
|
|
2527
2944
|
},
|
|
@@ -3056,7 +3473,7 @@ export const OPERATIONS = [
|
|
|
3056
3473
|
openapiPath: '/v1/policies',
|
|
3057
3474
|
operationId: 'policies.publish',
|
|
3058
3475
|
summary: 'Publish a policy',
|
|
3059
|
-
description: "Body is a full `Policy` — the server validates top-level shape (id, tenantId, semver version, kind ∈ closed enum, spec is an object)
|
|
3476
|
+
description: "Body is a full `Policy` — the server validates top-level shape (id, tenantId, semver version, kind ∈ closed enum, spec is an object), and `spec` for `tool-errors`, `hitl` and `retention` (a retention policy with an unknown domain or `mode: archive` is refused with `400 validation-failed`, naming the field). Other kinds' specs are their runtime consumer's to validate. Re-publishing an existing `(policyId, version)` returns `409 policy-already-registered`. A tenant has one retention policy per domain, plus one for `*`: a second policy id for a covered domain is refused with `409 policy-scope-taken` (`details.heldBy` names the policy that covers it; publish a new version of that one instead), and a new version can't move a policy to another domain (`409 policy-scope-changed`). A known kind that no runtime consumer applies yet (`access-control`, `adapter-allowlist`, `rate-limit`, `compliance`) is refused with `400 kind-not-applied` (`details.appliedKinds` lists the ones that are): publishing it would change nothing. Idempotency-Key applies (retries with the same key replay the original 201).",
|
|
3060
3477
|
tags: ['policies'],
|
|
3061
3478
|
security: 'bearer',
|
|
3062
3479
|
parameters: [IdempotencyKeyParam],
|
|
@@ -3065,7 +3482,7 @@ export const OPERATIONS = [
|
|
|
3065
3482
|
'201': { description: 'Policy published.', schema: ref('PublishPolicyResult') },
|
|
3066
3483
|
...CommonMutationErrors,
|
|
3067
3484
|
'400': ErrorResponse('Validation failed (see `details.issues`), or `kind-not-applied`: no runtime consumer applies that kind yet.'),
|
|
3068
|
-
'409': ErrorResponse('
|
|
3485
|
+
'409': ErrorResponse('`policy-already-registered`: that (id, version) exists. `policy-scope-taken`: another policy covers the retention domain (`details.heldBy`). `policy-scope-changed`: the version would move the policy to another domain.'),
|
|
3069
3486
|
},
|
|
3070
3487
|
},
|
|
3071
3488
|
{
|
|
@@ -3097,6 +3514,65 @@ export const OPERATIONS = [
|
|
|
3097
3514
|
'200': { description: 'Reinstated.', schema: ref('ReinstatePolicyVersionResult') },
|
|
3098
3515
|
...CommonMutationErrors,
|
|
3099
3516
|
'404': ErrorResponse('No policy at that (id, version) under this tenant.'),
|
|
3517
|
+
'409': ErrorResponse("`policy-scope-taken`: another policy now covers the version's retention domain (`details.heldBy`); unregister it first. `policy-scope-changed`: the version covers a different domain from the policy's other versions."),
|
|
3518
|
+
},
|
|
3519
|
+
},
|
|
3520
|
+
// ---------- retention (admin plane) ----------
|
|
3521
|
+
{
|
|
3522
|
+
method: 'get',
|
|
3523
|
+
honoPath: '/v1/retention/scheduled',
|
|
3524
|
+
openapiPath: '/v1/retention/scheduled',
|
|
3525
|
+
operationId: 'retention.scheduled',
|
|
3526
|
+
summary: 'List deleted rows scheduled for purging',
|
|
3527
|
+
description: "Tombstoned rows in every domain a retention policy covers, with when each is purged (`purgeAt`) and the policy that decides it. `domainsMissingAdapter` names the covered domains this deployment can't purge; `unpolicedDomains` the ones no policy covers, whose tombstones are kept; `conflicts` the domains two policies cover (stored before one policy per domain was enforced). `limit` caps the rows **per domain**; `hasMore` says some domain has more than it returned, and `nextCursor` (when the runtime can continue) is the `cursor` for the next page. Requires `admin` on the tenant.",
|
|
3528
|
+
tags: ['retention'],
|
|
3529
|
+
security: 'bearer',
|
|
3530
|
+
parameters: [
|
|
3531
|
+
RetentionDomainQueryParam,
|
|
3532
|
+
RetentionPastGraceOnlyQueryParam,
|
|
3533
|
+
LimitQueryParam,
|
|
3534
|
+
CursorQueryParam,
|
|
3535
|
+
],
|
|
3536
|
+
responses: {
|
|
3537
|
+
'200': { description: 'Scheduled rows.', schema: ref('RetentionScheduledPage') },
|
|
3538
|
+
...CommonAuthErrors,
|
|
3539
|
+
'403': ErrorResponse('Not a tenant admin.'),
|
|
3540
|
+
'400': ErrorResponse('Unknown `domain`.'),
|
|
3541
|
+
},
|
|
3542
|
+
},
|
|
3543
|
+
{
|
|
3544
|
+
method: 'post',
|
|
3545
|
+
honoPath: '/v1/retention/sweep',
|
|
3546
|
+
openapiPath: '/v1/retention/sweep',
|
|
3547
|
+
operationId: 'retention.sweep',
|
|
3548
|
+
summary: 'Purge the deleted rows past their grace',
|
|
3549
|
+
description: "Purges, for good, every tombstoned row past the grace of the retention policy that covers its domain (or only `domain`'s), up to `maxPerDomain` per domain; `remaining` counts what is left for the next call. Nothing sweeps on its own: call this (or `POST /v1/retention/sweep/{domain}`) from a schedule. A hold (`graceSeconds: -1`) keeps its domain's rows. Idempotent: a second call purges nothing new. Requires `admin` on the tenant.",
|
|
3550
|
+
tags: ['retention'],
|
|
3551
|
+
security: 'bearer',
|
|
3552
|
+
requestBody: { required: false, schema: ref('RetentionSweepBody') },
|
|
3553
|
+
responses: {
|
|
3554
|
+
'200': { description: 'What was purged, per domain.', schema: ref('RetentionSweepResult') },
|
|
3555
|
+
...CommonMutationErrors,
|
|
3556
|
+
'403': ErrorResponse('Not a tenant admin.'),
|
|
3557
|
+
'400': ErrorResponse('Unknown `domain`, or `maxPerDomain` outside 1..10000.'),
|
|
3558
|
+
},
|
|
3559
|
+
},
|
|
3560
|
+
{
|
|
3561
|
+
method: 'post',
|
|
3562
|
+
honoPath: '/v1/retention/sweep/:domain',
|
|
3563
|
+
openapiPath: '/v1/retention/sweep/{domain}',
|
|
3564
|
+
operationId: 'retention.sweepDomain',
|
|
3565
|
+
summary: "Purge one domain's deleted rows past their grace",
|
|
3566
|
+
description: 'As `POST /v1/retention/sweep`, for one domain. Requires `admin` on the tenant.',
|
|
3567
|
+
tags: ['retention'],
|
|
3568
|
+
security: 'bearer',
|
|
3569
|
+
parameters: [RetentionDomainPathParam],
|
|
3570
|
+
requestBody: { required: false, schema: ref('RetentionSweepDomainBody') },
|
|
3571
|
+
responses: {
|
|
3572
|
+
'200': { description: 'What was purged.', schema: ref('RetentionSweepResult') },
|
|
3573
|
+
...CommonMutationErrors,
|
|
3574
|
+
'403': ErrorResponse('Not a tenant admin.'),
|
|
3575
|
+
'400': ErrorResponse('Unknown `domain` (or `*`), or `maxPerDomain` outside 1..10000.'),
|
|
3100
3576
|
},
|
|
3101
3577
|
},
|
|
3102
3578
|
// ---------- eval suites (admin plane) ----------
|
|
@@ -3187,8 +3663,9 @@ export const OPERATIONS = [
|
|
|
3187
3663
|
responses: {
|
|
3188
3664
|
'201': { description: 'Eval suite published.', schema: ref('PublishEvalSuiteResult') },
|
|
3189
3665
|
...CommonMutationErrors,
|
|
3190
|
-
'400': ErrorResponse(
|
|
3666
|
+
'400': ErrorResponse("Validation failed (see `details.issues`); or `projectId` isn't a project id (a UUID)."),
|
|
3191
3667
|
'409': ErrorResponse('Eval suite already registered at that (id, version).'),
|
|
3668
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
3192
3669
|
},
|
|
3193
3670
|
},
|
|
3194
3671
|
{
|
|
@@ -3205,10 +3682,11 @@ export const OPERATIONS = [
|
|
|
3205
3682
|
responses: {
|
|
3206
3683
|
'201': { description: 'Version published.', schema: ref('BuildJudgedSuiteResult') },
|
|
3207
3684
|
...CommonMutationErrors,
|
|
3208
|
-
'400': ErrorResponse(
|
|
3685
|
+
'400': ErrorResponse("Malformed body; or `projectId` isn't a project id (a UUID)."),
|
|
3209
3686
|
'403': ErrorResponse('`permission-denied`.'),
|
|
3210
3687
|
'409': ErrorResponse('Eval suite already registered at that (id, version).'),
|
|
3211
3688
|
'501': ErrorResponse('`test-sets-not-supported`: this deployment cannot build test sets.'),
|
|
3689
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
3212
3690
|
},
|
|
3213
3691
|
},
|
|
3214
3692
|
{
|
|
@@ -3348,9 +3826,10 @@ export const OPERATIONS = [
|
|
|
3348
3826
|
responses: {
|
|
3349
3827
|
'201': { description: 'Published.', schema: ref('PublishBlockResult') },
|
|
3350
3828
|
...CommonMutationErrors,
|
|
3351
|
-
'400': ErrorResponse(
|
|
3829
|
+
'400': ErrorResponse("`validation-failed` (see `details.issues`), or an unknown `projectId`; or `projectId` isn't a project id (a UUID)."),
|
|
3352
3830
|
'403': ErrorResponse('`permission-denied`: no `write` on the project.'),
|
|
3353
3831
|
'409': ErrorResponse('`block-already-registered` or `block-project-mismatch`.'),
|
|
3832
|
+
'404': ErrorResponse("The body's `projectId` names no project of this tenant (`project-not-found`)."),
|
|
3354
3833
|
},
|
|
3355
3834
|
},
|
|
3356
3835
|
{
|
|
@@ -3401,8 +3880,8 @@ export const OPERATIONS = [
|
|
|
3401
3880
|
responses: {
|
|
3402
3881
|
'201': { description: 'Eval run started.', schema: ref('StartEvalRunResult') },
|
|
3403
3882
|
...CommonMutationErrors,
|
|
3404
|
-
'400': ErrorResponse(
|
|
3405
|
-
'404': ErrorResponse('No eval suite with that id under this tenant.'),
|
|
3883
|
+
'400': ErrorResponse("Malformed body (both / neither of `agentRef` / `flowRef`, dispatcher-input-invalid); or `projectId` isn't a project id (a UUID)."),
|
|
3884
|
+
'404': ErrorResponse('No eval suite with that id under this tenant; or `projectId` names no project of this tenant (`project-not-found`).'),
|
|
3406
3885
|
'422': ErrorResponse('No dispatcher registered for the suite kind.'),
|
|
3407
3886
|
},
|
|
3408
3887
|
},
|
|
@@ -3956,7 +4435,7 @@ export const OPERATIONS = [
|
|
|
3956
4435
|
openapiPath: '/v1/audit/authz',
|
|
3957
4436
|
operationId: 'audit.authz.list',
|
|
3958
4437
|
summary: 'List authz decision audit events',
|
|
3959
|
-
description: 'Cursor-paginated read of `authz-decision` audit events for the tenant. Filters (all AND-composed): `?actorSubject=` / `?onBehalfOf=` / `?action=` / `?resource=` / `?outcome=` / `?runId=` / `?from=` / `?to=`. Admin@tenant only. Only mounted when `CreateAppInput.auditEvents` is wired.',
|
|
4438
|
+
description: 'Cursor-paginated read of `authz-decision` audit events for the tenant. Filters (all AND-composed): `?actorSubject=` / `?onBehalfOf=` / `?action=` / `?resource=` / `?outcome=` / `?runId=` / `?from=` / `?to=`. Oldest first; `?order=desc` for newest first. Admin@tenant only. Only mounted when `CreateAppInput.auditEvents` is wired.',
|
|
3960
4439
|
tags: ['audit'],
|
|
3961
4440
|
security: 'bearer',
|
|
3962
4441
|
parameters: [
|
|
@@ -4018,6 +4497,13 @@ export const OPERATIONS = [
|
|
|
4018
4497
|
description: 'ISO 8601 upper bound (inclusive) on `timestamp`.',
|
|
4019
4498
|
schema: { type: 'string', format: 'date-time' },
|
|
4020
4499
|
},
|
|
4500
|
+
{
|
|
4501
|
+
name: 'order',
|
|
4502
|
+
in: 'query',
|
|
4503
|
+
required: false,
|
|
4504
|
+
description: '`asc` (the default): oldest first. `desc`: newest first. `nextCursor` continues in the same order.',
|
|
4505
|
+
schema: { type: 'string', enum: ['asc', 'desc'] },
|
|
4506
|
+
},
|
|
4021
4507
|
],
|
|
4022
4508
|
responses: {
|
|
4023
4509
|
'200': {
|
|
@@ -4064,7 +4550,7 @@ export const OPERATIONS = [
|
|
|
4064
4550
|
},
|
|
4065
4551
|
},
|
|
4066
4552
|
...CommonAuthErrors,
|
|
4067
|
-
'400': ErrorResponse('Malformed cursor, `from`, `to`, or `
|
|
4553
|
+
'400': ErrorResponse('Malformed cursor, `from`, `to`, `outcome`, or `order`.'),
|
|
4068
4554
|
},
|
|
4069
4555
|
},
|
|
4070
4556
|
// ---------- orgs ----------
|
|
@@ -4386,6 +4872,7 @@ export const OPERATIONS = [
|
|
|
4386
4872
|
responses: {
|
|
4387
4873
|
'204': { description: 'Removed (or already absent). No body.' },
|
|
4388
4874
|
...CommonAuthErrors,
|
|
4875
|
+
'501': ErrorResponse("With authorization enforced, a runtime whose tenant-hierarchy binding can't change the membership together with its authorization tuple refuses with `authz-membership-unsupported`; nothing is changed."),
|
|
4389
4876
|
},
|
|
4390
4877
|
},
|
|
4391
4878
|
{
|
|
@@ -4418,6 +4905,7 @@ export const OPERATIONS = [
|
|
|
4418
4905
|
'204': { description: 'Role updated. No body.' },
|
|
4419
4906
|
...CommonMutationErrors,
|
|
4420
4907
|
'404': ErrorResponse('No membership for that (team, user) pair, or no such team under this tenant.'),
|
|
4908
|
+
'501': ErrorResponse("With authorization enforced, a runtime whose tenant-hierarchy binding can't change the membership together with its authorization tuple refuses with `authz-membership-unsupported`; nothing is changed."),
|
|
4421
4909
|
},
|
|
4422
4910
|
},
|
|
4423
4911
|
// ---------- projects ----------
|
|
@@ -4644,6 +5132,7 @@ export const OPERATIONS = [
|
|
|
4644
5132
|
responses: {
|
|
4645
5133
|
'204': { description: 'Removed (or already absent). No body.' },
|
|
4646
5134
|
...CommonAuthErrors,
|
|
5135
|
+
'501': ErrorResponse("With authorization enforced, a runtime whose tenant-hierarchy binding can't change the membership together with its authorization tuple refuses with `authz-membership-unsupported`; nothing is changed."),
|
|
4647
5136
|
},
|
|
4648
5137
|
},
|
|
4649
5138
|
{
|
|
@@ -4676,6 +5165,7 @@ export const OPERATIONS = [
|
|
|
4676
5165
|
'204': { description: 'Role updated. No body.' },
|
|
4677
5166
|
...CommonMutationErrors,
|
|
4678
5167
|
'404': ErrorResponse('No membership for that (project, user) pair, or no such project under this tenant.'),
|
|
5168
|
+
'501': ErrorResponse("With authorization enforced, a runtime whose tenant-hierarchy binding can't change the membership together with its authorization tuple refuses with `authz-membership-unsupported`; nothing is changed."),
|
|
4679
5169
|
},
|
|
4680
5170
|
},
|
|
4681
5171
|
// ---------- tenant ----------
|