@parcha/agentrun-serve 0.1.0-beta.37 → 0.1.0-beta.39
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 +700 -0
- package/README.md +441 -177
- package/dist/adapters.d.ts +4 -1
- package/dist/adapters.js +4 -2
- package/dist/agent-rows.d.ts +1 -3
- package/dist/agents-store.d.ts +35 -3
- package/dist/agents-store.js +48 -23
- 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/bash-read-only.js +2 -1
- package/dist/browser-cost.js +52 -93
- package/dist/cap-short.d.ts +12 -0
- package/dist/cap-short.js +60 -0
- package/dist/cap.d.ts +3 -400
- package/dist/cap.js +6 -942
- package/dist/catalog.d.ts +0 -5
- package/dist/catalog.js +2 -6
- package/dist/chatgpt-plan.d.ts +163 -0
- package/dist/chatgpt-plan.js +549 -0
- package/dist/cli.js +26 -6
- package/dist/composio-preset.d.ts +25 -0
- package/dist/composio-preset.js +51 -8
- package/dist/composio-triggers.d.ts +113 -0
- package/dist/composio-triggers.js +411 -0
- package/dist/computer-calls.d.ts +36 -24
- package/dist/computer-calls.js +110 -27
- package/dist/computer-commands.d.ts +2 -0
- package/dist/computer-commands.js +7 -3
- package/dist/computer-live.d.ts +12 -2
- package/dist/computer-live.js +21 -5
- package/dist/computer-routes.d.ts +2 -2
- package/dist/computer-routes.js +2 -2
- package/dist/computer-setting.d.ts +15 -2
- package/dist/computer-setting.js +20 -4
- package/dist/computer-view.d.ts +18 -2
- package/dist/computer-view.js +21 -6
- package/dist/computer-viewer.js +40 -13
- package/dist/computers.d.ts +8 -2
- package/dist/computers.js +18 -8
- package/dist/console/assets/index-BNhZs-jp.css +1 -0
- package/dist/console/assets/index-BQv5aOGB.js +700 -0
- package/dist/console/index.html +2 -2
- package/dist/console-links.d.ts +2 -0
- package/dist/console-links.js +6 -3
- package/dist/decision-cap.d.ts +2 -5
- package/dist/decision-cap.js +3 -6
- package/dist/decision-rows.js +11 -11
- package/dist/decisions.js +4 -0
- package/dist/email/account.d.ts +84 -0
- package/dist/email/account.js +159 -0
- package/dist/email/answer.d.ts +10 -0
- package/dist/email/answer.js +182 -0
- package/dist/email/email-faux.d.ts +95 -0
- package/dist/email/email-faux.js +849 -0
- package/dist/email/labels.d.ts +1 -0
- package/dist/email/labels.js +84 -0
- package/dist/email/mail.d.ts +186 -0
- package/dist/email/mail.js +380 -0
- package/dist/email/names.d.ts +20 -0
- package/dist/email/names.js +40 -0
- package/dist/email/routes.d.ts +9 -0
- package/dist/email/routes.js +50 -0
- package/dist/email/tools.d.ts +20 -0
- package/dist/email/tools.js +517 -0
- package/dist/environment.d.ts +17 -2
- package/dist/environment.js +36 -8
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +12 -0
- package/dist/eval-mailbox.d.ts +103 -0
- package/dist/eval-mailbox.js +236 -0
- package/dist/faux-computers.js +4 -2
- package/dist/graph-view.d.ts +9 -2
- package/dist/graph-view.js +6 -2
- package/dist/harness-install.d.ts +28 -2
- package/dist/harness-install.js +147 -59
- package/dist/harness-opencode/adapter.js +2 -22
- package/dist/harness-opencode/facts.js +5 -4
- package/dist/harness-opencode/host/policy.d.ts +4 -5
- package/dist/harness-opencode/host/policy.js +14 -33
- package/dist/harness-opencode/index.d.ts +1 -1
- package/dist/harness-opencode/index.js +1 -1
- package/dist/harness-opencode/versions.d.ts +6 -0
- package/dist/harness-opencode/versions.js +6 -0
- package/dist/harness-table.d.ts +0 -2
- package/dist/harness-table.js +8 -7
- package/dist/harness.d.ts +12 -0
- package/dist/harness.js +15 -3
- package/dist/host-tools.d.ts +1 -5
- package/dist/host-tools.js +7 -10
- package/dist/hosted-search.d.ts +3 -3
- package/dist/hosted-search.js +51 -32
- package/dist/import-sources.d.ts +1 -1
- package/dist/import-sources.js +3 -3
- package/dist/import.d.ts +21 -0
- package/dist/import.js +186 -1
- package/dist/key-check.d.ts +0 -2
- package/dist/key-check.js +3 -4
- package/dist/key-refusal.d.ts +8 -2
- package/dist/key-refusal.js +16 -13
- package/dist/key-words.d.ts +3 -2
- package/dist/key-words.js +4 -2
- package/dist/learn/check.d.ts +24 -4
- package/dist/learn/check.js +340 -7
- package/dist/learn/commit.d.ts +10 -0
- package/dist/learn/commit.js +18 -4
- package/dist/learn/compile.d.ts +250 -0
- package/dist/learn/compile.js +507 -0
- package/dist/learn/general.d.ts +3 -0
- package/dist/learn/general.js +4 -2
- package/dist/learn/grade.d.ts +5 -1
- package/dist/learn/grade.js +11 -7
- package/dist/learn/notes.d.ts +8 -0
- package/dist/learn/notes.js +18 -0
- package/dist/learn/promote.d.ts +308 -0
- package/dist/learn/promote.js +321 -0
- package/dist/learn/refit.d.ts +48 -0
- package/dist/learn/refit.js +264 -0
- package/dist/learn/reflect.d.ts +5 -25
- package/dist/learn/reflect.js +14 -131
- package/dist/learn/replay-calls.d.ts +63 -0
- package/dist/learn/replay-calls.js +158 -0
- package/dist/learn/skills.d.ts +19 -16
- package/dist/learn/skills.js +157 -53
- package/dist/learn/workflow-nodes.d.ts +15 -0
- package/dist/learn/workflow-nodes.js +44 -0
- package/dist/learned-nodes.d.ts +58 -2
- package/dist/learned-nodes.js +68 -5
- package/dist/learned-workflow.d.ts +58 -32
- package/dist/learned-workflow.js +215 -77
- package/dist/learning-batch.d.ts +2 -2
- package/dist/learning-batch.js +4 -4
- package/dist/learning-cost.d.ts +41 -11
- package/dist/learning-cost.js +31 -13
- package/dist/learning-routes.d.ts +12 -2
- package/dist/learning-routes.js +34 -6
- package/dist/learning-words.d.ts +8 -1
- package/dist/learning-words.js +11 -1
- package/dist/learning.d.ts +26 -1
- package/dist/learning.js +7 -4
- package/dist/link-check.d.ts +27 -0
- package/dist/link-check.js +164 -0
- package/dist/llm.js +0 -3
- package/dist/local-models.d.ts +33 -2
- package/dist/local-models.js +43 -5
- package/dist/mcp-gateway.d.ts +12 -20
- package/dist/mcp-gateway.js +16 -44
- package/dist/mcp-oauth.d.ts +5 -0
- package/dist/mcp-oauth.js +1 -1
- package/dist/mcp-pin-first.d.ts +37 -0
- package/dist/mcp-pin-first.js +113 -0
- package/dist/mcp-probe.d.ts +8 -9
- package/dist/mcp-probe.js +16 -33
- package/dist/mcp-secret-writes.js +3 -0
- package/dist/mcp-servers-store.d.ts +102 -26
- package/dist/mcp-servers-store.js +151 -25
- package/dist/mcp-sources.d.ts +39 -0
- package/dist/mcp-sources.js +74 -0
- package/dist/mcp-store.d.ts +11 -0
- package/dist/mcp-store.js +16 -2
- 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 +11 -0
- package/dist/model-form.js +17 -1
- package/dist/model.d.ts +39 -6
- package/dist/model.js +171 -32
- package/dist/monid.d.ts +50 -29
- package/dist/monid.js +234 -143
- package/dist/native/binding.d.ts +13 -0
- package/dist/native/binding.js +57 -0
- package/dist/native/cli.d.ts +2 -0
- package/dist/native/cli.js +48 -0
- package/dist/native/connection.d.ts +8 -0
- package/dist/native/connection.js +94 -0
- package/dist/native/context.d.ts +6 -0
- package/dist/native/context.js +22 -0
- package/dist/native/discovery.d.ts +27 -0
- package/dist/native/discovery.js +404 -0
- package/dist/native/environment.d.ts +4 -0
- package/dist/native/environment.js +18 -0
- package/dist/native/history.d.ts +20 -0
- package/dist/native/history.js +147 -0
- package/dist/native/instructions.d.ts +21 -0
- package/dist/native/instructions.js +173 -0
- package/dist/native/remote-worker-bridge.d.ts +3 -0
- package/dist/native/remote-worker-bridge.js +278 -0
- package/dist/native/remote.d.ts +187 -0
- package/dist/native/remote.js +492 -0
- package/dist/native/runtime.d.ts +17 -0
- package/dist/native/runtime.js +316 -0
- package/dist/native/runtimes.d.ts +66 -0
- package/dist/native/runtimes.js +41 -0
- package/dist/native/schema.d.ts +46 -0
- package/dist/native/schema.js +41 -0
- package/dist/native/types.d.ts +87 -0
- package/dist/native/types.js +1 -0
- package/dist/observation/http.d.ts +4 -0
- package/dist/observation/http.js +140 -0
- package/dist/observation/observer.d.ts +301 -0
- package/dist/observation/observer.js +919 -0
- package/dist/observation/schema.d.ts +52 -0
- package/dist/observation/schema.js +154 -0
- package/dist/openapi.d.ts +1 -0
- package/dist/openapi.js +705 -126
- package/dist/paid-calls.d.ts +34 -32
- package/dist/paid-calls.js +52 -104
- package/dist/place-offers.d.ts +4 -8
- package/dist/place-offers.js +4 -9
- package/dist/port-models.d.ts +7 -2
- package/dist/port-models.js +5 -2
- package/dist/print.d.ts +4 -2
- package/dist/print.js +4 -3
- package/dist/propose.d.ts +8 -3
- package/dist/propose.js +28 -7
- package/dist/provider.d.ts +5 -1
- package/dist/provider.js +17 -2
- package/dist/push-handler.d.ts +3 -2
- package/dist/push-handler.js +20 -6
- package/dist/reflect-range.js +2 -1
- package/dist/refusal-words.d.ts +11 -0
- package/dist/refusal-words.js +13 -2
- package/dist/rows.d.ts +5 -3
- package/dist/rows.js +15 -4
- package/dist/run-launch.d.ts +23 -1
- package/dist/run-launch.js +17 -4
- package/dist/run-learning-served.d.ts +84 -0
- package/dist/run-manifest.d.ts +8 -0
- package/dist/run-manifest.js +33 -1
- package/dist/run-reads-over-store.d.ts +3 -3
- package/dist/run-reads-over-store.js +13 -10
- package/dist/run-secrets.js +2 -3
- package/dist/run-timeline-served.d.ts +3 -2
- package/dist/run-timeline-served.js +12 -10
- package/dist/run-view.d.ts +59 -41
- package/dist/run-view.js +128 -64
- package/dist/runnable.d.ts +13 -8
- package/dist/runnable.js +77 -60
- package/dist/runner/adapter-loop.d.ts +60 -15
- package/dist/runner/adapter-loop.js +1406 -464
- package/dist/runner/adapter-run-spec.d.ts +45 -14
- package/dist/runner/adapter-run-spec.js +200 -116
- package/dist/runner/adapters/pi.d.ts +40 -7
- package/dist/runner/adapters/pi.js +149 -38
- package/dist/runner/beside.d.ts +3 -1
- package/dist/runner/beside.js +24 -8
- package/dist/runner/claim-secrets.d.ts +3 -1
- package/dist/runner/claim-secrets.js +28 -4
- package/dist/runner/cli-run-spec.d.ts +30 -0
- package/dist/runner/cli-run-spec.js +150 -66
- package/dist/runner/computer-channel.d.ts +5 -2
- package/dist/runner/computer-channel.js +5 -3
- package/dist/runner/computer-journal.d.ts +6 -0
- package/dist/runner/computer-journal.js +8 -10
- package/dist/runner/conformance/harness.d.ts +3 -0
- package/dist/runner/conformance/harness.js +149 -5
- package/dist/runner/conformance/subject.d.ts +11 -4
- package/dist/runner/end-of-run.d.ts +8 -5
- package/dist/runner/end-of-run.js +11 -6
- package/dist/runner/feedback-round.d.ts +79 -0
- package/dist/runner/feedback-round.js +127 -0
- package/dist/runner/harness-loops.js +17 -0
- package/dist/runner/journal-kinds.d.ts +55 -13
- package/dist/runner/journal-kinds.js +19 -0
- package/dist/runner/learning-dispatch.d.ts +3 -2
- package/dist/runner/learning-dispatch.js +6 -6
- package/dist/runner/learning-end.d.ts +58 -19
- package/dist/runner/learning-end.js +316 -115
- package/dist/runner/learning-factory.d.ts +3 -0
- package/dist/runner/learning-factory.js +8 -2
- package/dist/runner/learning-loop.d.ts +21 -1
- package/dist/runner/learning-loop.js +24 -6
- package/dist/runner/learning-seed.d.ts +4 -0
- package/dist/runner/learning-seed.js +14 -0
- package/dist/runner/loop-contract.d.ts +19 -3
- package/dist/runner/loop.d.ts +34 -1
- package/dist/runner/loop.js +55 -1
- package/dist/runner/main.d.ts +6 -1
- package/dist/runner/main.js +26 -4
- package/dist/runner/mcp-claim.d.ts +5 -1
- package/dist/runner/mcp-claim.js +66 -50
- package/dist/runner/mcp-run.d.ts +20 -53
- package/dist/runner/mcp-run.js +22 -88
- package/dist/runner/meta-tools.d.ts +44 -0
- package/dist/runner/meta-tools.js +344 -0
- package/dist/runner/metrics.d.ts +80 -21
- package/dist/runner/metrics.js +128 -42
- package/dist/runner/model-route.d.ts +12 -3
- package/dist/runner/model-route.js +149 -19
- package/dist/runner/monid-run.d.ts +18 -0
- package/dist/runner/monid-run.js +170 -0
- package/dist/runner/native-loop.d.ts +11 -0
- package/dist/runner/native-loop.js +438 -0
- package/dist/runner/promotion.d.ts +146 -0
- package/dist/runner/promotion.js +803 -0
- package/dist/runner/redact.js +3 -0
- package/dist/runner/reflect-hook.d.ts +36 -21
- package/dist/runner/reflect-hook.js +147 -49
- package/dist/runner/runner.d.ts +7 -1
- package/dist/runner/runner.js +34 -8
- package/dist/runner/sdk-loop.d.ts +7 -0
- package/dist/runner/sdk-loop.js +470 -0
- package/dist/runner/sessions.d.ts +8 -3
- package/dist/runner/sessions.js +5 -1
- package/dist/runner/spec-holds.d.ts +16 -2
- package/dist/runner/spec-holds.js +42 -14
- package/dist/runner/step-guard.d.ts +62 -0
- package/dist/runner/step-guard.js +93 -0
- package/dist/runner/store-secrets.js +17 -2
- package/dist/runner/subagent.d.ts +0 -3
- package/dist/runner/subagent.js +7 -12
- package/dist/runner/workflow-first.d.ts +226 -0
- package/dist/runner/workflow-first.js +293 -0
- package/dist/runner/workflow-loop.d.ts +1 -1
- package/dist/runner/workflow-loop.js +32 -19
- package/dist/runner/workflow-spec.d.ts +5 -1
- package/dist/runner/workflow-spec.js +63 -48
- package/dist/runs-over-store.d.ts +41 -4
- package/dist/runs-over-store.js +64 -22
- package/dist/sdk/runs.d.ts +115 -0
- package/dist/sdk/runs.js +422 -0
- package/dist/sdk/schema.d.ts +175 -0
- package/dist/sdk/schema.js +138 -0
- package/dist/sdk/workflows.d.ts +22 -0
- package/dist/sdk/workflows.js +39 -0
- package/dist/secrets.d.ts +2 -0
- package/dist/secrets.js +19 -1
- package/dist/server.d.ts +108 -20
- package/dist/server.js +874 -157
- package/dist/settings-wake.d.ts +8 -6
- package/dist/settings-wake.js +13 -7
- package/dist/skill-route.d.ts +3 -0
- package/dist/skill-route.js +16 -0
- package/dist/skills/agentrun-serve/SKILL.md +368 -0
- package/dist/stats.d.ts +10 -10
- package/dist/store/agent-body.d.ts +22 -7
- package/dist/store/agent-body.js +23 -14
- package/dist/store/command-wake.d.ts +3 -2
- package/dist/store/command-wake.js +4 -4
- package/dist/store/index.d.ts +1 -1
- package/dist/store/native-command-owner.d.ts +10 -0
- package/dist/store/native-command-owner.js +47 -0
- package/dist/store/postgres/connection.js +3 -1
- 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/postgres/migrations/0012_revision_monid_pin.sql +4 -0
- package/dist/store/postgres/migrations/0013_native_command_owner.sql +6 -0
- package/dist/store/postgres/migrations/0014_run_cost_upper_bound.sql +6 -0
- package/dist/store/postgres/store.js +3 -0
- package/dist/store/schema.d.ts +16 -0
- package/dist/store/schema.js +47 -8
- 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 +8 -1
- package/dist/store/sqlite/run-patch.js +33 -10
- package/dist/store/sqlite/store.js +184 -28
- package/dist/store/store.d.ts +98 -21
- package/dist/store-reads/analytics.d.ts +7 -7
- package/dist/store-reads/analytics.js +23 -5
- package/dist/store-reads/cap.js +8 -6
- package/dist/store-reads/journal.d.ts +30 -1
- package/dist/store-reads/journal.js +141 -83
- package/dist/store-reads/learning.d.ts +179 -13
- package/dist/store-reads/learning.js +230 -68
- package/dist/store-reads/loop.d.ts +61 -0
- package/dist/store-reads/loop.js +111 -0
- package/dist/store-reads/runs.d.ts +5 -0
- package/dist/store-reads/runs.js +3 -2
- package/dist/store-view.d.ts +3 -2
- package/dist/store-view.js +109 -37
- package/dist/template-eval.d.ts +87 -16
- package/dist/template-eval.js +605 -120
- package/dist/template-github-permissions.d.ts +2 -2
- package/dist/template-github-permissions.js +2 -1
- 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 +274 -52
- package/dist/templates.js +670 -201
- package/dist/text-urls.d.ts +38 -0
- package/dist/text-urls.js +170 -0
- package/dist/timeline/computer.d.ts +48 -0
- package/dist/timeline/computer.js +169 -0
- package/dist/timeline/index.d.ts +7 -5
- package/dist/timeline/index.js +7 -5
- package/dist/timeline/labels.d.ts +11 -4
- package/dist/timeline/labels.js +122 -8
- package/dist/timeline/origin.d.ts +20 -6
- package/dist/timeline/origin.js +13 -6
- package/dist/timeline/render-text.js +1 -1
- package/dist/timeline/timeline.d.ts +76 -20
- package/dist/timeline/timeline.js +184 -39
- package/dist/timeline/util.d.ts +5 -0
- package/dist/timeline/util.js +44 -8
- package/dist/timeline/web-calls.d.ts +17 -0
- package/dist/timeline/web-calls.js +106 -0
- package/dist/tool-gate.d.ts +103 -76
- package/dist/tool-gate.js +200 -127
- package/dist/tool-keys.d.ts +4 -1
- package/dist/tool-keys.js +8 -3
- package/dist/tool-list.d.ts +29 -0
- package/dist/tool-list.js +50 -0
- package/dist/tool-names.d.ts +76 -0
- package/dist/tool-names.js +101 -0
- package/dist/tool-plane.d.ts +34 -28
- package/dist/tool-plane.js +72 -37
- package/dist/tools.d.ts +59 -15
- package/dist/tools.js +46 -42
- package/dist/trigger-adapter.d.ts +85 -5
- package/dist/trigger-adapter.js +6 -0
- package/dist/trigger-adapters.js +3 -1
- package/dist/trigger-composio.d.ts +10 -0
- package/dist/trigger-composio.js +122 -0
- package/dist/trigger-email.d.ts +4 -0
- package/dist/trigger-email.js +228 -0
- package/dist/trigger-signatures.d.ts +6 -10
- package/dist/trigger-signatures.js +16 -16
- package/dist/trigger-targets.d.ts +1 -1
- package/dist/trigger-targets.js +4 -3
- package/dist/trigger-webhook.js +6 -4
- package/dist/triggers.d.ts +94 -9
- package/dist/triggers.js +263 -62
- package/dist/uploads.d.ts +9 -0
- package/dist/uploads.js +27 -0
- package/dist/validate.d.ts +15 -7
- package/dist/validate.js +91 -50
- package/dist/web-fake.d.ts +56 -0
- package/dist/web-fake.js +102 -0
- package/dist/web-fetch-direct.d.ts +3 -0
- package/dist/web-fetch-direct.js +4 -1
- package/dist/web-fetch.d.ts +6 -8
- package/dist/web-fetch.js +10 -53
- package/dist/web-search.d.ts +51 -2
- package/dist/web-search.js +116 -18
- package/dist/webhooks.d.ts +2 -1
- package/dist/webhooks.js +5 -1
- package/dist/workflow/node-runner.js +10 -2
- package/dist/workspace/archil-claim.d.ts +3 -0
- package/dist/workspace/archil-claim.js +9 -2
- package/dist/workspace/computer-deps.d.ts +25 -9
- package/dist/workspace/computer-deps.js +82 -38
- package/dist/workspace/computer-for-claim.d.ts +60 -4
- package/dist/workspace/computer-for-claim.js +203 -45
- package/dist/workspace/computer-hold.js +7 -1
- package/dist/workspace/computer-janitor.d.ts +10 -3
- package/dist/workspace/computer-janitor.js +96 -29
- package/dist/workspace/computer-kept.d.ts +82 -0
- package/dist/workspace/computer-kept.js +147 -0
- package/dist/workspace/computer-mcp.js +4 -3
- package/dist/workspace/computer-ports.d.ts +23 -3
- package/dist/workspace/computer-ports.js +115 -5
- package/dist/workspace/index.d.ts +2 -3
- package/dist/workspace/index.js +1 -2
- package/dist/workspace/kind-skills/desktop/SKILL.md +31 -11
- package/dist/workspace/kind-skills/phone/SKILL.md +29 -14
- package/dist/workspace/local.js +2 -2
- package/dist/workspace/resolve-computer.d.ts +33 -1
- package/dist/workspace/resolve-computer.js +37 -16
- package/dist/workspace/revision-skills.d.ts +6 -2
- package/dist/workspace/revision-skills.js +12 -5
- package/dist/workspace/run-end-computers.d.ts +30 -0
- package/dist/workspace/run-end-computers.js +137 -0
- package/dist/workspace/run-tools.d.ts +40 -23
- package/dist/workspace/run-tools.js +46 -19
- package/dist/wrap-up.d.ts +35 -0
- package/dist/wrap-up.js +48 -0
- package/launcher/agentrun-serve +4 -2
- package/package.json +13 -9
- package/skills/agentrun-serve/SKILL.md +248 -10
- package/templates/README.md +220 -60
- package/templates/TOOLS.md +168 -0
- package/templates/code-review/agent.md +46 -16
- 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 +3 -3
- 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/off-by-one/graders/no-repo-reads.md +2 -1
- 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/pasted-by-reference/case.yaml +5 -0
- package/templates/code-review/evals/pasted-by-reference/graders/by-reference.md +15 -0
- package/templates/code-review/evals/pasted-by-reference/graders/head-sha.md +6 -0
- package/templates/code-review/evals/pasted-by-reference/prompt.md +31 -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 +5 -4
- package/templates/code-review/skills/review/REVIEWER.md +5 -4
- package/templates/code-review/skills/review/SKILL.md +11 -6
- 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 +5 -4
- 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 +5 -4
- 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-Cn6JX1uH.js +0 -563
- package/dist/console/assets/index-DRN62V5v.css +0 -1
- package/dist/host-calls.d.ts +0 -20
- package/dist/host-calls.js +0 -12
- package/dist/runner/adapters/pi-computer.d.ts +0 -7
- package/dist/runner/adapters/pi-computer.js +0 -43
- package/dist/tool-blurbs.d.ts +0 -4
- package/dist/tool-blurbs.js +0 -28
- package/dist/tool-budget.d.ts +0 -38
- package/dist/tool-budget.js +0 -62
- package/dist/workspace/computer-script.d.ts +0 -37
- package/dist/workspace/computer-script.js +0 -138
- 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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** A URL written in text, as a link is read (a page's links, an answer's cited links): it also ends at "|", so a Slack
|
|
2
|
+
* mrkdwn link `<https://a/b|text>` is `https://a/b`. */
|
|
3
|
+
export declare const TEXT_URL: RegExp;
|
|
4
|
+
/** A URL written in text, as the timeline scrubs one (scrubUrls): it runs on through a "|", so a query value holding one
|
|
5
|
+
* (`?ids=1|2`) is elided whole, never shown past the "|". The scrub's only difference from TEXT_URL. */
|
|
6
|
+
export declare const SCRUBBED_URL: RegExp;
|
|
7
|
+
/** What a URL found in text may end with that is not its own: a sentence's punctuation, a closing quote, an emphasis's
|
|
8
|
+
* "*", a closing bracket the URL did not open (trimmed). */
|
|
9
|
+
export declare const TRAILING = ".,;:!?*)]}'";
|
|
10
|
+
/** A URL found in text less its tail (TRAILING): a closing bracket stays where the URL opened as many as it closes (a wiki
|
|
11
|
+
* title's `Foo_(bar)`). One count of the brackets, then one walk back, so a long run of them is linear. */
|
|
12
|
+
export declare function trimmed(raw: string): string;
|
|
13
|
+
/** Where a markdown link's target (`text` from `from`, the character after its "](") ends: at the ")" that closes the link,
|
|
14
|
+
* so parentheses it holds in pairs (a wiki title's) stay, else at whitespace or `to`. `text[end] === ")"` says it closed. */
|
|
15
|
+
export declare function targetEnd(text: string, from?: number, to?: number): number;
|
|
16
|
+
/** A string that is one URL whole (a JSON field holding a link means all of it, its last character too), trimmed of the
|
|
17
|
+
* whitespace around it; else undefined. */
|
|
18
|
+
export declare function wholeUrl(text: string): string | undefined;
|
|
19
|
+
/** A link as `text` writes it, and whether that is all of it (`exact`): a markdown link's target that its ")" closed is;
|
|
20
|
+
* a URL written out, or a target with no ")", may end in a tail that is not its own (TRAILING). */
|
|
21
|
+
export type WrittenLink = {
|
|
22
|
+
raw: string;
|
|
23
|
+
exact: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Every link `text` holds, in order, as written (WrittenLink): a markdown link's target (`[text](url)`, targetEnd), and a
|
|
26
|
+
* URL written out (TEXT_URL). A URL written out that runs into a "](" is a link written as its own text
|
|
27
|
+
* (`[https://a](https://a)`): what follows each "](" in it is a target. A target ends where targetEnd says, never where
|
|
28
|
+
* TEXT_URL stopped, so one holding a "|" (`](https://a/?m=1|2)`) is whole. Each link is looked for from where the last
|
|
29
|
+
* one ended, a target read past the URL running into it scanned once more at most: linear, however many unclosed "](" a
|
|
30
|
+
* hostile page holds. A page's links (hrefsIn) and an answer's cited links (link-check.ts) both read it. */
|
|
31
|
+
export declare function linksWritten(text: string): Generator<WrittenLink>;
|
|
32
|
+
/** Every link `text` holds, in order (linksWritten): a target its ")" closed as it is, any other less its tail (trimmed). */
|
|
33
|
+
export declare function hrefsIn(text: string): Generator<string>;
|
|
34
|
+
/** The absolute http(s) URLs a text holds, each once and without its fragment, in order: for JSON, those of its string
|
|
35
|
+
* values (jsonHrefs); for any other text (markdown, plain text, XML), its markdown link targets and the URLs it writes
|
|
36
|
+
* out (hrefsIn), read with its entities undone (readable). A fetched page's links (linksWithin keeps those within the
|
|
37
|
+
* caps and counts the rest), and the urls the link check takes from a call that is not a web call. */
|
|
38
|
+
export declare function linksOf(text: string): Generator<string>;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// The one reading of an http(s) URL written in text: where it ends, what tail is not its own, where a markdown link's
|
|
2
|
+
// target ends, and the links a page's text holds. The timeline's scrub (timeline/util.ts scrubUrls), the eval link check's
|
|
3
|
+
// cited links (link-check.ts) and a fetched page's links (web-fetch-direct.ts, web-fetch.ts) all read through it, so a
|
|
4
|
+
// link a page holds and the same link an answer cites come out in the same shape.
|
|
5
|
+
//
|
|
6
|
+
// Every reading here is linear in its text: a page is hostile and up to a million characters.
|
|
7
|
+
/** What ends a URL written in text, for every reader: whitespace, a quote, an angle bracket, a backtick or a backslash. */
|
|
8
|
+
const URL_ENDS = "\\s\"`<>\\\\";
|
|
9
|
+
/** A URL written in text, as a link is read (a page's links, an answer's cited links): it also ends at "|", so a Slack
|
|
10
|
+
* mrkdwn link `<https://a/b|text>` is `https://a/b`. */
|
|
11
|
+
export const TEXT_URL = new RegExp(`https?://[^${URL_ENDS}|]+`, "gi");
|
|
12
|
+
/** A URL written in text, as the timeline scrubs one (scrubUrls): it runs on through a "|", so a query value holding one
|
|
13
|
+
* (`?ids=1|2`) is elided whole, never shown past the "|". The scrub's only difference from TEXT_URL. */
|
|
14
|
+
export const SCRUBBED_URL = new RegExp(`https?://[^${URL_ENDS}]+`, "gi");
|
|
15
|
+
/** What a URL found in text may end with that is not its own: a sentence's punctuation, a closing quote, an emphasis's
|
|
16
|
+
* "*", a closing bracket the URL did not open (trimmed). */
|
|
17
|
+
export const TRAILING = ".,;:!?*)]}'";
|
|
18
|
+
const OPENER = { ")": "(", "]": "[", "}": "{" };
|
|
19
|
+
/** A URL found in text less its tail (TRAILING): a closing bracket stays where the URL opened as many as it closes (a wiki
|
|
20
|
+
* title's `Foo_(bar)`). One count of the brackets, then one walk back, so a long run of them is linear. */
|
|
21
|
+
export function trimmed(raw) {
|
|
22
|
+
const count = { "(": 0, ")": 0, "[": 0, "]": 0, "{": 0, "}": 0 };
|
|
23
|
+
for (const char of raw)
|
|
24
|
+
if (char in count)
|
|
25
|
+
count[char] += 1;
|
|
26
|
+
let end = raw.length;
|
|
27
|
+
for (; end > 0 && TRAILING.includes(raw[end - 1]); end--) {
|
|
28
|
+
const char = raw[end - 1];
|
|
29
|
+
const opener = OPENER[char];
|
|
30
|
+
if (opener && count[opener] >= count[char])
|
|
31
|
+
break;
|
|
32
|
+
if (opener)
|
|
33
|
+
count[char] -= 1;
|
|
34
|
+
}
|
|
35
|
+
return raw.slice(0, end);
|
|
36
|
+
}
|
|
37
|
+
/** Where a markdown link's target (`text` from `from`, the character after its "](") ends: at the ")" that closes the link,
|
|
38
|
+
* so parentheses it holds in pairs (a wiki title's) stay, else at whitespace or `to`. `text[end] === ")"` says it closed. */
|
|
39
|
+
export function targetEnd(text, from = 0, to = text.length) {
|
|
40
|
+
let end = from;
|
|
41
|
+
for (let depth = 0; end < to && !/\s/.test(text[end]); end++) {
|
|
42
|
+
if (text[end] === "(")
|
|
43
|
+
depth++;
|
|
44
|
+
else if (text[end] === ")" && depth-- === 0)
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
return end;
|
|
48
|
+
}
|
|
49
|
+
/** Where a markdown target in angle brackets (`text` from `from`, the character after its "<") ends: the index of its ">",
|
|
50
|
+
* or -1 where whitespace, another "<" or `to` comes first (no such target: read it as targetEnd does). */
|
|
51
|
+
function angledEnd(text, from, to) {
|
|
52
|
+
for (let end = from; end < to && !/[\s<]/.test(text[end]); end++)
|
|
53
|
+
if (text[end] === ">")
|
|
54
|
+
return end;
|
|
55
|
+
return -1;
|
|
56
|
+
}
|
|
57
|
+
/** A string that is one URL whole (a JSON field holding a link means all of it, its last character too), trimmed of the
|
|
58
|
+
* whitespace around it; else undefined. */
|
|
59
|
+
export function wholeUrl(text) {
|
|
60
|
+
const whole = text.trim();
|
|
61
|
+
return /^https?:\/\//i.test(whole) && !/\s/.test(whole) ? whole : undefined;
|
|
62
|
+
}
|
|
63
|
+
/** Where a link starts: a markdown link's target (after its "]("), or a URL written out (TEXT_URL). */
|
|
64
|
+
const LINK_AT = new RegExp(`\\]\\(|${TEXT_URL.source}`, "gi");
|
|
65
|
+
/** Every link `text` holds, in order, as written (WrittenLink): a markdown link's target (`[text](url)`, targetEnd), and a
|
|
66
|
+
* URL written out (TEXT_URL). A URL written out that runs into a "](" is a link written as its own text
|
|
67
|
+
* (`[https://a](https://a)`): what follows each "](" in it is a target. A target ends where targetEnd says, never where
|
|
68
|
+
* TEXT_URL stopped, so one holding a "|" (`](https://a/?m=1|2)`) is whole. Each link is looked for from where the last
|
|
69
|
+
* one ended, a target read past the URL running into it scanned once more at most: linear, however many unclosed "](" a
|
|
70
|
+
* hostile page holds. A page's links (hrefsIn) and an answer's cited links (link-check.ts) both read it. */
|
|
71
|
+
export function* linksWritten(text) {
|
|
72
|
+
const at = new RegExp(LINK_AT.source, "gi");
|
|
73
|
+
for (let found = at.exec(text); found; found = at.exec(text)) {
|
|
74
|
+
// A "](" alone is ["", ""]: one target, after it.
|
|
75
|
+
const pieces = found[0].split("](");
|
|
76
|
+
if (pieces[0])
|
|
77
|
+
yield { raw: pieces[0], exact: false };
|
|
78
|
+
let from = found.index + pieces[0].length + 2;
|
|
79
|
+
for (let i = 1; i < pieces.length; i++) {
|
|
80
|
+
// Each target but the last ends by the next "](" in the URL; the last may run on past where TEXT_URL stopped.
|
|
81
|
+
const to = i < pieces.length - 1 ? from + pieces[i].length : text.length;
|
|
82
|
+
// A target in angle brackets (CommonMark's `](<https://a/b>)`) is what they hold, its ">" its end.
|
|
83
|
+
const angled = text[from] === "<" ? angledEnd(text, from + 1, to) : -1;
|
|
84
|
+
const end = angled >= 0 ? angled : targetEnd(text, from, to);
|
|
85
|
+
yield angled >= 0 ? { raw: text.slice(from + 1, angled), exact: true } : { raw: text.slice(from, end), exact: text[end] === ")" };
|
|
86
|
+
at.lastIndex = Math.max(at.lastIndex, end);
|
|
87
|
+
from += pieces[i].length + 2;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Every link `text` holds, in order (linksWritten): a target its ")" closed as it is, any other less its tail (trimmed). */
|
|
92
|
+
export function* hrefsIn(text) {
|
|
93
|
+
for (const { raw, exact } of linksWritten(text))
|
|
94
|
+
yield exact ? raw : trimmed(raw);
|
|
95
|
+
}
|
|
96
|
+
/** The entities XML names (`'` HTML's `'` too, a numeric reference), undone once in a text that is not JSON. */
|
|
97
|
+
const ENTITY = /&(?:(quot|amp|lt|gt|apos)|#(\d{1,7})|#x([0-9a-f]{1,6}));/gi;
|
|
98
|
+
const NAMED = { quot: '"', amp: "&", lt: "<", gt: ">", apos: "'" };
|
|
99
|
+
/** An XML attribute: its name, and its value in double quotes (kept as it is, so an "='" in its query is never taken for
|
|
100
|
+
* an attribute) or in single quotes (the fourth group). */
|
|
101
|
+
const ATTRIBUTE = /(\s)([^\s=<>"'/]+)(\s*=\s*)(?:"[^"]*"|'([^'<]*)')/g;
|
|
102
|
+
/** `text` read for its links, where it is not JSON: its entities undone once, so an escaped `<a href="…">`
|
|
103
|
+
* (an Atom feed's content) ends its URL at the quote, never running on to the next space, and an attribute's
|
|
104
|
+
* `href="https://a/?x=1&y=2"` is the URL `https://a/?x=1&y=2`. One pass, so `&lt;` is `<`. Where it is XML,
|
|
105
|
+
* first: a single-quoted attribute (`href='https://a/b'`) is requoted to end at its quote as a double-quoted one does (its
|
|
106
|
+
* value holds no "'" or "<" of its own), and a namespace's name (`xmlns="http://www.w3.org/2005/Atom"`), an identifier,
|
|
107
|
+
* never a link, is dropped. Attributes are read in order, each whole. */
|
|
108
|
+
function readable(text) {
|
|
109
|
+
const xml = /^\s*<[?!A-Za-z]/.test(text)
|
|
110
|
+
? text.replace(ATTRIBUTE, (attribute, space, name, equals, single) => {
|
|
111
|
+
if (/^xmlns(:|$)/i.test(name))
|
|
112
|
+
return space;
|
|
113
|
+
return single === undefined ? attribute : `${space}${name}${equals}"${single}"`;
|
|
114
|
+
})
|
|
115
|
+
: text;
|
|
116
|
+
return xml.replace(ENTITY, (entity, name, decimal, hex) => {
|
|
117
|
+
if (name)
|
|
118
|
+
return NAMED[name.toLowerCase()];
|
|
119
|
+
const code = Number.parseInt(decimal ?? hex, decimal ? 10 : 16);
|
|
120
|
+
return code <= 0x10ffff ? String.fromCodePoint(code) : entity;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/** A JSON body's links as written, in the body's order: each string value's (hrefsIn), one that is a URL whole taken as
|
|
124
|
+
* it is (wholeUrl); undefined for a text that is not JSON. Read from the parsed body, so an escape (`\/`) never hides or
|
|
125
|
+
* cuts one. */
|
|
126
|
+
function jsonHrefs(text) {
|
|
127
|
+
// An object, an array or one string: the bodies that can hold a URL (a string body is one, or holds some).
|
|
128
|
+
if (!/^\s*[[{"]/.test(text))
|
|
129
|
+
return undefined;
|
|
130
|
+
let body;
|
|
131
|
+
try {
|
|
132
|
+
body = JSON.parse(text);
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
return (function* () {
|
|
138
|
+
// A stack, not recursion: a deeply nested body never overflows it.
|
|
139
|
+
const stack = [body];
|
|
140
|
+
while (stack.length) {
|
|
141
|
+
const next = stack.pop();
|
|
142
|
+
if (typeof next === "string") {
|
|
143
|
+
const whole = wholeUrl(next);
|
|
144
|
+
yield* whole === undefined ? hrefsIn(next) : [whole];
|
|
145
|
+
}
|
|
146
|
+
else if (typeof next === "object" && next !== null) {
|
|
147
|
+
const values = Object.values(next);
|
|
148
|
+
for (let i = values.length - 1; i >= 0; i--)
|
|
149
|
+
stack.push(values[i]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
})();
|
|
153
|
+
}
|
|
154
|
+
/** The absolute http(s) URLs a text holds, each once and without its fragment, in order: for JSON, those of its string
|
|
155
|
+
* values (jsonHrefs); for any other text (markdown, plain text, XML), its markdown link targets and the URLs it writes
|
|
156
|
+
* out (hrefsIn), read with its entities undone (readable). A fetched page's links (linksWithin keeps those within the
|
|
157
|
+
* caps and counts the rest), and the urls the link check takes from a call that is not a web call. */
|
|
158
|
+
export function* linksOf(text) {
|
|
159
|
+
const seen = new Set();
|
|
160
|
+
for (const href of jsonHrefs(text) ?? hrefsIn(readable(text))) {
|
|
161
|
+
const link = /^https?:\/\//i.test(href) ? URL.parse(href) : null;
|
|
162
|
+
if (!link)
|
|
163
|
+
continue;
|
|
164
|
+
link.hash = "";
|
|
165
|
+
if (seen.has(link.href))
|
|
166
|
+
continue;
|
|
167
|
+
seen.add(link.href);
|
|
168
|
+
yield link.href;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** One computer call on a tool_result row's `computer_calls`: serve's record of it (computer-calls.ts ComputerCallRecord). */
|
|
2
|
+
export type ComputerCallRow = {
|
|
3
|
+
readonly method: string;
|
|
4
|
+
readonly started_at: string;
|
|
5
|
+
readonly app?: string;
|
|
6
|
+
readonly ok: boolean;
|
|
7
|
+
readonly ms: number;
|
|
8
|
+
readonly code?: string;
|
|
9
|
+
readonly steps?: readonly ComputerStepRow[];
|
|
10
|
+
readonly expect?: "met" | "unmet";
|
|
11
|
+
};
|
|
12
|
+
/** One step of a ui.act call on that record. */
|
|
13
|
+
export type ComputerStepRow = {
|
|
14
|
+
readonly do: string;
|
|
15
|
+
readonly on?: {
|
|
16
|
+
readonly role: string;
|
|
17
|
+
readonly name?: string;
|
|
18
|
+
};
|
|
19
|
+
readonly keys?: string;
|
|
20
|
+
readonly nav?: string;
|
|
21
|
+
readonly route?: string;
|
|
22
|
+
readonly verified?: boolean;
|
|
23
|
+
readonly error?: string;
|
|
24
|
+
};
|
|
25
|
+
/** An app's id as a person names it: "com.apple.TextEdit" is TextEdit, "org.xfce.mousepad" Mousepad. */
|
|
26
|
+
export declare function appWords(id: string): string;
|
|
27
|
+
/** A key step's chord as the record keeps it and the words say it: one with a command modifier, or of named keys only
|
|
28
|
+
* ("enter", "shift+tab"). A lone character or shift and one is typing (a password's, key by key), so it is nothing. */
|
|
29
|
+
export declare function keptChord(chord: unknown): string | undefined;
|
|
30
|
+
/** A ui.act step as its record keeps it, from the step asked: its kind, the element `on` names by the step's ref (its
|
|
31
|
+
* own, or the one a type goes into), a key step's chord as kept, a nav step's place. A typed or set value is never read. */
|
|
32
|
+
export declare function stepOf(step: unknown, on: (ref: string) => ComputerStepRow["on"]): ComputerStepRow;
|
|
33
|
+
/** The words of a chord done: "Saved (⌘S)", "Pressed ⌃⇧T". */
|
|
34
|
+
export declare const chordWords: (chord: string) => string;
|
|
35
|
+
/** One ui.act step in words: "Pressed “Save”", "Typed into the text box", "Saved (⌘S)"; a refused one as tried, "Could
|
|
36
|
+
* not press “Save”". */
|
|
37
|
+
export declare function stepWords(step: ComputerStepRow): string;
|
|
38
|
+
/** An act's steps that ran, in words: the first three, then how many more. "Selected all (⌘A), typed into the text box,
|
|
39
|
+
* saved (⌘S), +1 more". A step refused after those is said too, last, the ones before it counted: the call answered,
|
|
40
|
+
* so its words are what says the act did not do it all. */
|
|
41
|
+
export declare function stepsWords(steps: readonly ComputerStepRow[]): string;
|
|
42
|
+
/** One computer call in words: "Opened TextEdit", "Looked at TextEdit", "Selected all (⌘A), typed into the text box",
|
|
43
|
+
* "Waited for TextEdit (not seen)". A failed one as tried, "Could not open TextEdit": its code is the call's own field,
|
|
44
|
+
* shown beside the words where a reader shows it. */
|
|
45
|
+
export declare function callWords(call: ComputerCallRow): string;
|
|
46
|
+
/** Several calls of one step in words, as its row says them: each call's, in order, "Opened Mousepad, took a screenshot,
|
|
47
|
+
* listed the apps". */
|
|
48
|
+
export declare const callsWords: (calls: readonly ComputerCallRow[]) => string;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// A computer step in words, the one voice a person reads it in wherever it shows: a computer tool call's Timeline row
|
|
2
|
+
// (labels.ts, from the call's input and answer), the step's expanded call list (the console's ComputerCalls, from the
|
|
3
|
+
// record serve keeps on a tool call's result row: computer_calls, serve's computer-calls.ts) and a movie's caption
|
|
4
|
+
// (daemon-macos/scripts/call-words.mjs, the same record). The plain past tense, what happened: "Opened TextEdit",
|
|
5
|
+
// "Selected all (⌘A), typed into the text box “Pears”", "Pressed “Save”", "Could not press “Save”". The same on a phone,
|
|
6
|
+
// a Linux desktop and a Mac. The record holds no typed or set value, so neither do the words: a type step says where it
|
|
7
|
+
// typed.
|
|
8
|
+
/** Apps whose id says little of the name a person knows them by. Any other id's last part is its name, capitalized. */
|
|
9
|
+
const APP_NAMES = {
|
|
10
|
+
"com.apple.systempreferences": "System Settings", "com.apple.iCal": "Calendar", "com.apple.finder": "Finder",
|
|
11
|
+
"com.android.settings": "Settings", "com.android.chrome": "Chrome", "xfce4-terminal": "Terminal", "org.xfce.terminal": "Terminal", xterm: "XTerm",
|
|
12
|
+
"firefox-esr": "Firefox", "google-chrome": "Chrome",
|
|
13
|
+
};
|
|
14
|
+
/** An app's id as a person names it: "com.apple.TextEdit" is TextEdit, "org.xfce.mousepad" Mousepad. */
|
|
15
|
+
export function appWords(id) {
|
|
16
|
+
const last = id.split(".").at(-1) || id;
|
|
17
|
+
return APP_NAMES[id] ?? (last ? last[0].toUpperCase() + last.slice(1) : id);
|
|
18
|
+
}
|
|
19
|
+
/** The keys a chord names that are no character (the protocol's KEYS). */
|
|
20
|
+
const NAMED_KEYS = new Set(["enter", "tab", "space", "backspace", "delete", "escape", "insert", "up", "down", "left", "right", "home", "end", "pageup", "pagedown",
|
|
21
|
+
"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12", "shift", "ctrl", "alt", "super", "capslock"]);
|
|
22
|
+
/** The modifiers whose chord with a character is a command, never typing ("super+s"); shift and a character is typing. */
|
|
23
|
+
const COMMAND_KEYS = new Set(["ctrl", "alt", "super"]);
|
|
24
|
+
/** A key step's chord as the record keeps it and the words say it: one with a command modifier, or of named keys only
|
|
25
|
+
* ("enter", "shift+tab"). A lone character or shift and one is typing (a password's, key by key), so it is nothing. */
|
|
26
|
+
export function keptChord(chord) {
|
|
27
|
+
if (typeof chord !== "string" || !chord)
|
|
28
|
+
return undefined;
|
|
29
|
+
// The last key may be "+" itself ("shift++").
|
|
30
|
+
const keys = chord.endsWith("++") ? [...chord.slice(0, -2).split("+"), "+"] : chord.split("+");
|
|
31
|
+
const lower = keys.map((key) => key.toLowerCase());
|
|
32
|
+
if (lower.some((key) => COMMAND_KEYS.has(key)))
|
|
33
|
+
return chord;
|
|
34
|
+
return lower.every((key) => NAMED_KEYS.has(key)) ? chord : undefined;
|
|
35
|
+
}
|
|
36
|
+
/** The step kinds a ui.act step may name (the protocol's UiStep keys). */
|
|
37
|
+
const STEP_KINDS = ["press", "set", "perform", "click", "type", "key", "nav", "scroll", "drag"];
|
|
38
|
+
/** A ui.act step as its record keeps it, from the step asked: its kind, the element `on` names by the step's ref (its
|
|
39
|
+
* own, or the one a type goes into), a key step's chord as kept, a nav step's place. A typed or set value is never read. */
|
|
40
|
+
export function stepOf(step, on) {
|
|
41
|
+
const given = step && typeof step === "object" && !Array.isArray(step) ? step : {};
|
|
42
|
+
const kind = STEP_KINDS.find((name) => name in given) ?? "step";
|
|
43
|
+
const ref = kind === "type" ? given.into : given[kind];
|
|
44
|
+
const target = typeof ref === "string" ? on(ref) : undefined;
|
|
45
|
+
const keys = kind === "key" ? keptChord(given.key) : undefined;
|
|
46
|
+
const nav = kind === "nav" && typeof given.nav === "string" ? given.nav : undefined;
|
|
47
|
+
return { do: kind, ...(target ? { on: target } : {}), ...(keys ? { keys } : {}), ...(nav ? { nav } : {}) };
|
|
48
|
+
}
|
|
49
|
+
/** A role as words, where its name says too little alone: a text box, a check box. */
|
|
50
|
+
const ROLE_WORDS = {
|
|
51
|
+
textbox: "text box", searchbox: "search box", checkbox: "check box", combobox: "pop-up", switch: "switch", slider: "slider",
|
|
52
|
+
list: "list", table: "table", scrollarea: "scroll area", window: "window", dialog: "dialog", menu: "menu", toolbar: "toolbar",
|
|
53
|
+
image: "image", text: "text", heading: "heading", group: "group", progressbar: "progress bar",
|
|
54
|
+
};
|
|
55
|
+
/** Roles whose name alone says what was pressed: “Save”, never "the button “Save”". An element of no known role (a
|
|
56
|
+
* phone's clickable row, "generic") and a label's text ("General" in System Settings' sidebar) are their names too. */
|
|
57
|
+
const NAME_ONLY = new Set(["button", "link", "menuitem", "tab", "listitem", "row", "cell", "radio", "generic", "text", "heading"]);
|
|
58
|
+
/** The element a step acted on, in words: “Save”, the text box “Pears: 41”, the list. */
|
|
59
|
+
function targetWords(on) {
|
|
60
|
+
if (!on)
|
|
61
|
+
return undefined;
|
|
62
|
+
const role = ROLE_WORDS[on.role] ?? (on.role === "generic" ? "element" : on.role);
|
|
63
|
+
if (!on.name)
|
|
64
|
+
return `the ${role}`;
|
|
65
|
+
return NAME_ONLY.has(on.role) ? `“${on.name}”` : `the ${role} “${on.name}”`;
|
|
66
|
+
}
|
|
67
|
+
/** What a ⌘ chord does, where a person knows it by that, as done and as tried: super+s saved. */
|
|
68
|
+
const CHORD_WORDS = {
|
|
69
|
+
s: ["Saved", "save"], a: ["Selected all", "select all"], c: ["Copied", "copy"], v: ["Pasted", "paste"], x: ["Cut", "cut"], z: ["Undid", "undo"],
|
|
70
|
+
w: ["Closed the window", "close the window"], q: ["Quit", "quit"], t: ["Opened a new tab", "open a new tab"],
|
|
71
|
+
};
|
|
72
|
+
const GLYPHS = { super: "⌘", shift: "⇧", alt: "⌥", ctrl: "⌃" };
|
|
73
|
+
const NAMED = { enter: "Return", escape: "Esc", tab: "Tab", space: "Space", backspace: "Delete", delete: "Forward Delete", up: "↑", down: "↓", left: "←", right: "→" };
|
|
74
|
+
const said = (did, act, rest = "") => ({ did: `${did}${rest}`, tried: `${act}${rest}` });
|
|
75
|
+
/** A chord as a person reads it: "super+s" is "Saved (⌘S)", "enter" is "Pressed Return", "ctrl+shift+t" is "Pressed
|
|
76
|
+
* ⌃⇧T". Only a ⌘ chord is named by what it does: what a ⌃ one does depends on the computer (on a Mac ⌃A goes to the
|
|
77
|
+
* line's start, elsewhere it selects all), and a record does not say which computer it was. */
|
|
78
|
+
function chordSaid(chord) {
|
|
79
|
+
const keys = chord.endsWith("++") ? [...chord.slice(0, -2).split("+"), "+"] : chord.split("+");
|
|
80
|
+
const last = keys.at(-1) ?? "";
|
|
81
|
+
const mods = keys.slice(0, -1).map((key) => key.toLowerCase());
|
|
82
|
+
const shown = keys.length === 1 && NAMED[last.toLowerCase()]
|
|
83
|
+
? NAMED[last.toLowerCase()]
|
|
84
|
+
: `${mods.map((key) => GLYPHS[key] ?? `${key}+`).join("")}${NAMED[last.toLowerCase()] ?? (last.length === 1 ? last.toUpperCase() : last)}`;
|
|
85
|
+
const command = mods.length === 1 && mods[0] === "super" ? CHORD_WORDS[last.toLowerCase()] : undefined;
|
|
86
|
+
return command ? said(command[0], command[1], ` (${shown})`) : said("Pressed", "press", ` ${shown}`);
|
|
87
|
+
}
|
|
88
|
+
/** The words of a chord done: "Saved (⌘S)", "Pressed ⌃⇧T". */
|
|
89
|
+
export const chordWords = (chord) => chordSaid(chord).did;
|
|
90
|
+
const NAV = {
|
|
91
|
+
back: ["Went", "go", " back"], home: ["Went", "go", " home"], app_switch: ["Opened", "open", " the recent apps"],
|
|
92
|
+
};
|
|
93
|
+
/** One ui.act step in words, as done and as tried. */
|
|
94
|
+
function stepSaid(step) {
|
|
95
|
+
const target = targetWords(step.on);
|
|
96
|
+
const on = (none) => ` ${target ?? none}`;
|
|
97
|
+
switch (step.do) {
|
|
98
|
+
case "press": return said("Pressed", "press", on("an element"));
|
|
99
|
+
case "click": return said("Clicked", "click", target ? ` ${target}` : " at a point");
|
|
100
|
+
case "set": return said("Set", "set", on("an element"));
|
|
101
|
+
case "perform": return said("Acted on", "act on", on("an element"));
|
|
102
|
+
case "type": return target ? said("Typed into", "type into", ` ${target}`) : said("Typed text", "type text");
|
|
103
|
+
case "key": return step.keys ? chordSaid(step.keys) : said("Pressed a key", "press a key");
|
|
104
|
+
case "nav": {
|
|
105
|
+
const [did, act, rest] = (step.nav && NAV[step.nav]) || ["Navigated", "navigate", ""];
|
|
106
|
+
return said(did, act, rest);
|
|
107
|
+
}
|
|
108
|
+
case "scroll": return target ? said("Scrolled", "scroll", ` ${target}`) : said("Scrolled", "scroll");
|
|
109
|
+
case "drag": return said("Dragged", "drag", " across the screen");
|
|
110
|
+
default: return said("Acted", "act");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** One ui.act step in words: "Pressed “Save”", "Typed into the text box", "Saved (⌘S)"; a refused one as tried, "Could
|
|
114
|
+
* not press “Save”". */
|
|
115
|
+
export function stepWords(step) {
|
|
116
|
+
const told = stepSaid(step);
|
|
117
|
+
return step.error === undefined ? told.did : `Could not ${told.tried}`;
|
|
118
|
+
}
|
|
119
|
+
/** At most this many steps of one act are said; the rest are counted. */
|
|
120
|
+
const STEPS_SAID = 3;
|
|
121
|
+
const lower = (words) => words[0].toLowerCase() + words.slice(1);
|
|
122
|
+
/** An act's steps that ran, in words: the first three, then how many more. "Selected all (⌘A), typed into the text box,
|
|
123
|
+
* saved (⌘S), +1 more". A step refused after those is said too, last, the ones before it counted: the call answered,
|
|
124
|
+
* so its words are what says the act did not do it all. */
|
|
125
|
+
export function stepsWords(steps) {
|
|
126
|
+
const words = steps.slice(0, STEPS_SAID).map(stepWords);
|
|
127
|
+
const rest = steps.slice(STEPS_SAID);
|
|
128
|
+
const refused = rest.findIndex((step) => step.error !== undefined);
|
|
129
|
+
const more = refused < 0 ? rest.length : rest.length - 1;
|
|
130
|
+
return [
|
|
131
|
+
words[0], ...words.slice(1).map(lower), ...(more > 0 ? [`+${more} more`] : []), ...(refused < 0 ? [] : [lower(stepWords(rest[refused]))]),
|
|
132
|
+
].join(", ");
|
|
133
|
+
}
|
|
134
|
+
/** A method other than ui's and apps', as done and as tried. */
|
|
135
|
+
const METHOD_WORDS = {
|
|
136
|
+
"screen.shot": ["Took a screenshot", "take a screenshot"], "screen.watch": ["Watched the screen", "watch the screen"],
|
|
137
|
+
"input.actions": ["Used the pointer and keys", "use the pointer and keys"], "apps.list": ["Listed the apps", "list the apps"],
|
|
138
|
+
"files.read": ["Read a file", "read a file"], "files.write": ["Wrote a file", "write a file"], "files.list": ["Listed a folder", "list a folder"],
|
|
139
|
+
"files.stat": ["Looked up a file", "look up a file"], "exec.run": ["Ran a command", "run a command"], "process.start": ["Started a process", "start a process"],
|
|
140
|
+
ping: ["Checked the computer", "check the computer"],
|
|
141
|
+
};
|
|
142
|
+
/** One computer call in words: "Opened TextEdit", "Looked at TextEdit", "Selected all (⌘A), typed into the text box",
|
|
143
|
+
* "Waited for TextEdit (not seen)". A failed one as tried, "Could not open TextEdit": its code is the call's own field,
|
|
144
|
+
* shown beside the words where a reader shows it. */
|
|
145
|
+
export function callWords(call) {
|
|
146
|
+
const app = call.app ? appWords(call.app) : undefined;
|
|
147
|
+
const told = (() => {
|
|
148
|
+
switch (call.method) {
|
|
149
|
+
case "apps.launch": return said("Opened", "open", ` ${app ?? "an app"}`);
|
|
150
|
+
case "apps.terminate": return said("Quit", "quit", ` ${app ?? "an app"}`);
|
|
151
|
+
case "ui.observe": return said("Looked at", "look at", ` ${app ?? "the window"}`);
|
|
152
|
+
case "ui.act": {
|
|
153
|
+
if (call.ok && call.steps?.length)
|
|
154
|
+
return { did: stepsWords(call.steps), tried: "" };
|
|
155
|
+
if (call.ok)
|
|
156
|
+
return said("Waited for", "wait for", ` ${app ?? "the window"}${call.expect === "unmet" ? " (not seen)" : ""}`);
|
|
157
|
+
return said("Acted on", "act on", ` ${app ?? "the computer"}`);
|
|
158
|
+
}
|
|
159
|
+
default: {
|
|
160
|
+
const [did, act] = METHOD_WORDS[call.method] ?? [call.method, call.method];
|
|
161
|
+
return said(did, act);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
})();
|
|
165
|
+
return call.ok ? told.did : `Could not ${told.tried}`;
|
|
166
|
+
}
|
|
167
|
+
/** Several calls of one step in words, as its row says them: each call's, in order, "Opened Mousepad, took a screenshot,
|
|
168
|
+
* listed the apps". */
|
|
169
|
+
export const callsWords = (calls) => calls.map((call, index) => (index === 0 ? callWords(call) : lower(callWords(call)))).join(", ");
|
package/dist/timeline/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { groupTimeline, foldCalls, failedCall, type Call, type Fold, type Group } from "./group.js";
|
|
2
|
-
export { callFailed, foldLabel, inputPreview, labelOf, nameOf, registerLabel, registerOutcome, registerTurnEnding, type FoldSpec, type LabelFn, type OutcomeFn, type ToolResultView } from "./labels.js";
|
|
2
|
+
export { callFailed, endsTurn, foldLabel, inputPreview, labelOf, nameOf, registerLabel, registerOutcome, registerTurnEnding, type FoldSpec, type LabelFn, type OutcomeFn, type ToolResultView } from "./labels.js";
|
|
3
3
|
export { renderText } from "./render-text.js";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
4
|
+
export { appWords, callWords, chordWords, stepWords, type ComputerCallRow, type ComputerStepRow } from "./computer.js";
|
|
5
|
+
export { costLabel, endedUsage, PAGE_CHANGED_ROW, RUN_RESUMED, toolCallWords, TURN_END } from "./timeline.js";
|
|
6
|
+
export { FEEDBACK_SUFFIX, isFeedbackRow, isMessageRow, isUserEntry, MESSAGE_ORIGIN, messageOrigins, NOTE_SUFFIX, originMatcher, originOf, TRIGGER_LABELS, TRIGGER_SOURCES, type MessageOrigin, type TriggerSource } from "./origin.js";
|
|
7
|
+
export { cut, scrubUrl, scrubUrls } from "./util.js";
|
|
8
|
+
export { webCut, webShownOf, webWithin, type WebShown } from "./web-calls.js";
|
|
9
|
+
export { BROWSER_CHARGE, CALL_ENDED_WITH_RUN, CALL_REFUSED, CALL_RESULT_CHARS, CAP_WRAPUP, CAPS, chargedTool, COMPUTER_NOTE, endedOnTurnEndingTool, HOST_PHASE, METRIC_NAMES, REQUEST_CONTINUED, REQUEST_COST, REQUEST_COST_LATE, REQUEST_COST_PENDING, REQUEST_ENDED, REQUEST_REFUSED, REQUEST_STARTED, runMetricsOf, runMetricsWithDecisions, timelineOf, timelineReducer, TOOL_COST, TOOL_STARTED, TOOL_UNMETERED, type AgentEventLike, type DecisionLike, type EntryLike, type RunMetrics, type SideSpend, type TimelineEvent, type TimelineKind, type TimelineOptions, type ToolMetrics, } from "./timeline.js";
|
package/dist/timeline/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { groupTimeline, foldCalls, failedCall } from "./group.js";
|
|
2
|
-
export { callFailed, foldLabel, inputPreview, labelOf, nameOf, registerLabel, registerOutcome, registerTurnEnding } from "./labels.js";
|
|
2
|
+
export { callFailed, endsTurn, foldLabel, inputPreview, labelOf, nameOf, registerLabel, registerOutcome, registerTurnEnding } from "./labels.js";
|
|
3
3
|
export { renderText } from "./render-text.js";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
4
|
+
export { appWords, callWords, chordWords, stepWords } from "./computer.js";
|
|
5
|
+
export { costLabel, endedUsage, PAGE_CHANGED_ROW, RUN_RESUMED, toolCallWords, TURN_END } from "./timeline.js";
|
|
6
|
+
export { FEEDBACK_SUFFIX, isFeedbackRow, isMessageRow, isUserEntry, MESSAGE_ORIGIN, messageOrigins, NOTE_SUFFIX, originMatcher, originOf, TRIGGER_LABELS, TRIGGER_SOURCES } from "./origin.js";
|
|
7
|
+
export { cut, scrubUrl, scrubUrls } from "./util.js";
|
|
8
|
+
export { webCut, webShownOf, webWithin } from "./web-calls.js";
|
|
9
|
+
export { BROWSER_CHARGE, CALL_ENDED_WITH_RUN, CALL_REFUSED, CALL_RESULT_CHARS, CAP_WRAPUP, CAPS, chargedTool, COMPUTER_NOTE, endedOnTurnEndingTool, HOST_PHASE, METRIC_NAMES, REQUEST_CONTINUED, REQUEST_COST, REQUEST_COST_LATE, REQUEST_COST_PENDING, REQUEST_ENDED, REQUEST_REFUSED, REQUEST_STARTED, runMetricsOf, runMetricsWithDecisions, timelineOf, timelineReducer, TOOL_COST, TOOL_STARTED, TOOL_UNMETERED, } from "./timeline.js";
|
|
@@ -14,10 +14,14 @@ export type FoldSpec = {
|
|
|
14
14
|
path?: boolean;
|
|
15
15
|
};
|
|
16
16
|
/** Registers the label of one tool, in the past tense, and with `name` what the tool is called where calls are counted
|
|
17
|
-
* (a run's analytics).
|
|
18
|
-
|
|
17
|
+
* (a run's analytics). `saysFailure`: the label of a call that errored says so itself ("Could not take a screenshot"),
|
|
18
|
+
* so its row adds only why. A host adds its own tools here. */
|
|
19
|
+
export declare function registerLabel(tool: string, label: LabelFn, fold?: FoldSpec, { name, saysFailure }?: {
|
|
19
20
|
name?: string;
|
|
21
|
+
saysFailure?: true;
|
|
20
22
|
}): void;
|
|
23
|
+
/** Whether `tool`'s label says a call that errored failed (registerLabel's saysFailure). */
|
|
24
|
+
export declare const saysFailure: (tool: string) => boolean;
|
|
21
25
|
/** What a tool is called where its calls are counted, in plain words: its registered name, else the name it was called by. */
|
|
22
26
|
export declare const nameOf: (tool: string) => string;
|
|
23
27
|
/** A finished call's outcome, when its own result says more than that the call returned: a tool that answers a refusal
|
|
@@ -64,7 +68,8 @@ export declare function foldLabel(tool: string, calls: readonly {
|
|
|
64
68
|
}[], options?: {
|
|
65
69
|
path?: (path: string) => string;
|
|
66
70
|
}): string;
|
|
67
|
-
/** The input worth showing: Grep's keys first, then the browser and file ones
|
|
71
|
+
/** The input worth showing: Grep's keys first, then the browser and file ones, and last the app a computer's look or act
|
|
72
|
+
* names (never what an act types: its steps; nor a codemode script, which can hold it). */
|
|
68
73
|
export declare function inputPreview(args: Obj, max: number): string | null;
|
|
69
74
|
/** Files a finished call put in the workspace. */
|
|
70
75
|
export declare function savedPaths(tool: string, args: Obj, result: ToolResultView): string[];
|
|
@@ -75,5 +80,7 @@ export declare const BROWSER_STEPS: ReadonlySet<string>;
|
|
|
75
80
|
/** A call refused before it ran, in plain words: "Refused: " and the tool's name with what it would have acted on (the
|
|
76
81
|
* path it would have read or written, the command it would have run, the page it would have fetched), never a label's
|
|
77
82
|
* past tense ("Wrote deny.md"), which says it ran. Any tool: one with none of those reads as its name alone (an MCP
|
|
78
|
-
* server's tool as its server and name, "fake · send_message", as its label reads it).
|
|
83
|
+
* server's tool as its server and name, "fake · send_message", as its label reads it). A computer_op reads as its op
|
|
84
|
+
* alone ("Refused: files.write"), never its arguments, which hold what it would have written or typed; an op the
|
|
85
|
+
* computer has no call for, as the tool's name. */
|
|
79
86
|
export declare function refusedLabel(tool: string, args: Obj): string;
|