@wardby/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +131 -0
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +282 -0
- package/bin/wardby.js +3 -0
- package/deploy/local/docker-compose.yml +19 -0
- package/dist/claude-coding-worker/driver.d.ts +70 -0
- package/dist/claude-coding-worker/driver.js +128 -0
- package/dist/claude-coding-worker/main.d.ts +2 -0
- package/dist/claude-coding-worker/main.js +41 -0
- package/dist/claude-coding-worker/sdk.d.ts +4 -0
- package/dist/claude-coding-worker/sdk.js +43 -0
- package/dist/claude-coding-worker/tool-relay.d.ts +1 -0
- package/dist/claude-coding-worker/tool-relay.js +9 -0
- package/dist/cli-help.d.ts +1 -0
- package/dist/cli-help.js +20 -0
- package/dist/cli.d.ts +18 -0
- package/dist/cli.js +629 -0
- package/dist/coding/observability.d.ts +59 -0
- package/dist/coding/observability.js +77 -0
- package/dist/coding/profile.d.ts +88 -0
- package/dist/coding/profile.js +137 -0
- package/dist/coding/protocol.d.ts +345 -0
- package/dist/coding/protocol.js +445 -0
- package/dist/coding/provider.d.ts +4 -0
- package/dist/coding/provider.js +18 -0
- package/dist/coding-proxy/main.d.ts +1 -0
- package/dist/coding-proxy/main.js +51 -0
- package/dist/coding-worker/artifact.d.ts +16 -0
- package/dist/coding-worker/artifact.js +37 -0
- package/dist/coding-worker/driver.d.ts +46 -0
- package/dist/coding-worker/driver.js +158 -0
- package/dist/coding-worker/errors.d.ts +1 -0
- package/dist/coding-worker/errors.js +23 -0
- package/dist/coding-worker/isolation-probe.d.ts +1 -0
- package/dist/coding-worker/isolation-probe.js +146 -0
- package/dist/coding-worker/keeper.d.ts +4 -0
- package/dist/coding-worker/keeper.js +29 -0
- package/dist/coding-worker/main.d.ts +2 -0
- package/dist/coding-worker/main.js +43 -0
- package/dist/coding-worker/sdk.d.ts +26 -0
- package/dist/coding-worker/sdk.js +28 -0
- package/dist/coding-worker/types.d.ts +64 -0
- package/dist/coding-worker/types.js +1 -0
- package/dist/config/providers.d.ts +158 -0
- package/dist/config/providers.js +162 -0
- package/dist/core/budget-groups.d.ts +72 -0
- package/dist/core/budget-groups.js +149 -0
- package/dist/core/budget.d.ts +63 -0
- package/dist/core/budget.js +69 -0
- package/dist/core/coding-queue.d.ts +32 -0
- package/dist/core/coding-queue.js +54 -0
- package/dist/core/cron.d.ts +31 -0
- package/dist/core/cron.js +43 -0
- package/dist/core/datastores.d.ts +41 -0
- package/dist/core/datastores.js +105 -0
- package/dist/core/db.d.ts +2 -0
- package/dist/core/db.js +2 -0
- package/dist/core/dispatch.d.ts +81 -0
- package/dist/core/dispatch.js +184 -0
- package/dist/core/engine-native.d.ts +29 -0
- package/dist/core/engine-native.js +259 -0
- package/dist/core/http-runtime.d.ts +7 -0
- package/dist/core/http-runtime.js +101 -0
- package/dist/core/lease.d.ts +13 -0
- package/dist/core/lease.js +22 -0
- package/dist/core/logger.d.ts +13 -0
- package/dist/core/logger.js +45 -0
- package/dist/core/memory-tools.d.ts +11 -0
- package/dist/core/memory-tools.js +122 -0
- package/dist/core/reconciler.d.ts +45 -0
- package/dist/core/reconciler.js +152 -0
- package/dist/core/runner.d.ts +87 -0
- package/dist/core/runner.js +529 -0
- package/dist/core/scheduler.d.ts +47 -0
- package/dist/core/scheduler.js +121 -0
- package/dist/core/secrets.d.ts +46 -0
- package/dist/core/secrets.js +100 -0
- package/dist/core/subagent-memory-tools.d.ts +18 -0
- package/dist/core/subagent-memory-tools.js +121 -0
- package/dist/core/timing.d.ts +7 -0
- package/dist/core/timing.js +7 -0
- package/dist/core/webhooks.d.ts +23 -0
- package/dist/core/webhooks.js +113 -0
- package/dist/env.d.ts +11 -0
- package/dist/env.js +13 -0
- package/dist/import/budgets.d.ts +16 -0
- package/dist/import/budgets.js +21 -0
- package/dist/import/bundle.d.ts +16 -0
- package/dist/import/bundle.js +61 -0
- package/dist/import/cli-args.d.ts +2 -0
- package/dist/import/cli-args.js +44 -0
- package/dist/import/create.d.ts +34 -0
- package/dist/import/create.js +363 -0
- package/dist/import/index.d.ts +25 -0
- package/dist/import/index.js +130 -0
- package/dist/import/model-gate.d.ts +1 -0
- package/dist/import/model-gate.js +3 -0
- package/dist/import/neutral-schema.d.ts +369 -0
- package/dist/import/neutral-schema.js +109 -0
- package/dist/import/preflight.d.ts +41 -0
- package/dist/import/preflight.js +71 -0
- package/dist/import/report.d.ts +5 -0
- package/dist/import/report.js +98 -0
- package/dist/import/tool-scan.d.ts +8 -0
- package/dist/import/tool-scan.js +20 -0
- package/dist/mcp/auth/ownership.d.ts +113 -0
- package/dist/mcp/auth/ownership.js +87 -0
- package/dist/mcp/auth/principal.d.ts +9 -0
- package/dist/mcp/auth/principal.js +9 -0
- package/dist/mcp/auth/resource-server.d.ts +47 -0
- package/dist/mcp/auth/resource-server.js +82 -0
- package/dist/mcp/auth/self-hosted/browser.d.ts +3 -0
- package/dist/mcp/auth/self-hosted/browser.js +273 -0
- package/dist/mcp/auth/self-hosted/cli.d.ts +2 -0
- package/dist/mcp/auth/self-hosted/cli.js +39 -0
- package/dist/mcp/auth/self-hosted/credentials.d.ts +58 -0
- package/dist/mcp/auth/self-hosted/credentials.js +106 -0
- package/dist/mcp/auth/self-hosted/rate-limit.d.ts +13 -0
- package/dist/mcp/auth/self-hosted/rate-limit.js +20 -0
- package/dist/mcp/auth/self-hosted/session.d.ts +36 -0
- package/dist/mcp/auth/self-hosted/session.js +110 -0
- package/dist/mcp/capabilities.d.ts +11 -0
- package/dist/mcp/capabilities.js +10 -0
- package/dist/mcp/context.d.ts +46 -0
- package/dist/mcp/context.js +1 -0
- package/dist/mcp/errors.d.ts +13 -0
- package/dist/mcp/errors.js +22 -0
- package/dist/mcp/index.d.ts +32 -0
- package/dist/mcp/index.js +187 -0
- package/dist/mcp/jsonrpc.d.ts +8 -0
- package/dist/mcp/jsonrpc.js +1 -0
- package/dist/mcp/server.d.ts +107 -0
- package/dist/mcp/server.js +203 -0
- package/dist/mcp/tasks/manager.d.ts +63 -0
- package/dist/mcp/tasks/manager.js +103 -0
- package/dist/mcp/tools/agents.d.ts +2 -0
- package/dist/mcp/tools/agents.js +375 -0
- package/dist/mcp/tools/budget-groups.d.ts +2 -0
- package/dist/mcp/tools/budget-groups.js +136 -0
- package/dist/mcp/tools/datastore.d.ts +2 -0
- package/dist/mcp/tools/datastore.js +217 -0
- package/dist/mcp/tools/memory.d.ts +3 -0
- package/dist/mcp/tools/memory.js +60 -0
- package/dist/mcp/tools/models.d.ts +8 -0
- package/dist/mcp/tools/models.js +15 -0
- package/dist/mcp/tools/runs.d.ts +2 -0
- package/dist/mcp/tools/runs.js +61 -0
- package/dist/mcp/tools/scheduling.d.ts +2 -0
- package/dist/mcp/tools/scheduling.js +48 -0
- package/dist/mcp/tools/secret-elicitation-form.d.ts +22 -0
- package/dist/mcp/tools/secret-elicitation-form.js +93 -0
- package/dist/mcp/tools/secret-elicitation-server.d.ts +5 -0
- package/dist/mcp/tools/secret-elicitation-server.js +57 -0
- package/dist/mcp/tools/secret-elicitation.d.ts +38 -0
- package/dist/mcp/tools/secret-elicitation.js +52 -0
- package/dist/mcp/tools/secrets.d.ts +13 -0
- package/dist/mcp/tools/secrets.js +124 -0
- package/dist/mcp/tools/subagents.d.ts +2 -0
- package/dist/mcp/tools/subagents.js +133 -0
- package/dist/mcp/tools/text-result.d.ts +6 -0
- package/dist/mcp/tools/text-result.js +3 -0
- package/dist/mcp/tools/tools.d.ts +2 -0
- package/dist/mcp/tools/tools.js +211 -0
- package/dist/mcp/tools/trigger.d.ts +2 -0
- package/dist/mcp/tools/trigger.js +120 -0
- package/dist/mcp/tools/webhooks.d.ts +2 -0
- package/dist/mcp/tools/webhooks.js +34 -0
- package/dist/mcp/transport/http-limits.d.ts +17 -0
- package/dist/mcp/transport/http-limits.js +92 -0
- package/dist/mcp/transport/stdio.d.ts +23 -0
- package/dist/mcp/transport/stdio.js +6 -0
- package/dist/mcp/transport/streamable-http.d.ts +34 -0
- package/dist/mcp/transport/streamable-http.js +158 -0
- package/dist/mcp/unattended-schedules.d.ts +15 -0
- package/dist/mcp/unattended-schedules.js +21 -0
- package/dist/mcp/webhooks/ingress.d.ts +17 -0
- package/dist/mcp/webhooks/ingress.js +33 -0
- package/dist/observability/config.d.ts +6 -0
- package/dist/observability/config.js +20 -0
- package/dist/observability/metrics-server.d.ts +11 -0
- package/dist/observability/metrics-server.js +47 -0
- package/dist/observability/metrics.d.ts +36 -0
- package/dist/observability/metrics.js +158 -0
- package/dist/providers/auth/authorization-server.d.ts +41 -0
- package/dist/providers/auth/authorization-server.js +1 -0
- package/dist/providers/auth/delegating.d.ts +44 -0
- package/dist/providers/auth/delegating.js +105 -0
- package/dist/providers/auth/index.d.ts +11 -0
- package/dist/providers/auth/index.js +20 -0
- package/dist/providers/auth/release-gate.d.ts +1 -0
- package/dist/providers/auth/release-gate.js +4 -0
- package/dist/providers/auth/self-hosted.d.ts +78 -0
- package/dist/providers/auth/self-hosted.js +377 -0
- package/dist/providers/auth/subject.d.ts +1 -0
- package/dist/providers/auth/subject.js +6 -0
- package/dist/providers/auth/types.d.ts +63 -0
- package/dist/providers/auth/types.js +22 -0
- package/dist/providers/coding-proxy/deny-port.d.ts +5 -0
- package/dist/providers/coding-proxy/deny-port.js +45 -0
- package/dist/providers/coding-proxy/environment-credentials.d.ts +7 -0
- package/dist/providers/coding-proxy/environment-credentials.js +16 -0
- package/dist/providers/coding-proxy/index.d.ts +7 -0
- package/dist/providers/coding-proxy/index.js +7 -0
- package/dist/providers/coding-proxy/memory-ledger.d.ts +17 -0
- package/dist/providers/coding-proxy/memory-ledger.js +103 -0
- package/dist/providers/coding-proxy/metering.d.ts +20 -0
- package/dist/providers/coding-proxy/metering.js +161 -0
- package/dist/providers/coding-proxy/prisma-ledger.d.ts +15 -0
- package/dist/providers/coding-proxy/prisma-ledger.js +213 -0
- package/dist/providers/coding-proxy/proxy.d.ts +75 -0
- package/dist/providers/coding-proxy/proxy.js +721 -0
- package/dist/providers/coding-proxy/runtime.d.ts +18 -0
- package/dist/providers/coding-proxy/runtime.js +39 -0
- package/dist/providers/coding-proxy/secure-fetch.d.ts +9 -0
- package/dist/providers/coding-proxy/secure-fetch.js +72 -0
- package/dist/providers/coding-proxy/server.d.ts +17 -0
- package/dist/providers/coding-proxy/server.js +139 -0
- package/dist/providers/coding-proxy/types.d.ts +99 -0
- package/dist/providers/coding-proxy/types.js +1 -0
- package/dist/providers/datastore/index.d.ts +2 -0
- package/dist/providers/datastore/index.js +2 -0
- package/dist/providers/datastore/postgres.d.ts +20 -0
- package/dist/providers/datastore/postgres.js +130 -0
- package/dist/providers/datastore/scoped.d.ts +10 -0
- package/dist/providers/datastore/scoped.js +46 -0
- package/dist/providers/datastore/types.d.ts +31 -0
- package/dist/providers/datastore/types.js +7 -0
- package/dist/providers/email/types.d.ts +46 -0
- package/dist/providers/email/types.js +8 -0
- package/dist/providers/engine/index.d.ts +1 -0
- package/dist/providers/engine/index.js +1 -0
- package/dist/providers/engine/types.d.ts +67 -0
- package/dist/providers/engine/types.js +16 -0
- package/dist/providers/executor/build.d.ts +6 -0
- package/dist/providers/executor/build.js +15 -0
- package/dist/providers/executor/composition.d.ts +14 -0
- package/dist/providers/executor/composition.js +123 -0
- package/dist/providers/executor/container.d.ts +184 -0
- package/dist/providers/executor/container.js +936 -0
- package/dist/providers/executor/dbos-status.d.ts +50 -0
- package/dist/providers/executor/dbos-status.js +64 -0
- package/dist/providers/executor/dbos.d.ts +53 -0
- package/dist/providers/executor/dbos.js +269 -0
- package/dist/providers/executor/in-process.d.ts +18 -0
- package/dist/providers/executor/in-process.js +38 -0
- package/dist/providers/executor/index.d.ts +8 -0
- package/dist/providers/executor/index.js +8 -0
- package/dist/providers/executor/routing.d.ts +48 -0
- package/dist/providers/executor/routing.js +70 -0
- package/dist/providers/executor/types.d.ts +55 -0
- package/dist/providers/executor/types.js +1 -0
- package/dist/providers/index.d.ts +43 -0
- package/dist/providers/index.js +18 -0
- package/dist/providers/jobs/docker-isolation.d.ts +166 -0
- package/dist/providers/jobs/docker-isolation.js +724 -0
- package/dist/providers/jobs/docker.d.ts +127 -0
- package/dist/providers/jobs/docker.js +1027 -0
- package/dist/providers/jobs/fake-kubernetes-api.d.ts +98 -0
- package/dist/providers/jobs/fake-kubernetes-api.js +142 -0
- package/dist/providers/jobs/fake.d.ts +23 -0
- package/dist/providers/jobs/fake.js +132 -0
- package/dist/providers/jobs/kubernetes-api.d.ts +60 -0
- package/dist/providers/jobs/kubernetes-api.js +20 -0
- package/dist/providers/jobs/kubernetes-client.d.ts +36 -0
- package/dist/providers/jobs/kubernetes-client.js +171 -0
- package/dist/providers/jobs/kubernetes-dry-run-fixture.d.ts +49 -0
- package/dist/providers/jobs/kubernetes-dry-run-fixture.js +141 -0
- package/dist/providers/jobs/kubernetes-isolation.d.ts +147 -0
- package/dist/providers/jobs/kubernetes-isolation.js +607 -0
- package/dist/providers/jobs/kubernetes-platform.d.ts +177 -0
- package/dist/providers/jobs/kubernetes-platform.js +280 -0
- package/dist/providers/jobs/kubernetes-preflight.d.ts +59 -0
- package/dist/providers/jobs/kubernetes-preflight.js +339 -0
- package/dist/providers/jobs/kubernetes-witness.d.ts +10 -0
- package/dist/providers/jobs/kubernetes-witness.js +193 -0
- package/dist/providers/jobs/kubernetes.d.ts +127 -0
- package/dist/providers/jobs/kubernetes.js +874 -0
- package/dist/providers/jobs/safe-extract.d.ts +9 -0
- package/dist/providers/jobs/safe-extract.js +325 -0
- package/dist/providers/jobs/types.d.ts +78 -0
- package/dist/providers/jobs/types.js +6 -0
- package/dist/providers/jobs/workspace-swap.d.ts +2 -0
- package/dist/providers/jobs/workspace-swap.js +47 -0
- package/dist/providers/llm/anthropic.d.ts +13 -0
- package/dist/providers/llm/anthropic.js +21 -0
- package/dist/providers/llm/bedrock.d.ts +19 -0
- package/dist/providers/llm/bedrock.js +33 -0
- package/dist/providers/llm/claude-messages.d.ts +106 -0
- package/dist/providers/llm/claude-messages.js +157 -0
- package/dist/providers/llm/claude-provider.d.ts +40 -0
- package/dist/providers/llm/claude-provider.js +31 -0
- package/dist/providers/llm/index.d.ts +10 -0
- package/dist/providers/llm/index.js +10 -0
- package/dist/providers/llm/openai.d.ts +23 -0
- package/dist/providers/llm/openai.js +156 -0
- package/dist/providers/llm/pricing-anthropic.d.ts +4 -0
- package/dist/providers/llm/pricing-anthropic.js +30 -0
- package/dist/providers/llm/pricing-bedrock-claude.d.ts +12 -0
- package/dist/providers/llm/pricing-bedrock-claude.js +37 -0
- package/dist/providers/llm/pricing-core.d.ts +26 -0
- package/dist/providers/llm/pricing-core.js +17 -0
- package/dist/providers/llm/pricing.d.ts +30 -0
- package/dist/providers/llm/pricing.js +74 -0
- package/dist/providers/llm/registration.d.ts +8 -0
- package/dist/providers/llm/registration.js +39 -0
- package/dist/providers/llm/routing.d.ts +25 -0
- package/dist/providers/llm/routing.js +32 -0
- package/dist/providers/llm/types.d.ts +85 -0
- package/dist/providers/llm/types.js +12 -0
- package/dist/providers/memory/index.d.ts +2 -0
- package/dist/providers/memory/index.js +2 -0
- package/dist/providers/memory/postgres.d.ts +20 -0
- package/dist/providers/memory/postgres.js +72 -0
- package/dist/providers/memory/types.d.ts +32 -0
- package/dist/providers/memory/types.js +17 -0
- package/dist/providers/secrets/app-key.d.ts +8 -0
- package/dist/providers/secrets/app-key.js +50 -0
- package/dist/providers/secrets/index.d.ts +10 -0
- package/dist/providers/secrets/index.js +13 -0
- package/dist/providers/secrets/transfer-envelope.d.ts +12 -0
- package/dist/providers/secrets/transfer-envelope.js +35 -0
- package/dist/providers/secrets/types.d.ts +18 -0
- package/dist/providers/secrets/types.js +12 -0
- package/dist/providers/storage/types.d.ts +18 -0
- package/dist/providers/storage/types.js +7 -0
- package/dist/providers/vcs/git.d.ts +105 -0
- package/dist/providers/vcs/git.js +710 -0
- package/dist/providers/vcs/github.d.ts +105 -0
- package/dist/providers/vcs/github.js +394 -0
- package/dist/providers/vcs/index.d.ts +6 -0
- package/dist/providers/vcs/index.js +26 -0
- package/dist/providers/vcs/types.d.ts +118 -0
- package/dist/providers/vcs/types.js +1 -0
- package/dist/sandbox/bounded-json.d.ts +2 -0
- package/dist/sandbox/bounded-json.js +36 -0
- package/dist/sandbox/bridge.d.ts +15 -0
- package/dist/sandbox/bridge.js +78 -0
- package/dist/sandbox/eval-core.d.ts +37 -0
- package/dist/sandbox/eval-core.js +159 -0
- package/dist/sandbox/fetch-policy.d.ts +24 -0
- package/dist/sandbox/fetch-policy.js +96 -0
- package/dist/sandbox/generated/zod-to-json-schema.bundle.js +5 -0
- package/dist/sandbox/generated/zod.bundle.js +1 -0
- package/dist/sandbox/host-functions.d.ts +29 -0
- package/dist/sandbox/host-functions.js +168 -0
- package/dist/sandbox/limits.d.ts +39 -0
- package/dist/sandbox/limits.js +39 -0
- package/dist/sandbox/parser-worker/__fixtures__/crash.d.ts +1 -0
- package/dist/sandbox/parser-worker/__fixtures__/crash.js +6 -0
- package/dist/sandbox/parser-worker/__fixtures__/echo.d.ts +1 -0
- package/dist/sandbox/parser-worker/__fixtures__/echo.js +5 -0
- package/dist/sandbox/parser-worker/__fixtures__/reject.d.ts +1 -0
- package/dist/sandbox/parser-worker/__fixtures__/reject.js +5 -0
- package/dist/sandbox/parser-worker/__fixtures__/spin-forever.d.ts +1 -0
- package/dist/sandbox/parser-worker/__fixtures__/spin-forever.js +11 -0
- package/dist/sandbox/parser-worker/pool.d.ts +13 -0
- package/dist/sandbox/parser-worker/pool.js +111 -0
- package/dist/sandbox/parser-worker/worker.d.ts +14 -0
- package/dist/sandbox/parser-worker/worker.js +63 -0
- package/dist/sandbox/pii-redaction.d.ts +1 -0
- package/dist/sandbox/pii-redaction.js +29 -0
- package/dist/sandbox/prelude.d.ts +26 -0
- package/dist/sandbox/prelude.js +408 -0
- package/dist/sandbox/quickjs-module.d.ts +13 -0
- package/dist/sandbox/quickjs-module.js +19 -0
- package/dist/sandbox/run-in-sandbox.d.ts +34 -0
- package/dist/sandbox/run-in-sandbox.js +53 -0
- package/dist/sandbox/safe-fetch.d.ts +26 -0
- package/dist/sandbox/safe-fetch.js +140 -0
- package/dist/sandbox/tool-capabilities.d.ts +66 -0
- package/dist/sandbox/tool-capabilities.js +103 -0
- package/dist/sandbox/zod-params.d.ts +22 -0
- package/dist/sandbox/zod-params.js +60 -0
- package/dist/serve.d.ts +14 -0
- package/dist/serve.js +54 -0
- package/dist/wardby-bin.d.ts +2 -0
- package/dist/wardby-bin.js +20 -0
- package/package.json +123 -0
- package/prisma/migrations/20260905000000_init/migration.sql +34 -0
- package/prisma/migrations/20260905010000_scheduler_durability/migration.sql +31 -0
- package/prisma/migrations/20260905020000_tools_multiturn/migration.sql +47 -0
- package/prisma/migrations/20260905030000_cache_tool_json_schema/migration.sql +13 -0
- package/prisma/migrations/20260906000000_mcp_phase4/migration.sql +115 -0
- package/prisma/migrations/20260906010000_run_final_text/migration.sql +7 -0
- package/prisma/migrations/20260906020000_run_turns/migration.sql +6 -0
- package/prisma/migrations/20260906030000_task_principal_id/migration.sql +5 -0
- package/prisma/migrations/20260906040000_secure_self_hosted_oauth/migration.sql +67 -0
- package/prisma/migrations/20260906050000_phase5_coding_agents/migration.sql +52 -0
- package/prisma/migrations/20260906060000_tool_capability_scoping/migration.sql +22 -0
- package/prisma/migrations/20260906070000_datastore_pii_flag/migration.sql +6 -0
- package/prisma/migrations/20260906080000_secret_elicitation_outcomes/migration.sql +13 -0
- package/prisma/migrations/20260907010000_coding_proxy_ledger/migration.sql +57 -0
- package/prisma/migrations/20260907020000_budget_groups/migration.sql +24 -0
- package/prisma/migrations/20260907030000_coding_webhook_task_override/migration.sql +4 -0
- package/prisma/migrations/20260908010000_run_execution_backend/migration.sql +2 -0
- package/prisma/migrations/20260908020000_coding_run_audit_metadata/migration.sql +7 -0
- package/prisma/migrations/20260910010000_agent_secret_bound_name/migration.sql +16 -0
- package/prisma/migrations/20260911010000_coding_worker_toolchains/migration.sql +5 -0
- package/prisma/migrations/20260912010000_coding_provider_contract/migration.sql +24 -0
- package/prisma/migrations/20260912020000_coding_proxy_protocol/migration.sql +10 -0
- package/prisma/migrations/20260912030000_agent_memory/migration.sql +18 -0
- package/prisma/migrations/20260912040000_named_shared_datastores/migration.sql +68 -0
- package/prisma/migrations/20260913000000_run_trigger_webhook/migration.sql +2 -0
- package/prisma/migrations/20260913010000_agent_sub_agent/migration.sql +32 -0
- package/prisma/migrations/20260913020000_run_task_override/migration.sql +5 -0
- package/prisma/migrations/20260913030000_coding_run_root/migration.sql +11 -0
- package/prisma/migrations/20260922010000_coding_run_queued_at/migration.sql +8 -0
- package/prisma/migrations/20260922020000_coding_workspace_disk/migration.sql +8 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +723 -0
- package/scripts/git-askpass.sh +11 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CiphertextSchema: z.ZodObject<{
|
|
3
|
+
v: z.ZodNumber;
|
|
4
|
+
alg: z.ZodString;
|
|
5
|
+
epk: z.ZodString;
|
|
6
|
+
nonce: z.ZodString;
|
|
7
|
+
ct: z.ZodString;
|
|
8
|
+
tag: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
tag: string;
|
|
11
|
+
v: number;
|
|
12
|
+
alg: string;
|
|
13
|
+
epk: string;
|
|
14
|
+
nonce: string;
|
|
15
|
+
ct: string;
|
|
16
|
+
}, {
|
|
17
|
+
tag: string;
|
|
18
|
+
v: number;
|
|
19
|
+
alg: string;
|
|
20
|
+
epk: string;
|
|
21
|
+
nonce: string;
|
|
22
|
+
ct: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const ManifestSchema: z.ZodObject<{
|
|
25
|
+
bundleVersion: z.ZodNumber;
|
|
26
|
+
source: z.ZodObject<{
|
|
27
|
+
product: z.ZodString;
|
|
28
|
+
exporterVersion: z.ZodString;
|
|
29
|
+
exportedAt: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
product: string;
|
|
32
|
+
exporterVersion: string;
|
|
33
|
+
exportedAt: string;
|
|
34
|
+
}, {
|
|
35
|
+
product: string;
|
|
36
|
+
exporterVersion: string;
|
|
37
|
+
exportedAt: string;
|
|
38
|
+
}>;
|
|
39
|
+
secretMode: z.ZodEnum<["references", "envelope"]>;
|
|
40
|
+
transferKeyId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
contentWindowDays: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
42
|
+
contentSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
toolCallDetail: z.ZodDefault<z.ZodEnum<["metadata", "full"]>>;
|
|
44
|
+
runAuditWindowDays: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
+
runAuditSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
capabilities: z.ZodArray<z.ZodString, "many">;
|
|
47
|
+
counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
capabilities: string[];
|
|
50
|
+
bundleVersion: number;
|
|
51
|
+
source: {
|
|
52
|
+
product: string;
|
|
53
|
+
exporterVersion: string;
|
|
54
|
+
exportedAt: string;
|
|
55
|
+
};
|
|
56
|
+
secretMode: "references" | "envelope";
|
|
57
|
+
transferKeyId: string | null;
|
|
58
|
+
contentWindowDays: number | null;
|
|
59
|
+
contentSince: string | null;
|
|
60
|
+
toolCallDetail: "metadata" | "full";
|
|
61
|
+
runAuditWindowDays: number | null;
|
|
62
|
+
runAuditSince: string | null;
|
|
63
|
+
counts: Record<string, number>;
|
|
64
|
+
}, {
|
|
65
|
+
capabilities: string[];
|
|
66
|
+
bundleVersion: number;
|
|
67
|
+
source: {
|
|
68
|
+
product: string;
|
|
69
|
+
exporterVersion: string;
|
|
70
|
+
exportedAt: string;
|
|
71
|
+
};
|
|
72
|
+
secretMode: "references" | "envelope";
|
|
73
|
+
counts: Record<string, number>;
|
|
74
|
+
transferKeyId?: string | null | undefined;
|
|
75
|
+
contentWindowDays?: number | null | undefined;
|
|
76
|
+
contentSince?: string | null | undefined;
|
|
77
|
+
toolCallDetail?: "metadata" | "full" | undefined;
|
|
78
|
+
runAuditWindowDays?: number | null | undefined;
|
|
79
|
+
runAuditSince?: string | null | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
export type Manifest = z.infer<typeof ManifestSchema>;
|
|
82
|
+
export declare const NeutralAgentSchema: z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
systemPrompt: z.ZodString;
|
|
85
|
+
provider: z.ZodEnum<["openai", "bedrock"]>;
|
|
86
|
+
model: z.ZodString;
|
|
87
|
+
region: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
schedule: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
90
|
+
scheduleEnabled: z.ZodBoolean;
|
|
91
|
+
maxTurns: z.ZodNumber;
|
|
92
|
+
budgetUsd: z.ZodString;
|
|
93
|
+
ownerEmail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
kind: z.ZodDefault<z.ZodEnum<["native"]>>;
|
|
95
|
+
memoryEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
96
|
+
unmodeled: z.ZodDefault<z.ZodObject<{
|
|
97
|
+
description: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
98
|
+
slug: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
99
|
+
emailAllowlist: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodUnknown>>>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
description?: string | null | undefined;
|
|
102
|
+
slug?: string | null | undefined;
|
|
103
|
+
emailAllowlist?: unknown;
|
|
104
|
+
}, {
|
|
105
|
+
description?: string | null | undefined;
|
|
106
|
+
slug?: string | null | undefined;
|
|
107
|
+
emailAllowlist?: unknown;
|
|
108
|
+
}>>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
name: string;
|
|
111
|
+
model: string;
|
|
112
|
+
budgetUsd: string;
|
|
113
|
+
systemPrompt: string;
|
|
114
|
+
kind: "native";
|
|
115
|
+
schedule: string | null;
|
|
116
|
+
timezone: string;
|
|
117
|
+
scheduleEnabled: boolean;
|
|
118
|
+
maxTurns: number;
|
|
119
|
+
memoryEnabled: boolean;
|
|
120
|
+
provider: "openai" | "bedrock";
|
|
121
|
+
region: string | null;
|
|
122
|
+
ownerEmail: string | null;
|
|
123
|
+
unmodeled: {
|
|
124
|
+
description?: string | null | undefined;
|
|
125
|
+
slug?: string | null | undefined;
|
|
126
|
+
emailAllowlist?: unknown;
|
|
127
|
+
};
|
|
128
|
+
}, {
|
|
129
|
+
name: string;
|
|
130
|
+
model: string;
|
|
131
|
+
budgetUsd: string;
|
|
132
|
+
systemPrompt: string;
|
|
133
|
+
scheduleEnabled: boolean;
|
|
134
|
+
maxTurns: number;
|
|
135
|
+
provider: "openai" | "bedrock";
|
|
136
|
+
kind?: "native" | undefined;
|
|
137
|
+
schedule?: string | null | undefined;
|
|
138
|
+
timezone?: string | undefined;
|
|
139
|
+
memoryEnabled?: boolean | undefined;
|
|
140
|
+
region?: string | null | undefined;
|
|
141
|
+
ownerEmail?: string | null | undefined;
|
|
142
|
+
unmodeled?: {
|
|
143
|
+
description?: string | null | undefined;
|
|
144
|
+
slug?: string | null | undefined;
|
|
145
|
+
emailAllowlist?: unknown;
|
|
146
|
+
} | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
export type NeutralAgent = z.infer<typeof NeutralAgentSchema>;
|
|
149
|
+
export declare const NeutralToolSchema: z.ZodObject<{
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
description: z.ZodDefault<z.ZodString>;
|
|
152
|
+
paramsZod: z.ZodString;
|
|
153
|
+
jsonSchema: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
154
|
+
code: z.ZodString;
|
|
155
|
+
secretSchema: z.ZodDefault<z.ZodString>;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
name: string;
|
|
158
|
+
code: string;
|
|
159
|
+
description: string;
|
|
160
|
+
paramsZod: string;
|
|
161
|
+
secretSchema: string;
|
|
162
|
+
jsonSchema?: unknown;
|
|
163
|
+
}, {
|
|
164
|
+
name: string;
|
|
165
|
+
code: string;
|
|
166
|
+
paramsZod: string;
|
|
167
|
+
description?: string | undefined;
|
|
168
|
+
jsonSchema?: unknown;
|
|
169
|
+
secretSchema?: string | undefined;
|
|
170
|
+
}>;
|
|
171
|
+
export type NeutralTool = z.infer<typeof NeutralToolSchema>;
|
|
172
|
+
export declare const NeutralAgentToolSchema: z.ZodObject<{
|
|
173
|
+
agentName: z.ZodString;
|
|
174
|
+
toolName: z.ZodString;
|
|
175
|
+
allowedSecrets: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
176
|
+
allowedDatastorePrefixes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
177
|
+
allowedHosts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
178
|
+
allowedSharedDatastorePrefixes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
|
|
179
|
+
hostsSource: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
allowedSecrets: string[];
|
|
182
|
+
allowedDatastorePrefixes: string[];
|
|
183
|
+
allowedHosts: string[];
|
|
184
|
+
allowedSharedDatastorePrefixes: Record<string, string[]>;
|
|
185
|
+
agentName: string;
|
|
186
|
+
toolName: string;
|
|
187
|
+
hostsSource?: string | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
agentName: string;
|
|
190
|
+
toolName: string;
|
|
191
|
+
allowedSecrets?: string[] | undefined;
|
|
192
|
+
allowedDatastorePrefixes?: string[] | undefined;
|
|
193
|
+
allowedHosts?: string[] | undefined;
|
|
194
|
+
allowedSharedDatastorePrefixes?: Record<string, string[]> | undefined;
|
|
195
|
+
hostsSource?: string | undefined;
|
|
196
|
+
}>;
|
|
197
|
+
export type NeutralAgentTool = z.infer<typeof NeutralAgentToolSchema>;
|
|
198
|
+
export declare const NeutralSecretSchema: z.ZodObject<{
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
201
|
+
ownerEmail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
202
|
+
ciphertext: z.ZodOptional<z.ZodObject<{
|
|
203
|
+
v: z.ZodNumber;
|
|
204
|
+
alg: z.ZodString;
|
|
205
|
+
epk: z.ZodString;
|
|
206
|
+
nonce: z.ZodString;
|
|
207
|
+
ct: z.ZodString;
|
|
208
|
+
tag: z.ZodString;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
tag: string;
|
|
211
|
+
v: number;
|
|
212
|
+
alg: string;
|
|
213
|
+
epk: string;
|
|
214
|
+
nonce: string;
|
|
215
|
+
ct: string;
|
|
216
|
+
}, {
|
|
217
|
+
tag: string;
|
|
218
|
+
v: number;
|
|
219
|
+
alg: string;
|
|
220
|
+
epk: string;
|
|
221
|
+
nonce: string;
|
|
222
|
+
ct: string;
|
|
223
|
+
}>>;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
name: string;
|
|
226
|
+
description: string | null;
|
|
227
|
+
ownerEmail: string | null;
|
|
228
|
+
ciphertext?: {
|
|
229
|
+
tag: string;
|
|
230
|
+
v: number;
|
|
231
|
+
alg: string;
|
|
232
|
+
epk: string;
|
|
233
|
+
nonce: string;
|
|
234
|
+
ct: string;
|
|
235
|
+
} | undefined;
|
|
236
|
+
}, {
|
|
237
|
+
name: string;
|
|
238
|
+
ciphertext?: {
|
|
239
|
+
tag: string;
|
|
240
|
+
v: number;
|
|
241
|
+
alg: string;
|
|
242
|
+
epk: string;
|
|
243
|
+
nonce: string;
|
|
244
|
+
ct: string;
|
|
245
|
+
} | undefined;
|
|
246
|
+
description?: string | null | undefined;
|
|
247
|
+
ownerEmail?: string | null | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
export type NeutralSecret = z.infer<typeof NeutralSecretSchema>;
|
|
250
|
+
export declare const NeutralAgentSecretSchema: z.ZodObject<{
|
|
251
|
+
agentName: z.ZodString;
|
|
252
|
+
secretName: z.ZodString;
|
|
253
|
+
alias: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
254
|
+
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
agentName: string;
|
|
256
|
+
secretName: string;
|
|
257
|
+
alias: string | null;
|
|
258
|
+
}, {
|
|
259
|
+
agentName: string;
|
|
260
|
+
secretName: string;
|
|
261
|
+
alias?: string | null | undefined;
|
|
262
|
+
}>;
|
|
263
|
+
export type NeutralAgentSecret = z.infer<typeof NeutralAgentSecretSchema>;
|
|
264
|
+
export declare const NeutralSingleDatastoreSchema: z.ZodObject<{
|
|
265
|
+
agentName: z.ZodString;
|
|
266
|
+
name: z.ZodOptional<z.ZodString>;
|
|
267
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
268
|
+
key: z.ZodString;
|
|
269
|
+
value: z.ZodUnknown;
|
|
270
|
+
pii: z.ZodDefault<z.ZodBoolean>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
key: string;
|
|
273
|
+
pii: boolean;
|
|
274
|
+
value?: unknown;
|
|
275
|
+
}, {
|
|
276
|
+
key: string;
|
|
277
|
+
value?: unknown;
|
|
278
|
+
pii?: boolean | undefined;
|
|
279
|
+
}>, "many">>;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
entries: {
|
|
282
|
+
key: string;
|
|
283
|
+
pii: boolean;
|
|
284
|
+
value?: unknown;
|
|
285
|
+
}[];
|
|
286
|
+
agentName: string;
|
|
287
|
+
name?: string | undefined;
|
|
288
|
+
}, {
|
|
289
|
+
agentName: string;
|
|
290
|
+
name?: string | undefined;
|
|
291
|
+
entries?: {
|
|
292
|
+
key: string;
|
|
293
|
+
value?: unknown;
|
|
294
|
+
pii?: boolean | undefined;
|
|
295
|
+
}[] | undefined;
|
|
296
|
+
}>;
|
|
297
|
+
export type NeutralSingleDatastore = z.infer<typeof NeutralSingleDatastoreSchema>;
|
|
298
|
+
export declare const NeutralSharedDatastoreSchema: z.ZodObject<{
|
|
299
|
+
name: z.ZodString;
|
|
300
|
+
ownerEmail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
301
|
+
attachedAgentNames: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
302
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
303
|
+
key: z.ZodString;
|
|
304
|
+
value: z.ZodUnknown;
|
|
305
|
+
}, "strip", z.ZodTypeAny, {
|
|
306
|
+
key: string;
|
|
307
|
+
value?: unknown;
|
|
308
|
+
}, {
|
|
309
|
+
key: string;
|
|
310
|
+
value?: unknown;
|
|
311
|
+
}>, "many">>;
|
|
312
|
+
}, "strip", z.ZodTypeAny, {
|
|
313
|
+
name: string;
|
|
314
|
+
entries: {
|
|
315
|
+
key: string;
|
|
316
|
+
value?: unknown;
|
|
317
|
+
}[];
|
|
318
|
+
ownerEmail: string | null;
|
|
319
|
+
attachedAgentNames: string[];
|
|
320
|
+
}, {
|
|
321
|
+
name: string;
|
|
322
|
+
entries?: {
|
|
323
|
+
key: string;
|
|
324
|
+
value?: unknown;
|
|
325
|
+
}[] | undefined;
|
|
326
|
+
ownerEmail?: string | null | undefined;
|
|
327
|
+
attachedAgentNames?: string[] | undefined;
|
|
328
|
+
}>;
|
|
329
|
+
export type NeutralSharedDatastore = z.infer<typeof NeutralSharedDatastoreSchema>;
|
|
330
|
+
export declare const NeutralWebhookSchema: z.ZodObject<{
|
|
331
|
+
agentName: z.ZodString;
|
|
332
|
+
enabled: z.ZodBoolean;
|
|
333
|
+
}, "strip", z.ZodTypeAny, {
|
|
334
|
+
agentName: string;
|
|
335
|
+
enabled: boolean;
|
|
336
|
+
}, {
|
|
337
|
+
agentName: string;
|
|
338
|
+
enabled: boolean;
|
|
339
|
+
}>;
|
|
340
|
+
export type NeutralWebhook = z.infer<typeof NeutralWebhookSchema>;
|
|
341
|
+
export declare const NeutralBudgetSchema: z.ZodObject<{
|
|
342
|
+
name: z.ZodString;
|
|
343
|
+
ownerEmail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
344
|
+
period: z.ZodEnum<["daily", "weekly", "monthly"]>;
|
|
345
|
+
alertThreshold: z.ZodString;
|
|
346
|
+
blockThreshold: z.ZodString;
|
|
347
|
+
alertEmails: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
348
|
+
enabled: z.ZodBoolean;
|
|
349
|
+
attachedAgentNames: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
350
|
+
}, "strip", z.ZodTypeAny, {
|
|
351
|
+
name: string;
|
|
352
|
+
period: "daily" | "weekly" | "monthly";
|
|
353
|
+
enabled: boolean;
|
|
354
|
+
ownerEmail: string | null;
|
|
355
|
+
attachedAgentNames: string[];
|
|
356
|
+
alertThreshold: string;
|
|
357
|
+
blockThreshold: string;
|
|
358
|
+
alertEmails: string[];
|
|
359
|
+
}, {
|
|
360
|
+
name: string;
|
|
361
|
+
period: "daily" | "weekly" | "monthly";
|
|
362
|
+
enabled: boolean;
|
|
363
|
+
alertThreshold: string;
|
|
364
|
+
blockThreshold: string;
|
|
365
|
+
ownerEmail?: string | null | undefined;
|
|
366
|
+
attachedAgentNames?: string[] | undefined;
|
|
367
|
+
alertEmails?: string[] | undefined;
|
|
368
|
+
}>;
|
|
369
|
+
export type NeutralBudget = z.infer<typeof NeutralBudgetSchema>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const CiphertextSchema = z.object({
|
|
3
|
+
v: z.number(),
|
|
4
|
+
alg: z.string(),
|
|
5
|
+
epk: z.string(),
|
|
6
|
+
nonce: z.string(),
|
|
7
|
+
ct: z.string(),
|
|
8
|
+
tag: z.string(),
|
|
9
|
+
});
|
|
10
|
+
export const ManifestSchema = z.object({
|
|
11
|
+
bundleVersion: z.number(),
|
|
12
|
+
source: z.object({ product: z.string(), exporterVersion: z.string(), exportedAt: z.string() }),
|
|
13
|
+
secretMode: z.enum(["references", "envelope"]),
|
|
14
|
+
transferKeyId: z.string().nullable().default(null),
|
|
15
|
+
contentWindowDays: z.number().nullable().default(null),
|
|
16
|
+
contentSince: z.string().nullable().default(null),
|
|
17
|
+
toolCallDetail: z.enum(["metadata", "full"]).default("metadata"),
|
|
18
|
+
runAuditWindowDays: z.number().nullable().default(null),
|
|
19
|
+
runAuditSince: z.string().nullable().default(null),
|
|
20
|
+
capabilities: z.array(z.string()),
|
|
21
|
+
counts: z.record(z.string(), z.number()),
|
|
22
|
+
});
|
|
23
|
+
export const NeutralAgentSchema = z.object({
|
|
24
|
+
name: z.string(),
|
|
25
|
+
systemPrompt: z.string(),
|
|
26
|
+
provider: z.enum(["openai", "bedrock"]),
|
|
27
|
+
model: z.string(),
|
|
28
|
+
region: z.string().nullable().default(null),
|
|
29
|
+
schedule: z.string().nullable().default(null), // "" or null both mean manual-only
|
|
30
|
+
timezone: z.string().default("UTC"),
|
|
31
|
+
scheduleEnabled: z.boolean(),
|
|
32
|
+
maxTurns: z.number().int(),
|
|
33
|
+
budgetUsd: z.string(),
|
|
34
|
+
ownerEmail: z.string().nullable().default(null),
|
|
35
|
+
kind: z.enum(["native"]).default("native"),
|
|
36
|
+
memoryEnabled: z.boolean().default(false),
|
|
37
|
+
unmodeled: z
|
|
38
|
+
.object({
|
|
39
|
+
description: z.string().nullable().default(null),
|
|
40
|
+
slug: z.string().nullable().default(null),
|
|
41
|
+
emailAllowlist: z.unknown().nullable().default(null),
|
|
42
|
+
})
|
|
43
|
+
.partial()
|
|
44
|
+
.default({}),
|
|
45
|
+
});
|
|
46
|
+
export const NeutralToolSchema = z.object({
|
|
47
|
+
name: z.string(),
|
|
48
|
+
description: z.string().default(""),
|
|
49
|
+
paramsZod: z.string(),
|
|
50
|
+
jsonSchema: z.unknown().nullable().default(null), // ignored; we re-derive (ruling 2)
|
|
51
|
+
code: z.string(),
|
|
52
|
+
secretSchema: z.string().default(""),
|
|
53
|
+
});
|
|
54
|
+
export const NeutralAgentToolSchema = z.object({
|
|
55
|
+
agentName: z.string(),
|
|
56
|
+
toolName: z.string(),
|
|
57
|
+
allowedSecrets: z.array(z.string()).default([]),
|
|
58
|
+
allowedDatastorePrefixes: z.array(z.string()).default([]),
|
|
59
|
+
allowedHosts: z.array(z.string()).default([]),
|
|
60
|
+
allowedSharedDatastorePrefixes: z.record(z.string(), z.array(z.string())).default({}),
|
|
61
|
+
hostsSource: z.string().optional(),
|
|
62
|
+
});
|
|
63
|
+
export const NeutralSecretSchema = z.object({
|
|
64
|
+
name: z.string(),
|
|
65
|
+
description: z.string().nullable().default(null),
|
|
66
|
+
ownerEmail: z.string().nullable().default(null),
|
|
67
|
+
ciphertext: CiphertextSchema.optional(),
|
|
68
|
+
});
|
|
69
|
+
export const NeutralAgentSecretSchema = z.object({
|
|
70
|
+
agentName: z.string(),
|
|
71
|
+
secretName: z.string(),
|
|
72
|
+
alias: z.string().nullable().default(null),
|
|
73
|
+
});
|
|
74
|
+
export const NeutralSingleDatastoreSchema = z.object({
|
|
75
|
+
agentName: z.string(),
|
|
76
|
+
name: z.string().optional(),
|
|
77
|
+
entries: z
|
|
78
|
+
.array(z.object({
|
|
79
|
+
key: z.string(),
|
|
80
|
+
value: z.unknown(),
|
|
81
|
+
pii: z.boolean().default(false),
|
|
82
|
+
}))
|
|
83
|
+
.default([]),
|
|
84
|
+
});
|
|
85
|
+
export const NeutralSharedDatastoreSchema = z.object({
|
|
86
|
+
name: z.string(),
|
|
87
|
+
ownerEmail: z.string().nullable().default(null),
|
|
88
|
+
attachedAgentNames: z.array(z.string()).default([]),
|
|
89
|
+
entries: z
|
|
90
|
+
.array(z.object({
|
|
91
|
+
key: z.string(),
|
|
92
|
+
value: z.unknown(),
|
|
93
|
+
}))
|
|
94
|
+
.default([]),
|
|
95
|
+
});
|
|
96
|
+
export const NeutralWebhookSchema = z.object({
|
|
97
|
+
agentName: z.string(),
|
|
98
|
+
enabled: z.boolean(),
|
|
99
|
+
});
|
|
100
|
+
export const NeutralBudgetSchema = z.object({
|
|
101
|
+
name: z.string(),
|
|
102
|
+
ownerEmail: z.string().nullable().default(null),
|
|
103
|
+
period: z.enum(["daily", "weekly", "monthly"]),
|
|
104
|
+
alertThreshold: z.string(),
|
|
105
|
+
blockThreshold: z.string(),
|
|
106
|
+
alertEmails: z.array(z.string()).default([]),
|
|
107
|
+
enabled: z.boolean(),
|
|
108
|
+
attachedAgentNames: z.array(z.string()).default([]),
|
|
109
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Bundle } from "./bundle.js";
|
|
2
|
+
export type ConflictPolicy = "fail" | "skip" | "rename";
|
|
3
|
+
export interface PreflightInput {
|
|
4
|
+
bundle: Bundle;
|
|
5
|
+
routableModels: ReadonlySet<string>;
|
|
6
|
+
supportedGlobals: ReadonlySet<string>;
|
|
7
|
+
existingAgentNames: ReadonlySet<string>;
|
|
8
|
+
existingToolNames: ReadonlySet<string>;
|
|
9
|
+
capabilitiesSupported: ReadonlySet<string>;
|
|
10
|
+
onConflict: ConflictPolicy;
|
|
11
|
+
prefix: string;
|
|
12
|
+
allowOpenFetch: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface Reconciliation {
|
|
15
|
+
nameRemap: Map<string, string>;
|
|
16
|
+
agents: {
|
|
17
|
+
name: string;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
disabledReason?: string;
|
|
20
|
+
skipped?: string;
|
|
21
|
+
}[];
|
|
22
|
+
tools: {
|
|
23
|
+
name: string;
|
|
24
|
+
rejected?: string;
|
|
25
|
+
skipped?: string;
|
|
26
|
+
}[];
|
|
27
|
+
skippedCapabilities: string[];
|
|
28
|
+
budgets: {
|
|
29
|
+
name: string;
|
|
30
|
+
skippedReason?: string;
|
|
31
|
+
}[];
|
|
32
|
+
collisions: {
|
|
33
|
+
kind: "agent" | "tool";
|
|
34
|
+
name: string;
|
|
35
|
+
action: ConflictPolicy;
|
|
36
|
+
newName?: string;
|
|
37
|
+
}[];
|
|
38
|
+
notes: string[];
|
|
39
|
+
hasFatalCollision: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare function preflight(input: PreflightInput): Reconciliation;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { classifyModel } from "./model-gate.js";
|
|
2
|
+
import { scanToolCode } from "./tool-scan.js";
|
|
3
|
+
import { mapBudget } from "./budgets.js";
|
|
4
|
+
export function preflight(input) {
|
|
5
|
+
const { bundle, onConflict, prefix } = input;
|
|
6
|
+
const nameRemap = new Map();
|
|
7
|
+
const collisions = [];
|
|
8
|
+
const notes = [];
|
|
9
|
+
let hasFatalCollision = false;
|
|
10
|
+
const resolveCollision = (kind, name, existing) => {
|
|
11
|
+
if (!existing.has(name))
|
|
12
|
+
return { skipped: undefined };
|
|
13
|
+
if (onConflict === "fail") {
|
|
14
|
+
hasFatalCollision = true;
|
|
15
|
+
collisions.push({ kind, name, action: "fail" });
|
|
16
|
+
return { skipped: "collision" };
|
|
17
|
+
}
|
|
18
|
+
if (onConflict === "skip") {
|
|
19
|
+
collisions.push({ kind, name, action: "skip" });
|
|
20
|
+
return { skipped: "collision" };
|
|
21
|
+
}
|
|
22
|
+
const newName = prefix + name;
|
|
23
|
+
// Rename target must itself be free; otherwise the upsert would adopt an
|
|
24
|
+
// unrelated pre-existing row. Treat an occupied target as a fatal collision.
|
|
25
|
+
if (existing.has(newName)) {
|
|
26
|
+
hasFatalCollision = true;
|
|
27
|
+
collisions.push({ kind, name, action: "fail" });
|
|
28
|
+
notes.push(`${kind} ${name}: rename target "${newName}" already exists — cannot resolve collision`);
|
|
29
|
+
return { skipped: "collision" };
|
|
30
|
+
}
|
|
31
|
+
nameRemap.set(name, newName);
|
|
32
|
+
collisions.push({ kind, name, action: "rename", newName });
|
|
33
|
+
return { skipped: undefined };
|
|
34
|
+
};
|
|
35
|
+
const agents = bundle.readAgents().map((a) => {
|
|
36
|
+
const c = resolveCollision("agent", a.name, input.existingAgentNames);
|
|
37
|
+
if (c.skipped === "collision")
|
|
38
|
+
return { name: a.name, disabled: false, skipped: "collision" };
|
|
39
|
+
const routable = classifyModel(a.model, input.routableModels) === "routable";
|
|
40
|
+
// Controller Ruling B: disabled flag reflects MODEL ROUTABILITY ONLY
|
|
41
|
+
return routable
|
|
42
|
+
? { name: a.name, disabled: false }
|
|
43
|
+
: {
|
|
44
|
+
name: a.name,
|
|
45
|
+
disabled: true,
|
|
46
|
+
disabledReason: `model ${a.model} not routable — no registered provider serves it`,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
const tools = bundle.readTools().map((t) => {
|
|
50
|
+
const c = resolveCollision("tool", t.name, input.existingToolNames);
|
|
51
|
+
if (c.skipped === "collision")
|
|
52
|
+
return { name: t.name, skipped: "collision" };
|
|
53
|
+
const scan = scanToolCode(t.code, input.supportedGlobals);
|
|
54
|
+
return scan.ok
|
|
55
|
+
? { name: t.name }
|
|
56
|
+
: { name: t.name, rejected: `uses unsupported host API: ${scan.rejectedApis.join(", ")}` };
|
|
57
|
+
});
|
|
58
|
+
const skippedCapabilities = bundle.manifest.capabilities.filter((c) => !input.capabilitiesSupported.has(c));
|
|
59
|
+
const budgets = bundle.readBudgets().map((b) => {
|
|
60
|
+
const m = mapBudget(b);
|
|
61
|
+
return m.ok ? { name: b.name } : { name: b.name, skippedReason: m.reason };
|
|
62
|
+
});
|
|
63
|
+
if (!input.allowOpenFetch) {
|
|
64
|
+
for (const at of bundle.readAgentTools()) {
|
|
65
|
+
if (at.allowedHosts.includes("*")) {
|
|
66
|
+
notes.push(`agent-tool ${at.agentName}/${at.toolName}: "*" host dropped (no --allow-open-fetch)`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return { nameRemap, agents, tools, skippedCapabilities, budgets, collisions, notes, hasFatalCollision };
|
|
71
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export function renderReconciliation(r, opts) {
|
|
2
|
+
const lines = [];
|
|
3
|
+
// Dry run banner
|
|
4
|
+
if (opts.dryRun) {
|
|
5
|
+
lines.push("DRY RUN — no changes written");
|
|
6
|
+
lines.push("");
|
|
7
|
+
}
|
|
8
|
+
// Secret mode notice
|
|
9
|
+
lines.push(`Secret mode: ${opts.secretMode}`);
|
|
10
|
+
lines.push("");
|
|
11
|
+
// Agents
|
|
12
|
+
lines.push("Agents:");
|
|
13
|
+
const disabledAgents = r.agents.filter((a) => a.disabled || a.skipped);
|
|
14
|
+
if (disabledAgents.length > 0) {
|
|
15
|
+
for (const a of disabledAgents) {
|
|
16
|
+
if (a.disabled && a.disabledReason) {
|
|
17
|
+
lines.push(` - ${a.name} (disabled): ${a.disabledReason}`);
|
|
18
|
+
}
|
|
19
|
+
else if (a.skipped) {
|
|
20
|
+
lines.push(` - ${a.name}: skipped (${a.skipped})`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
lines.push(" (all agents importable)");
|
|
26
|
+
}
|
|
27
|
+
lines.push("");
|
|
28
|
+
// Tools
|
|
29
|
+
lines.push("Tools:");
|
|
30
|
+
const rejectedTools = r.tools.filter((t) => t.rejected || t.skipped);
|
|
31
|
+
if (rejectedTools.length > 0) {
|
|
32
|
+
for (const t of rejectedTools) {
|
|
33
|
+
if (t.rejected) {
|
|
34
|
+
lines.push(` - ${t.name} (rejected): ${t.rejected}`);
|
|
35
|
+
}
|
|
36
|
+
else if (t.skipped) {
|
|
37
|
+
lines.push(` - ${t.name}: skipped (${t.skipped})`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
lines.push(" (all tools importable)");
|
|
43
|
+
}
|
|
44
|
+
lines.push("");
|
|
45
|
+
// Skipped capabilities
|
|
46
|
+
lines.push("Skipped capabilities:");
|
|
47
|
+
if (r.skippedCapabilities.length > 0) {
|
|
48
|
+
for (const cap of r.skippedCapabilities) {
|
|
49
|
+
lines.push(` - ${cap}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
lines.push(" (none)");
|
|
54
|
+
}
|
|
55
|
+
lines.push("");
|
|
56
|
+
// Budgets
|
|
57
|
+
lines.push("Budgets:");
|
|
58
|
+
const skippedBudgets = r.budgets.filter((b) => b.skippedReason);
|
|
59
|
+
if (skippedBudgets.length > 0) {
|
|
60
|
+
for (const b of skippedBudgets) {
|
|
61
|
+
lines.push(` - ${b.name}: skipped (${b.skippedReason})`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
lines.push(" (all budgets importable)");
|
|
66
|
+
}
|
|
67
|
+
lines.push("");
|
|
68
|
+
// Collisions
|
|
69
|
+
lines.push("Collisions:");
|
|
70
|
+
if (r.collisions.length > 0) {
|
|
71
|
+
for (const c of r.collisions) {
|
|
72
|
+
if (c.action === "rename") {
|
|
73
|
+
lines.push(` - ${c.kind} ${c.name} → ${c.newName} (renamed)`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
lines.push(` - ${c.kind} ${c.name} (${c.action})`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
lines.push(" (none)");
|
|
82
|
+
}
|
|
83
|
+
lines.push("");
|
|
84
|
+
// Notes
|
|
85
|
+
lines.push("Notes:");
|
|
86
|
+
if (r.notes.length > 0) {
|
|
87
|
+
for (const note of r.notes) {
|
|
88
|
+
lines.push(` - ${note}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
lines.push(" (none)");
|
|
93
|
+
}
|
|
94
|
+
lines.push("");
|
|
95
|
+
// Webhook secret notice (always shown)
|
|
96
|
+
lines.push("Webhook secrets will be regenerated and shown once at creation.");
|
|
97
|
+
return lines.join("\n");
|
|
98
|
+
}
|