@parcha/agentrun-serve 0.1.0-beta.58 → 0.1.0-beta.60
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/CHANGELOG.md +402 -1
- package/README.md +516 -190
- package/dist/acp-package.d.ts +5 -1
- package/dist/acp-package.js +19 -2
- package/dist/adapters.d.ts +23 -2
- package/dist/adapters.js +106 -33
- package/dist/agent-delete.d.ts +6 -9
- package/dist/agent-delete.js +5 -3
- package/dist/agent-package.js +11 -1
- package/dist/agents-store.js +1 -1
- package/dist/answer-text.d.ts +3 -0
- package/dist/answer-text.js +22 -0
- package/dist/api-only.d.ts +2 -2
- package/dist/api-only.js +3 -3
- package/dist/archil-routes.d.ts +4 -1
- package/dist/archil-routes.js +15 -12
- package/dist/archil-settings.d.ts +18 -8
- package/dist/archil-settings.js +35 -17
- package/dist/attach-conformance.js +5 -4
- package/dist/box-paths.d.ts +3 -2
- package/dist/box-paths.js +5 -4
- package/dist/browser-computer.d.ts +3 -8
- package/dist/browser-computer.js +12 -35
- package/dist/browser-cost.js +94 -20
- package/dist/capacity.d.ts +1 -1
- package/dist/capacity.js +3 -3
- package/dist/chatgpt-plan.d.ts +7 -0
- package/dist/chatgpt-plan.js +35 -11
- package/dist/claude-login-token.d.ts +20 -11
- package/dist/claude-login-token.js +175 -107
- package/dist/claude-login.d.ts +124 -33
- package/dist/claude-login.js +562 -85
- package/dist/claude-sign-in.d.ts +3 -0
- package/dist/claude-sign-in.js +10 -1
- package/dist/cli-learning/connections.js +1 -1
- package/dist/cli.js +323 -292
- package/dist/composio-made.d.ts +1 -6
- package/dist/composio-made.js +1 -6
- package/dist/composio-owners.d.ts +26 -0
- package/dist/composio-owners.js +36 -0
- package/dist/composio-preset.d.ts +56 -23
- package/dist/composio-preset.js +173 -77
- package/dist/composio-triggers.d.ts +4 -4
- package/dist/composio-triggers.js +6 -7
- package/dist/compute-cost.js +11 -2
- package/dist/computer-attach.d.ts +6 -3
- package/dist/computer-attach.js +41 -29
- package/dist/computer-held-routes.d.ts +1 -1
- package/dist/computer-held-routes.js +9 -4
- package/dist/computer-keys.d.ts +11 -1
- package/dist/computer-keys.js +26 -1
- package/dist/computer-record.js +3 -1
- package/dist/computer-view.d.ts +5 -3
- package/dist/computer-view.js +10 -6
- package/dist/computer-viewer.js +36 -7
- package/dist/computers.d.ts +2 -1
- package/dist/computers.js +6 -3
- package/dist/console/THIRD-PARTY-NOTICES.txt +50 -0
- package/dist/console/assets/backend-QnwGVBeU.js +166 -0
- package/dist/console/assets/index-DZi-muIj.js +629 -0
- package/dist/console/assets/share-pz61zIn9.js +6 -0
- package/dist/console/assets/styles-CcceGcu2.js +291 -0
- package/dist/console/assets/styles-fjQBFfMv.css +1 -0
- package/dist/console/index.html +4 -3
- package/dist/console/share.html +17 -0
- package/dist/decisions.d.ts +17 -7
- package/dist/decisions.js +41 -15
- package/dist/dial-relay.js +10 -4
- package/dist/docker-daemon.js +4 -5
- package/dist/docker-host-addresses.js +29 -11
- package/dist/email/account.d.ts +6 -0
- package/dist/email/account.js +6 -0
- package/dist/email/authentication.d.ts +21 -0
- package/dist/email/authentication.js +106 -0
- package/dist/email/email-faux.d.ts +11 -2
- package/dist/email/email-faux.js +21 -5
- package/dist/email/mail.d.ts +25 -0
- package/dist/email/mail.js +58 -2
- package/dist/email/names.js +2 -2
- package/dist/email/tools.d.ts +9 -4
- package/dist/email/tools.js +95 -13
- package/dist/env-switch.d.ts +12 -2
- package/dist/env-switch.js +23 -3
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/factory-activity.d.ts +68 -0
- package/dist/factory-activity.js +153 -0
- package/dist/factory-runs.d.ts +11 -0
- package/dist/factory-runs.js +52 -0
- package/dist/fal-price.d.ts +11 -1
- package/dist/fal-price.js +33 -0
- package/dist/faux-computers.js +1 -1
- package/dist/filed-answer.d.ts +2 -2
- package/dist/filed-answer.js +2 -2
- package/dist/filed-tool.d.ts +32 -0
- package/dist/filed-tool.js +122 -0
- package/dist/graph-served.d.ts +10 -5
- package/dist/graph-served.js +40 -10
- package/dist/handed-values.js +1 -2
- package/dist/harness-check.d.ts +2 -1
- package/dist/harness-check.js +45 -12
- package/dist/harness-keys.d.ts +1 -2
- package/dist/harness-keys.js +10 -8
- package/dist/harness-opencode/facts.js +2 -0
- package/dist/harness-recipe-entry.d.ts +9 -3
- package/dist/harness-recipe-entry.js +18 -9
- package/dist/harness-recipe.d.ts +21 -0
- package/dist/harness-recipe.js +25 -3
- package/dist/harness-table.d.ts +12 -0
- package/dist/harness-table.js +21 -6
- package/dist/harness.js +6 -2
- package/dist/helper-env.d.ts +4 -1
- package/dist/helper-env.js +4 -1
- package/dist/host-check.d.ts +2 -3
- package/dist/host-check.js +13 -7
- package/dist/hosted-search.js +1 -1
- package/dist/import-worker.js +2 -2
- package/dist/import.d.ts +20 -8
- package/dist/import.js +448 -187
- package/dist/key-refusal.d.ts +14 -2
- package/dist/key-refusal.js +97 -33
- package/dist/learn/audit.d.ts +28 -27
- package/dist/learn/audit.js +87 -62
- package/dist/learn/check.js +1 -1
- package/dist/learn/commit.d.ts +35 -43
- package/dist/learn/commit.js +62 -270
- package/dist/learn/compile.d.ts +9 -6
- package/dist/learn/compile.js +51 -28
- package/dist/learn/corrections.js +1 -1
- package/dist/learn/delete.d.ts +5 -12
- package/dist/learn/delete.js +17 -30
- package/dist/learn/field-check.d.ts +111 -0
- package/dist/learn/field-check.js +174 -0
- package/dist/learn/forget-run.d.ts +16 -0
- package/dist/learn/forget-run.js +53 -0
- package/dist/learn/index.js +1 -1
- package/dist/learn/learning-of.d.ts +0 -4
- package/dist/learn/learning-of.js +0 -5
- package/dist/learn/ledger.d.ts +32 -29
- package/dist/learn/ledger.js +26 -19
- package/dist/learn/{folder.d.ts → legacy/folder.d.ts} +2 -1
- package/dist/learn/{folder.js → legacy/folder.js} +4 -7
- package/dist/learn/legacy/place.d.ts +16 -0
- package/dist/{workspace/learning-workspace.js → learn/legacy/place.js} +12 -42
- package/dist/learn/legacy/scrub.d.ts +28 -0
- package/dist/learn/legacy/scrub.js +258 -0
- package/dist/learn/promote.d.ts +119 -102
- package/dist/learn/promote.js +119 -262
- package/dist/learn/reset-ledger.d.ts +18 -0
- package/dist/learn/reset-ledger.js +14 -0
- package/dist/learn/rows.d.ts +186 -0
- package/dist/learn/rows.js +376 -0
- package/dist/learn/secrets.d.ts +4 -0
- package/dist/learn/secrets.js +12 -0
- package/dist/learn/workflow-draft.d.ts +4 -1
- package/dist/learn/workflow-draft.js +12 -2
- package/dist/learned-nodes.d.ts +8 -5
- package/dist/learned-nodes.js +8 -5
- package/dist/learned-workflow.d.ts +2 -1
- package/dist/learned-workflow.js +13 -10
- package/dist/learning-cost.d.ts +25 -8
- package/dist/learning-cost.js +23 -8
- package/dist/learning-reset.d.ts +1 -1
- package/dist/learning-reset.js +9 -11
- package/dist/learning-routes.d.ts +60 -81
- package/dist/learning-routes.js +187 -360
- package/dist/learning-setting.d.ts +6 -0
- package/dist/learning-setting.js +11 -1
- package/dist/learning-words.d.ts +2 -0
- package/dist/learning-words.js +2 -0
- package/dist/learning.d.ts +18 -24
- package/dist/learning.js +35 -66
- package/dist/listen-first.d.ts +5 -4
- package/dist/listen-first.js +4 -5
- package/dist/live-reach.d.ts +7 -0
- package/dist/live-reach.js +7 -0
- package/dist/mcp-api-only-origins.d.ts +15 -0
- package/dist/mcp-api-only-origins.js +40 -0
- package/dist/mcp-gateway.d.ts +22 -2
- package/dist/mcp-gateway.js +85 -11
- package/dist/mcp-oauth.d.ts +1 -1
- package/dist/mcp-oauth.js +3 -2
- package/dist/mcp-probe.d.ts +3 -0
- package/dist/mcp-probe.js +3 -0
- package/dist/mcp-resources.d.ts +1 -1
- package/dist/mcp-secret-writes.d.ts +24 -2
- package/dist/mcp-secret-writes.js +30 -2
- package/dist/mcp-servers-store.d.ts +52 -14
- package/dist/mcp-servers-store.js +165 -61
- package/dist/mcp-sources.d.ts +1 -2
- package/dist/mcp-sources.js +1 -2
- package/dist/mcp-store.d.ts +5 -5
- package/dist/mcp-store.js +3 -3
- package/dist/mcp.js +1 -1
- package/dist/model-gateway.d.ts +1 -1
- package/dist/model-gateway.js +20 -36
- package/dist/native/discovery.d.ts +6 -0
- package/dist/native/discovery.js +14 -1
- package/dist/native/remote.d.ts +5 -0
- package/dist/native/remote.js +16 -0
- package/dist/native/runtime.js +3 -2
- package/dist/observation/observer.d.ts +6 -6
- package/dist/ollama-provider.d.ts +23 -9
- package/dist/ollama-provider.js +49 -20
- package/dist/openapi.js +290 -79
- package/dist/otel/genai.d.ts +83 -7
- package/dist/otel/genai.js +69 -9
- package/dist/otel/tracer.d.ts +42 -13
- package/dist/otel/tracer.js +241 -56
- package/dist/page.d.ts +7 -1
- package/dist/page.js +76 -22
- package/dist/paid-calls.d.ts +6 -4
- package/dist/paid-calls.js +15 -7
- package/dist/place-offers.d.ts +58 -34
- package/dist/place-offers.js +96 -54
- package/dist/place.d.ts +41 -20
- package/dist/place.js +97 -47
- package/dist/print.js +1 -1
- package/dist/provider.d.ts +3 -2
- package/dist/provider.js +17 -8
- package/dist/purged-workflow.d.ts +0 -33
- package/dist/purged-workflow.js +3 -71
- package/dist/redact/match.d.ts +42 -9
- package/dist/redact/match.js +356 -54
- package/dist/run-census.d.ts +1 -1
- package/dist/run-census.js +4 -5
- package/dist/run-cut.js +4 -5
- package/dist/run-export-store.d.ts +15 -0
- package/dist/run-export-store.js +30 -0
- package/dist/run-export.d.ts +139 -0
- package/dist/run-export.js +379 -0
- package/dist/run-file-cut.d.ts +5 -0
- package/dist/run-file-cut.js +13 -0
- package/dist/run-launch.d.ts +3 -3
- package/dist/run-launch.js +16 -3
- package/dist/run-learning-served.d.ts +3 -3
- package/dist/run-learning-served.js +1 -1
- package/dist/run-listing.d.ts +1 -1
- package/dist/run-model-key.d.ts +15 -6
- package/dist/run-model-key.js +30 -31
- package/dist/run-reads-over-store.js +4 -4
- package/dist/run-secrets.js +3 -5
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +8 -5
- package/dist/runnable.js +26 -9
- package/dist/runner/adapter-loop.d.ts +35 -18
- package/dist/runner/adapter-loop.js +94 -47
- package/dist/runner/adapter-run-spec.d.ts +14 -1
- package/dist/runner/adapter-run-spec.js +73 -46
- package/dist/runner/adapters/pi.js +4 -2
- package/dist/runner/audit.d.ts +10 -9
- package/dist/runner/audit.js +64 -67
- package/dist/runner/beside.js +5 -6
- package/dist/runner/claim-secrets.d.ts +10 -3
- package/dist/runner/claim-secrets.js +29 -13
- package/dist/runner/cli-run-spec.d.ts +18 -0
- package/dist/runner/cli-run-spec.js +87 -58
- package/dist/runner/compare-end.d.ts +2 -3
- package/dist/runner/compare-end.js +30 -11
- package/dist/runner/conformance/harness.js +2 -3
- package/dist/runner/conformance/subject.d.ts +4 -1
- package/dist/runner/disk-free.d.ts +15 -4
- package/dist/runner/disk-free.js +25 -7
- package/dist/runner/feedback-round.d.ts +1 -1
- package/dist/runner/feedback-round.js +2 -2
- package/dist/runner/harness-loops.js +3 -4
- package/dist/runner/held.d.ts +5 -12
- package/dist/runner/held.js +0 -25
- package/dist/runner/journal-kinds.d.ts +8 -2
- package/dist/runner/journal-kinds.js +23 -5
- package/dist/runner/learned-first.d.ts +0 -2
- package/dist/runner/learned-first.js +23 -7
- package/dist/runner/learning-end.d.ts +14 -24
- package/dist/runner/learning-end.js +52 -94
- package/dist/runner/learning-seed.d.ts +13 -16
- package/dist/runner/learning-seed.js +13 -23
- package/dist/runner/live-ticker.js +7 -5
- package/dist/runner/loop-contract.d.ts +0 -2
- package/dist/runner/loop.d.ts +7 -0
- package/dist/runner/loop.js +1 -0
- package/dist/runner/main.js +13 -12
- package/dist/runner/mcp-claim.js +21 -5
- package/dist/runner/mcp-run.d.ts +4 -0
- package/dist/runner/mcp-run.js +2 -0
- package/dist/runner/meta-tools.js +3 -2
- package/dist/runner/metrics.d.ts +7 -0
- package/dist/runner/metrics.js +19 -0
- package/dist/runner/model-route.d.ts +10 -7
- package/dist/runner/model-route.js +79 -15
- package/dist/runner/native-loop.js +12 -11
- package/dist/runner/presence.d.ts +1 -4
- package/dist/runner/presence.js +6 -8
- package/dist/runner/promotion.d.ts +39 -36
- package/dist/runner/promotion.js +168 -112
- package/dist/runner/redact.d.ts +3 -1
- package/dist/runner/redact.js +5 -3
- package/dist/runner/reflect-hook.d.ts +2 -2
- package/dist/runner/reflect-hook.js +4 -1
- package/dist/runner/responses-fetch.d.ts +36 -0
- package/dist/runner/responses-fetch.js +511 -0
- package/dist/runner/run-child-host.d.ts +21 -14
- package/dist/runner/run-child-host.js +187 -141
- package/dist/runner/run-child.js +11 -4
- package/dist/runner/runner-check.js +5 -1
- package/dist/runner/runner.d.ts +3 -4
- package/dist/runner/runner.js +13 -9
- package/dist/runner/sdk-loop.js +10 -12
- package/dist/runner/spec-holds.d.ts +8 -1
- package/dist/runner/spec-holds.js +9 -4
- package/dist/runner/workflow-calls.d.ts +9 -0
- package/dist/runner/workflow-calls.js +150 -0
- package/dist/runner/workflow-first.d.ts +120 -32
- package/dist/runner/workflow-first.js +218 -94
- package/dist/runner/workflow-spec.js +1 -1
- package/dist/runs-over-store.js +8 -7
- package/dist/save-once.d.ts +14 -0
- package/dist/save-once.js +31 -0
- package/dist/scrub-command.d.ts +34 -31
- package/dist/scrub-command.js +116 -147
- package/dist/sdk/check.d.ts +1 -4
- package/dist/sdk/check.js +2 -3
- package/dist/sdk/runs.d.ts +26 -7
- package/dist/sdk/runs.js +194 -78
- package/dist/seal-key.js +4 -4
- package/dist/secret-cut.d.ts +3 -0
- package/dist/secret-cut.js +7 -1
- package/dist/secret-rules.d.ts +8 -1
- package/dist/secret-rules.js +482 -53
- package/dist/secrets.d.ts +55 -9
- package/dist/secrets.js +345 -21
- package/dist/server-fs.d.ts +1 -1
- package/dist/server-fs.js +1 -1
- package/dist/server-keys.d.ts +10 -3
- package/dist/server-keys.js +16 -3
- package/dist/server-secrets-store.js +2 -4
- package/dist/server.d.ts +30 -18
- package/dist/server.js +520 -238
- package/dist/share-context.d.ts +22 -0
- package/dist/share-context.js +76 -0
- package/dist/shell-lex.d.ts +105 -0
- package/dist/shell-lex.js +646 -0
- package/dist/sign-ins-store.d.ts +5 -7
- package/dist/sign-ins-store.js +12 -16
- package/dist/sign-ins.d.ts +7 -11
- package/dist/sign-ins.js +40 -41
- package/dist/skills/agentrun-serve/SKILL.md +5 -2
- package/dist/source-sync/auxiliary.js +2 -2
- package/dist/start-switches.d.ts +6 -5
- package/dist/start-switches.js +8 -4
- package/dist/stats.d.ts +5 -1
- package/dist/stats.js +1 -1
- package/dist/store/agent-body.js +2 -2
- package/dist/store/dialect.d.ts +4 -0
- package/dist/store/dialect.js +1 -0
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/mcp-record-keys.d.ts +10 -0
- package/dist/store/mcp-record-keys.js +13 -0
- package/dist/store/postgres/dialect.js +2 -0
- package/dist/store/postgres/migrations/0029_run_launch_census_settle.sql +28 -0
- package/dist/store/postgres/migrations/0030_learning_ledger_epoch.sql +40 -0
- package/dist/store/postgres/migrations/0031_learning_ledger_calls.sql +12 -0
- package/dist/store/postgres/migrations/0032_learning_rows.sql +65 -0
- package/dist/store/postgres/store.js +4 -0
- package/dist/store/schema.d.ts +60 -11
- package/dist/store/schema.js +147 -17
- package/dist/store/seal.d.ts +4 -1
- package/dist/store/sqlite/learning-rows.d.ts +23 -0
- package/dist/store/sqlite/learning-rows.js +559 -0
- package/dist/store/sqlite/run-launch.d.ts +3 -10
- package/dist/store/sqlite/run-launch.js +12 -23
- package/dist/store/sqlite/run-patch.d.ts +17 -10
- package/dist/store/sqlite/run-patch.js +50 -13
- package/dist/store/sqlite/store.d.ts +9 -0
- package/dist/store/sqlite/store.js +194 -46
- package/dist/store/store-schema.js +3 -4
- package/dist/store/store.d.ts +286 -38
- package/dist/store/store.js +27 -11
- package/dist/store-reads/analytics.d.ts +2 -1
- package/dist/store-reads/analytics.js +7 -5
- package/dist/store-reads/journal.d.ts +33 -3
- package/dist/store-reads/journal.js +99 -4
- package/dist/store-reads/learning.d.ts +50 -45
- package/dist/store-reads/learning.js +153 -116
- package/dist/store-reads/loop.js +1 -1
- package/dist/store-reads/stats.d.ts +2 -2
- package/dist/store-reads/stats.js +13 -7
- package/dist/store-view.d.ts +24 -2
- package/dist/store-view.js +49 -17
- package/dist/suggestions.d.ts +1 -1
- package/dist/suggestions.js +29 -13
- package/dist/template-eval.d.ts +72 -9
- package/dist/template-eval.js +358 -64
- package/dist/templates.d.ts +10 -2
- package/dist/templates.js +31 -4
- package/dist/timeline/labels.d.ts +1 -1
- package/dist/timeline/labels.js +4 -3
- package/dist/timeline/timeline.d.ts +23 -11
- package/dist/timeline/timeline.js +115 -31
- package/dist/timeline/web-calls.d.ts +8 -6
- package/dist/timeline/web-calls.js +10 -6
- package/dist/tool-gate.d.ts +13 -1
- package/dist/tool-gate.js +43 -3
- package/dist/tool-keys-store.js +2 -4
- package/dist/tool-keys.d.ts +11 -0
- package/dist/tool-keys.js +16 -0
- package/dist/tool-plane.d.ts +54 -13
- package/dist/tool-plane.js +103 -32
- package/dist/tools.d.ts +5 -1
- package/dist/tools.js +7 -7
- package/dist/trigger-email.js +12 -6
- package/dist/triggers.d.ts +15 -34
- package/dist/triggers.js +119 -126
- package/dist/validate.d.ts +8 -1
- package/dist/validate.js +163 -23
- package/dist/web-fake.d.ts +2 -1
- package/dist/web-fake.js +8 -6
- package/dist/web-fetch.d.ts +8 -6
- package/dist/web-fetch.js +13 -11
- package/dist/web-holds.d.ts +34 -0
- package/dist/web-holds.js +89 -0
- package/dist/web-run.d.ts +32 -5
- package/dist/web-run.js +76 -28
- package/dist/web-save.js +23 -12
- package/dist/web-search.js +14 -25
- package/dist/wires.d.ts +4 -3
- package/dist/wires.js +5 -4
- package/dist/workspace/archil-claim.d.ts +12 -5
- package/dist/workspace/archil-claim.js +45 -5
- package/dist/workspace/archil-exec.js +1 -1
- package/dist/workspace/archil.d.ts +1 -1
- package/dist/workspace/archil.js +1 -1
- package/dist/workspace/attach.js +52 -19
- package/dist/workspace/attached-computers.d.ts +6 -2
- package/dist/workspace/attached-computers.js +5 -4
- package/dist/workspace/computer-deps.d.ts +23 -6
- package/dist/workspace/computer-deps.js +38 -18
- package/dist/workspace/computer-for-claim.d.ts +21 -4
- package/dist/workspace/computer-for-claim.js +160 -54
- package/dist/workspace/computer-intervals.d.ts +2 -0
- package/dist/workspace/computer-intervals.js +1 -1
- package/dist/workspace/computer-janitor.d.ts +48 -14
- package/dist/workspace/computer-janitor.js +153 -44
- package/dist/workspace/computer-kept.d.ts +158 -32
- package/dist/workspace/computer-kept.js +288 -63
- package/dist/workspace/computer-providers.d.ts +19 -4
- package/dist/workspace/computer-providers.js +40 -6
- package/dist/workspace/index.d.ts +2 -3
- package/dist/workspace/index.js +2 -3
- package/dist/workspace/local.js +41 -1
- package/dist/workspace/mount-revoke-left.d.ts +31 -0
- package/dist/workspace/mount-revoke-left.js +72 -0
- package/dist/workspace/paired-route.js +4 -5
- package/dist/workspace/paths.d.ts +0 -4
- package/dist/workspace/paths.js +0 -6
- package/dist/workspace/resolve-computer.d.ts +5 -2
- package/dist/workspace/resolve-computer.js +9 -3
- package/dist/workspace/run-end-computers.d.ts +11 -5
- package/dist/workspace/run-end-computers.js +153 -28
- package/dist/workspace/run-tools.d.ts +22 -3
- package/dist/workspace/run-tools.js +17 -5
- package/dist/workspace/run-workspace.d.ts +14 -1
- package/dist/workspace/run-workspace.js +34 -1
- package/dist/workspace/workspace.d.ts +7 -1
- package/dist/workspace/workspace.js +1 -1
- package/package.json +13 -14
- package/skills/agentrun-serve/SKILL.md +5 -2
- package/templates/README.md +22 -6
- package/templates/TOOLS.md +46 -0
- package/dist/console/assets/backend-CSAWUqtZ.js +0 -166
- package/dist/console/assets/index-Bwn1oTem.css +0 -1
- package/dist/console/assets/index-DPh29cyz.js +0 -747
- package/dist/workspace/learning-workspace.d.ts +0 -24
- /package/dist/learn/{learning.sh → legacy/learning.sh} +0 -0
package/dist/paid-calls.d.ts
CHANGED
|
@@ -54,10 +54,10 @@ export declare function booking<T extends ToolRegistration>(tool: T): T;
|
|
|
54
54
|
export declare const bookedIn: <T>(ledger: Ledger | undefined, work: () => Promise<T>) => Promise<T>;
|
|
55
55
|
/** `send`, one request to a paid provider at `fee`, on the run's one ledger under the call it runs in (Ledger.paid):
|
|
56
56
|
* admitted at the fee's price, then sent, then settled at what it may have charged (its price on a 2xx, a 408 or a 5xx
|
|
57
|
-
* or when it threw after it was sent
|
|
58
|
-
* less. It throws PaidRefused, in the cap's words, when the cap does not hold its price, when its hold could not be kept,
|
|
57
|
+
* or when it threw after it was sent, or what `charged` says it cost, never above its price; $0 on another 4xx); a
|
|
58
|
+
* settle that cannot be written leaves it at its hold, never less, and `settled` hears which. It throws PaidRefused, in the cap's words, when the cap does not hold its price, when its hold could not be kept,
|
|
59
59
|
* or when the call has no run's ledger, and then nothing is sent. A request that throws throws, settled at its price. */
|
|
60
|
-
export declare function paidRequest(fee: Fee, send: () => Promise<Response
|
|
60
|
+
export declare function paidRequest(fee: Fee, send: () => Promise<Response>, charged?: () => number, settled?: (booked: boolean) => void): Promise<Response>;
|
|
61
61
|
/** paidStep's chargeOf for a step that charged nothing and is given back: its mark settled with no charge row. */
|
|
62
62
|
export declare const GIVEN_BACK = "given back";
|
|
63
63
|
/** Whether the current work runs inside a call's ledger (bookedIn): a host tool call of the run's, or a workflow call
|
|
@@ -85,7 +85,8 @@ export declare const stopRunWith: (pause: NonNullable<Ledger["pause"]>) => (word
|
|
|
85
85
|
* or why its hold could not be kept), then `run`, then settled at `chargeOf` its outcome (null: at its hold; GIVEN_BACK:
|
|
86
86
|
* given back, nothing charged, as a hold-only step's: a request its provider refused unrun leaves no charge row). One refused
|
|
87
87
|
* for room pauses the run through `pause`, else through the ledger of the call it runs in (bookedIn's), as main's
|
|
88
|
-
* paidCall pauses: a step outside any host tool call (a pi-native tool's, the browser's) passes the run's own.
|
|
88
|
+
* paidCall pauses: a step outside any host tool call (a pi-native tool's, the browser's) passes the run's own. A settle
|
|
89
|
+
* that could not be written leaves the step at its hold, and its result says so (`unsettled`). */
|
|
89
90
|
export declare function paidStep<T>(paid: PaidBooking, call: string | undefined, fee: {
|
|
90
91
|
name: string;
|
|
91
92
|
holdUsd: number;
|
|
@@ -105,4 +106,5 @@ export declare function paidStep<T>(paid: PaidBooking, call: string | undefined,
|
|
|
105
106
|
refused: string;
|
|
106
107
|
} | {
|
|
107
108
|
result: T;
|
|
109
|
+
unsettled?: true;
|
|
108
110
|
}>;
|
package/dist/paid-calls.js
CHANGED
|
@@ -56,16 +56,23 @@ export const bookedIn = (ledger, work) => (ledger ? ledgers.run(ledger, work) :
|
|
|
56
56
|
const billed = (status) => (status >= 200 && status < 300) || status === 408 || status >= 500;
|
|
57
57
|
/** `send`, one request to a paid provider at `fee`, on the run's one ledger under the call it runs in (Ledger.paid):
|
|
58
58
|
* admitted at the fee's price, then sent, then settled at what it may have charged (its price on a 2xx, a 408 or a 5xx
|
|
59
|
-
* or when it threw after it was sent
|
|
60
|
-
* less. It throws PaidRefused, in the cap's words, when the cap does not hold its price, when its hold could not be kept,
|
|
59
|
+
* or when it threw after it was sent, or what `charged` says it cost, never above its price; $0 on another 4xx); a
|
|
60
|
+
* settle that cannot be written leaves it at its hold, never less, and `settled` hears which. It throws PaidRefused, in the cap's words, when the cap does not hold its price, when its hold could not be kept,
|
|
61
61
|
* or when the call has no run's ledger, and then nothing is sent. A request that throws throws, settled at its price. */
|
|
62
|
-
export async function paidRequest(fee, send) {
|
|
62
|
+
export async function paidRequest(fee, send, charged, settled) {
|
|
63
63
|
const ledger = ledgers.getStore();
|
|
64
64
|
if (!ledger?.paid)
|
|
65
65
|
throw new PaidRefused(unbookedRefusal(fee.name));
|
|
66
|
-
const
|
|
66
|
+
const said = () => {
|
|
67
|
+
// `charged` may be the provider's estimate (Jev's, where it reports no cost): booked on purpose, as nearer the real
|
|
68
|
+
// charge than the hold, and never above the hold (Math.min below).
|
|
69
|
+
const usd = charged?.();
|
|
70
|
+
return typeof usd === "number" && Number.isFinite(usd) && usd >= 0 ? Math.min(usd, fee.usd) : fee.usd;
|
|
71
|
+
};
|
|
72
|
+
const stepped = await paidStep(ledger.paid, ledger.call, { name: fee.name, holdUsd: fee.usd, basis: fee.basis, by: fee.by }, send, (outcome) => ("thrown" in outcome ? fee.usd : billed(outcome.result.status) ? said() : 0));
|
|
67
73
|
if ("refused" in stepped)
|
|
68
74
|
throw new PaidRefused(stepped.refused);
|
|
75
|
+
settled?.(stepped.unsettled !== true);
|
|
69
76
|
return stepped.result;
|
|
70
77
|
}
|
|
71
78
|
/** paidStep's chargeOf for a step that charged nothing and is given back: its mark settled with no charge row. */
|
|
@@ -115,7 +122,8 @@ export const stopRunWith = (pause) => async (words) => {
|
|
|
115
122
|
* or why its hold could not be kept), then `run`, then settled at `chargeOf` its outcome (null: at its hold; GIVEN_BACK:
|
|
116
123
|
* given back, nothing charged, as a hold-only step's: a request its provider refused unrun leaves no charge row). One refused
|
|
117
124
|
* for room pauses the run through `pause`, else through the ledger of the call it runs in (bookedIn's), as main's
|
|
118
|
-
* paidCall pauses: a step outside any host tool call (a pi-native tool's, the browser's) passes the run's own.
|
|
125
|
+
* paidCall pauses: a step outside any host tool call (a pi-native tool's, the browser's) passes the run's own. A settle
|
|
126
|
+
* that could not be written leaves the step at its hold, and its result says so (`unsettled`). */
|
|
119
127
|
export async function paidStep(paid, call, fee, run, chargeOf, pause) {
|
|
120
128
|
const id = `${call ?? fee.ref ?? fee.name}#${(paidSeq += 1)}`;
|
|
121
129
|
let admitted;
|
|
@@ -138,8 +146,8 @@ export async function paidStep(paid, call, fee, run, chargeOf, pause) {
|
|
|
138
146
|
}
|
|
139
147
|
// A hold-only step (`hold`) is given back, never a charge: its money is booked by its own charges' steps.
|
|
140
148
|
const charge = fee.hold ? GIVEN_BACK : chargeOf(outcome);
|
|
141
|
-
await (charge === GIVEN_BACK ? paid.settle(id, 0, { givenBack: true }) : paid.settle(id, charge)).
|
|
149
|
+
const landed = await (charge === GIVEN_BACK ? paid.settle(id, 0, { givenBack: true }) : paid.settle(id, charge)).then(() => true, () => false);
|
|
142
150
|
if ("thrown" in outcome)
|
|
143
151
|
throw outcome.thrown;
|
|
144
|
-
return outcome;
|
|
152
|
+
return landed ? outcome : { ...outcome, unsettled: true };
|
|
145
153
|
}
|
package/dist/place-offers.d.ts
CHANGED
|
@@ -1,13 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type ProviderEntry } from "@parcha/agentrun-computer";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a computer provider can be a box, read from its descriptor's facts (PROVIDERS' entry). A place names a box
|
|
4
|
+
* alone, no kind, image or network, so a run in it gets a sandbox computer on that provider with no image named
|
|
5
|
+
* (computer-setting.ts computerOfPlace), resolved and started by the claim as any computer setting is
|
|
6
|
+
* (workspace/resolve-computer.ts, computer-deps.ts computerSpecOf), and it needs:
|
|
7
|
+
* - a Linux shell with files and processes, for bash and the background tools: the provider serves the sandbox kind;
|
|
8
|
+
* - the run's folder in that shell: it takes a bind, an Archil mount or a synced folder (its derived mounts; a provider
|
|
9
|
+
* whose machines keep their own disk where the folder would be takes none);
|
|
10
|
+
* - an image with none named: its default sandbox image, or the one its prepareImage() makes;
|
|
11
|
+
* - what places.allow says: its computers keep to a host list, or reach nothing (its network forms hold allow or none).
|
|
12
|
+
* One that reaches only its vendor's own network can't be held to the list.
|
|
13
|
+
* Which mode's folder it takes (a bind in Mode 1, Archil or a synced one in Mode 2) is the run's start's check, as for
|
|
14
|
+
* any computer setting: the mode can change while the server runs.
|
|
15
|
+
*/
|
|
16
|
+
export declare const isBox: (entry: ProviderEntry) => boolean;
|
|
17
|
+
/** Every box a place may name, in the order capabilities lists them (Settings' order of providers). */
|
|
18
|
+
export declare const BOX_IDS: readonly string[];
|
|
19
|
+
/** The boxes on this machine's container engine (their descriptor's `local`: Docker's), the boxes a server sets up when
|
|
20
|
+
* AGENTRUN_BOXES is not set at all. Their engine is Docker, so a local box is probed at the start with `docker
|
|
21
|
+
* version` (probeDocker), its computers mount this server's paths (box-paths.ts) and keep out the Docker host's own
|
|
22
|
+
* addresses (docker-host-addresses.ts). */
|
|
23
|
+
export declare const LOCAL_BOXES: readonly string[];
|
|
24
|
+
/** The box a new agent that names no place and needs a shell is given (its descriptor's `defaultBox`: Docker's), by
|
|
25
|
+
* that fact, never by a name; undefined where no box's descriptor sets it. */
|
|
26
|
+
export declare const DEFAULT_BOX: string | undefined;
|
|
4
27
|
/** A box as capabilities show it: whether this server has it, and why when not (or how it was checked); `state`, which
|
|
5
28
|
* capabilities derive from it (place.ts stated). `network`: what an available box reaches (BOX_NETWORKS), with
|
|
6
29
|
* `network_reason` when it is available and has none for a cause of its own (a daemon elsewhere). `host_addresses`: for Docker from a container (compose.yaml), the Docker host's own addresses
|
|
7
30
|
* its computers' egress proxy refuses as the host's (docker-host-addresses.ts: the read through the socket and
|
|
8
31
|
* AGENTRUN_DOCKER_HOST_ADDRESSES). */
|
|
9
32
|
export type BoxOffer = {
|
|
10
|
-
id:
|
|
33
|
+
id: string;
|
|
11
34
|
available: boolean;
|
|
12
35
|
state?: BoxState;
|
|
13
36
|
reason?: string;
|
|
@@ -21,47 +44,45 @@ export type BoxNetwork = (typeof BOX_NETWORKS)[number];
|
|
|
21
44
|
/** A box's state in capabilities: ready (available) or unavailable. */
|
|
22
45
|
export declare const BOX_STATES: readonly ["ready", "unavailable"];
|
|
23
46
|
export type BoxState = (typeof BOX_STATES)[number];
|
|
24
|
-
/** The remote boxes' keys: secrets the server holds and its computer providers read, which no run is handed
|
|
25
|
-
* (run-secrets.ts SERVER_ONLY). */
|
|
26
|
-
export declare const BOX_KEYS: readonly string[];
|
|
27
47
|
/** The setting that lists the boxes to set up: a comma list of box ids, empty or `none` for no box. */
|
|
28
48
|
export declare const BOXES_ENV = "AGENTRUN_BOXES";
|
|
29
|
-
/**
|
|
30
|
-
export declare const DEFAULT_BOXES: readonly BoxId[];
|
|
31
|
-
/** Whether `env` leaves the boxes to this server's default (DEFAULT_BOXES): AGENTRUN_BOXES is not set at all. */
|
|
49
|
+
/** Whether `env` leaves the boxes to this server's default (LOCAL_BOXES): AGENTRUN_BOXES is not set at all. */
|
|
32
50
|
export declare const boxesByDefault: (env: NodeJS.ProcessEnv) => boolean;
|
|
33
|
-
/** The boxes `env` lists in AGENTRUN_BOXES,
|
|
51
|
+
/** The boxes `env` lists in AGENTRUN_BOXES, LOCAL_BOXES when it is not set, none when it is empty or `none`; a name
|
|
34
52
|
* that is no box throws, naming it, and so does `none` with another. */
|
|
35
|
-
export declare function enabledBoxes(env: NodeJS.ProcessEnv): Set<
|
|
53
|
+
export declare function enabledBoxes(env: NodeJS.ProcessEnv): Set<string>;
|
|
36
54
|
/** The start's log line: the boxes available, the rest, and why each box AGENTRUN_BOXES lists (`listed`) is not available. */
|
|
37
|
-
export declare function boxesLog(offers: readonly BoxOffer[], listed: ReadonlySet<
|
|
55
|
+
export declare function boxesLog(offers: readonly BoxOffer[], listed: ReadonlySet<string>): Record<string, string>;
|
|
38
56
|
/** Why docker is unavailable when its daemon refuses this server's process its socket (EACCES on /var/run/docker.sock)
|
|
39
57
|
* and the group file lists this user in the docker group: this process started before the user joined it (a systemd
|
|
40
58
|
* user manager that has run since, kept by linger), so a restart of that manager, or a new login, gives it the group. */
|
|
41
59
|
export declare const DOCKER_NOT_IN_GROUP = "This server's process isn't in the docker group: restart your user manager with `sudo systemctl restart user@$(id -u)`, or log in again if linger is off";
|
|
42
60
|
/** The same, when the group file does not list this user in the docker group (or cannot say): joining comes first. */
|
|
43
61
|
export declare const DOCKER_JOIN_GROUP = "This server's process isn't in the docker group: add this user to it with `sudo usermod -aG docker $USER`, then restart your user manager with `sudo systemctl restart user@$(id -u)`, or log in again if linger is off";
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
|
|
62
|
+
/** No Docker daemon for this server, as Settings → Computers says it (docker-daemon.ts noDockerWords). */
|
|
63
|
+
export declare const NO_DOCKER_HERE = "No Docker on this server: Render and most hosted services run none.";
|
|
64
|
+
/** Why docker is unavailable to a server in AgentRun's image that has no Docker socket: a hosted service (Fly.io, Render,
|
|
65
|
+
* a Kubernetes pod), the one-container `docker run` and deploy/'s compose file give it none, so it asks a daemon that is
|
|
66
|
+
* not there. Starting Docker or joining its group would not help. Hosted, there is no host socket to give, so the way is
|
|
67
|
+
* a vendor's computer, as Settings → Computers says (its opening sentence is the same); on a machine the person runs,
|
|
68
|
+
* compose.yaml at the repository's root mounts the host's socket, which is root on that host (compose.yaml's own header
|
|
69
|
+
* says so), so the words say that too. */
|
|
70
|
+
export declare const DOCKER_NO_SOCKET = "No Docker on this server: Render and most hosted services run none. Its agents get file tools and web_fetch but no shell. For a shell, use a vendor computer (Settings \u2192 Computers); or, on a machine you run, give this server the host's Docker socket, as `docker compose up -d` with compose.yaml at the repository's root does. That socket is root on the host, so give it only where you would give AgentRun root";
|
|
49
71
|
/** The same, for a container given the socket and refused it: the group compose.yaml adds (DOCKER_GID) is not the
|
|
50
72
|
* socket's. usermod in the container would not last past its restart. */
|
|
51
73
|
export declare const DOCKER_SOCKET_GROUP = "This server's container may not use the Docker socket: set DOCKER_GID in .env to the socket's group, as compose.yaml says, then run `docker compose up -d` again";
|
|
52
|
-
/**
|
|
53
|
-
* path is there (`exists`: the socket a failed probe names). What a failed probe says to do. */
|
|
74
|
+
/** Where this server runs: on a host, in AgentRun's own image (IMAGE_ENV), or in some other container; and how it tells
|
|
75
|
+
* whether a path is there (`exists`: the socket a failed probe names). What a failed probe says to do. */
|
|
54
76
|
export type ContainerFacts = {
|
|
55
|
-
|
|
56
|
-
image?: boolean;
|
|
77
|
+
where: "host" | "image" | "other";
|
|
57
78
|
exists?: (path: string) => boolean;
|
|
58
79
|
};
|
|
59
80
|
/** Set by AgentRun's image (packages/serve/docker/Dockerfile): the socket advice (DOCKER_NO_SOCKET, DOCKER_SOCKET_GROUP)
|
|
60
81
|
* is for it alone, and Kubernetes and other containerd runtimes, which write no mark of their own, run it too. */
|
|
61
82
|
export declare const IMAGE_ENV = "AGENTRUN_IN_IMAGE";
|
|
62
|
-
/** A container: AgentRun's image (IMAGE_ENV), or
|
|
63
|
-
*
|
|
64
|
-
export declare const containerOf: (env: NodeJS.ProcessEnv,
|
|
83
|
+
/** A container: AgentRun's image (IMAGE_ENV), or any other that computer's containerSigns sees under `root` (the
|
|
84
|
+
* filesystem's root; the tests' seam): a runtime's mark or a container's cgroup, such as a Kubernetes pod's. */
|
|
85
|
+
export declare const containerOf: (env: NodeJS.ProcessEnv, root?: string) => ContainerFacts;
|
|
65
86
|
/** How long Docker's probe may take. */
|
|
66
87
|
export declare const PROBE_TIMEOUT_MS = 5000;
|
|
67
88
|
/** What `docker version` says of this machine's Docker daemon: it answers (`up`), or why not. `absent`: no daemon
|
|
@@ -97,23 +118,26 @@ export type PlaceOffersOptions = {
|
|
|
97
118
|
/** Whether this server runs in a container, and how a path is checked, which say a failed probe's fix (containerReason);
|
|
98
119
|
* default this process's. */
|
|
99
120
|
container?: ContainerFacts;
|
|
100
|
-
/** Under --faux only:
|
|
121
|
+
/** Under --faux only: the local box answers, whatever AGENTRUN_BOXES lists, and nothing asks Docker. */
|
|
101
122
|
fauxDocker?: boolean;
|
|
102
123
|
/** Told the architecture of the Docker daemon the probe found (amd64, arm64), when Docker answers and names it: the
|
|
103
124
|
* server's check that a Docker computer's daemon is built for it (box-paths.ts dockerComputerRefusal) asks Docker
|
|
104
125
|
* nothing more. */
|
|
105
126
|
dockerArch?: (arch: string) => void;
|
|
106
127
|
};
|
|
107
|
-
/** Every box, in BOX_IDS order, as this server has it at its start (`env`: its environment, its secrets readable): a box
|
|
108
|
-
*
|
|
128
|
+
/** Every box, in BOX_IDS order, as this server has it at its start (`env`: its environment, its secrets readable): a box
|
|
129
|
+
* AGENTRUN_BOXES does not list is not enabled; a local box by Docker's probe (or `fauxDocker`); a vendor's by its
|
|
130
|
+
* provider's required keys. Rejects only for a name in AGENTRUN_BOXES that is no box. No reason holds a key or an
|
|
131
|
+
* answer's body. */
|
|
109
132
|
export declare function placeOffers(env: NodeJS.ProcessEnv, options?: PlaceOffersOptions): Promise<BoxOffer[]>;
|
|
110
|
-
/** What each available box reaches, from the server's host list (`allow`, box-settings.ts boxAllowOf)
|
|
133
|
+
/** What each available box reaches, from the server's host list (`allow`, box-settings.ts boxAllowOf). A local box's
|
|
111
134
|
* computers through their egress proxy (an allowlist), with the Docker host's own addresses it refuses when the server
|
|
112
|
-
* runs in a container (`hostAddresses`), or unavailable where `
|
|
113
|
-
* (box-paths.ts dockerComputerRefusal, docker-host-addresses.ts noHostAddresses)
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
|
|
135
|
+
* runs in a container (`local.hostAddresses`), or unavailable where `local.refused` says Docker can't run a computer
|
|
136
|
+
* here (box-paths.ts dockerComputerRefusal, docker-host-addresses.ts noHostAddresses). A vendor's box as its provider's
|
|
137
|
+
* network forms say: the list where its computers keep to one, through the egress proxy their init starts
|
|
138
|
+
* (@parcha/agentrun-computer's hosted/network.ts); nothing where they make no network but none, as the claim narrows
|
|
139
|
+
* them (computer-deps.ts networkOf), saying so. With `allow` none, none has a network. */
|
|
140
|
+
export declare function withNetworks(offers: readonly BoxOffer[], allow: readonly string[] | "none", local?: {
|
|
117
141
|
refused?: string;
|
|
118
142
|
hostAddresses?: readonly string[];
|
|
119
143
|
faux?: boolean;
|
package/dist/place-offers.js
CHANGED
|
@@ -1,42 +1,68 @@
|
|
|
1
1
|
// The boxes a place may name, as capabilities show them (places.boxes), read from the computers runs execute on: a
|
|
2
2
|
// sandbox place on box X is a sandbox computer on provider X (computer-setting.ts computerOfPlace), which a run's claim
|
|
3
|
-
// starts (workspace/).
|
|
3
|
+
// starts (workspace/). Which providers are boxes is their descriptors' facts (isBox), never a list of names. Read once,
|
|
4
|
+
// at the server's start: each fix takes a restart.
|
|
4
5
|
//
|
|
5
|
-
// AGENTRUN_BOXES lists the boxes to set up. Not set at all, it is
|
|
6
|
-
// Docker and offers it when Docker answers, so a new agent lands in its box
|
|
7
|
-
// to list. Set, it wins: a box it does not list is never probed and is
|
|
8
|
-
// lists it, an empty value or `none` sets up no box, and a name in it
|
|
9
|
-
// what to do next.
|
|
10
|
-
// provider requires are set (the server's environment, else saved in
|
|
11
|
-
// at the start: a key the vendor refuses fails the run's computer
|
|
6
|
+
// AGENTRUN_BOXES lists the boxes to set up. Not set at all, it is the boxes on this machine's container engine alone
|
|
7
|
+
// (LOCAL_BOXES, Docker's): a plain start probes Docker and offers it when Docker answers, so a new agent lands in its box
|
|
8
|
+
// (place.ts); every other box is the operator's to list. Set, it wins: a box it does not list is never probed and is
|
|
9
|
+
// unavailable, its reason naming the setting that lists it, an empty value or `none` sets up no box, and a name in it
|
|
10
|
+
// that is no box refuses the start. Every reason says what to do next. A local box is probed (`docker version`); a
|
|
11
|
+
// vendor's box is offered when the keys its computer provider requires are set (the server's environment, else saved in
|
|
12
|
+
// Settings → Computers), and is not asked anything at the start: a key the vendor refuses fails the run's computer
|
|
13
|
+
// start, in the vendor's words.
|
|
12
14
|
import { execFile } from "node:child_process";
|
|
13
15
|
import { existsSync } from "node:fs";
|
|
14
16
|
import { readFile } from "node:fs/promises";
|
|
15
17
|
import { userInfo } from "node:os";
|
|
16
|
-
import { PROVIDERS } from "@parcha/agentrun-computer";
|
|
18
|
+
import { containerSigns, PROVIDERS } from "@parcha/agentrun-computer";
|
|
19
|
+
import { BOX_ALLOW_ENV } from "./box-settings.js";
|
|
17
20
|
import { withoutSecrets } from "./secrets.js";
|
|
18
|
-
/**
|
|
19
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Whether a computer provider can be a box, read from its descriptor's facts (PROVIDERS' entry). A place names a box
|
|
23
|
+
* alone, no kind, image or network, so a run in it gets a sandbox computer on that provider with no image named
|
|
24
|
+
* (computer-setting.ts computerOfPlace), resolved and started by the claim as any computer setting is
|
|
25
|
+
* (workspace/resolve-computer.ts, computer-deps.ts computerSpecOf), and it needs:
|
|
26
|
+
* - a Linux shell with files and processes, for bash and the background tools: the provider serves the sandbox kind;
|
|
27
|
+
* - the run's folder in that shell: it takes a bind, an Archil mount or a synced folder (its derived mounts; a provider
|
|
28
|
+
* whose machines keep their own disk where the folder would be takes none);
|
|
29
|
+
* - an image with none named: its default sandbox image, or the one its prepareImage() makes;
|
|
30
|
+
* - what places.allow says: its computers keep to a host list, or reach nothing (its network forms hold allow or none).
|
|
31
|
+
* One that reaches only its vendor's own network can't be held to the list.
|
|
32
|
+
* Which mode's folder it takes (a bind in Mode 1, Archil or a synced one in Mode 2) is the run's start's check, as for
|
|
33
|
+
* any computer setting: the mode can change while the server runs.
|
|
34
|
+
*/
|
|
35
|
+
export const isBox = (entry) => entry.kinds.includes("sandbox") &&
|
|
36
|
+
entry.mounts.length > 0 &&
|
|
37
|
+
(entry.defaultImage?.sandbox !== undefined || entry.prepareImage === true) &&
|
|
38
|
+
(entry.network.includes("allow") || entry.network.includes("none"));
|
|
39
|
+
/** Every box a place may name, in the order capabilities lists them (Settings' order of providers). */
|
|
40
|
+
export const BOX_IDS = PROVIDERS.filter(isBox).map((entry) => entry.id);
|
|
41
|
+
/** The provider entry of box `id`. */
|
|
42
|
+
const boxEntry = (id) => PROVIDERS.find((entry) => entry.id === id);
|
|
43
|
+
/** The boxes on this machine's container engine (their descriptor's `local`: Docker's), the boxes a server sets up when
|
|
44
|
+
* AGENTRUN_BOXES is not set at all. Their engine is Docker, so a local box is probed at the start with `docker
|
|
45
|
+
* version` (probeDocker), its computers mount this server's paths (box-paths.ts) and keep out the Docker host's own
|
|
46
|
+
* addresses (docker-host-addresses.ts). */
|
|
47
|
+
export const LOCAL_BOXES = BOX_IDS.filter((id) => boxEntry(id).local === true);
|
|
48
|
+
/** The box a new agent that names no place and needs a shell is given (its descriptor's `defaultBox`: Docker's), by
|
|
49
|
+
* that fact, never by a name; undefined where no box's descriptor sets it. */
|
|
50
|
+
export const DEFAULT_BOX = BOX_IDS.find((id) => boxEntry(id).defaultBox === true);
|
|
20
51
|
/** What an available box reaches: the hosts of `places.allow` (`allowlist`), or nothing (`none`). */
|
|
21
52
|
export const BOX_NETWORKS = ["allowlist", "none"];
|
|
22
53
|
/** A box's state in capabilities: ready (available) or unavailable. */
|
|
23
54
|
export const BOX_STATES = ["ready", "unavailable"];
|
|
24
|
-
/** The remote boxes' keys: secrets the server holds and its computer providers read, which no run is handed
|
|
25
|
-
* (run-secrets.ts SERVER_ONLY). */
|
|
26
|
-
export const BOX_KEYS = ["DAYTONA_API_KEY", "MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"];
|
|
27
55
|
/** The setting that lists the boxes to set up: a comma list of box ids, empty or `none` for no box. */
|
|
28
56
|
export const BOXES_ENV = "AGENTRUN_BOXES";
|
|
29
|
-
/** The boxes a server sets up when AGENTRUN_BOXES is not set at all: Docker, probed as if listed. */
|
|
30
|
-
export const DEFAULT_BOXES = ["docker"];
|
|
31
57
|
/** The AGENTRUN_BOXES that sets up no box, as an empty one does. */
|
|
32
58
|
const NO_BOXES = "none";
|
|
33
|
-
/** Whether `env` leaves the boxes to this server's default (
|
|
59
|
+
/** Whether `env` leaves the boxes to this server's default (LOCAL_BOXES): AGENTRUN_BOXES is not set at all. */
|
|
34
60
|
export const boxesByDefault = (env) => env[BOXES_ENV] === undefined;
|
|
35
|
-
/** The boxes `env` lists in AGENTRUN_BOXES,
|
|
61
|
+
/** The boxes `env` lists in AGENTRUN_BOXES, LOCAL_BOXES when it is not set, none when it is empty or `none`; a name
|
|
36
62
|
* that is no box throws, naming it, and so does `none` with another. */
|
|
37
63
|
export function enabledBoxes(env) {
|
|
38
64
|
if (boxesByDefault(env))
|
|
39
|
-
return new Set(
|
|
65
|
+
return new Set(LOCAL_BOXES);
|
|
40
66
|
const names = env[BOXES_ENV].split(",").map((name) => name.trim()).filter(Boolean);
|
|
41
67
|
if (names.includes(NO_BOXES)) {
|
|
42
68
|
if (names.length > 1)
|
|
@@ -82,26 +108,29 @@ const ownGroups = () => {
|
|
|
82
108
|
catch { }
|
|
83
109
|
return { file: "/etc/group", user, ids: process.getgroups?.() ?? [] };
|
|
84
110
|
};
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
|
|
111
|
+
/** No Docker daemon for this server, as Settings → Computers says it (docker-daemon.ts noDockerWords). */
|
|
112
|
+
export const NO_DOCKER_HERE = "No Docker on this server: Render and most hosted services run none.";
|
|
113
|
+
/** Why docker is unavailable to a server in AgentRun's image that has no Docker socket: a hosted service (Fly.io, Render,
|
|
114
|
+
* a Kubernetes pod), the one-container `docker run` and deploy/'s compose file give it none, so it asks a daemon that is
|
|
115
|
+
* not there. Starting Docker or joining its group would not help. Hosted, there is no host socket to give, so the way is
|
|
116
|
+
* a vendor's computer, as Settings → Computers says (its opening sentence is the same); on a machine the person runs,
|
|
117
|
+
* compose.yaml at the repository's root mounts the host's socket, which is root on that host (compose.yaml's own header
|
|
118
|
+
* says so), so the words say that too. */
|
|
119
|
+
export const DOCKER_NO_SOCKET = `${NO_DOCKER_HERE} Its agents get file tools and web_fetch but no shell. For a shell, use a vendor computer (Settings → Computers); or, on a machine you run, give this server the host's Docker socket, as \`docker compose up -d\` with compose.yaml at the repository's root does. That socket is root on the host, so give it only where you would give AgentRun root`;
|
|
90
120
|
/** The same, for a container given the socket and refused it: the group compose.yaml adds (DOCKER_GID) is not the
|
|
91
121
|
* socket's. usermod in the container would not last past its restart. */
|
|
92
122
|
export const DOCKER_SOCKET_GROUP = "This server's container may not use the Docker socket: set DOCKER_GID in .env to the socket's group, as compose.yaml says, then run `docker compose up -d` again";
|
|
93
123
|
/** Set by AgentRun's image (packages/serve/docker/Dockerfile): the socket advice (DOCKER_NO_SOCKET, DOCKER_SOCKET_GROUP)
|
|
94
124
|
* is for it alone, and Kubernetes and other containerd runtimes, which write no mark of their own, run it too. */
|
|
95
125
|
export const IMAGE_ENV = "AGENTRUN_IN_IMAGE";
|
|
96
|
-
/** A container: AgentRun's image (IMAGE_ENV), or
|
|
97
|
-
*
|
|
98
|
-
export const containerOf = (env,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
126
|
+
/** A container: AgentRun's image (IMAGE_ENV), or any other that computer's containerSigns sees under `root` (the
|
|
127
|
+
* filesystem's root; the tests' seam): a runtime's mark or a container's cgroup, such as a Kubernetes pod's. */
|
|
128
|
+
export const containerOf = (env, root = "/") => ({
|
|
129
|
+
where: env[IMAGE_ENV] === "1" ? "image" : containerSigns(root) !== undefined ? "other" : "host",
|
|
130
|
+
});
|
|
102
131
|
/** A reason in a container that is not AgentRun's image: the host's words, said to be the container's (its own Docker, its
|
|
103
132
|
* own docker group), never compose.yaml's, which is not there to use. */
|
|
104
|
-
const inOtherContainer = (container, reason) => (container.
|
|
133
|
+
const inOtherContainer = (container, reason) => (container.where === "other" ? `This server runs in a container. ${reason}` : reason);
|
|
105
134
|
/** The daemon address docker names when it cannot connect ("Cannot connect to the Docker daemon at unix:///….sock."):
|
|
106
135
|
* the one its DOCKER_HOST or current context resolved to. Matched, never shown. */
|
|
107
136
|
const DAEMON_AT = /docker daemon at ([a-z]+:\/\/\S+?)\.?(?:\s|$)/i;
|
|
@@ -117,7 +146,7 @@ function socketThere(endpoint, env, exists) {
|
|
|
117
146
|
* a host and in another container (inOtherContainer), and for a socket that is there and whose daemon does not answer
|
|
118
147
|
* (the host's Docker is down). */
|
|
119
148
|
const containerReason = (answer, env, container) => {
|
|
120
|
-
if (
|
|
149
|
+
if (container.where !== "image" || answer.failed === undefined)
|
|
121
150
|
return undefined;
|
|
122
151
|
if (answer.denied)
|
|
123
152
|
return DOCKER_SOCKET_GROUP;
|
|
@@ -149,13 +178,16 @@ export async function askDockerDaemon(env, signal, groups = ownGroups(), contain
|
|
|
149
178
|
const code = error?.code;
|
|
150
179
|
resolve({ ...(error ? { failed: typeof code === "number" ? `exit ${code}` : errorName(error), ...(SOCKET_DENIED.test(String(stderr)) ? { denied: true } : {}), ...endpointIn(stderr) } : {}), out: String(stdout) });
|
|
151
180
|
}));
|
|
152
|
-
|
|
181
|
+
// An absent daemon's reason is read by no one: Settings → Computers and a run's start say noDockerWords instead
|
|
182
|
+
// (computers.ts, resolve-computer.ts), so only a refused socket's words are said to be another container's.
|
|
183
|
+
const absent = (reason) => ({ up: false, absent: true, reason });
|
|
153
184
|
// The box's probe runs once, at the start: each fix takes a restart. Docker is on by default, so its reason is often a
|
|
154
185
|
// first-time user's first read: what is wrong in plain words, what the probe saw, then what to do.
|
|
155
|
-
// In
|
|
156
|
-
|
|
186
|
+
// In AgentRun's image, a socket that refused this process is that socket's group's to fix (containerReason), never the
|
|
187
|
+
// host's; a socket that is not there is no daemon, which every reader words as none (noDockerWords).
|
|
188
|
+
const inside = answer.denied ? containerReason(answer, env, container) : undefined;
|
|
157
189
|
if (inside !== undefined)
|
|
158
|
-
return { up: false, absent:
|
|
190
|
+
return { up: false, absent: false, reason: inside };
|
|
159
191
|
if (answer.failed === "ENOENT")
|
|
160
192
|
return absent("Docker isn't running on this machine (no docker command on PATH): install or start Docker, then restart AgentRun");
|
|
161
193
|
// Its socket refused this process: the group it lacks, and how to get it without a reboot (the words, never docker's):
|
|
@@ -202,10 +234,10 @@ async function probeDocker(env, timeoutMs, groups, container, arch) {
|
|
|
202
234
|
arch?.(named);
|
|
203
235
|
return { id: "docker", available: true };
|
|
204
236
|
}
|
|
205
|
-
/** A
|
|
237
|
+
/** A vendor's box's offer: available when every key its computer provider requires is set, read as a run's claim reads
|
|
206
238
|
* it (`keyOf`: the server's environment, else the key saved in Settings → Computers); nothing is asked of the vendor. */
|
|
207
239
|
async function remoteOffer(id, keyOf) {
|
|
208
|
-
const required = (
|
|
240
|
+
const required = boxEntry(id).keys.filter((key) => key.required).map((key) => key.name);
|
|
209
241
|
const missing = [];
|
|
210
242
|
for (const name of required)
|
|
211
243
|
if ((await keyOf(name)) === undefined)
|
|
@@ -214,41 +246,51 @@ async function remoteOffer(id, keyOf) {
|
|
|
214
246
|
return { id, available: false, reason: `needs ${missing.join(" and ")}` };
|
|
215
247
|
return { id, available: true, reason: "configured; not probed at start" };
|
|
216
248
|
}
|
|
217
|
-
/** Every box, in BOX_IDS order, as this server has it at its start (`env`: its environment, its secrets readable): a box
|
|
218
|
-
*
|
|
249
|
+
/** Every box, in BOX_IDS order, as this server has it at its start (`env`: its environment, its secrets readable): a box
|
|
250
|
+
* AGENTRUN_BOXES does not list is not enabled; a local box by Docker's probe (or `fauxDocker`); a vendor's by its
|
|
251
|
+
* provider's required keys. Rejects only for a name in AGENTRUN_BOXES that is no box. No reason holds a key or an
|
|
252
|
+
* answer's body. */
|
|
219
253
|
export async function placeOffers(env, options = {}) {
|
|
220
254
|
const enabled = enabledBoxes(env);
|
|
221
255
|
const keyOf = options.keyOf ?? (async (name) => env[name] || undefined);
|
|
222
256
|
return Promise.all(BOX_IDS.map(async (id) => {
|
|
257
|
+
const local = LOCAL_BOXES.includes(id);
|
|
223
258
|
// The tests' faux docker stands in whatever AGENTRUN_BOXES lists, as the old faux box did.
|
|
224
|
-
if (
|
|
259
|
+
if (local && options.fauxDocker)
|
|
225
260
|
return { id, available: true, reason: "a faux docker (tests)" };
|
|
226
261
|
if (!enabled.has(id))
|
|
227
262
|
return { id, available: false, reason: notEnabled(id, enabled) };
|
|
228
|
-
|
|
263
|
+
// A local box's engine is Docker (LOCAL_BOXES), so its probe is Docker's own, which answers as the docker box.
|
|
264
|
+
if (local)
|
|
229
265
|
return probeDocker(env, options.timeoutMs ?? PROBE_TIMEOUT_MS, options.groups ?? ownGroups(), options.container ?? containerOf(env), options.dockerArch);
|
|
230
266
|
return remoteOffer(id, keyOf);
|
|
231
267
|
}));
|
|
232
268
|
}
|
|
233
|
-
/** What each available box reaches, from the server's host list (`allow`, box-settings.ts boxAllowOf)
|
|
269
|
+
/** What each available box reaches, from the server's host list (`allow`, box-settings.ts boxAllowOf). A local box's
|
|
234
270
|
* computers through their egress proxy (an allowlist), with the Docker host's own addresses it refuses when the server
|
|
235
|
-
* runs in a container (`hostAddresses`), or unavailable where `
|
|
236
|
-
* (box-paths.ts dockerComputerRefusal, docker-host-addresses.ts noHostAddresses)
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
|
|
271
|
+
* runs in a container (`local.hostAddresses`), or unavailable where `local.refused` says Docker can't run a computer
|
|
272
|
+
* here (box-paths.ts dockerComputerRefusal, docker-host-addresses.ts noHostAddresses). A vendor's box as its provider's
|
|
273
|
+
* network forms say: the list where its computers keep to one, through the egress proxy their init starts
|
|
274
|
+
* (@parcha/agentrun-computer's hosted/network.ts); nothing where they make no network but none, as the claim narrows
|
|
275
|
+
* them (computer-deps.ts networkOf), saying so. With `allow` none, none has a network. */
|
|
276
|
+
export function withNetworks(offers, allow, local = {}) {
|
|
240
277
|
return offers.map((offer) => {
|
|
241
278
|
if (!offer.available)
|
|
242
279
|
return offer;
|
|
243
|
-
if (offer.id
|
|
244
|
-
if (
|
|
245
|
-
return { id: offer.id, available: false, state: "unavailable", reason:
|
|
246
|
-
if (
|
|
280
|
+
if (LOCAL_BOXES.includes(offer.id)) {
|
|
281
|
+
if (local.refused !== undefined)
|
|
282
|
+
return { id: offer.id, available: false, state: "unavailable", reason: local.refused };
|
|
283
|
+
if (local.faux)
|
|
247
284
|
return { ...offer, network: "none", network_reason: "a faux docker (tests)" };
|
|
248
285
|
if (allow === "none")
|
|
249
286
|
return { ...offer, network: "none", network_reason: "AGENTRUN_BOX_ALLOW is none" };
|
|
250
|
-
return { ...offer, network: "allowlist", ...(
|
|
287
|
+
return { ...offer, network: "allowlist", ...(local.hostAddresses?.length ? { host_addresses: [...local.hostAddresses] } : {}) };
|
|
251
288
|
}
|
|
252
|
-
|
|
289
|
+
if (allow === "none")
|
|
290
|
+
return { ...offer, network: "none" };
|
|
291
|
+
const entry = boxEntry(offer.id);
|
|
292
|
+
if (entry.network.includes("allow"))
|
|
293
|
+
return { ...offer, network: "allowlist" };
|
|
294
|
+
return { ...offer, network: "none", network_reason: `${entry.label}'s computers run with no network, whatever ${BOX_ALLOW_ENV} lists` };
|
|
253
295
|
});
|
|
254
296
|
}
|
package/dist/place.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type BoxOffer } from "./place-offers.js";
|
|
2
2
|
import { type InputIssue } from "./errors.js";
|
|
3
3
|
export declare const PLACE_MODES: readonly ["runner", "sandbox"];
|
|
4
4
|
export type PlaceMode = (typeof PLACE_MODES)[number];
|
|
@@ -6,15 +6,19 @@ export type Place = {
|
|
|
6
6
|
mode: "runner";
|
|
7
7
|
} | {
|
|
8
8
|
mode: "sandbox";
|
|
9
|
-
box:
|
|
9
|
+
box: string;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
export declare const RUN_BOXES: readonly BoxId[];
|
|
13
|
-
/** The boxes this server gives runs, from what it found at its start (place-offers.ts): a box runs execute in that it
|
|
14
|
-
* has, and no other. */
|
|
11
|
+
/** Every box, from what this server found at its start (place-offers.ts): one it did not find is not set up. */
|
|
15
12
|
export declare function boxAvailability(registry: readonly BoxOffer[]): BoxOffer[];
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
13
|
+
/** What a new agent that would get Docker's box sets where this server does not have it: a box, listing the boxes this
|
|
14
|
+
* server has (never picking one), or the runner. */
|
|
15
|
+
export declare function placeToName(registry: readonly BoxOffer[]): string;
|
|
16
|
+
/** Why such an agent is refused: it names a box (placeToName); and why Docker's box is not here, in the words its offer
|
|
17
|
+
* gave (its probe's, with their fix: start Docker, join its group), where it gave some. */
|
|
18
|
+
export declare const nameABox: (registry: readonly BoxOffer[]) => string;
|
|
19
|
+
/** The place a new agentic definition that names none is saved with: Docker's box where this server has it; else none,
|
|
20
|
+
* with `reason`, the words such a definition is refused in (nameABox), and `why` Docker's box is not here, in its probe's
|
|
21
|
+
* own words. A workflow is never given one. */
|
|
18
22
|
export declare function newAgentPlace(registry: readonly BoxOffer[]): {
|
|
19
23
|
place: Place;
|
|
20
24
|
} | {
|
|
@@ -26,34 +30,50 @@ export declare function newAgentPlace(registry: readonly BoxOffer[]): {
|
|
|
26
30
|
* background tools); the runner for a workflow, which is never given a box, for one whose tools need no shell (none, or
|
|
27
31
|
* only read and write: a container would only hold up its start), and for one that names a tool the box refuses (the
|
|
28
32
|
* browser, runner-only for now). */
|
|
29
|
-
export declare function defaultPlaceOf(kind: "agentic" | "workflow", tools: readonly unknown[], registry: readonly BoxOffer[], flags:
|
|
33
|
+
export declare function defaultPlaceOf(kind: "agentic" | "workflow", tools: readonly unknown[], registry: readonly BoxOffer[], flags: ToolFlags): Place;
|
|
34
|
+
type ToolFlags = (tool: string) => {
|
|
30
35
|
readonly sandboxOnly?: true;
|
|
31
36
|
readonly runnerOnly?: true;
|
|
32
|
-
} | undefined
|
|
37
|
+
} | undefined;
|
|
38
|
+
/** The refusal of an agentic definition that names no place (noPlaceIssue), at its create or at an edit that would
|
|
39
|
+
* save it, where it would be given the default box (it names no tools, `tools` undefined, so it would get a shell, or a
|
|
40
|
+
* tool that runs only in a box) and this server does not have Docker's box, and where the runner has no shell
|
|
41
|
+
* (`runnerShell` false: Mode 1). On Mode 2 the runner's exec is a shell, and such a definition saves for the runner as
|
|
42
|
+
* it always did, its tools checked there (runnable.ts). Undefined for one that saves. */
|
|
43
|
+
export declare function noBoxRefusal(tools: readonly unknown[] | undefined, registry: readonly BoxOffer[], flags: ToolFlags, runnerShell: boolean): InputIssue | undefined;
|
|
44
|
+
/** The refusal of a revision that names no place where Docker's box is not here, at definition.place: its words, and
|
|
45
|
+
* what to set as its fix, so no example of a place is picked for it. */
|
|
46
|
+
export declare const noPlaceIssue: (registry: readonly BoxOffer[]) => InputIssue;
|
|
33
47
|
/** The tools a new agent in the default box is given when its definition names none: a shell, and the background tools
|
|
34
48
|
* that start, read, feed, signal and list commands that outlive one call (background.ts SHELL_TOOLS, which a test holds
|
|
35
49
|
* this list to; written out here, since background.ts reads this module). A definition that names its tools, an empty
|
|
36
50
|
* list included, keeps exactly those. */
|
|
37
51
|
export declare const NEW_AGENT_TOOLS: readonly string[];
|
|
38
|
-
/** Why a sandbox-only tool (bash) cannot run on this server: no box
|
|
39
|
-
* Undefined when one is. */
|
|
40
|
-
export declare function noBoxReason(registry: readonly BoxOffer[]): string | undefined;
|
|
52
|
+
/** Why a sandbox-only tool (bash) cannot run on this server: no box is available, each box AGENTRUN_BOXES lists
|
|
53
|
+
* (`listed`) with its reason, then the boxes it does not list. Undefined when one is. */
|
|
54
|
+
export declare function noBoxReason(registry: readonly BoxOffer[], listed: ReadonlySet<string>): string | undefined;
|
|
41
55
|
/** The start banner's words on the boxes: which are ready for a sandbox agent's tools, then why each box is not that
|
|
42
|
-
* AGENTRUN_BOXES lists (`listed`),
|
|
43
|
-
* `byDefault`, with AGENTRUN_BOXES not set at all: short,
|
|
44
|
-
|
|
56
|
+
* AGENTRUN_BOXES lists (`listed`), and, when none is ready, the boxes it does not list, with what to do.
|
|
57
|
+
* `byDefault`, with AGENTRUN_BOXES not set at all: short, the local box alone, said to be on by default, or why it is
|
|
58
|
+
* not, and where a new agent with no place goes then: it names its place, or, where the runner has a shell
|
|
59
|
+
* (`runnerShell`: Mode 2), it runs on the runner (placesOf). */
|
|
60
|
+
export declare function boxesLine(registry: readonly BoxOffer[], listed: ReadonlySet<string>, allow?: readonly string[] | "none", byDefault?: boolean, runnerShell?: boolean): string;
|
|
45
61
|
/** `places` in capabilities: the modes a revision may name, the place a new agent is saved with and a revision that
|
|
46
|
-
* names none runs in (`default_place
|
|
47
|
-
*
|
|
48
|
-
|
|
62
|
+
* names none runs in (`default_place`), each box, and the hosts a box whose `network` is `allowlist` reaches (`allow`,
|
|
63
|
+
* box-settings.ts boxAllowOf; empty for `none`). `default_place` is Docker's box where this server has it; else, where
|
|
64
|
+
* the runner has a shell (`runnerShell`: Mode 2's Archil exec), the runner; else null, no default: a new agent names its
|
|
65
|
+
* place, and `default_reason` is the words a no-place create is refused in (noBoxRefusal). `default_reason` is there
|
|
66
|
+
* exactly when `default_place` is null. */
|
|
67
|
+
export declare const placesOf: (registry: readonly BoxOffer[], allow?: readonly string[] | "none", runnerShell?: boolean) => {
|
|
49
68
|
boxes: BoxOffer[];
|
|
50
69
|
allow: string[];
|
|
51
70
|
default_place: Place;
|
|
71
|
+
default_reason?: undefined;
|
|
52
72
|
modes: ("runner" | "sandbox")[];
|
|
53
73
|
} | {
|
|
54
74
|
boxes: BoxOffer[];
|
|
55
75
|
allow: string[];
|
|
56
|
-
default_place:
|
|
76
|
+
default_place: null;
|
|
57
77
|
default_reason: string;
|
|
58
78
|
modes: ("runner" | "sandbox")[];
|
|
59
79
|
};
|
|
@@ -66,3 +86,4 @@ export declare const placeFix: (place: Place) => string;
|
|
|
66
86
|
/** What is wrong with `place` as a definition gives it, as issues at `field`. Each names its fix: the field to remove,
|
|
67
87
|
* or the place to copy, the one it most likely meant. */
|
|
68
88
|
export declare function placeIssues(place: unknown, field: string): InputIssue[];
|
|
89
|
+
export {};
|