@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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { CapabilityKind, Feature } from '@kindgi/capabilities';
|
|
5
|
+
import type { Cursor, TenantId } from '@kindgi/types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Caller-plugged surface for the capability catalog — part of the admin
|
|
9
|
+
* control plane.
|
|
10
|
+
*
|
|
11
|
+
* Capabilities are **read-only** over HTTP. They are framework-declared
|
|
12
|
+
* (see `@kindgi/specs/capability.schema.json` + the `FEATURES` enum from
|
|
13
|
+
* `@kindgi/capabilities`) and deployment-extensible at boot time via
|
|
14
|
+
* this binding — never tenant-created via the API. Deployments that
|
|
15
|
+
* expose custom capability kinds (embedding, gpu-compute, sandbox-exec,
|
|
16
|
+
* browser-session, ...) plug a binding that also lists their extensions.
|
|
17
|
+
*
|
|
18
|
+
* Cursors are opaque — the binding chooses its encoding. The API layer
|
|
19
|
+
* only validates round-trip as a string; it never inspects the payload.
|
|
20
|
+
*/
|
|
21
|
+
export interface CapabilityRegistryBinding {
|
|
22
|
+
/**
|
|
23
|
+
* Cursor-paginated list of capability descriptors. Optional
|
|
24
|
+
* `featureFilter` is a prefix match on `descriptor.feature` — matches
|
|
25
|
+
* the `?feature=` filter shape on the route.
|
|
26
|
+
*/
|
|
27
|
+
list(input: CapabilityListInput): Promise<CapabilityPage>;
|
|
28
|
+
/**
|
|
29
|
+
* Fetch a capability descriptor by its id, or `null` when unknown.
|
|
30
|
+
* The route surfaces `null` as `404 capability-not-found`.
|
|
31
|
+
*/
|
|
32
|
+
get(input: CapabilityGetInput): Promise<CapabilityDescriptor | null>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Wire shape returned by the capability routes. Lean by design — the
|
|
37
|
+
* runtime `Capability` (`@kindgi/capabilities.Capability`) is a
|
|
38
|
+
* declarative query shape (needs / prefer / budget) that agents attach
|
|
39
|
+
* to their spec; that's a different concept from a descriptor entry in
|
|
40
|
+
* the *catalog* of features a deployment supports. The catalog entry
|
|
41
|
+
* carries the identifier + human description + the optional params
|
|
42
|
+
* schema pointer.
|
|
43
|
+
*
|
|
44
|
+
* `id` is caller-chosen — for example `feature:<feature>`
|
|
45
|
+
* (e.g. `feature:tool-use`); deployments that extend
|
|
46
|
+
* the catalog with non-LLM capability kinds may pick other conventions
|
|
47
|
+
* (`kind:embedding`, `kind:sandbox-exec`, ...).
|
|
48
|
+
*/
|
|
49
|
+
export interface CapabilityDescriptor {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly feature: Feature | string;
|
|
52
|
+
readonly description: string;
|
|
53
|
+
/**
|
|
54
|
+
* Kind of resource the capability targets. Optional — absent value
|
|
55
|
+
* defaults to `'llm-inference'`. Adapters for non-LLM kinds set this
|
|
56
|
+
* explicitly so the catalog can be filtered by kind downstream.
|
|
57
|
+
*/
|
|
58
|
+
readonly kind?: CapabilityKind;
|
|
59
|
+
/**
|
|
60
|
+
* Optional JSON Schema shape describing the parameters an agent may
|
|
61
|
+
* carry alongside `{ feature }` in a `Requirement`. Opaque to the API
|
|
62
|
+
* layer — the SDK surfaces it for tooling / doc generation.
|
|
63
|
+
*/
|
|
64
|
+
readonly paramsSchema?: Readonly<Record<string, unknown>>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface CapabilityListInput {
|
|
68
|
+
readonly tenantId: TenantId;
|
|
69
|
+
readonly limit: number;
|
|
70
|
+
readonly cursor?: Cursor;
|
|
71
|
+
/** Prefix match on `CapabilityDescriptor.feature`. */
|
|
72
|
+
readonly featureFilter?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface CapabilityGetInput {
|
|
76
|
+
readonly tenantId: TenantId;
|
|
77
|
+
readonly capabilityId: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface CapabilityPage {
|
|
81
|
+
readonly data: readonly CapabilityDescriptor[];
|
|
82
|
+
readonly nextCursor?: Cursor;
|
|
83
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { Scope } from '@kindgi/platform';
|
|
5
|
+
import type { Cursor, TenantId, Timestamp } from '@kindgi/types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Caller-plugged surface for the cost readback plane — part of the
|
|
9
|
+
* admin control plane. Read-only: tenants + operators
|
|
10
|
+
* inspect what they've spent across model calls, tool invocations,
|
|
11
|
+
* storage, and sandbox usage. Instrumentation (how records get recorded)
|
|
12
|
+
* lives at the agent / tool / sandbox layers — this surface only reads.
|
|
13
|
+
*
|
|
14
|
+
* The runtime substrate is the cost tracker — usage records carrying
|
|
15
|
+
* `resourceKind`, `providerId`, `runId`, `quantity`, `unit`, `costUsd`,
|
|
16
|
+
* `metrics` and `attributes`, plus a `recordedAt` timestamp. But the wire
|
|
17
|
+
* vocabulary differs enough (`category` instead of `resourceKind`;
|
|
18
|
+
* first-class `agentId` / `conversationId` filters that live in
|
|
19
|
+
* `attributes` at storage time; multi-dim `groupBy` that needs
|
|
20
|
+
* storage-side rollups) that a caller-plugged binding is cleaner than
|
|
21
|
+
* direct storage access — each deployment maps wire fields to whatever
|
|
22
|
+
* storage shape it uses. Trivial in-memory implementations are fine for
|
|
23
|
+
* dev + tests; production implementations run the aggregate rollups in
|
|
24
|
+
* their store.
|
|
25
|
+
*
|
|
26
|
+
* Every method is tenant-scoped. Cursors are opaque — the binding
|
|
27
|
+
* chooses its encoding. The API layer only validates round-trip as a
|
|
28
|
+
* string; it never inspects the payload.
|
|
29
|
+
*
|
|
30
|
+
* Budgets are NOT part of this interface.
|
|
31
|
+
*/
|
|
32
|
+
export interface CostBinding {
|
|
33
|
+
/**
|
|
34
|
+
* Cursor-paginated list of cost records. Sort order is fixed:
|
|
35
|
+
* `occurredAt desc, id desc`. Filters compose (all AND).
|
|
36
|
+
*/
|
|
37
|
+
listRecords(input: CostListRecordsInput): Promise<CostRecordPage>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch a record by id, or `null` when unknown. The route surfaces
|
|
40
|
+
* `null` as `404 cost-record-not-found`.
|
|
41
|
+
*/
|
|
42
|
+
getRecord(input: CostGetRecordInput): Promise<CostRecord | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Multi-dimensional aggregate rollup. `groupBy` may combine any
|
|
45
|
+
* subset of `agentId | runId | category | providerId | day | month
|
|
46
|
+
* | tenant | conversationId`; the binding returns one group per
|
|
47
|
+
* distinct key tuple within the required `from`..`to` window.
|
|
48
|
+
*/
|
|
49
|
+
aggregate(input: CostAggregateInput): Promise<CostAggregateResult>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// -------- listRecords --------
|
|
53
|
+
|
|
54
|
+
export interface CostListRecordsInput {
|
|
55
|
+
readonly tenantId: TenantId;
|
|
56
|
+
readonly limit: number;
|
|
57
|
+
readonly cursor?: Cursor;
|
|
58
|
+
readonly filter: CostRecordFilter;
|
|
59
|
+
/**
|
|
60
|
+
* Narrow the list to a specific scope. Absent = no scope narrow
|
|
61
|
+
* (return every row in the tenant the caller can see — admin/audit
|
|
62
|
+
* default).
|
|
63
|
+
*
|
|
64
|
+
* Content-scoped semantics (this binding — cost records attribute
|
|
65
|
+
* to the project whose run produced them):
|
|
66
|
+
* - `{ kind: 'project', projectId }` — rows in that project.
|
|
67
|
+
* - `{ kind: 'org', orgId }` — rows in every project belonging to
|
|
68
|
+
* that org.
|
|
69
|
+
* - `{ kind: 'tenant', tenantId }` — every row in the tenant.
|
|
70
|
+
*
|
|
71
|
+
* Content rows always belong to a project, so `inherit` has no
|
|
72
|
+
* effect here.
|
|
73
|
+
*/
|
|
74
|
+
readonly scope?: Scope;
|
|
75
|
+
/**
|
|
76
|
+
* `false` = literal-at-this-scope only (admin/audit view).
|
|
77
|
+
* `true` (default) = inheritance walk (user-facing view).
|
|
78
|
+
* No-op for content-scoped bindings (rows only exist at
|
|
79
|
+
* project-level — there is no upward hierarchy to walk). Kept for
|
|
80
|
+
* uniformity: scope-aware bindings share one filter shape.
|
|
81
|
+
*/
|
|
82
|
+
readonly inherit?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface CostRecordFilter {
|
|
86
|
+
readonly runId?: string;
|
|
87
|
+
readonly agentId?: string;
|
|
88
|
+
readonly conversationId?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Wire vocabulary for the resource dimension — maps to the runtime's
|
|
91
|
+
* `resourceKind` (`llm.inference`, `tool.invocation`, `storage.write`,
|
|
92
|
+
* `sandbox.exec`, ...). Exact-match; free-form string so deployments
|
|
93
|
+
* can extend without a schema change.
|
|
94
|
+
*/
|
|
95
|
+
readonly category?: string;
|
|
96
|
+
readonly providerId?: string;
|
|
97
|
+
readonly from?: Date;
|
|
98
|
+
readonly to?: Date;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface CostRecordPage {
|
|
102
|
+
readonly data: readonly CostRecord[];
|
|
103
|
+
readonly nextCursor?: Cursor;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// -------- getRecord --------
|
|
107
|
+
|
|
108
|
+
export interface CostGetRecordInput {
|
|
109
|
+
readonly tenantId: TenantId;
|
|
110
|
+
readonly recordId: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// -------- aggregate --------
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Group dimensions the binding may aggregate over. `day` / `month` are
|
|
117
|
+
* time bucketing on `occurredAt` (UTC calendar day / month). Every call
|
|
118
|
+
* is tenant-scoped, so `tenant` always resolves to the caller's tenant
|
|
119
|
+
* id.
|
|
120
|
+
*/
|
|
121
|
+
export type CostGroupDimension =
|
|
122
|
+
| 'agentId'
|
|
123
|
+
| 'runId'
|
|
124
|
+
| 'category'
|
|
125
|
+
| 'providerId'
|
|
126
|
+
| 'day'
|
|
127
|
+
| 'month'
|
|
128
|
+
| 'tenant'
|
|
129
|
+
| 'conversationId';
|
|
130
|
+
|
|
131
|
+
export const COST_GROUP_DIMENSIONS: readonly CostGroupDimension[] = [
|
|
132
|
+
'agentId',
|
|
133
|
+
'runId',
|
|
134
|
+
'category',
|
|
135
|
+
'providerId',
|
|
136
|
+
'day',
|
|
137
|
+
'month',
|
|
138
|
+
'tenant',
|
|
139
|
+
'conversationId',
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
export interface CostAggregateInput {
|
|
143
|
+
readonly tenantId: TenantId;
|
|
144
|
+
readonly groupBy: readonly CostGroupDimension[];
|
|
145
|
+
readonly from: Date;
|
|
146
|
+
readonly to: Date;
|
|
147
|
+
readonly filter?: CostRecordFilter;
|
|
148
|
+
/**
|
|
149
|
+
* Narrow the aggregate to a specific scope. Same semantics as
|
|
150
|
+
* `CostListRecordsInput.scope` — content-scoped; an org scope covers
|
|
151
|
+
* the org's projects. Lets `/v1/cost/aggregate` accept the same
|
|
152
|
+
* `?scopeKind + ?scopeId` triplet as `/v1/cost/records`. Without
|
|
153
|
+
* this, an aggregate call after a scoped list would drop the scope
|
|
154
|
+
* silently. `inherit` is a documented no-op for this content-scoped
|
|
155
|
+
* binding.
|
|
156
|
+
*/
|
|
157
|
+
readonly scope?: Scope;
|
|
158
|
+
/**
|
|
159
|
+
* `false` = literal-at-this-scope only. `true` (default) = inheritance
|
|
160
|
+
* walk. No-op for content-scoped bindings; passed through for wire
|
|
161
|
+
* shape uniformity.
|
|
162
|
+
*/
|
|
163
|
+
readonly inherit?: boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* One row of the aggregate result. `key` maps every requested `groupBy`
|
|
168
|
+
* dimension to its value for this group — `null` when the underlying
|
|
169
|
+
* records had no value for that dimension (e.g. records with no
|
|
170
|
+
* `agentId` when grouping by `agentId`). Downstream consumers treat
|
|
171
|
+
* `null` as a distinct group ("unattributed").
|
|
172
|
+
*/
|
|
173
|
+
export interface CostAggregateGroup {
|
|
174
|
+
readonly key: Readonly<Record<string, string | null>>;
|
|
175
|
+
readonly count: number;
|
|
176
|
+
readonly totalUsd: number;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface CostAggregateResult {
|
|
180
|
+
readonly groups: readonly CostAggregateGroup[];
|
|
181
|
+
readonly totalUsd: number;
|
|
182
|
+
readonly totalRecords: number;
|
|
183
|
+
readonly timeRange: {
|
|
184
|
+
readonly from: Timestamp;
|
|
185
|
+
readonly to: Timestamp;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// -------- CostRecord (wire) --------
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Wire shape for a single cost record. Corresponds 1:1 to a usage
|
|
193
|
+
* record in the runtime's cost tracker, flattened for the wire
|
|
194
|
+
* (`resourceKind` renamed to `category`; `attributes.agentId`
|
|
195
|
+
* / `attributes.conversationId` lifted to top-level fields when
|
|
196
|
+
* present). The binding decides how to reshape the runtime row — this
|
|
197
|
+
* type just describes what the route hands back.
|
|
198
|
+
*/
|
|
199
|
+
export interface CostRecord {
|
|
200
|
+
readonly id: string;
|
|
201
|
+
readonly tenantId: TenantId;
|
|
202
|
+
readonly category: string;
|
|
203
|
+
readonly providerId?: string;
|
|
204
|
+
readonly runId?: string;
|
|
205
|
+
readonly agentId?: string;
|
|
206
|
+
readonly conversationId?: string;
|
|
207
|
+
readonly quantity: number;
|
|
208
|
+
readonly unit: string;
|
|
209
|
+
readonly costUsd?: number;
|
|
210
|
+
readonly occurredAt: Timestamp;
|
|
211
|
+
readonly metrics?: Readonly<Record<string, unknown>>;
|
|
212
|
+
readonly attributes?: Readonly<Record<string, unknown>>;
|
|
213
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { Cursor, SigningKeyId, TenantId } from '@kindgi/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Caller-plugged surface for the deployment ledger — the audit anchor
|
|
8
|
+
* row written by `POST /v1/deployments`. Mirrors the
|
|
9
|
+
* caller-plugged pattern of `BlobStorageBinding` /
|
|
10
|
+
* `PolicyRegistryBinding`: the API package does NOT own deployment
|
|
11
|
+
* storage. Deployments plug their own store (a database, or in-memory for
|
|
12
|
+
* tests) through this interface.
|
|
13
|
+
*
|
|
14
|
+
* Semantics:
|
|
15
|
+
* - A deployment is the append-only record of a signed image landing
|
|
16
|
+
* at the API. Its `imageDigest` (extracted from `imageRef`) is the
|
|
17
|
+
* idempotency key — re-registering the same digest returns the
|
|
18
|
+
* existing record with no new `artifactVersion`.
|
|
19
|
+
* - The full signature envelope (`signerKeyId`, `signerPublicKey`,
|
|
20
|
+
* `signature`, canonical `indexHash`) is persisted so regulators
|
|
21
|
+
* can re-verify offline against the immutable image bytes.
|
|
22
|
+
* - Primitive counts (`tools` / `guardrails` / `agents` / `flows`)
|
|
23
|
+
* are captured for at-a-glance rendering; the full manifest set
|
|
24
|
+
* lives at `imageRef@sha256:…/app/index.json`.
|
|
25
|
+
*
|
|
26
|
+
* Every method is tenant-scoped: callers pass `tenantId` explicitly so
|
|
27
|
+
* multi-tenant deployments can partition storage without exposing the
|
|
28
|
+
* scoping inside the API package.
|
|
29
|
+
*
|
|
30
|
+
* Cursors are opaque — the binding chooses its encoding. The API layer
|
|
31
|
+
* only validates that a cursor round-trips as a string.
|
|
32
|
+
*
|
|
33
|
+
* ## Seam only
|
|
34
|
+
*
|
|
35
|
+
* This file defines the seam the `packages/api/src/routes/deployments.ts`
|
|
36
|
+
* route calls; no implementation is bundled.
|
|
37
|
+
*/
|
|
38
|
+
export interface DeploymentBinding {
|
|
39
|
+
/**
|
|
40
|
+
* Persist a signed deployment record. The API route checks the signer
|
|
41
|
+
* against the trust list (`SigningKeyBinding.isTrusted`), verifies the
|
|
42
|
+
* Ed25519 signature, verifies image pullability
|
|
43
|
+
* (`ImageRegistryBinding.head`), and validates every primitive in the
|
|
44
|
+
* index before calling — the binding receives a well-formed input.
|
|
45
|
+
*
|
|
46
|
+
* Idempotent per `imageDigest`: when the same digest is re-registered
|
|
47
|
+
* under the same tenant the binding MUST return
|
|
48
|
+
* `{ kind: 'already-registered', deployment }` with the existing row
|
|
49
|
+
* (existing `artifactVersion` — the issuer-supplied value the row
|
|
50
|
+
* originally pinned). Different digest → new row with the caller's
|
|
51
|
+
* newly-supplied `artifactVersion` persisted verbatim.
|
|
52
|
+
*/
|
|
53
|
+
register(input: DeploymentRegisterInput): Promise<DeploymentRegisterOutcome>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch a deployment by its server-allocated id. `null` when unknown
|
|
56
|
+
* to the tenant. The route surfaces `null` as `404
|
|
57
|
+
* deployment-not-found`.
|
|
58
|
+
*/
|
|
59
|
+
get(input: DeploymentGetInput): Promise<Deployment | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Fetch a deployment by its `imageDigest` (the sha256 of the pinned
|
|
62
|
+
* OCI image). Used for the idempotency check on `register` and for
|
|
63
|
+
* cross-referencing image identity from the sandbox layer at
|
|
64
|
+
* dispatch. `null` when no record exists.
|
|
65
|
+
*/
|
|
66
|
+
getByImageDigest(input: DeploymentGetByImageDigestInput): Promise<Deployment | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Cursor-paginated list, sorted by `activatedAt` descending
|
|
69
|
+
* (binding-defined tie-break, e.g. `deploymentId` desc). Filters
|
|
70
|
+
* compose as AND.
|
|
71
|
+
*/
|
|
72
|
+
list(input: DeploymentListInput): Promise<DeploymentPage>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// -------------------- record --------------------
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Wire shape for a deployment record. Immutable once written — every
|
|
79
|
+
* field is set atomically at `register` time.
|
|
80
|
+
*
|
|
81
|
+
* `signerPublicKey` is retained alongside `signerKeyId` so offline audit
|
|
82
|
+
* can re-verify without hitting the tenant's trust list; the trust-list
|
|
83
|
+
* check happens at `register` time inside the route (via
|
|
84
|
+
* `SigningKeyBinding.isTrusted`).
|
|
85
|
+
*/
|
|
86
|
+
export interface Deployment {
|
|
87
|
+
readonly deploymentId: string;
|
|
88
|
+
readonly tenantId: TenantId;
|
|
89
|
+
/** Full digest-pinned image reference, e.g. `registry.example.com/acme/pack@sha256:…`. */
|
|
90
|
+
readonly imageRef: string;
|
|
91
|
+
/** `sha256` hex-encoded digest extracted from `imageRef` (idempotency key). */
|
|
92
|
+
readonly imageDigest: string;
|
|
93
|
+
/**
|
|
94
|
+
* Issuer-supplied `YYYYMMDD.N` — matches the value inside the signed
|
|
95
|
+
* envelope. Bindings persist it verbatim; the
|
|
96
|
+
* signature is only offline-verifiable if the same bytes round-trip.
|
|
97
|
+
*/
|
|
98
|
+
readonly artifactVersion: string;
|
|
99
|
+
/** `sha256` of the canonicalised `index.json` extracted from the image. */
|
|
100
|
+
readonly indexHash: string;
|
|
101
|
+
/** Which key signed the deploy. Cross-checked against `SigningKeyBinding`. */
|
|
102
|
+
readonly signerKeyId: SigningKeyId;
|
|
103
|
+
/** Retained for offline audit. Base64 of the raw public-key bytes. */
|
|
104
|
+
readonly signerPublicKey: string;
|
|
105
|
+
/** Base64 of the Ed25519 signature over the canonicalised envelope. */
|
|
106
|
+
readonly signature: string;
|
|
107
|
+
/** Issuer-supplied timestamp inside the signed envelope. ISO-8601. */
|
|
108
|
+
readonly publishedAt: string;
|
|
109
|
+
/** Server-side ledger timestamp — when `register` returned OK. ISO-8601. */
|
|
110
|
+
readonly activatedAt: string;
|
|
111
|
+
/**
|
|
112
|
+
* Counts of primitives in the deployment's `index.json`. Not
|
|
113
|
+
* authoritative — the image is. Populated for cheap admin rendering.
|
|
114
|
+
*/
|
|
115
|
+
readonly primitives: DeploymentPrimitiveCounts;
|
|
116
|
+
/**
|
|
117
|
+
* Exactly what the deployment shipped: each primitive's id and, for
|
|
118
|
+
* the versioned ones, its version. Versions are immutable, so this is
|
|
119
|
+
* enough to know which code a deployment made live.
|
|
120
|
+
*/
|
|
121
|
+
readonly contents: DeploymentContents;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** A primitive a deployment shipped. Guardrails have no version. */
|
|
125
|
+
export interface DeployedPrimitive {
|
|
126
|
+
readonly id: string;
|
|
127
|
+
readonly version?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface DeploymentContents {
|
|
131
|
+
readonly tools: readonly DeployedPrimitive[];
|
|
132
|
+
readonly guardrails: readonly DeployedPrimitive[];
|
|
133
|
+
readonly agents: readonly DeployedPrimitive[];
|
|
134
|
+
readonly flows: readonly DeployedPrimitive[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface DeploymentPrimitiveCounts {
|
|
138
|
+
readonly tools: number;
|
|
139
|
+
readonly guardrails: number;
|
|
140
|
+
readonly agents: number;
|
|
141
|
+
readonly flows: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// -------------------- register --------------------
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Everything the ledger needs to persist a signed deployment. The route
|
|
148
|
+
* assembles this from the request body + verified sig envelope; the
|
|
149
|
+
* binding does not re-verify the signature (that's the route's job).
|
|
150
|
+
*/
|
|
151
|
+
export interface DeploymentRegisterInput {
|
|
152
|
+
readonly tenantId: TenantId;
|
|
153
|
+
readonly imageRef: string;
|
|
154
|
+
readonly imageDigest: string;
|
|
155
|
+
/**
|
|
156
|
+
* Issuer-supplied `YYYYMMDD.N`. Part of the canonical signed envelope
|
|
157
|
+
* — persisted verbatim so offline verification
|
|
158
|
+
* can reproduce the exact bytes.
|
|
159
|
+
*/
|
|
160
|
+
readonly artifactVersion: string;
|
|
161
|
+
readonly indexHash: string;
|
|
162
|
+
readonly signerKeyId: SigningKeyId;
|
|
163
|
+
readonly signerPublicKey: string;
|
|
164
|
+
readonly signature: string;
|
|
165
|
+
readonly publishedAt: string;
|
|
166
|
+
readonly primitives: DeploymentPrimitiveCounts;
|
|
167
|
+
readonly contents: DeploymentContents;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type DeploymentRegisterOutcome =
|
|
171
|
+
| {
|
|
172
|
+
readonly kind: 'ok';
|
|
173
|
+
readonly deployment: Deployment;
|
|
174
|
+
}
|
|
175
|
+
| {
|
|
176
|
+
/**
|
|
177
|
+
* Same `imageDigest` was already registered for this tenant. The
|
|
178
|
+
* binding returns the existing row unchanged; the route surfaces
|
|
179
|
+
* as `200 OK` (idempotent replay), NOT `409`.
|
|
180
|
+
*/
|
|
181
|
+
readonly kind: 'already-registered';
|
|
182
|
+
readonly deployment: Deployment;
|
|
183
|
+
}
|
|
184
|
+
| {
|
|
185
|
+
/** Any other write failure — persistence error, invalid input. */
|
|
186
|
+
readonly kind: 'error';
|
|
187
|
+
readonly code: string;
|
|
188
|
+
readonly message: string;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// -------------------- get --------------------
|
|
192
|
+
|
|
193
|
+
export interface DeploymentGetInput {
|
|
194
|
+
readonly tenantId: TenantId;
|
|
195
|
+
readonly deploymentId: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface DeploymentGetByImageDigestInput {
|
|
199
|
+
readonly tenantId: TenantId;
|
|
200
|
+
readonly imageDigest: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// -------------------- list --------------------
|
|
204
|
+
|
|
205
|
+
export interface DeploymentListInput {
|
|
206
|
+
readonly tenantId: TenantId;
|
|
207
|
+
readonly limit: number;
|
|
208
|
+
readonly cursor?: Cursor;
|
|
209
|
+
/**
|
|
210
|
+
* Optional prefix filter on `Deployment.imageRef`. Useful for
|
|
211
|
+
* `registry.example.com/acme/support-pack@sha256:` matches within a
|
|
212
|
+
* multi-image tenant.
|
|
213
|
+
*/
|
|
214
|
+
readonly imageRefPrefix?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Restrict to a specific signing key. Useful for revocation audits —
|
|
217
|
+
* "which deploys did the compromised key sign?"
|
|
218
|
+
*/
|
|
219
|
+
readonly signerKeyId?: SigningKeyId;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface DeploymentPage {
|
|
223
|
+
readonly data: readonly Deployment[];
|
|
224
|
+
readonly nextCursor?: Cursor;
|
|
225
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { TupleEnqueueHook } from '@kindgi/authz';
|
|
5
|
+
import type { Scope } from '@kindgi/platform';
|
|
6
|
+
import type { Cursor, EnvName, Result } from '@kindgi/types';
|
|
7
|
+
|
|
8
|
+
import type { ResolveContext } from './secrets-binding.js';
|
|
9
|
+
|
|
10
|
+
export type { ResolveContext } from './secrets-binding.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Caller-plugged env store — non-sensitive per-env values. Same
|
|
14
|
+
* `(scope, envName, name)` structural key as `SecretBinding`, same
|
|
15
|
+
* discriminated `Scope` primitive from `@kindgi/platform`.
|
|
16
|
+
* Emits `env-resolved` compliance-evidence events on every `resolve`
|
|
17
|
+
* — symmetric with secrets, gives operators the same debugging
|
|
18
|
+
* superpower ("what did this run see for its env at start?").
|
|
19
|
+
*
|
|
20
|
+
* What differs from `SecretBinding`:
|
|
21
|
+
* - `value` returns on the wire (env is non-sensitive by
|
|
22
|
+
* definition); no capability gate on read.
|
|
23
|
+
* - Revision counter, not version-with-rotation-ceremony. Overwrite
|
|
24
|
+
* bumps `revision`; there's no revoke, no hard-delete, no
|
|
25
|
+
* rotation-workflow-with-async-completion.
|
|
26
|
+
* - No encryption at rest.
|
|
27
|
+
*
|
|
28
|
+
* Env-safety: cross-env reads are refused. Same structural rule as
|
|
29
|
+
* secrets.
|
|
30
|
+
*/
|
|
31
|
+
export interface EnvBinding {
|
|
32
|
+
/** Cursor-paginated list. Returns `value` for every entry. */
|
|
33
|
+
list(input: EnvListInput): Promise<EnvListPage>;
|
|
34
|
+
|
|
35
|
+
/** Fetch a single entry. `null` when unknown. */
|
|
36
|
+
get(input: EnvGetInput): Promise<EnvRecord | null>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Resolve at dispatch time. Same `ResolveContext` as secrets. Emits
|
|
40
|
+
* `env-resolved` compliance-evidence event on every call.
|
|
41
|
+
*/
|
|
42
|
+
resolve(input: EnvResolveInput): Promise<Result<EnvResolveOutcome, EnvError>>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Write / overwrite an env value. Every write bumps `revision`.
|
|
46
|
+
* `ifRevision` provides optimistic concurrency guard.
|
|
47
|
+
*/
|
|
48
|
+
set(input: EnvSetInput): Promise<EnvSetOutcome>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Idempotent delete. Returns `{ deleted: false }` on unknown key.
|
|
52
|
+
* No soft-delete — env is a plain overwrite-shaped store; delete
|
|
53
|
+
* means gone.
|
|
54
|
+
*/
|
|
55
|
+
delete(input: EnvDeleteInput): Promise<EnvDeleteOutcome>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface EnvRecord {
|
|
59
|
+
readonly scope: Scope;
|
|
60
|
+
readonly envName: EnvName;
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly value: string;
|
|
63
|
+
readonly revision: number;
|
|
64
|
+
readonly createdAt: string;
|
|
65
|
+
readonly updatedAt: string;
|
|
66
|
+
readonly tags?: Readonly<Record<string, string>>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface EnvListInput {
|
|
70
|
+
readonly scope: Scope;
|
|
71
|
+
readonly envName: EnvName;
|
|
72
|
+
readonly limit: number;
|
|
73
|
+
readonly cursor?: Cursor;
|
|
74
|
+
readonly namePrefix?: string;
|
|
75
|
+
readonly tagFilter?: Readonly<Record<string, string>>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface EnvListPage {
|
|
79
|
+
readonly data: readonly EnvRecord[];
|
|
80
|
+
readonly nextCursor?: Cursor;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface EnvGetInput {
|
|
84
|
+
readonly scope: Scope;
|
|
85
|
+
readonly envName: EnvName;
|
|
86
|
+
readonly name: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface EnvResolveInput {
|
|
90
|
+
readonly scope: Scope;
|
|
91
|
+
readonly envName: EnvName;
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly resolveContext: ResolveContext;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface EnvResolveOutcome {
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly value: string;
|
|
99
|
+
readonly revision: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface EnvSetInput {
|
|
103
|
+
readonly scope: Scope;
|
|
104
|
+
readonly envName: EnvName;
|
|
105
|
+
readonly name: string;
|
|
106
|
+
readonly value: string;
|
|
107
|
+
readonly tags?: Readonly<Record<string, string>>;
|
|
108
|
+
readonly ifRevision?: number;
|
|
109
|
+
/**
|
|
110
|
+
* REQUIRED. Called inside the binding's write tx on FRESH insert
|
|
111
|
+
* (new env-var identity). Receives the new entry's id as the FGA
|
|
112
|
+
* subject id. Not invoked on revision-update (identity already exists).
|
|
113
|
+
* See `AgentPublishInput.enqueueTuples` for the design rationale.
|
|
114
|
+
*/
|
|
115
|
+
readonly enqueueTuples: TupleEnqueueHook;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type EnvSetOutcome =
|
|
119
|
+
| { readonly kind: 'ok'; readonly record: EnvRecord }
|
|
120
|
+
| { readonly kind: 'revision-conflict'; readonly currentRevision: number }
|
|
121
|
+
| { readonly kind: 'error'; readonly code: string; readonly message: string };
|
|
122
|
+
|
|
123
|
+
export interface EnvDeleteInput {
|
|
124
|
+
readonly scope: Scope;
|
|
125
|
+
readonly envName: EnvName;
|
|
126
|
+
readonly name: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface EnvDeleteOutcome {
|
|
130
|
+
readonly deleted: boolean;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type EnvError =
|
|
134
|
+
| { readonly code: 'env-not-found'; readonly message: string; readonly name: string }
|
|
135
|
+
| {
|
|
136
|
+
readonly code: 'env-write-conflict';
|
|
137
|
+
readonly message: string;
|
|
138
|
+
readonly currentRevision: number;
|
|
139
|
+
}
|
|
140
|
+
| { readonly code: 'env-store-error'; readonly message: string; readonly cause?: unknown };
|