@kindgi/api 0.0.0-bootstrap.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +396 -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 +264 -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 +13 -0
- package/dist/middleware/error-mapper.d.ts.map +1 -0
- package/dist/middleware/error-mapper.js +32 -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 +5051 -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 +773 -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 +29659 -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 +1285 -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 +291 -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 +37 -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 +5445 -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 +981 -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,104 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { ApiTokenId, ProjectId, TenantId } from '@kindgi/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Admin surface for API keys: mint, list, read, revoke. Distinct from
|
|
8
|
+
* `TokenResolver`, which is the read path used by the auth middleware.
|
|
9
|
+
* Splitting keeps the auth hot path free of write concerns and lets
|
|
10
|
+
* deployments plug in different implementations.
|
|
11
|
+
*
|
|
12
|
+
* An API key is a machine credential: a service account
|
|
13
|
+
* (`service_account:<tokenId>`) with a role in its tenant and an explicit
|
|
14
|
+
* list of framework capabilities. `POST /v1/tokens` mints;
|
|
15
|
+
* `GET /v1/tokens` and `GET /v1/tokens/:tokenId` read (never the secret);
|
|
16
|
+
* `POST /v1/tokens/:tokenId/revoke` revokes.
|
|
17
|
+
*/
|
|
18
|
+
export interface TokenAdmin {
|
|
19
|
+
mint(input: TokenMintInput): Promise<TokenMintOutput>;
|
|
20
|
+
list(input: TokenListInput): Promise<readonly ApiTokenRecord[]>;
|
|
21
|
+
get(input: TokenGetInput): Promise<ApiTokenRecord | undefined>;
|
|
22
|
+
revoke(input: TokenRevokeInput): Promise<TokenRevokeOutcome>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A key's role in its tenant. `admin` administers the tenant (and mints,
|
|
27
|
+
* lists and revokes keys); `member` belongs to it and administers nothing.
|
|
28
|
+
*/
|
|
29
|
+
export type ApiTokenRole = 'admin' | 'member';
|
|
30
|
+
|
|
31
|
+
export const API_TOKEN_ROLES: readonly ApiTokenRole[] = ['admin', 'member'];
|
|
32
|
+
|
|
33
|
+
export interface TokenMintInput {
|
|
34
|
+
readonly tenantId: TenantId;
|
|
35
|
+
readonly role: ApiTokenRole;
|
|
36
|
+
/**
|
|
37
|
+
* Framework capabilities the key carries (`env:write`, `secrets:write`,
|
|
38
|
+
* …). The route only lets a caller grant capabilities it holds itself.
|
|
39
|
+
*/
|
|
40
|
+
readonly capabilities: readonly string[];
|
|
41
|
+
/** Optional human-readable label. Shown in admin UIs. */
|
|
42
|
+
readonly label?: string;
|
|
43
|
+
/** Optional expiration date. */
|
|
44
|
+
readonly expiresAt?: Date;
|
|
45
|
+
/** Optional project scope; when set, tokens are only valid for that project. */
|
|
46
|
+
readonly projectId?: ProjectId;
|
|
47
|
+
/**
|
|
48
|
+
* Who minted it, as a principal reference: `user:<id>` or
|
|
49
|
+
* `service_account:<tokenId>`.
|
|
50
|
+
*/
|
|
51
|
+
readonly createdBy?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TokenMintOutput {
|
|
55
|
+
/** The new key, as `list` and `get` will show it. */
|
|
56
|
+
readonly record: ApiTokenRecord;
|
|
57
|
+
/**
|
|
58
|
+
* The plaintext bearer token. Returned to the caller ONCE, at mint
|
|
59
|
+
* time. Stores must persist a hash — not the plaintext — so lost
|
|
60
|
+
* tokens can only be replaced, not recovered.
|
|
61
|
+
*/
|
|
62
|
+
readonly token: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** What a key looks like after minting: everything but its secret. */
|
|
66
|
+
export interface ApiTokenRecord {
|
|
67
|
+
readonly tokenId: ApiTokenId;
|
|
68
|
+
readonly role: ApiTokenRole;
|
|
69
|
+
readonly capabilities: readonly string[];
|
|
70
|
+
readonly label?: string;
|
|
71
|
+
readonly projectId?: ProjectId;
|
|
72
|
+
readonly createdBy?: string;
|
|
73
|
+
readonly createdAt: Date;
|
|
74
|
+
readonly expiresAt?: Date;
|
|
75
|
+
/** Set once revoked. A revoked key never resolves again. */
|
|
76
|
+
readonly revokedAt?: Date;
|
|
77
|
+
/** When the key last authenticated a request (updated at most once a minute). */
|
|
78
|
+
readonly lastUsedAt?: Date;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A page of keys, newest first (`createdAt` then `tokenId`, descending).
|
|
83
|
+
* The store returns up to `limit` records strictly after `after` in that
|
|
84
|
+
* order; the route asks for one more than it shows, to know whether more
|
|
85
|
+
* remain.
|
|
86
|
+
*/
|
|
87
|
+
export interface TokenListInput {
|
|
88
|
+
readonly tenantId: TenantId;
|
|
89
|
+
readonly limit: number;
|
|
90
|
+
/** The last record of the previous page. */
|
|
91
|
+
readonly after?: { readonly createdAt: Date; readonly tokenId: ApiTokenId };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface TokenGetInput {
|
|
95
|
+
readonly tenantId: TenantId;
|
|
96
|
+
readonly tokenId: ApiTokenId;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface TokenRevokeInput {
|
|
100
|
+
readonly tenantId: TenantId;
|
|
101
|
+
readonly tokenId: ApiTokenId;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type TokenRevokeOutcome = { readonly kind: 'ok' } | { readonly kind: 'not-found' };
|
|
@@ -0,0 +1,274 @@
|
|
|
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 { ToolManifest } from '@kindgi/tools';
|
|
7
|
+
import type { Cursor, ProjectId, Semver, TenantId, ToolId } from '@kindgi/types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Caller-plugged surface for the tool catalog. Versioned CRUD mirroring
|
|
11
|
+
* `AgentRegistryBinding` — the API package does NOT own registry
|
|
12
|
+
* persistence. Deployments wire a `ToolRegistry` (from `@kindgi/tools`)
|
|
13
|
+
* — or a durable store — through this binding.
|
|
14
|
+
*
|
|
15
|
+
* The surface is metadata-only: a `Tool` runtime value carries a
|
|
16
|
+
* `handler` closure, which cannot cross HTTP. The wire body is a
|
|
17
|
+
* `ToolManifest` (Tool minus handler); the actual handler must already
|
|
18
|
+
* be registered with the runtime. Handler code is not uploaded over
|
|
19
|
+
* this surface.
|
|
20
|
+
*
|
|
21
|
+
* `publish` is versioned — each call adds a new `(toolId,
|
|
22
|
+
* version)` row. `get(toolId)` returns the latest active version;
|
|
23
|
+
* agents reference tools via `{ id, version: <semver-range> }` and
|
|
24
|
+
* `resolve(toolId, versionSpec)` walks active versions to pick the
|
|
25
|
+
* highest satisfying via `semver.maxSatisfying`. Retirement follows the
|
|
26
|
+
* versioned soft-tombstone pattern: `unregister(toolId, version)`
|
|
27
|
+
* soft-tombstones one version; `reinstateVersion` un-tombstones; when no
|
|
28
|
+
* active versions remain, the tool has no latest version and
|
|
29
|
+
* `GET /v1/tools/{id}` returns 410 gone (distinct from 404
|
|
30
|
+
* not-found via `headExists`).
|
|
31
|
+
*/
|
|
32
|
+
export interface ToolRegistryBinding {
|
|
33
|
+
/**
|
|
34
|
+
* Cursor-paginated list of tools (latest active version per id).
|
|
35
|
+
* Optional `nameFilter` is a prefix match on the tool id — tools use
|
|
36
|
+
* dotted namespaces (`acme.verify-citation`), so prefix matching is
|
|
37
|
+
* the natural filter shape. Derived-retired tools (no active
|
|
38
|
+
* versions) are hidden from list by default.
|
|
39
|
+
*/
|
|
40
|
+
list(input: ToolListInput): Promise<ToolPage>;
|
|
41
|
+
/**
|
|
42
|
+
* The manifest of the LATEST active version for the given tool id,
|
|
43
|
+
* or `null` if the id is unknown OR every version is tombstoned.
|
|
44
|
+
* The route uses `headExists` to distinguish 410 gone from 404
|
|
45
|
+
* not-found.
|
|
46
|
+
*/
|
|
47
|
+
get(input: ToolGetInput): Promise<ToolManifest | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Exact `(toolId, version)` lookup, including tombstoned versions.
|
|
50
|
+
* Provenance paths use this to resolve historical run references.
|
|
51
|
+
*/
|
|
52
|
+
getVersion(input: ToolGetVersionInput): Promise<ToolManifest | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Cursor-paginated list of versions for a specific tool id. Sort
|
|
55
|
+
* order is binding-defined (for example, publish timestamp
|
|
56
|
+
* descending). Returns an empty page (no
|
|
57
|
+
* error) when the id is unknown — the route flips that to 404 via
|
|
58
|
+
* a prior `headExists`.
|
|
59
|
+
*
|
|
60
|
+
* By default returns only active versions. Set
|
|
61
|
+
* `includeTombstoned = true` to include soft-tombstoned rows too;
|
|
62
|
+
* tombstoned rows carry `unregisteredAt` on the wire (ISO string),
|
|
63
|
+
* active rows do not.
|
|
64
|
+
*/
|
|
65
|
+
listVersions(input: ToolListVersionsInput): Promise<ToolVersionPage>;
|
|
66
|
+
/**
|
|
67
|
+
* Head-row existence probe. Lets `GET /v1/tools/{id}` distinguish
|
|
68
|
+
* `410 gone` (identity exists, no active version) from `404 not-
|
|
69
|
+
* found` (never registered). Same shape as
|
|
70
|
+
* `AgentRegistryBinding.headExists`.
|
|
71
|
+
*/
|
|
72
|
+
headExists(input: ToolGetInput): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* Resolve a semver range against active versions and return the
|
|
75
|
+
* highest satisfying manifest via `semver.maxSatisfying`. When
|
|
76
|
+
* `versionSpec` is absent, returns the latest active version (same
|
|
77
|
+
* as `get`). `not-satisfiable` fires when the range parses but no
|
|
78
|
+
* active version matches. `invalid-range` fires when the range
|
|
79
|
+
* itself is not valid semver grammar. `not-found` fires when the
|
|
80
|
+
* tool id is unknown.
|
|
81
|
+
*/
|
|
82
|
+
resolve(input: ToolResolveInput): Promise<ToolResolveOutcome>;
|
|
83
|
+
/**
|
|
84
|
+
* Publish a validated tool manifest. Every publish adds a version
|
|
85
|
+
* row; the tool's latest version is recomputed across active
|
|
86
|
+
* versions. Bindings MAY reject with `already-registered` when the
|
|
87
|
+
* same `(toolId, version)` is re-published; the route maps that to
|
|
88
|
+
* `409`. Semver hygiene: version numbers are single-use even after
|
|
89
|
+
* unregister — reinstate instead of republishing the same bytes.
|
|
90
|
+
*/
|
|
91
|
+
publish(input: ToolPublishInput): Promise<ToolPublishOutcome>;
|
|
92
|
+
/**
|
|
93
|
+
* Soft-tombstone a specific `(toolId, version)`. When this leaves
|
|
94
|
+
* NO active versions, the tool has no latest version — it enters the
|
|
95
|
+
* derived "retired" state (GET returns 410 gone).
|
|
96
|
+
* Publish of a new version reactivates. Version is REQUIRED
|
|
97
|
+
* (there are no bare-tool-id semantics).
|
|
98
|
+
*/
|
|
99
|
+
unregister(input: ToolUnregisterInput): Promise<ToolUnregisterOutcome>;
|
|
100
|
+
/**
|
|
101
|
+
* Un-tombstone a specific `(toolId, version)`. Recomputes the tool's
|
|
102
|
+
* latest version across active versions. Restores the manifest
|
|
103
|
+
* bytes verbatim (semver hygiene). Idempotent.
|
|
104
|
+
*/
|
|
105
|
+
reinstateVersion(input: ToolReinstateVersionInput): Promise<ToolReinstateVersionOutcome>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface ToolListInput {
|
|
109
|
+
readonly tenantId: TenantId;
|
|
110
|
+
readonly limit: number;
|
|
111
|
+
readonly cursor?: Cursor;
|
|
112
|
+
/** Prefix match on `ToolManifest.id`. Undefined = no filter. */
|
|
113
|
+
readonly nameFilter?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Narrow the list to a specific scope. Absent = no scope narrow
|
|
116
|
+
* (return every row in the tenant the caller can see).
|
|
117
|
+
*/
|
|
118
|
+
readonly scope?: Scope;
|
|
119
|
+
/**
|
|
120
|
+
* `false` = literal-at-this-scope only. `true` (default) =
|
|
121
|
+
* inheritance walk — no-op for content-scoped bindings
|
|
122
|
+
* (documented for uniformity).
|
|
123
|
+
*/
|
|
124
|
+
readonly inherit?: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ToolGetInput {
|
|
128
|
+
readonly tenantId: TenantId;
|
|
129
|
+
readonly toolId: ToolId;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ToolGetVersionInput {
|
|
133
|
+
readonly tenantId: TenantId;
|
|
134
|
+
readonly toolId: ToolId;
|
|
135
|
+
readonly version: Semver;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface ToolListVersionsInput {
|
|
139
|
+
readonly tenantId: TenantId;
|
|
140
|
+
readonly toolId: ToolId;
|
|
141
|
+
readonly limit: number;
|
|
142
|
+
readonly cursor?: Cursor;
|
|
143
|
+
/**
|
|
144
|
+
* `false` (default) → return only active versions. `true` → return
|
|
145
|
+
* active + tombstoned rows; tombstoned entries carry `unregisteredAt`
|
|
146
|
+
* on the wire, active entries do not. Aligns with the soft-tombstone
|
|
147
|
+
* pattern used by agents / flows / eval suites / policies.
|
|
148
|
+
*/
|
|
149
|
+
readonly includeTombstoned?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface ToolResolveInput {
|
|
153
|
+
readonly tenantId: TenantId;
|
|
154
|
+
readonly toolId: ToolId;
|
|
155
|
+
/**
|
|
156
|
+
* Semver range (npm grammar): `'1.2.3'` exact pin, `'^1.2.3'`
|
|
157
|
+
* compatible-updates, `'~1.2.3'` patch-updates, `'>=1.0.0 <2.0.0'`
|
|
158
|
+
* explicit range. Absent = latest active (behaves like `get`).
|
|
159
|
+
*/
|
|
160
|
+
readonly versionSpec?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface ToolPublishInput {
|
|
164
|
+
readonly tenantId: TenantId;
|
|
165
|
+
/**
|
|
166
|
+
* Project the tool is registered into. REQUIRED. Callers
|
|
167
|
+
* that don't naturally know a projectId (deployment
|
|
168
|
+
* route, boot-time dev-echo seed, MCP bridge) resolve the tenant's
|
|
169
|
+
* Default via `projectBinding.getDefault(tenantId)` at THEIR layer.
|
|
170
|
+
*/
|
|
171
|
+
readonly projectId: ProjectId;
|
|
172
|
+
readonly tool: ToolManifest;
|
|
173
|
+
/**
|
|
174
|
+
* REQUIRED. Called inside the binding's write tx after row insert,
|
|
175
|
+
* receiving the business `toolId`. Returns tuples for the same tx.
|
|
176
|
+
* See `AgentPublishInput.enqueueTuples` for the design rationale.
|
|
177
|
+
*/
|
|
178
|
+
readonly enqueueTuples: TupleEnqueueHook;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface ToolUnregisterInput {
|
|
182
|
+
readonly tenantId: TenantId;
|
|
183
|
+
readonly toolId: ToolId;
|
|
184
|
+
/** REQUIRED — no bare-id unregister under the versioned model. */
|
|
185
|
+
readonly version: Semver;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface ToolReinstateVersionInput {
|
|
189
|
+
readonly tenantId: TenantId;
|
|
190
|
+
readonly toolId: ToolId;
|
|
191
|
+
readonly version: Semver;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface ToolPage {
|
|
195
|
+
readonly data: readonly ToolManifest[];
|
|
196
|
+
readonly nextCursor?: Cursor;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A single row in a `listVersions` result. Manifest fields plus an
|
|
201
|
+
* optional `unregisteredAt` timestamp — present iff the version has
|
|
202
|
+
* been soft-tombstoned via `unregister`. Callers that ignore the extra
|
|
203
|
+
* field see a plain `ToolManifest`.
|
|
204
|
+
*/
|
|
205
|
+
export type ToolVersionRow = ToolManifest & {
|
|
206
|
+
readonly unregisteredAt?: string;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export interface ToolVersionPage {
|
|
210
|
+
readonly data: readonly ToolVersionRow[];
|
|
211
|
+
readonly nextCursor?: Cursor;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export type ToolPublishOutcome =
|
|
215
|
+
| {
|
|
216
|
+
readonly kind: 'ok';
|
|
217
|
+
readonly toolId: ToolId;
|
|
218
|
+
readonly version: Semver;
|
|
219
|
+
}
|
|
220
|
+
| {
|
|
221
|
+
readonly kind: 'already-registered';
|
|
222
|
+
readonly toolId: ToolId;
|
|
223
|
+
readonly version: Semver;
|
|
224
|
+
}
|
|
225
|
+
| {
|
|
226
|
+
readonly kind: 'project-not-found';
|
|
227
|
+
readonly toolId: ToolId;
|
|
228
|
+
readonly version: Semver;
|
|
229
|
+
readonly projectId: ProjectId;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export type ToolUnregisterOutcome = {
|
|
233
|
+
readonly unregistered: boolean;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export type ToolReinstateVersionOutcome =
|
|
237
|
+
| {
|
|
238
|
+
readonly kind: 'ok';
|
|
239
|
+
readonly toolId: ToolId;
|
|
240
|
+
readonly version: Semver;
|
|
241
|
+
readonly wasTombstoned: boolean;
|
|
242
|
+
}
|
|
243
|
+
| {
|
|
244
|
+
readonly kind: 'not-found';
|
|
245
|
+
readonly toolId: ToolId;
|
|
246
|
+
readonly version: Semver;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export type ToolResolveOutcome =
|
|
250
|
+
| {
|
|
251
|
+
readonly kind: 'ok';
|
|
252
|
+
readonly toolId: ToolId;
|
|
253
|
+
readonly resolvedVersion: Semver;
|
|
254
|
+
readonly manifest: ToolManifest;
|
|
255
|
+
}
|
|
256
|
+
| {
|
|
257
|
+
/** No `(toolId)` head row — tool id was never published. */
|
|
258
|
+
readonly kind: 'not-found';
|
|
259
|
+
readonly toolId: ToolId;
|
|
260
|
+
}
|
|
261
|
+
| {
|
|
262
|
+
/** Head exists but no active versions match the requested range. */
|
|
263
|
+
readonly kind: 'not-satisfiable';
|
|
264
|
+
readonly toolId: ToolId;
|
|
265
|
+
readonly versionSpec: string;
|
|
266
|
+
/** Active semver strings — helps the caller diagnose. */
|
|
267
|
+
readonly candidateVersions: readonly string[];
|
|
268
|
+
}
|
|
269
|
+
| {
|
|
270
|
+
/** `versionSpec` failed `semver.validRange`. */
|
|
271
|
+
readonly kind: 'invalid-range';
|
|
272
|
+
readonly toolId: ToolId;
|
|
273
|
+
readonly versionSpec: string;
|
|
274
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Trigger registry — API-layer view of the runtime-owned CRUD contract.
|
|
6
|
+
*
|
|
7
|
+
* The interface lives in `@kindgi/runtime` (public wire vocabulary);
|
|
8
|
+
* the Kindgi runtime provides an implementation. The API layer
|
|
9
|
+
* re-exports the contract here for parity with the other caller-plugged
|
|
10
|
+
* bindings (`AdapterRegistryBinding`, `ProviderRegistryBinding`, etc.) —
|
|
11
|
+
* routes import from this file, deployments plug in a satisfying impl
|
|
12
|
+
* (their own, if they want bespoke persistence).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export type {
|
|
16
|
+
CronTriggerRecord,
|
|
17
|
+
EventTriggerRecord,
|
|
18
|
+
GetTriggerInput,
|
|
19
|
+
ListTriggersInput,
|
|
20
|
+
RegisterCronTriggerInput,
|
|
21
|
+
RegisterEventTriggerInput,
|
|
22
|
+
RegisterTriggerError,
|
|
23
|
+
RegisterTriggerInput,
|
|
24
|
+
RegisterWebhookTriggerInput,
|
|
25
|
+
TriggerKind,
|
|
26
|
+
TriggerLifecycleError,
|
|
27
|
+
TriggerLifecycleInput,
|
|
28
|
+
TriggerListPage,
|
|
29
|
+
TriggerRecord,
|
|
30
|
+
TriggerRegistryBinding,
|
|
31
|
+
UpdateCronTriggerInput,
|
|
32
|
+
UpdateEventTriggerInput,
|
|
33
|
+
UpdateTriggerError,
|
|
34
|
+
UpdateTriggerInput,
|
|
35
|
+
UpdateWebhookTriggerInput,
|
|
36
|
+
WebhookTriggerRecord,
|
|
37
|
+
} from '@kindgi/runtime';
|
|
38
|
+
export { TRIGGER_KINDS } from '@kindgi/runtime';
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { Principal, ReviewerRole } from '@kindgi/authz';
|
|
5
|
+
import type { ApiTokenId, RunId, SessionId, TenantId, UserId } from '@kindgi/types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Hono environment shape — variables the middleware chain populates
|
|
9
|
+
* and route handlers consume via `c.get(...)`.
|
|
10
|
+
*/
|
|
11
|
+
export interface AppEnv {
|
|
12
|
+
Variables: {
|
|
13
|
+
requestId: string;
|
|
14
|
+
/** Set by `bearerAuthMiddleware` on authenticated routes. */
|
|
15
|
+
tenantId: TenantId;
|
|
16
|
+
/**
|
|
17
|
+
* Set by `bearerAuthMiddleware` when the token's `TokenResolution`
|
|
18
|
+
* carried a `reviewerRole`. Approvals routes gate visibility +
|
|
19
|
+
* decisions on this: `standard < senior < admin`. Absent for
|
|
20
|
+
* tokens that were never provisioned with a reviewer role.
|
|
21
|
+
*/
|
|
22
|
+
reviewerRole?: ReviewerRole;
|
|
23
|
+
/**
|
|
24
|
+
* Set by `bearerAuthMiddleware` when the token resolution carries
|
|
25
|
+
* a `userId`. Approvals routes hand it to `ReviewerBinding` to
|
|
26
|
+
* translate `UserId → ReviewerId` before calling `submitReview`.
|
|
27
|
+
*/
|
|
28
|
+
userId?: UserId;
|
|
29
|
+
/**
|
|
30
|
+
* Set by `bearerAuthMiddleware` when the caller authenticated with a
|
|
31
|
+
* durable API key: the key's id. The principal is the key's service
|
|
32
|
+
* account.
|
|
33
|
+
*/
|
|
34
|
+
tokenId?: ApiTokenId;
|
|
35
|
+
/**
|
|
36
|
+
* Set by `bearerAuthMiddleware` when the caller presented a
|
|
37
|
+
* framework-issued OAuth session token (`kgi_sk_*`).
|
|
38
|
+
* `/v1/identity/whoami` + `/v1/auth/logout` read this to introspect /
|
|
39
|
+
* revoke without a second lookup. Absent for static bearer tokens.
|
|
40
|
+
*/
|
|
41
|
+
sessionId?: SessionId;
|
|
42
|
+
/** Identity-provider id behind a session token. Absent for bearer. */
|
|
43
|
+
providerId?: string;
|
|
44
|
+
/** Set by `sigv4Middleware` on `/s3/*`: the bucket the credential may access. */
|
|
45
|
+
bucket?: string;
|
|
46
|
+
/** Set by `sigv4Middleware` on `/s3/*`: the access key that signed the request. */
|
|
47
|
+
s3AccessKeyId?: string;
|
|
48
|
+
/** OAuth scopes granted to a session token. Absent for bearer. */
|
|
49
|
+
scopes?: readonly string[];
|
|
50
|
+
/**
|
|
51
|
+
* Framework capabilities granted to the bearer. Route handlers
|
|
52
|
+
* call `hasCapability(c, '<name>')` to gate
|
|
53
|
+
* writes / reveals; missing capability → 403 `permission-denied`.
|
|
54
|
+
* Absent = no capabilities granted.
|
|
55
|
+
*/
|
|
56
|
+
capabilities?: readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* Composite authz Principal built by `principalMiddleware` from
|
|
59
|
+
* the token resolution. Present on every route mounted BELOW that
|
|
60
|
+
* middleware (i.e. all `/v1/*` routes). Consumed by the
|
|
61
|
+
* `authorize()` middleware factory and any route handler that
|
|
62
|
+
* needs to make conditional authz checks.
|
|
63
|
+
*/
|
|
64
|
+
principal?: Principal;
|
|
65
|
+
/**
|
|
66
|
+
* Set when the request authenticated with a public run token
|
|
67
|
+
* (`kgi_pt_…`): such a request may only read the runs in
|
|
68
|
+
* `publicRunIds` and their descendants, on the progress routes.
|
|
69
|
+
*/
|
|
70
|
+
tokenKind?: 'public-run';
|
|
71
|
+
/** The runs a public run token names. */
|
|
72
|
+
publicRunIds?: readonly RunId[];
|
|
73
|
+
};
|
|
74
|
+
}
|