@kindgi/api 0.0.0-bootstrap.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +216 -1
- package/dist/adapter-binding.d.ts +177 -0
- package/dist/adapter-binding.d.ts.map +1 -0
- package/dist/adapter-binding.js +12 -0
- package/dist/adapter-binding.js.map +1 -0
- package/dist/agent-binding.d.ts +207 -0
- package/dist/agent-binding.d.ts.map +1 -0
- package/dist/agent-binding.js +4 -0
- package/dist/agent-binding.js.map +1 -0
- package/dist/app.d.ts +770 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +397 -0
- package/dist/app.js.map +1 -0
- package/dist/capability-binding.d.ts +76 -0
- package/dist/capability-binding.d.ts.map +1 -0
- package/dist/capability-binding.js +4 -0
- package/dist/capability-binding.js.map +1 -0
- package/dist/cost-binding.d.ts +175 -0
- package/dist/cost-binding.d.ts.map +1 -0
- package/dist/cost-binding.js +13 -0
- package/dist/cost-binding.js.map +1 -0
- package/dist/deployment-binding.d.ts +201 -0
- package/dist/deployment-binding.d.ts.map +1 -0
- package/dist/deployment-binding.js +4 -0
- package/dist/deployment-binding.js.map +1 -0
- package/dist/env-binding.d.ts +132 -0
- package/dist/env-binding.d.ts.map +1 -0
- package/dist/env-binding.js +4 -0
- package/dist/env-binding.js.map +1 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +268 -0
- package/dist/errors.js.map +1 -0
- package/dist/eval-run-binding.d.ts +196 -0
- package/dist/eval-run-binding.d.ts.map +1 -0
- package/dist/eval-run-binding.js +16 -0
- package/dist/eval-run-binding.js.map +1 -0
- package/dist/eval-run-dispatcher.d.ts +131 -0
- package/dist/eval-run-dispatcher.d.ts.map +1 -0
- package/dist/eval-run-dispatcher.js +368 -0
- package/dist/eval-run-dispatcher.js.map +1 -0
- package/dist/eval-suite-binding.d.ts +227 -0
- package/dist/eval-suite-binding.d.ts.map +1 -0
- package/dist/eval-suite-binding.js +24 -0
- package/dist/eval-suite-binding.js.map +1 -0
- package/dist/event-bus-binding.d.ts +107 -0
- package/dist/event-bus-binding.d.ts.map +1 -0
- package/dist/event-bus-binding.js +5 -0
- package/dist/event-bus-binding.js.map +1 -0
- package/dist/flow-binding.d.ts +194 -0
- package/dist/flow-binding.d.ts.map +1 -0
- package/dist/flow-binding.js +4 -0
- package/dist/flow-binding.js.map +1 -0
- package/dist/guardrail-binding.d.ts +138 -0
- package/dist/guardrail-binding.d.ts.map +1 -0
- package/dist/guardrail-binding.js +4 -0
- package/dist/guardrail-binding.js.map +1 -0
- package/dist/handler-binding.d.ts +126 -0
- package/dist/handler-binding.d.ts.map +1 -0
- package/dist/handler-binding.js +4 -0
- package/dist/handler-binding.js.map +1 -0
- package/dist/hitl-binding.d.ts +115 -0
- package/dist/hitl-binding.d.ts.map +1 -0
- package/dist/hitl-binding.js +4 -0
- package/dist/hitl-binding.js.map +1 -0
- package/dist/identity-directory-binding.d.ts +116 -0
- package/dist/identity-directory-binding.d.ts.map +1 -0
- package/dist/identity-directory-binding.js +4 -0
- package/dist/identity-directory-binding.js.map +1 -0
- package/dist/identity-provider-binding.d.ts +184 -0
- package/dist/identity-provider-binding.d.ts.map +1 -0
- package/dist/identity-provider-binding.js +4 -0
- package/dist/identity-provider-binding.js.map +1 -0
- package/dist/image-registry-binding.d.ts +165 -0
- package/dist/image-registry-binding.d.ts.map +1 -0
- package/dist/image-registry-binding.js +4 -0
- package/dist/image-registry-binding.js.map +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/key-management-binding.d.ts +101 -0
- package/dist/key-management-binding.d.ts.map +1 -0
- package/dist/key-management-binding.js +4 -0
- package/dist/key-management-binding.js.map +1 -0
- package/dist/mcp-endpoint-binding.d.ts +312 -0
- package/dist/mcp-endpoint-binding.d.ts.map +1 -0
- package/dist/mcp-endpoint-binding.js +12 -0
- package/dist/mcp-endpoint-binding.js.map +1 -0
- package/dist/memory-binding.d.ts +209 -0
- package/dist/memory-binding.d.ts.map +1 -0
- package/dist/memory-binding.js +4 -0
- package/dist/memory-binding.js.map +1 -0
- package/dist/middleware/auth.d.ts +168 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +247 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/authorize.d.ts +26 -0
- package/dist/middleware/authorize.d.ts.map +1 -0
- package/dist/middleware/authorize.js +65 -0
- package/dist/middleware/authorize.js.map +1 -0
- package/dist/middleware/error-mapper.d.ts +20 -0
- package/dist/middleware/error-mapper.d.ts.map +1 -0
- package/dist/middleware/error-mapper.js +34 -0
- package/dist/middleware/error-mapper.js.map +1 -0
- package/dist/middleware/idempotency.d.ts +43 -0
- package/dist/middleware/idempotency.d.ts.map +1 -0
- package/dist/middleware/idempotency.js +118 -0
- package/dist/middleware/idempotency.js.map +1 -0
- package/dist/middleware/principal.d.ts +4 -0
- package/dist/middleware/principal.d.ts.map +1 -0
- package/dist/middleware/principal.js +42 -0
- package/dist/middleware/principal.js.map +1 -0
- package/dist/middleware/public-run-routes.d.ts +16 -0
- package/dist/middleware/public-run-routes.d.ts.map +1 -0
- package/dist/middleware/public-run-routes.js +43 -0
- package/dist/middleware/public-run-routes.js.map +1 -0
- package/dist/middleware/request-id.d.ts +14 -0
- package/dist/middleware/request-id.d.ts.map +1 -0
- package/dist/middleware/request-id.js +24 -0
- package/dist/middleware/request-id.js.map +1 -0
- package/dist/middleware/sigv4-verify.d.ts +64 -0
- package/dist/middleware/sigv4-verify.d.ts.map +1 -0
- package/dist/middleware/sigv4-verify.js +286 -0
- package/dist/middleware/sigv4-verify.js.map +1 -0
- package/dist/middleware/sigv4.d.ts +25 -0
- package/dist/middleware/sigv4.d.ts.map +1 -0
- package/dist/middleware/sigv4.js +120 -0
- package/dist/middleware/sigv4.js.map +1 -0
- package/dist/openapi/generate.d.ts +15 -0
- package/dist/openapi/generate.d.ts.map +1 -0
- package/dist/openapi/generate.js +241 -0
- package/dist/openapi/generate.js.map +1 -0
- package/dist/openapi/operations.d.ts +70 -0
- package/dist/openapi/operations.d.ts.map +1 -0
- package/dist/openapi/operations.js +5050 -0
- package/dist/openapi/operations.js.map +1 -0
- package/dist/openapi/schemas.d.ts +590 -0
- package/dist/openapi/schemas.d.ts.map +1 -0
- package/dist/openapi/schemas.js +5820 -0
- package/dist/openapi/schemas.js.map +1 -0
- package/dist/provenance-binding.d.ts +116 -0
- package/dist/provenance-binding.d.ts.map +1 -0
- package/dist/provenance-binding.js +31 -0
- package/dist/provenance-binding.js.map +1 -0
- package/dist/provider-binding.d.ts +174 -0
- package/dist/provider-binding.d.ts.map +1 -0
- package/dist/provider-binding.js +4 -0
- package/dist/provider-binding.js.map +1 -0
- package/dist/public-run-token.d.ts +97 -0
- package/dist/public-run-token.d.ts.map +1 -0
- package/dist/public-run-token.js +167 -0
- package/dist/public-run-token.js.map +1 -0
- package/dist/retention-binding.d.ts +69 -0
- package/dist/retention-binding.d.ts.map +1 -0
- package/dist/retention-binding.js +4 -0
- package/dist/retention-binding.js.map +1 -0
- package/dist/reviewer-binding.d.ts +84 -0
- package/dist/reviewer-binding.d.ts.map +1 -0
- package/dist/reviewer-binding.js +4 -0
- package/dist/reviewer-binding.js.map +1 -0
- package/dist/rotation-status-store.d.ts +96 -0
- package/dist/rotation-status-store.d.ts.map +1 -0
- package/dist/rotation-status-store.js +106 -0
- package/dist/rotation-status-store.js.map +1 -0
- package/dist/routes/adapters.d.ts +29 -0
- package/dist/routes/adapters.d.ts.map +1 -0
- package/dist/routes/adapters.js +230 -0
- package/dist/routes/adapters.js.map +1 -0
- package/dist/routes/agents.d.ts +17 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +342 -0
- package/dist/routes/agents.js.map +1 -0
- package/dist/routes/approvals.d.ts +37 -0
- package/dist/routes/approvals.d.ts.map +1 -0
- package/dist/routes/approvals.js +551 -0
- package/dist/routes/approvals.js.map +1 -0
- package/dist/routes/artifacts.d.ts +25 -0
- package/dist/routes/artifacts.d.ts.map +1 -0
- package/dist/routes/artifacts.js +265 -0
- package/dist/routes/artifacts.js.map +1 -0
- package/dist/routes/audit.d.ts +6 -0
- package/dist/routes/audit.d.ts.map +1 -0
- package/dist/routes/audit.js +162 -0
- package/dist/routes/audit.js.map +1 -0
- package/dist/routes/auth.d.ts +47 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +630 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/capabilities.d.ts +14 -0
- package/dist/routes/capabilities.d.ts.map +1 -0
- package/dist/routes/capabilities.js +62 -0
- package/dist/routes/capabilities.js.map +1 -0
- package/dist/routes/compliance.d.ts +37 -0
- package/dist/routes/compliance.d.ts.map +1 -0
- package/dist/routes/compliance.js +321 -0
- package/dist/routes/compliance.js.map +1 -0
- package/dist/routes/conversations.d.ts +13 -0
- package/dist/routes/conversations.d.ts.map +1 -0
- package/dist/routes/conversations.js +295 -0
- package/dist/routes/conversations.js.map +1 -0
- package/dist/routes/cost.d.ts +24 -0
- package/dist/routes/cost.d.ts.map +1 -0
- package/dist/routes/cost.js +243 -0
- package/dist/routes/cost.js.map +1 -0
- package/dist/routes/deployments.d.ts +122 -0
- package/dist/routes/deployments.d.ts.map +1 -0
- package/dist/routes/deployments.js +1036 -0
- package/dist/routes/deployments.js.map +1 -0
- package/dist/routes/env.d.ts +62 -0
- package/dist/routes/env.d.ts.map +1 -0
- package/dist/routes/env.js +311 -0
- package/dist/routes/env.js.map +1 -0
- package/dist/routes/eval-runs.d.ts +28 -0
- package/dist/routes/eval-runs.d.ts.map +1 -0
- package/dist/routes/eval-runs.js +479 -0
- package/dist/routes/eval-runs.js.map +1 -0
- package/dist/routes/eval-suites.d.ts +24 -0
- package/dist/routes/eval-suites.d.ts.map +1 -0
- package/dist/routes/eval-suites.js +381 -0
- package/dist/routes/eval-suites.js.map +1 -0
- package/dist/routes/event-triggers.d.ts +12 -0
- package/dist/routes/event-triggers.d.ts.map +1 -0
- package/dist/routes/event-triggers.js +218 -0
- package/dist/routes/event-triggers.js.map +1 -0
- package/dist/routes/flows.d.ts +23 -0
- package/dist/routes/flows.d.ts.map +1 -0
- package/dist/routes/flows.js +344 -0
- package/dist/routes/flows.js.map +1 -0
- package/dist/routes/guardrails.d.ts +33 -0
- package/dist/routes/guardrails.d.ts.map +1 -0
- package/dist/routes/guardrails.js +236 -0
- package/dist/routes/guardrails.js.map +1 -0
- package/dist/routes/identity.d.ts +39 -0
- package/dist/routes/identity.d.ts.map +1 -0
- package/dist/routes/identity.js +138 -0
- package/dist/routes/identity.js.map +1 -0
- package/dist/routes/mcp.d.ts +23 -0
- package/dist/routes/mcp.d.ts.map +1 -0
- package/dist/routes/mcp.js +727 -0
- package/dist/routes/mcp.js.map +1 -0
- package/dist/routes/memory.d.ts +16 -0
- package/dist/routes/memory.d.ts.map +1 -0
- package/dist/routes/memory.js +353 -0
- package/dist/routes/memory.js.map +1 -0
- package/dist/routes/observations.d.ts +19 -0
- package/dist/routes/observations.d.ts.map +1 -0
- package/dist/routes/observations.js +135 -0
- package/dist/routes/observations.js.map +1 -0
- package/dist/routes/orgs.d.ts +24 -0
- package/dist/routes/orgs.d.ts.map +1 -0
- package/dist/routes/orgs.js +208 -0
- package/dist/routes/orgs.js.map +1 -0
- package/dist/routes/pagination.d.ts +18 -0
- package/dist/routes/pagination.d.ts.map +1 -0
- package/dist/routes/pagination.js +35 -0
- package/dist/routes/pagination.js.map +1 -0
- package/dist/routes/policies.d.ts +23 -0
- package/dist/routes/policies.d.ts.map +1 -0
- package/dist/routes/policies.js +314 -0
- package/dist/routes/policies.js.map +1 -0
- package/dist/routes/projects.d.ts +45 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +485 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/proposals.d.ts +24 -0
- package/dist/routes/proposals.d.ts.map +1 -0
- package/dist/routes/proposals.js +581 -0
- package/dist/routes/proposals.js.map +1 -0
- package/dist/routes/provenance.d.ts +34 -0
- package/dist/routes/provenance.d.ts.map +1 -0
- package/dist/routes/provenance.js +274 -0
- package/dist/routes/provenance.js.map +1 -0
- package/dist/routes/providers.d.ts +32 -0
- package/dist/routes/providers.d.ts.map +1 -0
- package/dist/routes/providers.js +490 -0
- package/dist/routes/providers.js.map +1 -0
- package/dist/routes/public-run-tokens.d.ts +17 -0
- package/dist/routes/public-run-tokens.d.ts.map +1 -0
- package/dist/routes/public-run-tokens.js +69 -0
- package/dist/routes/public-run-tokens.js.map +1 -0
- package/dist/routes/retention.d.ts +19 -0
- package/dist/routes/retention.d.ts.map +1 -0
- package/dist/routes/retention.js +152 -0
- package/dist/routes/retention.js.map +1 -0
- package/dist/routes/reviewers.d.ts +5 -0
- package/dist/routes/reviewers.d.ts.map +1 -0
- package/dist/routes/reviewers.js +161 -0
- package/dist/routes/reviewers.js.map +1 -0
- package/dist/routes/runs.d.ts +34 -0
- package/dist/routes/runs.d.ts.map +1 -0
- package/dist/routes/runs.js +705 -0
- package/dist/routes/runs.js.map +1 -0
- package/dist/routes/s3.d.ts +31 -0
- package/dist/routes/s3.d.ts.map +1 -0
- package/dist/routes/s3.js +433 -0
- package/dist/routes/s3.js.map +1 -0
- package/dist/routes/schedules.d.ts +20 -0
- package/dist/routes/schedules.d.ts.map +1 -0
- package/dist/routes/schedules.js +234 -0
- package/dist/routes/schedules.js.map +1 -0
- package/dist/routes/scope-params.d.ts +57 -0
- package/dist/routes/scope-params.d.ts.map +1 -0
- package/dist/routes/scope-params.js +105 -0
- package/dist/routes/scope-params.js.map +1 -0
- package/dist/routes/secret-ref.d.ts +20 -0
- package/dist/routes/secret-ref.d.ts.map +1 -0
- package/dist/routes/secret-ref.js +42 -0
- package/dist/routes/secret-ref.js.map +1 -0
- package/dist/routes/secrets.d.ts +53 -0
- package/dist/routes/secrets.d.ts.map +1 -0
- package/dist/routes/secrets.js +715 -0
- package/dist/routes/secrets.js.map +1 -0
- package/dist/routes/signing-keys.d.ts +23 -0
- package/dist/routes/signing-keys.d.ts.map +1 -0
- package/dist/routes/signing-keys.js +212 -0
- package/dist/routes/signing-keys.js.map +1 -0
- package/dist/routes/sse.d.ts +58 -0
- package/dist/routes/sse.d.ts.map +1 -0
- package/dist/routes/sse.js +92 -0
- package/dist/routes/sse.js.map +1 -0
- package/dist/routes/teams.d.ts +30 -0
- package/dist/routes/teams.d.ts.map +1 -0
- package/dist/routes/teams.js +443 -0
- package/dist/routes/teams.js.map +1 -0
- package/dist/routes/tenant.d.ts +57 -0
- package/dist/routes/tenant.d.ts.map +1 -0
- package/dist/routes/tenant.js +352 -0
- package/dist/routes/tenant.js.map +1 -0
- package/dist/routes/tokens.d.ts +14 -0
- package/dist/routes/tokens.d.ts.map +1 -0
- package/dist/routes/tokens.js +231 -0
- package/dist/routes/tokens.js.map +1 -0
- package/dist/routes/tools.d.ts +33 -0
- package/dist/routes/tools.d.ts.map +1 -0
- package/dist/routes/tools.js +380 -0
- package/dist/routes/tools.js.map +1 -0
- package/dist/routes/webhook-endpoints.d.ts +10 -0
- package/dist/routes/webhook-endpoints.d.ts.map +1 -0
- package/dist/routes/webhook-endpoints.js +407 -0
- package/dist/routes/webhook-endpoints.js.map +1 -0
- package/dist/routes/webhooks.d.ts +21 -0
- package/dist/routes/webhooks.d.ts.map +1 -0
- package/dist/routes/webhooks.js +228 -0
- package/dist/routes/webhooks.js.map +1 -0
- package/dist/s3-credential-binding.d.ts +54 -0
- package/dist/s3-credential-binding.d.ts.map +1 -0
- package/dist/s3-credential-binding.js +4 -0
- package/dist/s3-credential-binding.js.map +1 -0
- package/dist/secrets-binding.d.ts +281 -0
- package/dist/secrets-binding.d.ts.map +1 -0
- package/dist/secrets-binding.js +10 -0
- package/dist/secrets-binding.js.map +1 -0
- package/dist/secrets-provider-binding.d.ts +164 -0
- package/dist/secrets-provider-binding.d.ts.map +1 -0
- package/dist/secrets-provider-binding.js +4 -0
- package/dist/secrets-provider-binding.js.map +1 -0
- package/dist/session-store-binding.d.ts +148 -0
- package/dist/session-store-binding.d.ts.map +1 -0
- package/dist/session-store-binding.js +4 -0
- package/dist/session-store-binding.js.map +1 -0
- package/dist/signing-key-binding.d.ts +210 -0
- package/dist/signing-key-binding.d.ts.map +1 -0
- package/dist/signing-key-binding.js +4 -0
- package/dist/signing-key-binding.js.map +1 -0
- package/dist/state-store-binding.d.ts +53 -0
- package/dist/state-store-binding.d.ts.map +1 -0
- package/dist/state-store-binding.js +38 -0
- package/dist/state-store-binding.js.map +1 -0
- package/dist/supervisor-binding.d.ts +526 -0
- package/dist/supervisor-binding.d.ts.map +1 -0
- package/dist/supervisor-binding.js +4 -0
- package/dist/supervisor-binding.js.map +1 -0
- package/dist/tenant-host-access.d.ts +41 -0
- package/dist/tenant-host-access.d.ts.map +1 -0
- package/dist/tenant-host-access.js +42 -0
- package/dist/tenant-host-access.js.map +1 -0
- package/dist/token-admin.d.ts +99 -0
- package/dist/token-admin.d.ts.map +1 -0
- package/dist/token-admin.js +4 -0
- package/dist/token-admin.js.map +1 -0
- package/dist/tool-binding.d.ts +247 -0
- package/dist/tool-binding.d.ts.map +1 -0
- package/dist/tool-binding.js +4 -0
- package/dist/tool-binding.js.map +1 -0
- package/dist/trigger-binding.d.ts +13 -0
- package/dist/trigger-binding.d.ts.map +1 -0
- package/dist/trigger-binding.js +4 -0
- package/dist/trigger-binding.js.map +1 -0
- package/dist/types.d.ts +71 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/webhook-endpoint-binding.d.ts +230 -0
- package/dist/webhook-endpoint-binding.d.ts.map +1 -0
- package/dist/webhook-endpoint-binding.js +12 -0
- package/dist/webhook-endpoint-binding.js.map +1 -0
- package/dist/xml.d.ts +79 -0
- package/dist/xml.d.ts.map +1 -0
- package/dist/xml.js +115 -0
- package/dist/xml.js.map +1 -0
- package/openapi.json +29649 -0
- package/package.json +76 -4
- package/scripts/emit-openapi.mjs +44 -0
- package/src/adapter-binding.ts +204 -0
- package/src/agent-binding.ts +231 -0
- package/src/app.ts +1286 -0
- package/src/capability-binding.ts +83 -0
- package/src/cost-binding.ts +213 -0
- package/src/deployment-binding.ts +225 -0
- package/src/env-binding.ts +140 -0
- package/src/errors.ts +295 -0
- package/src/eval-run-binding.ts +209 -0
- package/src/eval-run-dispatcher.ts +497 -0
- package/src/eval-suite-binding.ts +257 -0
- package/src/event-bus-binding.ts +127 -0
- package/src/flow-binding.ts +213 -0
- package/src/guardrail-binding.ts +151 -0
- package/src/handler-binding.ts +132 -0
- package/src/hitl-binding.ts +172 -0
- package/src/identity-directory-binding.ts +128 -0
- package/src/identity-provider-binding.ts +203 -0
- package/src/image-registry-binding.ts +193 -0
- package/src/index.ts +606 -0
- package/src/key-management-binding.ts +91 -0
- package/src/mcp-endpoint-binding.ts +311 -0
- package/src/memory-binding.ts +239 -0
- package/src/middleware/auth.ts +437 -0
- package/src/middleware/authorize.ts +125 -0
- package/src/middleware/error-mapper.ts +40 -0
- package/src/middleware/idempotency.ts +160 -0
- package/src/middleware/principal.ts +64 -0
- package/src/middleware/public-run-routes.ts +50 -0
- package/src/middleware/request-id.ts +28 -0
- package/src/middleware/sigv4-verify.ts +374 -0
- package/src/middleware/sigv4.ts +165 -0
- package/src/openapi/generate.ts +307 -0
- package/src/openapi/operations.ts +5444 -0
- package/src/openapi/schemas.ts +6363 -0
- package/src/provenance-binding.ts +169 -0
- package/src/provider-binding.ts +196 -0
- package/src/public-run-token.ts +263 -0
- package/src/retention-binding.ts +78 -0
- package/src/reviewer-binding.ts +99 -0
- package/src/rotation-status-store.ts +209 -0
- package/src/routes/adapters.ts +319 -0
- package/src/routes/agents.ts +424 -0
- package/src/routes/approvals.ts +759 -0
- package/src/routes/artifacts.ts +317 -0
- package/src/routes/audit.ts +219 -0
- package/src/routes/auth.ts +806 -0
- package/src/routes/capabilities.ts +79 -0
- package/src/routes/compliance.ts +482 -0
- package/src/routes/conversations.ts +369 -0
- package/src/routes/cost.ts +327 -0
- package/src/routes/deployments.ts +1493 -0
- package/src/routes/env.ts +429 -0
- package/src/routes/eval-runs.ts +631 -0
- package/src/routes/eval-suites.ts +490 -0
- package/src/routes/event-triggers.ts +283 -0
- package/src/routes/flows.ts +423 -0
- package/src/routes/guardrails.ts +320 -0
- package/src/routes/identity.ts +203 -0
- package/src/routes/mcp.ts +940 -0
- package/src/routes/memory.ts +430 -0
- package/src/routes/observations.ts +175 -0
- package/src/routes/orgs.ts +273 -0
- package/src/routes/pagination.ts +51 -0
- package/src/routes/policies.ts +413 -0
- package/src/routes/projects.ts +634 -0
- package/src/routes/proposals.ts +719 -0
- package/src/routes/provenance.ts +406 -0
- package/src/routes/providers.ts +624 -0
- package/src/routes/public-run-tokens.ts +104 -0
- package/src/routes/retention.ts +193 -0
- package/src/routes/reviewers.ts +209 -0
- package/src/routes/runs.ts +892 -0
- package/src/routes/s3.ts +519 -0
- package/src/routes/schedules.ts +300 -0
- package/src/routes/scope-params.ts +133 -0
- package/src/routes/secret-ref.ts +52 -0
- package/src/routes/secrets.ts +975 -0
- package/src/routes/signing-keys.ts +259 -0
- package/src/routes/sse.ts +148 -0
- package/src/routes/teams.ts +584 -0
- package/src/routes/tenant.ts +530 -0
- package/src/routes/tokens.ts +285 -0
- package/src/routes/tools.ts +491 -0
- package/src/routes/webhook-endpoints.ts +534 -0
- package/src/routes/webhooks.ts +296 -0
- package/src/s3-credential-binding.ts +58 -0
- package/src/secrets-binding.ts +308 -0
- package/src/secrets-provider-binding.ts +167 -0
- package/src/session-store-binding.ts +163 -0
- package/src/signing-key-binding.ts +235 -0
- package/src/state-store-binding.ts +84 -0
- package/src/supervisor-binding.ts +554 -0
- package/src/tenant-host-access.ts +62 -0
- package/src/token-admin.ts +104 -0
- package/src/tool-binding.ts +274 -0
- package/src/trigger-binding.ts +38 -0
- package/src/types.ts +74 -0
- package/src/webhook-endpoint-binding.ts +246 -0
- package/src/xml.ts +196 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { TupleEnqueueHook } from '@kindgi/authz';
|
|
5
|
+
import type { Scope } from '@kindgi/platform';
|
|
6
|
+
import type { Cursor, EnvName, TenantId } from '@kindgi/types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Caller-plugged surface for the MCP-endpoint catalog. Tenants register
|
|
10
|
+
* the remote MCP servers they want the runtime to consume. At boot the
|
|
11
|
+
* runtime discovers each endpoint's tools (MCP `tools/list`) and
|
|
12
|
+
* registers them into the `ToolRegistryBinding` under the same tenant —
|
|
13
|
+
* remote tools become native `Tool`s without a TypeScript recompile.
|
|
14
|
+
*
|
|
15
|
+
* Contract shape: 4-method non-versioned, mirroring
|
|
16
|
+
* `ProviderRegistryBinding` (`list` / `get` / `register` / `unregister`)
|
|
17
|
+
* minus `capabilitiesFor` — an MCP endpoint doesn't advertise a static
|
|
18
|
+
* capability list up-front (tools come from the live server at boot).
|
|
19
|
+
*
|
|
20
|
+
* Every method is tenant-scoped: callers pass `tenantId` explicitly so
|
|
21
|
+
* multi-tenant deployments can partition storage without exposing the
|
|
22
|
+
* scoping inside the API package.
|
|
23
|
+
*
|
|
24
|
+
* **Wire-safety of secrets.** `authRef` is a REFERENCE (e.g.
|
|
25
|
+
* `env:MY_MCP_KEY`), never a plaintext credential. The API surface
|
|
26
|
+
* accepts, stores, and returns only the reference; the runtime resolves
|
|
27
|
+
* it inside the deployment (e.g. against env vars) before constructing
|
|
28
|
+
* the transport. This mirrors the "no secrets on
|
|
29
|
+
* the wire" guardrail `ProviderRegistryBinding` enforces for LLM keys.
|
|
30
|
+
*/
|
|
31
|
+
export interface MCPEndpointRegistryBinding {
|
|
32
|
+
/** Cursor-paginated list. Optional `transportFilter` narrows to one variant. */
|
|
33
|
+
list(input: MCPEndpointListInput): Promise<MCPEndpointPage>;
|
|
34
|
+
/** Fetch a single endpoint, or `null` when unknown. Route flips `null` → 404. */
|
|
35
|
+
get(input: MCPEndpointGetInput): Promise<MCPEndpoint | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Register an endpoint. Route validates the closed transport enum and
|
|
38
|
+
* the config-transport ↔ top-level-transport match before calling.
|
|
39
|
+
* Bindings MAY reject with `already-registered`; the route maps that
|
|
40
|
+
* to `409 mcp-endpoint-already-registered`.
|
|
41
|
+
*/
|
|
42
|
+
register(input: MCPEndpointRegisterInput): Promise<MCPEndpointRegisterOutcome>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove an endpoint. `{ unregistered: false }` maps to
|
|
45
|
+
* `404 mcp-endpoint-not-found` at the route.
|
|
46
|
+
*/
|
|
47
|
+
unregister(input: MCPEndpointUnregisterInput): Promise<MCPEndpointUnregisterOutcome>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Closed transport enum. `stdio` for local subprocess servers,
|
|
52
|
+
* `http-sse` for the older MCP HTTP+SSE transport (separate SSE stream
|
|
53
|
+
* + POST endpoint), `streamable-http` for the Streamable HTTP transport
|
|
54
|
+
* (single HTTP endpoint, SSE for server → client, POST for
|
|
55
|
+
* client → server, session-id via header). Additive: extend the
|
|
56
|
+
* union when a new SDK transport lands.
|
|
57
|
+
*/
|
|
58
|
+
export const MCP_TRANSPORTS = ['stdio', 'http-sse', 'streamable-http'] as const;
|
|
59
|
+
export type MCPTransport = (typeof MCP_TRANSPORTS)[number];
|
|
60
|
+
|
|
61
|
+
/** stdio transport config — subprocess command + args. */
|
|
62
|
+
export interface MCPStdioConfig {
|
|
63
|
+
readonly transport: 'stdio';
|
|
64
|
+
readonly command: string;
|
|
65
|
+
readonly args?: readonly string[];
|
|
66
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** http-sse transport config — HTTP+SSE transport (separate SSE + POST). */
|
|
70
|
+
export interface MCPHttpSseConfig {
|
|
71
|
+
readonly transport: 'http-sse';
|
|
72
|
+
readonly url: string;
|
|
73
|
+
/** Optional distinct SSE endpoint if the server splits them. */
|
|
74
|
+
readonly sseUrl?: string;
|
|
75
|
+
/** Optional header overrides. `secretRef` is applied separately by the runtime. */
|
|
76
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** streamable-http transport config — single endpoint. */
|
|
80
|
+
export interface MCPStreamableHttpConfig {
|
|
81
|
+
readonly transport: 'streamable-http';
|
|
82
|
+
readonly url: string;
|
|
83
|
+
/** Optional header overrides. `secretRef` is applied separately by the runtime. */
|
|
84
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type MCPEndpointConfig = MCPStdioConfig | MCPHttpSseConfig | MCPStreamableHttpConfig;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The secret an endpoint authenticates with: a name in the deployment's
|
|
91
|
+
* secrets store, resolved at the endpoint's tenant scope (the shape
|
|
92
|
+
* webhooks and providers use). Never the secret itself.
|
|
93
|
+
*/
|
|
94
|
+
export interface MCPEndpointSecretRef {
|
|
95
|
+
readonly envName: EnvName;
|
|
96
|
+
readonly name: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Wire shape for a registered MCP endpoint. Secrets never appear —
|
|
101
|
+
* `secretRef` names a secret the runtime resolves inside the
|
|
102
|
+
* deployment. Callers who inspect this object over the wire never see
|
|
103
|
+
* the plaintext credential.
|
|
104
|
+
*/
|
|
105
|
+
export interface MCPEndpoint {
|
|
106
|
+
/** Deployment-stable endpoint id. Route param + registration key. */
|
|
107
|
+
readonly endpointId: string;
|
|
108
|
+
/** Human-readable display name. */
|
|
109
|
+
readonly name: string;
|
|
110
|
+
/**
|
|
111
|
+
* Redundant with `config.transport` — kept at the top for cheap
|
|
112
|
+
* filtering (`?transport=stdio`) without unwrapping `config`. Route
|
|
113
|
+
* enforces `config.transport === transport` at registration.
|
|
114
|
+
*/
|
|
115
|
+
readonly transport: MCPTransport;
|
|
116
|
+
readonly config: MCPEndpointConfig;
|
|
117
|
+
/**
|
|
118
|
+
* The secret sent as the endpoint's bearer (`Authorization` by default),
|
|
119
|
+
* resolved through the tenant's secrets store when the runtime connects.
|
|
120
|
+
*/
|
|
121
|
+
readonly secretRef?: MCPEndpointSecretRef;
|
|
122
|
+
/**
|
|
123
|
+
* Optional pass-through to the MCP client's server-info instructions
|
|
124
|
+
* slot. Purely informational.
|
|
125
|
+
*/
|
|
126
|
+
readonly instructions?: string;
|
|
127
|
+
/** Optional caller-defined metadata bag. */
|
|
128
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface MCPEndpointListInput {
|
|
132
|
+
readonly tenantId: TenantId;
|
|
133
|
+
readonly limit: number;
|
|
134
|
+
readonly cursor?: Cursor;
|
|
135
|
+
/** Exact match on `transport`. */
|
|
136
|
+
readonly transportFilter?: MCPTransport;
|
|
137
|
+
/**
|
|
138
|
+
* Narrow the list to a specific scope. Absent = no narrow (return
|
|
139
|
+
* every row in the tenant regardless of scope kind).
|
|
140
|
+
*
|
|
141
|
+
* Policy/config-scoped semantics (this binding):
|
|
142
|
+
* - `{ kind: 'project', projectId }` — with `inherit=true` (default):
|
|
143
|
+
* rows literally at this project + rows at the project's org +
|
|
144
|
+
* tenant-wide rows (upward walk). With `inherit=false`: only rows
|
|
145
|
+
* registered at exactly this project.
|
|
146
|
+
* - `{ kind: 'org', orgId }` — with `inherit=true`: org-scoped +
|
|
147
|
+
* tenant-scoped. With `inherit=false`: only rows registered at
|
|
148
|
+
* exactly this org.
|
|
149
|
+
* - `{ kind: 'tenant', tenantId }` — `inherit` has no effect (already
|
|
150
|
+
* the top of the hierarchy).
|
|
151
|
+
*/
|
|
152
|
+
readonly scope?: Scope;
|
|
153
|
+
/**
|
|
154
|
+
* `true` (default) = inheritance walk. Matches the common
|
|
155
|
+
* user-facing case ("what endpoints does this project see").
|
|
156
|
+
* `false` = literal-at-this-scope only. Matches the admin/audit case
|
|
157
|
+
* ("what's explicitly configured at this scope").
|
|
158
|
+
*/
|
|
159
|
+
readonly inherit?: boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface MCPEndpointGetInput {
|
|
163
|
+
readonly tenantId: TenantId;
|
|
164
|
+
readonly endpointId: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface MCPEndpointRegisterInput {
|
|
168
|
+
readonly tenantId: TenantId;
|
|
169
|
+
readonly endpoint: MCPEndpoint;
|
|
170
|
+
/**
|
|
171
|
+
* Scope at which the endpoint is registered (policy/config anchor).
|
|
172
|
+
* Required — no silent tenant-scope fallback at the binding layer.
|
|
173
|
+
* Callers without a natural scope resolve via
|
|
174
|
+
* `bindings.projectBinding.getDefault(...)` at the caller layer (route
|
|
175
|
+
* body, runtime).
|
|
176
|
+
*
|
|
177
|
+
* Policy/config-scoped semantics (this binding):
|
|
178
|
+
* - `{ kind: 'project', projectId }` — endpoint visible only to that
|
|
179
|
+
* project and its descendants under inherit=true reads.
|
|
180
|
+
* - `{ kind: 'org', orgId }` — visible to every project inside that org
|
|
181
|
+
* under inherit=true reads.
|
|
182
|
+
* - `{ kind: 'tenant', tenantId }` — visible to every project + org
|
|
183
|
+
* inside the tenant (top of hierarchy).
|
|
184
|
+
*/
|
|
185
|
+
readonly scope: Scope;
|
|
186
|
+
/**
|
|
187
|
+
* REQUIRED. Called inside the binding's write tx after insert,
|
|
188
|
+
* receiving the business `endpointId`. Returns tuples for the tx —
|
|
189
|
+
* `mcp_endpoint#scope@{tenant|org|project}:X` per the model.
|
|
190
|
+
* See `AgentPublishInput.enqueueTuples` for the design rationale.
|
|
191
|
+
*/
|
|
192
|
+
readonly enqueueTuples: TupleEnqueueHook;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface MCPEndpointUnregisterInput {
|
|
196
|
+
readonly tenantId: TenantId;
|
|
197
|
+
readonly endpointId: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface MCPEndpointPage {
|
|
201
|
+
readonly data: readonly MCPEndpoint[];
|
|
202
|
+
readonly nextCursor?: Cursor;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export type MCPEndpointRegisterOutcome =
|
|
206
|
+
| { readonly kind: 'ok'; readonly endpointId: string }
|
|
207
|
+
| { readonly kind: 'already-registered'; readonly endpointId: string }
|
|
208
|
+
| {
|
|
209
|
+
readonly kind: 'project-not-found';
|
|
210
|
+
readonly endpointId: string;
|
|
211
|
+
readonly projectId: import('@kindgi/types').ProjectId;
|
|
212
|
+
}
|
|
213
|
+
| {
|
|
214
|
+
readonly kind: 'org-not-found';
|
|
215
|
+
readonly endpointId: string;
|
|
216
|
+
readonly orgId: import('@kindgi/types').OrgId;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export type MCPEndpointUnregisterOutcome = {
|
|
220
|
+
readonly unregistered: boolean;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Caller-plugged probe for remote MCP endpoints' resources + prompts
|
|
225
|
+
* primitives. The runtime supplies an implementation that opens a live
|
|
226
|
+
* MCP client against the endpoint's declared transport, runs the
|
|
227
|
+
* operation, and closes it — typically a fresh client per call to
|
|
228
|
+
* `listResources` / `readResource` / `listPrompts` / `getPrompt`.
|
|
229
|
+
*
|
|
230
|
+
* Duck-typed at the wire boundary: return shapes mirror the MCP spec so
|
|
231
|
+
* this file doesn't have to depend on an MCP client library. The
|
|
232
|
+
* implementation maps its client's types into these shapes.
|
|
233
|
+
*/
|
|
234
|
+
export interface MCPClientProbeBinding {
|
|
235
|
+
listResources(input: MCPClientProbeInput): Promise<MCPListResourcesOutcome>;
|
|
236
|
+
readResource(
|
|
237
|
+
input: MCPClientProbeInput & { readonly uri: string },
|
|
238
|
+
): Promise<MCPReadResourceOutcome>;
|
|
239
|
+
listPrompts(input: MCPClientProbeInput): Promise<MCPListPromptsOutcome>;
|
|
240
|
+
getPrompt(
|
|
241
|
+
input: MCPClientProbeInput & {
|
|
242
|
+
readonly name: string;
|
|
243
|
+
readonly args?: Readonly<Record<string, string>>;
|
|
244
|
+
},
|
|
245
|
+
): Promise<MCPGetPromptOutcome>;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface MCPClientProbeInput {
|
|
249
|
+
readonly tenantId: TenantId;
|
|
250
|
+
readonly endpointId: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** MCP-spec resource descriptor. */
|
|
254
|
+
export interface MCPResourceDescriptor {
|
|
255
|
+
readonly uri: string;
|
|
256
|
+
readonly name: string;
|
|
257
|
+
readonly description?: string;
|
|
258
|
+
readonly mimeType?: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** MCP-spec resource content payload — exactly one of `text` or `blob`. */
|
|
262
|
+
export interface MCPResourceContent {
|
|
263
|
+
readonly uri: string;
|
|
264
|
+
readonly mimeType?: string;
|
|
265
|
+
readonly text?: string;
|
|
266
|
+
readonly blob?: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** MCP-spec prompt argument spec. */
|
|
270
|
+
export interface MCPPromptArgument {
|
|
271
|
+
readonly name: string;
|
|
272
|
+
readonly description?: string;
|
|
273
|
+
readonly required?: boolean;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** MCP-spec prompt descriptor. */
|
|
277
|
+
export interface MCPPromptDescriptor {
|
|
278
|
+
readonly name: string;
|
|
279
|
+
readonly description?: string;
|
|
280
|
+
readonly arguments?: readonly MCPPromptArgument[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** MCP-spec prompt message. */
|
|
284
|
+
export interface MCPPromptMessage {
|
|
285
|
+
readonly role: 'user' | 'assistant';
|
|
286
|
+
readonly content:
|
|
287
|
+
| { readonly type: 'text'; readonly text: string }
|
|
288
|
+
| { readonly type: 'image'; readonly data: string; readonly mimeType: string };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export type MCPListResourcesOutcome =
|
|
292
|
+
| { readonly kind: 'ok'; readonly resources: readonly MCPResourceDescriptor[] }
|
|
293
|
+
| { readonly kind: 'endpoint-not-found' }
|
|
294
|
+
| { readonly kind: 'protocol-error'; readonly message: string };
|
|
295
|
+
|
|
296
|
+
export type MCPReadResourceOutcome =
|
|
297
|
+
| { readonly kind: 'ok'; readonly content: MCPResourceContent }
|
|
298
|
+
| { readonly kind: 'endpoint-not-found' }
|
|
299
|
+
| { readonly kind: 'resource-not-found'; readonly uri: string }
|
|
300
|
+
| { readonly kind: 'read-failed'; readonly message: string };
|
|
301
|
+
|
|
302
|
+
export type MCPListPromptsOutcome =
|
|
303
|
+
| { readonly kind: 'ok'; readonly prompts: readonly MCPPromptDescriptor[] }
|
|
304
|
+
| { readonly kind: 'endpoint-not-found' }
|
|
305
|
+
| { readonly kind: 'protocol-error'; readonly message: string };
|
|
306
|
+
|
|
307
|
+
export type MCPGetPromptOutcome =
|
|
308
|
+
| { readonly kind: 'ok'; readonly messages: readonly MCPPromptMessage[] }
|
|
309
|
+
| { readonly kind: 'endpoint-not-found' }
|
|
310
|
+
| { readonly kind: 'prompt-not-found'; readonly name: string }
|
|
311
|
+
| { readonly kind: 'get-failed'; readonly message: string };
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { Fact, MemoryScope, Retention } from '@kindgi/memory';
|
|
5
|
+
import type { Scope as PlatformScope } from '@kindgi/platform';
|
|
6
|
+
import type { Cursor, FactId, TenantId } from '@kindgi/types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Caller-plugged surface for the memory resource. Same shape as
|
|
10
|
+
* `AgentRegistryBinding` / `ToolRegistryBinding` / `GuardrailRegistryBinding`:
|
|
11
|
+
* the API package does NOT own memory persistence or retrieval logic.
|
|
12
|
+
* Deployments plug in a binding that wraps the memory subsystem (the
|
|
13
|
+
* Kindgi runtime provides one) together with their own
|
|
14
|
+
* `EmbeddingProviderRegistry` and per-type retrieval policies.
|
|
15
|
+
*
|
|
16
|
+
* Every method is tenant-scoped: callers pass `tenantId` explicitly so
|
|
17
|
+
* multi-tenant deployments can partition storage without exposing the
|
|
18
|
+
* scoping inside the API package.
|
|
19
|
+
*
|
|
20
|
+
* Cursors are opaque — the binding chooses its encoding (page number,
|
|
21
|
+
* ISO timestamp, `id@version`, whatever). The API layer only validates
|
|
22
|
+
* that a cursor round-trips as a string; it never inspects the payload.
|
|
23
|
+
*
|
|
24
|
+
* Supersession, not delete: facts are append-only. `supersedeFact`
|
|
25
|
+
* writes a new revision that supersedes the target; the historical row
|
|
26
|
+
* remains readable until retention sweeps it. There is no hard delete;
|
|
27
|
+
* the retention sweep handles physical removal.
|
|
28
|
+
*/
|
|
29
|
+
export interface MemoryBinding {
|
|
30
|
+
/**
|
|
31
|
+
* Cursor-paginated list of facts under the tenant. Filters:
|
|
32
|
+
* - `type` — exact fact-type match.
|
|
33
|
+
* - `scope` — partial-match filter (see `Scope` in the memory subsystem).
|
|
34
|
+
*
|
|
35
|
+
* Sort order is binding-defined — for example, the latest version
|
|
36
|
+
* per `(type, id)` sorted by `createdAt desc`.
|
|
37
|
+
*/
|
|
38
|
+
listFacts(input: MemoryListFactsInput): Promise<MemoryFactPage>;
|
|
39
|
+
/**
|
|
40
|
+
* The fact with the given id, or `null` if unknown. Latest version
|
|
41
|
+
* by default; bindings MAY accept a `version` in the input to select
|
|
42
|
+
* a specific historical revision (not exposed on the route today).
|
|
43
|
+
* The route surfaces `null` as `404 fact-not-found`.
|
|
44
|
+
*/
|
|
45
|
+
getFact(input: MemoryGetFactInput): Promise<Fact | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Persist a new fact. The binding validates the write against its
|
|
48
|
+
* retrieval-policy registry (populates keyword / semantic indexes
|
|
49
|
+
* per type) and its embedding registry (for semantic-indexed types).
|
|
50
|
+
*
|
|
51
|
+
* When the fact type declares semantic indexing but no embedding
|
|
52
|
+
* provider is bound, the binding MUST return an `err` result — the
|
|
53
|
+
* route maps that to `400 bad-input`.
|
|
54
|
+
*/
|
|
55
|
+
writeFact(input: MemoryWriteFactInput): Promise<MemoryWriteFactOutcome>;
|
|
56
|
+
/**
|
|
57
|
+
* Mark a fact as superseded. The binding writes a superseding
|
|
58
|
+
* revision (or flags the row, depending on its runtime semantics).
|
|
59
|
+
* Idempotent — superseding an already-superseded fact returns
|
|
60
|
+
* `{ superseded: true }` without error. When the fact id is unknown,
|
|
61
|
+
* returns `{ superseded: false }` and the route flips that to `404`.
|
|
62
|
+
*/
|
|
63
|
+
supersedeFact(input: MemorySupersedeFactInput): Promise<MemorySupersedeFactOutcome>;
|
|
64
|
+
/**
|
|
65
|
+
* Cross-history retrieval. The `intent` mirrors the shape agents use
|
|
66
|
+
* for declarative retrieval (`packages/agents/src/retrieval.ts`):
|
|
67
|
+
*
|
|
68
|
+
* - `mode: 'list'` — plain scoped list, no query needed.
|
|
69
|
+
* - `mode: 'keyword'` — full-text keyword search.
|
|
70
|
+
* - `mode: 'semantic'` — vector cosine similarity. Requires an
|
|
71
|
+
* embedding registry in the binding; if absent, the binding
|
|
72
|
+
* MUST return `{ kind: 'embedding-unavailable' }` so the route
|
|
73
|
+
* can respond `400 bad-input`.
|
|
74
|
+
* - `mode: 'both'` — keyword + semantic union, dedup by fact id.
|
|
75
|
+
*
|
|
76
|
+
* Semantic modes MAY accept `embeddingModel` on the intent to select
|
|
77
|
+
* a specific registered provider; omit to fall back to the sole one.
|
|
78
|
+
*/
|
|
79
|
+
retrieve(input: MemoryRetrieveInput): Promise<MemoryRetrieveOutcome>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// -------------------- list --------------------
|
|
83
|
+
|
|
84
|
+
export interface MemoryListFactsInput {
|
|
85
|
+
readonly tenantId: TenantId;
|
|
86
|
+
readonly limit: number;
|
|
87
|
+
readonly cursor?: Cursor;
|
|
88
|
+
/** Exact match on `Fact.type`. Undefined = no type filter. */
|
|
89
|
+
readonly type?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Partial `MemoryScope` filter from the memory subsystem — the
|
|
92
|
+
* flat-struct memory scope (tenantId + optional userId / orgId /
|
|
93
|
+
* projectId / threadId / sessionId). Every provided key must match.
|
|
94
|
+
*/
|
|
95
|
+
readonly scope?: Partial<MemoryScope>;
|
|
96
|
+
/**
|
|
97
|
+
* Narrow the list to a specific scope using the platform-wide
|
|
98
|
+
* discriminated `Scope` primitive from `@kindgi/platform`.
|
|
99
|
+
* Absent = no scope narrow (return every row in the tenant the
|
|
100
|
+
* caller can see — admin/audit default).
|
|
101
|
+
*
|
|
102
|
+
* Content-scoped semantics (this binding — memory facts attribute
|
|
103
|
+
* to the project via `Scope.projectId`):
|
|
104
|
+
* - `{ kind: 'project', projectId }` — rows in that project.
|
|
105
|
+
* - `{ kind: 'org', orgId }` — rows in every project belonging to
|
|
106
|
+
* that org.
|
|
107
|
+
* - `{ kind: 'tenant', tenantId }` — every row in the tenant.
|
|
108
|
+
*
|
|
109
|
+
* Content rows always belong to a project, so `inherit` has no
|
|
110
|
+
* effect here.
|
|
111
|
+
*
|
|
112
|
+
* The `scope` field above and `platformScope` are additive filters —
|
|
113
|
+
* pass either, or both (AND-composed).
|
|
114
|
+
*/
|
|
115
|
+
readonly platformScope?: PlatformScope;
|
|
116
|
+
/**
|
|
117
|
+
* `false` = literal-at-this-scope only (admin/audit view).
|
|
118
|
+
* `true` (default) = inheritance walk (user-facing view).
|
|
119
|
+
* No-op for content-scoped bindings (rows only exist at
|
|
120
|
+
* project-level — there is no upward hierarchy to walk). Kept for
|
|
121
|
+
* uniformity: scope-aware bindings share one filter shape.
|
|
122
|
+
*/
|
|
123
|
+
readonly inherit?: boolean;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface MemoryFactPage {
|
|
127
|
+
readonly data: readonly Fact[];
|
|
128
|
+
readonly nextCursor?: Cursor;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// -------------------- get --------------------
|
|
132
|
+
|
|
133
|
+
export interface MemoryGetFactInput {
|
|
134
|
+
readonly tenantId: TenantId;
|
|
135
|
+
readonly factId: FactId;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// -------------------- write --------------------
|
|
139
|
+
|
|
140
|
+
export interface MemoryWriteFactInput {
|
|
141
|
+
/**
|
|
142
|
+
* The caller's tenant (from the token) — the tenant the fact is written
|
|
143
|
+
* to. The route rejects a `scope.tenantId` that differs from it, and an
|
|
144
|
+
* implementation must write under `tenantId`, never a tenant taken
|
|
145
|
+
* from `scope`.
|
|
146
|
+
*/
|
|
147
|
+
readonly tenantId: TenantId;
|
|
148
|
+
readonly type: string;
|
|
149
|
+
readonly scope: MemoryScope;
|
|
150
|
+
readonly content: unknown;
|
|
151
|
+
readonly retention?: Retention;
|
|
152
|
+
readonly contentHash?: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export type MemoryWriteFactOutcome =
|
|
156
|
+
| {
|
|
157
|
+
readonly kind: 'ok';
|
|
158
|
+
readonly fact: Fact;
|
|
159
|
+
}
|
|
160
|
+
| {
|
|
161
|
+
/**
|
|
162
|
+
* The type declared semantic indexing but the binding has no
|
|
163
|
+
* embedding registry (or the registry resolves no provider).
|
|
164
|
+
* Route maps to `400 bad-input`.
|
|
165
|
+
*/
|
|
166
|
+
readonly kind: 'embedding-unavailable';
|
|
167
|
+
readonly message: string;
|
|
168
|
+
}
|
|
169
|
+
| {
|
|
170
|
+
/** Any other write failure — persistence error, invalid content, etc. */
|
|
171
|
+
readonly kind: 'error';
|
|
172
|
+
readonly code: string;
|
|
173
|
+
readonly message: string;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// -------------------- supersede --------------------
|
|
177
|
+
|
|
178
|
+
export interface MemorySupersedeFactInput {
|
|
179
|
+
readonly tenantId: TenantId;
|
|
180
|
+
readonly factId: FactId;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface MemorySupersedeFactOutcome {
|
|
184
|
+
readonly superseded: boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// -------------------- retrieve --------------------
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Retrieval intent shape used on the wire. Mirrors the agent-side
|
|
191
|
+
* `RetrievalIntent` in `packages/agents/src/types.ts` but widened to
|
|
192
|
+
* accept explicit filters + limits — the agent path derives filters
|
|
193
|
+
* from `Conversation` context, while the direct-HTTP path takes them
|
|
194
|
+
* verbatim from the request body.
|
|
195
|
+
*/
|
|
196
|
+
export interface MemoryRetrieveIntent {
|
|
197
|
+
readonly mode: 'list' | 'keyword' | 'semantic' | 'both';
|
|
198
|
+
/**
|
|
199
|
+
* Freeform text query. Required for `keyword` / `semantic` / `both`;
|
|
200
|
+
* ignored for `list`.
|
|
201
|
+
*/
|
|
202
|
+
readonly query?: string;
|
|
203
|
+
/**
|
|
204
|
+
* Fact type filter. Passed through to the binding as a single-type
|
|
205
|
+
* lookup; multi-type queries call `retrieve` per type today.
|
|
206
|
+
*/
|
|
207
|
+
readonly type?: string;
|
|
208
|
+
/** Partial scope predicate. */
|
|
209
|
+
readonly scope?: Partial<MemoryScope>;
|
|
210
|
+
readonly limit?: number;
|
|
211
|
+
/** Selects a specific embedding provider registered on the binding. */
|
|
212
|
+
readonly embeddingModel?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface MemoryRetrieveInput {
|
|
216
|
+
readonly tenantId: TenantId;
|
|
217
|
+
readonly intent: MemoryRetrieveIntent;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface MemoryRetrievalHit {
|
|
221
|
+
readonly fact: Fact;
|
|
222
|
+
readonly score?: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type MemoryRetrieveOutcome =
|
|
226
|
+
| {
|
|
227
|
+
readonly kind: 'ok';
|
|
228
|
+
readonly results: readonly MemoryRetrievalHit[];
|
|
229
|
+
}
|
|
230
|
+
| {
|
|
231
|
+
/** Semantic mode requested but no embedding provider bound. */
|
|
232
|
+
readonly kind: 'embedding-unavailable';
|
|
233
|
+
readonly message: string;
|
|
234
|
+
}
|
|
235
|
+
| {
|
|
236
|
+
readonly kind: 'error';
|
|
237
|
+
readonly code: string;
|
|
238
|
+
readonly message: string;
|
|
239
|
+
};
|