@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/dist/app.d.ts
ADDED
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import type { ConversationBinding, RunSnapshotBinding } from '@kindgi/agents';
|
|
3
|
+
import type { AuditEventBinding } from '@kindgi/audit-events';
|
|
4
|
+
import type { AuthzCheckBinding } from '@kindgi/authz';
|
|
5
|
+
import type { AdapterFactoryRegistry } from '@kindgi/capabilities';
|
|
6
|
+
import type { ComplianceEvidenceGenerator, LoadedClassifier } from '@kindgi/compliance';
|
|
7
|
+
import type { SigningKeyBinding } from '@kindgi/crypto';
|
|
8
|
+
import type { TenantHierarchyBinding } from '@kindgi/platform';
|
|
9
|
+
import type { OrgBinding, ProjectBinding, ProjectMembershipBinding, TeamBinding, TeamMembershipBinding, TeamProjectGrantBinding } from '@kindgi/platform';
|
|
10
|
+
import type { KernelBinding } from '@kindgi/runtime';
|
|
11
|
+
import type { BlobStorageBinding } from '@kindgi/blob-binding';
|
|
12
|
+
import type { MemoryQueryBinding } from '@kindgi/memory';
|
|
13
|
+
import type { PolicyRegistryBinding } from '@kindgi/policy-contract';
|
|
14
|
+
import type { AdapterRegistryBinding } from './adapter-binding.js';
|
|
15
|
+
import type { AgentRegistryBinding } from './agent-binding.js';
|
|
16
|
+
import type { CapabilityRegistryBinding } from './capability-binding.js';
|
|
17
|
+
import type { CostBinding } from './cost-binding.js';
|
|
18
|
+
import type { DeploymentBinding } from './deployment-binding.js';
|
|
19
|
+
import type { EnvBinding } from './env-binding.js';
|
|
20
|
+
import type { EvalRunBinding } from './eval-run-binding.js';
|
|
21
|
+
import type { EvalSuiteRegistryBinding } from './eval-suite-binding.js';
|
|
22
|
+
import type { EventBusBinding } from './event-bus-binding.js';
|
|
23
|
+
import type { FlowRegistryBinding } from './flow-binding.js';
|
|
24
|
+
import type { GuardrailRegistryBinding } from './guardrail-binding.js';
|
|
25
|
+
import type { RunHandlerBinding } from './handler-binding.js';
|
|
26
|
+
import type { HitlBinding } from './hitl-binding.js';
|
|
27
|
+
import type { IdentityDirectoryBinding } from './identity-directory-binding.js';
|
|
28
|
+
import type { ExchangeCodeFn, IdentityProviderBinding, RefreshTokenFn } from './identity-provider-binding.js';
|
|
29
|
+
import type { ImageRegistryBinding } from './image-registry-binding.js';
|
|
30
|
+
import type { MCPClientProbeBinding, MCPEndpointRegistryBinding } from './mcp-endpoint-binding.js';
|
|
31
|
+
import type { MemoryBinding } from './memory-binding.js';
|
|
32
|
+
import { type TokenResolver } from './middleware/auth.js';
|
|
33
|
+
import { type IdempotencyStore } from './middleware/idempotency.js';
|
|
34
|
+
import { type GenerateOptions } from './openapi/generate.js';
|
|
35
|
+
import type { ProvenanceBinding } from './provenance-binding.js';
|
|
36
|
+
import type { ProviderRegistryBinding } from './provider-binding.js';
|
|
37
|
+
import { type PublicRunTokenConfig } from './public-run-token.js';
|
|
38
|
+
import type { RetentionBinding } from './retention-binding.js';
|
|
39
|
+
import type { ReviewerBinding, ReviewerRegistryBinding } from './reviewer-binding.js';
|
|
40
|
+
import { type RotationStatusStore } from './rotation-status-store.js';
|
|
41
|
+
import type { S3CredentialBinding } from './s3-credential-binding.js';
|
|
42
|
+
import type { SecretBinding } from './secrets-binding.js';
|
|
43
|
+
import type { SessionStoreBinding } from './session-store-binding.js';
|
|
44
|
+
import type { SigningKeyBinding as SigningKeyRegistryBinding } from './signing-key-binding.js';
|
|
45
|
+
import { type OauthStateStore } from './state-store-binding.js';
|
|
46
|
+
import type { SupervisorBinding } from './supervisor-binding.js';
|
|
47
|
+
import type { TenantHostAccess } from './tenant-host-access.js';
|
|
48
|
+
import type { TokenAdmin } from './token-admin.js';
|
|
49
|
+
import type { ToolRegistryBinding } from './tool-binding.js';
|
|
50
|
+
import type { TriggerRegistryBinding } from './trigger-binding.js';
|
|
51
|
+
import type { AppEnv } from './types.js';
|
|
52
|
+
import type { WebhookEndpointBinding } from './webhook-endpoint-binding.js';
|
|
53
|
+
/**
|
|
54
|
+
* Assemble the platform HTTP app. Caller-injectable dependencies:
|
|
55
|
+
*
|
|
56
|
+
* - `resolveToken`: `(token) → Promise<{ tenantId, … } | null>`. Caller
|
|
57
|
+
* plugs in the actual token store — this package doesn't own auth
|
|
58
|
+
* persistence.
|
|
59
|
+
* - `runHandler`: bridge from `POST /v1/runs` requests into the
|
|
60
|
+
* agent/flow invocation stack. See `RunHandlerBinding` for shape.
|
|
61
|
+
*
|
|
62
|
+
* The returned app is a plain Hono instance; callers mount it on a
|
|
63
|
+
* server (e.g. `@hono/node-server`) or invoke `.request(...)` directly
|
|
64
|
+
* for tests.
|
|
65
|
+
*/
|
|
66
|
+
export interface CreateAppInput {
|
|
67
|
+
readonly resolveToken: TokenResolver;
|
|
68
|
+
readonly runHandler: RunHandlerBinding;
|
|
69
|
+
/**
|
|
70
|
+
* Conversation store binding — openConversation / getConversation /
|
|
71
|
+
* listConversations / listConversationsPage / closeConversation /
|
|
72
|
+
* deleteConversation / appendMessage / readMessages. Every
|
|
73
|
+
* conversation-touching route (conversations, approvals audit
|
|
74
|
+
* bundle, provenance signed export) routes through this binding.
|
|
75
|
+
* The Kindgi runtime supplies an implementation. Required.
|
|
76
|
+
*/
|
|
77
|
+
readonly conversationBinding: ConversationBinding;
|
|
78
|
+
/**
|
|
79
|
+
* Run-snapshot store binding — write / read on the run reconstruction
|
|
80
|
+
* envelope. Not called by this package's routes; required so the host
|
|
81
|
+
* can assemble a complete `InvokeAgentBindings` (`@kindgi/agents`)
|
|
82
|
+
* when it constructs the agent-runtime handler. The Kindgi runtime
|
|
83
|
+
* supplies an implementation.
|
|
84
|
+
*/
|
|
85
|
+
readonly runSnapshotBinding: RunSnapshotBinding;
|
|
86
|
+
/**
|
|
87
|
+
* Kernel binding (`@kindgi/runtime`) for run lifecycle + scheduler /
|
|
88
|
+
* waitpoint / retention / trigger-registry / event-bus sub-bindings.
|
|
89
|
+
* The Kindgi runtime supplies one (or pass a bespoke implementation).
|
|
90
|
+
*
|
|
91
|
+
* Required — @kindgi/api holds no reference to the kernel
|
|
92
|
+
* itself, so the caller owns the construction.
|
|
93
|
+
*/
|
|
94
|
+
readonly kernelBinding: KernelBinding;
|
|
95
|
+
/**
|
|
96
|
+
* Tenant-hierarchy CRUD binding — atomic entity writes + FGA
|
|
97
|
+
* parent/owner tuple emission. Used by the always-mounted
|
|
98
|
+
* `/v1/tenant` route and by `/v1/orgs`, `/v1/teams`, `/v1/projects`
|
|
99
|
+
* when the corresponding platform bindings are supplied. The Kindgi
|
|
100
|
+
* runtime supplies an implementation.
|
|
101
|
+
*
|
|
102
|
+
* Required — same rationale as `kernelBinding`.
|
|
103
|
+
*/
|
|
104
|
+
readonly tenantHierarchyBinding: TenantHierarchyBinding;
|
|
105
|
+
/**
|
|
106
|
+
* Memory data-access binding — listFacts / searchByKeyword /
|
|
107
|
+
* searchBySemantic / appendLog / readLog. Every agent-runtime memory
|
|
108
|
+
* read and log write routes through this binding. This package's
|
|
109
|
+
* routes don't call it (conversation transcripts are read through
|
|
110
|
+
* `conversationBinding`). The Kindgi runtime supplies an
|
|
111
|
+
* implementation (or pass a bespoke one).
|
|
112
|
+
*
|
|
113
|
+
* Required — same rationale as `kernelBinding` / `provenanceBinding`.
|
|
114
|
+
*/
|
|
115
|
+
readonly memoryBinding: MemoryQueryBinding;
|
|
116
|
+
/**
|
|
117
|
+
* Provenance data-access binding — list summaries + full-DAG reads
|
|
118
|
+
* over stored provenance records. Used by the always-mounted
|
|
119
|
+
* `/v1/provenance` routes. The Kindgi runtime supplies an
|
|
120
|
+
* implementation (or pass a bespoke one).
|
|
121
|
+
*
|
|
122
|
+
* Required — @kindgi/api never touches the provenance schema or
|
|
123
|
+
* domain functions directly, so the caller owns the default
|
|
124
|
+
* construction.
|
|
125
|
+
*/
|
|
126
|
+
readonly provenanceBinding: ProvenanceBinding;
|
|
127
|
+
/**
|
|
128
|
+
* Optional authz enforcement config. When present, route handlers get
|
|
129
|
+
* an `Authorizer` (`authorize()` / `can()` / `check()` /
|
|
130
|
+
* `filterByCan()`) backed by `authzCheckBinding`. `principalMiddleware`
|
|
131
|
+
* runs on `/v1/*` either way. When absent (e.g. dev deployments),
|
|
132
|
+
* routes still work but authz is not enforced — bearer + capability
|
|
133
|
+
* gates are the only checks.
|
|
134
|
+
*/
|
|
135
|
+
readonly authz?: {
|
|
136
|
+
readonly fgaApiUrl: string;
|
|
137
|
+
/**
|
|
138
|
+
* PDP binding (`@kindgi/authz`) — `check(principal, action,
|
|
139
|
+
* resource, ctx?)` + `checkBatch(...)`. The Kindgi runtime supplies
|
|
140
|
+
* one (or pass a bespoke implementation).
|
|
141
|
+
*/
|
|
142
|
+
readonly authzCheckBinding: AuthzCheckBinding;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Optional unified audit substrate. When present:
|
|
146
|
+
* - `GET /v1/audit/authz` is mounted (admin@tenant only) as a
|
|
147
|
+
* view filtered to `kind='authz-decision'`. Those events are
|
|
148
|
+
* written by the authz check binding (wired to this same sink),
|
|
149
|
+
* correlated with the request's `x-request-id` — the `Authorizer`
|
|
150
|
+
* passes it as `correlationId` on every `check()`.
|
|
151
|
+
* - `/v1/compliance/*` is mounted as a view filtered to
|
|
152
|
+
* classifier-marked exportable kinds (needs
|
|
153
|
+
* `complianceClassifier` too).
|
|
154
|
+
* Absent = no durable audit trail; every subsystem's audit
|
|
155
|
+
* writes become no-ops.
|
|
156
|
+
*
|
|
157
|
+
* One write surface — authz decisions and compliance evidence share
|
|
158
|
+
* this single binding.
|
|
159
|
+
*/
|
|
160
|
+
readonly auditEvents?: AuditEventBinding;
|
|
161
|
+
/**
|
|
162
|
+
* Optional classification lens over `auditEvents`. Drives which
|
|
163
|
+
* audit-event kinds appear in the `/v1/compliance/*` view and (at
|
|
164
|
+
* export time) which get an Ed25519 signature. Absent =
|
|
165
|
+
* `/v1/compliance/*` is not mounted.
|
|
166
|
+
*/
|
|
167
|
+
readonly complianceClassifier?: LoadedClassifier;
|
|
168
|
+
/**
|
|
169
|
+
* Optional compliance-evidence generator. Required when
|
|
170
|
+
* `auditEvents` + `complianceClassifier` are provided (i.e., when
|
|
171
|
+
* `/v1/compliance/*` mounts). The Kindgi runtime supplies the
|
|
172
|
+
* generator (or pass a bespoke implementation). The public interface
|
|
173
|
+
* has recordFromRun / exportSigned / describe; implementations may add
|
|
174
|
+
* more (e.g. subscriptions), which @kindgi/api doesn't use.
|
|
175
|
+
*/
|
|
176
|
+
readonly complianceGenerator?: ComplianceEvidenceGenerator;
|
|
177
|
+
/**
|
|
178
|
+
* Optional. When omitted, a per-app in-memory store is used —
|
|
179
|
+
* appropriate for dev + tests, NOT for production (retries after a
|
|
180
|
+
* process restart won't dedupe). Prod deployments pass a persistent
|
|
181
|
+
* store (Postgres, Redis, etc.).
|
|
182
|
+
*/
|
|
183
|
+
readonly idempotencyStore?: IdempotencyStore;
|
|
184
|
+
/**
|
|
185
|
+
* Optional. When present, mounts the API-key routes: `POST /v1/tokens`
|
|
186
|
+
* (mint), `GET /v1/tokens` (list), `GET /v1/tokens/:tokenId` and
|
|
187
|
+
* `POST /v1/tokens/:tokenId/revoke`. Omit if the deployment manages
|
|
188
|
+
* keys out-of-band (e.g. via a separate admin console).
|
|
189
|
+
*/
|
|
190
|
+
readonly tokenAdmin?: TokenAdmin;
|
|
191
|
+
/**
|
|
192
|
+
* Optional. When present, mounts the HITL surface:
|
|
193
|
+
* - `GET /v1/approvals` (list, role-scoped)
|
|
194
|
+
* - `GET /v1/approvals/:approvalId`
|
|
195
|
+
* - `POST /v1/approvals/:approvalId/complete`
|
|
196
|
+
*
|
|
197
|
+
* Requires a `ReviewerBinding` because `hitl.submitReview` needs the
|
|
198
|
+
* reviewer's id (not their user id). Deployments plug in the
|
|
199
|
+
* `UserId → ReviewerId` lookup here.
|
|
200
|
+
*
|
|
201
|
+
* Also requires `hitlBinding` — the data-access surface. The Kindgi
|
|
202
|
+
* runtime supplies one (or pass a bespoke implementation); the api
|
|
203
|
+
* package holds no reference to the HITL domain functions.
|
|
204
|
+
*/
|
|
205
|
+
readonly reviewerBinding?: ReviewerBinding;
|
|
206
|
+
/**
|
|
207
|
+
* Required alongside `reviewerBinding`. The approvals data-access
|
|
208
|
+
* binding (`getApproval` / `listApprovals` / `submitReview` /
|
|
209
|
+
* `loadReviewDecision`) — `@kindgi/api` never touches the HITL
|
|
210
|
+
* domain functions or their storage directly. The Kindgi runtime
|
|
211
|
+
* supplies an implementation.
|
|
212
|
+
*/
|
|
213
|
+
readonly hitlBinding?: HitlBinding;
|
|
214
|
+
/**
|
|
215
|
+
* Optional. When present, mounts the reviewer roster sub-resource
|
|
216
|
+
* at `/v1/approvals/reviewers` — list / get / register / unregister.
|
|
217
|
+
* Caller-plugged, same pattern as `agentRegistry`. Distinct from
|
|
218
|
+
* `reviewerBinding` (which resolves a token's `UserId` to a
|
|
219
|
+
* `ReviewerId` for decision routing) so a deployment can wire the
|
|
220
|
+
* two independently.
|
|
221
|
+
*/
|
|
222
|
+
readonly reviewerRegistry?: ReviewerRegistryBinding;
|
|
223
|
+
/**
|
|
224
|
+
* Optional. When `true` AND `supervisor` is wired, mounts
|
|
225
|
+
* `GET /v1/observations` (supervisor readback). Both are needed —
|
|
226
|
+
* the flag is the deploy-time opt-in, the binding is the query seam.
|
|
227
|
+
* Without a `supervisor`
|
|
228
|
+
* binding this flag is a no-op.
|
|
229
|
+
*/
|
|
230
|
+
readonly enableObservations?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Optional. When present, mounts the agents catalog surface
|
|
233
|
+
* (`/v1/agents` list/get/publish, `/v1/agents/:agentId/versions/*`).
|
|
234
|
+
* Same caller-plugged pattern as `TokenAdmin` — the API package does
|
|
235
|
+
* NOT own registry persistence. Deployments plug in any
|
|
236
|
+
* implementation, e.g. one over `@kindgi/agents`' in-memory
|
|
237
|
+
* `AgentRegistry`.
|
|
238
|
+
*/
|
|
239
|
+
readonly agentRegistry?: AgentRegistryBinding;
|
|
240
|
+
/**
|
|
241
|
+
* Optional. When present, mounts the flows catalog surface
|
|
242
|
+
* (`/v1/flows` list/get/publish, `/v1/flows/:flowId/versions/*`).
|
|
243
|
+
* Caller-plugged pattern mirrors `agentRegistry` 1:1. Publish
|
|
244
|
+
* validates the wire body via `@kindgi/flow.loadFlow` — a flow
|
|
245
|
+
* published through the API is byte-identical to one constructed
|
|
246
|
+
* in-process. Enables non-agent workflows (webhook processors, ETL
|
|
247
|
+
* jobs, ingest pipelines) via HTTP.
|
|
248
|
+
*/
|
|
249
|
+
readonly flowRegistry?: FlowRegistryBinding;
|
|
250
|
+
/**
|
|
251
|
+
* Optional. When present, mounts the tools catalog surface
|
|
252
|
+
* (`/v1/tools` list/get/register/unregister). Caller-plugged
|
|
253
|
+
* pattern mirrors `agentRegistry`. Registration here is metadata-only
|
|
254
|
+
* — handler code is bundled with the runtime or shipped in a signed
|
|
255
|
+
* deployment (`POST /v1/deployments`).
|
|
256
|
+
*/
|
|
257
|
+
readonly toolRegistry?: ToolRegistryBinding;
|
|
258
|
+
/**
|
|
259
|
+
* Optional post-write hook fired after a successful tool publish /
|
|
260
|
+
* unregister / reinstate. The caller wires this to invalidate any
|
|
261
|
+
* in-process runtime cache that mirrors the persisted registry
|
|
262
|
+
* (e.g. the runtime's tool bridge, invalidated per tenant).
|
|
263
|
+
* Without it, a re-published tool's schema / description edits
|
|
264
|
+
* are silently ignored until the server process restarts.
|
|
265
|
+
*/
|
|
266
|
+
readonly onToolWrite?: import('./routes/tools.js').ToolWriteHook;
|
|
267
|
+
/**
|
|
268
|
+
* Optional. When present, mounts the guardrails catalog surface
|
|
269
|
+
* (`/v1/guardrails` list/get/register/unregister). Caller-plugged
|
|
270
|
+
* pattern mirrors `agentRegistry`. Registration here is metadata-only
|
|
271
|
+
* — the check implementation is bundled with the runtime or shipped
|
|
272
|
+
* in a signed deployment.
|
|
273
|
+
*/
|
|
274
|
+
readonly guardrailRegistry?: GuardrailRegistryBinding;
|
|
275
|
+
/**
|
|
276
|
+
* Optional post-write hook fired after a successful guardrail
|
|
277
|
+
* register / unregister. Caller wires this to invalidate any
|
|
278
|
+
* in-process runtime cache that mirrors the persisted registry
|
|
279
|
+
* (e.g. the runtime's guardrail bridge, invalidated per tenant).
|
|
280
|
+
* Without it, a newly-registered guardrail is stored but doesn't
|
|
281
|
+
* reach agent turns until the server process restarts. Same
|
|
282
|
+
* cache-invalidation concern as `onToolWrite` / `onProviderWrite`.
|
|
283
|
+
*/
|
|
284
|
+
readonly onGuardrailWrite?: import('./routes/guardrails.js').GuardrailWriteHook;
|
|
285
|
+
/**
|
|
286
|
+
* Optional. When present, mounts the retention surface
|
|
287
|
+
* (`/v1/retention/scheduled`, `/v1/retention/sweep`,
|
|
288
|
+
* `/v1/retention/sweep/:domain`). Caller-plugged; the Kindgi runtime
|
|
289
|
+
* supplies an implementation over its per-domain retention sweeps.
|
|
290
|
+
*/
|
|
291
|
+
readonly retention?: RetentionBinding;
|
|
292
|
+
/**
|
|
293
|
+
* Optional. When present, mounts the memory surface
|
|
294
|
+
* (`/v1/memory/facts` list/get/write/supersede, `/v1/memory/retrieve`).
|
|
295
|
+
* Caller-plugged pattern mirrors the other registry bindings — the
|
|
296
|
+
* API package doesn't hardwire an embedding provider or a retrieval
|
|
297
|
+
* policy registry. Deployments plug in a binding that wraps
|
|
298
|
+
* the memory subsystem runtime + their embedding registry.
|
|
299
|
+
*/
|
|
300
|
+
readonly memory?: MemoryBinding;
|
|
301
|
+
/**
|
|
302
|
+
* Optional. When present, mounts the supervisor proposals surface
|
|
303
|
+
* (`/v1/proposals` list/get/draft, plus lifecycle actions
|
|
304
|
+
* dry-run / submit-review / apply / rollback / withdraw). Every
|
|
305
|
+
* route requires an `X-Supervisor-Id` request header — the API
|
|
306
|
+
* package doesn't own the supervisor registry, so the binding
|
|
307
|
+
* receives that scope explicitly.
|
|
308
|
+
*
|
|
309
|
+
* The binding wraps the supervisor runtime primitives +
|
|
310
|
+
* the deployment's `AgentRegistry` + `HITL` wiring + eval dataset
|
|
311
|
+
* registry. See `supervisor-binding.ts` for the full contract.
|
|
312
|
+
*/
|
|
313
|
+
readonly supervisor?: SupervisorBinding;
|
|
314
|
+
/**
|
|
315
|
+
* Optional. Caller-plugged key store for signed provenance exports
|
|
316
|
+
* (`POST /v1/provenance/:runId/export`). When omitted, the export
|
|
317
|
+
* route responds `404 signing-not-configured` — the read routes
|
|
318
|
+
* (`GET /v1/provenance`, `GET /v1/provenance/:runId`) remain mounted
|
|
319
|
+
* either way because they read through `provenanceBinding` and do not
|
|
320
|
+
* need signing material.
|
|
321
|
+
*
|
|
322
|
+
* Same caller-plugged pattern as the other bindings — the API package
|
|
323
|
+
* does NOT own key persistence. Deployments plug in a binding that
|
|
324
|
+
* wraps their KMS / HSM / env-var store; see `SigningKeyBinding` in
|
|
325
|
+
* `@kindgi/crypto`.
|
|
326
|
+
*/
|
|
327
|
+
readonly signingKey?: SigningKeyBinding;
|
|
328
|
+
/**
|
|
329
|
+
* Optional. Issue and accept public run tokens (`kgi_pt_…`):
|
|
330
|
+
* short-lived, read-only tokens a browser uses to follow specific runs
|
|
331
|
+
* (`GET /v1/runs/:runId/progress` and its stream: status and steps, no data). When
|
|
332
|
+
* present, `POST /v1/runs` returns a `publicAccessToken`,
|
|
333
|
+
* `POST /v1/tokens/public` mints them, and `allowedOrigins` get CORS
|
|
334
|
+
* on those two read routes. Checked at startup: the key must be an
|
|
335
|
+
* Ed25519 key in `signingKey`. Use a key for this purpose alone.
|
|
336
|
+
*/
|
|
337
|
+
readonly publicRunTokens?: PublicRunTokenConfig;
|
|
338
|
+
/**
|
|
339
|
+
* Optional. When present, mounts the artifacts surface
|
|
340
|
+
* (`/v1/artifacts` list / multipart upload; `/v1/artifacts/:blobId`
|
|
341
|
+
* GET stream / HEAD / DELETE). Caller-plugged pattern mirrors the
|
|
342
|
+
* other registry bindings — the API package doesn't own storage.
|
|
343
|
+
* Deployments plug in a `BlobStorageBinding` implementation, e.g.
|
|
344
|
+
* filesystem-backed for development or object-store-backed in
|
|
345
|
+
* production.
|
|
346
|
+
*/
|
|
347
|
+
readonly blobStorage?: BlobStorageBinding;
|
|
348
|
+
/**
|
|
349
|
+
* Optional. When present, mounts the read-only capabilities catalog
|
|
350
|
+
* surface (`/v1/capabilities` list, `/v1/capabilities/:capabilityId`
|
|
351
|
+
* get). Capabilities are framework-declared (`FEATURES` enum in
|
|
352
|
+
* `@kindgi/capabilities` + `@kindgi/specs/capability.schema.json`) and
|
|
353
|
+
* deployment-extended at boot time via the binding — tenants do NOT
|
|
354
|
+
* author capabilities via HTTP.
|
|
355
|
+
*/
|
|
356
|
+
readonly capabilityRegistry?: CapabilityRegistryBinding;
|
|
357
|
+
/**
|
|
358
|
+
* Optional. When present, mounts the model-providers catalog surface
|
|
359
|
+
* (`/v1/providers` list, `/v1/providers/:providerId` get, `POST
|
|
360
|
+
* /v1/providers` register, `POST /v1/providers/:providerId/unregister`,
|
|
361
|
+
* `GET /v1/providers/:providerId/capabilities` sub-resource). Full
|
|
362
|
+
* CRUD — tenants register their own providers. `ProviderMetadata` is
|
|
363
|
+
* the wire shape; secrets never cross the wire (they stay inside the
|
|
364
|
+
* binding).
|
|
365
|
+
*/
|
|
366
|
+
readonly providerRegistry?: ProviderRegistryBinding;
|
|
367
|
+
/**
|
|
368
|
+
* Optional post-write hook fired after a successful provider
|
|
369
|
+
* register / unregister. The caller wires this to invalidate any
|
|
370
|
+
* in-process runtime cache that mirrors the persisted registry
|
|
371
|
+
* (e.g. the runtime's provider bridge, invalidated per tenant).
|
|
372
|
+
* Without it, a provider registered after boot is stored but the
|
|
373
|
+
* runtime keeps serving its boot-time snapshot — routing continues
|
|
374
|
+
* to pick whatever was seeded at boot even after the operator
|
|
375
|
+
* registered another provider.
|
|
376
|
+
*/
|
|
377
|
+
readonly onProviderWrite?: import('./routes/providers.js').ProviderWriteHook;
|
|
378
|
+
/**
|
|
379
|
+
* Optional. When present, mounts the MCP-endpoint registry surface at
|
|
380
|
+
* `/v1/mcp/endpoints/*` — `GET /v1/mcp/endpoints` (list, cursor-paginated,
|
|
381
|
+
* optional `?transport=` filter), `GET /v1/mcp/endpoints/:endpointId`,
|
|
382
|
+
* `POST /v1/mcp/endpoints` (register), `POST /v1/mcp/endpoints/:endpointId/unregister`.
|
|
383
|
+
* Full CRUD — tenants declare the remote MCP servers they want the
|
|
384
|
+
* runtime to consume. `MCPEndpoint` is the wire shape; its `secretRef`
|
|
385
|
+
* names a secret in the deployment's store, never the credential.
|
|
386
|
+
* The runtime can discover each endpoint's tools at boot and register
|
|
387
|
+
* them into the tool registry under the same tenant.
|
|
388
|
+
*/
|
|
389
|
+
readonly mcpEndpointRegistry?: MCPEndpointRegistryBinding;
|
|
390
|
+
/**
|
|
391
|
+
* How far tenant configuration may reach into the server's host
|
|
392
|
+
* (`KINDGI_TENANT_HOST_ACCESS`, see `tenant-host-access.ts`): under
|
|
393
|
+
* `deployed`, registering a stdio MCP endpoint answers `403
|
|
394
|
+
* host-access-denied`. Default `deployed`; the runtime passes `local`
|
|
395
|
+
* only for a development server.
|
|
396
|
+
*/
|
|
397
|
+
readonly tenantHostAccess?: TenantHostAccess;
|
|
398
|
+
/**
|
|
399
|
+
* Optional. Backs the MCP resources + prompts routes, which mount with
|
|
400
|
+
* `mcpEndpointRegistry`:
|
|
401
|
+
* `GET /v1/mcp/endpoints/:endpointId/resources`,
|
|
402
|
+
* `GET /v1/mcp/endpoints/:endpointId/resources/:uri`,
|
|
403
|
+
* `GET /v1/mcp/endpoints/:endpointId/prompts`,
|
|
404
|
+
* `POST /v1/mcp/endpoints/:endpointId/prompts/:name`.
|
|
405
|
+
*
|
|
406
|
+
* A typical implementation opens a fresh MCP client against the
|
|
407
|
+
* endpoint per request, runs the operation, and closes. When absent,
|
|
408
|
+
* the resources + prompts routes 404 with `mcp-endpoint-not-found`.
|
|
409
|
+
*/
|
|
410
|
+
readonly mcpClientProbe?: MCPClientProbeBinding;
|
|
411
|
+
/**
|
|
412
|
+
* Optional. When present, mounts the cost readback surface at
|
|
413
|
+
* `/v1/cost/*` — `GET /v1/cost/records` (paginated list with
|
|
414
|
+
* `runId` / `agentId` / `conversationId` / `category` / `providerId` /
|
|
415
|
+
* time-window filters), `GET /v1/cost/records/:recordId` (single),
|
|
416
|
+
* `GET /v1/cost/aggregate` (multi-dimensional rollup over a required
|
|
417
|
+
* time window; default "last 30 days"). Read-only over HTTP —
|
|
418
|
+
* records are written by the runtime's agent / tool / sandbox
|
|
419
|
+
* instrumentation, not through this surface.
|
|
420
|
+
*
|
|
421
|
+
* Budgets are NOT part of this surface.
|
|
422
|
+
*/
|
|
423
|
+
readonly cost?: CostBinding;
|
|
424
|
+
/**
|
|
425
|
+
* Optional. When present, mounts the unified adapters catalog surface
|
|
426
|
+
* at `/v1/adapters/*` — `GET /v1/adapters` (paginated list with
|
|
427
|
+
* optional `kind` / `status` filters), `GET /v1/adapters/:adapterId`
|
|
428
|
+
* (single), `POST /v1/adapters/:adapterId/test` (kind-specific smoke
|
|
429
|
+
* probe). Read-only + test-only over HTTP; adapter lifecycle
|
|
430
|
+
* (register / unregister / reconfigure) is a deployment concern
|
|
431
|
+
* — the runtime learns about adapters at `CreateAppInput` time.
|
|
432
|
+
*
|
|
433
|
+
* Deployments implement the binding by aggregating their wired
|
|
434
|
+
* adapters (they know which ones are active because they wire them).
|
|
435
|
+
* See `AdapterRegistryBinding` for the full contract.
|
|
436
|
+
*/
|
|
437
|
+
readonly adapterRegistry?: AdapterRegistryBinding;
|
|
438
|
+
/**
|
|
439
|
+
* Optional. In-process factory registry that maps `adapter_id` →
|
|
440
|
+
* factory function + optional `prepare()` for adapter warmup /
|
|
441
|
+
* download. Backs `POST /v1/adapters/:adapterId/prepare` (mounted
|
|
442
|
+
* with `adapterRegistry`) — an SSE endpoint that iterates
|
|
443
|
+
* `entry.prepare()` and streams `PrepareEvent`s to the caller.
|
|
444
|
+
*
|
|
445
|
+
* The runtime builds this at boot alongside the adapter registry so
|
|
446
|
+
* registry entries and in-process factories stay coherent.
|
|
447
|
+
* Deployments without in-process adapter factories (e.g. a custom
|
|
448
|
+
* runHandler) can leave this undefined — the `prepare` route then
|
|
449
|
+
* answers `400 bad-input` for every adapter id.
|
|
450
|
+
*/
|
|
451
|
+
readonly adapterFactories?: AdapterFactoryRegistry;
|
|
452
|
+
/**
|
|
453
|
+
* Optional. When present, mounts the trigger admin surfaces at
|
|
454
|
+
* `/v1/schedules/*`, `/v1/event-triggers/*`, and `/v1/webhooks/*`.
|
|
455
|
+
* Kernel runtime primitives (cron/event/webhook schedulers) do the
|
|
456
|
+
* firing; this binding satisfies the CRUD surface over the stored
|
|
457
|
+
* triggers.
|
|
458
|
+
*
|
|
459
|
+
* The Kindgi runtime supplies an implementation. Deployments that
|
|
460
|
+
* want bespoke persistence substitute their own binding.
|
|
461
|
+
*/
|
|
462
|
+
readonly triggerRegistry?: TriggerRegistryBinding;
|
|
463
|
+
/**
|
|
464
|
+
* Optional. When present, mounts the outbound webhook surface at
|
|
465
|
+
* `/v1/webhook-endpoints/*`: endpoints the platform sends signed
|
|
466
|
+
* events to (`run.finished`), their delivery log, redelivery and a test
|
|
467
|
+
* event. The runtime supplies storage, secrets and the sender; see
|
|
468
|
+
* `WebhookEndpointBinding`.
|
|
469
|
+
*/
|
|
470
|
+
readonly webhookEndpoints?: WebhookEndpointBinding;
|
|
471
|
+
/**
|
|
472
|
+
* Optional. When present, mounts the tenant policies catalog surface
|
|
473
|
+
* (`/v1/policies` list/get/publish, `/v1/policies/:policyId/versions/*`).
|
|
474
|
+
* Full versioned CRUD — mirrors `flows` 1:1. Registry-only:
|
|
475
|
+
* enforcement is out of scope. Runtime consumers (e.g. the kernel
|
|
476
|
+
* router for `model-routing`, an adapter-allowlist check for
|
|
477
|
+
* `adapter-allowlist`, retention sweepers for `retention`) read
|
|
478
|
+
* policies from this store and apply them at their own boundary.
|
|
479
|
+
* `policyKind` is enumerated + extensible — new kinds require a spec +
|
|
480
|
+
* validator update in tandem.
|
|
481
|
+
*/
|
|
482
|
+
readonly policyRegistry?: PolicyRegistryBinding;
|
|
483
|
+
/**
|
|
484
|
+
* Optional. When present, mounts the evaluation-suite catalog surface
|
|
485
|
+
* (`/v1/eval-suites` list/get/publish, `/v1/eval-suites/:suiteId/versions/*`).
|
|
486
|
+
* Full versioned CRUD — mirrors `policies` 1:1. Registry-only:
|
|
487
|
+
* eval-run execution + per-kind grader dispatch (eval-judge adapter
|
|
488
|
+
* for `accuracy` / `pairwise` / `regression`, HITL bridge for
|
|
489
|
+
* `human-review`, sandbox handler for `custom`) is out of scope
|
|
490
|
+
* here (see `evalRunBinding`). `evalKind` is enumerated + extensible
|
|
491
|
+
* — new kinds require a spec + validator update in tandem.
|
|
492
|
+
*/
|
|
493
|
+
readonly evalSuiteRegistry?: EvalSuiteRegistryBinding;
|
|
494
|
+
/**
|
|
495
|
+
* Optional. When present alongside `evalSuiteRegistry`, mounts the
|
|
496
|
+
* evaluation-run data-plane surface: `POST /v1/eval-suites/:suiteId/runs`
|
|
497
|
+
* (start), `GET /v1/eval-runs` (list, cursor-paginated),
|
|
498
|
+
* `GET /v1/eval-runs/:runId` (get), `POST /v1/eval-runs/:runId/cancel`,
|
|
499
|
+
* `GET /v1/eval-runs/:runId/events` (SSE). Caller-plugged binding —
|
|
500
|
+
* the API package doesn't own eval-run persistence. The reference
|
|
501
|
+
* `createInProcessEvalRunBinding` (`packages/api/src/eval-run-dispatcher.ts`)
|
|
502
|
+
* implements the pattern end-to-end for the `accuracy` kind; a suite
|
|
503
|
+
* of a kind with no registered dispatcher answers
|
|
504
|
+
* `422 dispatcher-not-registered`.
|
|
505
|
+
*/
|
|
506
|
+
readonly evalRunBinding?: EvalRunBinding;
|
|
507
|
+
/**
|
|
508
|
+
* Optional. Push-based pub/sub binding used by SSE endpoints to
|
|
509
|
+
* deliver run events without polling. When present, `GET
|
|
510
|
+
* /v1/runs/:runId/stream` subscribes on channel
|
|
511
|
+
* `kernel:run:<runId>` and delivers push-mode; when absent, the
|
|
512
|
+
* route falls back to a 200 ms journal poll — wire shape identical
|
|
513
|
+
* either way, so callers can't tell.
|
|
514
|
+
*
|
|
515
|
+
* The Kindgi runtime supplies an implementation. Wire the same bus
|
|
516
|
+
* into the kernel behind `CreateAppInput.runHandler` so the kernel
|
|
517
|
+
* publishes on each journal write; without that, the subscription
|
|
518
|
+
* receives nothing (the kernel never posts).
|
|
519
|
+
*
|
|
520
|
+
* See `packages/api/src/event-bus-binding.ts` for the contract.
|
|
521
|
+
*/
|
|
522
|
+
readonly eventBus?: EventBusBinding;
|
|
523
|
+
/**
|
|
524
|
+
* Optional. When present alongside `blobStorage`, mounts the
|
|
525
|
+
* AWS S3-compat wire surface at `/s3/*`. SigV4-authenticated
|
|
526
|
+
* per request against the credentials this binding resolves. Requests
|
|
527
|
+
* for buckets the credential is not authorized for return
|
|
528
|
+
* `403 AccessDenied`. Storage flows through the same
|
|
529
|
+
* `BlobStorageBinding` as the bespoke `/v1/artifacts/*` surface —
|
|
530
|
+
* cross-surface interop is a first-class guardrail. Includes the
|
|
531
|
+
* S3 multipart-upload operations (initiate / upload part / complete /
|
|
532
|
+
* list parts / abort).
|
|
533
|
+
*/
|
|
534
|
+
readonly s3Credentials?: S3CredentialBinding;
|
|
535
|
+
/**
|
|
536
|
+
* Optional. When present, mounts the OAuth session persistence
|
|
537
|
+
* surface. Combined with `identityProvider` + `exchangeCode` (below),
|
|
538
|
+
* this activates the full `/v1/auth/*` route family. The static
|
|
539
|
+
* bearer-token flow remains available on the same routes byte-
|
|
540
|
+
* shape-identical; the middleware detects `kgi_sk_*` prefixed
|
|
541
|
+
* tokens and routes them through this store.
|
|
542
|
+
*
|
|
543
|
+
* Caller-plugged — the API package does NOT own session persistence.
|
|
544
|
+
* The Kindgi runtime supplies a durable implementation; deployments
|
|
545
|
+
* can also plug in their own (Redis, SQLite, memory, etc.).
|
|
546
|
+
*/
|
|
547
|
+
readonly sessionStore?: SessionStoreBinding;
|
|
548
|
+
/**
|
|
549
|
+
* Optional. When present, tunes session-token lifecycle enforcement
|
|
550
|
+
* in the auth middleware. Absent → sensible defaults (absolute TTL
|
|
551
|
+
* from the stored session's `expiresAt`; inactivity timeout disabled).
|
|
552
|
+
* Only applies to `kgi_sk_*` session tokens; static bearer tokens are
|
|
553
|
+
* unaffected.
|
|
554
|
+
*/
|
|
555
|
+
readonly session?: SessionConfig;
|
|
556
|
+
/**
|
|
557
|
+
* Optional. When present alongside `sessionStore` + `exchangeCode`,
|
|
558
|
+
* mounts the identity-provider catalog + auth flow at `/v1/auth/*`.
|
|
559
|
+
*
|
|
560
|
+
* Deployments register their OAuth/OIDC providers at boot (or via
|
|
561
|
+
* `POST /v1/auth/providers`); the framework does NOT bake in a
|
|
562
|
+
* provider list.
|
|
563
|
+
*/
|
|
564
|
+
readonly identityProvider?: IdentityProviderBinding;
|
|
565
|
+
/**
|
|
566
|
+
* Required alongside `identityProvider`. Called by
|
|
567
|
+
* `POST /v1/auth/callback/:providerId` to exchange the authorization
|
|
568
|
+
* code for provider tokens + userinfo. Deployments implementing
|
|
569
|
+
* `IdentityProviderBinding` typically pair it with their own
|
|
570
|
+
* `exchangeCode` that speaks OAuth 2.0 + PKCE against the provider's
|
|
571
|
+
* `tokenEndpoint`.
|
|
572
|
+
*/
|
|
573
|
+
readonly exchangeCode?: ExchangeCodeFn;
|
|
574
|
+
/**
|
|
575
|
+
* Optional. When present, `POST /v1/auth/refresh` rotates the
|
|
576
|
+
* underlying provider tokens via this callback before re-issuing a
|
|
577
|
+
* session token. When absent, refresh only rotates the framework's
|
|
578
|
+
* session token (still useful for scoping expiry to the framework
|
|
579
|
+
* boundary; the provider tokens keep their original TTL).
|
|
580
|
+
*/
|
|
581
|
+
readonly refreshToken?: RefreshTokenFn;
|
|
582
|
+
/**
|
|
583
|
+
* Optional. Short-lived CSRF-`state` + PKCE-`code_verifier` cache
|
|
584
|
+
* used between login initiation and callback. When absent, a per-app
|
|
585
|
+
* in-memory store is used — appropriate for single-process dev + tests.
|
|
586
|
+
* Multi-pod deployments MUST plug in a shared store (Redis, Postgres)
|
|
587
|
+
* because the callback frequently lands on a different pod than the
|
|
588
|
+
* login. Mirror of the `idempotencyStore` caller-plugged pattern.
|
|
589
|
+
*/
|
|
590
|
+
readonly oauthStateStore?: OauthStateStore;
|
|
591
|
+
/**
|
|
592
|
+
* Optional. Signed-deployment ledger — the audit anchor for every
|
|
593
|
+
* `POST /v1/deployments` landing. Caller-plugged per the pattern
|
|
594
|
+
* (e.g. in-memory for tests, a durable store in production). Mount
|
|
595
|
+
* happens only when this + `signingKeyRegistry` + `imageRegistry` are
|
|
596
|
+
* ALL wired.
|
|
597
|
+
*/
|
|
598
|
+
readonly deploymentRegistry?: DeploymentBinding;
|
|
599
|
+
/**
|
|
600
|
+
* Optional. Tenant-scoped signing-key trust registry.
|
|
601
|
+
* Higher-level than `SigningKeyBinding` (which is
|
|
602
|
+
* KMS-shaped): answers "for tenant T, is this public key allowed to
|
|
603
|
+
* sign deploys?" and performs signature verification against the
|
|
604
|
+
* registered trust list. Aliased on import to avoid the local name
|
|
605
|
+
* collision with the crypto binding.
|
|
606
|
+
*/
|
|
607
|
+
readonly signingKeyRegistry?: SigningKeyRegistryBinding;
|
|
608
|
+
/**
|
|
609
|
+
* Optional. OCI image registry client — Docker
|
|
610
|
+
* Registry HTTP API v2 seam. The deploy route calls `head` + one
|
|
611
|
+
* `extractFile('/app/index.json')` to verify pullability + integrity;
|
|
612
|
+
* `push` is for build tooling, not the API routes. Caller-plugged
|
|
613
|
+
* so deployments route different tenants at different registries.
|
|
614
|
+
*/
|
|
615
|
+
readonly imageRegistry?: ImageRegistryBinding;
|
|
616
|
+
/**
|
|
617
|
+
* Optional. When present, mounts the tenant-scoped identity
|
|
618
|
+
* directory surface (`/v1/identity/users` list/get,
|
|
619
|
+
* `/v1/identity/users/:userId/sessions` list-active,
|
|
620
|
+
* `/v1/identity/users/:userId/revoke-sessions` admin op,
|
|
621
|
+
* `/v1/identity/whoami` self) — part of the admin control plane.
|
|
622
|
+
* Registry-only over HTTP; deployments plug in an
|
|
623
|
+
* LDAP / SCIM / bespoke user store behind
|
|
624
|
+
* `IdentityDirectoryBinding`. `whoami` returns the fuller
|
|
625
|
+
* `UserRecord` shape when the binding is wired and the token
|
|
626
|
+
* carries a `userId`; otherwise it falls back to the minimal
|
|
627
|
+
* `{ tenantId, ... }` shape.
|
|
628
|
+
*/
|
|
629
|
+
readonly identityDirectory?: IdentityDirectoryBinding;
|
|
630
|
+
/**
|
|
631
|
+
* Optional. Overrides the default `info` + `servers` in the emitted
|
|
632
|
+
* OpenAPI document (`GET /v1/openapi.json`) and — via the `docs`
|
|
633
|
+
* sub-config — opts the deployment into an interactive Scalar-rendered
|
|
634
|
+
* API reference UI. Deployments typically set `servers[0].url` to their
|
|
635
|
+
* public base URL.
|
|
636
|
+
*/
|
|
637
|
+
readonly openapi?: OpenApiConfig;
|
|
638
|
+
/**
|
|
639
|
+
* Optional. When present, mounts the `/v1/orgs` resource surface
|
|
640
|
+
* (list/create/get/patch/delete) of the multi-tenant hierarchy.
|
|
641
|
+
* Caller-plugged: the reference in-memory implementation is
|
|
642
|
+
* `makeInMemoryOrgBinding` in `@kindgi/platform`; the Kindgi runtime
|
|
643
|
+
* supplies a durable one.
|
|
644
|
+
*/
|
|
645
|
+
readonly orgBinding?: OrgBinding;
|
|
646
|
+
/**
|
|
647
|
+
* Optional. When present, mounts the `/v1/teams` resource surface —
|
|
648
|
+
* team CRUD plus `/v1/teams/:teamId/memberships` sub-resource. Both
|
|
649
|
+
* `teamBinding` AND `teamMembershipBinding` MUST be supplied together
|
|
650
|
+
* (otherwise `/v1/teams` is not mounted) — the reference
|
|
651
|
+
* in-memory adapter returns them as a combined `{teams, memberships}`
|
|
652
|
+
* factory, and durable implementations mirror that shape.
|
|
653
|
+
*/
|
|
654
|
+
readonly teamBinding?: TeamBinding;
|
|
655
|
+
readonly teamMembershipBinding?: TeamMembershipBinding;
|
|
656
|
+
/**
|
|
657
|
+
* Optional. When present, mounts the `/v1/projects` resource surface —
|
|
658
|
+
* project CRUD (including `/v1/projects/default`) plus
|
|
659
|
+
* `/v1/projects/:projectId/memberships` sub-resource. Both
|
|
660
|
+
* `projectBinding` AND `projectMembershipBinding` MUST be supplied
|
|
661
|
+
* together — same combined-factory pattern as teams.
|
|
662
|
+
*/
|
|
663
|
+
readonly projectBinding?: ProjectBinding;
|
|
664
|
+
readonly projectMembershipBinding?: ProjectMembershipBinding;
|
|
665
|
+
/**
|
|
666
|
+
* Optional. The team↔project grant binding. Not consumed by this
|
|
667
|
+
* package's routes; the authz backend uses it to resolve
|
|
668
|
+
* team-mediated project grants.
|
|
669
|
+
*/
|
|
670
|
+
readonly teamProjectGrantBinding?: TeamProjectGrantBinding;
|
|
671
|
+
/**
|
|
672
|
+
* Optional. Non-sensitive per-env values. When present alongside or
|
|
673
|
+
* separately from `secretsBinding`, mounts the `/v1/tenant/config`
|
|
674
|
+
* sub-routes at tenant scope. The base `GET /v1/tenant` route is
|
|
675
|
+
* always mounted; the `/config` surface is gated on at least one of
|
|
676
|
+
* `envBinding` / `secretsBinding` being present.
|
|
677
|
+
*/
|
|
678
|
+
readonly envBinding?: EnvBinding;
|
|
679
|
+
/**
|
|
680
|
+
* Optional. Sensitive per-env values. Same mount rule as
|
|
681
|
+
* `envBinding` — either binding present is enough to mount
|
|
682
|
+
* `/v1/tenant/config`. Writes to `/v1/tenant/config` with
|
|
683
|
+
* `sensitive: true` (or `kind: 'secret'`) route to this binding; the
|
|
684
|
+
* routes 400 when a secret write is attempted but this binding is
|
|
685
|
+
* absent.
|
|
686
|
+
*
|
|
687
|
+
* When present, ALSO mounts `/v1/secrets/*` — the dedicated
|
|
688
|
+
* secrets HTTP surface. Same for `envBinding` and `/v1/env/*`.
|
|
689
|
+
*/
|
|
690
|
+
readonly secretsBinding?: SecretBinding;
|
|
691
|
+
/**
|
|
692
|
+
* Optional. Backs the async-rotation wire (`POST /v1/secrets/:name/rotate`
|
|
693
|
+
* → 202 Accepted; poll via `GET /v1/secrets/:name/rotations/:rotationId`;
|
|
694
|
+
* subscribe via `GET /v1/secrets/:name/rotations/:rotationId/events`).
|
|
695
|
+
* When `secretsBinding` is present AND this is absent, a per-app
|
|
696
|
+
* in-memory reference store is used — appropriate for dev + tests
|
|
697
|
+
* only; multi-pod production deployments MUST plug in a durable
|
|
698
|
+
* adapter (rotations can take minutes to hours; the row must
|
|
699
|
+
* survive process restarts and reach pods handling later polls /
|
|
700
|
+
* subscribes).
|
|
701
|
+
*/
|
|
702
|
+
readonly rotationStatusStore?: RotationStatusStore;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* OpenAPI configuration. Extends `GenerateOptions` (info + servers) with
|
|
706
|
+
* an optional `docs` sub-config that opts the deployment into mounting
|
|
707
|
+
* an interactive Scalar-rendered API reference UI alongside the JSON
|
|
708
|
+
* spec at `/v1/openapi.json`.
|
|
709
|
+
*
|
|
710
|
+
* `docs` is opt-in (default off). Deployments that want the docs UI set
|
|
711
|
+
* `docs: true` (mounts at `/docs`) or `docs: { path: '/reference' }` for
|
|
712
|
+
* a custom mount path.
|
|
713
|
+
*/
|
|
714
|
+
export interface OpenApiConfig extends GenerateOptions {
|
|
715
|
+
/**
|
|
716
|
+
* When set, mounts a Scalar-rendered interactive API reference UI
|
|
717
|
+
* that reads from `GET /v1/openapi.json`. Pass `true` for defaults
|
|
718
|
+
* (mounted at `/docs`, default theme, page title from the OpenAPI
|
|
719
|
+
* `info.title`) or an object to customize the mount path / title /
|
|
720
|
+
* theme. Absent = docs UI not mounted.
|
|
721
|
+
*/
|
|
722
|
+
readonly docs?: boolean | ScalarDocsConfig;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Session lifecycle configuration. All fields optional; defaults keep
|
|
726
|
+
* the baseline behavior (absolute TTL from the stored session's
|
|
727
|
+
* `expiresAt`, inactivity enforcement disabled). Only applies to
|
|
728
|
+
* `kgi_sk_*` session tokens; static bearer tokens are unaffected.
|
|
729
|
+
* Milliseconds throughout — compared against `Date.now()` on the hot
|
|
730
|
+
* path.
|
|
731
|
+
*/
|
|
732
|
+
export interface SessionConfig {
|
|
733
|
+
/**
|
|
734
|
+
* Recommended default for deployment-issued sessions. The framework
|
|
735
|
+
* itself uses the provider's `expiresAt` verbatim on OAuth callback;
|
|
736
|
+
* this default surfaces only when a downstream helper opts into it.
|
|
737
|
+
* 24h = `24 * 60 * 60 * 1000`.
|
|
738
|
+
*/
|
|
739
|
+
readonly ttl?: number;
|
|
740
|
+
/**
|
|
741
|
+
* Inactivity timeout — requests whose session `lastActiveAt` is older
|
|
742
|
+
* than `Date.now() - inactivityTimeout` receive `401 session-inactive`.
|
|
743
|
+
* Absent → inactivity enforcement disabled. Recommended: 4 hours.
|
|
744
|
+
*/
|
|
745
|
+
readonly inactivityTimeout?: number;
|
|
746
|
+
/**
|
|
747
|
+
* How often the middleware calls `sessionStore.touch()` to bump
|
|
748
|
+
* `lastActiveAt`. Defaults to 60_000 ms. Higher values ⇒ fewer writes
|
|
749
|
+
* but coarser inactivity enforcement.
|
|
750
|
+
*/
|
|
751
|
+
readonly touchThrottle?: number;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Optional overrides for the Scalar-rendered docs UI. All fields are
|
|
755
|
+
* optional; sensible defaults are applied.
|
|
756
|
+
*/
|
|
757
|
+
export interface ScalarDocsConfig {
|
|
758
|
+
/** Mount path. Default: `/docs`. */
|
|
759
|
+
readonly path?: string;
|
|
760
|
+
/** Browser tab title. Default: `Kindgi API`. */
|
|
761
|
+
readonly title?: string;
|
|
762
|
+
/**
|
|
763
|
+
* Scalar theme name — string-typed so it stays open to whatever
|
|
764
|
+
* themes Scalar ships without a version-lock. Default: Scalar's
|
|
765
|
+
* built-in default theme.
|
|
766
|
+
*/
|
|
767
|
+
readonly theme?: string;
|
|
768
|
+
}
|
|
769
|
+
export declare function createApp(input: CreateAppInput): Hono<AppEnv>;
|
|
770
|
+
//# sourceMappingURL=app.d.ts.map
|