@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/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Kindgi Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,218 @@
|
|
|
1
1
|
# @kindgi/api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
REST + SSE HTTP surface for the Kindgi platform. Exposes the runtime
|
|
4
|
+
(kernel, agents, HITL, supervisor — reached through the bindings passed
|
|
5
|
+
to `createApp`) behind two wire faces:
|
|
6
|
+
|
|
7
|
+
- **`/v1/*`** — the Kindgi REST API. JSON in, JSON out. Bearer
|
|
8
|
+
token auth. Documented via OpenAPI 3.1 (snapshot shipped as `@kindgi/api/openapi.json`).
|
|
9
|
+
Conventions locked in [`docs/API-ROUTE-CONVENTIONS.md`](../../docs/API-ROUTE-CONVENTIONS.md).
|
|
10
|
+
- **`/s3/*`** — AWS S3 API v4 wire surface. XML in,
|
|
11
|
+
XML out. SigV4 auth. Documented in this file.
|
|
12
|
+
|
|
13
|
+
Both surfaces route through the same runtime bindings — an artifact
|
|
14
|
+
uploaded via one is readable via the other. Deployments enable
|
|
15
|
+
either or both via `createApp(...)` bindings.
|
|
16
|
+
|
|
17
|
+
## `createApp(input)`
|
|
18
|
+
|
|
19
|
+
Assemble the Hono app instance. Every runtime dependency is caller-
|
|
20
|
+
plugged; the API package does not own persistence. See
|
|
21
|
+
[`src/app.ts`](src/app.ts) for the full `CreateAppInput` shape.
|
|
22
|
+
|
|
23
|
+
Minimal wiring for BOTH surfaces:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { createApp } from '@kindgi/api';
|
|
27
|
+
|
|
28
|
+
const app = createApp({
|
|
29
|
+
// Required runtime bindings — supplied by the Kindgi runtime in a
|
|
30
|
+
// deployment; `createStubAppBindings()` from @kindgi/testing in tests.
|
|
31
|
+
...runtimeBindings,
|
|
32
|
+
resolveToken: async (token) => /* ... */,
|
|
33
|
+
runHandler: /* ... */,
|
|
34
|
+
blobStorage, // any BlobStorageBinding (filesystem, S3, GCS, …)
|
|
35
|
+
s3Credentials: {
|
|
36
|
+
async resolve(accessKeyId) {
|
|
37
|
+
// Deployment-owned lookup — return { secretKey, tenantId, bucket }
|
|
38
|
+
// or null for unknown / revoked.
|
|
39
|
+
return await lookupAccessKey(accessKeyId);
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Omit `s3Credentials` → the `/s3/*` mount is skipped (Hono 404).
|
|
46
|
+
Omit `blobStorage` → both `/v1/artifacts` AND `/s3` are skipped.
|
|
47
|
+
|
|
48
|
+
## Interactive docs (Scalar)
|
|
49
|
+
|
|
50
|
+
Set `openapi.docs` on `createApp(...)` to mount a Scalar-rendered
|
|
51
|
+
interactive API reference alongside the JSON spec. The docs page reads
|
|
52
|
+
the (already-public) `/v1/openapi.json` in the browser, so it sits on
|
|
53
|
+
the public side of the auth chain — no bearer required to browse.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const app = createApp({
|
|
57
|
+
...runtimeBindings,
|
|
58
|
+
resolveToken: /* ... */,
|
|
59
|
+
runHandler: /* ... */,
|
|
60
|
+
openapi: { docs: true }, // → mounts /docs (default path)
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Or customize:
|
|
64
|
+
openapi: { docs: { path: '/reference', title: 'Acme Legal API' } }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`docs` is opt-in — omit it and the docs UI is unmounted (Hono 404). The
|
|
68
|
+
JSON spec at `/v1/openapi.json` is always mounted independent of this
|
|
69
|
+
flag.
|
|
70
|
+
|
|
71
|
+
## The `/s3/*` mount
|
|
72
|
+
|
|
73
|
+
Any S3-aware client (`aws s3 cp`, `rclone`, `mc`, aws-sdk-js, boto3)
|
|
74
|
+
hits `/s3/*` with zero code changes. The server verifies AWS Signature
|
|
75
|
+
Version 4 itself (`node:crypto`; see
|
|
76
|
+
[`src/middleware/sigv4-verify.ts`](src/middleware/sigv4-verify.ts)).
|
|
77
|
+
|
|
78
|
+
### Auth model
|
|
79
|
+
|
|
80
|
+
Every `/s3/*` request carries SigV4 credentials, either as:
|
|
81
|
+
|
|
82
|
+
- **Header auth** — `Authorization: AWS4-HMAC-SHA256 Credential=<accessKeyId>/<date>/<region>/s3/aws4_request, SignedHeaders=..., Signature=<hex>`
|
|
83
|
+
- **Presigned URL** — query params `X-Amz-Algorithm=AWS4-HMAC-SHA256`,
|
|
84
|
+
`X-Amz-Credential=...`, `X-Amz-Date=...`, `X-Amz-Expires=...`,
|
|
85
|
+
`X-Amz-SignedHeaders=...`, `X-Amz-Signature=...`.
|
|
86
|
+
|
|
87
|
+
The middleware:
|
|
88
|
+
|
|
89
|
+
1. Parses the auth params (header OR presigned).
|
|
90
|
+
2. Checks the signed timestamp and credential scope: within ±15 minutes
|
|
91
|
+
of the server clock for header auth (`RequestTimeTooSkewed`
|
|
92
|
+
otherwise); presigned URLs until `X-Amz-Expires`.
|
|
93
|
+
3. Calls `S3CredentialBinding.resolve(accessKeyId)` → resolves to
|
|
94
|
+
`{ secretKey, tenantId, bucket, expiresAt? }` or `null`.
|
|
95
|
+
4. For header auth, verifies `x-amz-content-sha256` matches the
|
|
96
|
+
received body — returns `400 XAmzContentSHA256Mismatch` on payload
|
|
97
|
+
tampering before signature comparison.
|
|
98
|
+
5. Re-derives the signature under `secretKey` from exactly what the
|
|
99
|
+
client signed (its timestamp and its `SignedHeaders`) and compares
|
|
100
|
+
it in constant time.
|
|
101
|
+
6. Compares the URL-declared bucket to the credential's `bucket`
|
|
102
|
+
field. Mismatch → `403 AccessDenied` (each credential is scoped to
|
|
103
|
+
one bucket).
|
|
104
|
+
7. Sets `c.set('tenantId', ...)` + `c.set('bucket', ...)` for the
|
|
105
|
+
downstream S3 route handlers.
|
|
106
|
+
|
|
107
|
+
All auth failures return S3-style XML errors
|
|
108
|
+
(`<Error><Code>...</Code>...</Error>`) with `Content-Type: application/xml`.
|
|
109
|
+
|
|
110
|
+
### Supported operations
|
|
111
|
+
|
|
112
|
+
Object routes (bucket + key):
|
|
113
|
+
|
|
114
|
+
| Verb | Path | Op |
|
|
115
|
+
|--- |--- |--- |
|
|
116
|
+
| PUT | `/s3/:bucket/*` | PutObject |
|
|
117
|
+
| GET | `/s3/:bucket/*` | GetObject |
|
|
118
|
+
| HEAD | `/s3/:bucket/*` | HeadObject |
|
|
119
|
+
| DELETE | `/s3/:bucket/*` | DeleteObject |
|
|
120
|
+
|
|
121
|
+
Bucket routes:
|
|
122
|
+
|
|
123
|
+
| Verb | Path | Op |
|
|
124
|
+
|--- |--- |--- |
|
|
125
|
+
| HEAD | `/s3/:bucket` | HeadBucket |
|
|
126
|
+
| GET | `/s3/:bucket` | ListObjectsV2 (requires `?list-type=2`) |
|
|
127
|
+
|
|
128
|
+
Multipart upload (S3-standard `md5(concat(md5(part_i)))-N` ETag):
|
|
129
|
+
|
|
130
|
+
| Verb | Path | Op |
|
|
131
|
+
|--- |--- |--- |
|
|
132
|
+
| POST | `/s3/:bucket/*?uploads` | InitiateMultipartUpload |
|
|
133
|
+
| PUT | `/s3/:bucket/*?partNumber=&uploadId=` | UploadPart |
|
|
134
|
+
| POST | `/s3/:bucket/*?uploadId=` | CompleteMultipartUpload |
|
|
135
|
+
| GET | `/s3/:bucket/*?uploadId=` | ListParts |
|
|
136
|
+
| DELETE | `/s3/:bucket/*?uploadId=` | AbortMultipartUpload |
|
|
137
|
+
|
|
138
|
+
Semantic notes:
|
|
139
|
+
|
|
140
|
+
- **Content-MD5** on PUT (regular OR part upload) is verified;
|
|
141
|
+
mismatch → `400 BadDigest`.
|
|
142
|
+
- **Range** requests on GET support single-range only (`bytes=N-M`,
|
|
143
|
+
`bytes=N-`, `bytes=-M`) — response is `206 Partial Content` with
|
|
144
|
+
`Content-Range: bytes N-M/total`. Multi-range (comma-separated)
|
|
145
|
+
requests are rejected with `416 InvalidRange`.
|
|
146
|
+
- **DELETE** always returns `204` — whether the key existed or not
|
|
147
|
+
(S3 semantics).
|
|
148
|
+
- **ListObjectsV2** requires `?list-type=2`; v1 listing is not
|
|
149
|
+
implemented (returns `501 NotImplemented`). `?prefix=`,
|
|
150
|
+
`?max-keys=`, `?continuation-token=` are honored.
|
|
151
|
+
- **x-amz-tagging** header on PUT is form-encoded
|
|
152
|
+
(`key1=val1&key2=val2`) and stored as `BlobMeta.tags`. The
|
|
153
|
+
dedicated `?tagging` subresource verbs are not implemented.
|
|
154
|
+
|
|
155
|
+
### Cross-surface interop
|
|
156
|
+
|
|
157
|
+
Every persisted blob carries BOTH a `blobId` (UUID) AND a
|
|
158
|
+
`(bucket, key)` pair. Bespoke uploads via `POST /v1/artifacts` land
|
|
159
|
+
under `bucket: 'artifacts', key: <blobId>` by default — S3
|
|
160
|
+
credentials granted the `artifacts` bucket see them via
|
|
161
|
+
`s3://artifacts/<blobId>`.
|
|
162
|
+
|
|
163
|
+
Conversely, S3 uploads via `PUT /s3/:bucket/:key` are visible in
|
|
164
|
+
`GET /v1/artifacts` listings under the same `blobId` and are
|
|
165
|
+
downloadable via `GET /v1/artifacts/:blobId`.
|
|
166
|
+
|
|
167
|
+
### Errors (S3-style XML)
|
|
168
|
+
|
|
169
|
+
| HTTP | S3 Code | When |
|
|
170
|
+
|--- |--- |--- |
|
|
171
|
+
| 400 | `InvalidRequest` | Malformed request |
|
|
172
|
+
| 400 | `MalformedXML` | `CompleteMultipartUpload` body invalid |
|
|
173
|
+
| 400 | `InvalidArgument` | Bad query param (e.g. `partNumber` OOB) |
|
|
174
|
+
| 416 | `InvalidRange` | Bad `Range` header |
|
|
175
|
+
| 400 | `BadDigest` | `Content-MD5` mismatch |
|
|
176
|
+
| 400 | `XAmzContentSHA256Mismatch` | Payload hash header mismatch |
|
|
177
|
+
| 400 | `InvalidPart` | Multipart part ETag mismatch |
|
|
178
|
+
| 403 | `AccessDenied` | Credential expired / wrong bucket |
|
|
179
|
+
| 403 | `InvalidAccessKeyId` | Unknown access key |
|
|
180
|
+
| 403 | `SignatureDoesNotMatch` | SigV4 verification failed |
|
|
181
|
+
| 403 | `RequestTimeTooSkewed` | Signed timestamp outside the ±15 min window |
|
|
182
|
+
| 403 | `InvalidRequest` | Malformed SigV4 authorization |
|
|
183
|
+
| 400 | `AuthorizationQueryParametersError` | Malformed presigned-URL parameters |
|
|
184
|
+
| 404 | `NoSuchKey` | Unknown key |
|
|
185
|
+
| 404 | `NoSuchUpload` | Unknown or aborted `uploadId` |
|
|
186
|
+
| 501 | `NotImplemented` | Unsupported operation |
|
|
187
|
+
| 500 | `InternalError` | Backing store failure |
|
|
188
|
+
|
|
189
|
+
## Development
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
pnpm --filter @kindgi/api build # compile TS + emit dist
|
|
193
|
+
pnpm --filter @kindgi/api typecheck # no-emit typecheck
|
|
194
|
+
pnpm --filter @kindgi/api test # vitest run
|
|
195
|
+
pnpm --filter @kindgi/api gen:openapi # regenerate packages/api/openapi.json
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`gen:openapi` documents the `/v1/*` surface only. The `/s3/*` surface
|
|
199
|
+
follows the S3 wire (XML, AWS-native SDKs) and is intentionally NOT
|
|
200
|
+
in the OpenAPI document — consumers use their own S3 SDKs pointed at
|
|
201
|
+
the mount.
|
|
202
|
+
|
|
203
|
+
## Adapters (production-readiness plug-ins)
|
|
204
|
+
|
|
205
|
+
`createApp(...)` bindings are caller-plugged so this package can stay
|
|
206
|
+
free of persistence choices. The Kindgi runtime ships production
|
|
207
|
+
implementations (e.g. a Postgres-backed `idempotencyStore` whose retries
|
|
208
|
+
survive restarts and multi-instance deployments, filesystem and object-store
|
|
209
|
+
`blobStorage`). This package includes `createInMemoryIdempotencyStore()`,
|
|
210
|
+
which is correct for dev + tests.
|
|
211
|
+
|
|
212
|
+
## See also
|
|
213
|
+
|
|
214
|
+
- [`docs/API-ROUTE-CONVENTIONS.md`](../../docs/API-ROUTE-CONVENTIONS.md)
|
|
215
|
+
— locked URL / auth / error-envelope / pagination / SSE conventions
|
|
216
|
+
for `/v1/*`.
|
|
217
|
+
- [`docs/ADDING-A-ROUTE.md`](../../docs/ADDING-A-ROUTE.md) — how to add
|
|
218
|
+
a new `/v1/*` route.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { Cursor, TenantId } from '@kindgi/types';
|
|
2
|
+
/**
|
|
3
|
+
* Caller-plugged surface for the adapter catalog — part of the admin
|
|
4
|
+
* control plane. Read-only + smoke-test-only
|
|
5
|
+
* over HTTP: tenants + operators see every adapter the deployment
|
|
6
|
+
* wired at boot time and probe each one for liveness.
|
|
7
|
+
*
|
|
8
|
+
* Adapters are the concrete bridges the runtime uses to talk to
|
|
9
|
+
* outside systems: model providers, embedding providers, blob storage,
|
|
10
|
+
* sandbox providers, eval judges. Each adapter package
|
|
11
|
+
* (the filesystem blob adapter, the inprocess sandbox adapter,
|
|
12
|
+
* `@kindgi/adapter-model-in-process`, `@kindgi/adapter-model-openai-compat`,
|
|
13
|
+
* the local embedding adapter, the AJV eval-judge adapter, ...)
|
|
14
|
+
* exports a factory + optional metadata; the deployment aggregates the
|
|
15
|
+
* ones it actually wired into an `AdapterRegistryBinding`.
|
|
16
|
+
*
|
|
17
|
+
* ## Why read-only + test-only
|
|
18
|
+
*
|
|
19
|
+
* Adapter lifecycle (register / unregister / reconfigure) is a
|
|
20
|
+
* **deployment concern**, not a runtime one. The runtime learns about
|
|
21
|
+
* adapters at `CreateAppInput` time; if a deployment wants to change
|
|
22
|
+
* what's wired it restarts the process with different config. This
|
|
23
|
+
* mirrors the pattern used elsewhere in the framework where lifecycle
|
|
24
|
+
* state is deployment-owned (bucket allocation in S3, key store for
|
|
25
|
+
* signing). HTTP-driven adapter reconfigure would require the runtime
|
|
26
|
+
* to accept live reconfiguration, which it does not.
|
|
27
|
+
*
|
|
28
|
+
* ## Wire shape discipline
|
|
29
|
+
*
|
|
30
|
+
* `AdapterInfo.config` is REDACTED — no secrets on the wire. A binding
|
|
31
|
+
* MAY expose non-sensitive routing hints (`{ region: 'us-east-1' }`)
|
|
32
|
+
* but MUST NOT surface API keys, endpoints, credentials, or any
|
|
33
|
+
* material that could be used to impersonate the adapter. The binding
|
|
34
|
+
* is authoritative on what counts as safe to expose per adapter kind.
|
|
35
|
+
*
|
|
36
|
+
* ## Probe semantics
|
|
37
|
+
*
|
|
38
|
+
* `test(...)` runs a kind-specific smoke probe against the adapter.
|
|
39
|
+
* Probe failures return an `AdapterTestOutcome` with `ok: false` — not
|
|
40
|
+
* an error. A failed probe is a valid observation about the adapter's
|
|
41
|
+
* state, not a server error. The route surfaces `AdapterTestOutcome`
|
|
42
|
+
* as HTTP 200 either way; a 5xx would indicate the probe machinery
|
|
43
|
+
* itself broke (which is legitimately a server error).
|
|
44
|
+
*
|
|
45
|
+
* ### Default probes by adapter kind
|
|
46
|
+
*
|
|
47
|
+
* - `blob`: write 32 random bytes → read back → verify hash → delete.
|
|
48
|
+
* - `sandbox`: create a context-isolated (or `none`) sandbox → run
|
|
49
|
+
* `1 + 1 === 2` → verify result → destroy.
|
|
50
|
+
* - `model` / `model-provider`: minimal completion with
|
|
51
|
+
* `[{ role: 'user', content: 'ping' }]` and `maxTokens: 1` — verify
|
|
52
|
+
* the provider returns a well-shaped response.
|
|
53
|
+
* - `embedding`: embed the string `'ping'` — verify the vector length
|
|
54
|
+
* matches the advertised dimension.
|
|
55
|
+
* - `eval-judge`: run a trivial pass-through eval — verify success.
|
|
56
|
+
*
|
|
57
|
+
* Adapter authors MAY accept a caller-supplied `input` on `test(...)`
|
|
58
|
+
* for more elaborate probes; when absent the binding falls back to
|
|
59
|
+
* the default above.
|
|
60
|
+
*
|
|
61
|
+
* Every method is tenant-scoped. Cursors are opaque — the binding
|
|
62
|
+
* chooses its encoding. The API layer only validates round-trip as a
|
|
63
|
+
* string; it never inspects the payload.
|
|
64
|
+
*/
|
|
65
|
+
export interface AdapterRegistryBinding {
|
|
66
|
+
/**
|
|
67
|
+
* Cursor-paginated list of adapters the deployment has wired.
|
|
68
|
+
* Optional filters narrow to a specific `kind` or `status`.
|
|
69
|
+
*/
|
|
70
|
+
list(input: AdapterListInput): Promise<AdapterPage>;
|
|
71
|
+
/**
|
|
72
|
+
* Fetch a single adapter by id, or `null` when unknown. The route
|
|
73
|
+
* surfaces `null` as `404 adapter-not-found`.
|
|
74
|
+
*/
|
|
75
|
+
get(input: AdapterGetInput): Promise<AdapterInfo | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Run the kind-specific smoke probe. Returns `null` when the id is
|
|
78
|
+
* unknown — the route surfaces that as `404 adapter-not-found`.
|
|
79
|
+
* Otherwise returns an `AdapterTestOutcome` (which itself carries
|
|
80
|
+
* `ok: true | false` — failed probes are data, not errors).
|
|
81
|
+
*/
|
|
82
|
+
test(input: AdapterTestInput): Promise<AdapterTestOutcome | null>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Closed set of adapter kinds the framework knows about. New kinds
|
|
86
|
+
* require an additive schema update — we enumerate rather than accept
|
|
87
|
+
* an open string so wire consumers (UIs, command-line tools) can render
|
|
88
|
+
* kind-specific columns without guessing.
|
|
89
|
+
*
|
|
90
|
+
* `model-provider` is distinct from `model` for adapters that wrap a
|
|
91
|
+
* remote provider gateway (a hosted API or a self-hosted inference
|
|
92
|
+
* server) vs. adapters that host the model in-process.
|
|
93
|
+
*/
|
|
94
|
+
export type AdapterKind = 'model' | 'model-provider' | 'embedding' | 'blob' | 'sandbox' | 'eval-judge';
|
|
95
|
+
export declare const ADAPTER_KINDS: readonly AdapterKind[];
|
|
96
|
+
/**
|
|
97
|
+
* Adapter status the wire surface exposes. `active` = wired and
|
|
98
|
+
* last-observed healthy. `degraded` = wired but the binding has seen
|
|
99
|
+
* recent failures / partial capability loss. `error` = wired but
|
|
100
|
+
* unusable (e.g. auth material missing at boot). The binding is
|
|
101
|
+
* authoritative on how it derives the value.
|
|
102
|
+
*/
|
|
103
|
+
export type AdapterStatus = 'active' | 'degraded' | 'error';
|
|
104
|
+
export declare const ADAPTER_STATUSES: readonly AdapterStatus[];
|
|
105
|
+
/**
|
|
106
|
+
* Wire shape for a single wired adapter. Deployments produce this
|
|
107
|
+
* from whatever data structure they use to hold their adapter set —
|
|
108
|
+
* commonly the `describe()` output on the adapter factory plus a
|
|
109
|
+
* status field the deployment tracks itself.
|
|
110
|
+
*/
|
|
111
|
+
export interface AdapterInfo {
|
|
112
|
+
/** Stable id chosen by the deployment (e.g. `'sandbox-primary'`). */
|
|
113
|
+
readonly adapterId: string;
|
|
114
|
+
readonly kind: AdapterKind;
|
|
115
|
+
/** Package name that owns the implementation (e.g. `'@kindgi/adapter-model-in-process'`). */
|
|
116
|
+
readonly name: string;
|
|
117
|
+
/** Semver of the wired package. */
|
|
118
|
+
readonly version: string;
|
|
119
|
+
/**
|
|
120
|
+
* Kind-specific capability tags. Free-form strings scoped by kind —
|
|
121
|
+
* e.g. `['context-isolated']` for a sandbox adapter, `['tool-use', 'streaming']`
|
|
122
|
+
* for a model adapter, `['multipart-upload']` for blob storage.
|
|
123
|
+
*/
|
|
124
|
+
readonly capabilities: readonly string[];
|
|
125
|
+
/**
|
|
126
|
+
* Redacted routing hints only. No secrets. Absent when the binding
|
|
127
|
+
* has nothing safe to expose.
|
|
128
|
+
*/
|
|
129
|
+
readonly config?: Readonly<Record<string, unknown>>;
|
|
130
|
+
readonly status: AdapterStatus;
|
|
131
|
+
/** Human-readable reason accompanying `degraded` / `error` status. */
|
|
132
|
+
readonly statusReason?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface AdapterListInput {
|
|
135
|
+
readonly tenantId: TenantId;
|
|
136
|
+
readonly limit: number;
|
|
137
|
+
readonly cursor?: Cursor;
|
|
138
|
+
readonly filter?: AdapterListFilter;
|
|
139
|
+
}
|
|
140
|
+
export interface AdapterListFilter {
|
|
141
|
+
readonly kind?: AdapterKind;
|
|
142
|
+
readonly status?: AdapterStatus;
|
|
143
|
+
}
|
|
144
|
+
export interface AdapterPage {
|
|
145
|
+
readonly data: readonly AdapterInfo[];
|
|
146
|
+
readonly nextCursor?: Cursor;
|
|
147
|
+
}
|
|
148
|
+
export interface AdapterGetInput {
|
|
149
|
+
readonly tenantId: TenantId;
|
|
150
|
+
readonly adapterId: string;
|
|
151
|
+
}
|
|
152
|
+
export interface AdapterTestInput {
|
|
153
|
+
readonly tenantId: TenantId;
|
|
154
|
+
readonly adapterId: string;
|
|
155
|
+
/**
|
|
156
|
+
* Optional kind-specific probe input. When absent the binding runs
|
|
157
|
+
* the default probe documented in the interface JSDoc above. Shape
|
|
158
|
+
* is intentionally open so bindings can extend the probe surface
|
|
159
|
+
* per kind without a schema change.
|
|
160
|
+
*/
|
|
161
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Result of a probe run. `ok: false` is a valid observation — the
|
|
165
|
+
* route serialises it as HTTP 200 either way.
|
|
166
|
+
*
|
|
167
|
+
* `probe` is kind-specific data (e.g. `{ vectorLength: 384 }` for an
|
|
168
|
+
* embedding probe, `{ latencyMs: 42, completion: '2' }` for a model
|
|
169
|
+
* probe). Consumers should not depend on its exact shape — the UI
|
|
170
|
+
* treats it as a diagnostic bag to render as JSON.
|
|
171
|
+
*/
|
|
172
|
+
export interface AdapterTestOutcome {
|
|
173
|
+
readonly ok: boolean;
|
|
174
|
+
readonly latencyMs: number;
|
|
175
|
+
readonly probe: Readonly<Record<string, unknown>>;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=adapter-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-binding.d.ts","sourceRoot":"","sources":["../src/adapter-binding.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACpD;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzD;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACnE;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,gBAAgB,GAChB,WAAW,GACX,MAAM,GACN,SAAS,GACT,YAAY,CAAC;AAEjB,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAO/C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAAoC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,sEAAsE;IACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
export const ADAPTER_KINDS = [
|
|
4
|
+
'model',
|
|
5
|
+
'model-provider',
|
|
6
|
+
'embedding',
|
|
7
|
+
'blob',
|
|
8
|
+
'sandbox',
|
|
9
|
+
'eval-judge',
|
|
10
|
+
];
|
|
11
|
+
export const ADAPTER_STATUSES = ['active', 'degraded', 'error'];
|
|
12
|
+
//# sourceMappingURL=adapter-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-binding.js","sourceRoot":"","sources":["../src/adapter-binding.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAyGjC,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,OAAO;IACP,gBAAgB;IAChB,WAAW;IACX,MAAM;IACN,SAAS;IACT,YAAY;CACb,CAAC;AAWF,MAAM,CAAC,MAAM,gBAAgB,GAA6B,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC"}
|