@nordhavnhq/runner 0.0.0-stage → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cliclick +0 -0
- package/dist/brand.d.ts +5 -0
- package/dist/brand.js +18 -0
- package/dist/cli/agent.d.ts +9 -0
- package/dist/cli/agent.js +80 -0
- package/dist/cli/folder.d.ts +2 -0
- package/dist/cli/folder.js +103 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.js +67 -0
- package/dist/cli/lifecycle.d.ts +3 -0
- package/dist/cli/lifecycle.js +149 -0
- package/dist/cli/link.d.ts +42 -0
- package/dist/cli/link.js +314 -0
- package/dist/cli/logs.d.ts +2 -0
- package/dist/cli/logs.js +147 -0
- package/dist/cli/prompts.d.ts +7 -0
- package/dist/cli/prompts.js +13 -0
- package/dist/cli/ps.d.ts +2 -0
- package/dist/cli/ps.js +81 -0
- package/dist/cli/relay.d.ts +4 -0
- package/dist/cli/relay.js +29 -0
- package/dist/cli/update.d.ts +6 -0
- package/dist/cli/update.js +131 -0
- package/dist/config.d.ts +166 -0
- package/dist/config.js +383 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +145 -0
- package/dist/legacy-env.d.ts +4 -0
- package/dist/legacy-env.js +32 -0
- package/dist/paths.d.ts +37 -0
- package/dist/paths.js +92 -0
- package/dist/runtime/daemon.d.ts +57 -0
- package/dist/runtime/daemon.js +159 -0
- package/dist/runtime/dev-start.d.ts +31 -0
- package/dist/runtime/dev-start.js +110 -0
- package/dist/runtime/file-claims.d.ts +58 -0
- package/dist/runtime/file-claims.js +174 -0
- package/dist/runtime/fs-browse.d.ts +18 -0
- package/dist/runtime/fs-browse.js +104 -0
- package/dist/runtime/fs-checkout.d.ts +154 -0
- package/dist/runtime/fs-checkout.js +1049 -0
- package/dist/runtime/fs-git-index.d.ts +22 -0
- package/dist/runtime/fs-git-index.js +133 -0
- package/dist/runtime/fs-git.d.ts +16 -0
- package/dist/runtime/fs-git.js +424 -0
- package/dist/runtime/git-relay.d.ts +46 -0
- package/dist/runtime/git-relay.js +259 -0
- package/dist/runtime/git-unpushed.d.ts +36 -0
- package/dist/runtime/git-unpushed.js +93 -0
- package/dist/runtime/node-version.d.ts +12 -0
- package/dist/runtime/node-version.js +39 -0
- package/dist/runtime/preview-tunnel.d.ts +16 -0
- package/dist/runtime/preview-tunnel.js +135 -0
- package/dist/runtime/processes.d.ts +61 -0
- package/dist/runtime/processes.js +408 -0
- package/dist/runtime/project-node-download.d.ts +17 -0
- package/dist/runtime/project-node-download.js +137 -0
- package/dist/runtime/project-node.d.ts +65 -0
- package/dist/runtime/project-node.js +223 -0
- package/dist/runtime/reap-scratch.d.ts +22 -0
- package/dist/runtime/reap-scratch.js +112 -0
- package/dist/runtime/spill-tool-output.d.ts +14 -0
- package/dist/runtime/spill-tool-output.js +84 -0
- package/dist/runtime/up.d.ts +6 -0
- package/dist/runtime/up.js +1325 -0
- package/dist/tools/_coerce.d.ts +2 -0
- package/dist/tools/_coerce.js +26 -0
- package/dist/tools/_commit-scope.d.ts +14 -0
- package/dist/tools/_commit-scope.js +70 -0
- package/dist/tools/_jail.d.ts +68 -0
- package/dist/tools/_jail.js +209 -0
- package/dist/tools/_output.d.ts +24 -0
- package/dist/tools/_output.js +48 -0
- package/dist/tools/_ripgrep.d.ts +46 -0
- package/dist/tools/_ripgrep.js +148 -0
- package/dist/tools/_run-worktree.d.ts +10 -0
- package/dist/tools/_run-worktree.js +27 -0
- package/dist/tools/_shell-words.d.ts +15 -0
- package/dist/tools/_shell-words.js +43 -0
- package/dist/tools/_sonar/astro.d.ts +6 -0
- package/dist/tools/_sonar/astro.js +45 -0
- package/dist/tools/_sonar/blade.d.ts +3 -0
- package/dist/tools/_sonar/blade.js +53 -0
- package/dist/tools/_sonar/build.d.ts +44 -0
- package/dist/tools/_sonar/build.js +147 -0
- package/dist/tools/_sonar/changed.d.ts +21 -0
- package/dist/tools/_sonar/changed.js +230 -0
- package/dist/tools/_sonar/diagnose/delta.d.ts +27 -0
- package/dist/tools/_sonar/diagnose/delta.js +64 -0
- package/dist/tools/_sonar/diagnose/detect.d.ts +39 -0
- package/dist/tools/_sonar/diagnose/detect.js +117 -0
- package/dist/tools/_sonar/diagnose/index.d.ts +13 -0
- package/dist/tools/_sonar/diagnose/index.js +217 -0
- package/dist/tools/_sonar/diagnose/lint-worker.d.ts +1 -0
- package/dist/tools/_sonar/diagnose/lint-worker.js +48 -0
- package/dist/tools/_sonar/diagnose/pool.d.ts +22 -0
- package/dist/tools/_sonar/diagnose/pool.js +149 -0
- package/dist/tools/_sonar/diagnose/rules.d.ts +23 -0
- package/dist/tools/_sonar/diagnose/rules.js +131 -0
- package/dist/tools/_sonar/diagnose/types-worker.d.ts +1 -0
- package/dist/tools/_sonar/diagnose/types-worker.js +183 -0
- package/dist/tools/_sonar/files.d.ts +14 -0
- package/dist/tools/_sonar/files.js +121 -0
- package/dist/tools/_sonar/graph.d.ts +34 -0
- package/dist/tools/_sonar/graph.js +164 -0
- package/dist/tools/_sonar/hints.d.ts +116 -0
- package/dist/tools/_sonar/hints.js +545 -0
- package/dist/tools/_sonar/imports.d.ts +38 -0
- package/dist/tools/_sonar/imports.js +275 -0
- package/dist/tools/_sonar/index.d.ts +79 -0
- package/dist/tools/_sonar/index.js +462 -0
- package/dist/tools/_sonar/keys.d.ts +5 -0
- package/dist/tools/_sonar/keys.js +248 -0
- package/dist/tools/_sonar/laravel-routes.d.ts +15 -0
- package/dist/tools/_sonar/laravel-routes.js +263 -0
- package/dist/tools/_sonar/laravel.d.ts +64 -0
- package/dist/tools/_sonar/laravel.js +326 -0
- package/dist/tools/_sonar/location.d.ts +33 -0
- package/dist/tools/_sonar/location.js +137 -0
- package/dist/tools/_sonar/map.d.ts +43 -0
- package/dist/tools/_sonar/map.js +212 -0
- package/dist/tools/_sonar/parse.d.ts +3 -0
- package/dist/tools/_sonar/parse.js +76 -0
- package/dist/tools/_sonar/prewarm.d.ts +9 -0
- package/dist/tools/_sonar/prewarm.js +96 -0
- package/dist/tools/_sonar/prisma.d.ts +9 -0
- package/dist/tools/_sonar/prisma.js +51 -0
- package/dist/tools/_sonar/refs.d.ts +7 -0
- package/dist/tools/_sonar/refs.js +273 -0
- package/dist/tools/_sonar/render.d.ts +66 -0
- package/dist/tools/_sonar/render.js +498 -0
- package/dist/tools/_sonar/resolve.d.ts +63 -0
- package/dist/tools/_sonar/resolve.js +402 -0
- package/dist/tools/_sonar/roots.d.ts +4 -0
- package/dist/tools/_sonar/roots.js +42 -0
- package/dist/tools/_sonar/routes.d.ts +5 -0
- package/dist/tools/_sonar/routes.js +247 -0
- package/dist/tools/_sonar/serve.d.ts +12 -0
- package/dist/tools/_sonar/serve.js +104 -0
- package/dist/tools/_sonar/suggest.d.ts +23 -0
- package/dist/tools/_sonar/suggest.js +114 -0
- package/dist/tools/_sonar/tests.d.ts +21 -0
- package/dist/tools/_sonar/tests.js +134 -0
- package/dist/tools/_sonar/tsconfig.d.ts +34 -0
- package/dist/tools/_sonar/tsconfig.js +188 -0
- package/dist/tools/_sonar/types.d.ts +81 -0
- package/dist/tools/_sonar/types.js +6 -0
- package/dist/tools/_symbols.d.ts +27 -0
- package/dist/tools/_symbols.js +461 -0
- package/dist/tools/_test-report.d.ts +47 -0
- package/dist/tools/_test-report.js +203 -0
- package/dist/tools/_touched.d.ts +44 -0
- package/dist/tools/_touched.js +195 -0
- package/dist/tools/_upload.d.ts +26 -0
- package/dist/tools/_upload.js +132 -0
- package/dist/tools/_worktree-setup.d.ts +29 -0
- package/dist/tools/_worktree-setup.js +204 -0
- package/dist/tools/browser.d.ts +2 -0
- package/dist/tools/browser.js +8 -0
- package/dist/tools/commit-guard.d.ts +44 -0
- package/dist/tools/commit-guard.js +165 -0
- package/dist/tools/computer.d.ts +13 -0
- package/dist/tools/computer.js +952 -0
- package/dist/tools/console.d.ts +44 -0
- package/dist/tools/console.js +739 -0
- package/dist/tools/database.d.ts +28 -0
- package/dist/tools/database.js +152 -0
- package/dist/tools/filesystem.d.ts +36 -0
- package/dist/tools/filesystem.js +506 -0
- package/dist/tools/git-tag.d.ts +10 -0
- package/dist/tools/git-tag.js +164 -0
- package/dist/tools/git.d.ts +52 -0
- package/dist/tools/git.js +1272 -0
- package/dist/tools/http.d.ts +12 -0
- package/dist/tools/http.js +119 -0
- package/dist/tools/image.d.ts +8 -0
- package/dist/tools/image.js +551 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.js +58 -0
- package/dist/tools/outline.d.ts +20 -0
- package/dist/tools/outline.js +98 -0
- package/dist/tools/search.d.ts +17 -0
- package/dist/tools/search.js +391 -0
- package/dist/tools/sonar.d.ts +17 -0
- package/dist/tools/sonar.js +231 -0
- package/dist/tools/testing.d.ts +36 -0
- package/dist/tools/testing.js +273 -0
- package/dist/tools/upload.d.ts +8 -0
- package/dist/tools/upload.js +106 -0
- package/dist/tools/webcam.d.ts +28 -0
- package/dist/tools/webcam.js +967 -0
- package/dist/update/install-kind.d.ts +35 -0
- package/dist/update/install-kind.js +109 -0
- package/dist/update/install.d.ts +32 -0
- package/dist/update/install.js +187 -0
- package/dist/update/manifest.d.ts +18 -0
- package/dist/update/manifest.js +73 -0
- package/dist/update/peers.d.ts +18 -0
- package/dist/update/peers.js +43 -0
- package/dist/update/policy.d.ts +20 -0
- package/dist/update/policy.js +49 -0
- package/dist/update/supervisor.d.ts +25 -0
- package/dist/update/supervisor.js +83 -0
- package/dist/update/updater.d.ts +44 -0
- package/dist/update/updater.js +116 -0
- package/dist/utils/format.d.ts +50 -0
- package/dist/utils/format.js +190 -0
- package/dist/version.d.ts +17 -0
- package/dist/version.js +63 -0
- package/dist/version.json +5 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/act-tools.d.ts +15 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/act-tools.js +541 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/cast-hub.d.ts +25 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/cast-hub.js +137 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/guard.d.ts +21 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/guard.js +104 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/host-protocol.d.ts +47 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/host-protocol.js +41 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/host.d.ts +18 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/host.js +15 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/index.d.ts +13 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/index.js +28 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/live-input.d.ts +74 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/live-input.js +93 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/live-open.d.ts +4 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/live-open.js +57 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/live.d.ts +148 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/live.js +179 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/local-live.d.ts +31 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/local-live.js +262 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/marks.d.ts +36 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/marks.js +173 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/page-events.d.ts +27 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/page-events.js +82 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/page-tools.d.ts +13 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/page-tools.js +526 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/params.d.ts +12 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/params.js +32 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/pick.d.ts +24 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/pick.js +76 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/session.d.ts +225 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/session.js +507 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/shots.d.ts +11 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/shots.js +103 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/show.d.ts +10 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/show.js +190 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/target.d.ts +37 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/target.js +82 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/tour.d.ts +19 -0
- package/node_modules/@nordhavnhq/runner-browser/dist/tour.js +178 -0
- package/node_modules/@nordhavnhq/runner-browser/package.json +18 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/config.d.ts +96 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/config.js +25 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/connection.d.ts +276 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/connection.js +507 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/constants.d.ts +48 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/constants.js +95 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/batch.d.ts +94 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/batch.js +219 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/calls.d.ts +136 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/calls.js +214 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/fs.d.ts +735 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/fs.js +40 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/loop.d.ts +362 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/loop.js +703 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/own-files.d.ts +105 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/own-files.js +202 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/phases.d.ts +204 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/phases.js +497 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/pins.d.ts +45 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/pins.js +176 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/processes.d.ts +74 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/processes.js +72 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/release-tag.d.ts +59 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/release-tag.js +117 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/replay.d.ts +62 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/replay.js +84 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/tool-names.d.ts +27 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/tool-names.js +80 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/version.d.ts +22 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/version.js +22 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/wire.d.ts +595 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/contract/wire.js +85 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/index.d.ts +43 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/index.js +50 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/inference.d.ts +135 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/inference.js +945 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/mcp.d.ts +67 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/mcp.js +47 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/platform.d.ts +21 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/platform.js +25 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/auto-load.d.ts +39 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/auto-load.js +67 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/background-commands.d.ts +61 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/background-commands.js +58 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/chat-run-ends.d.ts +23 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/chat-run-ends.js +42 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/duration.d.ts +6 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/duration.js +12 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/events.d.ts +150 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/events.js +36 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/extract-json.d.ts +14 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/extract-json.js +49 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-chat.d.ts +109 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-chat.js +894 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-task.d.ts +73 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-task.js +765 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/loop.d.ts +246 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/loop.js +621 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/messages.d.ts +88 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/messages.js +188 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/pending-steers.d.ts +15 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/pending-steers.js +10 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/phased-loop.d.ts +16 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/phased-loop.js +97 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/project-instructions.d.ts +22 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/project-instructions.js +47 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/run-tools.d.ts +26 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/run-tools.js +48 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/scratch-prompt.d.ts +8 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/scratch-prompt.js +19 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/side-question.d.ts +76 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/side-question.js +155 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/task-validation.d.ts +43 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/task-validation.js +37 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/unload-toolset.d.ts +49 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/unload-toolset.js +104 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/write-scope.d.ts +16 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/write-scope.js +6 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/tools/delegate.d.ts +86 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/tools/delegate.js +141 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/tools/index.d.ts +179 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/tools/index.js +35 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/tools/mcp.d.ts +21 -0
- package/node_modules/@nordhavnhq/runner-runtime/dist/tools/mcp.js +179 -0
- package/node_modules/@nordhavnhq/runner-runtime/package.json +18 -0
- package/package.json +33 -4
- package/README.md +0 -3
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { resolveTarget } from './target.js';
|
|
2
|
+
// ─── marks: point at elements on a page for the person ──────────────────────
|
|
3
|
+
//
|
|
4
|
+
// `runner_browser_show` can draw numbered boxes with a short label around
|
|
5
|
+
// elements of the page, so the person sees in the live view what the agent is
|
|
6
|
+
// talking about. The layer lives in the page itself (a closed shadow root), so
|
|
7
|
+
// the screencast and a headed window show it without anything in the studio.
|
|
8
|
+
// It is aria-hidden and lets every pointer event through: snapshots and the
|
|
9
|
+
// agent's own clicks do not see it. A navigation drops it with the document.
|
|
10
|
+
export const MARKS_MAX = 12;
|
|
11
|
+
export const MARK_LABEL_MAX = 140;
|
|
12
|
+
const RESOLVE_TIMEOUT_MS = 3_000;
|
|
13
|
+
const HOST_IDS = { marks: '__justmade_marks__', pick: '__justmade_pick__' };
|
|
14
|
+
export const MARK_TONES = ['issue', 'good', 'info'];
|
|
15
|
+
const TONE_COLOURS = {
|
|
16
|
+
default: '#ff3d7f',
|
|
17
|
+
issue: '#ef4444',
|
|
18
|
+
good: '#16a34a',
|
|
19
|
+
info: '#2563eb',
|
|
20
|
+
};
|
|
21
|
+
/** One mark of the `marks` parameter, or why it is wrong. */
|
|
22
|
+
function readMark(item, n) {
|
|
23
|
+
if (!item || typeof item !== 'object')
|
|
24
|
+
return { error: `Error: Mark ${n} must be an object with ref or selector.` };
|
|
25
|
+
const m = item;
|
|
26
|
+
const ref = typeof m.ref === 'string' ? m.ref.trim() : '';
|
|
27
|
+
const selector = typeof m.selector === 'string' ? m.selector.trim() : '';
|
|
28
|
+
if (!ref && !selector)
|
|
29
|
+
return { error: `Error: Mark ${n} needs a ref (from runner_browser_snapshot) or a selector.` };
|
|
30
|
+
if (m.tone !== undefined && !MARK_TONES.includes(m.tone)) {
|
|
31
|
+
return { error: `Error: Mark ${n}: \`tone\` is one of ${MARK_TONES.join(', ')}.` };
|
|
32
|
+
}
|
|
33
|
+
const label = typeof m.label === 'string' ? m.label.trim().slice(0, MARK_LABEL_MAX) : '';
|
|
34
|
+
return {
|
|
35
|
+
...(ref ? { ref } : { selector }),
|
|
36
|
+
...(label ? { label } : {}),
|
|
37
|
+
...(m.tone ? { tone: m.tone } : {}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Validate the `marks` parameter: an array of { ref | selector, label?, tone? }. */
|
|
41
|
+
export function readMarks(raw) {
|
|
42
|
+
if (raw === undefined || raw === null)
|
|
43
|
+
return undefined;
|
|
44
|
+
if (!Array.isArray(raw))
|
|
45
|
+
return { error: 'Error: `marks` must be an array of { ref | selector, label }.' };
|
|
46
|
+
if (raw.length > MARKS_MAX)
|
|
47
|
+
return { error: `Error: At most ${MARKS_MAX} marks at once.` };
|
|
48
|
+
const marks = [];
|
|
49
|
+
for (const [i, item] of raw.entries()) {
|
|
50
|
+
const mark = readMark(item, i + 1);
|
|
51
|
+
if ('error' in mark)
|
|
52
|
+
return mark;
|
|
53
|
+
marks.push(mark);
|
|
54
|
+
}
|
|
55
|
+
return marks;
|
|
56
|
+
}
|
|
57
|
+
/** Remove a marks layer from a page. Never throws. */
|
|
58
|
+
export async function clearMarks(page, layer = 'marks') {
|
|
59
|
+
await page.evaluate((id) => {
|
|
60
|
+
const host = document.getElementById(id);
|
|
61
|
+
host?.__stop?.();
|
|
62
|
+
host?.remove();
|
|
63
|
+
}, HOST_IDS[layer]).catch(() => { });
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Draw the marks on the page, replacing any that are there. An empty list just
|
|
67
|
+
* clears. The first mark is scrolled into view.
|
|
68
|
+
*/
|
|
69
|
+
export async function drawMarks(page, marks, layer = 'marks') {
|
|
70
|
+
await clearMarks(page, layer);
|
|
71
|
+
const missed = [];
|
|
72
|
+
const items = [];
|
|
73
|
+
for (const [i, mark] of marks.entries()) {
|
|
74
|
+
const target = resolveTarget(page, mark);
|
|
75
|
+
if (!target || 'error' in target) {
|
|
76
|
+
missed.push({ mark: i + 1, error: target?.error ?? 'no target' });
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const el = await target.locator.elementHandle({ timeout: RESOLVE_TIMEOUT_MS });
|
|
81
|
+
if (!el)
|
|
82
|
+
throw new Error('not found');
|
|
83
|
+
items.push({ el, label: mark.label ?? '', n: i + 1, colour: TONE_COLOURS[mark.tone ?? 'default'] });
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
const hint = mark.ref ? ' (take a fresh snapshot)' : '';
|
|
87
|
+
missed.push({ mark: i + 1, error: `${target.name} is not on the page${hint}.` });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!items.length)
|
|
91
|
+
return { marked: 0, missed };
|
|
92
|
+
await items[0].el.scrollIntoViewIfNeeded({ timeout: RESOLVE_TIMEOUT_MS }).catch(() => { });
|
|
93
|
+
await page.evaluate(paintMarks, { id: HOST_IDS[layer], list: items.map(({ el, label, n, colour }) => ({ el, label, n, colour })) });
|
|
94
|
+
for (const { el } of items)
|
|
95
|
+
void el.dispose().catch(() => { });
|
|
96
|
+
return { marked: items.length, missed };
|
|
97
|
+
}
|
|
98
|
+
/** Runs in the page: the marks layer in a closed shadow root, placed again every frame. */
|
|
99
|
+
function paintMarks({ id, list }) {
|
|
100
|
+
const host = document.createElement('div');
|
|
101
|
+
host.id = id;
|
|
102
|
+
host.setAttribute('aria-hidden', 'true');
|
|
103
|
+
host.style.cssText = 'position:fixed;inset:0;pointer-events:none;z-index:2147483647;';
|
|
104
|
+
const root = host.attachShadow({ mode: 'closed' });
|
|
105
|
+
const style = document.createElement('style');
|
|
106
|
+
style.textContent = [
|
|
107
|
+
':host{all:initial}',
|
|
108
|
+
// The colour comes per mark (`--c`, its tone); the ring is that colour, faded.
|
|
109
|
+
'.box{position:fixed;border:3px solid var(--c);border-radius:6px;box-shadow:0 0 0 4px color-mix(in srgb,var(--c) 25%,transparent);transition:opacity .15s;box-sizing:border-box}',
|
|
110
|
+
// A label never runs off the viewport (a narrow phone): it wraps instead.
|
|
111
|
+
'.tag{position:fixed;display:flex;align-items:flex-start;gap:6px;max-width:min(320px,calc(100vw - 8px));font:600 13px/1.35 system-ui,-apple-system,sans-serif;color:#fff}',
|
|
112
|
+
'.n{flex:none;min-width:22px;height:22px;border-radius:11px;background:var(--c);display:flex;align-items:center;justify-content:center;padding:0 6px;box-sizing:border-box}',
|
|
113
|
+
'.t{background:#16161d;border-radius:6px;padding:3px 8px;box-shadow:0 2px 8px rgba(0,0,0,.3)}',
|
|
114
|
+
].join('');
|
|
115
|
+
root.appendChild(style);
|
|
116
|
+
const placed = list.map(({ el, label, n, colour }) => {
|
|
117
|
+
const box = document.createElement('div');
|
|
118
|
+
box.className = 'box';
|
|
119
|
+
box.style.setProperty('--c', colour);
|
|
120
|
+
const tag = document.createElement('div');
|
|
121
|
+
tag.className = 'tag';
|
|
122
|
+
tag.style.setProperty('--c', colour);
|
|
123
|
+
const num = document.createElement('span');
|
|
124
|
+
num.className = 'n';
|
|
125
|
+
num.textContent = String(n);
|
|
126
|
+
tag.appendChild(num);
|
|
127
|
+
if (label) {
|
|
128
|
+
const text = document.createElement('span');
|
|
129
|
+
text.className = 't';
|
|
130
|
+
text.textContent = label;
|
|
131
|
+
tag.appendChild(text);
|
|
132
|
+
}
|
|
133
|
+
root.append(box, tag);
|
|
134
|
+
return { el: el, box, tag };
|
|
135
|
+
});
|
|
136
|
+
// Follow scrolling, resizing and layout changes: re-measure every frame.
|
|
137
|
+
let raf = 0;
|
|
138
|
+
const overlaps = (a, b) => a.left < b.left + b.w && b.left < a.left + a.w && a.top < b.top + b.h && b.top < a.top + a.h;
|
|
139
|
+
const freeSpot = (taken, r, w, h) => {
|
|
140
|
+
// Keep the label inside the viewport on the right too.
|
|
141
|
+
const left = Math.max(4, Math.min(r.left - 4, window.innerWidth - w - 4));
|
|
142
|
+
const tops = [r.top - h - 8, r.bottom + 8].filter(t => t >= 4);
|
|
143
|
+
const free = tops.map(top => ({ left, top, w, h })).find(s => !taken.some(t => overlaps(s, t)));
|
|
144
|
+
if (free)
|
|
145
|
+
return free;
|
|
146
|
+
const spot = { left, top: tops[0] ?? r.bottom + 8, w, h };
|
|
147
|
+
for (let i = 0; i < 8 && taken.some(t => overlaps(spot, t)); i++)
|
|
148
|
+
spot.top += h + 4;
|
|
149
|
+
return spot;
|
|
150
|
+
};
|
|
151
|
+
const place = () => {
|
|
152
|
+
const taken = [];
|
|
153
|
+
for (const { el, box, tag } of placed) {
|
|
154
|
+
const r = el.getBoundingClientRect();
|
|
155
|
+
const gone = !el.isConnected || (r.width === 0 && r.height === 0);
|
|
156
|
+
box.style.opacity = tag.style.opacity = gone ? '0' : '1';
|
|
157
|
+
if (gone)
|
|
158
|
+
continue;
|
|
159
|
+
box.style.left = `${r.left - 4}px`;
|
|
160
|
+
box.style.top = `${r.top - 4}px`;
|
|
161
|
+
box.style.width = `${r.width + 8}px`;
|
|
162
|
+
box.style.height = `${r.height + 8}px`;
|
|
163
|
+
const spot = freeSpot(taken, r, tag.offsetWidth, tag.offsetHeight);
|
|
164
|
+
taken.push(spot);
|
|
165
|
+
tag.style.left = `${spot.left}px`;
|
|
166
|
+
tag.style.top = `${spot.top}px`;
|
|
167
|
+
}
|
|
168
|
+
raf = requestAnimationFrame(place);
|
|
169
|
+
};
|
|
170
|
+
place();
|
|
171
|
+
host.__stop = () => cancelAnimationFrame(raf);
|
|
172
|
+
document.documentElement.appendChild(host);
|
|
173
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Page } from 'playwright-core';
|
|
2
|
+
/** Something a tab did on its own that the agent should hear about. */
|
|
3
|
+
export interface PageEvent {
|
|
4
|
+
seq: number;
|
|
5
|
+
at: number;
|
|
6
|
+
tab: number;
|
|
7
|
+
kind: 'dialog' | 'download';
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
/** The part of a session the event wiring needs. */
|
|
11
|
+
export interface EventSink {
|
|
12
|
+
events: PageEvent[];
|
|
13
|
+
seq: number;
|
|
14
|
+
readUpTo: {
|
|
15
|
+
events: number;
|
|
16
|
+
};
|
|
17
|
+
/** Where downloads are saved (the dispatch's scratch); null: not saved. */
|
|
18
|
+
downloadDir: string | null;
|
|
19
|
+
pendingDownloads: Set<Promise<void>>;
|
|
20
|
+
}
|
|
21
|
+
/** Hook a tab's dialogs and downloads into the sink. */
|
|
22
|
+
export declare function wirePageEvents(sink: EventSink, page: Page, tab: () => number): void;
|
|
23
|
+
/**
|
|
24
|
+
* The events since the agent last heard of them, for a tool result; empty when
|
|
25
|
+
* there are none. Waits a moment for downloads that are still being saved.
|
|
26
|
+
*/
|
|
27
|
+
export declare function takeEvents(sink: EventSink): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { mkdirSync } from 'node:fs';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import { errorLine } from './params.js';
|
|
4
|
+
const EVENT_LIMIT = 50;
|
|
5
|
+
const DOWNLOAD_WAIT_MS = 5_000;
|
|
6
|
+
function push(sink, tab, kind, text) {
|
|
7
|
+
sink.events.push({ seq: ++sink.seq, at: Date.now(), tab, kind, text });
|
|
8
|
+
if (sink.events.length > EVENT_LIMIT)
|
|
9
|
+
sink.events.splice(0, sink.events.length - EVENT_LIMIT);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Answer a dialog the safe way: an alert has only OK and leaving a page is what
|
|
13
|
+
* the agent asked for, so those are accepted; a confirm or prompt is a choice
|
|
14
|
+
* the agent did not make, so it is dismissed.
|
|
15
|
+
*/
|
|
16
|
+
async function answerDialog(dialog) {
|
|
17
|
+
const type = dialog.type();
|
|
18
|
+
if (type === 'alert' || type === 'beforeunload') {
|
|
19
|
+
await dialog.accept().catch(() => { });
|
|
20
|
+
return 'accepted';
|
|
21
|
+
}
|
|
22
|
+
await dialog.dismiss().catch(() => { });
|
|
23
|
+
return 'dismissed';
|
|
24
|
+
}
|
|
25
|
+
async function saveDownload(sink, download, tab) {
|
|
26
|
+
const name = basename(download.suggestedFilename() || 'download');
|
|
27
|
+
if (!sink.downloadDir) {
|
|
28
|
+
push(sink, tab, 'download', `"${name}" from ${download.url().slice(0, 200)}: not saved (no scratch folder on this browser host)`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
mkdirSync(sink.downloadDir, { recursive: true });
|
|
33
|
+
const path = join(sink.downloadDir, `${sink.seq + 1}-${name}`);
|
|
34
|
+
await download.saveAs(path);
|
|
35
|
+
push(sink, tab, 'download', `"${name}" saved to ${path}`);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
push(sink, tab, 'download', `"${name}" failed: ${errorLine(err)}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Hook a tab's dialogs and downloads into the sink. */
|
|
42
|
+
export function wirePageEvents(sink, page, tab) {
|
|
43
|
+
page.on('dialog', (dialog) => {
|
|
44
|
+
void answerDialog(dialog).then((answer) => {
|
|
45
|
+
const message = dialog.message().replace(/\s+/g, ' ').slice(0, 300);
|
|
46
|
+
push(sink, tab(), 'dialog', `${dialog.type()} "${message}" ${answer}`);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
page.on('download', (download) => {
|
|
50
|
+
const saving = saveDownload(sink, download, tab());
|
|
51
|
+
sink.pendingDownloads.add(saving);
|
|
52
|
+
void saving.finally(() => { sink.pendingDownloads.delete(saving); });
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The events since the agent last heard of them, for a tool result; empty when
|
|
57
|
+
* there are none. Waits a moment for downloads that are still being saved.
|
|
58
|
+
*/
|
|
59
|
+
export async function takeEvents(sink) {
|
|
60
|
+
if (sink.pendingDownloads.size > 0) {
|
|
61
|
+
let timer;
|
|
62
|
+
const cap = new Promise((resolve) => { timer = setTimeout(resolve, DOWNLOAD_WAIT_MS); });
|
|
63
|
+
await Promise.race([Promise.all(sink.pendingDownloads), cap]);
|
|
64
|
+
clearTimeout(timer);
|
|
65
|
+
}
|
|
66
|
+
const fresh = sink.events.filter(e => e.seq > sink.readUpTo.events);
|
|
67
|
+
if (fresh.length === 0)
|
|
68
|
+
return {};
|
|
69
|
+
sink.readUpTo.events = fresh[fresh.length - 1].seq;
|
|
70
|
+
const out = {};
|
|
71
|
+
const dialogs = fresh.filter(e => e.kind === 'dialog').map(e => e.text);
|
|
72
|
+
const downloads = fresh.filter(e => e.kind === 'download').map(e => e.text);
|
|
73
|
+
if (dialogs.length) {
|
|
74
|
+
out.dialogs = dialogs;
|
|
75
|
+
if (dialogs.some(d => d.endsWith(' dismissed'))) {
|
|
76
|
+
out.dialogHint = 'A confirm or prompt is dismissed by default. To answer it, set window.confirm or window.prompt with runner_browser_eval before the action, then repeat it.';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (downloads.length)
|
|
80
|
+
out.downloads = downloads;
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition } from '@nordhavnhq/runner-runtime';
|
|
2
|
+
import { type BrowserSession } from './session.js';
|
|
3
|
+
type Exec = (params: Record<string, unknown>, context?: ToolContext) => Promise<string>;
|
|
4
|
+
/**
|
|
5
|
+
* The console errors since the agent last read the logs, split by source: the
|
|
6
|
+
* site's own scripts, or third parties (trackers and ads can log dozens).
|
|
7
|
+
*/
|
|
8
|
+
export declare function unreadConsoleErrors(session: BrowserSession, pageUrl: string): string | null;
|
|
9
|
+
export declare const pageTools: {
|
|
10
|
+
definition: ToolDefinition;
|
|
11
|
+
execute: Exec;
|
|
12
|
+
}[];
|
|
13
|
+
export {};
|