@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,554 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
import type { Scope } from '@kindgi/platform';
|
|
5
|
+
import type {
|
|
6
|
+
AgentId,
|
|
7
|
+
ApprovalId,
|
|
8
|
+
Cursor,
|
|
9
|
+
FixProposalId,
|
|
10
|
+
ObservationId,
|
|
11
|
+
ProvenanceId,
|
|
12
|
+
RunId,
|
|
13
|
+
Semver,
|
|
14
|
+
SupervisorId,
|
|
15
|
+
TenantId,
|
|
16
|
+
Timestamp,
|
|
17
|
+
} from '@kindgi/types';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Caller-plugged surface for the supervisor's fix-proposal lifecycle
|
|
21
|
+
* + observation readback. Same shape as
|
|
22
|
+
* `AgentRegistryBinding` / `MemoryBinding` / `ReviewerBinding`: the API
|
|
23
|
+
* package does NOT own supervisor runtime, agent registry, HITL wiring,
|
|
24
|
+
* or eval invocation. A binding implementation composes:
|
|
25
|
+
*
|
|
26
|
+
* - the supervisor runtime (draft, dry-run, submit for review, apply,
|
|
27
|
+
* roll back, withdraw, list / get proposals, query observations);
|
|
28
|
+
* - its `Supervisor` registry (`supervisorId → Supervisor`);
|
|
29
|
+
* - its agent registry (for the dry-run baseline lookup + `apply`);
|
|
30
|
+
* - its eval dataset + judge registries and an agent-invocation
|
|
31
|
+
* closure (all needed by the dry-run);
|
|
32
|
+
* - its HITL surface (submitting for review enqueues an approval —
|
|
33
|
+
* the binding surfaces the resulting `ApprovalId` back to the route
|
|
34
|
+
* so the response body carries it).
|
|
35
|
+
*
|
|
36
|
+
* Every proposal method is tenant-scoped AND supervisor-scoped: callers
|
|
37
|
+
* pass both `tenantId` and `supervisorId`. `supervisorId` comes from the
|
|
38
|
+
* `X-Supervisor-Id` request header — tenant flows from the token,
|
|
39
|
+
* supervisor is a per-request scope the caller supplies.
|
|
40
|
+
*
|
|
41
|
+
* State transitions are enforced by the supervisor runtime
|
|
42
|
+
* (`invalid-transition` domain error). The route layer surfaces those
|
|
43
|
+
* as `409 conflict` with error code
|
|
44
|
+
* `proposal-invalid-state-transition` — out-of-order lifecycle calls
|
|
45
|
+
* are caller/state conflicts.
|
|
46
|
+
*
|
|
47
|
+
* `queryObservations` is the supervisor readback for `/v1/observations`
|
|
48
|
+
* — a straight paginated list over the observation stream. Tenant-scoped
|
|
49
|
+
* only; `supervisorId` is an optional filter, not a mount-time scope.
|
|
50
|
+
*/
|
|
51
|
+
export interface SupervisorBinding {
|
|
52
|
+
/**
|
|
53
|
+
* Cursor-paginated list of proposals scoped to `(tenantId,
|
|
54
|
+
* supervisorId)`. Filters:
|
|
55
|
+
* - `status` — single `FixProposalStatus` value.
|
|
56
|
+
* - `agentId` — exact match on target agent id.
|
|
57
|
+
* - `tier` — `'prompt' | 'retrieval' | 'tool-config'`.
|
|
58
|
+
*
|
|
59
|
+
* Sort order is binding-defined (for example `createdAt desc, id desc`).
|
|
60
|
+
*/
|
|
61
|
+
listProposals(input: SupervisorListProposalsInput): Promise<SupervisorProposalPage>;
|
|
62
|
+
/**
|
|
63
|
+
* Get a proposal by id, or `null` when unknown. The route surfaces
|
|
64
|
+
* `null` as `404 proposal-not-found`. The binding MUST also return
|
|
65
|
+
* `null` when the proposal exists but is not owned by the caller's
|
|
66
|
+
* supervisor id — cross-supervisor reads leak tier boundaries the
|
|
67
|
+
* same way cross-tenant reads leak resource existence (avoid via
|
|
68
|
+
* `null → 404` per `docs/API-ROUTE-CONVENTIONS.md` §2.4).
|
|
69
|
+
*/
|
|
70
|
+
getProposal(input: SupervisorGetProposalInput): Promise<FixProposal | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Draft a new proposal in `draft` state. The dedup fingerprint is
|
|
73
|
+
* computed from `(tier, agentId, agentVersion, canonical(change))`;
|
|
74
|
+
* duplicate proposals short-circuit to the existing non-terminal row —
|
|
75
|
+
* discriminated on `SupervisorDraftOutcome.kind`.
|
|
76
|
+
*/
|
|
77
|
+
draftProposal(input: SupervisorDraftProposalInput): Promise<SupervisorDraftOutcome>;
|
|
78
|
+
/**
|
|
79
|
+
* Trigger a dry-run for a proposal. A dry-run needs a dataset, judges,
|
|
80
|
+
* eval bindings and an agent-invocation closure — all of which the
|
|
81
|
+
* binding assembles from `input.datasetId` / `input.datasetVersion`
|
|
82
|
+
* and its own runtime wiring. Returns the updated proposal (`dry-run-passed` or
|
|
83
|
+
* `dry-run-failed`) or a discriminated error outcome so the route
|
|
84
|
+
* can map `invalid-transition` → `409` without touching the runtime
|
|
85
|
+
* error union directly.
|
|
86
|
+
*/
|
|
87
|
+
dryRunProposal(input: SupervisorDryRunProposalInput): Promise<SupervisorDryRunOutcome>;
|
|
88
|
+
/**
|
|
89
|
+
* Submit an approved dry-run proposal for HITL review. The binding
|
|
90
|
+
* forwards the resolved `Supervisor` (for ground-layer enforcement +
|
|
91
|
+
* meta-fix detection) and enqueues the approval. Returns the updated proposal (in
|
|
92
|
+
* `proposed-for-review` state) plus the created approval id so the
|
|
93
|
+
* route can surface it in the response body (the SDK correlates
|
|
94
|
+
* proposal → approval via that id).
|
|
95
|
+
*/
|
|
96
|
+
submitReview(input: SupervisorSubmitReviewInput): Promise<SupervisorSubmitReviewOutcome>;
|
|
97
|
+
/**
|
|
98
|
+
* Apply an `approved` proposal — registers a new agent version.
|
|
99
|
+
* Returns a minimal ack shape
|
|
100
|
+
* (`proposalId`, `appliedVersion`, `appliedAt`) rather than the
|
|
101
|
+
* full runtime result — the route body stays lean; callers who
|
|
102
|
+
* need the full `Agent` snapshot can `GET /v1/agents/:agentId`.
|
|
103
|
+
*/
|
|
104
|
+
applyProposal(input: SupervisorApplyProposalInput): Promise<SupervisorApplyOutcome>;
|
|
105
|
+
/**
|
|
106
|
+
* Roll back an `applied` proposal — unregisters the applied
|
|
107
|
+
* version from the agent registry + transitions to `rolled-back`.
|
|
108
|
+
*/
|
|
109
|
+
rollbackProposal(input: SupervisorRollbackProposalInput): Promise<SupervisorRollbackOutcome>;
|
|
110
|
+
/**
|
|
111
|
+
* Withdraw a non-terminal proposal. Legal from any of
|
|
112
|
+
* `draft | dry-running | dry-run-passed | dry-run-failed |
|
|
113
|
+
* proposed-for-review`. Terminal states surface as
|
|
114
|
+
* `invalid-transition` (which the route maps to 409).
|
|
115
|
+
*/
|
|
116
|
+
withdrawProposal(input: SupervisorWithdrawProposalInput): Promise<SupervisorWithdrawOutcome>;
|
|
117
|
+
/**
|
|
118
|
+
* Cursor-paginated observation readback for `/v1/observations`.
|
|
119
|
+
* Tenant-scoped; supervisor/agent/conversation/time-window filters
|
|
120
|
+
* are optional. Returns a discriminated `err` outcome for the runtime
|
|
121
|
+
* failure paths
|
|
122
|
+
* (persistence + envelope decode); the route surfaces those via
|
|
123
|
+
* `statusFor(code)`.
|
|
124
|
+
*/
|
|
125
|
+
queryObservations(
|
|
126
|
+
input: SupervisorQueryObservationsInput,
|
|
127
|
+
): Promise<SupervisorQueryObservationsOutcome>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ============ inputs ============
|
|
131
|
+
|
|
132
|
+
export interface SupervisorListProposalsInput {
|
|
133
|
+
readonly tenantId: TenantId;
|
|
134
|
+
readonly supervisorId: SupervisorId;
|
|
135
|
+
readonly limit: number;
|
|
136
|
+
readonly cursor?: Cursor;
|
|
137
|
+
readonly status?: FixProposalStatus;
|
|
138
|
+
readonly agentId?: AgentId;
|
|
139
|
+
readonly tier?: ProposedChange['tier'];
|
|
140
|
+
/**
|
|
141
|
+
* Narrow the list to a specific scope. Absent = no scope narrow
|
|
142
|
+
* (return every row in the tenant the caller can see — admin/audit
|
|
143
|
+
* default).
|
|
144
|
+
*
|
|
145
|
+
* Content-scoped semantics (this binding — fix-proposals attribute
|
|
146
|
+
* to the project of the agent they target):
|
|
147
|
+
* - `{ kind: 'project', projectId }` — rows in that project.
|
|
148
|
+
* - `{ kind: 'org', orgId }` — rows in every project belonging to
|
|
149
|
+
* that org.
|
|
150
|
+
* - `{ kind: 'tenant', tenantId }` — every row in the tenant.
|
|
151
|
+
*
|
|
152
|
+
* Proposals are content: every row belongs to a project, so `inherit`
|
|
153
|
+
* has no effect here.
|
|
154
|
+
*/
|
|
155
|
+
readonly scope?: Scope;
|
|
156
|
+
/**
|
|
157
|
+
* `false` = literal-at-this-scope only (admin/audit view).
|
|
158
|
+
* `true` (default) = inheritance walk (user-facing view).
|
|
159
|
+
* No-op for content-scoped bindings (rows only exist at
|
|
160
|
+
* project-level — there is no upward hierarchy to walk). Kept for
|
|
161
|
+
* uniformity: scope-aware bindings share one filter shape across the
|
|
162
|
+
* SDK and OpenAPI schemas.
|
|
163
|
+
*/
|
|
164
|
+
readonly inherit?: boolean;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface SupervisorGetProposalInput {
|
|
168
|
+
readonly tenantId: TenantId;
|
|
169
|
+
readonly supervisorId: SupervisorId;
|
|
170
|
+
readonly proposalId: FixProposalId;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface SupervisorDraftProposalInput {
|
|
174
|
+
readonly tenantId: TenantId;
|
|
175
|
+
readonly supervisorId: SupervisorId;
|
|
176
|
+
readonly agentId: AgentId;
|
|
177
|
+
readonly agentVersion: string;
|
|
178
|
+
readonly tier: ProposedChange['tier'];
|
|
179
|
+
readonly change: ProposedChange['change'];
|
|
180
|
+
readonly patternRefs: readonly PatternRef[];
|
|
181
|
+
readonly hypothesis: string;
|
|
182
|
+
readonly proposerRuleId: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface SupervisorDryRunProposalInput {
|
|
186
|
+
readonly tenantId: TenantId;
|
|
187
|
+
readonly supervisorId: SupervisorId;
|
|
188
|
+
readonly proposalId: FixProposalId;
|
|
189
|
+
/**
|
|
190
|
+
* Dataset the binding uses for the dry-run.
|
|
191
|
+
* The wire carries just `(datasetId, datasetVersion)` — the binding
|
|
192
|
+
* resolves both to the actual `Dataset<TInput, TExpected>` from its
|
|
193
|
+
* own registry.
|
|
194
|
+
*/
|
|
195
|
+
readonly datasetId: string;
|
|
196
|
+
readonly datasetVersion: string;
|
|
197
|
+
readonly criterion: PassCriterion;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface SupervisorSubmitReviewInput {
|
|
201
|
+
readonly tenantId: TenantId;
|
|
202
|
+
readonly supervisorId: SupervisorId;
|
|
203
|
+
readonly proposalId: FixProposalId;
|
|
204
|
+
readonly requiredRole?: 'standard' | 'senior' | 'admin';
|
|
205
|
+
readonly expiresAt?: Timestamp;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface SupervisorApplyProposalInput {
|
|
209
|
+
readonly tenantId: TenantId;
|
|
210
|
+
readonly supervisorId: SupervisorId;
|
|
211
|
+
readonly proposalId: FixProposalId;
|
|
212
|
+
readonly newVersion?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface SupervisorRollbackProposalInput {
|
|
216
|
+
readonly tenantId: TenantId;
|
|
217
|
+
readonly supervisorId: SupervisorId;
|
|
218
|
+
readonly proposalId: FixProposalId;
|
|
219
|
+
readonly reason: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface SupervisorWithdrawProposalInput {
|
|
223
|
+
readonly tenantId: TenantId;
|
|
224
|
+
readonly supervisorId: SupervisorId;
|
|
225
|
+
readonly proposalId: FixProposalId;
|
|
226
|
+
readonly reason: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Observation readback filter. Tenant-scoped; every other filter is
|
|
231
|
+
* optional. `since` / `until` bound `observedAt`; `cursor` is an opaque
|
|
232
|
+
* ISO timestamp from a prior page's `nextCursor`. `limit` is clamped by
|
|
233
|
+
* the binding.
|
|
234
|
+
*/
|
|
235
|
+
export interface SupervisorQueryObservationsInput {
|
|
236
|
+
readonly tenantId: TenantId;
|
|
237
|
+
readonly limit: number;
|
|
238
|
+
readonly cursor?: Cursor;
|
|
239
|
+
readonly status?: ObservationStatus;
|
|
240
|
+
readonly supervisorId?: SupervisorId;
|
|
241
|
+
readonly agentId?: AgentId;
|
|
242
|
+
readonly agentVersion?: Semver;
|
|
243
|
+
readonly conversationId?: RunId;
|
|
244
|
+
readonly since?: Timestamp;
|
|
245
|
+
readonly until?: Timestamp;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// ============ outputs ============
|
|
249
|
+
|
|
250
|
+
export interface SupervisorProposalPage {
|
|
251
|
+
readonly data: readonly FixProposal[];
|
|
252
|
+
readonly nextCursor?: Cursor;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Result of a draft attempt. Deduplication is by
|
|
257
|
+
* `(supervisorId, fingerprint)`:
|
|
258
|
+
*
|
|
259
|
+
* - `ok` — a new draft row was inserted.
|
|
260
|
+
* - `dedup` — an existing non-terminal proposal has the same
|
|
261
|
+
* fingerprint; caller can treat it as their own
|
|
262
|
+
* draft. `proposal` is the pre-existing row.
|
|
263
|
+
*/
|
|
264
|
+
export type SupervisorDraftOutcome =
|
|
265
|
+
| { readonly kind: 'ok'; readonly proposal: FixProposal }
|
|
266
|
+
| { readonly kind: 'dedup'; readonly proposal: FixProposal };
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Result of a dry-run attempt. `ok` carries the updated proposal
|
|
270
|
+
* (either `dry-run-passed` or `dry-run-failed` — both are legitimate
|
|
271
|
+
* outcomes; `failed` means "the criterion was not met," not "the
|
|
272
|
+
* request errored"). Failure outcomes surface as discriminated errors
|
|
273
|
+
* the route layer maps to specific HTTP statuses.
|
|
274
|
+
*/
|
|
275
|
+
export type SupervisorDryRunOutcome =
|
|
276
|
+
| { readonly kind: 'ok'; readonly proposal: FixProposal; readonly passed: boolean }
|
|
277
|
+
| { readonly kind: 'not-found'; readonly proposalId: FixProposalId }
|
|
278
|
+
| {
|
|
279
|
+
readonly kind: 'invalid-transition';
|
|
280
|
+
readonly proposalId: FixProposalId;
|
|
281
|
+
readonly from: FixProposalStatus;
|
|
282
|
+
readonly to: FixProposalStatus;
|
|
283
|
+
}
|
|
284
|
+
| {
|
|
285
|
+
/**
|
|
286
|
+
* Wire back `apply-change-failed` (change couldn't be applied
|
|
287
|
+
* against the current baseline), `baseline-mismatch` (proposal
|
|
288
|
+
* targets a stale version), or any other runtime failure. The
|
|
289
|
+
* route maps the code through `statusFor`: the two named codes are
|
|
290
|
+
* `422 unprocessable` (the request was well-formed but the domain
|
|
291
|
+
* state prevents dry-running); unknown codes are `500`.
|
|
292
|
+
*/
|
|
293
|
+
readonly kind: 'runtime-error';
|
|
294
|
+
readonly code: string;
|
|
295
|
+
readonly message: string;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export type SupervisorSubmitReviewOutcome =
|
|
299
|
+
| {
|
|
300
|
+
readonly kind: 'ok';
|
|
301
|
+
readonly proposal: FixProposal;
|
|
302
|
+
readonly approvalId: ApprovalId;
|
|
303
|
+
readonly metaFix: boolean;
|
|
304
|
+
}
|
|
305
|
+
| { readonly kind: 'not-found'; readonly proposalId: FixProposalId }
|
|
306
|
+
| {
|
|
307
|
+
readonly kind: 'invalid-transition';
|
|
308
|
+
readonly proposalId: FixProposalId;
|
|
309
|
+
readonly from: FixProposalStatus;
|
|
310
|
+
readonly to: FixProposalStatus;
|
|
311
|
+
}
|
|
312
|
+
| {
|
|
313
|
+
readonly kind: 'ground-layer-violation';
|
|
314
|
+
readonly proposalId: FixProposalId;
|
|
315
|
+
readonly guardrailId: string;
|
|
316
|
+
readonly reason: string;
|
|
317
|
+
}
|
|
318
|
+
| { readonly kind: 'runtime-error'; readonly code: string; readonly message: string };
|
|
319
|
+
|
|
320
|
+
export type SupervisorApplyOutcome =
|
|
321
|
+
| {
|
|
322
|
+
readonly kind: 'ok';
|
|
323
|
+
readonly proposalId: FixProposalId;
|
|
324
|
+
readonly appliedVersion: string;
|
|
325
|
+
readonly appliedAt: Timestamp;
|
|
326
|
+
}
|
|
327
|
+
| { readonly kind: 'not-found'; readonly proposalId: FixProposalId }
|
|
328
|
+
| {
|
|
329
|
+
readonly kind: 'invalid-transition';
|
|
330
|
+
readonly proposalId: FixProposalId;
|
|
331
|
+
readonly from: FixProposalStatus;
|
|
332
|
+
readonly to: FixProposalStatus;
|
|
333
|
+
}
|
|
334
|
+
| { readonly kind: 'runtime-error'; readonly code: string; readonly message: string };
|
|
335
|
+
|
|
336
|
+
export type SupervisorRollbackOutcome =
|
|
337
|
+
| {
|
|
338
|
+
readonly kind: 'ok';
|
|
339
|
+
readonly proposalId: FixProposalId;
|
|
340
|
+
readonly rolledBackAt: Timestamp;
|
|
341
|
+
}
|
|
342
|
+
| { readonly kind: 'not-found'; readonly proposalId: FixProposalId }
|
|
343
|
+
| {
|
|
344
|
+
readonly kind: 'invalid-transition';
|
|
345
|
+
readonly proposalId: FixProposalId;
|
|
346
|
+
readonly from: FixProposalStatus;
|
|
347
|
+
readonly to: FixProposalStatus;
|
|
348
|
+
}
|
|
349
|
+
| { readonly kind: 'runtime-error'; readonly code: string; readonly message: string };
|
|
350
|
+
|
|
351
|
+
export type SupervisorWithdrawOutcome =
|
|
352
|
+
| { readonly kind: 'ok'; readonly proposal: FixProposal }
|
|
353
|
+
| { readonly kind: 'not-found'; readonly proposalId: FixProposalId }
|
|
354
|
+
| {
|
|
355
|
+
readonly kind: 'invalid-transition';
|
|
356
|
+
readonly proposalId: FixProposalId;
|
|
357
|
+
readonly from: FixProposalStatus;
|
|
358
|
+
readonly to: FixProposalStatus;
|
|
359
|
+
}
|
|
360
|
+
| { readonly kind: 'runtime-error'; readonly code: string; readonly message: string };
|
|
361
|
+
|
|
362
|
+
export interface SupervisorObservationPage {
|
|
363
|
+
readonly data: readonly Observation[];
|
|
364
|
+
readonly nextCursor?: Cursor;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export type SupervisorQueryObservationsOutcome =
|
|
368
|
+
| { readonly kind: 'ok'; readonly page: SupervisorObservationPage }
|
|
369
|
+
| { readonly kind: 'runtime-error'; readonly code: string; readonly message: string };
|
|
370
|
+
|
|
371
|
+
// ============ wire types ============
|
|
372
|
+
//
|
|
373
|
+
// Every field the wire surfaces is declared here, so @kindgi/api does
|
|
374
|
+
// not depend on the supervisor runtime's own types. A binding
|
|
375
|
+
// implementation maps its types into these shapes.
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Lifecycle of a fix proposal.
|
|
379
|
+
*
|
|
380
|
+
* `draft` — initial state after `POST /v1/proposals`.
|
|
381
|
+
* `dry-running` — transient state while a dry-run executes.
|
|
382
|
+
* `dry-run-passed` / `dry-run-failed` — dry-run terminated with a
|
|
383
|
+
* criterion result. `failed` is a legitimate domain outcome, not an
|
|
384
|
+
* error.
|
|
385
|
+
* `proposed-for-review` — submitted for HITL. `reviewApprovalId` is set.
|
|
386
|
+
* `approved` / `rejected` — HITL terminal states.
|
|
387
|
+
* `applied` — the change materialized. `appliedVersion` + `appliedAt` set.
|
|
388
|
+
* `rolled-back` — a prior `applied` proposal was undone.
|
|
389
|
+
* `withdrawn` — the caller withdrew the proposal before terminal review.
|
|
390
|
+
*/
|
|
391
|
+
export type FixProposalStatus =
|
|
392
|
+
| 'draft'
|
|
393
|
+
| 'dry-running'
|
|
394
|
+
| 'dry-run-passed'
|
|
395
|
+
| 'dry-run-failed'
|
|
396
|
+
| 'proposed-for-review'
|
|
397
|
+
| 'approved'
|
|
398
|
+
| 'rejected'
|
|
399
|
+
| 'applied'
|
|
400
|
+
| 'rolled-back'
|
|
401
|
+
| 'withdrawn';
|
|
402
|
+
|
|
403
|
+
/** The aggregated fingerprint kind for a failure pattern. */
|
|
404
|
+
export type PatternKind =
|
|
405
|
+
| 'guardrail-violation'
|
|
406
|
+
| 'tool-error'
|
|
407
|
+
| 'budget-exceeded'
|
|
408
|
+
| 'model-error'
|
|
409
|
+
| 'aborted';
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* A change to an agent's prompt (the `instructions` string). Three
|
|
413
|
+
* kinds cover the common shapes. Extensible via the `kind` discriminant.
|
|
414
|
+
*/
|
|
415
|
+
export type PromptChange =
|
|
416
|
+
| { readonly kind: 'append'; readonly text: string }
|
|
417
|
+
| { readonly kind: 'replace-section'; readonly section: string; readonly newText: string }
|
|
418
|
+
| { readonly kind: 'replace'; readonly beforeText: string; readonly afterText: string };
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* A retrieval intent — mirror of `Agent.retrieval[]` shape.
|
|
422
|
+
*/
|
|
423
|
+
export interface RetrievalIntentShape {
|
|
424
|
+
readonly types: readonly string[];
|
|
425
|
+
readonly scope: 'same-conversation' | 'same-project' | 'tenant';
|
|
426
|
+
readonly limit?: number;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export type RetrievalChange =
|
|
430
|
+
| { readonly kind: 'add-intent'; readonly intent: RetrievalIntentShape }
|
|
431
|
+
| { readonly kind: 'remove-intent'; readonly index: number }
|
|
432
|
+
| {
|
|
433
|
+
readonly kind: 'replace-intent';
|
|
434
|
+
readonly index: number;
|
|
435
|
+
readonly intent: RetrievalIntentShape;
|
|
436
|
+
}
|
|
437
|
+
| { readonly kind: 'update-limit'; readonly index: number; readonly limit: number };
|
|
438
|
+
|
|
439
|
+
export type ToolConfigChange =
|
|
440
|
+
| {
|
|
441
|
+
readonly kind: 'add-tool';
|
|
442
|
+
readonly toolId: string;
|
|
443
|
+
readonly toolVersion: string;
|
|
444
|
+
}
|
|
445
|
+
| { readonly kind: 'remove-tool'; readonly toolId: string }
|
|
446
|
+
| {
|
|
447
|
+
readonly kind: 'set-tools';
|
|
448
|
+
readonly tools: readonly { readonly id: string; readonly version: string }[];
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* The change payload — polymorphic over tier.
|
|
453
|
+
*/
|
|
454
|
+
export type ProposedChange =
|
|
455
|
+
| { readonly tier: 'prompt'; readonly change: PromptChange }
|
|
456
|
+
| { readonly tier: 'retrieval'; readonly change: RetrievalChange }
|
|
457
|
+
| { readonly tier: 'tool-config'; readonly change: ToolConfigChange };
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* A reference to a failure pattern that motivated a proposal.
|
|
461
|
+
*/
|
|
462
|
+
export interface PatternRef {
|
|
463
|
+
readonly kind: PatternKind;
|
|
464
|
+
readonly key: string;
|
|
465
|
+
readonly count: number;
|
|
466
|
+
readonly firstSeenAt: Timestamp;
|
|
467
|
+
readonly lastSeenAt: Timestamp;
|
|
468
|
+
readonly sampleConversations: readonly RunId[];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* A fix proposal drafted by the supervisor. Every field is declared here
|
|
473
|
+
* so the API package does not depend on the supervisor runtime's types.
|
|
474
|
+
*/
|
|
475
|
+
export interface FixProposal {
|
|
476
|
+
readonly id: FixProposalId;
|
|
477
|
+
readonly tenantId: TenantId;
|
|
478
|
+
readonly supervisorId: SupervisorId;
|
|
479
|
+
readonly agentId: AgentId;
|
|
480
|
+
readonly agentVersion: string;
|
|
481
|
+
readonly tier: ProposedChange['tier'];
|
|
482
|
+
readonly change: ProposedChange['change'];
|
|
483
|
+
readonly patternRefs: readonly PatternRef[];
|
|
484
|
+
readonly hypothesis: string;
|
|
485
|
+
readonly proposerRuleId: string;
|
|
486
|
+
readonly status: FixProposalStatus;
|
|
487
|
+
readonly fingerprint: string;
|
|
488
|
+
readonly resolutionReason?: string;
|
|
489
|
+
readonly reviewApprovalId?: ApprovalId;
|
|
490
|
+
readonly appliedVersion?: string;
|
|
491
|
+
readonly appliedAt?: Timestamp;
|
|
492
|
+
readonly rolledBackAt?: Timestamp;
|
|
493
|
+
readonly createdAt: Timestamp;
|
|
494
|
+
readonly updatedAt: Timestamp;
|
|
495
|
+
readonly resolvedAt?: Timestamp;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Dry-run pass criterion. */
|
|
499
|
+
export type PassCriterion =
|
|
500
|
+
| { readonly kind: 'min-pass-rate'; readonly minPassRate: number }
|
|
501
|
+
| {
|
|
502
|
+
readonly kind: 'strict-improvement';
|
|
503
|
+
readonly baselinePassRate: number;
|
|
504
|
+
readonly minDelta: number;
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Classified outcome of an observed turn. The observations route
|
|
509
|
+
* validates the query param against this union.
|
|
510
|
+
*/
|
|
511
|
+
export type ObservationStatus =
|
|
512
|
+
| 'succeeded'
|
|
513
|
+
| 'guardrail-violation'
|
|
514
|
+
| 'guardrail-warning'
|
|
515
|
+
| 'tool-error'
|
|
516
|
+
| 'model-error'
|
|
517
|
+
| 'budget-exceeded'
|
|
518
|
+
| 'aborted'
|
|
519
|
+
| 'other';
|
|
520
|
+
|
|
521
|
+
export interface ObservedViolation {
|
|
522
|
+
readonly guardrailId: string;
|
|
523
|
+
readonly action: string;
|
|
524
|
+
readonly severity: string;
|
|
525
|
+
readonly passed: boolean;
|
|
526
|
+
readonly reason?: string;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Wire shape of a supervisor observation — the atomic unit persisted
|
|
531
|
+
* per observed agent turn. Serialized 1:1 into the `/v1/observations`
|
|
532
|
+
* response body.
|
|
533
|
+
*/
|
|
534
|
+
export interface Observation {
|
|
535
|
+
readonly id: ObservationId;
|
|
536
|
+
readonly tenantId: TenantId;
|
|
537
|
+
readonly supervisorId: SupervisorId;
|
|
538
|
+
readonly agentId: AgentId;
|
|
539
|
+
readonly agentVersion: string;
|
|
540
|
+
readonly conversationId: RunId;
|
|
541
|
+
readonly turnNumber: number;
|
|
542
|
+
readonly status: ObservationStatus;
|
|
543
|
+
readonly failureCode?: string;
|
|
544
|
+
readonly violations: readonly ObservedViolation[];
|
|
545
|
+
readonly failureDetail?: Readonly<Record<string, unknown>>;
|
|
546
|
+
readonly durationMs: number;
|
|
547
|
+
readonly costUsd: string;
|
|
548
|
+
readonly provider?: { readonly id: string; readonly model: string };
|
|
549
|
+
readonly provenanceRef?: {
|
|
550
|
+
readonly runId: RunId;
|
|
551
|
+
readonly provenanceId?: ProvenanceId;
|
|
552
|
+
};
|
|
553
|
+
readonly observedAt: Timestamp;
|
|
554
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* How far tenant configuration may reach into the server's own host:
|
|
6
|
+
* `KINDGI_TENANT_HOST_ACCESS`. A token holder registers things (MCP
|
|
7
|
+
* endpoints, providers, webhooks) the server then acts on; some of them
|
|
8
|
+
* can act on the host itself, which only a single-user machine should
|
|
9
|
+
* allow.
|
|
10
|
+
*
|
|
11
|
+
* - `local` (the default under `KINDGI_DEV`): a developer's machine.
|
|
12
|
+
* Tenant configuration may run commands on the host.
|
|
13
|
+
* - `deployed` (the default otherwise): a stdio MCP endpoint, which
|
|
14
|
+
* runs its command in the server's container as the server's user,
|
|
15
|
+
* is refused at registration and at connect; and the server's
|
|
16
|
+
* outbound calls to hosts a tenant chose (an MCP endpoint, a model
|
|
17
|
+
* provider's base URL, an HTTP tool, an image registry) refuse the
|
|
18
|
+
* cloud metadata endpoints and the server's own host.
|
|
19
|
+
*
|
|
20
|
+
* Checks ask `deniesHostReach(level, reach)`, never compare levels, so a
|
|
21
|
+
* stricter level (or a new kind of reach) is one more row or entry here.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** The levels, least strict first. */
|
|
25
|
+
export const TENANT_HOST_ACCESS_LEVELS = ['local', 'deployed'] as const;
|
|
26
|
+
|
|
27
|
+
export type TenantHostAccess = (typeof TENANT_HOST_ACCESS_LEVELS)[number];
|
|
28
|
+
|
|
29
|
+
/** What tenant configuration can make the server do on its own host. */
|
|
30
|
+
export type HostReach =
|
|
31
|
+
/** Run a command: a `stdio` MCP endpoint. */
|
|
32
|
+
| 'exec'
|
|
33
|
+
/**
|
|
34
|
+
* Connect to a link-local address (169.254.0.0/16, fe80::/10,
|
|
35
|
+
* fd00:ec2::254), where the cloud metadata endpoints hand out the
|
|
36
|
+
* server's own credentials.
|
|
37
|
+
*/
|
|
38
|
+
| 'metadata-network'
|
|
39
|
+
/** Connect to the server's own host: 127.0.0.0/8, ::1, 0.0.0.0/8, `::`. */
|
|
40
|
+
| 'loopback';
|
|
41
|
+
|
|
42
|
+
const DENIED: Readonly<Record<TenantHostAccess, ReadonlySet<HostReach>>> = {
|
|
43
|
+
local: new Set(),
|
|
44
|
+
deployed: new Set(['exec', 'metadata-network', 'loopback']),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** Whether `level` refuses tenant configuration that needs `reach`. */
|
|
48
|
+
export function deniesHostReach(level: TenantHostAccess, reach: HostReach): boolean {
|
|
49
|
+
return DENIED[level].has(reach);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** `value` as a level, or `undefined` when it isn't one. */
|
|
53
|
+
export function parseTenantHostAccess(value: string): TenantHostAccess | undefined {
|
|
54
|
+
return (TENANT_HOST_ACCESS_LEVELS as readonly string[]).includes(value)
|
|
55
|
+
? (value as TenantHostAccess)
|
|
56
|
+
: undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Why a stdio MCP endpoint is refused, the same at registration and at connect. */
|
|
60
|
+
export function stdioRefusal(endpointId: string): string {
|
|
61
|
+
return `MCP endpoint "${endpointId}" uses the stdio transport, which runs a command on the server's host; KINDGI_TENANT_HOST_ACCESS=deployed refuses that. Run the MCP server over HTTP (streamable-http) instead.`;
|
|
62
|
+
}
|