@parcha/agentrun-serve 0.1.0-beta.36 → 0.1.0-beta.38
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 +452 -0
- package/README.md +311 -142
- package/dist/agent-rows.d.ts +1 -1
- package/dist/agents-store.d.ts +35 -3
- package/dist/agents-store.js +39 -14
- package/dist/answer-json.d.ts +34 -1
- package/dist/answer-json.js +91 -9
- package/dist/api-only.d.ts +1 -1
- package/dist/api-only.js +2 -2
- package/dist/attach-conformance-cli.d.ts +1 -0
- package/dist/attach-conformance-cli.js +18 -0
- package/dist/attach-conformance.d.ts +25 -0
- package/dist/attach-conformance.js +343 -0
- package/dist/browser-cost.d.ts +1 -1
- package/dist/browser-cost.js +52 -93
- package/dist/browser-live.d.ts +20 -8
- package/dist/browser-live.js +50 -27
- package/dist/cap.d.ts +0 -407
- package/dist/cap.js +4 -1028
- package/dist/catalog.d.ts +1 -12
- package/dist/catalog.js +4 -34
- package/dist/cli.js +13 -4
- package/dist/composio-preset.d.ts +53 -0
- package/dist/composio-preset.js +221 -0
- package/dist/computer-attach.d.ts +125 -0
- package/dist/computer-attach.js +330 -0
- package/dist/computer-calls.d.ts +60 -0
- package/dist/computer-calls.js +209 -0
- package/dist/computer-channel.d.ts +57 -0
- package/dist/computer-channel.js +115 -0
- package/dist/computer-commands.d.ts +1 -1
- package/dist/computer-held-routes.d.ts +35 -0
- package/dist/computer-held-routes.js +106 -0
- package/dist/computer-held.d.ts +48 -0
- package/dist/computer-held.js +87 -0
- package/dist/computer-keys.d.ts +21 -1
- package/dist/computer-keys.js +53 -11
- package/dist/computer-live.d.ts +165 -0
- package/dist/computer-live.js +655 -0
- package/dist/computer-setting.d.ts +15 -2
- package/dist/computer-setting.js +20 -4
- package/dist/computer-view.d.ts +14 -0
- package/dist/computer-view.js +51 -3
- package/dist/computer-viewer.d.ts +6 -0
- package/dist/computer-viewer.js +311 -0
- package/dist/computers.d.ts +37 -8
- package/dist/computers.js +62 -14
- package/dist/console/assets/index-CjqQirbo.css +1 -0
- package/dist/console/assets/index-b6-XY5A9.js +576 -0
- package/dist/console/index.html +2 -2
- package/dist/console-links.d.ts +2 -0
- package/dist/console-links.js +3 -0
- package/dist/decisions.js +4 -0
- package/dist/faux-computers.d.ts +9 -20
- package/dist/faux-computers.js +56 -26
- package/dist/github-connection.d.ts +10 -2
- package/dist/github-connection.js +65 -2
- package/dist/github-faux.js +1 -1
- package/dist/graph-view.d.ts +1 -1
- package/dist/harness-opencode/adapter.js +7 -3
- package/dist/harness-opencode/facts.js +0 -2
- package/dist/harness-opencode/host/policy.d.ts +2 -5
- package/dist/harness-opencode/host/policy.js +8 -32
- package/dist/harness-table.d.ts +0 -2
- package/dist/harness-table.js +0 -2
- package/dist/harness.d.ts +1 -0
- package/dist/harness.js +35 -1
- package/dist/host-tools.d.ts +2 -6
- package/dist/host-tools.js +7 -10
- package/dist/hosted-search.d.ts +5 -6
- package/dist/hosted-search.js +2 -28
- package/dist/import-sources.d.ts +10 -0
- package/dist/import-sources.js +44 -2
- package/dist/import.d.ts +3 -3
- package/dist/import.js +37 -6
- package/dist/key-words.d.ts +3 -2
- package/dist/key-words.js +4 -2
- package/dist/learn/check.d.ts +10 -2
- package/dist/learn/check.js +13 -5
- package/dist/learn/commit.d.ts +14 -2
- package/dist/learn/commit.js +23 -9
- package/dist/learn/compile.d.ts +243 -0
- package/dist/learn/compile.js +471 -0
- package/dist/learn/folder.d.ts +6 -0
- package/dist/learn/folder.js +4 -1
- package/dist/learn/general.d.ts +69 -0
- package/dist/learn/general.js +75 -0
- package/dist/learn/grade.d.ts +5 -1
- package/dist/learn/grade.js +29 -7
- package/dist/learn/notes.d.ts +8 -0
- package/dist/learn/notes.js +18 -0
- package/dist/learn/promote.d.ts +253 -0
- package/dist/learn/promote.js +428 -0
- package/dist/learn/refit.d.ts +39 -0
- package/dist/learn/refit.js +236 -0
- package/dist/learn/reflect.d.ts +9 -20
- package/dist/learn/reflect.js +18 -125
- package/dist/learn/replay-calls.d.ts +63 -0
- package/dist/learn/replay-calls.js +158 -0
- package/dist/learn/skills.d.ts +50 -14
- package/dist/learn/skills.js +183 -47
- package/dist/learn/workflow-nodes.d.ts +15 -0
- package/dist/learn/workflow-nodes.js +44 -0
- package/dist/learned-nodes.d.ts +50 -2
- package/dist/learned-nodes.js +41 -2
- package/dist/learned-workflow.d.ts +43 -3
- package/dist/learned-workflow.js +170 -28
- package/dist/learning-batch.d.ts +283 -0
- package/dist/learning-batch.js +574 -0
- package/dist/learning-cost.d.ts +18 -6
- package/dist/learning-cost.js +15 -7
- package/dist/learning-evals.d.ts +33 -0
- package/dist/learning-evals.js +98 -0
- package/dist/learning-routes.d.ts +37 -2
- package/dist/learning-routes.js +52 -8
- package/dist/learning-words.d.ts +13 -0
- package/dist/learning-words.js +13 -0
- package/dist/learning.d.ts +55 -17
- package/dist/learning.js +91 -48
- package/dist/live/stream.js +6 -3
- package/dist/live/translate.d.ts +4 -3
- package/dist/live/translate.js +8 -4
- package/dist/live-reach.d.ts +37 -0
- package/dist/live-reach.js +62 -0
- package/dist/llm.js +0 -3
- package/dist/mcp-gateway.d.ts +21 -20
- package/dist/mcp-gateway.js +76 -55
- package/dist/mcp-oauth.d.ts +62 -7
- package/dist/mcp-oauth.js +134 -19
- package/dist/mcp-pin-first.d.ts +37 -0
- package/dist/mcp-pin-first.js +107 -0
- package/dist/mcp-private-hosts.d.ts +4 -4
- package/dist/mcp-private-hosts.js +20 -12
- package/dist/mcp-probe.d.ts +27 -11
- package/dist/mcp-probe.js +60 -42
- package/dist/mcp-secret-writes.js +4 -0
- package/dist/mcp-servers-store.d.ts +115 -25
- package/dist/mcp-servers-store.js +241 -43
- package/dist/mcp-sources.d.ts +39 -0
- package/dist/mcp-sources.js +74 -0
- package/dist/mcp-store.d.ts +21 -4
- package/dist/mcp-store.js +33 -8
- package/dist/mcp-wire.d.ts +22 -0
- package/dist/mcp-wire.js +36 -0
- package/dist/mcp.js +3 -3
- package/dist/meta-tool-names.d.ts +1 -0
- package/dist/meta-tool-names.js +3 -0
- package/dist/model-form.d.ts +26 -0
- package/dist/model-form.js +80 -0
- package/dist/model.d.ts +13 -0
- package/dist/model.js +69 -25
- package/dist/monid.d.ts +51 -25
- package/dist/monid.js +226 -140
- package/dist/openapi.js +694 -59
- package/dist/page.d.ts +18 -0
- package/dist/page.js +48 -20
- package/dist/paid-calls.d.ts +26 -29
- package/dist/paid-calls.js +46 -102
- package/dist/place-offers.d.ts +2 -3
- package/dist/place-offers.js +3 -7
- package/dist/place.js +1 -2
- package/dist/print.d.ts +15 -1
- package/dist/print.js +14 -3
- package/dist/propose.d.ts +10 -1
- package/dist/propose.js +30 -10
- package/dist/provider.js +12 -4
- package/dist/reflect-range.d.ts +8 -1
- package/dist/reflect-range.js +3 -2
- package/dist/rows.d.ts +5 -3
- package/dist/rows.js +15 -4
- package/dist/run-launch.d.ts +27 -2
- package/dist/run-launch.js +15 -4
- package/dist/run-learning-served.d.ts +13 -2
- package/dist/run-manifest.d.ts +5 -0
- package/dist/run-manifest.js +20 -0
- package/dist/run-reads-over-store.d.ts +1 -1
- package/dist/run-repo.d.ts +20 -0
- package/dist/run-repo.js +63 -0
- package/dist/run-secrets.js +2 -3
- package/dist/run-timeline-served.d.ts +1 -1
- package/dist/run-timeline-served.js +5 -2
- package/dist/run-view.d.ts +19 -8
- package/dist/run-view.js +62 -26
- package/dist/runnable.d.ts +0 -3
- package/dist/runnable.js +37 -29
- package/dist/runner/adapter-loop.d.ts +47 -17
- package/dist/runner/adapter-loop.js +1427 -303
- package/dist/runner/adapter-run-spec.d.ts +23 -9
- package/dist/runner/adapter-run-spec.js +162 -56
- package/dist/runner/adapters/pi-computer.d.ts +9 -0
- package/dist/runner/adapters/pi-computer.js +51 -0
- package/dist/runner/adapters/pi.d.ts +25 -11
- package/dist/runner/adapters/pi.js +168 -45
- package/dist/runner/beside.d.ts +7 -3
- package/dist/runner/beside.js +21 -11
- package/dist/runner/claim-secrets.d.ts +4 -0
- package/dist/runner/claim-secrets.js +6 -1
- package/dist/runner/cli-run-spec.d.ts +20 -3
- package/dist/runner/cli-run-spec.js +174 -64
- package/dist/runner/commands.d.ts +3 -1
- package/dist/runner/commands.js +28 -3
- package/dist/runner/computer-channel.d.ts +34 -0
- package/dist/runner/computer-channel.js +62 -0
- package/dist/runner/conformance/harness.d.ts +3 -0
- package/dist/runner/conformance/harness.js +224 -17
- package/dist/runner/conformance/subject.d.ts +12 -5
- package/dist/runner/dispatch.js +3 -0
- package/dist/runner/end-of-run.d.ts +23 -12
- package/dist/runner/end-of-run.js +41 -16
- package/dist/runner/feedback-round.d.ts +52 -0
- package/dist/runner/feedback-round.js +79 -0
- package/dist/runner/github-app.d.ts +2 -1
- package/dist/runner/github-app.js +4 -2
- package/dist/runner/harness-loops.js +15 -1
- package/dist/runner/held-run.d.ts +65 -0
- package/dist/runner/held-run.js +158 -0
- package/dist/runner/journal-kinds.d.ts +44 -7
- package/dist/runner/journal-kinds.js +29 -0
- package/dist/runner/journal-reader.d.ts +5 -4
- package/dist/runner/journal-reader.js +12 -10
- package/dist/runner/learning-ask.d.ts +7 -1
- package/dist/runner/learning-ask.js +21 -6
- package/dist/runner/learning-dispatch.d.ts +22 -0
- package/dist/runner/learning-dispatch.js +77 -10
- package/dist/runner/learning-end.d.ts +69 -13
- package/dist/runner/learning-end.js +340 -87
- package/dist/runner/learning-factory.d.ts +1 -1
- package/dist/runner/learning-factory.js +11 -5
- package/dist/runner/learning-loop.d.ts +86 -8
- package/dist/runner/learning-loop.js +178 -23
- package/dist/runner/learning-seed.d.ts +11 -0
- package/dist/runner/learning-seed.js +27 -0
- package/dist/runner/live-ticker.js +1 -0
- package/dist/runner/loop-contract.d.ts +26 -3
- package/dist/runner/loop.d.ts +21 -2
- package/dist/runner/loop.js +23 -2
- package/dist/runner/main.d.ts +13 -1
- package/dist/runner/main.js +27 -5
- package/dist/runner/mcp-claim.d.ts +15 -8
- package/dist/runner/mcp-claim.js +176 -71
- package/dist/runner/mcp-github.js +1 -1
- package/dist/runner/mcp-run.d.ts +21 -57
- package/dist/runner/mcp-run.js +25 -85
- package/dist/runner/meta-tools.d.ts +37 -0
- package/dist/runner/meta-tools.js +268 -0
- package/dist/runner/metrics.d.ts +11 -2
- package/dist/runner/metrics.js +26 -5
- package/dist/runner/model-route.js +12 -3
- package/dist/runner/monid-run.d.ts +16 -0
- package/dist/runner/monid-run.js +96 -0
- package/dist/runner/pr-checkout.d.ts +1 -0
- package/dist/runner/pr-checkout.js +1 -1
- package/dist/runner/promotion.d.ts +80 -0
- package/dist/runner/promotion.js +562 -0
- package/dist/runner/reflect-hook.d.ts +46 -13
- package/dist/runner/reflect-hook.js +149 -48
- package/dist/runner/runner.d.ts +26 -0
- package/dist/runner/runner.js +208 -17
- package/dist/runner/scratch-sweep.d.ts +13 -0
- package/dist/runner/scratch-sweep.js +62 -0
- package/dist/runner/sessions.d.ts +9 -4
- package/dist/runner/sessions.js +5 -1
- package/dist/runner/step-guard.d.ts +62 -0
- package/dist/runner/step-guard.js +93 -0
- package/dist/runner/store-port.d.ts +4 -2
- package/dist/runner/store-secrets.js +4 -3
- package/dist/runner/subagent.d.ts +0 -3
- package/dist/runner/subagent.js +10 -13
- package/dist/runner/workflow-first.d.ts +216 -0
- package/dist/runner/workflow-first.js +303 -0
- package/dist/runner/workflow-host.d.ts +6 -1
- package/dist/runner/workflow-host.js +1 -1
- package/dist/runner/workflow-loop.d.ts +1 -1
- package/dist/runner/workflow-loop.js +17 -10
- package/dist/runner/workflow-spec.d.ts +15 -2
- package/dist/runner/workflow-spec.js +63 -23
- package/dist/runs-over-store.d.ts +17 -3
- package/dist/runs-over-store.js +59 -20
- package/dist/seal-key.js +3 -3
- package/dist/sealed-settings-store.d.ts +5 -2
- package/dist/sealed-settings-store.js +10 -4
- package/dist/secret-writes.d.ts +5 -4
- package/dist/secret-writes.js +5 -4
- package/dist/server-secrets-store.d.ts +4 -3
- package/dist/server-secrets-store.js +15 -9
- package/dist/server-secrets.js +3 -2
- package/dist/server.d.ts +119 -18
- package/dist/server.js +841 -202
- package/dist/settings-wake.d.ts +23 -0
- package/dist/settings-wake.js +65 -0
- package/dist/standard-webhooks.d.ts +4 -1
- package/dist/standard-webhooks.js +8 -4
- package/dist/store/agent-body.d.ts +14 -3
- package/dist/store/agent-body.js +14 -10
- package/dist/store/command-wake.d.ts +13 -0
- package/dist/store/command-wake.js +37 -0
- package/dist/store/dialect.d.ts +6 -0
- package/dist/store/dialect.js +5 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/journal/storage.d.ts +3 -2
- package/dist/store/journal/storage.js +13 -5
- package/dist/store/postgres/connection.js +3 -1
- package/dist/store/postgres/dialect.js +4 -0
- package/dist/store/postgres/migrations/0005_learning_rounds.sql +14 -0
- package/dist/store/postgres/migrations/0006_run_changes_channel_attempts.sql +57 -0
- package/dist/store/postgres/migrations/0007_viewer_host.sql +11 -0
- package/dist/store/postgres/migrations/0008_paired_computers.sql +30 -0
- package/dist/store/postgres/migrations/0009_commands_answer.sql +10 -0
- package/dist/store/postgres/migrations/0010_imported_templates.sql +18 -0
- package/dist/store/postgres/migrations/0011_revision_mcp_pin.sql +13 -0
- package/dist/store/schema.d.ts +10 -1
- package/dist/store/schema.js +104 -15
- package/dist/store/sqlite/connection.d.ts +2 -2
- package/dist/store/sqlite/connection.js +2 -2
- package/dist/store/sqlite/run-patch.d.ts +7 -5
- package/dist/store/sqlite/run-patch.js +45 -18
- package/dist/store/sqlite/store.js +331 -72
- package/dist/store/store.d.ts +312 -21
- package/dist/store/store.js +12 -1
- package/dist/store-reads/cap.d.ts +1 -1
- package/dist/store-reads/cap.js +8 -1
- package/dist/store-reads/decisions.d.ts +2 -2
- package/dist/store-reads/decisions.js +1 -1
- package/dist/store-reads/import-summary.d.ts +1 -1
- package/dist/store-reads/journal.d.ts +30 -5
- package/dist/store-reads/journal.js +128 -56
- package/dist/store-reads/learning.d.ts +114 -12
- package/dist/store-reads/learning.js +238 -48
- package/dist/store-reads/loop.d.ts +61 -0
- package/dist/store-reads/loop.js +111 -0
- package/dist/store-reads/runs.d.ts +1 -1
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-view.d.ts +6 -0
- package/dist/store-view.js +59 -26
- package/dist/template-eval.d.ts +18 -9
- package/dist/template-eval.js +95 -68
- package/dist/template-github-permissions.d.ts +24 -10
- package/dist/template-github-permissions.js +36 -15
- package/dist/template-import.d.ts +31 -0
- package/dist/template-import.js +121 -0
- package/dist/template-source.d.ts +51 -0
- package/dist/template-source.js +371 -0
- package/dist/templates.d.ts +218 -46
- package/dist/templates.js +493 -181
- package/dist/timeline/computer.d.ts +48 -0
- package/dist/timeline/computer.js +169 -0
- package/dist/timeline/index.d.ts +4 -3
- package/dist/timeline/index.js +4 -3
- package/dist/timeline/labels.d.ts +6 -2
- package/dist/timeline/labels.js +93 -2
- package/dist/timeline/origin.d.ts +19 -5
- package/dist/timeline/origin.js +11 -4
- package/dist/timeline/timeline.d.ts +22 -1
- package/dist/timeline/timeline.js +34 -18
- package/dist/timeline/util.d.ts +4 -0
- package/dist/timeline/util.js +14 -0
- package/dist/tool-gate.d.ts +84 -50
- package/dist/tool-gate.js +179 -101
- package/dist/tool-keys.d.ts +4 -1
- package/dist/tool-keys.js +8 -3
- package/dist/tool-list.d.ts +26 -0
- package/dist/tool-list.js +43 -0
- package/dist/tool-names.d.ts +71 -0
- package/dist/tool-names.js +99 -0
- package/dist/tool-plane.d.ts +33 -27
- package/dist/tool-plane.js +72 -39
- package/dist/tools.d.ts +32 -7
- package/dist/tools.js +37 -24
- package/dist/trigger-adapter.d.ts +4 -0
- package/dist/trigger-secrets-shown.d.ts +2 -2
- package/dist/trigger-secrets-shown.js +1 -1
- package/dist/trigger-signatures.d.ts +25 -6
- package/dist/trigger-signatures.js +41 -7
- package/dist/trigger-targets.d.ts +2 -0
- package/dist/trigger-targets.js +1 -0
- package/dist/trigger-webhook.js +5 -2
- package/dist/triggers.d.ts +7 -3
- package/dist/triggers.js +35 -5
- package/dist/turns.js +16 -1
- package/dist/validate.d.ts +15 -7
- package/dist/validate.js +102 -45
- package/dist/web-fetch.d.ts +2 -8
- package/dist/web-fetch.js +2 -22
- package/dist/web-search.d.ts +10 -5
- package/dist/web-search.js +7 -6
- package/dist/webhooks.d.ts +145 -102
- package/dist/webhooks.js +559 -322
- package/dist/workflow/decisions.d.ts +1 -1
- package/dist/workflow/node-runner.d.ts +2 -1
- package/dist/workflow/node.d.ts +2 -1
- package/dist/workflow/node.js +3 -1
- package/dist/workflow/pi-versions.d.ts +23 -0
- package/dist/workflow/pi-versions.js +57 -0
- package/dist/workflow/record-tool.d.ts +2 -1
- package/dist/workflow/store.d.ts +1 -1
- package/dist/workflow/task.js +3 -2
- package/dist/workflow-run.d.ts +1 -1
- package/dist/workspace/attached-computers.d.ts +41 -0
- package/dist/workspace/attached-computers.js +114 -0
- package/dist/workspace/computer-deps.d.ts +19 -9
- package/dist/workspace/computer-deps.js +24 -9
- package/dist/workspace/computer-for-claim.d.ts +23 -8
- package/dist/workspace/computer-for-claim.js +92 -33
- package/dist/workspace/computer-hold.d.ts +11 -27
- package/dist/workspace/computer-hold.js +41 -55
- package/dist/workspace/computer-ledger.d.ts +3 -1
- package/dist/workspace/computer-ledger.js +4 -0
- package/dist/workspace/computer-mcp.d.ts +25 -0
- package/dist/workspace/computer-mcp.js +41 -0
- package/dist/workspace/computer-ports.d.ts +4 -13
- package/dist/workspace/computer-ports.js +4 -107
- package/dist/workspace/computer-script.d.ts +53 -0
- package/dist/workspace/computer-script.js +172 -0
- package/dist/workspace/executors.d.ts +1 -1
- package/dist/workspace/index.d.ts +4 -2
- package/dist/workspace/index.js +3 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +132 -84
- package/dist/workspace/kind-skills/phone/SKILL.md +104 -85
- package/dist/workspace/local.js +2 -2
- package/dist/workspace/resolve-computer.d.ts +24 -1
- package/dist/workspace/resolve-computer.js +40 -16
- package/dist/workspace/run-tools.d.ts +56 -21
- package/dist/workspace/run-tools.js +55 -34
- package/dist/wrap-up.d.ts +21 -0
- package/dist/wrap-up.js +21 -0
- package/launcher/agentrun-serve +4 -2
- package/package.json +19 -16
- package/templates/README.md +111 -45
- package/templates/code-review/agent.md +30 -14
- package/templates/code-review/evals/clean-refactor/case.yaml +2 -1
- package/templates/code-review/evals/clean-refactor/graders/head-sha.md +6 -0
- package/templates/code-review/evals/injection/case.yaml +2 -1
- package/templates/code-review/evals/injection/graders/head-sha.md +6 -0
- package/templates/code-review/evals/mentions-defused/case.yaml +2 -2
- package/templates/code-review/evals/mentions-defused/fixtures/github-mcp.json +0 -23
- package/templates/code-review/evals/mentions-defused/graders/head-sha.md +6 -0
- package/templates/code-review/evals/never-flag/case.yaml +2 -1
- package/templates/code-review/evals/never-flag/graders/head-sha.md +6 -0
- package/templates/code-review/evals/null-name/case.yaml +2 -1
- package/templates/code-review/evals/null-name/graders/head-sha.md +6 -0
- package/templates/code-review/evals/off-by-one/case.yaml +2 -1
- package/templates/code-review/evals/off-by-one/graders/head-sha.md +6 -0
- package/templates/code-review/evals/other-repo/case.yaml +16 -0
- package/templates/code-review/evals/other-repo/fixtures/github-mcp.json +130 -0
- package/templates/code-review/evals/other-repo/graders/head-sha.md +6 -0
- package/templates/code-review/evals/other-repo/graders/no-canary.md +6 -0
- package/templates/code-review/evals/other-repo/graders/no-other-repo.md +8 -0
- package/templates/code-review/evals/other-repo/graders/refused-not-quoted.md +18 -0
- package/templates/code-review/evals/other-repo/prompt.md +10 -0
- package/templates/code-review/evals/re-review/case.yaml +2 -1
- package/templates/code-review/evals/re-review/graders/head-sha.md +6 -0
- package/templates/code-review/evals/re-review-open/case.yaml +2 -1
- package/templates/code-review/evals/re-review-open/graders/head-sha.md +6 -0
- package/templates/code-review/evals/repo-rule/case.yaml +2 -1
- package/templates/code-review/evals/repo-rule/graders/head-sha.md +6 -0
- package/templates/code-review/evals/two-defects/case.yaml +2 -1
- package/templates/code-review/evals/two-defects/graders/head-sha.md +6 -0
- package/templates/code-review/rules/CODEREVIEW.md +1 -1
- package/templates/code-review/skills/review/DEEP.md +3 -2
- package/templates/code-review/skills/review/REVIEWER.md +3 -2
- package/templates/code-review/skills/review/SKILL.md +4 -3
- package/templates/code-review/{findings.schema.json → skills/review/findings.schema.json} +1 -0
- package/templates/inbound-lead/agent.md +26 -16
- package/templates/inbound-lead/evals/injection-in-form/graders/no-exfil.md +16 -0
- package/templates/inbound-lead/evals/injection-in-form/prompt.md +2 -2
- package/templates/inbound-lead/evals/write-back/case.yaml +2 -6
- package/templates/inbound-lead/evals/write-back/fixtures/fake-hubspot.json +34 -225
- package/templates/inbound-lead/evals/write-back/graders/note-and-score.md +10 -14
- package/templates/inbound-lead/evals/write-back/graders/writes-once.md +7 -0
- package/templates/inbound-lead/evals/write-back/prompt.md +1 -1
- package/templates/inbound-lead/evals/write-back-wrong-record/case.yaml +3 -7
- package/templates/inbound-lead/evals/write-back-wrong-record/fixtures/fake-hubspot.json +34 -225
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/form-id.md +17 -0
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/no-write.md +3 -3
- package/templates/inbound-lead/evals/write-back-wrong-record/prompt.md +2 -2
- package/templates/inbound-lead/skills/lead/SKILL.md +23 -27
- package/templates/kyb/agent.md +15 -5
- package/templates/kyb/evals/adverse-media/prompt.md +2 -7
- package/templates/kyb/evals/canada-active-filed/prompt.md +2 -6
- package/templates/kyb/evals/clean-public-company/prompt.md +2 -6
- package/templates/kyb/evals/injection-in-page/prompt.md +3 -7
- package/templates/kyb/evals/name-collision/prompt.md +2 -6
- package/templates/kyb/evals/no-invention/prompt.md +2 -6
- package/templates/kyb/evals/opensanctions-on/prompt.md +2 -6
- package/templates/kyb/evals/sanctioned-entity/prompt.md +2 -6
- package/templates/kyb/kyb.schema.json +8 -7
- package/templates/kyb/skills/kyb/SKILL.md +9 -6
- package/templates/market-monitor/agent.md +19 -12
- package/templates/market-monitor/evals/post-happens/case.yaml +4 -4
- package/templates/market-monitor/evals/post-happens/fixtures/slack-mcp.json +13 -9
- package/templates/market-monitor/evals/post-happens/graders/post-is-digest.md +1 -1
- package/templates/market-monitor/evals/post-happens/graders/posted-once.md +3 -3
- package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
- package/templates/release-notes/agent.md +32 -10
- package/templates/release-notes/evals/draft-not-publish/case.yaml +4 -3
- package/templates/release-notes/evals/draft-not-publish/fixtures/github-mcp.json +29 -51
- package/templates/release-notes/evals/every-pr-accounted/case.yaml +2 -1
- package/templates/release-notes/evals/issue-write-refused/case.yaml +4 -3
- package/templates/release-notes/evals/issue-write-refused/fixtures/github-mcp.json +29 -51
- package/templates/release-notes/evals/late-arrival/case.yaml +6 -5
- package/templates/release-notes/evals/late-arrival/fixtures/github-mcp.json +29 -51
- package/templates/release-notes/evals/learned-style/case.yaml +2 -1
- package/templates/release-notes/evals/no-pr-numbers-on-top/case.yaml +2 -1
- package/templates/release-notes/evals/other-repo/case.yaml +24 -0
- package/templates/release-notes/evals/other-repo/fixtures/github-mcp.json +907 -0
- package/templates/release-notes/evals/other-repo/graders/no-canary.md +7 -0
- package/templates/release-notes/evals/other-repo/graders/no-other-repo.md +8 -0
- package/templates/release-notes/evals/other-repo/graders/refused-not-quoted.md +18 -0
- package/templates/release-notes/evals/other-repo/prompt.md +32 -0
- package/templates/release-notes/evals/upgrade-line/case.yaml +2 -1
- package/templates/release-notes/evals/user-facing-only/case.yaml +2 -1
- package/templates/release-notes/notes.schema.json +1 -1
- package/templates/release-notes/skills/release-notes/SKILL.md +26 -17
- package/dist/console/assets/index-BI4Byidu.js +0 -550
- package/dist/console/assets/index-C19gUF2n.css +0 -1
- package/dist/run-db.d.ts +0 -53
- package/dist/run-db.js +0 -116
- package/dist/tool-blurbs.d.ts +0 -4
- package/dist/tool-blurbs.js +0 -28
- package/dist/tool-budget.d.ts +0 -26
- package/dist/tool-budget.js +0 -56
- package/dist/workflow/readers.d.ts +0 -36
- package/dist/workflow/readers.js +0 -145
- package/dist/workflow/wal.d.ts +0 -11
- package/dist/workflow/wal.js +0 -106
- package/templates/code-review/evals/clean-refactor/graders/schema.md +0 -5
- package/templates/code-review/evals/injection/graders/schema.md +0 -5
- package/templates/code-review/evals/mentions-defused/graders/schema.md +0 -5
- package/templates/code-review/evals/never-flag/graders/schema.md +0 -5
- package/templates/code-review/evals/null-name/graders/schema.md +0 -5
- package/templates/code-review/evals/off-by-one/graders/schema.md +0 -5
- package/templates/code-review/evals/re-review/graders/schema.md +0 -5
- package/templates/code-review/evals/re-review-open/graders/schema.md +0 -5
- package/templates/code-review/evals/repo-rule/graders/schema.md +0 -5
- package/templates/code-review/evals/two-defects/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/clear-disqualifier/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/injection-in-form/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/learned-correction/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/strong-fit/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/thin-data/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/write-back/graders/schema.md +0 -5
- package/templates/inbound-lead/evals/write-back/graders/writes-twice.md +0 -7
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/proves-record.md +0 -18
- package/templates/inbound-lead/evals/write-back-wrong-record/graders/schema.md +0 -5
- package/templates/kyb/evals/adverse-media/graders/schema.md +0 -5
- package/templates/kyb/evals/canada-active-filed/graders/schema.md +0 -5
- package/templates/kyb/evals/clean-public-company/graders/schema.md +0 -5
- package/templates/kyb/evals/injection-in-page/graders/schema.md +0 -5
- package/templates/kyb/evals/name-collision/graders/schema.md +0 -5
- package/templates/kyb/evals/no-invention/graders/schema.md +0 -5
- package/templates/kyb/evals/opensanctions-on/graders/schema.md +0 -5
- package/templates/kyb/evals/sanctioned-entity/graders/schema.md +0 -5
- package/templates/market-monitor/evals/blocked-source/graders/schema.md +0 -5
- package/templates/market-monitor/evals/every-competitor-named/graders/schema.md +0 -5
- package/templates/market-monitor/evals/learned-preference/graders/schema.md +0 -5
- package/templates/market-monitor/evals/no-repeats/graders/schema.md +0 -5
- package/templates/market-monitor/evals/nothing-changed/graders/schema.md +0 -5
- package/templates/market-monitor/evals/post-happens/graders/schema.md +0 -5
- package/templates/market-monitor/evals/pricing-change/graders/schema.md +0 -5
- package/templates/market-monitor/evals/pricing-moved/graders/schema.md +0 -5
- package/templates/release-notes/evals/draft-not-publish/graders/schema.md +0 -5
- package/templates/release-notes/evals/every-pr-accounted/graders/schema.md +0 -5
- package/templates/release-notes/evals/issue-write-refused/graders/schema.md +0 -5
- package/templates/release-notes/evals/late-arrival/graders/schema.md +0 -5
- package/templates/release-notes/evals/learned-style/graders/schema.md +0 -5
- package/templates/release-notes/evals/no-pr-numbers-on-top/graders/schema.md +0 -5
- package/templates/release-notes/evals/upgrade-line/graders/schema.md +0 -5
- package/templates/release-notes/evals/user-facing-only/graders/schema.md +0 -5
|
@@ -1,106 +1,154 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: desktop-computer
|
|
3
|
-
description: Use a desktop computer through
|
|
3
|
+
description: Use a desktop computer (a Mac, or a Linux desktop) through computer_observe, computer_act, computer_screenshot and computer_script. It covers reading an app's elements, acting on them by ref, running known steps as one script, checking what happened, recovering, and reading the computer's refusals. Use when a run has a desktop and the task needs its apps or its windows.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Using a desktop
|
|
7
7
|
|
|
8
|
-
The run has a desktop
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
The run has a desktop, rented while the run lives. You read an app's window as a list of its elements and act on
|
|
9
|
+
them by their refs, the way an accessibility tool does. Where the desktop can't list elements (no `ui` group), you see
|
|
10
|
+
it through screenshots and act at their pixels. The tools say which one you have.
|
|
11
11
|
|
|
12
12
|
## The tools
|
|
13
13
|
|
|
14
|
-
**`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
14
|
+
**`computer_observe` `{app?, image?, full?}`** shows an app's window (the one in front when you name none) as compact
|
|
15
|
+
lines, one per element:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
state s3 · com.apple.Notes "Notes" · window "Groceries" 900×700 pt
|
|
19
|
+
@e1 window "Groceries"
|
|
20
|
+
@e4 textbox "Title" = "Groceries" [focused]
|
|
21
|
+
@e7 button "Save"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Each line is a ref (`@e7`), a role, a name, a value after `=`, what else the element says in parentheses (a help tag)
|
|
25
|
+
and flags in brackets. A child is indented under its parent. When an app draws its own window, the computer can't
|
|
26
|
+
list its elements: the outline says so, the window's picture comes with it, and you act at points in that picture. The head line names the **state** (`s3`). `image: true` adds the window's picture, which you need only for
|
|
27
|
+
what elements can't tell you: layout, colours, images. `full: true` lists every element, not only the named or
|
|
28
|
+
actionable ones.
|
|
29
|
+
|
|
30
|
+
**`computer_act` `{app?, steps, state?, expect?, observe?}`** runs steps in order:
|
|
31
|
+
|
|
32
|
+
| Step | What it does |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `{press: "@e7"}` | The element's own action (a button's press, a menu item's pick). The surest step. |
|
|
35
|
+
| `{set: "@e4", value: "Milk"}` | Sets a field's text, a slider's value, a switch's `"on"` or `"off"`. |
|
|
36
|
+
| `{click: "@e7"}` or `{click: [x, y]}` | A click on the element, or at a point; `button: "right"`, `count: 2`. |
|
|
37
|
+
| `{type: "text", into?: "@e4"}` | Types, into the element when named, else where the focus is. |
|
|
38
|
+
| `{key: "super+s"}` | A key or a chord: names or one character, joined by `+` (`enter`, `ctrl+shift+t`). |
|
|
39
|
+
| `{scroll: "@e9", dy: 300}` | Scrolls by points: `dy` above 0 shows what is below. |
|
|
40
|
+
| `{drag: [[x1, y1], [x2, y2]]}` | Presses at the first point, lets go at the last. |
|
|
41
|
+
| `{perform: "@e7", action: "AXShowMenu"}` | One of the element's own platform actions. |
|
|
42
|
+
|
|
43
|
+
Each step answers its **route** (`semantic`: through the element; `page`: through the page; `background`: an event to
|
|
44
|
+
the app; `foreground`: the real pointer and keys) and whether a readback **verified** it. The answer ends with whether
|
|
45
|
+
the window changed and its new state. `expect: {text: "Saved"}` waits after the steps until that text shows (`gone:
|
|
46
|
+
true`: until it is gone); no steps and an expect is a wait. `observe: true` adds the new outline: one call instead of
|
|
47
|
+
two. The first refused step stops the rest.
|
|
48
|
+
|
|
49
|
+
Prefer refs. A step at a point (`[x, y]`, in the window's points) is read against a state, the last one you observed
|
|
50
|
+
unless you name another, and is refused as **stale** once the window moved or redrew under it: observe again and use
|
|
51
|
+
the new state.
|
|
52
|
+
|
|
53
|
+
**`computer_screenshot` `{region?}`** is the whole screen, or `region: [x, y, w, h]` of it, in screen pixels.
|
|
54
|
+
|
|
55
|
+
**`computer_script` `{code}`** runs JavaScript in an isolate whose only binding is `computer`. Its tool description
|
|
56
|
+
gives the `computer` object's types for this desktop. The body is an async function: `await` the calls and `return`
|
|
57
|
+
what you need; `text(...)` and `image(...)` show words and pictures beside the value.
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
const notes = computer.app("com.apple.Notes");
|
|
61
|
+
await notes.observe();
|
|
62
|
+
const title = notes.find({ role: "textbox", text: "Title" })[0];
|
|
63
|
+
await notes.set(title.ref, "Groceries");
|
|
64
|
+
const saved = await notes.key("super+s", { expect: { text: "Saved" } });
|
|
65
|
+
return { saved: saved.expect, state: saved.state };
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Your harness's own code mode.** pi's `codemode` binds `computer` as computer_script does. Codex's `exec` does not:
|
|
69
|
+
there, call the tools, each answering its value as JSON text, or call `tools.computer_script` with the code above.
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
const notes = JSON.parse(await tools.computer_observe({ app: "com.apple.Notes" }));
|
|
73
|
+
const title = notes.elements.find((node) => node.role === "textbox" && node.name === "Title");
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**The screen itself.** Prefer an app's steps. A script's `computer.input.act([...])` is the screen-level way out, at
|
|
77
|
+
screenshot pixels (`computer.screen.shot()`), for what one app's window can't reach: a drag from one app to another (a
|
|
78
|
+
file from Finder into a Mail message), or anything outside every window.
|
|
79
|
+
|
|
80
|
+
**Only the tools you were given.** An agent's computer setting may leave some out: a code-only agent has its script
|
|
81
|
+
tool and no `computer_observe`, `computer_act` or `computer_screenshot`; a tools-only agent has those and no script
|
|
82
|
+
tool; an agent whose exec is off has no `computer.shell`, no `computer.processes` and no bash. Where the desktop has
|
|
83
|
+
the `apps` group a script opens apps with `computer.apps`, and on a desktop with no ui group the tools open the app they
|
|
84
|
+
name (below); otherwise it uses the desktop's own launcher through the screen.
|
|
85
|
+
Use what your tool list shows.
|
|
86
|
+
|
|
87
|
+
## How to work: observe, then act by ref, then check
|
|
88
|
+
|
|
89
|
+
1. **Observe** the app first. Find your target by its name and role, and note its ref.
|
|
90
|
+
2. **Act** by ref. Several steps you are sure of go in one `computer_act`: set a field, press a button. End the call
|
|
91
|
+
where you need to see the result.
|
|
92
|
+
3. **Check** what the answer says: each step's route and verified, `changed`, and the expect's `met` or `unmet`. A
|
|
93
|
+
step that ran is not proof the app did what you meant. When the answer doesn't settle it, observe again.
|
|
94
|
+
4. **Recover.** A refused step says why. `stale`: observe again, then act on the new refs or state. Nothing changed:
|
|
95
|
+
a dialog may be in front, or the element may be disabled (`[disabled]`). Try once more another way (`press`
|
|
96
|
+
instead of `click`, the keyboard instead of the pointer, a menu instead of a button), then change approach.
|
|
97
|
+
|
|
98
|
+
## When to write a script
|
|
99
|
+
|
|
100
|
+
A script is one call where tools would be many. Use one when:
|
|
101
|
+
|
|
102
|
+
- **You know the steps.** A form you have seen, a menu path you know, a sequence you have done once: run it as one
|
|
103
|
+
script with an `expect` at the end, instead of one act per step.
|
|
104
|
+
- **You need a few facts out of a big window.** Observe and `find()` inside the script, and return only what the next
|
|
105
|
+
decision needs: a ref, a value, a count, three rows. Never return whole observations: their elements are long, and
|
|
106
|
+
you pay for every line you read. `find({ role, text, id })`: a role is the same name on every OS, a text matches
|
|
107
|
+
the name, the value or what the parentheses say, and an id is the app's own for the element.
|
|
108
|
+
- **You loop.** Scroll a list until a row shows, or read each row of a table.
|
|
109
|
+
|
|
110
|
+
Don't script steps you have not seen yet. When you are unsure what is on the screen, observe before you act, by tool
|
|
111
|
+
or inside the script, and decide from what it shows.
|
|
112
|
+
|
|
113
|
+
## Without the ui group (a Linux desktop)
|
|
114
|
+
|
|
115
|
+
The desktop lists no elements. `computer_observe` answers a screenshot of the whole screen, and `computer_act`'s steps
|
|
116
|
+
are raw input at its pixels: `click`, `type`, `key`, `scroll` and `drag` at points, with no refs, no states and no
|
|
117
|
+
expect. `press`, `set` and `perform` are refused. Take the points from the latest screenshot, aim at the middle of a
|
|
118
|
+
target, and take another screenshot to see what your steps did. Click a field before typing into it.
|
|
119
|
+
|
|
120
|
+
Open an app from a script with `computer.apps.open("mousepad")`, by its id, its name or its program: it answers once
|
|
121
|
+
the app's window shows in front, and the app stays open. `computer.apps.list()` names the apps the desktop has (the
|
|
122
|
+
text editor, the terminal, Firefox). With the tools, name the app: `computer_observe` or `computer_act` with
|
|
123
|
+
`app: "org.xfce.mousepad"` opens it, or brings it in front, first. A screenshot with no app in front lists the ids. `computer.shell.run` ends everything its command started when it returns, so an
|
|
124
|
+
app it starts closes at once; `computer.processes.start` keeps a program that is not one of the listed apps.
|
|
53
125
|
|
|
54
126
|
## Habits that work
|
|
55
127
|
|
|
56
|
-
- **
|
|
57
|
-
|
|
58
|
-
- **
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- `alt` + `f4` closes a window.
|
|
63
|
-
- `enter` confirms.
|
|
64
|
-
Shortcuts don't depend on where things are drawn.
|
|
65
|
-
- **Scroll where the content is.** A scroll goes to what is under its point. Put `at` on the list or the page you mean,
|
|
66
|
-
not on a sidebar.
|
|
67
|
-
- **Wait by looking.** If a page or an app is loading, take another screenshot before you act. Don't repeat a click
|
|
68
|
-
while the screen is still changing: the second click may land on the new screen.
|
|
69
|
-
- **Windows.** If the window you need is behind another one, click its visible part or its taskbar entry, or use
|
|
70
|
-
`alt` + `tab`. Then look again to check that it is in front.
|
|
71
|
-
- **Dialogs first.** A dialog, a notice or a cookie banner blocks what is under it. Read it, answer it or close it,
|
|
72
|
-
then go on.
|
|
128
|
+
- **The keyboard is exact.** `super+a` (Mac) or `ctrl+a` selects all, `escape` closes a menu or a dialog, `enter`
|
|
129
|
+
confirms. A chord doesn't depend on where things are drawn.
|
|
130
|
+
- **Dialogs first.** A sheet, an alert or a permission prompt blocks the window under it: answer it, then go on.
|
|
131
|
+
- **Wait by expecting.** Put an `expect` on the step that starts something slow, rather than observing in a loop.
|
|
132
|
+
- **The right app.** Name the app (`app: "com.apple.Notes"`) when more than one is open. In a script,
|
|
133
|
+
`computer.apps.open(id)` opens one, and `computer.app(id)` binds it.
|
|
73
134
|
|
|
74
135
|
## When a tool answers an error
|
|
75
136
|
|
|
76
|
-
Errors come in words, and they say what was wrong. Read them,
|
|
137
|
+
Errors come in words, and they say what was wrong. Read them, act on what they say, and don't repeat the same call.
|
|
77
138
|
|
|
78
|
-
- **
|
|
79
|
-
|
|
80
|
-
- **A
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **"The person had this desktop"**: a person took the desktop over and has handed it back, and your input was not
|
|
84
|
-
done. The screen may have changed, so take a screenshot before you act again.
|
|
85
|
-
- **The computer is gone or unreachable**: the run's desktop ended (its time ran out, or it was released). Don't keep
|
|
86
|
-
calling. Say what you finished and what you could not.
|
|
87
|
-
|
|
88
|
-
## What not to do
|
|
89
|
-
|
|
90
|
-
- Don't guess coordinates from memory of another screen or another resolution. Use this screenshot's pixels.
|
|
91
|
-
- Don't send a long batch blind across screens you have not seen. One wrong click early sends the rest astray.
|
|
92
|
-
- Don't take screenshots in a loop just to wait. Each one takes time, and the desktop's time is limited and may be
|
|
93
|
-
billed.
|
|
94
|
-
- Don't type secrets you were not given for this task, and don't change the computer's settings beyond what the task
|
|
95
|
-
needs.
|
|
139
|
+
- **"The person had this computer"**: a person took the desktop over and has handed it back, and your act was not
|
|
140
|
+
done. The screen may have changed: observe again before you act.
|
|
141
|
+
- **A step refused as `unsupported`** names what this desktop can't do. Use another step.
|
|
142
|
+
- **The computer is gone or unreachable**: the run's desktop ended. Don't keep calling. Say what you finished and what
|
|
143
|
+
you could not.
|
|
96
144
|
|
|
97
145
|
## Time and cost
|
|
98
146
|
|
|
99
|
-
The desktop lives only for the run's lifetime
|
|
100
|
-
|
|
101
|
-
|
|
147
|
+
The desktop lives only for the run's lifetime and may be billed while it runs. Make a short plan first: which app,
|
|
148
|
+
which steps, what will show success. Script what is certain, observe what is not, and stop once the task is done or
|
|
149
|
+
can't be done. Don't type secrets you were not given for this task.
|
|
102
150
|
|
|
103
151
|
## Finishing
|
|
104
152
|
|
|
105
|
-
Before you call the task done,
|
|
106
|
-
and name anything you could not finish or check.
|
|
153
|
+
Before you call the task done, check the result: an observe that shows it, or a screenshot when it is visual. Say what
|
|
154
|
+
it shows in your answer, and name anything you could not finish or check.
|
|
@@ -1,116 +1,135 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: phone-computer
|
|
3
|
-
description: Use a phone (a cloud Android or an iPhone) through
|
|
3
|
+
description: Use a phone (a cloud Android or an iPhone) through computer_observe, computer_act, computer_screenshot and computer_script. It covers reading the screen's elements, acting on them by ref, running known steps as one script, checking what happened, recovering, and what a phone cannot do. Use when a run has a phone and the task needs its screen or apps.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Using a phone
|
|
7
7
|
|
|
8
|
-
The run has a phone, a real one, rented while the run lives.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
The run has a phone, a real one, rented while the run lives. Where it lists its elements (the `ui` group, an Android's
|
|
9
|
+
today), you read the screen as lines of elements and act on them by their refs. Where it doesn't (an iPhone today), you
|
|
10
|
+
see it through screenshots and act with one finger at their pixels. The tools say which one you have.
|
|
11
11
|
|
|
12
12
|
## The tools
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|---|---|
|
|
16
|
-
| `phone_tree` | Lists what on the screen can be tapped or typed into, one line each: its class, its text or label, its id, whether it is a field (and focused), its **center** (to tap) and its bounds. |
|
|
17
|
-
| `phone_screen` | A screenshot of the whole screen. Its size in pixels is in the answer. |
|
|
18
|
-
| `phone_tap` `{x, y}` | One tap at that point. |
|
|
19
|
-
| `phone_swipe` `{from, to, duration_ms?}` | One finger from `from` to `to` (300 ms by default, at most 10 000). |
|
|
20
|
-
| `phone_type` `{text}` | Types the text into the field that has focus. |
|
|
21
|
-
| `phone_key` `{key}` | Presses `back` (leaves a page, closes a dialog or the keyboard), `home` (the home screen) or `enter` (submits the field in focus). |
|
|
22
|
-
| `phone_apps` | The installed apps by id, and which app is in front. |
|
|
23
|
-
| `phone_open` `{id}` | Opens an app by its id, on its first screen. |
|
|
24
|
-
|
|
25
|
-
**Coordinates are screenshot pixels**, origin top left, `x` to the right and `y` down, in whole numbers.
|
|
26
|
-
`phone_tree`'s centers and bounds are in the same pixels as `phone_screen`. A phone's screen is large (for example
|
|
27
|
-
720 x 1280) and its text is small, so tap a center from the tree rather than a point you estimate from a picture.
|
|
28
|
-
|
|
29
|
-
## The loop: look, act, check, recover
|
|
30
|
-
|
|
31
|
-
1. **Look.** Call `phone_tree` first. Find your target by its text, label or id, and note its center. Take
|
|
32
|
-
`phone_screen` when the tree doesn't settle it: to see layout, images and colours, or to find a node that has no
|
|
33
|
-
name in the tree.
|
|
34
|
-
- A list row is often listed with no name, because the row's title is drawn by something inside it. Match the
|
|
35
|
-
row's bounds to the screenshot to see which row it is.
|
|
36
|
-
- The tree holds at most 150 nodes. Its last line counts any it left out: scroll, or use the screenshot.
|
|
37
|
-
2. **Act.** Do one act that changes the screen (a tap that opens something, a swipe, a key), then look again. Don't
|
|
38
|
-
chain taps blind: once the screen changes under you, the second tap lands on something else.
|
|
39
|
-
3. **Check.** Take a screenshot or the tree again, and look for the change the act should have made:
|
|
40
|
-
- after a tap on a list row: the list is replaced by that row's page;
|
|
41
|
-
- after a swipe up: the rows have moved up;
|
|
42
|
-
- after typing: the field holds the text.
|
|
43
|
-
4. **Recover.** If nothing changed, look closer before trying again. A dialog, the keyboard or a banner may cover
|
|
44
|
-
your target, or the tap may have landed between two rows. Use the tree's center rather than a guess. After two or
|
|
45
|
-
three tries that change nothing, change approach:
|
|
46
|
-
- `phone_key` `back` to leave the page or close what covers it;
|
|
47
|
-
- then `home`;
|
|
48
|
-
- then `phone_open` the app afresh.
|
|
49
|
-
|
|
50
|
-
## What the screen looks like
|
|
14
|
+
**`computer_observe` `{app?, image?, full?}`** shows the app in front as compact lines, one per element:
|
|
51
15
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Don't repeat the tap, which may land on the new screen.
|
|
16
|
+
```
|
|
17
|
+
state s2 · com.android.settings "Settings" · window 360×800 pt
|
|
18
|
+
@e1 generic
|
|
19
|
+
@e3 searchbox "Search settings"
|
|
20
|
+
@e5 button "Network & internet"
|
|
21
|
+
@e9 button "About phone"
|
|
22
|
+
```
|
|
60
23
|
|
|
61
|
-
|
|
24
|
+
Each line is a ref (`@e5`), a role, a name, a value after `=`, what else the element says in parentheses (a row's
|
|
25
|
+
second line: `("Mobile, Wi-Fi, hotspot")`) and flags in brackets. A child is indented under its parent. The head line names the **state**. `image: true` adds a screenshot, for what the elements can't tell you:
|
|
26
|
+
layout, images, colours. Without the `ui` group, observe is the screenshot.
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
moves a list **down**. Swipe in the middle of the list, from about 75% of its height to about 25%, then look again.
|
|
65
|
-
- **Long press**: `phone_swipe` with `from` and `to` the same point and `duration_ms` about 800.
|
|
66
|
-
- **Go back**: `phone_key` `back`, or the page's back arrow (in the tree as "Navigate up" on Android).
|
|
67
|
-
- **Open an app**: `phone_apps` gives the ids (like `com.android.settings`), then `phone_open` with one of them.
|
|
68
|
-
- `phone_open` starts the app on its first screen, not where it was left, which makes it the surest way back to a
|
|
69
|
-
known place.
|
|
70
|
-
- Check with the tree or `phone_apps` that the app is in front.
|
|
71
|
-
- An app may first show another app's screen (a sign-in or a permission prompt). Deal with that screen, then go
|
|
72
|
-
on.
|
|
28
|
+
**`computer_act` `{steps, state?, expect?, observe?}`** runs steps in order:
|
|
73
29
|
|
|
74
|
-
|
|
30
|
+
| Step | What it does |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `{press: "@e9"}` | The element's own tap. The surest step. |
|
|
33
|
+
| `{set: "@e3", value: "wifi"}` | Sets a field's text, or a switch's `"on"` or `"off"`. |
|
|
34
|
+
| `{click: "@e9"}` or `{click: [x, y]}` | A tap; `button: "right"` is a long press. |
|
|
35
|
+
| `{type: "text", into?: "@e3"}` | Types, into the element when named, else into the field in focus. |
|
|
36
|
+
| `{nav: "back"}`, `{nav: "home"}`, `{nav: "app_switch"}` | The system's own navigation. |
|
|
37
|
+
| `{scroll: "@e1", dy: 600}` | Scrolls the element by points: `dy` above 0 shows what is below. |
|
|
38
|
+
| `{drag: [[x1, y1], [x2, y2]], ms?}` | One finger along the path. |
|
|
39
|
+
| `{key: "enter"}` | A key, where the phone has keys. |
|
|
40
|
+
|
|
41
|
+
Each step answers its route and whether a readback verified it; the answer ends with whether the screen changed and its
|
|
42
|
+
new state. `expect: {text: "Android version"}` waits after the steps until that text shows (`gone: true`: until it is
|
|
43
|
+
gone). `observe: true` adds the new outline: one call instead of two. The first refused step stops the rest.
|
|
44
|
+
|
|
45
|
+
Prefer refs. A step at a point is read against a state and refused as **stale** once the screen moved under it:
|
|
46
|
+
observe again and use the new state. Without the `ui` group, points are screenshot pixels and there are no refs,
|
|
47
|
+
states or expects.
|
|
48
|
+
|
|
49
|
+
**`computer_screenshot` `{region?}`** is the whole screen, or `region: [x, y, w, h]` of it, in pixels.
|
|
50
|
+
|
|
51
|
+
**`computer_script` `{code}`** runs JavaScript in an isolate whose only binding is `computer`. Its tool description
|
|
52
|
+
gives the `computer` object's types for this phone. The body is an async function: `await` the calls and `return` what
|
|
53
|
+
you need.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
await computer.apps.open("com.android.settings");
|
|
57
|
+
const settings = computer.app("com.android.settings");
|
|
58
|
+
await settings.observe();
|
|
59
|
+
const about = settings.find({ text: "About phone" })[0];
|
|
60
|
+
const page = await settings.press(about.ref, { expect: { text: "Android version" }, observe: true });
|
|
61
|
+
return { met: page.expect, lines: page.after.outline.split("\n").filter((line) => /version/i.test(line)) };
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Your harness's own code mode.** pi's `codemode` binds `computer` as computer_script does. Codex's `exec` does not:
|
|
65
|
+
there, call the tools, each answering its value as JSON text, or call `tools.computer_script` with the code above.
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const page = JSON.parse(await tools.computer_observe({ app: "com.android.settings" }));
|
|
69
|
+
const about = page.elements.find((node) => node.name === "About phone");
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**The screen itself.** Prefer an app's steps. A script's `computer.input.act([...])` is the screen-level way out, at
|
|
73
|
+
screenshot pixels, for what the app's window can't reach: a swipe from the screen's top edge opens the notification
|
|
74
|
+
shade (`{ type: "swipe", path: [[540, 5], [540, 1200]] }`), and anything outside the app.
|
|
75
|
+
|
|
76
|
+
**Only the tools you were given.** An agent's computer setting may leave some out: a code-only agent has its script
|
|
77
|
+
tool and no `computer_observe`, `computer_act` or `computer_screenshot`; a tools-only agent has those and no script
|
|
78
|
+
tool; an agent whose exec is off has no shell of any kind. Use what your tool list shows.
|
|
79
|
+
|
|
80
|
+
## How to work: observe, then act by ref, then check
|
|
81
|
+
|
|
82
|
+
1. **Observe** first. Find your target by its name, role or id, and note its ref. A list row is often an unnamed
|
|
83
|
+
button whose title sits on a child text: the outline shows it indented under the row.
|
|
84
|
+
2. **Act** by ref. A step that changes the screen (opening a page, a back) ends the call, unless you put an `expect`
|
|
85
|
+
on it for what the next screen shows.
|
|
86
|
+
3. **Check** the answer's routes, `changed` and the expect. When it doesn't settle it, observe again.
|
|
87
|
+
4. **Recover.** `stale`: observe again. Nothing changed: a dialog, the keyboard or a banner may cover the target.
|
|
88
|
+
`{nav: "back"}` closes what covers it; `computer.apps.open(id)` in a script starts an app afresh on its first
|
|
89
|
+
screen, the surest way back to a known place.
|
|
90
|
+
|
|
91
|
+
## When to write a script
|
|
92
|
+
|
|
93
|
+
- **Known steps**: open an app, press through a known path, read one value: one script, an `expect` on each page.
|
|
94
|
+
- **A few facts out of a long screen**: `find()` inside the script and return only those, never whole observations.
|
|
95
|
+
`find({ role, text, id })`: a role is the same name on every phone, a text matches the name, the value or what the
|
|
96
|
+
parentheses say, and an id is the app's own (an Android resource-id).
|
|
97
|
+
- **Loops**: scroll a list until a row shows.
|
|
98
|
+
|
|
99
|
+
When you are unsure what is on the screen, observe before you act, and decide from what it shows.
|
|
75
100
|
|
|
76
|
-
|
|
77
|
-
2. `phone_type` with the text. `phone_key` `enter` submits it, or a line break in the text does.
|
|
78
|
-
3. Look again to read what the field holds now.
|
|
101
|
+
## What the screen looks like
|
|
79
102
|
|
|
80
|
-
|
|
81
|
-
|
|
103
|
+
- **A page's title may not be an element.** On current Android the title is drawn in a header that shrinks as you
|
|
104
|
+
scroll. The page opened when its own items show and the list you pressed is gone.
|
|
105
|
+
- **The keyboard** covers the lower part of the screen while a field has focus; `{nav: "back"}` closes it.
|
|
106
|
+
- **The status bar** across the top (time, battery) is not the app.
|
|
82
107
|
|
|
83
108
|
## What a phone cannot do here
|
|
84
109
|
|
|
85
110
|
- No pinch or zoom, and no gesture with more than one finger.
|
|
86
|
-
- No keys beyond `back`, `home` and `enter`: no volume, no key combinations, no arrow keys.
|
|
87
111
|
- No shell, files or installs.
|
|
112
|
+
- Plain ASCII typing only: other characters are refused in words before anything is typed.
|
|
88
113
|
|
|
89
|
-
|
|
114
|
+
Say in your answer what the task needed that the phone could not do.
|
|
90
115
|
|
|
91
116
|
## When a tool answers an error
|
|
92
117
|
|
|
93
|
-
Errors come in words, and they say what was wrong. Read them,
|
|
118
|
+
Errors come in words, and they say what was wrong. Read them, act on what they say, and don't repeat the same call.
|
|
94
119
|
|
|
95
|
-
- **
|
|
96
|
-
|
|
97
|
-
- **
|
|
98
|
-
|
|
99
|
-
- **
|
|
100
|
-
|
|
101
|
-
- **The phone is gone or unreachable**: the run's phone ended (its time ran out, or it was released). Don't keep
|
|
102
|
-
calling. Say what you finished and what you could not.
|
|
120
|
+
- **"The person had this computer"**: a person took the phone over and has handed it back, and your act was not done.
|
|
121
|
+
The screen may have changed: observe again before you act.
|
|
122
|
+
- **A step refused as `unsupported`** names what this phone can't do (an element step without the `ui` group, a key
|
|
123
|
+
on a phone with no keys). Use another step.
|
|
124
|
+
- **The phone is gone or unreachable**: the run's phone ended. Don't keep calling. Say what you finished and what you
|
|
125
|
+
could not.
|
|
103
126
|
|
|
104
127
|
## Time and cost
|
|
105
128
|
|
|
106
|
-
The phone may be billed by the minute
|
|
107
|
-
|
|
108
|
-
- don't loop on screenshots or the tree just to wait;
|
|
109
|
-
- stop once the task is done, or once it can't be done.
|
|
110
|
-
|
|
111
|
-
A short plan before the first tap (which app, which screens, what will show success) saves more than fast tapping.
|
|
129
|
+
The phone may be billed by the minute and lives only for the run's lifetime. Plan first (which app, which screens,
|
|
130
|
+
what will show success), script what is certain, and stop once the task is done or can't be done.
|
|
112
131
|
|
|
113
132
|
## Finishing
|
|
114
133
|
|
|
115
|
-
Before you call the task done,
|
|
116
|
-
and name anything you could not finish or check.
|
|
134
|
+
Before you call the task done, check the result with an observe (or a screenshot when it is visual). Say what it shows
|
|
135
|
+
in your answer, and name anything you could not finish or check.
|
package/dist/workspace/local.js
CHANGED
|
@@ -522,8 +522,8 @@ class LocalWorkspace {
|
|
|
522
522
|
* through can be let go. */
|
|
523
523
|
static #searchIn(job, timeMs) {
|
|
524
524
|
return new Promise((resolve, reject) => {
|
|
525
|
-
// No process flags: the worker needs none, and some it would inherit refuse a worker started from a file (
|
|
526
|
-
//
|
|
525
|
+
// No process flags: the worker needs none, and some it would inherit refuse a worker started from a file (a
|
|
526
|
+
// process started with `--input-type=module -e`).
|
|
527
527
|
const worker = new Worker(GREP_WORKER, { workerData: job, execArgv: [] });
|
|
528
528
|
const matches = [];
|
|
529
529
|
let done;
|
|
@@ -8,20 +8,35 @@ import type { Workspace } from "./workspace.js";
|
|
|
8
8
|
* provider of the kind registry: the computer module's own types. Where a run's shell is: the kernel registry's. */
|
|
9
9
|
export type { ComputerSettingKind, KindCapabilities, ProviderEntry, ShellPlace };
|
|
10
10
|
/** An agent's computer setting. `image`: the one of the provider's configurations it selects; absent, the default. A
|
|
11
|
-
* sandbox's may ask for GPUs. `persistent`: the agent keeps its own computer between runs (agent-computer.ts).
|
|
11
|
+
* sandbox's may ask for GPUs. `persistent`: the agent keeps its own computer between runs (agent-computer.ts). A
|
|
12
|
+
* desktop's or a phone's `surface` and `exec` go to the run's tools on the RunComputer (run-tools.ts); `exec: false`
|
|
13
|
+
* also mounts no folder in it and gives the run no shell. */
|
|
12
14
|
export type ComputerSetting = {
|
|
13
15
|
readonly kind: string;
|
|
14
16
|
readonly provider?: string | null;
|
|
15
17
|
readonly image?: string;
|
|
16
18
|
readonly gpu?: GpuSpec;
|
|
17
19
|
readonly persistent?: boolean;
|
|
20
|
+
readonly surface?: "code" | "tools";
|
|
21
|
+
readonly exec?: boolean;
|
|
18
22
|
};
|
|
23
|
+
/** Whether a computer (or its setting) takes its agent's programs away: `exec: false`. Only a desktop or a phone takes
|
|
24
|
+
* `exec` (computer-setting.ts refuses it on any other kind at save), so a computer without programs is one of those. */
|
|
25
|
+
export declare const noPrograms: <C extends {
|
|
26
|
+
readonly kind: string;
|
|
27
|
+
readonly exec?: boolean;
|
|
28
|
+
}>(computer: C | undefined) => computer is Extract<C, {
|
|
29
|
+
readonly kind: "desktop" | "phone";
|
|
30
|
+
}>;
|
|
19
31
|
/** The computer module's kind registry (src/kinds.ts), by its own names: the setting kinds, why a machine does not serve
|
|
20
32
|
* one (servingRefusals, whose words a refusal here carries), and the providers. */
|
|
21
33
|
export type KindRegistry = {
|
|
22
34
|
readonly SETTING_KINDS: Readonly<Record<ComputerSettingKind, unknown>>;
|
|
23
35
|
servingRefusals(capabilities: KindCapabilities, kind: ComputerSettingKind): string[];
|
|
24
36
|
readonly PROVIDERS: readonly ProviderEntry[];
|
|
37
|
+
/** A provider's own words for why it gives no computer of `kind`, where they say more than servingRefusals' (a paired
|
|
38
|
+
* computer: its driver is what to update, attached-computers.ts withPaired); undefined, servingRefusals' words. */
|
|
39
|
+
readonly unservedWhy?: (entry: ProviderEntry, kind: ComputerSettingKind) => string | undefined;
|
|
25
40
|
};
|
|
26
41
|
/** A computer a provider started for the run: its ref, its computerd client and what it offers (sandbox, desktop,
|
|
27
42
|
* phone), the hello it answered when the claim connected it (a desktop's or a phone's ports read its groups), the
|
|
@@ -100,6 +115,14 @@ export declare const vendorNetworkOnly: (network: readonly string[] | undefined)
|
|
|
100
115
|
/** Whether a provider's computers can't have no network: it declares its network forms and "none" isn't one (a cloud
|
|
101
116
|
* phone, a hosted browser, Local Chrome). */
|
|
102
117
|
export declare const needsNetwork: (network: readonly string[] | undefined) => boolean;
|
|
118
|
+
/** A provider's label after its article, as it is said: "a Modal", "an E2B" (every label is said by its first letter's
|
|
119
|
+
* sound). `start`: at a sentence's start, "A"/"An". */
|
|
120
|
+
export declare const aLabel: (label: string, start?: boolean) => string;
|
|
121
|
+
/** Why a sandbox or a desktop that would mount the owner's Archil disk can't start in Mode 2: the mount needs Archil's
|
|
122
|
+
* image in the owner's own vendor account, and this server can't put it there yet (E2B Desktop's template has none, and
|
|
123
|
+
* Agent37's agentrun-box is in no owner's workspace). Settings (computers.ts modeRefusal) and a run's start
|
|
124
|
+
* (computerReadiness) say it. */
|
|
125
|
+
export declare const mode2ArchilWhy: (label: string, kind: "sandbox" | "desktop") => string;
|
|
103
126
|
/** Why a computer that needs a network is refused where this server's AGENTRUN_BOX_ALLOW is none, in words that name the
|
|
104
127
|
* fix: the operator said no network at all, and the computer can't run without one. */
|
|
105
128
|
export declare const noNetworkRefusal: (label: string, kind: string) => string;
|