@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,58 @@
|
|
|
1
|
+
/** Who a run works for: the conversation of a chat, the task of a task run, or
|
|
2
|
+
* (for a call) whoever placed it. Several dispatches can share one owner. */
|
|
3
|
+
export interface RunOwner {
|
|
4
|
+
/** The studio uid the claim is keyed on (conversation uid, task uid, or a
|
|
5
|
+
* call's queue uid when its caller is not running here). */
|
|
6
|
+
owner: string;
|
|
7
|
+
/** How a refusal names the owner, e.g. `chat CNJ94536`. */
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Mark a dispatch as running for `who`. Returns the function that marks it
|
|
12
|
+
* ended (idempotent). When an owner's last dispatch ends, its claims go: a
|
|
13
|
+
* claim only ever blocks while its owner is live.
|
|
14
|
+
*/
|
|
15
|
+
export declare function beginClaimRun(queueUid: string | undefined, who: RunOwner): () => void;
|
|
16
|
+
/** The owner of a chat turn: its conversation, over every turn. */
|
|
17
|
+
export declare function chatRunOwner(conversationUid: string): RunOwner;
|
|
18
|
+
/**
|
|
19
|
+
* The owner of a task dispatch: its task, or for a call (no task uid) the run
|
|
20
|
+
* that placed it when that runs here too (a call works on its caller's
|
|
21
|
+
* files, as `ownFiles` already says), else the call itself.
|
|
22
|
+
*/
|
|
23
|
+
export declare function taskRunOwner(queueUid: string, input: unknown): RunOwner;
|
|
24
|
+
/** The fields of a tool context that say which run is calling. */
|
|
25
|
+
export interface ClaimContext {
|
|
26
|
+
queueUid?: string;
|
|
27
|
+
taskUid?: string;
|
|
28
|
+
conversationId?: string;
|
|
29
|
+
}
|
|
30
|
+
/** The owner of the run behind a tool call: the registered dispatch, else
|
|
31
|
+
* the task, else the chat. Null when the call names no run at all. */
|
|
32
|
+
export declare function ownerOfContext(ctx: ClaimContext | undefined): RunOwner | null;
|
|
33
|
+
/**
|
|
34
|
+
* The refusal for a write to `absPath` by the run behind `ctx`, or null when
|
|
35
|
+
* the write may go ahead. A claim of an ended owner, or on a file that is
|
|
36
|
+
* clean again, is dropped here so the writer can take it over.
|
|
37
|
+
*/
|
|
38
|
+
export declare function refuseClaimedWrite(absPath: string, displayPath: string, ctx: ClaimContext | undefined): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The other live run that claims `absPath`, or null: no claim, the claiming
|
|
41
|
+
* run has ended, or it is the run behind `ctx` itself. Changes nothing (a shell
|
|
42
|
+
* command uses it to leave another run's files out of what it touched).
|
|
43
|
+
*/
|
|
44
|
+
export declare function claimedByOtherRun(absPath: string, ctx: ClaimContext | undefined): RunOwner | null;
|
|
45
|
+
/**
|
|
46
|
+
* The line on top of a read of `absPath` while another live run has it
|
|
47
|
+
* changed and uncommitted, or null. Changes nothing: a stale claim is dropped
|
|
48
|
+
* by the next write (refuseClaimedWrite). Git is only asked when there is a
|
|
49
|
+
* live claim of another run, so an ordinary read costs a map lookup.
|
|
50
|
+
*/
|
|
51
|
+
export declare function claimedReadNote(absPath: string, displayPath: string, ctx: ClaimContext | undefined): string | null;
|
|
52
|
+
/** The owner whose live run claims `absPath`, or null. Changes nothing. */
|
|
53
|
+
export declare function liveClaimOwner(absPath: string): string | null;
|
|
54
|
+
/** Record that the run behind `ctx` wrote `absPath`. Keeps the first write's
|
|
55
|
+
* time while the same owner holds the claim. */
|
|
56
|
+
export declare function claimFile(absPath: string, ctx: ClaimContext | undefined): void;
|
|
57
|
+
/** Forget every claim and live run. Tests only. */
|
|
58
|
+
export declare function resetFileClaims(): void;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { basename, dirname } from 'node:path';
|
|
3
|
+
/** The owner of each live dispatch, by its queue uid. */
|
|
4
|
+
const ownerByQueue = new Map();
|
|
5
|
+
/** Live dispatches per owner (a chat whose next turn supersedes the last one
|
|
6
|
+
* counts twice for a moment). */
|
|
7
|
+
const liveCount = new Map();
|
|
8
|
+
const liveLabels = new Map();
|
|
9
|
+
/** Claims by canonical absolute path. */
|
|
10
|
+
const claims = new Map();
|
|
11
|
+
/** True while a dispatch of `owner` is running on this runner. */
|
|
12
|
+
function isRunLive(owner) {
|
|
13
|
+
return (liveCount.get(owner) ?? 0) > 0;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Mark a dispatch as running for `who`. Returns the function that marks it
|
|
17
|
+
* ended (idempotent). When an owner's last dispatch ends, its claims go: a
|
|
18
|
+
* claim only ever blocks while its owner is live.
|
|
19
|
+
*/
|
|
20
|
+
export function beginClaimRun(queueUid, who) {
|
|
21
|
+
if (queueUid)
|
|
22
|
+
ownerByQueue.set(queueUid, who);
|
|
23
|
+
liveCount.set(who.owner, (liveCount.get(who.owner) ?? 0) + 1);
|
|
24
|
+
liveLabels.set(who.owner, who.label);
|
|
25
|
+
let ended = false;
|
|
26
|
+
return () => {
|
|
27
|
+
if (ended)
|
|
28
|
+
return;
|
|
29
|
+
ended = true;
|
|
30
|
+
if (queueUid && ownerByQueue.get(queueUid) === who)
|
|
31
|
+
ownerByQueue.delete(queueUid);
|
|
32
|
+
const left = (liveCount.get(who.owner) ?? 1) - 1;
|
|
33
|
+
if (left > 0) {
|
|
34
|
+
liveCount.set(who.owner, left);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
liveCount.delete(who.owner);
|
|
38
|
+
liveLabels.delete(who.owner);
|
|
39
|
+
for (const [path, claim] of claims) {
|
|
40
|
+
if (claim.owner === who.owner)
|
|
41
|
+
claims.delete(path);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** The owner of a chat turn: its conversation, over every turn. */
|
|
46
|
+
export function chatRunOwner(conversationUid) {
|
|
47
|
+
return { owner: conversationUid, label: `chat ${conversationUid}` };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The owner of a task dispatch: its task, or for a call (no task uid) the run
|
|
51
|
+
* that placed it when that runs here too (a call works on its caller's
|
|
52
|
+
* files, as `ownFiles` already says), else the call itself.
|
|
53
|
+
*/
|
|
54
|
+
export function taskRunOwner(queueUid, input) {
|
|
55
|
+
const i = (input && typeof input === 'object' ? input : {});
|
|
56
|
+
if (typeof i.taskUid === 'string' && i.taskUid)
|
|
57
|
+
return { owner: i.taskUid, label: `task ${i.taskUid}` };
|
|
58
|
+
const key = typeof i.caller?.scratchKey === 'string' ? i.caller.scratchKey : null;
|
|
59
|
+
if (key) {
|
|
60
|
+
const viaQueue = ownerByQueue.get(key);
|
|
61
|
+
if (viaQueue)
|
|
62
|
+
return viaQueue;
|
|
63
|
+
const label = liveLabels.get(key);
|
|
64
|
+
if (label)
|
|
65
|
+
return { owner: key, label };
|
|
66
|
+
}
|
|
67
|
+
return { owner: queueUid, label: `call ${queueUid}` };
|
|
68
|
+
}
|
|
69
|
+
/** The owner of the run behind a tool call: the registered dispatch, else
|
|
70
|
+
* the task, else the chat. Null when the call names no run at all. */
|
|
71
|
+
export function ownerOfContext(ctx) {
|
|
72
|
+
const registered = ctx?.queueUid ? ownerByQueue.get(ctx.queueUid) : undefined;
|
|
73
|
+
if (registered)
|
|
74
|
+
return registered;
|
|
75
|
+
if (ctx?.taskUid)
|
|
76
|
+
return { owner: ctx.taskUid, label: `task ${ctx.taskUid}` };
|
|
77
|
+
if (ctx?.conversationId)
|
|
78
|
+
return chatRunOwner(ctx.conversationId);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether the file differs from HEAD in its repo (an untracked file counts).
|
|
83
|
+
* Null when it is not in a git repo or git fails: the caller then goes by
|
|
84
|
+
* liveness alone.
|
|
85
|
+
*/
|
|
86
|
+
function isFileChanged(absPath) {
|
|
87
|
+
try {
|
|
88
|
+
const out = execFileSync('git', ['status', '--porcelain', '--untracked-files=all', '--', basename(absPath)], {
|
|
89
|
+
cwd: dirname(absPath),
|
|
90
|
+
encoding: 'utf-8',
|
|
91
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
92
|
+
timeout: 5000,
|
|
93
|
+
});
|
|
94
|
+
return out.trim() !== '';
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function clock(ms) {
|
|
101
|
+
return new Date(ms).toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit' });
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The refusal for a write to `absPath` by the run behind `ctx`, or null when
|
|
105
|
+
* the write may go ahead. A claim of an ended owner, or on a file that is
|
|
106
|
+
* clean again, is dropped here so the writer can take it over.
|
|
107
|
+
*/
|
|
108
|
+
export function refuseClaimedWrite(absPath, displayPath, ctx) {
|
|
109
|
+
const claim = claims.get(absPath);
|
|
110
|
+
if (!claim)
|
|
111
|
+
return null;
|
|
112
|
+
const me = ownerOfContext(ctx);
|
|
113
|
+
if (me && claim.owner === me.owner)
|
|
114
|
+
return null;
|
|
115
|
+
if (!isRunLive(claim.owner) || isFileChanged(absPath) === false) {
|
|
116
|
+
claims.delete(absPath);
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return `Error: ${displayPath} has uncommitted changes from another run (${claim.label}, since ${clock(claim.since)}). Do not edit it: say so to the person, or wait until that run commits.`;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The other live run that claims `absPath`, or null: no claim, the claiming
|
|
123
|
+
* run has ended, or it is the run behind `ctx` itself. Changes nothing (a shell
|
|
124
|
+
* command uses it to leave another run's files out of what it touched).
|
|
125
|
+
*/
|
|
126
|
+
export function claimedByOtherRun(absPath, ctx) {
|
|
127
|
+
const claim = claims.get(absPath);
|
|
128
|
+
if (!claim || !isRunLive(claim.owner))
|
|
129
|
+
return null;
|
|
130
|
+
const me = ownerOfContext(ctx);
|
|
131
|
+
if (me && claim.owner === me.owner)
|
|
132
|
+
return null;
|
|
133
|
+
return { owner: claim.owner, label: claim.label };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The line on top of a read of `absPath` while another live run has it
|
|
137
|
+
* changed and uncommitted, or null. Changes nothing: a stale claim is dropped
|
|
138
|
+
* by the next write (refuseClaimedWrite). Git is only asked when there is a
|
|
139
|
+
* live claim of another run, so an ordinary read costs a map lookup.
|
|
140
|
+
*/
|
|
141
|
+
export function claimedReadNote(absPath, displayPath, ctx) {
|
|
142
|
+
const claim = claims.get(absPath);
|
|
143
|
+
if (!claim || !isRunLive(claim.owner))
|
|
144
|
+
return null;
|
|
145
|
+
const me = ownerOfContext(ctx);
|
|
146
|
+
if (me && claim.owner === me.owner)
|
|
147
|
+
return null;
|
|
148
|
+
if (isFileChanged(absPath) === false)
|
|
149
|
+
return null;
|
|
150
|
+
return `note: ${displayPath} has uncommitted changes from another run (${claim.label}, since ${clock(claim.since)}). It can change under you, and an edit is refused until that run commits or ends.`;
|
|
151
|
+
}
|
|
152
|
+
/** The owner whose live run claims `absPath`, or null. Changes nothing. */
|
|
153
|
+
export function liveClaimOwner(absPath) {
|
|
154
|
+
const claim = claims.get(absPath);
|
|
155
|
+
return claim && isRunLive(claim.owner) ? claim.owner : null;
|
|
156
|
+
}
|
|
157
|
+
/** Record that the run behind `ctx` wrote `absPath`. Keeps the first write's
|
|
158
|
+
* time while the same owner holds the claim. */
|
|
159
|
+
export function claimFile(absPath, ctx) {
|
|
160
|
+
const me = ownerOfContext(ctx);
|
|
161
|
+
if (!me)
|
|
162
|
+
return;
|
|
163
|
+
const current = claims.get(absPath);
|
|
164
|
+
if (current?.owner === me.owner)
|
|
165
|
+
return;
|
|
166
|
+
claims.set(absPath, { ...me, since: Date.now() });
|
|
167
|
+
}
|
|
168
|
+
/** Forget every claim and live run. Tests only. */
|
|
169
|
+
export function resetFileClaims() {
|
|
170
|
+
ownerByQueue.clear();
|
|
171
|
+
liveCount.clear();
|
|
172
|
+
liveLabels.clear();
|
|
173
|
+
claims.clear();
|
|
174
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FolderEntry } from '@nordhavnhq/runner-runtime';
|
|
2
|
+
import type { Config } from '../config.js';
|
|
3
|
+
/**
|
|
4
|
+
* List folders for the picker. `path === null` returns the runner's folder
|
|
5
|
+
* ROOTS (its access scope, from `nordhavn folder add`) as the top level, so
|
|
6
|
+
* the operator can drill into any of them and create a new folder directly
|
|
7
|
+
* inside a root. A concrete `path` returns that folder's immediate sub-folders,
|
|
8
|
+
* after checking it is inside a root. Throws (surfaced as an `fs:result` error)
|
|
9
|
+
* when the path escapes the runner's scope.
|
|
10
|
+
*/
|
|
11
|
+
export declare function browseFolders(config: Config, path: string | null): FolderEntry[];
|
|
12
|
+
/**
|
|
13
|
+
* Create `name` inside `parent` and return the new folder as a `FolderEntry`.
|
|
14
|
+
* `parent` must be inside a root; `name` must be a single safe path segment
|
|
15
|
+
* (no separators, no `..`). Idempotent: an existing folder of that name is
|
|
16
|
+
* returned as-is rather than erroring.
|
|
17
|
+
*/
|
|
18
|
+
export declare function makeFolder(config: Config, parent: string, name: string): FolderEntry;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import { basename, join, resolve, sep } from 'node:path';
|
|
3
|
+
import { isInsideRoot } from '../tools/_jail.js';
|
|
4
|
+
// ─── Folder browsing for the studio picker ─────────────────────────
|
|
5
|
+
//
|
|
6
|
+
// The studio UI drives a lazy treeview: it asks the runner to list the
|
|
7
|
+
// immediate sub-folders of a path so the operator can drill down and couple
|
|
8
|
+
// the right checkout to a project (or create a fresh folder for one). Every
|
|
9
|
+
// path the studio hands us is validated to sit inside one of the runner's
|
|
10
|
+
// configured folder roots (`config.projectsRoots`) - its access scope - before
|
|
11
|
+
// we touch the disk. There is no way to browse or create outside those roots.
|
|
12
|
+
/** Skipped everywhere: dot-dirs and heavy build/vcs dirs never hold a project
|
|
13
|
+
* checkout worth coupling, and scanning them is slow. */
|
|
14
|
+
function isIgnored(name) {
|
|
15
|
+
return name.startsWith('.') || name === 'node_modules';
|
|
16
|
+
}
|
|
17
|
+
/** True when `dir` has at least one non-ignored sub-directory - lets the UI
|
|
18
|
+
* render an expand affordance without a second round-trip. Unreadable dirs
|
|
19
|
+
* (permissions) report false rather than throwing. */
|
|
20
|
+
function hasChildFolders(dir) {
|
|
21
|
+
try {
|
|
22
|
+
for (const d of readdirSync(dir, { withFileTypes: true })) {
|
|
23
|
+
if (d.isDirectory() && !isIgnored(d.name))
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch { /* unreadable - treat as leaf */ }
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/** The runner's folder roots, resolved. */
|
|
31
|
+
function roots(config) {
|
|
32
|
+
return (config.projectsRoots ?? []).map(r => resolve(r));
|
|
33
|
+
}
|
|
34
|
+
/** True when `path` is one of the roots or lives inside one. */
|
|
35
|
+
function inScope(config, path) {
|
|
36
|
+
const resolved = resolve(path);
|
|
37
|
+
return roots(config).some(root => isInsideRoot(resolved, root));
|
|
38
|
+
}
|
|
39
|
+
function listChildFolders(dir) {
|
|
40
|
+
const out = [];
|
|
41
|
+
try {
|
|
42
|
+
for (const d of readdirSync(dir, { withFileTypes: true })) {
|
|
43
|
+
if (!d.isDirectory() || isIgnored(d.name))
|
|
44
|
+
continue;
|
|
45
|
+
const path = join(dir, d.name);
|
|
46
|
+
out.push({ name: d.name, path, hasChildren: hasChildFolders(path) });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch { /* unreadable - return whatever we gathered */ }
|
|
50
|
+
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* List folders for the picker. `path === null` returns the runner's folder
|
|
54
|
+
* ROOTS (its access scope, from `nordhavn folder add`) as the top level, so
|
|
55
|
+
* the operator can drill into any of them and create a new folder directly
|
|
56
|
+
* inside a root. A concrete `path` returns that folder's immediate sub-folders,
|
|
57
|
+
* after checking it is inside a root. Throws (surfaced as an `fs:result` error)
|
|
58
|
+
* when the path escapes the runner's scope.
|
|
59
|
+
*/
|
|
60
|
+
export function browseFolders(config, path) {
|
|
61
|
+
if (path == null) {
|
|
62
|
+
const seen = new Set();
|
|
63
|
+
const out = [];
|
|
64
|
+
for (const root of roots(config)) {
|
|
65
|
+
if (seen.has(root) || !existsSync(root))
|
|
66
|
+
continue;
|
|
67
|
+
seen.add(root);
|
|
68
|
+
// Roots are always expandable: even an empty one must be openable so the
|
|
69
|
+
// operator can create the first folder inside it.
|
|
70
|
+
out.push({ name: basename(root) || root, path: root, hasChildren: true });
|
|
71
|
+
}
|
|
72
|
+
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
73
|
+
}
|
|
74
|
+
if (!inScope(config, path)) {
|
|
75
|
+
throw new Error('Folder is outside the runner\'s allowed roots');
|
|
76
|
+
}
|
|
77
|
+
const resolved = resolve(path);
|
|
78
|
+
if (!existsSync(resolved) || !statSync(resolved).isDirectory()) {
|
|
79
|
+
throw new Error('Folder does not exist');
|
|
80
|
+
}
|
|
81
|
+
return listChildFolders(resolved);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Create `name` inside `parent` and return the new folder as a `FolderEntry`.
|
|
85
|
+
* `parent` must be inside a root; `name` must be a single safe path segment
|
|
86
|
+
* (no separators, no `..`). Idempotent: an existing folder of that name is
|
|
87
|
+
* returned as-is rather than erroring.
|
|
88
|
+
*/
|
|
89
|
+
export function makeFolder(config, parent, name) {
|
|
90
|
+
const clean = name.trim();
|
|
91
|
+
if (!clean || clean.includes('/') || clean.includes('\\') || clean.includes(sep) || clean === '.' || clean === '..') {
|
|
92
|
+
throw new Error('Invalid folder name');
|
|
93
|
+
}
|
|
94
|
+
if (!inScope(config, parent)) {
|
|
95
|
+
throw new Error('Parent folder is outside the runner\'s allowed roots');
|
|
96
|
+
}
|
|
97
|
+
const parentResolved = resolve(parent);
|
|
98
|
+
if (!existsSync(parentResolved) || !statSync(parentResolved).isDirectory()) {
|
|
99
|
+
throw new Error('Parent folder does not exist');
|
|
100
|
+
}
|
|
101
|
+
const path = join(parentResolved, clean);
|
|
102
|
+
mkdirSync(path, { recursive: true });
|
|
103
|
+
return { name: clean, path, hasChildren: hasChildFolders(path) };
|
|
104
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { type FsEntryAction, type FsFileBytes, type FsFileContent, type FsFileEntry, type FsGitBlame, type FsGitBranch, type FsGitChange, type FsGitCommit, type FsGitRepo, type FsGitCommitDetail, type FsGitFileChange, type FsGitRemote, type FsGitRepoState, type FsGitTag } from '@nordhavnhq/runner-runtime';
|
|
2
|
+
import type { Config } from '../config.js';
|
|
3
|
+
/** `root` resolved, once it lies inside the runner's folder roots and exists. Exported for `proc:start`. */
|
|
4
|
+
export declare function checkout(config: Config, root: string): string;
|
|
5
|
+
/** `path` inside the checkout, or an error when it leaves it, by its name or
|
|
6
|
+
* through a symlink (an existing path is compared by its real location). */
|
|
7
|
+
export declare function inside(base: string, path: string): string;
|
|
8
|
+
/** One folder of the checkout: folders first, then files, what git ignores
|
|
9
|
+
* marked `ignored` (outside a repo: dependencies, builds and caches), the way
|
|
10
|
+
* an editor greys it out. */
|
|
11
|
+
export declare function listCheckout(config: Config, root: string, path: string): FsFileEntry[];
|
|
12
|
+
/**
|
|
13
|
+
* Every file of the checkout by its path, as the tree has them: in a repo
|
|
14
|
+
* what git tracks and what it does not ignore (paths relative to the
|
|
15
|
+
* checkout, which may be a folder inside the repo), plus an ignored secret
|
|
16
|
+
* in a folder git keeps; outside one a walk that leaves out dependencies,
|
|
17
|
+
* builds and caches. At most `FS_PATHS_LIMIT`, sorted.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkoutPaths(config: Config, root: string): {
|
|
20
|
+
paths: string[];
|
|
21
|
+
truncated: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** One file of the checkout as text, unless it is binary or too large; a
|
|
24
|
+
* sensitive one marked so. */
|
|
25
|
+
export declare function readCheckoutFile(config: Config, root: string, path: string): FsFileContent;
|
|
26
|
+
/** A slice of one file of the checkout as bytes, read off disk on its own
|
|
27
|
+
* (a video is never read whole); a sensitive one marked so. */
|
|
28
|
+
export declare function readCheckoutBytes(config: Config, root: string, path: string, offset: number, length: number): FsFileBytes;
|
|
29
|
+
/** The file on disk is not the version the editor started from. */
|
|
30
|
+
export declare class CheckoutConflictError extends Error {
|
|
31
|
+
constructor();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Save one existing file of the checkout as UTF-8, unless it is inside
|
|
35
|
+
* `.git` or too large (a sensitive one too: a person edits its secrets). With `baseHash`, only while the file on disk is
|
|
36
|
+
* still that version (else `CheckoutConflictError`): an agent may have written
|
|
37
|
+
* it meanwhile, and its work must not vanish under somebody's save. Written
|
|
38
|
+
* in place, so the file keeps its mode. Returns the file as saved.
|
|
39
|
+
*/
|
|
40
|
+
export declare function writeCheckoutFile(config: Config, root: string, path: string, content: string, baseHash: string | null): FsFileContent;
|
|
41
|
+
/**
|
|
42
|
+
* Make a file (empty) or a folder in the checkout, rename one, or delete
|
|
43
|
+
* several, from the code app's tree. Every path is checked before anything
|
|
44
|
+
* changes: inside the checkout, not `.git`, a new one free (nothing is
|
|
45
|
+
* overwritten), its missing folders made with it. A delete is for good, a
|
|
46
|
+
* folder with all it holds. An upload comes in pieces: the first makes the
|
|
47
|
+
* file (never over one), each next one appends only when the file is exactly
|
|
48
|
+
* as long as its `offset` says, so a piece twice or out of order is refused.
|
|
49
|
+
* Returns the new path of a create, a rename or an upload.
|
|
50
|
+
*/
|
|
51
|
+
export declare function checkoutEntry(config: Config, root: string, action: FsEntryAction): {
|
|
52
|
+
created?: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* What git says changed in the checkout, staged or not, untracked files one
|
|
56
|
+
* by one: paths relative to the checkout, which may be a folder inside the
|
|
57
|
+
* repo (git answers relative to the repo's root, so its prefix is cut off and
|
|
58
|
+
* what lies outside the checkout is left out). Throws when it is no repo.
|
|
59
|
+
*/
|
|
60
|
+
export declare function checkoutGitStatus(config: Config, root: string): FsGitChange[];
|
|
61
|
+
export interface GitRun {
|
|
62
|
+
ok: boolean;
|
|
63
|
+
stdout: string;
|
|
64
|
+
stderr: string;
|
|
65
|
+
}
|
|
66
|
+
/** git in the checkout, without blocking the runner. It never prompts: a
|
|
67
|
+
* remote that wants a password nobody stored fails instead of hanging. */
|
|
68
|
+
export declare function git(base: string, args: string[], opts?: {
|
|
69
|
+
timeout?: number;
|
|
70
|
+
env?: Record<string, string>;
|
|
71
|
+
}): Promise<GitRun>;
|
|
72
|
+
/** What git said when it failed, for the person who asked. */
|
|
73
|
+
export declare const failure: (run: GitRun, fallback: string) => string;
|
|
74
|
+
export declare const said: (run: GitRun) => string;
|
|
75
|
+
/** The checkout, failing like `checkoutGitStatus` when it is no repo. */
|
|
76
|
+
export declare function repo(config: Config, root: string): Promise<string>;
|
|
77
|
+
/**
|
|
78
|
+
* The folders below `base` that hold a `.git` (a folder, or a file for a
|
|
79
|
+
* submodule or a worktree), relative to it with `/`, sorted: level by level,
|
|
80
|
+
* at most `depth` deep, into a repository too (one can hold another). Hidden
|
|
81
|
+
* folders and `REPO_SKIP` are passed over, a symlink is never followed.
|
|
82
|
+
*/
|
|
83
|
+
export declare function findRepos(base: string, depth?: number, limit?: number): string[];
|
|
84
|
+
/**
|
|
85
|
+
* The git repositories in the checkout, for the code app's Git view to pick
|
|
86
|
+
* one: the checkout itself first when it is (or lies in) one, then every
|
|
87
|
+
* folder below it that holds one (`findRepos`), each with its branch and
|
|
88
|
+
* how many paths changed in it. None when there is no repository at all.
|
|
89
|
+
*/
|
|
90
|
+
export declare function checkoutRepos(config: Config, root: string): Promise<FsGitRepo[]>;
|
|
91
|
+
/** A remote's url without a user or password in it (a token often is one);
|
|
92
|
+
* `git@host:path` keeps its `git`, which is no secret. */
|
|
93
|
+
export declare function publicRemoteUrl(url: string): string;
|
|
94
|
+
export declare function remotesOf(base: string): Promise<FsGitRemote[]>;
|
|
95
|
+
/**
|
|
96
|
+
* The checkout's branches, the one checked out first, then the other local
|
|
97
|
+
* ones, then the remote ones, each group the most recently committed first:
|
|
98
|
+
* with its last commit and how far it is from the branch it follows. And its
|
|
99
|
+
* remotes. Throws when it is no repo.
|
|
100
|
+
*/
|
|
101
|
+
export declare function checkoutBranches(config: Config, root: string): Promise<{
|
|
102
|
+
branches: FsGitBranch[];
|
|
103
|
+
remotes: FsGitRemote[];
|
|
104
|
+
repo: FsGitRepoState;
|
|
105
|
+
tags: FsGitTag[];
|
|
106
|
+
}>;
|
|
107
|
+
/** The merge, rebase, cherry-pick or revert the checkout is in the middle of. */
|
|
108
|
+
export declare function operationOf(base: string): Promise<FsGitRepoState['operation']>;
|
|
109
|
+
/** The files with a conflict, relative to the checkout. */
|
|
110
|
+
export declare function conflictsOf(base: string): Promise<string[]>;
|
|
111
|
+
/** Whether a remote branch holds the commit: then it is not undone. */
|
|
112
|
+
export declare function isPushed(base: string, rev: string): Promise<boolean>;
|
|
113
|
+
export declare const exists: (base: string, rev: string) => Promise<boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* The latest commits of the checkout, newest first and each before its
|
|
116
|
+
* parents (what a graph needs), at most `FS_LOG_LIMIT`: on `ref` (a full ref
|
|
117
|
+
* of a local or remote branch), on what is checked out when it is null, or
|
|
118
|
+
* with `all` on every branch, remote branch and tag. Only the commits that
|
|
119
|
+
* touch the checkout, which may be a folder inside the repo, their parents
|
|
120
|
+
* the nearest that do. A repo without commits has none. Throws when it is no
|
|
121
|
+
* repo or `ref` is no branch.
|
|
122
|
+
*/
|
|
123
|
+
export declare function checkoutLog(config: Config, root: string, ref: string | null, all?: boolean, opts?: LogOptions): Promise<FsGitCommit[]>;
|
|
124
|
+
/** What narrows `checkoutLog`: paging, a search, one path (`FsLogFrame`). */
|
|
125
|
+
export interface LogOptions {
|
|
126
|
+
skip?: number;
|
|
127
|
+
search?: string;
|
|
128
|
+
path?: string;
|
|
129
|
+
}
|
|
130
|
+
/** `fs:log` with `unpushed`: the commits on HEAD no remote branch holds, each
|
|
131
|
+
* with its body and stat: what a tag of the unpushed work covers (the whole
|
|
132
|
+
* repo, not just the checkout's folder, as the tag is). Throws when it is no repo. */
|
|
133
|
+
export declare function checkoutUnpushedLog(config: Config, root: string): Promise<FsGitCommit[]>;
|
|
134
|
+
/** The commit `sha` names, in full, or an error when it is no commit here. */
|
|
135
|
+
export declare function commitOf(base: string, sha: string): Promise<string>;
|
|
136
|
+
/**
|
|
137
|
+
* One commit with its whole message and what it changed against its first
|
|
138
|
+
* parent (a merge: what it brought in), file by file, only inside the
|
|
139
|
+
* checkout, paths relative to it.
|
|
140
|
+
*/
|
|
141
|
+
export declare function checkoutShow(config: Config, root: string, sha: string, against?: string): Promise<FsGitCommitDetail>;
|
|
142
|
+
/**
|
|
143
|
+
* Who last changed each line of one file of the checkout, as it is on disk:
|
|
144
|
+
* per line the commit, null for a line not committed yet, and per commit who,
|
|
145
|
+
* when and why. Throws when git does not track the file.
|
|
146
|
+
*/
|
|
147
|
+
export declare function checkoutBlame(config: Config, root: string, path: string): Promise<FsGitBlame>;
|
|
148
|
+
/**
|
|
149
|
+
* What changed in the checkout against what is committed, staged or not,
|
|
150
|
+
* file by file with its patch (`path`: that one file): tracked files as git
|
|
151
|
+
* diffs them, untracked ones as added. Only inside the checkout, paths
|
|
152
|
+
* relative to it. A repo without commits has every file added.
|
|
153
|
+
*/
|
|
154
|
+
export declare function checkoutDiff(config: Config, root: string, path: string | null, side?: 'staged' | 'unstaged'): Promise<FsGitFileChange[]>;
|