@nordhavnhq/runner 0.0.0-stage → 0.96.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 +39 -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 +20 -0
- package/dist/cli/link.js +312 -0
- package/dist/cli/logs.d.ts +2 -0
- package/dist/cli/logs.js +144 -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 +80 -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 +135 -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 +1324 -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,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the first complete top-level JSON object in `text` and return its
|
|
3
|
+
* substring. Walks a brace counter so a `{` inside a string literal doesn't
|
|
4
|
+
* fool us, and respects backslash-escaped quotes.
|
|
5
|
+
*
|
|
6
|
+
* Used by handle-task.ts to pull validation outcome out of the
|
|
7
|
+
* `studio_update_task` tool output, which begins with a human-readable prefix
|
|
8
|
+
* ("Task updated:\n…") followed by JSON. Naive `JSON.parse(text.slice(text
|
|
9
|
+
* .indexOf('{')))` is fragile when the model appends commentary after the
|
|
10
|
+
* JSON or when the payload contains stringified inner objects.
|
|
11
|
+
*
|
|
12
|
+
* Returns null if no balanced `{...}` is present.
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractFirstJsonObject(text: string): string | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the first complete top-level JSON object in `text` and return its
|
|
3
|
+
* substring. Walks a brace counter so a `{` inside a string literal doesn't
|
|
4
|
+
* fool us, and respects backslash-escaped quotes.
|
|
5
|
+
*
|
|
6
|
+
* Used by handle-task.ts to pull validation outcome out of the
|
|
7
|
+
* `studio_update_task` tool output, which begins with a human-readable prefix
|
|
8
|
+
* ("Task updated:\n…") followed by JSON. Naive `JSON.parse(text.slice(text
|
|
9
|
+
* .indexOf('{')))` is fragile when the model appends commentary after the
|
|
10
|
+
* JSON or when the payload contains stringified inner objects.
|
|
11
|
+
*
|
|
12
|
+
* Returns null if no balanced `{...}` is present.
|
|
13
|
+
*/
|
|
14
|
+
export function extractFirstJsonObject(text) {
|
|
15
|
+
const start = text.indexOf('{');
|
|
16
|
+
if (start < 0)
|
|
17
|
+
return null;
|
|
18
|
+
let depth = 0;
|
|
19
|
+
let inString = false;
|
|
20
|
+
let escape = false;
|
|
21
|
+
for (let i = start; i < text.length; i++) {
|
|
22
|
+
const ch = text[i];
|
|
23
|
+
if (inString) {
|
|
24
|
+
if (escape) {
|
|
25
|
+
escape = false;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (ch === '\\') {
|
|
29
|
+
escape = true;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (ch === '"')
|
|
33
|
+
inString = false;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (ch === '"') {
|
|
37
|
+
inString = true;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (ch === '{')
|
|
41
|
+
depth++;
|
|
42
|
+
else if (ch === '}') {
|
|
43
|
+
depth--;
|
|
44
|
+
if (depth === 0)
|
|
45
|
+
return text.slice(start, i + 1);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Config, AgentConfig } from '../config.js';
|
|
2
|
+
import { type AgentSocket } from '../connection.js';
|
|
3
|
+
import { type PendingSteer } from './pending-steers.js';
|
|
4
|
+
import { type FindProjectInstructions } from './project-instructions.js';
|
|
5
|
+
import { type ResolveWriteScope } from './write-scope.js';
|
|
6
|
+
import { type ToolProvider } from '../tools/index.js';
|
|
7
|
+
import type { ChatDispatchFrame } from '../contract/wire.js';
|
|
8
|
+
import { type LoopStopReason } from '../contract/loop.js';
|
|
9
|
+
/**
|
|
10
|
+
* The cutoff notice under the reply, but above a reply-suggestion tag that ends
|
|
11
|
+
* it: the studio only takes that tag off the last line, so a notice under it
|
|
12
|
+
* would leave the raw tag on screen. A reply that is only the tag gets the
|
|
13
|
+
* notice above it too. Mirrors the studio's `appendAboveReplySuggestion` and
|
|
14
|
+
* its rules for a valid tag (not empty, at most 200 characters, no tag inside;
|
|
15
|
+
* not its code-fence check); change both together.
|
|
16
|
+
*/
|
|
17
|
+
export declare function appendCutoffNotice(reply: string, notice: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Actionable "you were cut off" notice for a turn stopped by a breaker
|
|
20
|
+
* (round/time/cost cap). Returns null when the turn ended normally, so the
|
|
21
|
+
* caller appends it ONLY to a genuine mid-work cutoff. A breaker fires while the
|
|
22
|
+
* agent is still calling tools, so its last narration (if any) is mid-work and
|
|
23
|
+
* must not read as a finished reply - hence the notice is appended even when a
|
|
24
|
+
* reply exists, not just when it is empty.
|
|
25
|
+
*
|
|
26
|
+
* The reason half is shared; only the "what now" half depends on where the turn
|
|
27
|
+
* was spoken, which the studio states on the frame as `inMeeting`. BOTH halves
|
|
28
|
+
* are byte-identical to the studio's own `cutoffNotice` in
|
|
29
|
+
* server/utils/internal-runtime/run-chat.ts, so an external agent and an
|
|
30
|
+
* internal one say the same thing after the same cutoff. Change one side and
|
|
31
|
+
* change the other in the same change.
|
|
32
|
+
*
|
|
33
|
+
* `inMeeting` is a required parameter rather than a defaulted one: an older
|
|
34
|
+
* studio omits the frame field, and turning that absence into `false` is the
|
|
35
|
+
* caller's job, done once where the frame is read, not silently here.
|
|
36
|
+
*/
|
|
37
|
+
export declare function cutoffNotice(stopReason: LoopStopReason, rounds: number, inMeeting: boolean): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* How much of the turn is gone, told to the agent while it can still act on it.
|
|
40
|
+
*
|
|
41
|
+
* A turn has a wall-clock budget (`maxLoopMs`, five minutes for chat) and the
|
|
42
|
+
* agent has no way to see it. So it decides whether to write a whole document
|
|
43
|
+
* inline without knowing whether there is time, discovers the answer when
|
|
44
|
+
* `cutoffNotice` cuts it off mid-work, and in a meeting the room has been
|
|
45
|
+
* waiting the entire time. Giving it the clock is what lets it make that call
|
|
46
|
+
* itself instead of running into it.
|
|
47
|
+
*
|
|
48
|
+
* Two notices, not one per round: a running commentary costs context on every
|
|
49
|
+
* later round and invites the model to narrate the time instead of using it.
|
|
50
|
+
* The first is informational, the second is what to DO about it, because by then
|
|
51
|
+
* the useful action is to stop and hand the rest to a task.
|
|
52
|
+
*
|
|
53
|
+
* Returns null when nothing is due. Never persisted and never broadcast: this
|
|
54
|
+
* rides in the loop's in-memory message array and dies with the turn.
|
|
55
|
+
*
|
|
56
|
+
* Byte-identical to the studio's `budgetNotice` in
|
|
57
|
+
* server/utils/internal-runtime/run-chat.ts, thresholds included, so an internal
|
|
58
|
+
* agent and an external one are told the same thing at the same moment. Change
|
|
59
|
+
* one side and change the other in the same change.
|
|
60
|
+
*/
|
|
61
|
+
export declare function budgetNotice(elapsedMs: number, maxLoopMs: number, alreadySent: Set<number>): string | null;
|
|
62
|
+
/** Stop a chat run another one took over (see `supersededChatRuns`). */
|
|
63
|
+
export declare function supersedeChatRun(controller: AbortController): void;
|
|
64
|
+
export interface HandleChatDeps {
|
|
65
|
+
agent: AgentConfig;
|
|
66
|
+
/** The agent's display name as the studio last sent it (`connected` frame). */
|
|
67
|
+
agentName?: () => string | undefined;
|
|
68
|
+
config: Config;
|
|
69
|
+
/** Resolved absolute path of this agent's private home (`<home>/agent_<slug>`). */
|
|
70
|
+
agentHome: string;
|
|
71
|
+
/** Host-provided resolver: given the dispatch's project slug, return the local
|
|
72
|
+
* project root to jail tools to (explicit link -> projectsRoot convention ->
|
|
73
|
+
* agent home). Injected by the frontend so the core stays filesystem-free. */
|
|
74
|
+
resolveProject: (folder: string | null | undefined) => string;
|
|
75
|
+
/** Host-provided resolver: the dispatch's workspace folders (absolute paths
|
|
76
|
+
* beside the checkout) that are usable on this machine. Omitted: none. */
|
|
77
|
+
resolveWorkspaceFolders?: (folders: readonly string[] | undefined, checkout: string) => string[];
|
|
78
|
+
/** Host-provided resolver: given a per-dispatch id, create and return this
|
|
79
|
+
* dispatch's throwaway scratch dir. Injected so the core stays
|
|
80
|
+
* filesystem-free; the runner reaps these dirs on a TTL. */
|
|
81
|
+
resolveScratch: (dispatchId: string) => string;
|
|
82
|
+
/** Host-provided, optional: which of the project's own instruction files
|
|
83
|
+
* (`CLAUDE.md`, `AGENTS.md`, ...) exist, so the system prompt tells the agent to read them.
|
|
84
|
+
* Omitted by frontends without a real filesystem. */
|
|
85
|
+
findProjectInstructions?: FindProjectInstructions;
|
|
86
|
+
/** Host-provided, optional: keep the whole output of a tool result that is
|
|
87
|
+
* too long for the conversation in this dispatch's scratch dir, and return
|
|
88
|
+
* its path (or null when it kept nothing). The loop cuts the result either
|
|
89
|
+
* way; with a path its note tells the agent to read the rest in ranges.
|
|
90
|
+
* Omitted by frontends without a real filesystem. */
|
|
91
|
+
spillToolOutput?: (scratchRoot: string, callId: string, toolName: string, text: string) => Promise<string | null>;
|
|
92
|
+
/** Host-provided, optional: validate the chat's session scope
|
|
93
|
+
* (`project.scope`, relative) against the checkout and return the absolute
|
|
94
|
+
* folder the chat may change, or null to ignore it. Omitted by frontends
|
|
95
|
+
* without a real filesystem. */
|
|
96
|
+
resolveWriteScope?: ResolveWriteScope;
|
|
97
|
+
activeChatAborts: Map<string, AbortController>;
|
|
98
|
+
/** Per-conversation queue of `chat:steer` messages. Drained at the top of
|
|
99
|
+
* each round so a message typed mid-reply is absorbed into the current turn.
|
|
100
|
+
* Keyed by conversationId (reused across turns), so this handler MUST clear
|
|
101
|
+
* its own key on finish - otherwise a late steer leaks into the next turn.
|
|
102
|
+
* Mirrors `pendingTaskSteers` on the task path. */
|
|
103
|
+
pendingChatSteers: Map<string, PendingSteer[]>;
|
|
104
|
+
/** Frontend-supplied local tools (host tools on the CLI, editor tools in
|
|
105
|
+
* VS Code, ...). The core routes every non-MCP tool call through this. */
|
|
106
|
+
toolProvider: ToolProvider;
|
|
107
|
+
debug?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export declare function createHandleChat(deps: HandleChatDeps): (socket: AgentSocket, msg: ChatDispatchFrame) => Promise<void>;
|