@kindgi/api 0.0.0-bootstrap.0 → 0.1.1
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/LICENSE +201 -0
- package/README.md +216 -1
- package/dist/adapter-binding.d.ts +177 -0
- package/dist/adapter-binding.d.ts.map +1 -0
- package/dist/adapter-binding.js +12 -0
- package/dist/adapter-binding.js.map +1 -0
- package/dist/agent-binding.d.ts +207 -0
- package/dist/agent-binding.d.ts.map +1 -0
- package/dist/agent-binding.js +4 -0
- package/dist/agent-binding.js.map +1 -0
- package/dist/app.d.ts +770 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +397 -0
- package/dist/app.js.map +1 -0
- package/dist/capability-binding.d.ts +76 -0
- package/dist/capability-binding.d.ts.map +1 -0
- package/dist/capability-binding.js +4 -0
- package/dist/capability-binding.js.map +1 -0
- package/dist/cost-binding.d.ts +175 -0
- package/dist/cost-binding.d.ts.map +1 -0
- package/dist/cost-binding.js +13 -0
- package/dist/cost-binding.js.map +1 -0
- package/dist/deployment-binding.d.ts +201 -0
- package/dist/deployment-binding.d.ts.map +1 -0
- package/dist/deployment-binding.js +4 -0
- package/dist/deployment-binding.js.map +1 -0
- package/dist/env-binding.d.ts +132 -0
- package/dist/env-binding.d.ts.map +1 -0
- package/dist/env-binding.js +4 -0
- package/dist/env-binding.js.map +1 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +268 -0
- package/dist/errors.js.map +1 -0
- package/dist/eval-run-binding.d.ts +196 -0
- package/dist/eval-run-binding.d.ts.map +1 -0
- package/dist/eval-run-binding.js +16 -0
- package/dist/eval-run-binding.js.map +1 -0
- package/dist/eval-run-dispatcher.d.ts +131 -0
- package/dist/eval-run-dispatcher.d.ts.map +1 -0
- package/dist/eval-run-dispatcher.js +368 -0
- package/dist/eval-run-dispatcher.js.map +1 -0
- package/dist/eval-suite-binding.d.ts +227 -0
- package/dist/eval-suite-binding.d.ts.map +1 -0
- package/dist/eval-suite-binding.js +24 -0
- package/dist/eval-suite-binding.js.map +1 -0
- package/dist/event-bus-binding.d.ts +107 -0
- package/dist/event-bus-binding.d.ts.map +1 -0
- package/dist/event-bus-binding.js +5 -0
- package/dist/event-bus-binding.js.map +1 -0
- package/dist/flow-binding.d.ts +194 -0
- package/dist/flow-binding.d.ts.map +1 -0
- package/dist/flow-binding.js +4 -0
- package/dist/flow-binding.js.map +1 -0
- package/dist/guardrail-binding.d.ts +138 -0
- package/dist/guardrail-binding.d.ts.map +1 -0
- package/dist/guardrail-binding.js +4 -0
- package/dist/guardrail-binding.js.map +1 -0
- package/dist/handler-binding.d.ts +126 -0
- package/dist/handler-binding.d.ts.map +1 -0
- package/dist/handler-binding.js +4 -0
- package/dist/handler-binding.js.map +1 -0
- package/dist/hitl-binding.d.ts +115 -0
- package/dist/hitl-binding.d.ts.map +1 -0
- package/dist/hitl-binding.js +4 -0
- package/dist/hitl-binding.js.map +1 -0
- package/dist/identity-directory-binding.d.ts +116 -0
- package/dist/identity-directory-binding.d.ts.map +1 -0
- package/dist/identity-directory-binding.js +4 -0
- package/dist/identity-directory-binding.js.map +1 -0
- package/dist/identity-provider-binding.d.ts +184 -0
- package/dist/identity-provider-binding.d.ts.map +1 -0
- package/dist/identity-provider-binding.js +4 -0
- package/dist/identity-provider-binding.js.map +1 -0
- package/dist/image-registry-binding.d.ts +165 -0
- package/dist/image-registry-binding.d.ts.map +1 -0
- package/dist/image-registry-binding.js +4 -0
- package/dist/image-registry-binding.js.map +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/key-management-binding.d.ts +101 -0
- package/dist/key-management-binding.d.ts.map +1 -0
- package/dist/key-management-binding.js +4 -0
- package/dist/key-management-binding.js.map +1 -0
- package/dist/mcp-endpoint-binding.d.ts +312 -0
- package/dist/mcp-endpoint-binding.d.ts.map +1 -0
- package/dist/mcp-endpoint-binding.js +12 -0
- package/dist/mcp-endpoint-binding.js.map +1 -0
- package/dist/memory-binding.d.ts +209 -0
- package/dist/memory-binding.d.ts.map +1 -0
- package/dist/memory-binding.js +4 -0
- package/dist/memory-binding.js.map +1 -0
- package/dist/middleware/auth.d.ts +168 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +247 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/authorize.d.ts +26 -0
- package/dist/middleware/authorize.d.ts.map +1 -0
- package/dist/middleware/authorize.js +65 -0
- package/dist/middleware/authorize.js.map +1 -0
- package/dist/middleware/error-mapper.d.ts +20 -0
- package/dist/middleware/error-mapper.d.ts.map +1 -0
- package/dist/middleware/error-mapper.js +34 -0
- package/dist/middleware/error-mapper.js.map +1 -0
- package/dist/middleware/idempotency.d.ts +43 -0
- package/dist/middleware/idempotency.d.ts.map +1 -0
- package/dist/middleware/idempotency.js +118 -0
- package/dist/middleware/idempotency.js.map +1 -0
- package/dist/middleware/principal.d.ts +4 -0
- package/dist/middleware/principal.d.ts.map +1 -0
- package/dist/middleware/principal.js +42 -0
- package/dist/middleware/principal.js.map +1 -0
- package/dist/middleware/public-run-routes.d.ts +16 -0
- package/dist/middleware/public-run-routes.d.ts.map +1 -0
- package/dist/middleware/public-run-routes.js +43 -0
- package/dist/middleware/public-run-routes.js.map +1 -0
- package/dist/middleware/request-id.d.ts +14 -0
- package/dist/middleware/request-id.d.ts.map +1 -0
- package/dist/middleware/request-id.js +24 -0
- package/dist/middleware/request-id.js.map +1 -0
- package/dist/middleware/sigv4-verify.d.ts +64 -0
- package/dist/middleware/sigv4-verify.d.ts.map +1 -0
- package/dist/middleware/sigv4-verify.js +286 -0
- package/dist/middleware/sigv4-verify.js.map +1 -0
- package/dist/middleware/sigv4.d.ts +25 -0
- package/dist/middleware/sigv4.d.ts.map +1 -0
- package/dist/middleware/sigv4.js +120 -0
- package/dist/middleware/sigv4.js.map +1 -0
- package/dist/openapi/generate.d.ts +15 -0
- package/dist/openapi/generate.d.ts.map +1 -0
- package/dist/openapi/generate.js +241 -0
- package/dist/openapi/generate.js.map +1 -0
- package/dist/openapi/operations.d.ts +70 -0
- package/dist/openapi/operations.d.ts.map +1 -0
- package/dist/openapi/operations.js +5050 -0
- package/dist/openapi/operations.js.map +1 -0
- package/dist/openapi/schemas.d.ts +590 -0
- package/dist/openapi/schemas.d.ts.map +1 -0
- package/dist/openapi/schemas.js +5820 -0
- package/dist/openapi/schemas.js.map +1 -0
- package/dist/provenance-binding.d.ts +116 -0
- package/dist/provenance-binding.d.ts.map +1 -0
- package/dist/provenance-binding.js +31 -0
- package/dist/provenance-binding.js.map +1 -0
- package/dist/provider-binding.d.ts +174 -0
- package/dist/provider-binding.d.ts.map +1 -0
- package/dist/provider-binding.js +4 -0
- package/dist/provider-binding.js.map +1 -0
- package/dist/public-run-token.d.ts +97 -0
- package/dist/public-run-token.d.ts.map +1 -0
- package/dist/public-run-token.js +167 -0
- package/dist/public-run-token.js.map +1 -0
- package/dist/retention-binding.d.ts +69 -0
- package/dist/retention-binding.d.ts.map +1 -0
- package/dist/retention-binding.js +4 -0
- package/dist/retention-binding.js.map +1 -0
- package/dist/reviewer-binding.d.ts +84 -0
- package/dist/reviewer-binding.d.ts.map +1 -0
- package/dist/reviewer-binding.js +4 -0
- package/dist/reviewer-binding.js.map +1 -0
- package/dist/rotation-status-store.d.ts +96 -0
- package/dist/rotation-status-store.d.ts.map +1 -0
- package/dist/rotation-status-store.js +106 -0
- package/dist/rotation-status-store.js.map +1 -0
- package/dist/routes/adapters.d.ts +29 -0
- package/dist/routes/adapters.d.ts.map +1 -0
- package/dist/routes/adapters.js +230 -0
- package/dist/routes/adapters.js.map +1 -0
- package/dist/routes/agents.d.ts +17 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +342 -0
- package/dist/routes/agents.js.map +1 -0
- package/dist/routes/approvals.d.ts +37 -0
- package/dist/routes/approvals.d.ts.map +1 -0
- package/dist/routes/approvals.js +551 -0
- package/dist/routes/approvals.js.map +1 -0
- package/dist/routes/artifacts.d.ts +25 -0
- package/dist/routes/artifacts.d.ts.map +1 -0
- package/dist/routes/artifacts.js +265 -0
- package/dist/routes/artifacts.js.map +1 -0
- package/dist/routes/audit.d.ts +6 -0
- package/dist/routes/audit.d.ts.map +1 -0
- package/dist/routes/audit.js +162 -0
- package/dist/routes/audit.js.map +1 -0
- package/dist/routes/auth.d.ts +47 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +630 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/capabilities.d.ts +14 -0
- package/dist/routes/capabilities.d.ts.map +1 -0
- package/dist/routes/capabilities.js +62 -0
- package/dist/routes/capabilities.js.map +1 -0
- package/dist/routes/compliance.d.ts +37 -0
- package/dist/routes/compliance.d.ts.map +1 -0
- package/dist/routes/compliance.js +321 -0
- package/dist/routes/compliance.js.map +1 -0
- package/dist/routes/conversations.d.ts +13 -0
- package/dist/routes/conversations.d.ts.map +1 -0
- package/dist/routes/conversations.js +295 -0
- package/dist/routes/conversations.js.map +1 -0
- package/dist/routes/cost.d.ts +24 -0
- package/dist/routes/cost.d.ts.map +1 -0
- package/dist/routes/cost.js +243 -0
- package/dist/routes/cost.js.map +1 -0
- package/dist/routes/deployments.d.ts +122 -0
- package/dist/routes/deployments.d.ts.map +1 -0
- package/dist/routes/deployments.js +1036 -0
- package/dist/routes/deployments.js.map +1 -0
- package/dist/routes/env.d.ts +62 -0
- package/dist/routes/env.d.ts.map +1 -0
- package/dist/routes/env.js +311 -0
- package/dist/routes/env.js.map +1 -0
- package/dist/routes/eval-runs.d.ts +28 -0
- package/dist/routes/eval-runs.d.ts.map +1 -0
- package/dist/routes/eval-runs.js +479 -0
- package/dist/routes/eval-runs.js.map +1 -0
- package/dist/routes/eval-suites.d.ts +24 -0
- package/dist/routes/eval-suites.d.ts.map +1 -0
- package/dist/routes/eval-suites.js +381 -0
- package/dist/routes/eval-suites.js.map +1 -0
- package/dist/routes/event-triggers.d.ts +12 -0
- package/dist/routes/event-triggers.d.ts.map +1 -0
- package/dist/routes/event-triggers.js +218 -0
- package/dist/routes/event-triggers.js.map +1 -0
- package/dist/routes/flows.d.ts +23 -0
- package/dist/routes/flows.d.ts.map +1 -0
- package/dist/routes/flows.js +344 -0
- package/dist/routes/flows.js.map +1 -0
- package/dist/routes/guardrails.d.ts +33 -0
- package/dist/routes/guardrails.d.ts.map +1 -0
- package/dist/routes/guardrails.js +236 -0
- package/dist/routes/guardrails.js.map +1 -0
- package/dist/routes/identity.d.ts +39 -0
- package/dist/routes/identity.d.ts.map +1 -0
- package/dist/routes/identity.js +138 -0
- package/dist/routes/identity.js.map +1 -0
- package/dist/routes/mcp.d.ts +23 -0
- package/dist/routes/mcp.d.ts.map +1 -0
- package/dist/routes/mcp.js +727 -0
- package/dist/routes/mcp.js.map +1 -0
- package/dist/routes/memory.d.ts +16 -0
- package/dist/routes/memory.d.ts.map +1 -0
- package/dist/routes/memory.js +353 -0
- package/dist/routes/memory.js.map +1 -0
- package/dist/routes/observations.d.ts +19 -0
- package/dist/routes/observations.d.ts.map +1 -0
- package/dist/routes/observations.js +135 -0
- package/dist/routes/observations.js.map +1 -0
- package/dist/routes/orgs.d.ts +24 -0
- package/dist/routes/orgs.d.ts.map +1 -0
- package/dist/routes/orgs.js +208 -0
- package/dist/routes/orgs.js.map +1 -0
- package/dist/routes/pagination.d.ts +18 -0
- package/dist/routes/pagination.d.ts.map +1 -0
- package/dist/routes/pagination.js +35 -0
- package/dist/routes/pagination.js.map +1 -0
- package/dist/routes/policies.d.ts +23 -0
- package/dist/routes/policies.d.ts.map +1 -0
- package/dist/routes/policies.js +314 -0
- package/dist/routes/policies.js.map +1 -0
- package/dist/routes/projects.d.ts +45 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +485 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/proposals.d.ts +24 -0
- package/dist/routes/proposals.d.ts.map +1 -0
- package/dist/routes/proposals.js +581 -0
- package/dist/routes/proposals.js.map +1 -0
- package/dist/routes/provenance.d.ts +34 -0
- package/dist/routes/provenance.d.ts.map +1 -0
- package/dist/routes/provenance.js +274 -0
- package/dist/routes/provenance.js.map +1 -0
- package/dist/routes/providers.d.ts +32 -0
- package/dist/routes/providers.d.ts.map +1 -0
- package/dist/routes/providers.js +490 -0
- package/dist/routes/providers.js.map +1 -0
- package/dist/routes/public-run-tokens.d.ts +17 -0
- package/dist/routes/public-run-tokens.d.ts.map +1 -0
- package/dist/routes/public-run-tokens.js +69 -0
- package/dist/routes/public-run-tokens.js.map +1 -0
- package/dist/routes/retention.d.ts +19 -0
- package/dist/routes/retention.d.ts.map +1 -0
- package/dist/routes/retention.js +152 -0
- package/dist/routes/retention.js.map +1 -0
- package/dist/routes/reviewers.d.ts +5 -0
- package/dist/routes/reviewers.d.ts.map +1 -0
- package/dist/routes/reviewers.js +161 -0
- package/dist/routes/reviewers.js.map +1 -0
- package/dist/routes/runs.d.ts +34 -0
- package/dist/routes/runs.d.ts.map +1 -0
- package/dist/routes/runs.js +705 -0
- package/dist/routes/runs.js.map +1 -0
- package/dist/routes/s3.d.ts +31 -0
- package/dist/routes/s3.d.ts.map +1 -0
- package/dist/routes/s3.js +433 -0
- package/dist/routes/s3.js.map +1 -0
- package/dist/routes/schedules.d.ts +20 -0
- package/dist/routes/schedules.d.ts.map +1 -0
- package/dist/routes/schedules.js +234 -0
- package/dist/routes/schedules.js.map +1 -0
- package/dist/routes/scope-params.d.ts +57 -0
- package/dist/routes/scope-params.d.ts.map +1 -0
- package/dist/routes/scope-params.js +105 -0
- package/dist/routes/scope-params.js.map +1 -0
- package/dist/routes/secret-ref.d.ts +20 -0
- package/dist/routes/secret-ref.d.ts.map +1 -0
- package/dist/routes/secret-ref.js +42 -0
- package/dist/routes/secret-ref.js.map +1 -0
- package/dist/routes/secrets.d.ts +53 -0
- package/dist/routes/secrets.d.ts.map +1 -0
- package/dist/routes/secrets.js +715 -0
- package/dist/routes/secrets.js.map +1 -0
- package/dist/routes/signing-keys.d.ts +23 -0
- package/dist/routes/signing-keys.d.ts.map +1 -0
- package/dist/routes/signing-keys.js +212 -0
- package/dist/routes/signing-keys.js.map +1 -0
- package/dist/routes/sse.d.ts +58 -0
- package/dist/routes/sse.d.ts.map +1 -0
- package/dist/routes/sse.js +92 -0
- package/dist/routes/sse.js.map +1 -0
- package/dist/routes/teams.d.ts +30 -0
- package/dist/routes/teams.d.ts.map +1 -0
- package/dist/routes/teams.js +443 -0
- package/dist/routes/teams.js.map +1 -0
- package/dist/routes/tenant.d.ts +57 -0
- package/dist/routes/tenant.d.ts.map +1 -0
- package/dist/routes/tenant.js +352 -0
- package/dist/routes/tenant.js.map +1 -0
- package/dist/routes/tokens.d.ts +14 -0
- package/dist/routes/tokens.d.ts.map +1 -0
- package/dist/routes/tokens.js +231 -0
- package/dist/routes/tokens.js.map +1 -0
- package/dist/routes/tools.d.ts +33 -0
- package/dist/routes/tools.d.ts.map +1 -0
- package/dist/routes/tools.js +380 -0
- package/dist/routes/tools.js.map +1 -0
- package/dist/routes/webhook-endpoints.d.ts +10 -0
- package/dist/routes/webhook-endpoints.d.ts.map +1 -0
- package/dist/routes/webhook-endpoints.js +407 -0
- package/dist/routes/webhook-endpoints.js.map +1 -0
- package/dist/routes/webhooks.d.ts +21 -0
- package/dist/routes/webhooks.d.ts.map +1 -0
- package/dist/routes/webhooks.js +228 -0
- package/dist/routes/webhooks.js.map +1 -0
- package/dist/s3-credential-binding.d.ts +54 -0
- package/dist/s3-credential-binding.d.ts.map +1 -0
- package/dist/s3-credential-binding.js +4 -0
- package/dist/s3-credential-binding.js.map +1 -0
- package/dist/secrets-binding.d.ts +281 -0
- package/dist/secrets-binding.d.ts.map +1 -0
- package/dist/secrets-binding.js +10 -0
- package/dist/secrets-binding.js.map +1 -0
- package/dist/secrets-provider-binding.d.ts +164 -0
- package/dist/secrets-provider-binding.d.ts.map +1 -0
- package/dist/secrets-provider-binding.js +4 -0
- package/dist/secrets-provider-binding.js.map +1 -0
- package/dist/session-store-binding.d.ts +148 -0
- package/dist/session-store-binding.d.ts.map +1 -0
- package/dist/session-store-binding.js +4 -0
- package/dist/session-store-binding.js.map +1 -0
- package/dist/signing-key-binding.d.ts +210 -0
- package/dist/signing-key-binding.d.ts.map +1 -0
- package/dist/signing-key-binding.js +4 -0
- package/dist/signing-key-binding.js.map +1 -0
- package/dist/state-store-binding.d.ts +53 -0
- package/dist/state-store-binding.d.ts.map +1 -0
- package/dist/state-store-binding.js +38 -0
- package/dist/state-store-binding.js.map +1 -0
- package/dist/supervisor-binding.d.ts +526 -0
- package/dist/supervisor-binding.d.ts.map +1 -0
- package/dist/supervisor-binding.js +4 -0
- package/dist/supervisor-binding.js.map +1 -0
- package/dist/tenant-host-access.d.ts +41 -0
- package/dist/tenant-host-access.d.ts.map +1 -0
- package/dist/tenant-host-access.js +42 -0
- package/dist/tenant-host-access.js.map +1 -0
- package/dist/token-admin.d.ts +99 -0
- package/dist/token-admin.d.ts.map +1 -0
- package/dist/token-admin.js +4 -0
- package/dist/token-admin.js.map +1 -0
- package/dist/tool-binding.d.ts +247 -0
- package/dist/tool-binding.d.ts.map +1 -0
- package/dist/tool-binding.js +4 -0
- package/dist/tool-binding.js.map +1 -0
- package/dist/trigger-binding.d.ts +13 -0
- package/dist/trigger-binding.d.ts.map +1 -0
- package/dist/trigger-binding.js +4 -0
- package/dist/trigger-binding.js.map +1 -0
- package/dist/types.d.ts +71 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/webhook-endpoint-binding.d.ts +230 -0
- package/dist/webhook-endpoint-binding.d.ts.map +1 -0
- package/dist/webhook-endpoint-binding.js +12 -0
- package/dist/webhook-endpoint-binding.js.map +1 -0
- package/dist/xml.d.ts +79 -0
- package/dist/xml.d.ts.map +1 -0
- package/dist/xml.js +115 -0
- package/dist/xml.js.map +1 -0
- package/openapi.json +29649 -0
- package/package.json +76 -4
- package/scripts/emit-openapi.mjs +44 -0
- package/src/adapter-binding.ts +204 -0
- package/src/agent-binding.ts +231 -0
- package/src/app.ts +1286 -0
- package/src/capability-binding.ts +83 -0
- package/src/cost-binding.ts +213 -0
- package/src/deployment-binding.ts +225 -0
- package/src/env-binding.ts +140 -0
- package/src/errors.ts +295 -0
- package/src/eval-run-binding.ts +209 -0
- package/src/eval-run-dispatcher.ts +497 -0
- package/src/eval-suite-binding.ts +257 -0
- package/src/event-bus-binding.ts +127 -0
- package/src/flow-binding.ts +213 -0
- package/src/guardrail-binding.ts +151 -0
- package/src/handler-binding.ts +132 -0
- package/src/hitl-binding.ts +172 -0
- package/src/identity-directory-binding.ts +128 -0
- package/src/identity-provider-binding.ts +203 -0
- package/src/image-registry-binding.ts +193 -0
- package/src/index.ts +606 -0
- package/src/key-management-binding.ts +91 -0
- package/src/mcp-endpoint-binding.ts +311 -0
- package/src/memory-binding.ts +239 -0
- package/src/middleware/auth.ts +437 -0
- package/src/middleware/authorize.ts +125 -0
- package/src/middleware/error-mapper.ts +40 -0
- package/src/middleware/idempotency.ts +160 -0
- package/src/middleware/principal.ts +64 -0
- package/src/middleware/public-run-routes.ts +50 -0
- package/src/middleware/request-id.ts +28 -0
- package/src/middleware/sigv4-verify.ts +374 -0
- package/src/middleware/sigv4.ts +165 -0
- package/src/openapi/generate.ts +307 -0
- package/src/openapi/operations.ts +5444 -0
- package/src/openapi/schemas.ts +6363 -0
- package/src/provenance-binding.ts +169 -0
- package/src/provider-binding.ts +196 -0
- package/src/public-run-token.ts +263 -0
- package/src/retention-binding.ts +78 -0
- package/src/reviewer-binding.ts +99 -0
- package/src/rotation-status-store.ts +209 -0
- package/src/routes/adapters.ts +319 -0
- package/src/routes/agents.ts +424 -0
- package/src/routes/approvals.ts +759 -0
- package/src/routes/artifacts.ts +317 -0
- package/src/routes/audit.ts +219 -0
- package/src/routes/auth.ts +806 -0
- package/src/routes/capabilities.ts +79 -0
- package/src/routes/compliance.ts +482 -0
- package/src/routes/conversations.ts +369 -0
- package/src/routes/cost.ts +327 -0
- package/src/routes/deployments.ts +1493 -0
- package/src/routes/env.ts +429 -0
- package/src/routes/eval-runs.ts +631 -0
- package/src/routes/eval-suites.ts +490 -0
- package/src/routes/event-triggers.ts +283 -0
- package/src/routes/flows.ts +423 -0
- package/src/routes/guardrails.ts +320 -0
- package/src/routes/identity.ts +203 -0
- package/src/routes/mcp.ts +940 -0
- package/src/routes/memory.ts +430 -0
- package/src/routes/observations.ts +175 -0
- package/src/routes/orgs.ts +273 -0
- package/src/routes/pagination.ts +51 -0
- package/src/routes/policies.ts +413 -0
- package/src/routes/projects.ts +634 -0
- package/src/routes/proposals.ts +719 -0
- package/src/routes/provenance.ts +406 -0
- package/src/routes/providers.ts +624 -0
- package/src/routes/public-run-tokens.ts +104 -0
- package/src/routes/retention.ts +193 -0
- package/src/routes/reviewers.ts +209 -0
- package/src/routes/runs.ts +892 -0
- package/src/routes/s3.ts +519 -0
- package/src/routes/schedules.ts +300 -0
- package/src/routes/scope-params.ts +133 -0
- package/src/routes/secret-ref.ts +52 -0
- package/src/routes/secrets.ts +975 -0
- package/src/routes/signing-keys.ts +259 -0
- package/src/routes/sse.ts +148 -0
- package/src/routes/teams.ts +584 -0
- package/src/routes/tenant.ts +530 -0
- package/src/routes/tokens.ts +285 -0
- package/src/routes/tools.ts +491 -0
- package/src/routes/webhook-endpoints.ts +534 -0
- package/src/routes/webhooks.ts +296 -0
- package/src/s3-credential-binding.ts +58 -0
- package/src/secrets-binding.ts +308 -0
- package/src/secrets-provider-binding.ts +167 -0
- package/src/session-store-binding.ts +163 -0
- package/src/signing-key-binding.ts +235 -0
- package/src/state-store-binding.ts +84 -0
- package/src/supervisor-binding.ts +554 -0
- package/src/tenant-host-access.ts +62 -0
- package/src/token-admin.ts +104 -0
- package/src/tool-binding.ts +274 -0
- package/src/trigger-binding.ts +38 -0
- package/src/types.ts +74 -0
- package/src/webhook-endpoint-binding.ts +246 -0
- package/src/xml.ts +196 -0
package/src/errors.ts
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Error envelope + code→status mapping for the platform API.
|
|
6
|
+
*
|
|
7
|
+
* Spec: `docs/API-ROUTE-CONVENTIONS.md` §4. Every 4xx/5xx response
|
|
8
|
+
* carries `{ error: { code, message, details?, requestId } }`. Codes
|
|
9
|
+
* match domain error discriminants (`unresolved-tool`,
|
|
10
|
+
* `guardrail-violation`, etc.) so the SDK's `fromWire()` can pattern-
|
|
11
|
+
* match without inspecting HTTP status.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export interface WireErrorBody {
|
|
15
|
+
readonly error: WireError;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface WireError {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
22
|
+
readonly requestId: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Maps a domain error `code` to the HTTP status the route layer should
|
|
27
|
+
* return. Codes not in this map fall through to `500` — the middleware
|
|
28
|
+
* treats that as a bug (unmapped code) rather than a plausible domain
|
|
29
|
+
* error. New codes MUST have a row here.
|
|
30
|
+
*/
|
|
31
|
+
export const ERROR_CODE_TO_STATUS: Readonly<Record<string, number>> = {
|
|
32
|
+
// 400 — bad request
|
|
33
|
+
'validation-failed': 400,
|
|
34
|
+
'unknown-field': 400,
|
|
35
|
+
'bad-input': 400,
|
|
36
|
+
'unresolved-tool': 400,
|
|
37
|
+
'unresolved-guardrail': 400,
|
|
38
|
+
'schema-validation-failed': 400,
|
|
39
|
+
// Platform hierarchy scope filter.
|
|
40
|
+
'scope-invalid': 400,
|
|
41
|
+
// 401 — auth
|
|
42
|
+
'auth-missing': 401,
|
|
43
|
+
'auth-expired': 401,
|
|
44
|
+
'auth-revoked': 401,
|
|
45
|
+
// 403
|
|
46
|
+
'permission-denied': 403,
|
|
47
|
+
// A deployment refuses tenant configuration that reaches its host
|
|
48
|
+
// (KINDGI_TENANT_HOST_ACCESS): a stdio MCP endpoint.
|
|
49
|
+
'host-access-denied': 403,
|
|
50
|
+
// 404
|
|
51
|
+
'not-found': 404,
|
|
52
|
+
'run-not-found': 404,
|
|
53
|
+
'agent-not-found': 404,
|
|
54
|
+
'conversation-not-found': 404,
|
|
55
|
+
'tool-not-found': 404,
|
|
56
|
+
'guardrail-not-found': 404,
|
|
57
|
+
'fact-not-found': 404,
|
|
58
|
+
'flow-not-found': 404,
|
|
59
|
+
// 409 — conflict
|
|
60
|
+
'already-terminal': 409,
|
|
61
|
+
'run-already-terminal': 409,
|
|
62
|
+
'run-lease-lost': 409,
|
|
63
|
+
'idempotency-key-body-mismatch': 409,
|
|
64
|
+
'hitl-required': 409,
|
|
65
|
+
'duplicate-node-id': 409,
|
|
66
|
+
'duplicate-edge-id': 409,
|
|
67
|
+
'agent-version-mismatch': 409,
|
|
68
|
+
'agent-already-registered': 409,
|
|
69
|
+
'agent-gone': 410,
|
|
70
|
+
'flow-gone': 410,
|
|
71
|
+
'policy-gone': 410,
|
|
72
|
+
'eval-suite-gone': 410,
|
|
73
|
+
'tool-gone': 410,
|
|
74
|
+
'tool-already-registered': 409,
|
|
75
|
+
'guardrail-already-registered': 409,
|
|
76
|
+
'flow-already-registered': 409,
|
|
77
|
+
'conversation-closed': 409,
|
|
78
|
+
'invalid-agent': 400,
|
|
79
|
+
'invalid-tool-definition': 400,
|
|
80
|
+
'invalid-schema': 400,
|
|
81
|
+
'unknown-effect': 400,
|
|
82
|
+
'invalid-guardrail': 400,
|
|
83
|
+
// 422 — unprocessable entity
|
|
84
|
+
'guardrail-violation': 422,
|
|
85
|
+
'agent-turn-aborted': 422,
|
|
86
|
+
'budget-exceeded': 422,
|
|
87
|
+
'output-schema-violation': 422,
|
|
88
|
+
'model-invocation-failed': 422,
|
|
89
|
+
'tool-invocation-failed': 422,
|
|
90
|
+
'capability-routing-failed': 422,
|
|
91
|
+
'runtime-not-configured': 422,
|
|
92
|
+
// A run the runtime can't start or resume yet: a flow with a node no
|
|
93
|
+
// handler is bound for, or a run shape the host's run handler doesn't
|
|
94
|
+
// support.
|
|
95
|
+
'flow-unbound': 422,
|
|
96
|
+
'flow-runs-not-supported': 422,
|
|
97
|
+
'flow-resume-not-supported': 422,
|
|
98
|
+
// `POST /v1/runs/{runId}/resume` in this release: every waitpoint
|
|
99
|
+
// belongs to an approval (decided through the approvals routes, which
|
|
100
|
+
// check the reviewer and record the decision) or to the runtime itself.
|
|
101
|
+
'run-resume-not-supported': 422,
|
|
102
|
+
// 429 — rate limit. No route in this package emits it; a rate limiter
|
|
103
|
+
// in front of the routes can.
|
|
104
|
+
'rate-limit-exceeded': 429,
|
|
105
|
+
// 500 — server
|
|
106
|
+
'internal-server-error': 500,
|
|
107
|
+
'journal-error': 500,
|
|
108
|
+
stuck: 500,
|
|
109
|
+
// Waitpoint domain: "no pending token" or "already resolved" are
|
|
110
|
+
// 409-shaped (a caller conflict with the run's current state).
|
|
111
|
+
'waitpoint-error': 409,
|
|
112
|
+
// HITL (approvals + reviewers).
|
|
113
|
+
'approval-not-found': 404,
|
|
114
|
+
'reviewer-not-found': 404,
|
|
115
|
+
'reviewer-deactivated': 409,
|
|
116
|
+
'insufficient-role': 403,
|
|
117
|
+
'approval-terminal': 409,
|
|
118
|
+
'approval-already-decided': 409,
|
|
119
|
+
'invalid-transition': 409,
|
|
120
|
+
'audit-bundle-not-found': 404,
|
|
121
|
+
'approval-not-decided': 409,
|
|
122
|
+
'export-key-error': 500,
|
|
123
|
+
'persistence-error': 500,
|
|
124
|
+
// Supervisor observations query — same discriminants.
|
|
125
|
+
'observation-not-found': 404,
|
|
126
|
+
// Provenance routes.
|
|
127
|
+
'provenance-not-found': 404,
|
|
128
|
+
'signing-not-configured': 404,
|
|
129
|
+
'signing-key-not-found': 404,
|
|
130
|
+
'signing-key-conflict': 409,
|
|
131
|
+
'signing-key-revoked': 409,
|
|
132
|
+
'signing-key-algorithm-unsupported': 400,
|
|
133
|
+
'signing-key-store-error': 500,
|
|
134
|
+
// Supervisor proposals lifecycle.
|
|
135
|
+
'proposal-not-found': 404,
|
|
136
|
+
'proposal-invalid-state-transition': 409,
|
|
137
|
+
'proposal-terminal': 409,
|
|
138
|
+
'baseline-mismatch': 422,
|
|
139
|
+
'apply-change-failed': 422,
|
|
140
|
+
'ground-layer-violation': 422,
|
|
141
|
+
'agent-not-in-registry': 422,
|
|
142
|
+
'version-already-exists': 409,
|
|
143
|
+
'invalid-new-version': 400,
|
|
144
|
+
'supervisor-header-missing': 400,
|
|
145
|
+
// Artifacts.
|
|
146
|
+
'blob-not-found': 404,
|
|
147
|
+
'blob-hash-mismatch': 400,
|
|
148
|
+
'blob-size-mismatch': 400,
|
|
149
|
+
'blob-storage-error': 500,
|
|
150
|
+
// Admin plane — capabilities + providers.
|
|
151
|
+
'capability-not-found': 404,
|
|
152
|
+
'provider-not-found': 404,
|
|
153
|
+
'provider-already-registered': 409,
|
|
154
|
+
'invalid-provider': 400,
|
|
155
|
+
// Admin plane — cost readback.
|
|
156
|
+
'cost-record-not-found': 404,
|
|
157
|
+
// Admin plane — adapters.
|
|
158
|
+
'adapter-not-found': 404,
|
|
159
|
+
// Admin plane — policies.
|
|
160
|
+
'policy-not-found': 404,
|
|
161
|
+
'policy-already-registered': 409,
|
|
162
|
+
// Admin plane — eval suites.
|
|
163
|
+
'eval-suite-not-found': 404,
|
|
164
|
+
'eval-suite-already-registered': 409,
|
|
165
|
+
// Admin plane — eval-run dispatch.
|
|
166
|
+
'eval-run-not-found': 404,
|
|
167
|
+
'eval-run-already-terminal': 409,
|
|
168
|
+
'dispatcher-not-registered': 422,
|
|
169
|
+
'dispatcher-input-invalid': 400,
|
|
170
|
+
// Interop plane — MCP endpoint registry.
|
|
171
|
+
'mcp-endpoint-not-found': 404,
|
|
172
|
+
'mcp-endpoint-already-registered': 409,
|
|
173
|
+
'invalid-mcp-endpoint': 400,
|
|
174
|
+
// Interop plane — MCP resources + prompts.
|
|
175
|
+
'mcp-resource-not-found': 404,
|
|
176
|
+
'mcp-prompt-not-found': 404,
|
|
177
|
+
'mcp-resource-read-failed': 502,
|
|
178
|
+
'mcp-prompt-get-failed': 502,
|
|
179
|
+
// Auth surface — OAuth + sessions.
|
|
180
|
+
'session-not-found': 404,
|
|
181
|
+
'session-revoked': 409,
|
|
182
|
+
// NOTE: `session-expired` is a middleware-tier auth failure (401) —
|
|
183
|
+
// the token authenticated but the session's absolute TTL has elapsed.
|
|
184
|
+
// Distinct from `auth-expired` (bearer-token expiry) so callers can
|
|
185
|
+
// tell static bearer-token expiry from session TTL.
|
|
186
|
+
'session-expired': 401,
|
|
187
|
+
'session-inactive': 401,
|
|
188
|
+
'identity-provider-not-found': 404,
|
|
189
|
+
'identity-provider-already-registered': 409,
|
|
190
|
+
'oauth-state-invalid': 400,
|
|
191
|
+
'oauth-code-exchange-failed': 422,
|
|
192
|
+
'oauth-refresh-failed': 422,
|
|
193
|
+
'oauth-refresh-not-supported': 422,
|
|
194
|
+
'invalid-provider-config': 400,
|
|
195
|
+
'auth-not-session-token': 400,
|
|
196
|
+
// OAuth redirect URIs + refresh.
|
|
197
|
+
'redirect-uri-not-allowed': 400,
|
|
198
|
+
'redirect-uri-mismatch': 400,
|
|
199
|
+
'refresh-token-invalid': 401,
|
|
200
|
+
// Admin plane — identity directory.
|
|
201
|
+
'identity-user-not-found': 404,
|
|
202
|
+
'identity-revoke-failed': 500,
|
|
203
|
+
// Signed deployments.
|
|
204
|
+
'signature-invalid': 400,
|
|
205
|
+
'signer-not-trusted': 403,
|
|
206
|
+
'image-unverifiable': 400,
|
|
207
|
+
'deployment-validation-failed': 400,
|
|
208
|
+
'deployment-not-found': 404,
|
|
209
|
+
// Compliance routes.
|
|
210
|
+
'compliance-evidence-not-found': 404,
|
|
211
|
+
'compliance-export-failed': 500,
|
|
212
|
+
// Platform hierarchy.
|
|
213
|
+
'org-not-found': 404,
|
|
214
|
+
'team-not-found': 404,
|
|
215
|
+
'project-not-found': 404,
|
|
216
|
+
'team-membership-not-found': 404,
|
|
217
|
+
'project-membership-not-found': 404,
|
|
218
|
+
'tenant-not-found': 404,
|
|
219
|
+
'tenant-config-not-found': 404,
|
|
220
|
+
'tenant-config-revision-conflict': 409,
|
|
221
|
+
'authz-denied': 403,
|
|
222
|
+
'authz-backend-unavailable': 503,
|
|
223
|
+
// A tenant policy an agent turn must apply couldn't be (its store
|
|
224
|
+
// failed, or a stored spec is invalid): the turn fails closed.
|
|
225
|
+
'tenant-policy-unavailable': 503,
|
|
226
|
+
// Env + Secrets.
|
|
227
|
+
'env-not-found': 404,
|
|
228
|
+
'secret-not-found': 404,
|
|
229
|
+
'secret-revoked': 404,
|
|
230
|
+
'secret-version-not-found': 404,
|
|
231
|
+
'scope-kind-required': 400,
|
|
232
|
+
'scope-mismatch': 400,
|
|
233
|
+
'env-name-required': 400,
|
|
234
|
+
'env-name-mismatch': 400,
|
|
235
|
+
'env-cross-scope': 400,
|
|
236
|
+
'reserved-name-prefix': 400,
|
|
237
|
+
'secret-value-too-large': 400,
|
|
238
|
+
'secret-write-conflict': 409,
|
|
239
|
+
'env-write-conflict': 409,
|
|
240
|
+
'secret-encryption-failed': 500,
|
|
241
|
+
'secret-decryption-failed': 500,
|
|
242
|
+
'secret-provider-unavailable': 503,
|
|
243
|
+
'secret-provider-unauthorized': 502,
|
|
244
|
+
'secret-provider-rate-limited': 429,
|
|
245
|
+
'secret-store-error': 500,
|
|
246
|
+
'env-store-error': 500,
|
|
247
|
+
// Trigger HTTP surface.
|
|
248
|
+
'trigger-not-found': 404,
|
|
249
|
+
'trigger-invalid-config': 400,
|
|
250
|
+
'trigger-webhook-id-conflict': 409,
|
|
251
|
+
'trigger-already-in-state': 409,
|
|
252
|
+
'trigger-register-failed': 500,
|
|
253
|
+
'trigger-update-failed': 500,
|
|
254
|
+
'trigger-lifecycle-failed': 500,
|
|
255
|
+
'webhook-signature-invalid': 401,
|
|
256
|
+
'webhook-inactive': 410,
|
|
257
|
+
'webhook-secret-missing': 500,
|
|
258
|
+
'webhook-flow-not-found': 502,
|
|
259
|
+
// Outbound webhook endpoints.
|
|
260
|
+
'webhook-endpoint-not-found': 404,
|
|
261
|
+
'webhook-delivery-not-found': 404,
|
|
262
|
+
'webhook-url-refused': 400,
|
|
263
|
+
'webhook-secret-not-found': 400,
|
|
264
|
+
'webhook-secret-too-weak': 400,
|
|
265
|
+
// Public run tokens.
|
|
266
|
+
'token-mint-failed': 500,
|
|
267
|
+
} as const;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Look up the HTTP status for a domain error code. Unmapped codes
|
|
271
|
+
* return `500` — the caller should log a warning; this indicates a
|
|
272
|
+
* mapping-table gap.
|
|
273
|
+
*/
|
|
274
|
+
export function statusFor(code: string): number {
|
|
275
|
+
return ERROR_CODE_TO_STATUS[code] ?? 500;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** Build a wire error body from a domain error + requestId. */
|
|
279
|
+
export function toWireError(
|
|
280
|
+
err: { readonly code: string; readonly message: string } & Readonly<Record<string, unknown>>,
|
|
281
|
+
requestId: string,
|
|
282
|
+
): WireErrorBody {
|
|
283
|
+
const { code, message, ...rest } = err as unknown as Record<string, unknown>;
|
|
284
|
+
const detailKeys = Object.keys(rest).filter((k) => k !== 'cause');
|
|
285
|
+
const details =
|
|
286
|
+
detailKeys.length > 0 ? Object.fromEntries(detailKeys.map((k) => [k, rest[k]])) : undefined;
|
|
287
|
+
return {
|
|
288
|
+
error: {
|
|
289
|
+
code: String(code),
|
|
290
|
+
message: String(message),
|
|
291
|
+
...(details !== undefined && { details }),
|
|
292
|
+
requestId,
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { AgentId } from '@kindgi/agents';
|
|
5
|
+
import type { Scope } from '@kindgi/platform';
|
|
6
|
+
import type { Cursor, FlowId, ProjectId, RunId, Semver, TenantId, Timestamp } from '@kindgi/types';
|
|
7
|
+
|
|
8
|
+
import type { EvalKind } from './eval-suite-binding.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Caller-plugged surface for the evaluation-run data plane — the
|
|
12
|
+
* companion to the eval-suite registry that closes the loop by adding
|
|
13
|
+
* *execution*.
|
|
14
|
+
* Same pattern as every other admin binding: the API package does NOT
|
|
15
|
+
* own persistence. Deployments wire this binding to a runtime that
|
|
16
|
+
* dispatches per `EvalSuite.kind` (see `eval-run-dispatcher.ts` for
|
|
17
|
+
* the reference accuracy dispatcher).
|
|
18
|
+
*
|
|
19
|
+
* The wire shape mirrors the run surface. A durable implementation can
|
|
20
|
+
* make every `EvalRun` a specialized run (started with `runGraph`),
|
|
21
|
+
* inheriting durability, replay, and cancel semantics while adding
|
|
22
|
+
* eval-specific fields (`suiteId`, `suiteVersion`, `kind`, `result`);
|
|
23
|
+
* the in-process reference in `eval-run-dispatcher.ts` keeps runs in
|
|
24
|
+
* memory.
|
|
25
|
+
*
|
|
26
|
+
* `result` is kind-specific opaque JSON on the wire. For the
|
|
27
|
+
* `accuracy` reference dispatcher it is
|
|
28
|
+
* `{ passCount, totalCount, meanScore, perCase[] }`; other kinds define
|
|
29
|
+
* their own shapes.
|
|
30
|
+
*/
|
|
31
|
+
export interface EvalRunBinding {
|
|
32
|
+
/**
|
|
33
|
+
* Start a new eval run against a specific suite id (the dispatcher
|
|
34
|
+
* resolves the suite version internally — bindings MAY reject with
|
|
35
|
+
* `suite-not-found` when the suiteId is unknown for the tenant).
|
|
36
|
+
*/
|
|
37
|
+
start(input: EvalRunStartInput): Promise<EvalRunStartOutcome>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch a single eval run by id, or `null` if unknown. The route
|
|
40
|
+
* surfaces `null` as `404 eval-run-not-found`.
|
|
41
|
+
*/
|
|
42
|
+
get(input: EvalRunGetInput): Promise<EvalRun | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Cursor-paginated list of eval runs. Optional filters — see
|
|
45
|
+
* `EvalRunFilter`. Sort order is fixed: `startedAt` descending, id
|
|
46
|
+
* descending as tie-breaker (same shape as `/v1/runs`).
|
|
47
|
+
*/
|
|
48
|
+
list(input: EvalRunListInput): Promise<EvalRunPage>;
|
|
49
|
+
/**
|
|
50
|
+
* Cancel an eval run. Returns `{ cancelled: true }` on success;
|
|
51
|
+
* `{ cancelled: false, reason: 'not-found' | 'already-terminal' }`
|
|
52
|
+
* otherwise — the route flips each `reason` to the appropriate
|
|
53
|
+
* 4xx status.
|
|
54
|
+
*/
|
|
55
|
+
cancel(input: EvalRunCancelInput): Promise<EvalRunCancelOutcome>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* How the caller identifies the eval subject on `start`. Exactly one
|
|
60
|
+
* of `agentRef` / `flowRef` MUST be supplied — the route enforces
|
|
61
|
+
* that mutual exclusion before calling the binding.
|
|
62
|
+
*/
|
|
63
|
+
export interface AgentRef {
|
|
64
|
+
readonly agentId: AgentId;
|
|
65
|
+
readonly version?: Semver;
|
|
66
|
+
}
|
|
67
|
+
export interface FlowRef {
|
|
68
|
+
readonly flowId: FlowId;
|
|
69
|
+
readonly version?: Semver;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Terminal statuses match the run vocabulary. `pending` is a
|
|
74
|
+
* pre-execution state a dispatcher MAY use if it queues the run
|
|
75
|
+
* before starting it; the reference in-process dispatcher goes
|
|
76
|
+
* straight to `running`.
|
|
77
|
+
*/
|
|
78
|
+
export const EVAL_RUN_STATUSES = [
|
|
79
|
+
'pending',
|
|
80
|
+
'running',
|
|
81
|
+
'completed',
|
|
82
|
+
'failed',
|
|
83
|
+
'cancelled',
|
|
84
|
+
] as const;
|
|
85
|
+
export type EvalRunStatus = (typeof EVAL_RUN_STATUSES)[number];
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Wire shape for a single evaluation run. `result` is kind-specific
|
|
89
|
+
* opaque JSON (accuracy writes `{ passCount, totalCount, meanScore,
|
|
90
|
+
* perCase[] }`; other kinds define their own shapes). `error`
|
|
91
|
+
* carries the failure message when `status === 'failed'`.
|
|
92
|
+
*/
|
|
93
|
+
export interface EvalRun {
|
|
94
|
+
readonly runId: RunId;
|
|
95
|
+
readonly tenantId: TenantId;
|
|
96
|
+
readonly suiteId: string;
|
|
97
|
+
readonly suiteVersion: string;
|
|
98
|
+
readonly kind: EvalKind;
|
|
99
|
+
readonly agentRef?: AgentRef;
|
|
100
|
+
readonly flowRef?: FlowRef;
|
|
101
|
+
readonly status: EvalRunStatus;
|
|
102
|
+
readonly dryRun: boolean;
|
|
103
|
+
readonly startedAt: Timestamp;
|
|
104
|
+
readonly completedAt?: Timestamp;
|
|
105
|
+
readonly result?: Readonly<Record<string, unknown>>;
|
|
106
|
+
readonly error?: string;
|
|
107
|
+
readonly correlationId?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface EvalRunFilter {
|
|
111
|
+
readonly suiteId?: string;
|
|
112
|
+
readonly status?: EvalRunStatus;
|
|
113
|
+
readonly agentId?: AgentId;
|
|
114
|
+
readonly flowId?: FlowId;
|
|
115
|
+
readonly from?: Timestamp;
|
|
116
|
+
readonly to?: Timestamp;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface EvalRunStartInput {
|
|
120
|
+
readonly tenantId: TenantId;
|
|
121
|
+
/**
|
|
122
|
+
* Content-scope anchor. REQUIRED — every
|
|
123
|
+
* eval-run row is anchored to a project. The caller resolves this at
|
|
124
|
+
* ITS layer; storage adapters treat a missing / bogus id as a
|
|
125
|
+
* `project-not-found` outcome. No silent fallback to a tenant Default here.
|
|
126
|
+
*/
|
|
127
|
+
readonly projectId: ProjectId;
|
|
128
|
+
readonly suiteId: string;
|
|
129
|
+
readonly agentRef?: AgentRef;
|
|
130
|
+
readonly flowRef?: FlowRef;
|
|
131
|
+
readonly dryRun?: boolean;
|
|
132
|
+
readonly correlationId?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* `start` outcomes. `ok` returns the newly-minted `runId`; other
|
|
137
|
+
* shapes carry the domain error the route flips to a 4xx.
|
|
138
|
+
*/
|
|
139
|
+
export type EvalRunStartOutcome =
|
|
140
|
+
| {
|
|
141
|
+
readonly kind: 'ok';
|
|
142
|
+
readonly runId: RunId;
|
|
143
|
+
readonly dryRunPreview?: Readonly<Record<string, unknown>>;
|
|
144
|
+
}
|
|
145
|
+
| { readonly kind: 'suite-not-found'; readonly suiteId: string }
|
|
146
|
+
| { readonly kind: 'dispatcher-not-registered'; readonly evalKind: EvalKind }
|
|
147
|
+
| { readonly kind: 'dispatcher-input-invalid'; readonly message: string }
|
|
148
|
+
| {
|
|
149
|
+
/**
|
|
150
|
+
* The caller-supplied `projectId` does not resolve to a real
|
|
151
|
+
* project row in this tenant. Distinct from
|
|
152
|
+
* `dispatcher-input-invalid` so the route can surface a clean
|
|
153
|
+
* 4xx with the offending id rather than a generic dispatcher
|
|
154
|
+
* error.
|
|
155
|
+
*/
|
|
156
|
+
readonly kind: 'project-not-found';
|
|
157
|
+
readonly projectId: ProjectId;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export interface EvalRunGetInput {
|
|
161
|
+
readonly tenantId: TenantId;
|
|
162
|
+
readonly runId: RunId;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface EvalRunListInput {
|
|
166
|
+
readonly tenantId: TenantId;
|
|
167
|
+
readonly limit: number;
|
|
168
|
+
readonly cursor?: Cursor;
|
|
169
|
+
readonly filter?: EvalRunFilter;
|
|
170
|
+
/**
|
|
171
|
+
* Narrow the list to a specific scope. Absent = no scope narrow
|
|
172
|
+
* (return every row in the tenant the caller can see — admin/audit
|
|
173
|
+
* default).
|
|
174
|
+
*
|
|
175
|
+
* Content-scoped semantics (this binding):
|
|
176
|
+
* - `{ kind: 'project', projectId }` — rows in that project.
|
|
177
|
+
* - `{ kind: 'org', orgId }` — rows in every project belonging to
|
|
178
|
+
* that org.
|
|
179
|
+
* - `{ kind: 'tenant', tenantId }` — every row in the tenant.
|
|
180
|
+
*
|
|
181
|
+
* Content rows always belong to a project, so `inherit` has no
|
|
182
|
+
* effect here.
|
|
183
|
+
*/
|
|
184
|
+
readonly scope?: Scope;
|
|
185
|
+
/**
|
|
186
|
+
* `false` = literal-at-this-scope only (admin/audit view).
|
|
187
|
+
* `true` (default) = inheritance walk (user-facing view).
|
|
188
|
+
* No-op for content-scoped bindings (rows only exist at
|
|
189
|
+
* project-level — there is no upward hierarchy to walk). Kept for
|
|
190
|
+
* uniformity: scope-aware bindings share one filter shape across the
|
|
191
|
+
* SDK and OpenAPI schemas.
|
|
192
|
+
*/
|
|
193
|
+
readonly inherit?: boolean;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface EvalRunPage {
|
|
197
|
+
readonly data: readonly EvalRun[];
|
|
198
|
+
readonly nextCursor?: Cursor;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface EvalRunCancelInput {
|
|
202
|
+
readonly tenantId: TenantId;
|
|
203
|
+
readonly runId: RunId;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type EvalRunCancelOutcome =
|
|
207
|
+
| { readonly kind: 'ok' }
|
|
208
|
+
| { readonly kind: 'not-found' }
|
|
209
|
+
| { readonly kind: 'already-terminal'; readonly status: EvalRunStatus };
|