dsh-plugin-wsl-env 0.19.0 → 0.21.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/CHANGELOG.md +122 -0
- package/README.md +2 -2
- package/client.d.ts +5 -0
- package/client.js +98 -0
- package/cordis.patch.yml +66 -1
- package/docs/API.md +1 -0
- package/docs/CONFIGURATION.md +39 -5
- package/docs/CONFIGURATION.zh.md +15 -1
- package/docs/DIAGNOSTICS.md +83 -0
- package/docs/DIAGNOSTICS.zh.md +73 -0
- package/docs/LIMITATIONS.md +25 -0
- package/docs/LIMITATIONS.zh.md +7 -0
- package/docs/MIGRATION.md +1 -1
- package/docs/QUICKSTART.md +19 -3
- package/docs/RELEASING.md +3 -0
- package/docs/ROADMAP-1.0.md +49 -4
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +5 -0
- package/docs/UPSTREAM-OPEN-IN-APP.md +33 -0
- package/lib/client-host.d.ts +29 -0
- package/lib/client-host.js +29 -0
- package/lib/cwd-prompt-tool.d.ts +88 -0
- package/lib/cwd-prompt-tool.js +94 -0
- package/lib/cwd-prompt.d.ts +166 -0
- package/lib/cwd-prompt.js +203 -0
- package/lib/doctor-live.d.ts +5 -1
- package/lib/doctor-live.js +3 -2
- package/lib/index.js +6 -8
- package/lib/messages.d.ts +157 -0
- package/lib/messages.js +199 -0
- package/lib/preflight.d.ts +24 -0
- package/lib/preflight.js +111 -11
- package/lib/sandbox-core.js +7 -14
- package/lib/session-scope.js +10 -5
- package/lib/shell-env.d.ts +25 -0
- package/lib/shell-env.js +56 -0
- package/lib/shell.d.ts +3 -1
- package/lib/shell.js +3 -1
- package/lib/update-check.d.ts +197 -0
- package/lib/update-check.js +211 -0
- package/lib/wsl-doctor-tool.d.ts +122 -0
- package/lib/wsl-doctor-tool.js +161 -0
- package/package.json +43 -5
- package/scripts/doctor.mjs +1167 -160
package/docs/LIMITATIONS.md
CHANGED
|
@@ -94,6 +94,14 @@ operations never use the 9p share.
|
|
|
94
94
|
[ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement).
|
|
95
95
|
- **`bubblewrap` must be installed**, or both providers fail with the install
|
|
96
96
|
command; a session-start preflight surfaces the same text as an advisory warning.
|
|
97
|
+
- **Message localization is partial by design** — the preflight verdicts, `bwrap`
|
|
98
|
+
remedies and distro/workdir errors follow the app's Language setting
|
|
99
|
+
([CONFIGURATION.md](CONFIGURATION.md#message-language)); the `FS_*` refusal texts
|
|
100
|
+
in `fs-decisions` and the fsio replica stay byte-identical English because the
|
|
101
|
+
tool layer matches on those strings, and the standalone `scripts/doctor.mjs`
|
|
102
|
+
always prints English because it runs outside the app and cannot read the
|
|
103
|
+
host's locale preference. A remedy composed at probe time keeps the language
|
|
104
|
+
the probe ran in until that probe runs again.
|
|
97
105
|
- A workspace directory deleted mid-session fails with a runner error; the plugin
|
|
98
106
|
does not recreate it. A configured `cwd` that does not exist is reported as an
|
|
99
107
|
error naming the directory.
|
|
@@ -130,6 +138,23 @@ absolute path to pin one.
|
|
|
130
138
|
`git.exe`** — the `safe.directory` whitelist that WSL change review needs when
|
|
131
139
|
Windows git is installed (see Terminals below).
|
|
132
140
|
|
|
141
|
+
## The doctor's verdict and remedy boundary
|
|
142
|
+
|
|
143
|
+
The doctor's `verdict` answers under the effective configuration (the profile
|
|
144
|
+
layers the app loads, overlaid on the shipped preset) — but it is a verdict
|
|
145
|
+
about the machine and the configuration, not about a session: the
|
|
146
|
+
**policy**- and **data**-class error codes (see
|
|
147
|
+
[DIAGNOSTICS.md](DIAGNOSTICS.md#the-map)) are per-call decisions the doctor
|
|
148
|
+
cannot predict, and `ready` does not promise them away.
|
|
149
|
+
|
|
150
|
+
The doctor reads and reports; it never rewrites user- or distro-owned files.
|
|
151
|
+
`.wslconfig`, `/etc/wsl.conf`, a WSL1 conversion and distro installation are
|
|
152
|
+
remedy-only — the remedy text carries the exact command — and the fixable set
|
|
153
|
+
is limited to what is safe and reversible (stale scopes, the optional
|
|
154
|
+
packages behind `--install` plus a confirmation, and the Windows git
|
|
155
|
+
safe.directory whitelist behind the same gate). The verdict never upgrades
|
|
156
|
+
the sandbox's security statement: `enforcement: partial` is untouched.
|
|
157
|
+
|
|
133
158
|
## Session-start advisories
|
|
134
159
|
|
|
135
160
|
- **There is no session-UI notice seam in DSH 0.2.1.** `wsl-preflight` failures go
|
package/docs/LIMITATIONS.zh.md
CHANGED
|
@@ -88,6 +88,13 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
88
88
|
[ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement)。
|
|
89
89
|
- **必须安装 `bubblewrap`**,否则两个提供者都会带着安装命令失败;
|
|
90
90
|
会话启动预检会以建议性警告的形式给出同样的文本。
|
|
91
|
+
- **消息本地化按设计只覆盖一部分** —— 预检判定、`bwrap` 修复提示与
|
|
92
|
+
发行版/工作目录错误跟随应用的语言设置
|
|
93
|
+
([CONFIGURATION.zh.md](CONFIGURATION.zh.md#消息语言));`fs-decisions`
|
|
94
|
+
中的 `FS_*` 拒绝文本与 fsio 复刻保持逐字节英文,因为工具层按这些字符串
|
|
95
|
+
匹配;独立的 `scripts/doctor.mjs` 永远输出英文,因为它在应用之外运行,
|
|
96
|
+
读不到宿主的语言偏好。探测时合成的修复文本保持探测发生时的语言,
|
|
97
|
+
直到该探测再次运行。
|
|
91
98
|
- 会话中途被删除的工作区目录会以 runner 错误失败;插件不会重建它。
|
|
92
99
|
配置的 `cwd` 不存在时,报错会指明该目录。
|
|
93
100
|
|
package/docs/MIGRATION.md
CHANGED
|
@@ -74,7 +74,7 @@ shows the composed value.
|
|
|
74
74
|
| Gate | How | Runs where |
|
|
75
75
|
|---|---|---|
|
|
76
76
|
| Config docs and CHANGELOG current | review the diff; `lint:links` covers cross-references | CI |
|
|
77
|
-
| `pnpm test` | style, links, syntax, build freshness, tsc,
|
|
77
|
+
| `pnpm test` | style, links, syntax, build freshness, tsc, 42 unit files | CI (Node 22/24, Ubuntu + Windows) |
|
|
78
78
|
| `pnpm run test:coverage` | lines 85 / branches 84 / functions 70 | CI (Node 24, Ubuntu) |
|
|
79
79
|
| Peer line tested | `peer-canary` workflow resolves `next` and runs the scratch upgrade | CI schedule/manual |
|
|
80
80
|
| Packed install/upgrade/uninstall | `pnpm run e2e:install` (temp `DSH_HOME`, 0.17.1 → current over the peer raise, marker) | manual, this machine (10/10 on 2026-11-06; the origin moved 0.11.0 → 0.17.1 because dsh 0.2.2-rc.1 rightly rejects the exact-pin era) |
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -23,10 +23,21 @@ supplies the WSL environment.
|
|
|
23
23
|
| systemd + Linger (for the session runtime) | `node <plugin>/scripts/doctor.mjs` (installed) or `pnpm run doctor` (checkout) | `[boot] systemd=true` in `/etc/wsl.conf`, `wsl --shutdown`, then `loginctl enable-linger "$USER"`; or set `sessionSandbox: auto`/`false` |
|
|
24
24
|
| Node `^22.19.0` or `>=24.0.0` | only needed for source/development work | not needed inside the distro to use the published plugin |
|
|
25
25
|
|
|
26
|
+
No terminal at hand? In a session, ask for a diagnosis: the model runs the
|
|
27
|
+
`wsl_doctor` tool (mounted by this plugin) and the verdict — `ready`, or
|
|
28
|
+
`blocked` with per-failure copy-paste remedies — lands in the transcript.
|
|
29
|
+
The session-start preflight announces the same verdict on every session
|
|
30
|
+
start. `DSH_WSL_DOCTOR` additionally carries a ready-to-run command for the
|
|
31
|
+
doctor script itself (`sh -c "$DSH_WSL_DOCTOR --json"`).
|
|
32
|
+
|
|
26
33
|
The doctor (`scripts/doctor.mjs`, or `pnpm run doctor` from a checkout) checks
|
|
27
|
-
the environment and
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
the environment and ends in a verdict: `ready` means the first command should
|
|
35
|
+
succeed; `blocked` names the exact checks to fix, each with a copy-paste
|
|
36
|
+
remedy. It reads the distro's WSL mode from `wsl.exe -l -v` itself, so no
|
|
37
|
+
separate version check is needed. Doctor is read-only unless you pass `--fix`
|
|
38
|
+
(stale scopes, and the Windows git trust after a confirmation) or
|
|
39
|
+
`--fix --install` (packages, after a confirmation); `--bundle <path>` writes
|
|
40
|
+
the diagnostic file a setup report attaches.
|
|
30
41
|
|
|
31
42
|
## 2. Install
|
|
32
43
|
|
|
@@ -94,6 +105,11 @@ distro kernel. If the first command fails, the error names the remedy; the
|
|
|
94
105
|
[doctor](CONFIGURATION.md) and the [Troubleshooting table](../README.md#troubleshooting)
|
|
95
106
|
cover the common cases.
|
|
96
107
|
|
|
108
|
+
First-write note: the sandbox asks for permission before a write the session
|
|
109
|
+
policy has not granted — the prompt names the command and the target, and
|
|
110
|
+
allowing it once is safe. Enabling `loginctl enable-linger <user>` inside the
|
|
111
|
+
distro prevents the repeat prompts a non-lingering user manager causes.
|
|
112
|
+
|
|
97
113
|
The probe below runs the shipped kernel-enforced bwrap profiles live — writes
|
|
98
114
|
inside the workspace land, tested writes outside are refused with `EROFS`, and
|
|
99
115
|
the strict profile hides `/mnt` entirely
|
package/docs/RELEASING.md
CHANGED
|
@@ -256,3 +256,6 @@ npm does not let a published version be replaced, so the fix goes forward:
|
|
|
256
256
|
| The npm readme is chosen from the candidate files at the package root, and the rule is not fully explained. With `README.md` and `README.zh.md` side by side, version 0.1.1 published as `readmeFilename: README.zh.md`, so its npm page rendered Chinese — even though the tarball listed `README.md` first. Both names match the npm CLI's own selection code (`@npmcli/package-json/lib/normalize.js` globs `{README,README.*}` and accepts `/\.m?a?r?k?d?o?w?n?$/i`, which does match `.md`), so neither name is screened out. | Do not rely on the rule. Keep exactly one readme candidate at the package root, which `pnpm run lint:style` checks. The Chinese README lives in `docs/` for this reason. |
|
|
257
257
|
| A local `~/.npmrc` may point at a mirror | Pass `--registry=https://registry.npmjs.org/` on every publish and every verification. |
|
|
258
258
|
| The npm token is a credential | Keep it out of command arguments and the repository; revoke a temporary token after the release. |
|
|
259
|
+
| `gh api -f body="$var"` posts the variable as literal text, so a JSON-encoded string lands as visible `\uXXXX` escapes | The 0.19.0 announcement (2026-11-06) rendered as `\u5d2f\u53d1...` on discussion #8644 because the body was `json.dumps`-encoded and then passed through `-f`, which treats the value as raw. For non-ASCII content use `-F body=@file` (`-F` reads the file's bytes verbatim), and delete the bad comment via `deleteDiscussionComment` before reposting. |
|
|
260
|
+
| A successful write to an external system says nothing about the rendered content | Every release step that posts content (discussion comments, GitHub Release notes) must read the result back and compare it to the local source before declaring the step done. The API returns success for a double-encoded body; only the read-back — grep for `\u` escape sequences, diff the first lines against the source file — catches it. The workflow's release-verify step had to be re-created by hand on 0.19.0 for the sibling reason: its one-shot registry check ran inside the propagation window (now fixed to poll, cea5d4a). |
|
|
261
|
+
| WSL mounts drvfs per terminal session | After a `C:` 9p mount flips to read-only, `sudo mount -t drvfs 'C:' /mnt/c -o remount,rw` only fixes the session that ran it; another shell (a probe runner, an agent session) keeps the stale read-only mount and `sync-to-windows` fails with tar exit 2 ("Read-only file system"). Recover in the terminal that will run the sync: `sudo umount -l /mnt/c && sudo mount -t drvfs 'C:' /mnt/c -o rw,uid=1000,gid=1000`, then verify with `touch` before rerunning. |
|
package/docs/ROADMAP-1.0.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Roadmap 1.0: the WSL plugin the DSH ecosystem should have
|
|
2
2
|
|
|
3
|
-
Status: working plan, last refreshed 2026-11-
|
|
3
|
+
Status: working plan, last refreshed 2026-11-07 against `0.19.0` (WSL-316 doctor closed-loop planning; the §2 area tables were last refreshed at 0.15.0).
|
|
4
4
|
The 0.12.0 baseline that motivated the plan is kept below as history.
|
|
5
5
|
Audience: maintainers and contributors. This is a plan, not a release promise.
|
|
6
6
|
The short version: **from "the only WSL plugin" to "the default WSL plugin"** —
|
|
@@ -197,6 +197,13 @@ editor/LSP rewrite without an upstream seam, and default telemetry.
|
|
|
197
197
|
|
|
198
198
|
**Decision rules:**
|
|
199
199
|
|
|
200
|
+
- A new feature candidate originates from a logged pain in the
|
|
201
|
+
repository-local pain journal (`docs/superpowers/pains.md`), not from a
|
|
202
|
+
document-inferred gap; it
|
|
203
|
+
passes the three triage questions (who hurts, magnitude on the human time
|
|
204
|
+
scale, cost of not doing it) before entering this roadmap. The 2026-11-06
|
|
205
|
+
batch is the calibration: per-file watch events, the `@` seam push and the
|
|
206
|
+
clean-machine timing all died on these questions.
|
|
200
207
|
- A P1 item moves only with a measured need or a concrete consumer.
|
|
201
208
|
- A compatibility claim enters the matrix only with a test or a probe.
|
|
202
209
|
- A security statement never exceeds what the sandbox actually enforces.
|
|
@@ -379,9 +386,13 @@ command.
|
|
|
379
386
|
- [x] The preflight checks bwrap, systemd PID 1, `systemd-run` and Linger.
|
|
380
387
|
- [x] The warning is visibly attached to the session through the
|
|
381
388
|
runtime-context entry (not only logs).
|
|
382
|
-
- [
|
|
383
|
-
|
|
384
|
-
|
|
389
|
+
- [x] The transcript renders it: the runtime-context entry now carries the
|
|
390
|
+
verdict on healthy sessions too (the ready line). A dedicated GUI
|
|
391
|
+
notice/banner remains the session-notice ask
|
|
392
|
+
([#10263](https://github.com/deepseek-ai/deepseek-harness/discussions/10263)),
|
|
393
|
+
now self-sufficient: the `wsl_doctor` tool runs the doctor in-session
|
|
394
|
+
(the per-plugin diagnostics proposal #12499 was filed and withdrawn the
|
|
395
|
+
same day — the cohesive shape needs no upstream surface).
|
|
385
396
|
- [x] The warning never installs anything and never changes fail-closed
|
|
386
397
|
behavior.
|
|
387
398
|
- [x] A session with a usable environment produces no warning.
|
|
@@ -813,6 +824,40 @@ release gate; full probe suite.
|
|
|
813
824
|
|
|
814
825
|
**Depends on:** WSL-101, WSL-102, WSL-202, WSL-203.
|
|
815
826
|
|
|
827
|
+
### WSL-316 — Doctor closed loop: WSL mode, `.wslconfig`/`wsl.conf` diagnostics, verdict and smoke legs
|
|
828
|
+
|
|
829
|
+
**Priority:** P2 · **Size:** L · **Labels:** `area:onboarding`,
|
|
830
|
+
`type:feature`, `priority:P2`
|
|
831
|
+
|
|
832
|
+
**Status:** implemented on the plugin side (2026-11-07); the app-closed probe suite legs and the GUI-session closed-loop leg are on the maintainer checklist — the real-machine record is [2026-11-07 doctor real-machine](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/probe-runs/2026-11-07-doctor-real-machine.md). Designed and implemented the same day. The initial three
|
|
833
|
+
check groups (`distro.wsl-mode`, `config.wslconfig`, `distro.wsl-conf-*`) were
|
|
834
|
+
filed in [issue #35](https://github.com/Big-Dao/dsh-plugin-wsl-env/issues/35)
|
|
835
|
+
from the competitive triage (gaps #2/#3/#4). A commercial-doctor review added
|
|
836
|
+
A-level gaps (multi-distro `--all` with per-distro verdicts, the disk-full
|
|
837
|
+
class, `.wslconfig` semantics, the error-code matrix document, per-section
|
|
838
|
+
timing) and accepted B-level items (`--bundle`, DNS/clock legs, the
|
|
839
|
+
`git.win-safe` fix, `skipped` hygiene, deprecated-key detection) — the design
|
|
840
|
+
addendum and the acceptance list in the issue are the contract. Execution plan:
|
|
841
|
+
[2026-11-07 doctor closed-loop plan](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/plans/2026-11-07-doctor-closed-loop.md).
|
|
842
|
+
|
|
843
|
+
**Why:** the doctor is the onboarding promise's enforcement point; the bar is
|
|
844
|
+
the closed loop — after `doctor` and its named remedies, the first command
|
|
845
|
+
works, and `verdict: ready | blocked` says so machine-readably under the
|
|
846
|
+
**effective configuration** (a `session.systemd` failure blocks only under
|
|
847
|
+
`sessionSandbox: true`; with `auto` the fallback runs).
|
|
848
|
+
|
|
849
|
+
**Acceptance:** the issue's revised checklist (fake-`wsl.exe` matrix per new
|
|
850
|
+
check, smoke-leg fault injection, the fix-loop before→after re-verify, the
|
|
851
|
+
Tier 1 closed loop run with the GUI-session leg executed by the maintainer,
|
|
852
|
+
bilingual DIAGNOSTICS coverage of every shipped error code).
|
|
853
|
+
|
|
854
|
+
**Tests/probes:** `test/doctor.test.mjs` fake-`wsl.exe`/`cmd.exe` matrix;
|
|
855
|
+
`pnpm run doctor` against the real `wsl.exe` (read-only); the app-closed probe
|
|
856
|
+
suite for the maintainer-run legs.
|
|
857
|
+
|
|
858
|
+
**Depends on:** none upstream; the GUI verdict surface stays behind the
|
|
859
|
+
session-notice seam (#10263, deferred).
|
|
860
|
+
|
|
816
861
|
## 10. Release gates
|
|
817
862
|
|
|
818
863
|
A release is ready when:
|
|
@@ -73,6 +73,11 @@ or re-implementing the ranking engine — the regression path the RFC rules out.
|
|
|
73
73
|
**Fallback: keep the 9p walk.** `@` completion works today; it pays the
|
|
74
74
|
per-directory share cost above. There is no plugin-side optimization that is
|
|
75
75
|
safe without the seam, and the plugin does not replace the upstream module.
|
|
76
|
+
Maintainer observation (2026-11-06, real use): completion latency is
|
|
77
|
+
acceptable in practice — the human scanning the candidate list dominates the
|
|
78
|
+
walk, so the measured 56× is not the pain point. The seam stays a passive
|
|
79
|
+
wire-up when it lands (the canary watches the peer line); no active upstream
|
|
80
|
+
push is planned.
|
|
76
81
|
|
|
77
82
|
Wire `file-reference-wsl` when either happens:
|
|
78
83
|
|
|
@@ -7,6 +7,39 @@ start as Node, exit 1, and the UI reports launch-failed. File Explorer and
|
|
|
7
7
|
other non-Electron launchers work. The failure is the same on a Windows
|
|
8
8
|
folder and on a WSL UNC workspace.
|
|
9
9
|
|
|
10
|
+
Update 2026-11-06: the `0.2.1-rc.5` line cleared the flag in
|
|
11
|
+
`launchDetachedApp` (`clearedElectronFlag`, extracted in
|
|
12
|
+
[app.asar.0.2.1-rc.5.open-in-app.index.js](upstream/app.asar.0.2.1-rc.5.open-in-app.index.js)),
|
|
13
|
+
and **`0.2.2-rc.1` lost that clearing** — the regression is back on the
|
|
14
|
+
current runtime. The local machine carries a re-applied patch to the
|
|
15
|
+
installed `app.asar` (same helper, both `lib/index.js` and
|
|
16
|
+
`lib/types/resolver.js` of `@deepseek-ai/dsh-host-open-in-app`);
|
|
17
|
+
`test/probe/open-in-app-patch.sh` detects which state an install is in
|
|
18
|
+
(upstream-fixed / locally-patched / broken) and must be run after every app
|
|
19
|
+
upgrade, because an upgrade replaces the archive and silently drops the
|
|
20
|
+
local patch.
|
|
21
|
+
|
|
22
|
+
### Local patch 2 — WSL workspaces open through `--folder-uri` (verified 2026-11-06)
|
|
23
|
+
|
|
24
|
+
Riding on the same re-patch: a WSL UNC workspace
|
|
25
|
+
(`\\wsl.localhost\<distro>\...`) passed as a plain path opens a plain-folder
|
|
26
|
+
window where every command runs on the Windows side, and VS Code only
|
|
27
|
+
*suggests* "Reopen Folder in WSL". The patched `launchArgs` converts a WSL
|
|
28
|
+
UNC path (both `wsl.localhost` and `wsl$` spellings) to
|
|
29
|
+
`vscode-remote://wsl%2B<distro>/<posix path>` and passes it as
|
|
30
|
+
`--folder-uri=<uri>` — but only when the launch command is an Electron
|
|
31
|
+
editor (`Code.exe`, `Code - Insiders.exe`, `Cursor.exe`, `Windsurf.exe`);
|
|
32
|
+
every other launcher (terminals, Explorer) keeps the literal path, and
|
|
33
|
+
drive-letter paths are never rewritten. Two shapes were tried before this
|
|
34
|
+
one settled: the URI as a positional argument opens an untitled *file* whose
|
|
35
|
+
content is the URI text, so the explicit `--folder-uri=` form is required.
|
|
36
|
+
The patched module is archived in
|
|
37
|
+
[app.asar.0.2.2-rc.1.open-in-app.index.js](upstream/app.asar.0.2.2-rc.1.open-in-app.index.js).
|
|
38
|
+
|
|
39
|
+
Upstream ask, extended: besides clearing `ELECTRON_RUN_AS_NODE`, resolve a
|
|
40
|
+
WSL UNC workspace to its `vscode-remote` URI for Electron editors, so the
|
|
41
|
+
launched window is already in Remote-WSL.
|
|
42
|
+
|
|
10
43
|
User-facing note: [LIMITATIONS.md](LIMITATIONS.md#host-open-in-app).
|
|
11
44
|
|
|
12
45
|
## Environment
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root host half of `dsh-plugin-wsl-env`: a deliberate no-op plugin.
|
|
3
|
+
*
|
|
4
|
+
* The web client-modules roster only scans Loader rows whose name is an exact
|
|
5
|
+
* package name (`exactPackageSpecifier` rejects subpaths), so the browser half
|
|
6
|
+
* declared under `dsh.client` loads only when this package is mounted at its
|
|
7
|
+
* bare name. The shell executor that used to own `.` cannot serve that role:
|
|
8
|
+
* mounted at the composition root it would shadow the shipped host shell for
|
|
9
|
+
* every session. The two roles therefore split —
|
|
10
|
+
*
|
|
11
|
+
* - `.` (this module): a no-op host half, safe at the composition root; its
|
|
12
|
+
* only job is anchoring the bare-name row whose manifest the roster reads
|
|
13
|
+
* to serve `./client`;
|
|
14
|
+
* - `./shell` (`lib/shell.js`): the session shell executor, mounted inside
|
|
15
|
+
* the WSL agent preset's isolate realm.
|
|
16
|
+
*
|
|
17
|
+
* Compositions that still mount the bare name get the client half (the doctor
|
|
18
|
+
* composer button) and nothing else; the executor keeps its behavior through
|
|
19
|
+
* the explicit subpath. Before 0.20.0 `.` resolved to the executor itself —
|
|
20
|
+
* a profile that relied on that shape must switch to `dsh-plugin-wsl-env/shell`.
|
|
21
|
+
*
|
|
22
|
+
* This is a TypeScript source built to `lib/client-host.js`; edit THIS file and
|
|
23
|
+
* run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
24
|
+
* `pnpm test` fails when it drifts.
|
|
25
|
+
*
|
|
26
|
+
* @module dsh-plugin-wsl-env
|
|
27
|
+
*/
|
|
28
|
+
/** A no-op Cordis plugin: no config, no services, no effects. */
|
|
29
|
+
export declare function apply(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root host half of `dsh-plugin-wsl-env`: a deliberate no-op plugin.
|
|
3
|
+
*
|
|
4
|
+
* The web client-modules roster only scans Loader rows whose name is an exact
|
|
5
|
+
* package name (`exactPackageSpecifier` rejects subpaths), so the browser half
|
|
6
|
+
* declared under `dsh.client` loads only when this package is mounted at its
|
|
7
|
+
* bare name. The shell executor that used to own `.` cannot serve that role:
|
|
8
|
+
* mounted at the composition root it would shadow the shipped host shell for
|
|
9
|
+
* every session. The two roles therefore split —
|
|
10
|
+
*
|
|
11
|
+
* - `.` (this module): a no-op host half, safe at the composition root; its
|
|
12
|
+
* only job is anchoring the bare-name row whose manifest the roster reads
|
|
13
|
+
* to serve `./client`;
|
|
14
|
+
* - `./shell` (`lib/shell.js`): the session shell executor, mounted inside
|
|
15
|
+
* the WSL agent preset's isolate realm.
|
|
16
|
+
*
|
|
17
|
+
* Compositions that still mount the bare name get the client half (the doctor
|
|
18
|
+
* composer button) and nothing else; the executor keeps its behavior through
|
|
19
|
+
* the explicit subpath. Before 0.20.0 `.` resolved to the executor itself —
|
|
20
|
+
* a profile that relied on that shape must switch to `dsh-plugin-wsl-env/shell`.
|
|
21
|
+
*
|
|
22
|
+
* This is a TypeScript source built to `lib/client-host.js`; edit THIS file and
|
|
23
|
+
* run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
24
|
+
* `pnpm test` fails when it drifts.
|
|
25
|
+
*
|
|
26
|
+
* @module dsh-plugin-wsl-env
|
|
27
|
+
*/
|
|
28
|
+
/** A no-op Cordis plugin: no config, no services, no effects. */
|
|
29
|
+
export function apply() { }
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distro-native `working_directory` tool output: serve the model's own
|
|
3
|
+
* read/cd tool with the SAME read/`cd` semantics the harness ships, but with
|
|
4
|
+
* the returned `cwd` rewritten to the distro's POSIX form on a WSL session.
|
|
5
|
+
*
|
|
6
|
+
* The runtime-context rewrite (`lib/cwd-prompt.js`) covers the system-prompt
|
|
7
|
+
* entry and the per-turn snapshot. The `working_directory` tool is the THIRD
|
|
8
|
+
* surface the cwd reaches the model through: `dsh-tool-working-directory`
|
|
9
|
+
* prints `fs.processPath()` verbatim, which on this deployment is the UNC
|
|
10
|
+
* spelling — the one coordinate the distro shell cannot resolve. A model that
|
|
11
|
+
* quotes that path into `bash` fails exactly the failure mode the
|
|
12
|
+
* runtime-context rewrite exists to remove, so the surfaces must agree.
|
|
13
|
+
*
|
|
14
|
+
* This row DISABLES the shipped tool row and mounts a replacement with the
|
|
15
|
+
* same tool name, the same parameters, the same `cd` semantics (the harness's
|
|
16
|
+
* `workingDirectory` service still owns directory validation, resolution, and
|
|
17
|
+
* the durable change), and one difference: the returned `cwd` string has every
|
|
18
|
+
* WSL UNC spelling rewritten to its POSIX form. A non-WSL path passes through
|
|
19
|
+
* byte for byte, so host sessions see the shipped behavior.
|
|
20
|
+
*
|
|
21
|
+
* Advisory by construction. The service reads the harness's
|
|
22
|
+
* `workingDirectory` structurally; a harness without it fails this row's
|
|
23
|
+
* activation loudly (a missing service is a composition error, not a runtime
|
|
24
|
+
* degradation), while every per-call failure is the shipped tool's own — this
|
|
25
|
+
* wrapper adds no I/O and no new failure modes.
|
|
26
|
+
*
|
|
27
|
+
* This is a TypeScript source built to `lib/cwd-prompt-tool.js`; edit THIS
|
|
28
|
+
* file and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
29
|
+
* `pnpm test` fails when it drifts.
|
|
30
|
+
*
|
|
31
|
+
* @module dsh-plugin-wsl-env/cwd-prompt-tool
|
|
32
|
+
*/
|
|
33
|
+
export declare const name = "wsl-cwd-prompt-tool";
|
|
34
|
+
/**
|
|
35
|
+
* The context properties `apply` reads. Cordis 4 refuses an undeclared read —
|
|
36
|
+
* `cannot get property "tools" without inject` — so both the tool registry and
|
|
37
|
+
* the harness's `workingDirectory` service must be named here. Both are
|
|
38
|
+
* required: a host without one fails this row's activation loudly, which is
|
|
39
|
+
* the design (a missing service is a composition error, not a degradation).
|
|
40
|
+
*/
|
|
41
|
+
export declare const inject: string[];
|
|
42
|
+
/** The config schema's validated output: the row takes no options. */
|
|
43
|
+
export interface CwdPromptToolConfig {
|
|
44
|
+
/** Reserved; the wrapper has no options today. */
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** The tool registry slice this service consumes. */
|
|
48
|
+
export interface ToolRegistrySlice {
|
|
49
|
+
register: (tool: unknown) => unknown;
|
|
50
|
+
}
|
|
51
|
+
/** The harness's `workingDirectory` service slice the shipped tool uses. */
|
|
52
|
+
export interface WorkingDirectoryToolSlice {
|
|
53
|
+
ensure: (agent: unknown, signal?: unknown) => Promise<string>;
|
|
54
|
+
set: (agent: unknown, path: string, signal?: unknown) => Promise<string>;
|
|
55
|
+
}
|
|
56
|
+
/** The cordis context slice this service consumes. */
|
|
57
|
+
export type CwdPromptToolContext = {
|
|
58
|
+
tools: ToolRegistrySlice;
|
|
59
|
+
workingDirectory: WorkingDirectoryToolSlice;
|
|
60
|
+
};
|
|
61
|
+
/** A resolved tool call: what the shipped tool's `execute` receives. */
|
|
62
|
+
export interface ToolExec {
|
|
63
|
+
/** The live agent, required by the shipped tool too. */
|
|
64
|
+
agent: unknown;
|
|
65
|
+
/** Cancellation for the underlying directory operations. */
|
|
66
|
+
signal?: unknown;
|
|
67
|
+
}
|
|
68
|
+
/** The tool's result: one rewritten absolute path. */
|
|
69
|
+
export interface WorkingDirectoryResult {
|
|
70
|
+
/** The current absolute working directory, distro-native on WSL sessions. */
|
|
71
|
+
cwd: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A raw absolute path as the model should see it: the POSIX path a WSL UNC
|
|
75
|
+
* names, and every other path unchanged. This is the single-path sibling of
|
|
76
|
+
* `cwd-prompt.js`'s `rewriteQuotedUnc`, which handles the JSON-quoted texts.
|
|
77
|
+
*
|
|
78
|
+
* @param path - the absolute path the harness produced.
|
|
79
|
+
* @returns the distro-native path, or the input unchanged.
|
|
80
|
+
*/
|
|
81
|
+
export declare function rewriteUncPath(path: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Mount the replacement tool.
|
|
84
|
+
*
|
|
85
|
+
* @param ctx - the cordis context (the composition root, where the shipped
|
|
86
|
+
* tool row is disabled by the patch layer).
|
|
87
|
+
*/
|
|
88
|
+
export declare function apply(ctx: CwdPromptToolContext): Promise<void>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distro-native `working_directory` tool output: serve the model's own
|
|
3
|
+
* read/cd tool with the SAME read/`cd` semantics the harness ships, but with
|
|
4
|
+
* the returned `cwd` rewritten to the distro's POSIX form on a WSL session.
|
|
5
|
+
*
|
|
6
|
+
* The runtime-context rewrite (`lib/cwd-prompt.js`) covers the system-prompt
|
|
7
|
+
* entry and the per-turn snapshot. The `working_directory` tool is the THIRD
|
|
8
|
+
* surface the cwd reaches the model through: `dsh-tool-working-directory`
|
|
9
|
+
* prints `fs.processPath()` verbatim, which on this deployment is the UNC
|
|
10
|
+
* spelling — the one coordinate the distro shell cannot resolve. A model that
|
|
11
|
+
* quotes that path into `bash` fails exactly the failure mode the
|
|
12
|
+
* runtime-context rewrite exists to remove, so the surfaces must agree.
|
|
13
|
+
*
|
|
14
|
+
* This row DISABLES the shipped tool row and mounts a replacement with the
|
|
15
|
+
* same tool name, the same parameters, the same `cd` semantics (the harness's
|
|
16
|
+
* `workingDirectory` service still owns directory validation, resolution, and
|
|
17
|
+
* the durable change), and one difference: the returned `cwd` string has every
|
|
18
|
+
* WSL UNC spelling rewritten to its POSIX form. A non-WSL path passes through
|
|
19
|
+
* byte for byte, so host sessions see the shipped behavior.
|
|
20
|
+
*
|
|
21
|
+
* Advisory by construction. The service reads the harness's
|
|
22
|
+
* `workingDirectory` structurally; a harness without it fails this row's
|
|
23
|
+
* activation loudly (a missing service is a composition error, not a runtime
|
|
24
|
+
* degradation), while every per-call failure is the shipped tool's own — this
|
|
25
|
+
* wrapper adds no I/O and no new failure modes.
|
|
26
|
+
*
|
|
27
|
+
* This is a TypeScript source built to `lib/cwd-prompt-tool.js`; edit THIS
|
|
28
|
+
* file and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
29
|
+
* `pnpm test` fails when it drifts.
|
|
30
|
+
*
|
|
31
|
+
* @module dsh-plugin-wsl-env/cwd-prompt-tool
|
|
32
|
+
*/
|
|
33
|
+
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
34
|
+
import { uncToPosix } from "./paths.js";
|
|
35
|
+
export const name = "wsl-cwd-prompt-tool";
|
|
36
|
+
/**
|
|
37
|
+
* The context properties `apply` reads. Cordis 4 refuses an undeclared read —
|
|
38
|
+
* `cannot get property "tools" without inject` — so both the tool registry and
|
|
39
|
+
* the harness's `workingDirectory` service must be named here. Both are
|
|
40
|
+
* required: a host without one fails this row's activation loudly, which is
|
|
41
|
+
* the design (a missing service is a composition error, not a degradation).
|
|
42
|
+
*/
|
|
43
|
+
export const inject = ["tools", "workingDirectory"];
|
|
44
|
+
/**
|
|
45
|
+
* A raw absolute path as the model should see it: the POSIX path a WSL UNC
|
|
46
|
+
* names, and every other path unchanged. This is the single-path sibling of
|
|
47
|
+
* `cwd-prompt.js`'s `rewriteQuotedUnc`, which handles the JSON-quoted texts.
|
|
48
|
+
*
|
|
49
|
+
* @param path - the absolute path the harness produced.
|
|
50
|
+
* @returns the distro-native path, or the input unchanged.
|
|
51
|
+
*/
|
|
52
|
+
export function rewriteUncPath(path) {
|
|
53
|
+
const parsed = uncToPosix(path);
|
|
54
|
+
return parsed === undefined ? path : parsed.linuxPath;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Mount the replacement tool.
|
|
58
|
+
*
|
|
59
|
+
* @param ctx - the cordis context (the composition root, where the shipped
|
|
60
|
+
* tool row is disabled by the patch layer).
|
|
61
|
+
*/
|
|
62
|
+
export async function apply(ctx) {
|
|
63
|
+
ctx.tools.register(defineTool({
|
|
64
|
+
name: "working_directory",
|
|
65
|
+
description: "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
|
|
66
|
+
parameters: { cd: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Existing directory to enter. Omit to read the current directory.",
|
|
69
|
+
} },
|
|
70
|
+
output: {
|
|
71
|
+
schema: {
|
|
72
|
+
type: "object",
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
properties: { cwd: {
|
|
75
|
+
type: "string",
|
|
76
|
+
required: true,
|
|
77
|
+
description: "Current absolute working directory.",
|
|
78
|
+
} },
|
|
79
|
+
},
|
|
80
|
+
render: (_args, value) => [{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: value.cwd,
|
|
83
|
+
}],
|
|
84
|
+
},
|
|
85
|
+
async execute(args, exec) {
|
|
86
|
+
if (exec.agent === undefined)
|
|
87
|
+
throw new Error("working_directory requires an agent Session");
|
|
88
|
+
const cwd = args.cd === undefined
|
|
89
|
+
? await ctx.workingDirectory.ensure(exec.agent, exec.signal)
|
|
90
|
+
: await ctx.workingDirectory.set(exec.agent, args.cd, exec.signal);
|
|
91
|
+
return { cwd: rewriteUncPath(cwd) };
|
|
92
|
+
},
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distro-native working directory in the model's runtime context: rewrite the
|
|
3
|
+
* `working-directory:current` entry so a distro session reads its directory as
|
|
4
|
+
* the POSIX path its own commands use, not the host UNC spelling.
|
|
5
|
+
*
|
|
6
|
+
* The harness's `working-directory` service prints the session cwd verbatim,
|
|
7
|
+
* which on this deployment is `\\wsl.localhost\<distro>\...` — the coordinate
|
|
8
|
+
* system of the HOST filesystem, and one the model's tools mostly cannot use
|
|
9
|
+
* directly: the shell executor runs inside the distro, where only the POSIX
|
|
10
|
+
* form resolves. The mismatch is invisible to the harness and costs the model
|
|
11
|
+
* a translation step on every path it quotes back, with a wrong-guess failure
|
|
12
|
+
* mode (a UNC path handed to `bash` names nothing).
|
|
13
|
+
*
|
|
14
|
+
* The value reaches the model through TWO renderings, and both must be
|
|
15
|
+
* covered:
|
|
16
|
+
*
|
|
17
|
+
* 1. the system prompt — the entry as `assemble()` resolves it;
|
|
18
|
+
* 2. the per-turn runtime-context snapshot — `refreshContext()` re-resolves
|
|
19
|
+
* the registry providers DIRECTLY, so a waterfall listener on
|
|
20
|
+
* `system-prompt/assemble` never sees it.
|
|
21
|
+
*
|
|
22
|
+
* Both read the same scoped-layer table, where the nearest scope wins a name
|
|
23
|
+
* (`ScopedLayers.merge`). So the primary mechanism is a session-scoped
|
|
24
|
+
* registration UNDER THE SAME NAME: the entry's provider asks the harness's
|
|
25
|
+
* `workingDirectory` service for the CURRENT directory (so a mid-session `cd`
|
|
26
|
+
* still shows) and rewrites every WSL UNC spelling in it to its POSIX form.
|
|
27
|
+
* A root-level waterfall listener stays as defense in depth for the prompt
|
|
28
|
+
* path on a session where the inject seam is unavailable; the rewrite is
|
|
29
|
+
* idempotent, so the two mechanisms compose without interaction.
|
|
30
|
+
*
|
|
31
|
+
* Advisory by construction. The seams are structural (the plugin's own types
|
|
32
|
+
* spell the slices; docs/UPSTREAM-SESSION-NOTICE.md already relies on the
|
|
33
|
+
* sibling `systemPrompt.context()` seam): a harness without them, an agent
|
|
34
|
+
* whose context is not exposed, or a non-WSL workspace degrades to the
|
|
35
|
+
* shipped behavior — no rewrite, no failure. The rewrite touches one display
|
|
36
|
+
* string; it must never fail a model step.
|
|
37
|
+
*
|
|
38
|
+
* This is a TypeScript source built to `lib/cwd-prompt.js`; edit THIS file and
|
|
39
|
+
* run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
40
|
+
* `pnpm test` fails when it drifts.
|
|
41
|
+
*
|
|
42
|
+
* @module dsh-plugin-wsl-env/cwd-prompt
|
|
43
|
+
*/
|
|
44
|
+
import z from "@deepseek-ai/schemastery";
|
|
45
|
+
export declare const name = "wsl-cwd-prompt";
|
|
46
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
47
|
+
/** Whether the runtime-context rewrite runs at all. */
|
|
48
|
+
enabled: z<boolean, boolean, "defined">;
|
|
49
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
50
|
+
/** Whether the runtime-context rewrite runs at all. */
|
|
51
|
+
enabled: z<boolean, boolean, "defined">;
|
|
52
|
+
}>>, "plain">;
|
|
53
|
+
/** The config schema's validated output. */
|
|
54
|
+
export interface CwdPromptConfig {
|
|
55
|
+
/** Whether the runtime-context rewrite runs at all. */
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** One named contribution to the assembled system prompt. */
|
|
59
|
+
export interface PromptContextEntry {
|
|
60
|
+
/** The registry name; the harness's entry is `working-directory:current`. */
|
|
61
|
+
name?: string;
|
|
62
|
+
/** The literal contribution text, already resolved by its provider. */
|
|
63
|
+
text?: string;
|
|
64
|
+
/** Present and false on entries that skip prompt-variable interpolation. */
|
|
65
|
+
interpolate?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** The slice of the assembly the waterfall hands around. */
|
|
68
|
+
export interface PromptAssembly {
|
|
69
|
+
/** The named contributions, ordered by registry order. */
|
|
70
|
+
contexts?: PromptContextEntry[];
|
|
71
|
+
}
|
|
72
|
+
/** The waterfall's continuation; resolves to the (possibly rewritten) assembly. */
|
|
73
|
+
export type AssembleNext = () => Promise<PromptAssembly>;
|
|
74
|
+
/** The waterfall listener's signature, as the harness's own services use it. */
|
|
75
|
+
export type AssembleListener = (assembly: PromptAssembly, context: unknown, next: AssembleNext) => Promise<PromptAssembly>;
|
|
76
|
+
/** The `systemPrompt` slice an injected agent scope exposes. */
|
|
77
|
+
export interface CwdPromptScope {
|
|
78
|
+
systemPrompt: {
|
|
79
|
+
/** Register one context entry in this scope's layer. */
|
|
80
|
+
context: (entry: {
|
|
81
|
+
name: string;
|
|
82
|
+
order: number;
|
|
83
|
+
required: boolean;
|
|
84
|
+
interpolate: boolean;
|
|
85
|
+
text: (context: AssembleRequestContext) => string;
|
|
86
|
+
}) => unknown;
|
|
87
|
+
/** The order constant the harness assigned to a named context family. */
|
|
88
|
+
getContextOrder?: (family: string) => number | undefined;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** The assembly request context: what a provider's `text` receives. */
|
|
92
|
+
export interface AssembleRequestContext {
|
|
93
|
+
/** The live agent, when the assembly runs inside one. */
|
|
94
|
+
agent?: {
|
|
95
|
+
session?: {
|
|
96
|
+
header?: {
|
|
97
|
+
cwd?: string | undefined;
|
|
98
|
+
};
|
|
99
|
+
} | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}
|
|
102
|
+
/** The slice of a created agent this service inspects and injects into. */
|
|
103
|
+
export interface CwdPromptAgent {
|
|
104
|
+
/** The session stub, when mounted. */
|
|
105
|
+
session?: {
|
|
106
|
+
header?: {
|
|
107
|
+
cwd?: string | undefined;
|
|
108
|
+
};
|
|
109
|
+
} | undefined;
|
|
110
|
+
/** The agent's own context, when the harness exposes it. */
|
|
111
|
+
ctx?: {
|
|
112
|
+
inject?: (names: string[], install: (scope: CwdPromptScope) => void) => unknown;
|
|
113
|
+
get?: (name: string) => unknown;
|
|
114
|
+
} | undefined;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The harness's `working-directory` service, read structurally: only `get`
|
|
118
|
+
* is consumed, and its absence degrades to the session header's cwd.
|
|
119
|
+
*/
|
|
120
|
+
export interface WorkingDirectorySlice {
|
|
121
|
+
get?: (session: unknown) => string | undefined;
|
|
122
|
+
}
|
|
123
|
+
/** The cordis context slice this service consumes. */
|
|
124
|
+
export type CwdPromptContext = {
|
|
125
|
+
logger?: {
|
|
126
|
+
debug?: (message: string) => void;
|
|
127
|
+
};
|
|
128
|
+
agents?: {
|
|
129
|
+
list: () => CwdPromptAgent[];
|
|
130
|
+
};
|
|
131
|
+
on: ((event: "agent/created", listener: (payload: unknown) => unknown) => () => boolean) & ((event: "system-prompt/assemble", listener: AssembleListener) => () => boolean);
|
|
132
|
+
get?: (name: string) => unknown;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Rewrite every JSON-string-quoted WSL UNC path in one text to its POSIX form.
|
|
136
|
+
* The harness writes the cwd through `JSON.stringify`, so the backslashes are
|
|
137
|
+
* ESCAPED inside the quotes (`"\\\\wsl.localhost\\..."` as rendered text):
|
|
138
|
+
* match a JSON string, parse its inner content, and only rewrite when the raw
|
|
139
|
+
* value is a WSL UNC share. A path that parses to anything else (a drive
|
|
140
|
+
* path, another share, already-POSIX text) passes through unchanged, so the
|
|
141
|
+
* rewrite is safe to re-run.
|
|
142
|
+
*
|
|
143
|
+
* @param text - the contribution text.
|
|
144
|
+
* @returns the text with WSL UNC paths in distro coordinates.
|
|
145
|
+
*/
|
|
146
|
+
export declare function rewriteQuotedUnc(text: string): string;
|
|
147
|
+
/**
|
|
148
|
+
* The rewritten entry text for one assembly: ask the harness's service for the
|
|
149
|
+
* CURRENT directory (a mid-session `cd` must show), fall back to the session
|
|
150
|
+
* header's original cwd, and translate only WSL UNC spellings. Everything the
|
|
151
|
+
* regex cannot see passes through untouched, so a host session receives the
|
|
152
|
+
* shipped text byte for byte.
|
|
153
|
+
*
|
|
154
|
+
* @param agent - the agent the assembly runs inside.
|
|
155
|
+
* @param workingDirectory - the harness's service, when resolvable.
|
|
156
|
+
* @returns the entry text.
|
|
157
|
+
*/
|
|
158
|
+
export declare function entryText(agent: AssembleRequestContext["agent"], workingDirectory: WorkingDirectorySlice | undefined): string;
|
|
159
|
+
/**
|
|
160
|
+
* Mount the rewrite.
|
|
161
|
+
*
|
|
162
|
+
* @param ctx - the cordis context (the composition root, where the harness's
|
|
163
|
+
* own prompt services register).
|
|
164
|
+
* @param config - the schema-validated plugin config.
|
|
165
|
+
*/
|
|
166
|
+
export declare function apply(ctx: CwdPromptContext, config?: CwdPromptConfig): void;
|