@kindgi/api 0.1.3 → 0.1.4-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-binding.d.ts +18 -4
- package/dist/agent-binding.d.ts.map +1 -1
- package/dist/agent-pins.d.ts +48 -0
- package/dist/agent-pins.d.ts.map +1 -0
- package/dist/agent-pins.js +102 -0
- package/dist/agent-pins.js.map +1 -0
- package/dist/app.d.ts +22 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +20 -2
- package/dist/app.js.map +1 -1
- package/dist/block-binding.d.ts +132 -0
- package/dist/block-binding.d.ts.map +1 -0
- package/dist/block-binding.js +4 -0
- package/dist/block-binding.js.map +1 -0
- package/dist/block-pins.d.ts +22 -0
- package/dist/block-pins.d.ts.map +1 -0
- package/dist/block-pins.js +112 -0
- package/dist/block-pins.js.map +1 -0
- package/dist/cost-binding.d.ts +20 -1
- package/dist/cost-binding.d.ts.map +1 -1
- package/dist/cost-binding.js +4 -0
- package/dist/cost-binding.js.map +1 -1
- package/dist/deploy-versions.d.ts +58 -0
- package/dist/deploy-versions.d.ts.map +1 -0
- package/dist/deploy-versions.js +91 -0
- package/dist/deploy-versions.js.map +1 -0
- package/dist/deployment-binding.d.ts +24 -3
- package/dist/deployment-binding.d.ts.map +1 -1
- package/dist/derive-agent-version.d.ts +69 -0
- package/dist/derive-agent-version.d.ts.map +1 -0
- package/dist/derive-agent-version.js +139 -0
- package/dist/derive-agent-version.js.map +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +17 -0
- package/dist/errors.js.map +1 -1
- package/dist/eval-case-binding.d.ts +65 -0
- package/dist/eval-case-binding.d.ts.map +1 -0
- package/dist/eval-case-binding.js +4 -0
- package/dist/eval-case-binding.js.map +1 -0
- package/dist/eval-run-binding.d.ts +30 -0
- package/dist/eval-run-binding.d.ts.map +1 -1
- package/dist/eval-run-dispatcher.d.ts +38 -3
- package/dist/eval-run-dispatcher.d.ts.map +1 -1
- package/dist/eval-run-dispatcher.js +21 -15
- package/dist/eval-run-dispatcher.js.map +1 -1
- package/dist/eval-suite-binding.d.ts +1 -1
- package/dist/eval-suite-binding.d.ts.map +1 -1
- package/dist/eval-suite-binding.js +2 -0
- package/dist/eval-suite-binding.js.map +1 -1
- package/dist/flow-binding.d.ts +10 -4
- package/dist/flow-binding.d.ts.map +1 -1
- package/dist/flow-pins.d.ts +36 -0
- package/dist/flow-pins.d.ts.map +1 -0
- package/dist/flow-pins.js +81 -0
- package/dist/flow-pins.js.map +1 -0
- package/dist/index.d.ts +17 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/judged-dispatcher.d.ts +134 -0
- package/dist/judged-dispatcher.d.ts.map +1 -0
- package/dist/judged-dispatcher.js +297 -0
- package/dist/judged-dispatcher.js.map +1 -0
- package/dist/judged-items.d.ts +86 -0
- package/dist/judged-items.d.ts.map +1 -0
- package/dist/judged-items.js +184 -0
- package/dist/judged-items.js.map +1 -0
- package/dist/judgment-binding.d.ts +316 -0
- package/dist/judgment-binding.d.ts.map +1 -0
- package/dist/judgment-binding.js +19 -0
- package/dist/judgment-binding.js.map +1 -0
- package/dist/openapi/generate.d.ts.map +1 -1
- package/dist/openapi/generate.js +4 -1
- package/dist/openapi/generate.js.map +1 -1
- package/dist/openapi/operations.d.ts.map +1 -1
- package/dist/openapi/operations.js +461 -7
- package/dist/openapi/operations.js.map +1 -1
- package/dist/openapi/schemas.d.ts +40 -0
- package/dist/openapi/schemas.d.ts.map +1 -1
- package/dist/openapi/schemas.js +843 -7
- package/dist/openapi/schemas.js.map +1 -1
- package/dist/provider-binding.d.ts +12 -7
- package/dist/provider-binding.d.ts.map +1 -1
- package/dist/routes/agents.d.ts +9 -1
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/agents.js +175 -11
- package/dist/routes/agents.js.map +1 -1
- package/dist/routes/blocks.d.ts +19 -0
- package/dist/routes/blocks.d.ts.map +1 -0
- package/dist/routes/blocks.js +281 -0
- package/dist/routes/blocks.js.map +1 -0
- package/dist/routes/cost.d.ts.map +1 -1
- package/dist/routes/cost.js +47 -2
- package/dist/routes/cost.js.map +1 -1
- package/dist/routes/deployments.d.ts +3 -0
- package/dist/routes/deployments.d.ts.map +1 -1
- package/dist/routes/deployments.js +208 -55
- package/dist/routes/deployments.js.map +1 -1
- package/dist/routes/eval-comparison.d.ts +14 -0
- package/dist/routes/eval-comparison.d.ts.map +1 -0
- package/dist/routes/eval-comparison.js +87 -0
- package/dist/routes/eval-comparison.js.map +1 -0
- package/dist/routes/eval-runs.d.ts.map +1 -1
- package/dist/routes/eval-runs.js +8 -0
- package/dist/routes/eval-runs.js.map +1 -1
- package/dist/routes/flows.d.ts +13 -1
- package/dist/routes/flows.d.ts.map +1 -1
- package/dist/routes/flows.js +44 -3
- package/dist/routes/flows.js.map +1 -1
- package/dist/routes/hierarchy-errors.d.ts +35 -0
- package/dist/routes/hierarchy-errors.d.ts.map +1 -0
- package/dist/routes/hierarchy-errors.js +39 -0
- package/dist/routes/hierarchy-errors.js.map +1 -0
- package/dist/routes/judged-suites.d.ts +20 -0
- package/dist/routes/judged-suites.d.ts.map +1 -0
- package/dist/routes/judged-suites.js +272 -0
- package/dist/routes/judged-suites.js.map +1 -0
- package/dist/routes/judgment-context.d.ts +22 -0
- package/dist/routes/judgment-context.d.ts.map +1 -0
- package/dist/routes/judgment-context.js +88 -0
- package/dist/routes/judgment-context.js.map +1 -0
- package/dist/routes/judgment-flow-context.d.ts +32 -0
- package/dist/routes/judgment-flow-context.d.ts.map +1 -0
- package/dist/routes/judgment-flow-context.js +195 -0
- package/dist/routes/judgment-flow-context.js.map +1 -0
- package/dist/routes/judgments.d.ts +41 -0
- package/dist/routes/judgments.d.ts.map +1 -0
- package/dist/routes/judgments.js +566 -0
- package/dist/routes/judgments.js.map +1 -0
- package/dist/routes/orgs.d.ts +5 -2
- package/dist/routes/orgs.d.ts.map +1 -1
- package/dist/routes/orgs.js +38 -22
- package/dist/routes/orgs.js.map +1 -1
- package/dist/routes/policies.d.ts.map +1 -1
- package/dist/routes/policies.js +12 -1
- package/dist/routes/policies.js.map +1 -1
- package/dist/routes/projects.d.ts +10 -2
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +87 -79
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/providers.d.ts.map +1 -1
- package/dist/routes/providers.js +6 -1
- package/dist/routes/providers.js.map +1 -1
- package/dist/routes/runs.js +24 -3
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/teams.d.ts +6 -2
- package/dist/routes/teams.d.ts.map +1 -1
- package/dist/routes/teams.js +77 -73
- package/dist/routes/teams.js.map +1 -1
- package/openapi.json +13545 -10103
- package/package.json +21 -21
- package/src/agent-binding.ts +19 -4
- package/src/agent-pins.ts +147 -0
- package/src/app.ts +71 -2
- package/src/block-binding.ts +137 -0
- package/src/block-pins.ts +148 -0
- package/src/cost-binding.ts +21 -1
- package/src/deploy-versions.ts +157 -0
- package/src/deployment-binding.ts +27 -3
- package/src/derive-agent-version.ts +206 -0
- package/src/errors.ts +17 -0
- package/src/eval-case-binding.ts +71 -0
- package/src/eval-run-binding.ts +33 -0
- package/src/eval-run-dispatcher.ts +57 -16
- package/src/eval-suite-binding.ts +2 -0
- package/src/flow-binding.ts +11 -4
- package/src/flow-pins.ts +113 -0
- package/src/index.ts +85 -2
- package/src/judged-dispatcher.ts +507 -0
- package/src/judged-items.ts +263 -0
- package/src/judgment-binding.ts +349 -0
- package/src/openapi/generate.ts +7 -1
- package/src/openapi/operations.ts +523 -7
- package/src/openapi/schemas.ts +1009 -88
- package/src/provider-binding.ts +12 -7
- package/src/routes/agents.ts +243 -19
- package/src/routes/blocks.ts +362 -0
- package/src/routes/cost.ts +55 -1
- package/src/routes/deployments.ts +266 -56
- package/src/routes/eval-comparison.ts +101 -0
- package/src/routes/eval-runs.ts +11 -0
- package/src/routes/flows.ts +63 -5
- package/src/routes/hierarchy-errors.ts +51 -0
- package/src/routes/judged-suites.ts +363 -0
- package/src/routes/judgment-context.ts +128 -0
- package/src/routes/judgment-flow-context.ts +245 -0
- package/src/routes/judgments.ts +743 -0
- package/src/routes/orgs.ts +44 -27
- package/src/routes/policies.ts +19 -0
- package/src/routes/projects.ts +106 -95
- package/src/routes/providers.ts +5 -0
- package/src/routes/runs.ts +28 -3
- package/src/routes/teams.ts +96 -90
|
@@ -149,6 +149,24 @@ const RunAgentIdQueryParam: ParameterSpec = {
|
|
|
149
149
|
schema: { type: 'string', minLength: 1 },
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
+
const RunReplaysQueryParam: ParameterSpec = {
|
|
153
|
+
name: 'replays',
|
|
154
|
+
in: 'query',
|
|
155
|
+
required: false,
|
|
156
|
+
description:
|
|
157
|
+
'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.',
|
|
158
|
+
schema: { type: 'string', enum: ['exclude', 'include', 'only'], default: 'exclude' },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const RunEvalRunIdQueryParam: ParameterSpec = {
|
|
162
|
+
name: 'evalRunId',
|
|
163
|
+
in: 'query',
|
|
164
|
+
required: false,
|
|
165
|
+
description:
|
|
166
|
+
'Only the replay runs of this eval run. Implies replays are included; cannot be combined with `replays=exclude`.',
|
|
167
|
+
schema: { type: 'string', minLength: 1 },
|
|
168
|
+
};
|
|
169
|
+
|
|
152
170
|
const RunIncludeQueryParam: ParameterSpec = {
|
|
153
171
|
name: 'include',
|
|
154
172
|
in: 'query',
|
|
@@ -554,6 +572,15 @@ const CostGroupByQueryParam: ParameterSpec = {
|
|
|
554
572
|
schema: { type: 'string' },
|
|
555
573
|
};
|
|
556
574
|
|
|
575
|
+
const CostAggregateLimitQueryParam: ParameterSpec = {
|
|
576
|
+
name: 'limit',
|
|
577
|
+
in: 'query',
|
|
578
|
+
required: false,
|
|
579
|
+
description:
|
|
580
|
+
'The most groups to return: the most expensive ones (`groups` is ordered by `totalUsd`, highest first). 1 to 10000, default 1000. When there were more, `truncated` is `true` and `totalGroups` says how many; the totals still cover every record.',
|
|
581
|
+
schema: { type: 'integer', minimum: 1, maximum: 10000, default: 1000 },
|
|
582
|
+
};
|
|
583
|
+
|
|
557
584
|
const CostModelQueryParam: ParameterSpec = {
|
|
558
585
|
name: 'model',
|
|
559
586
|
in: 'query',
|
|
@@ -777,7 +804,7 @@ const EvalSuiteKindFilterQueryParam: ParameterSpec = {
|
|
|
777
804
|
in: 'query',
|
|
778
805
|
required: false,
|
|
779
806
|
description:
|
|
780
|
-
'Filter to eval suites of a single kind. Values: `accuracy | pairwise | regression | human-review | benchmark | custom`.',
|
|
807
|
+
'Filter to eval suites of a single kind. Values: `accuracy | pairwise | regression | human-review | benchmark | custom | judged`.',
|
|
781
808
|
schema: { $ref: '#/components/schemas/EvalKind' },
|
|
782
809
|
};
|
|
783
810
|
|
|
@@ -789,6 +816,38 @@ const EvalSuiteNameFilterQueryParam: ParameterSpec = {
|
|
|
789
816
|
schema: { type: 'string' },
|
|
790
817
|
};
|
|
791
818
|
|
|
819
|
+
const BlockIdPathParam: ParameterSpec = {
|
|
820
|
+
name: 'blockId',
|
|
821
|
+
in: 'path',
|
|
822
|
+
required: true,
|
|
823
|
+
description: 'Block id: dotted lowercase (e.g. `acme.intake-prompt`).',
|
|
824
|
+
schema: { type: 'string', minLength: 1 },
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
const BlockVersionPathParam: ParameterSpec = {
|
|
828
|
+
name: 'version',
|
|
829
|
+
in: 'path',
|
|
830
|
+
required: true,
|
|
831
|
+
description: 'Exact block version (`major.minor.patch`).',
|
|
832
|
+
schema: { type: 'string', minLength: 1 },
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
const BlockKindFilterQueryParam: ParameterSpec = {
|
|
836
|
+
name: 'kind',
|
|
837
|
+
in: 'query',
|
|
838
|
+
required: false,
|
|
839
|
+
description: 'Only blocks of this kind: `prompt` or `settings`.',
|
|
840
|
+
schema: { $ref: '#/components/schemas/BlockKind' },
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
const BlockNameFilterQueryParam: ParameterSpec = {
|
|
844
|
+
name: 'name',
|
|
845
|
+
in: 'query',
|
|
846
|
+
required: false,
|
|
847
|
+
description: 'Prefix match on the block id.',
|
|
848
|
+
schema: { type: 'string' },
|
|
849
|
+
};
|
|
850
|
+
|
|
792
851
|
// Admin plane — eval-run data plane.
|
|
793
852
|
|
|
794
853
|
const EvalRunIdPathParam: ParameterSpec = {
|
|
@@ -910,6 +969,75 @@ const SecretNamePathParam: ParameterSpec = {
|
|
|
910
969
|
schema: { type: 'string', minLength: 1 },
|
|
911
970
|
};
|
|
912
971
|
|
|
972
|
+
// ---------------- judgments + judge classes: parameters ----------------
|
|
973
|
+
|
|
974
|
+
const JudgmentIdPathParam: ParameterSpec = {
|
|
975
|
+
name: 'judgmentId',
|
|
976
|
+
in: 'path',
|
|
977
|
+
required: true,
|
|
978
|
+
description: 'Judgment id.',
|
|
979
|
+
schema: { type: 'string', minLength: 1 },
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
const JudgeClassIdPathParam: ParameterSpec = {
|
|
983
|
+
name: 'judgeClassId',
|
|
984
|
+
in: 'path',
|
|
985
|
+
required: true,
|
|
986
|
+
description: 'Judge class id.',
|
|
987
|
+
schema: { type: 'string', minLength: 1 },
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
const judgmentQuery = (name: string, description: string, schema: JsonSchema): ParameterSpec => ({
|
|
991
|
+
name,
|
|
992
|
+
in: 'query',
|
|
993
|
+
required: false,
|
|
994
|
+
description,
|
|
995
|
+
schema,
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
const JudgmentListQueryParams: readonly ParameterSpec[] = [
|
|
999
|
+
judgmentQuery('runId', 'Only judgments of this run.', { type: 'string', minLength: 1 }),
|
|
1000
|
+
judgmentQuery('agentId', 'Only judgments of runs of this agent.', {
|
|
1001
|
+
type: 'string',
|
|
1002
|
+
minLength: 1,
|
|
1003
|
+
}),
|
|
1004
|
+
judgmentQuery('agentVersion', 'Only judgments of runs of this agent version. Needs `agentId`.', {
|
|
1005
|
+
type: 'string',
|
|
1006
|
+
minLength: 1,
|
|
1007
|
+
}),
|
|
1008
|
+
judgmentQuery('flowId', 'Only judgments of runs of this flow.', { type: 'string', minLength: 1 }),
|
|
1009
|
+
judgmentQuery('verdict', 'Only judgments with this verdict.', {
|
|
1010
|
+
type: 'string',
|
|
1011
|
+
enum: ['yes', 'no'],
|
|
1012
|
+
}),
|
|
1013
|
+
judgmentQuery('judgeClassId', 'Only judgments recorded under this judge class.', {
|
|
1014
|
+
type: 'string',
|
|
1015
|
+
minLength: 1,
|
|
1016
|
+
}),
|
|
1017
|
+
judgmentQuery('participantId', "Only judgments made for this app end user's opaque id.", {
|
|
1018
|
+
type: 'string',
|
|
1019
|
+
minLength: 1,
|
|
1020
|
+
}),
|
|
1021
|
+
];
|
|
1022
|
+
|
|
1023
|
+
const JudgeClassScopeKindQueryParam: ParameterSpec = judgmentQuery(
|
|
1024
|
+
'scopeKind',
|
|
1025
|
+
'Only classes of this scope kind. `project` and `agent` need `projectId`; `agent` also needs `agentId`.',
|
|
1026
|
+
{ type: 'string', enum: ['tenant', 'project', 'agent'] },
|
|
1027
|
+
);
|
|
1028
|
+
|
|
1029
|
+
const JudgeClassProjectIdQueryParam: ParameterSpec = judgmentQuery(
|
|
1030
|
+
'projectId',
|
|
1031
|
+
'Project of the scope, for `scopeKind=project|agent`.',
|
|
1032
|
+
{ type: 'string', minLength: 1 },
|
|
1033
|
+
);
|
|
1034
|
+
|
|
1035
|
+
const JudgeClassAgentIdQueryParam: ParameterSpec = judgmentQuery(
|
|
1036
|
+
'agentId',
|
|
1037
|
+
'Agent of the scope, for `scopeKind=agent`.',
|
|
1038
|
+
{ type: 'string', minLength: 1 },
|
|
1039
|
+
);
|
|
1040
|
+
|
|
913
1041
|
// ---------------- shared responses ----------------
|
|
914
1042
|
|
|
915
1043
|
const ErrorResponse = (description: string): ResponseSpec => ({
|
|
@@ -1008,6 +1136,8 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
1008
1136
|
ParentRunIdQueryParam,
|
|
1009
1137
|
TopLevelQueryParam,
|
|
1010
1138
|
RunAgentIdQueryParam,
|
|
1139
|
+
RunReplaysQueryParam,
|
|
1140
|
+
RunEvalRunIdQueryParam,
|
|
1011
1141
|
RunIncludeQueryParam,
|
|
1012
1142
|
],
|
|
1013
1143
|
responses: {
|
|
@@ -1543,6 +1673,27 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
1543
1673
|
'404': ErrorResponse('No agent with that id under this tenant.'),
|
|
1544
1674
|
},
|
|
1545
1675
|
},
|
|
1676
|
+
{
|
|
1677
|
+
method: 'post',
|
|
1678
|
+
honoPath: '/v1/agents/:agentId/versions',
|
|
1679
|
+
openapiPath: '/v1/agents/{agentId}/versions',
|
|
1680
|
+
operationId: 'agents.deriveVersion',
|
|
1681
|
+
summary: 'Derive an agent version with data-block pins swapped',
|
|
1682
|
+
description:
|
|
1683
|
+
"An expert's edit, without a code change: a new agent version that is `from`'s bag with some prompt or settings pins swapped (`derivedFrom: { version, reason: 'edited', label, by }`), numbered the next free patch after the agent's highest version. Only blocks `from` already references swap, to a published, active version of the right kind (model settings for the model-settings block); tool pins come from code. Needs `publish` on the agent.",
|
|
1684
|
+
tags: ['agents'],
|
|
1685
|
+
security: 'bearer',
|
|
1686
|
+
parameters: [AgentIdPathParam, IdempotencyKeyParam],
|
|
1687
|
+
requestBody: { required: true, schema: ref('DeriveAgentVersionBody') },
|
|
1688
|
+
responses: {
|
|
1689
|
+
'201': { description: 'The derived agent version.', schema: ref('Agent') },
|
|
1690
|
+
...CommonMutationErrors,
|
|
1691
|
+
'400': ErrorResponse(
|
|
1692
|
+
"`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`).",
|
|
1693
|
+
),
|
|
1694
|
+
'404': ErrorResponse('`agent-not-found`: no agent at `from`.'),
|
|
1695
|
+
},
|
|
1696
|
+
},
|
|
1546
1697
|
{
|
|
1547
1698
|
method: 'get',
|
|
1548
1699
|
honoPath: '/v1/agents/:agentId/versions/:version',
|
|
@@ -2635,7 +2786,7 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
2635
2786
|
operationId: 'providers.register',
|
|
2636
2787
|
summary: 'Register a model provider',
|
|
2637
2788
|
description:
|
|
2638
|
-
'Body is a full `ProviderMetadata`. Server validates shape: provider-level `id` + `region` non-empty; `models[]` non-empty with unique `name` per entry; per-model `contextWindow` positive integer; per-model `features` against the closed enum; per-model `cost` non-negative; optional per-model `p95LatencyMs` / `maxOutputTokens` well-shaped — same rules as `@kindgi/capabilities.createProviderRegistry`. Secrets (API keys, endpoints) are NOT part of the wire shape; deployments store them inside the binding.',
|
|
2789
|
+
'Body is a full `ProviderMetadata`. Server validates shape: provider-level `id` + `region` non-empty; `models[]` non-empty with unique `name` per entry; per-model `contextWindow` positive integer; per-model `features` against the closed enum; per-model `cost` non-negative; optional per-model `p95LatencyMs` / `maxOutputTokens` well-shaped; optional `labels` within their limits — same rules as `@kindgi/capabilities.createProviderRegistry`. Secrets (API keys, endpoints) are NOT part of the wire shape; deployments store them inside the binding.',
|
|
2639
2790
|
tags: ['providers'],
|
|
2640
2791
|
security: 'bearer',
|
|
2641
2792
|
parameters: [IdempotencyKeyParam],
|
|
@@ -2653,13 +2804,193 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
2653
2804
|
openapiPath: '/v1/providers/{providerId}/unregister',
|
|
2654
2805
|
operationId: 'providers.unregister',
|
|
2655
2806
|
summary: 'Unregister a model provider',
|
|
2807
|
+
description:
|
|
2808
|
+
'A tombstone, not an erase: from then on the provider is gone from list, get and capabilities, and the router never picks it. Its id is free to register again. A retention policy on the `provider` domain purges the row.',
|
|
2656
2809
|
tags: ['providers'],
|
|
2657
2810
|
security: 'bearer',
|
|
2658
2811
|
parameters: [ProviderIdPathParam, IdempotencyKeyParam],
|
|
2659
2812
|
responses: {
|
|
2660
2813
|
'200': { description: 'Unregistered.', schema: ref('UnregisterProviderResult') },
|
|
2661
2814
|
...CommonMutationErrors,
|
|
2662
|
-
'404': ErrorResponse('No provider with that id under this tenant.'),
|
|
2815
|
+
'404': ErrorResponse('No provider with that id under this tenant, or already unregistered.'),
|
|
2816
|
+
},
|
|
2817
|
+
},
|
|
2818
|
+
|
|
2819
|
+
// ---------- judgments ----------
|
|
2820
|
+
{
|
|
2821
|
+
method: 'post',
|
|
2822
|
+
honoPath: '/v1/judgments',
|
|
2823
|
+
openapiPath: '/v1/judgments',
|
|
2824
|
+
operationId: 'judgments.create',
|
|
2825
|
+
summary: "Judge an item of a run's output",
|
|
2826
|
+
description:
|
|
2827
|
+
"Records yes or no, with an optional reason, about one item of a finished run's output, optionally under a judge class that applies to the run's project or agent (unclassified judgments count with weight 1). `item.pointer` (a JSON Pointer) must resolve in the run's output; its value is kept as `itemValue`. The first judgment of a run also stores a copy of the run's input and output. `assertedBy` is the authenticated caller, never the body. Judging again as the same caller for the same run, item key and `participantId` supersedes the earlier judgment. Needs `judge` on the run.",
|
|
2828
|
+
tags: ['judgments'],
|
|
2829
|
+
security: 'bearer',
|
|
2830
|
+
parameters: [IdempotencyKeyParam],
|
|
2831
|
+
requestBody: { required: true, schema: ref('CreateJudgmentBody') },
|
|
2832
|
+
responses: {
|
|
2833
|
+
'201': { description: 'Judgment recorded.', schema: ref('Judgment') },
|
|
2834
|
+
...CommonMutationErrors,
|
|
2835
|
+
'400': ErrorResponse(
|
|
2836
|
+
'Malformed body, or `item-not-found` (the pointer resolves to nothing in the output), or `judge-class-not-applicable`.',
|
|
2837
|
+
),
|
|
2838
|
+
'403': ErrorResponse('`permission-denied`: not allowed to judge this run.'),
|
|
2839
|
+
'404': ErrorResponse('`run-not-found`.'),
|
|
2840
|
+
'409': ErrorResponse('`run-not-finished`: the run has no output to judge yet.'),
|
|
2841
|
+
},
|
|
2842
|
+
},
|
|
2843
|
+
{
|
|
2844
|
+
method: 'get',
|
|
2845
|
+
honoPath: '/v1/judgments',
|
|
2846
|
+
openapiPath: '/v1/judgments',
|
|
2847
|
+
operationId: 'judgments.list',
|
|
2848
|
+
summary: 'List judgments',
|
|
2849
|
+
description:
|
|
2850
|
+
'Live judgments (not removed or superseded), newest first, cursor-paginated. Filter by run, agent (and version), flow, verdict, judge class or participant; `?scopeKind + ?scopeId` narrow to a project.',
|
|
2851
|
+
tags: ['judgments'],
|
|
2852
|
+
security: 'bearer',
|
|
2853
|
+
parameters: [
|
|
2854
|
+
LimitQueryParam,
|
|
2855
|
+
CursorQueryParam,
|
|
2856
|
+
...JudgmentListQueryParams,
|
|
2857
|
+
ScopeKindQueryParam,
|
|
2858
|
+
ScopeIdQueryParam,
|
|
2859
|
+
],
|
|
2860
|
+
responses: {
|
|
2861
|
+
'200': { description: 'Page of judgments.', schema: ref('JudgmentCollectionPage') },
|
|
2862
|
+
...CommonAuthErrors,
|
|
2863
|
+
'400': ErrorResponse('Malformed query parameter.'),
|
|
2864
|
+
},
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
method: 'get',
|
|
2868
|
+
honoPath: '/v1/judgments/:judgmentId',
|
|
2869
|
+
openapiPath: '/v1/judgments/{judgmentId}',
|
|
2870
|
+
operationId: 'judgments.get',
|
|
2871
|
+
summary: 'Fetch a judgment with its copies',
|
|
2872
|
+
description:
|
|
2873
|
+
"Returns the judgment (live or not) with the stored copy of the run's input and output and, when the judgment pointed at an item, its value.",
|
|
2874
|
+
tags: ['judgments'],
|
|
2875
|
+
security: 'bearer',
|
|
2876
|
+
parameters: [JudgmentIdPathParam],
|
|
2877
|
+
responses: {
|
|
2878
|
+
'200': { description: 'Judgment with copies.', schema: ref('JudgmentWithCopies') },
|
|
2879
|
+
...CommonAuthErrors,
|
|
2880
|
+
'404': ErrorResponse('No judgment with that id under this tenant.'),
|
|
2881
|
+
},
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
method: 'post',
|
|
2885
|
+
honoPath: '/v1/judgments/:judgmentId/unregister',
|
|
2886
|
+
openapiPath: '/v1/judgments/{judgmentId}/unregister',
|
|
2887
|
+
operationId: 'judgments.unregister',
|
|
2888
|
+
summary: 'Remove a judgment',
|
|
2889
|
+
description:
|
|
2890
|
+
'Soft delete: the judgment stops listing; retention policy decides when it is purged.',
|
|
2891
|
+
tags: ['judgments'],
|
|
2892
|
+
security: 'bearer',
|
|
2893
|
+
parameters: [JudgmentIdPathParam, IdempotencyKeyParam],
|
|
2894
|
+
responses: {
|
|
2895
|
+
'200': { description: 'Removed.', schema: ref('UnregisterJudgmentResult') },
|
|
2896
|
+
...CommonMutationErrors,
|
|
2897
|
+
'403': ErrorResponse('`permission-denied`.'),
|
|
2898
|
+
'404': ErrorResponse('No live judgment with that id under this tenant.'),
|
|
2899
|
+
},
|
|
2900
|
+
},
|
|
2901
|
+
|
|
2902
|
+
// ---------- judge classes ----------
|
|
2903
|
+
{
|
|
2904
|
+
method: 'post',
|
|
2905
|
+
honoPath: '/v1/judge-classes',
|
|
2906
|
+
openapiPath: '/v1/judge-classes',
|
|
2907
|
+
operationId: 'judgeClasses.create',
|
|
2908
|
+
summary: 'Create a judge class',
|
|
2909
|
+
description:
|
|
2910
|
+
'A named kind of judge with a weight, scoped to the tenant, a project, or an agent in a project. Names are unique among the live classes of a scope. Needs `admin` on the tenant (tenant scope) or the project.',
|
|
2911
|
+
tags: ['judge-classes'],
|
|
2912
|
+
security: 'bearer',
|
|
2913
|
+
parameters: [IdempotencyKeyParam],
|
|
2914
|
+
requestBody: { required: true, schema: ref('CreateJudgeClassBody') },
|
|
2915
|
+
responses: {
|
|
2916
|
+
'201': { description: 'Judge class created.', schema: ref('JudgeClass') },
|
|
2917
|
+
...CommonMutationErrors,
|
|
2918
|
+
'403': ErrorResponse('`permission-denied`.'),
|
|
2919
|
+
'409': ErrorResponse('`judge-class-name-taken`, or an idempotency conflict.'),
|
|
2920
|
+
},
|
|
2921
|
+
},
|
|
2922
|
+
{
|
|
2923
|
+
method: 'get',
|
|
2924
|
+
honoPath: '/v1/judge-classes',
|
|
2925
|
+
openapiPath: '/v1/judge-classes',
|
|
2926
|
+
operationId: 'judgeClasses.list',
|
|
2927
|
+
summary: 'List judge classes',
|
|
2928
|
+
description:
|
|
2929
|
+
'Live classes, newest first, cursor-paginated. `?scopeKind=tenant|project|agent` (with `projectId` / `agentId`) narrows to one scope.',
|
|
2930
|
+
tags: ['judge-classes'],
|
|
2931
|
+
security: 'bearer',
|
|
2932
|
+
parameters: [
|
|
2933
|
+
LimitQueryParam,
|
|
2934
|
+
CursorQueryParam,
|
|
2935
|
+
JudgeClassScopeKindQueryParam,
|
|
2936
|
+
JudgeClassProjectIdQueryParam,
|
|
2937
|
+
JudgeClassAgentIdQueryParam,
|
|
2938
|
+
],
|
|
2939
|
+
responses: {
|
|
2940
|
+
'200': { description: 'Page of judge classes.', schema: ref('JudgeClassCollectionPage') },
|
|
2941
|
+
...CommonAuthErrors,
|
|
2942
|
+
'400': ErrorResponse('Malformed scope parameters.'),
|
|
2943
|
+
},
|
|
2944
|
+
},
|
|
2945
|
+
{
|
|
2946
|
+
method: 'get',
|
|
2947
|
+
honoPath: '/v1/judge-classes/:judgeClassId',
|
|
2948
|
+
openapiPath: '/v1/judge-classes/{judgeClassId}',
|
|
2949
|
+
operationId: 'judgeClasses.get',
|
|
2950
|
+
summary: 'Fetch a judge class',
|
|
2951
|
+
description:
|
|
2952
|
+
'Also returns a retired class (`unregisteredAt` set): judgments keep naming theirs.',
|
|
2953
|
+
tags: ['judge-classes'],
|
|
2954
|
+
security: 'bearer',
|
|
2955
|
+
parameters: [JudgeClassIdPathParam],
|
|
2956
|
+
responses: {
|
|
2957
|
+
'200': { description: 'Judge class.', schema: ref('JudgeClass') },
|
|
2958
|
+
...CommonAuthErrors,
|
|
2959
|
+
'404': ErrorResponse('No judge class with that id under this tenant.'),
|
|
2960
|
+
},
|
|
2961
|
+
},
|
|
2962
|
+
{
|
|
2963
|
+
method: 'patch',
|
|
2964
|
+
honoPath: '/v1/judge-classes/:judgeClassId',
|
|
2965
|
+
openapiPath: '/v1/judge-classes/{judgeClassId}',
|
|
2966
|
+
operationId: 'judgeClasses.update',
|
|
2967
|
+
summary: "Change a judge class's weight or description",
|
|
2968
|
+
tags: ['judge-classes'],
|
|
2969
|
+
security: 'bearer',
|
|
2970
|
+
parameters: [JudgeClassIdPathParam, IdempotencyKeyParam],
|
|
2971
|
+
requestBody: { required: true, schema: ref('UpdateJudgeClassBody') },
|
|
2972
|
+
responses: {
|
|
2973
|
+
'200': { description: 'Updated judge class.', schema: ref('JudgeClass') },
|
|
2974
|
+
...CommonMutationErrors,
|
|
2975
|
+
'403': ErrorResponse('`permission-denied`.'),
|
|
2976
|
+
'404': ErrorResponse('No live judge class with that id under this tenant.'),
|
|
2977
|
+
},
|
|
2978
|
+
},
|
|
2979
|
+
{
|
|
2980
|
+
method: 'post',
|
|
2981
|
+
honoPath: '/v1/judge-classes/:judgeClassId/unregister',
|
|
2982
|
+
openapiPath: '/v1/judge-classes/{judgeClassId}/unregister',
|
|
2983
|
+
operationId: 'judgeClasses.unregister',
|
|
2984
|
+
summary: 'Retire a judge class',
|
|
2985
|
+
description: 'No new judgments may name it; existing judgments keep it.',
|
|
2986
|
+
tags: ['judge-classes'],
|
|
2987
|
+
security: 'bearer',
|
|
2988
|
+
parameters: [JudgeClassIdPathParam, IdempotencyKeyParam],
|
|
2989
|
+
responses: {
|
|
2990
|
+
'200': { description: 'Retired.', schema: ref('UnregisterJudgeClassResult') },
|
|
2991
|
+
...CommonMutationErrors,
|
|
2992
|
+
'403': ErrorResponse('`permission-denied`.'),
|
|
2993
|
+
'404': ErrorResponse('No live judge class with that id under this tenant.'),
|
|
2663
2994
|
},
|
|
2664
2995
|
},
|
|
2665
2996
|
|
|
@@ -2880,11 +3211,12 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
2880
3211
|
operationId: 'cost.aggregate',
|
|
2881
3212
|
summary: 'Aggregate cost across a time window',
|
|
2882
3213
|
description:
|
|
2883
|
-
"Primary consumer path for dashboards. `groupBy` is required (comma-separated dimensions from the closed set); time range is required (both `from` and `to`, or both omitted for the default last-30-days window echoed back in `timeRange`). Filters compose on top of the time window. `?scopeKind + ?scopeId` narrow the aggregate to a scope: `org` covers every project in the org, so one call sums an org's spend. Each group, and the total, carries its cost and its token sums (`tokens`). `inherit` has no effect on cost records, which always belong to a project.",
|
|
3214
|
+
"Primary consumer path for dashboards. `groupBy` is required (comma-separated dimensions from the closed set); time range is required (both `from` and `to`, or both omitted for the default last-30-days window echoed back in `timeRange`). Filters compose on top of the time window. `?scopeKind + ?scopeId` narrow the aggregate to a scope: `org` covers every project in the org, so one call sums an org's spend. Each group, and the total, carries its cost and its token sums (`tokens`). `groups` is ordered by `totalUsd`, highest first (ties by key), and capped at `limit` (default 1000): `truncated` and `totalGroups` say when there were more, and the totals still cover every record. For every record, page through `/v1/cost/records`. `inherit` has no effect on cost records, which always belong to a project.",
|
|
2884
3215
|
tags: ['cost'],
|
|
2885
3216
|
security: 'bearer',
|
|
2886
3217
|
parameters: [
|
|
2887
3218
|
CostGroupByQueryParam,
|
|
3219
|
+
CostAggregateLimitQueryParam,
|
|
2888
3220
|
CostFromQueryParam,
|
|
2889
3221
|
CostToQueryParam,
|
|
2890
3222
|
CostCategoryQueryParam,
|
|
@@ -3072,7 +3404,7 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
3072
3404
|
operationId: 'policies.publish',
|
|
3073
3405
|
summary: 'Publish a policy',
|
|
3074
3406
|
description:
|
|
3075
|
-
"Body is a full `Policy` — the server validates top-level shape (id, tenantId, semver version, kind ∈ closed enum, spec is an object). Deeper `spec` validation is the runtime consumer's responsibility per kind. Re-publishing an existing `(policyId, version)` returns `409 policy-already-registered`. Idempotency-Key applies (retries with the same key replay the original 201).",
|
|
3407
|
+
"Body is a full `Policy` — the server validates top-level shape (id, tenantId, semver version, kind ∈ closed enum, spec is an object). Deeper `spec` validation is the runtime consumer's responsibility per kind. Re-publishing an existing `(policyId, version)` returns `409 policy-already-registered`. 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).",
|
|
3076
3408
|
tags: ['policies'],
|
|
3077
3409
|
security: 'bearer',
|
|
3078
3410
|
parameters: [IdempotencyKeyParam],
|
|
@@ -3080,7 +3412,9 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
3080
3412
|
responses: {
|
|
3081
3413
|
'201': { description: 'Policy published.', schema: ref('PublishPolicyResult') },
|
|
3082
3414
|
...CommonMutationErrors,
|
|
3083
|
-
'400': ErrorResponse(
|
|
3415
|
+
'400': ErrorResponse(
|
|
3416
|
+
'Validation failed (see `details.issues`), or `kind-not-applied`: no runtime consumer applies that kind yet.',
|
|
3417
|
+
),
|
|
3084
3418
|
'409': ErrorResponse('Policy already registered at that (id, version).'),
|
|
3085
3419
|
},
|
|
3086
3420
|
},
|
|
@@ -3211,6 +3545,48 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
3211
3545
|
'409': ErrorResponse('Eval suite already registered at that (id, version).'),
|
|
3212
3546
|
},
|
|
3213
3547
|
},
|
|
3548
|
+
{
|
|
3549
|
+
method: 'post',
|
|
3550
|
+
honoPath: '/v1/eval-suites/:suiteId/versions/from-judgments',
|
|
3551
|
+
openapiPath: '/v1/eval-suites/{suiteId}/versions/from-judgments',
|
|
3552
|
+
operationId: 'evalSuites.buildFromJudgments',
|
|
3553
|
+
summary: 'Build a test set from judgments',
|
|
3554
|
+
description:
|
|
3555
|
+
"Publishes a `judged` eval suite version whose cases are copies of judged runs of one agent (optionally one version) or flow, newest first, at most 1000. Each case holds the run's input, what the turn read (`context`), the judged output, and each item's judgments summed up: yes and no counts, the weight behind yes and behind all judgments (an unclassified judgment counts 1), and the reasons. `judgeClassIds` counts only judgments of those classes; `minJudgments` leaves out runs with fewer. Needs `admin` on the project.",
|
|
3556
|
+
tags: ['eval-suites'],
|
|
3557
|
+
security: 'bearer',
|
|
3558
|
+
parameters: [EvalSuiteIdPathParam, IdempotencyKeyParam],
|
|
3559
|
+
requestBody: { required: true, schema: ref('BuildJudgedSuiteBody') },
|
|
3560
|
+
responses: {
|
|
3561
|
+
'201': { description: 'Version published.', schema: ref('BuildJudgedSuiteResult') },
|
|
3562
|
+
...CommonMutationErrors,
|
|
3563
|
+
'400': ErrorResponse('Malformed body.'),
|
|
3564
|
+
'403': ErrorResponse('`permission-denied`.'),
|
|
3565
|
+
'409': ErrorResponse('Eval suite already registered at that (id, version).'),
|
|
3566
|
+
'501': ErrorResponse('`test-sets-not-supported`: this deployment cannot build test sets.'),
|
|
3567
|
+
},
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
method: 'get',
|
|
3571
|
+
honoPath: '/v1/eval-suites/:suiteId/versions/:version/cases',
|
|
3572
|
+
openapiPath: '/v1/eval-suites/{suiteId}/versions/{version}/cases',
|
|
3573
|
+
operationId: 'evalSuites.listCases',
|
|
3574
|
+
summary: 'List the cases of a judged eval suite version',
|
|
3575
|
+
description: 'Cursor-paginated, in the order the cases were stored (newest judged run first).',
|
|
3576
|
+
tags: ['eval-suites'],
|
|
3577
|
+
security: 'bearer',
|
|
3578
|
+
parameters: [
|
|
3579
|
+
EvalSuiteIdPathParam,
|
|
3580
|
+
EvalSuiteVersionPathParam,
|
|
3581
|
+
LimitQueryParam,
|
|
3582
|
+
CursorQueryParam,
|
|
3583
|
+
],
|
|
3584
|
+
responses: {
|
|
3585
|
+
'200': { description: 'Page of cases.', schema: ref('JudgedEvalCaseCollectionPage') },
|
|
3586
|
+
...CommonAuthErrors,
|
|
3587
|
+
'404': ErrorResponse('No eval suite with that id.'),
|
|
3588
|
+
},
|
|
3589
|
+
},
|
|
3214
3590
|
{
|
|
3215
3591
|
method: 'post',
|
|
3216
3592
|
honoPath: '/v1/eval-suites/:suiteId/versions/:version/unregister',
|
|
@@ -3245,6 +3621,139 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
3245
3621
|
},
|
|
3246
3622
|
|
|
3247
3623
|
// ---------- eval runs (data plane) ----------
|
|
3624
|
+
{
|
|
3625
|
+
method: 'get',
|
|
3626
|
+
honoPath: '/v1/blocks',
|
|
3627
|
+
openapiPath: '/v1/blocks',
|
|
3628
|
+
operationId: 'blocks.list',
|
|
3629
|
+
summary: 'List data blocks (latest version of each)',
|
|
3630
|
+
description:
|
|
3631
|
+
'Cursor-paginated. Only the blocks of projects the caller can read. `?kind=` narrows to prompts or settings, `?name=` is a prefix match on the id, and `?scopeKind=` + `?scopeId=` narrow to a project or an org, as the other lists do.',
|
|
3632
|
+
tags: ['blocks'],
|
|
3633
|
+
security: 'bearer',
|
|
3634
|
+
parameters: [
|
|
3635
|
+
LimitQueryParam,
|
|
3636
|
+
CursorQueryParam,
|
|
3637
|
+
BlockKindFilterQueryParam,
|
|
3638
|
+
BlockNameFilterQueryParam,
|
|
3639
|
+
ScopeKindQueryParam,
|
|
3640
|
+
ScopeIdQueryParam,
|
|
3641
|
+
],
|
|
3642
|
+
responses: {
|
|
3643
|
+
'200': { description: 'Page of blocks.', schema: ref('BlockCollectionPage') },
|
|
3644
|
+
...CommonAuthErrors,
|
|
3645
|
+
'400': ErrorResponse(
|
|
3646
|
+
'Malformed query parameter: an unknown `kind`, or `scope-invalid` for a malformed scope.',
|
|
3647
|
+
),
|
|
3648
|
+
},
|
|
3649
|
+
},
|
|
3650
|
+
{
|
|
3651
|
+
method: 'get',
|
|
3652
|
+
honoPath: '/v1/blocks/:blockId',
|
|
3653
|
+
openapiPath: '/v1/blocks/{blockId}',
|
|
3654
|
+
operationId: 'blocks.get',
|
|
3655
|
+
summary: 'Fetch a data block (latest version)',
|
|
3656
|
+
tags: ['blocks'],
|
|
3657
|
+
security: 'bearer',
|
|
3658
|
+
parameters: [BlockIdPathParam],
|
|
3659
|
+
responses: {
|
|
3660
|
+
'200': { description: 'Latest active version.', schema: ref('Block') },
|
|
3661
|
+
...CommonAuthErrors,
|
|
3662
|
+
'404': ErrorResponse(
|
|
3663
|
+
"`block-not-found`: no such block, or one in a project the caller can't read.",
|
|
3664
|
+
),
|
|
3665
|
+
},
|
|
3666
|
+
},
|
|
3667
|
+
{
|
|
3668
|
+
method: 'get',
|
|
3669
|
+
honoPath: '/v1/blocks/:blockId/versions',
|
|
3670
|
+
openapiPath: '/v1/blocks/{blockId}/versions',
|
|
3671
|
+
operationId: 'blocks.versions.list',
|
|
3672
|
+
summary: 'List versions of a data block',
|
|
3673
|
+
description:
|
|
3674
|
+
'Newest published first. `?includeTombstoned=true` includes unregistered versions, each with `unregisteredAt`.',
|
|
3675
|
+
tags: ['blocks'],
|
|
3676
|
+
security: 'bearer',
|
|
3677
|
+
parameters: [BlockIdPathParam, LimitQueryParam, CursorQueryParam, IncludeTombstonedQueryParam],
|
|
3678
|
+
responses: {
|
|
3679
|
+
'200': { description: 'Page of versions.', schema: ref('BlockCollectionPage') },
|
|
3680
|
+
...CommonAuthErrors,
|
|
3681
|
+
'404': ErrorResponse('`block-not-found`.'),
|
|
3682
|
+
},
|
|
3683
|
+
},
|
|
3684
|
+
{
|
|
3685
|
+
method: 'get',
|
|
3686
|
+
honoPath: '/v1/blocks/:blockId/versions/:version',
|
|
3687
|
+
openapiPath: '/v1/blocks/{blockId}/versions/{version}',
|
|
3688
|
+
operationId: 'blocks.versions.get',
|
|
3689
|
+
summary: 'Fetch a specific data block version',
|
|
3690
|
+
description: 'An unregistered version is returned too, with `unregisteredAt`.',
|
|
3691
|
+
tags: ['blocks'],
|
|
3692
|
+
security: 'bearer',
|
|
3693
|
+
parameters: [BlockIdPathParam, BlockVersionPathParam],
|
|
3694
|
+
responses: {
|
|
3695
|
+
'200': { description: 'The block at that version.', schema: ref('Block') },
|
|
3696
|
+
...CommonAuthErrors,
|
|
3697
|
+
'404': ErrorResponse('`block-not-found`.'),
|
|
3698
|
+
},
|
|
3699
|
+
},
|
|
3700
|
+
{
|
|
3701
|
+
method: 'post',
|
|
3702
|
+
honoPath: '/v1/blocks',
|
|
3703
|
+
openapiPath: '/v1/blocks',
|
|
3704
|
+
operationId: 'blocks.publish',
|
|
3705
|
+
summary: 'Publish a data block version',
|
|
3706
|
+
description:
|
|
3707
|
+
"Needs `write` on the project. A prompt's template must parse as Liquid; a settings block's `values` must satisfy its `schema` and the latest version's. A taken version is `409 block-already-registered` (versions never change); a block keeps its kind, and its versions stay in its first version's project (`409 block-project-mismatch`). Idempotency-Key applies.",
|
|
3708
|
+
tags: ['blocks'],
|
|
3709
|
+
security: 'bearer',
|
|
3710
|
+
parameters: [IdempotencyKeyParam],
|
|
3711
|
+
requestBody: { required: true, schema: ref('PublishBlockBody') },
|
|
3712
|
+
responses: {
|
|
3713
|
+
'201': { description: 'Published.', schema: ref('PublishBlockResult') },
|
|
3714
|
+
...CommonMutationErrors,
|
|
3715
|
+
'400': ErrorResponse(
|
|
3716
|
+
'`validation-failed` (see `details.issues`), or an unknown `projectId`.',
|
|
3717
|
+
),
|
|
3718
|
+
'403': ErrorResponse('`permission-denied`: no `write` on the project.'),
|
|
3719
|
+
'409': ErrorResponse('`block-already-registered` or `block-project-mismatch`.'),
|
|
3720
|
+
},
|
|
3721
|
+
},
|
|
3722
|
+
{
|
|
3723
|
+
method: 'post',
|
|
3724
|
+
honoPath: '/v1/blocks/:blockId/versions/:version/unregister',
|
|
3725
|
+
openapiPath: '/v1/blocks/{blockId}/versions/{version}/unregister',
|
|
3726
|
+
operationId: 'blocks.versions.unregister',
|
|
3727
|
+
summary: 'Unregister a data block version',
|
|
3728
|
+
description:
|
|
3729
|
+
'Soft: no range picks it any more, but the agent versions that pin it keep running it, and GET still reads it. Needs `write` on the project.',
|
|
3730
|
+
tags: ['blocks'],
|
|
3731
|
+
security: 'bearer',
|
|
3732
|
+
parameters: [BlockIdPathParam, BlockVersionPathParam, IdempotencyKeyParam],
|
|
3733
|
+
responses: {
|
|
3734
|
+
'200': { description: 'Unregistered.', schema: ref('UnregisterBlockResult') },
|
|
3735
|
+
...CommonMutationErrors,
|
|
3736
|
+
'403': ErrorResponse('`permission-denied`: no `write` on the project.'),
|
|
3737
|
+
'404': ErrorResponse('`block-not-found`, or already unregistered.'),
|
|
3738
|
+
},
|
|
3739
|
+
},
|
|
3740
|
+
{
|
|
3741
|
+
method: 'post',
|
|
3742
|
+
honoPath: '/v1/blocks/:blockId/versions/:version/reinstate',
|
|
3743
|
+
openapiPath: '/v1/blocks/{blockId}/versions/{version}/reinstate',
|
|
3744
|
+
operationId: 'blocks.versions.reinstate',
|
|
3745
|
+
summary: 'Reinstate an unregistered data block version',
|
|
3746
|
+
description: 'Unchanged, as published. Idempotent. Needs `write` on the project.',
|
|
3747
|
+
tags: ['blocks'],
|
|
3748
|
+
security: 'bearer',
|
|
3749
|
+
parameters: [BlockIdPathParam, BlockVersionPathParam, IdempotencyKeyParam],
|
|
3750
|
+
responses: {
|
|
3751
|
+
'200': { description: 'Reinstated.', schema: ref('ReinstateBlockResult') },
|
|
3752
|
+
...CommonMutationErrors,
|
|
3753
|
+
'403': ErrorResponse('`permission-denied`: no `write` on the project.'),
|
|
3754
|
+
'404': ErrorResponse('`block-not-found`.'),
|
|
3755
|
+
},
|
|
3756
|
+
},
|
|
3248
3757
|
{
|
|
3249
3758
|
method: 'post',
|
|
3250
3759
|
honoPath: '/v1/eval-suites/:suiteId/runs',
|
|
@@ -4053,7 +4562,7 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
4053
4562
|
operationId: 'orgs.delete',
|
|
4054
4563
|
summary: 'Delete an org (idempotent)',
|
|
4055
4564
|
description:
|
|
4056
|
-
'Idempotent
|
|
4565
|
+
"A tombstone, not an erase: from then on the org is gone from get and list, and its slug is free for a new org. Its projects and teams stay, without an org; when one of those projects has the slug of a project that has none, nothing is deleted: `409 slug-conflict` names the slugs (rename or move those projects first). In the Kindgi runtime, the org's own secrets and secret mappings are deleted with it, for good, and its own environments and MCP endpoints are unregistered. A retention policy on the `org` domain purges the org's row. Idempotent: deleting an unknown or already-deleted org returns 204.",
|
|
4057
4566
|
tags: ['orgs'],
|
|
4058
4567
|
security: 'bearer',
|
|
4059
4568
|
parameters: [
|
|
@@ -4069,6 +4578,9 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
4069
4578
|
responses: {
|
|
4070
4579
|
'204': { description: 'Deleted (or already absent). No body.' },
|
|
4071
4580
|
...CommonAuthErrors,
|
|
4581
|
+
'409': ErrorResponse(
|
|
4582
|
+
"slug-conflict: the org's projects would leave it with slugs that projects without an org already have.",
|
|
4583
|
+
),
|
|
4072
4584
|
},
|
|
4073
4585
|
},
|
|
4074
4586
|
|
|
@@ -4372,6 +4884,8 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
4372
4884
|
openapiPath: '/v1/projects',
|
|
4373
4885
|
operationId: 'projects.create',
|
|
4374
4886
|
summary: 'Create a project',
|
|
4887
|
+
description:
|
|
4888
|
+
"A project's slug is unique within its org, and a project without an org's among the tenant's projects without one: two orgs may each have a project with the same slug. A taken slug answers `409 slug-conflict`; a second Default, `409 project-default-already-exists`.",
|
|
4375
4889
|
tags: ['projects'],
|
|
4376
4890
|
security: 'bearer',
|
|
4377
4891
|
parameters: [IdempotencyKeyParam],
|
|
@@ -4410,6 +4924,8 @@ export const OPERATIONS: readonly OperationSpec[] = [
|
|
|
4410
4924
|
openapiPath: '/v1/projects/{projectId}',
|
|
4411
4925
|
operationId: 'projects.update',
|
|
4412
4926
|
summary: 'Partially update a project',
|
|
4927
|
+
description:
|
|
4928
|
+
'A new `slug`, or a move to another org (`orgId`, or `null` for none), answers `409 slug-conflict` when the slug is taken where the project ends up.',
|
|
4413
4929
|
tags: ['projects'],
|
|
4414
4930
|
security: 'bearer',
|
|
4415
4931
|
parameters: [
|