dsh-wsl-workspace 0.1.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/LICENSE +21 -0
- package/NOTICE +68 -0
- package/README.md +30 -0
- package/README.zh.md +30 -0
- package/cordis.patch.yml +7 -0
- package/lib/client.js +982 -0
- package/lib/client.js.map +1 -0
- package/lib/fs.js +175 -0
- package/lib/fs.js.map +1 -0
- package/lib/index.js +493 -0
- package/lib/index.js.map +1 -0
- package/lib/paths-DBaSmi7x.js +105 -0
- package/lib/paths-DBaSmi7x.js.map +1 -0
- package/lib/shell.js +382 -0
- package/lib/shell.js.map +1 -0
- package/lib/wsl-GjkUifnx.js +179 -0
- package/lib/wsl-GjkUifnx.js.map +1 -0
- package/package.json +57 -0
- package/src/client/AddWslWorkspace.tsx +346 -0
- package/src/client/api.ts +104 -0
- package/src/client/index.ts +193 -0
- package/src/client/locales.ts +68 -0
- package/src/client/styles.ts +282 -0
- package/src/fs.ts +228 -0
- package/src/host/variants.ts +199 -0
- package/src/index.ts +410 -0
- package/src/shared/paths.ts +159 -0
- package/src/shared/wsl-credentials.ts +85 -0
- package/src/shared/wsl.ts +105 -0
- package/src/shell.ts +441 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","names":["listDistrosApi","listDirApi","checkApi","setWorkspaceUserApi"],"sources":["../src/client/api.ts","../src/shared/paths.ts","../src/client/AddWslWorkspace.tsx","../src/client/styles.ts","../src/client/locales.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Thin fetch client for the Host plugin route. The browser calls\n * POST /wsl-workspace/api with a `{ method, params }` envelope and the Host\n * answers `{ ok: true, value }` or `{ ok: false, error }`.\n */\n\n/** Relative route the Host half registers (same-origin with the web server). */\nconst ENDPOINT = '/wsl-workspace/api'\n\n/** One directory entry as the Host lists it. */\nexport interface WslDirEntry {\n name: string\n kind: 'directory' | 'file' | 'other'\n}\n\n/** One directory level plus its breadcrumb ancestry. */\nexport interface WslDirListing {\n /** The listed absolute Linux path. */\n path: string\n /** Parent Linux path, or null at the filesystem root. */\n parent: string | null\n /** The level's children (in name order; the client filters to directories). */\n entries: WslDirEntry[]\n}\n\n/** Existence/directory check result for one Linux path. */\nexport interface WslPathCheck {\n exists: boolean\n isDirectory: boolean\n}\n\n/** Wire envelope the Host route answers with. */\ntype Envelope<T> = { ok: true; value: T } | { ok: false; error: string }\n\n/** Human text for an unknown rejection, reusing the repository's idiom. */\nfunction errorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Perform one POST call and unwrap the envelope.\n * @param method - the Host method name.\n * @param params - the method payload.\n * @returns the unwrapped value, or throws an Error on network or `ok:false`.\n */\nasync function call<T>(method: string, params: Record<string, unknown> = {}): Promise<T> {\n let response: Response\n try {\n response = await fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ method, params }),\n })\n } catch (error) {\n // The transport refused before answering (offline, origin mismatch, 404).\n throw new Error(`wsl-workspace request failed: ${errorMessage(error)}`)\n }\n let envelope: Envelope<T>\n try {\n envelope = (await response.json()) as Envelope<T>\n } catch {\n // A non-JSON body means a proxy/loader answered instead of the Host route.\n throw new Error(`wsl-workspace answered non-JSON (${response.status})`)\n }\n if (!envelope.ok) throw new Error(envelope.error)\n return envelope.value\n}\n\n/**\n * List the WSL distros installed on the host.\n * @returns distro names in registry order.\n */\nexport async function listDistros(): Promise<string[]> {\n return call<string[]>('listDistros', {})\n}\n\n/**\n * List one directory level inside a distro.\n * @param distro - distro name.\n * @param path - absolute Linux directory to list.\n * @returns the level's listing with ancestry.\n */\nexport async function listDir(distro: string, path: string): Promise<WslDirListing> {\n return call<WslDirListing>('listDir', { distro, path })\n}\n\n/**\n * Check whether a Linux path exists and is a directory.\n * @param distro - distro name.\n * @param path - absolute Linux path.\n * @returns existence and directory facts.\n */\nexport async function check(distro: string, path: string): Promise<WslPathCheck> {\n return call<WslPathCheck>('check', { distro, path })\n}\n\n/**\n * Store (or clear, with an empty string) the username of one WSL workspace.\n * @param path - the workspace UNC path.\n * @param username - the Linux username; empty string clears the stored value.\n */\nexport async function setWorkspaceUser(path: string, username: string): Promise<void> {\n return call<void>('setUser', { path, username })\n}\n","/**\n * WSL path helpers shared by the client and host halves. Pure and\n * dependency-free so both planes can import them without a runtime edge.\n */\n\n/** WSL2 default loopback bridge host: `\\\\wsl.localhost\\<distro>\\...`. */\nconst WSL_LOCALHOST_HOST = 'wsl.localhost'\n/** Legacy WSL interop host: `\\\\wsl$\\<distro>\\...`. */\nconst WSL_LEGACY_HOST = 'wsl$'\n\n/** The two UNC hosts WSL exposes a distribution's filesystem under. */\nconst UNC_HOSTS = [WSL_LOCALHOST_HOST, WSL_LEGACY_HOST]\n\n/** One WSL workspace coordinate parsed out of a UNC path. */\nexport interface WslUncTarget {\n /** Distro name (e.g. `Ubuntu`) as `wsl -l -q` reports it. */\n readonly distro: string\n /** Normalized absolute Linux path (leading `/`; no trailing slash except root). */\n readonly linuxPath: string\n}\n\n/**\n * Parse a WSL UNC path into its distro and Linux path. Accepts the WSL2\n * `\\\\wsl.localhost\\<distro>\\<linux>` form, the legacy `\\\\wsl$\\<distro>\\<linux>`\n * interop form, and forward-slash spellings of either.\n * @param raw - candidate absolute path.\n * @returns the parsed target, or null when the path is not a WSL UNC.\n */\nexport function parseWslUnc(raw: string): WslUncTarget | null {\n const normalized = raw.replace(/\\\\/g, '/').replace(/\\/\\/+/g, '//')\n if (!normalized.startsWith('//')) return null\n const segments = normalized.slice(2).split('/')\n const host = (segments[0] ?? '').toLowerCase()\n if (!UNC_HOSTS.includes(host)) return null\n const distro = segments[1] ?? ''\n if (distro === '') return null\n const rest = segments.slice(2).filter(segment => segment.length > 0)\n return { distro, linuxPath: `/${rest.join('/')}` }\n}\n\n/**\n * Whether a path resolves into a WSL distro through either UNC form.\n * @param raw - candidate absolute path.\n * @returns whether the path parses as a WSL UNC.\n */\nexport function isWslUnc(raw: string): boolean {\n return parseWslUnc(raw) !== null\n}\n\n/**\n * Translate a WSL UNC path to the absolute Linux path a process inside the\n * distribution can open. Throws on non-WSL input: callers rely on this\n * conversion to hand paths to the Linux world, so a silent pass-through\n * would hand a Windows path to bash.\n * @param uncPath - a path {@link parseWslUnc} accepts.\n * @returns the absolute Linux path.\n */\nexport function uncToLinux(uncPath: string): string {\n const parts = parseWslUnc(uncPath)\n if (parts === null) {\n throw new Error(`wsl-workspace: \"${uncPath}\" is not a WSL UNC path`)\n }\n return parts.linuxPath\n}\n\n/**\n * Normalize a Linux absolute path for the Host: collapse repeated slashes and\n * strip a trailing slash (root becomes `/`).\n * @param path - absolute Linux path.\n * @returns the normalized path.\n */\nexport function normalizeLinuxPath(path: string): string {\n const collapsed = path.replace(/\\/+/g, '/')\n return collapsed === '/' ? '/' : collapsed.replace(/\\/$/, '')\n}\n\n/**\n * Whether a path is an absolute, non-empty Linux path.\n * @param path - candidate.\n * @returns whether it starts with `/` and contains no NUL.\n */\nexport function isAbsoluteLinuxPath(path: string): boolean {\n return path.startsWith('/') && !path.includes('\\0')\n}\n\n/**\n * Join a distro and a Linux absolute path into the WSL2 UNC form used as the\n * workspace identity (`\\\\wsl.localhost\\<distro>\\<linux>`, backslash segments).\n * @param distro - distro name.\n * @param linuxPath - absolute Linux path (leading `/`).\n * @returns the UNC path.\n */\nexport function joinUnc(distro: string, linuxPath: string): string {\n if (!isAbsoluteLinuxPath(linuxPath)) {\n throw new Error(`wsl-workspace: cannot map a non-absolute Linux path \"${linuxPath}\" to UNC`)\n }\n // Defense in depth: a distribution name with separators or dot-dirs would\n // escape the `\\\\wsl.localhost\\` share structure (the host route validates\n // wire-supplied names too; every other caller passes through here).\n if (distro === '' || distro === '.' || distro === '..' || /[\\\\/]/.test(distro)) {\n throw new Error(`wsl-workspace: invalid distribution name \"${distro}\"`)\n }\n const normalized = linuxPath.replace(/\\/+/g, '/').replace(/\\/$/, '')\n const withoutLeading = normalized.startsWith('/') ? normalized.slice(1) : normalized\n const windowsSegments = withoutLeading.replace(/\\//g, '\\\\')\n const suffix = windowsSegments === '' ? '' : `\\\\${windowsSegments}`\n return `\\\\\\\\wsl.localhost\\\\${distro}${suffix}`\n}\n\n/**\n * Translate a Windows drive path to the drvfs mount path WSL distributions\n * conventionally expose it at (`C:\\foo` → `/mnt/c/foo`). Only single-letter\n * drives under `/mnt` are mapped; custom mount points are out of scope.\n * @param path - the candidate Windows path.\n * @returns the `/mnt/<drive>/…` path, or `null` for non-drive paths.\n */\nexport function windowsToMntPath(path: string): string | null {\n const match = /^([A-Za-z]):[\\\\/](.*)$/.exec(path)\n if (match === null) return null\n const rest = (match[2] ?? '').replace(/\\\\/g, '/').replace(/\\/+/g, '/').replace(/\\/$/, '')\n return `/mnt/${(match[1] ?? '').toLowerCase()}${rest === '' ? '' : `/${rest}`}`\n}\n\n/**\n * Translate a `/mnt/<drive>/…` path back to its Windows drive path.\n * @param linuxPath - the candidate Linux path.\n * @returns the `X:\\…` drive path, or `null` when the path is not a drvfs mount.\n */\nexport function mntToWindowsPath(linuxPath: string): string | null {\n const match = /^\\/mnt\\/([a-zA-Z])(?:\\/(.*))?$/.exec(linuxPath)\n if (match === null) return null\n const rest = (match[2] ?? '').replace(/\\//g, '\\\\')\n return `${(match[1] ?? '').toUpperCase()}:\\\\${rest}`\n}\n\n/**\n * True when a value is a Windows-shaped path (drive or UNC), which is how\n * the shell executor decides the WSLENV `/p` translation flag: only Windows\n * path values need translation when they cross into the Linux process.\n * @param value - the environment value to classify.\n * @returns whether the value looks like a Windows path.\n */\nexport function isWindowsPathShaped(value: string): boolean {\n return /^[A-Za-z]:[\\\\/]/.test(value) || value.startsWith('\\\\\\\\')\n}\n\n/** Linux username shape for `wsl.exe -u`: starts with a letter or underscore, then letters/digits/`_`/`.`/`-` (max 64). */\nconst WSL_USERNAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_.-]{0,63}$/\n\n/**\n * Whether a value is a safe Linux username for `wsl.exe -u`. The check is\n * strict on purpose: a value starting with `-` could be parsed as a wsl.exe\n * option instead of a username.\n * @param value - candidate username.\n * @returns whether it matches the Linux username shape.\n */\nexport function isValidWslUsername(value: string): boolean {\n return WSL_USERNAME_PATTERN.test(value)\n}\n","/**\n * Sidebar footer action that opens the \"Add WSL workspace\" dialog. In the\n * wide sidebar it renders a labeled row; in the 56px rail it collapses to a\n * 36px icon button (both honor the shell's `{ wide }` owner share).\n *\n * Registration omits the typed `locale:` seat (the `wslWorkspace` namespace is\n * not merged into `LocaleNamespaceMap`), so the injected face carries the\n * bound translate function instead.\n */\n\nimport type * as React from 'react'\nimport { useEffect, useRef, useState, type UIEventHandler } from 'react'\nimport { isAbsoluteLinuxPath, isValidWslUsername, joinUnc, normalizeLinuxPath } from '../shared/paths.ts'\nimport type { WslDirListing, WslPathCheck } from './api.ts'\n\n/** Result-level shape of a browse/check/list call we surface uniformly. */\ninterface ApiCall<T> {\n value: T\n}\n\n/** The inject face: plain data + callbacks the dialog drives. */\nexport interface AddWslWorkspaceInjected {\n /**\n * Confirm the deployment exposes a healthy `wsl` preset.\n * @returns undefined when healthy, else a Chinese/English message to show.\n */\n checkPreset(): Promise<string | undefined>\n /** List the WSL distros installed on the host. */\n listDistros(): Promise<string[]>\n /** List one Linux directory level inside a distro. */\n listDir(distro: string, path: string): Promise<WslDirListing>\n /** Check a Linux path's existence/directory facts. */\n check(distro: string, path: string): Promise<WslPathCheck>\n /**\n * Register a workspace over a WSL UNC path and start a session in it.\n * @param path - the `\\\\wsl.localhost\\<distro>\\...` UNC path.\n * @param username - optional Linux user for the session (empty = distro default).\n * @returns undefined on success, else a message to show.\n */\n createWorkspace(path: string, username: string): Promise<string | undefined>\n /** Translate a `wslWorkspace` dictionary key. */\n t: (key: string, params?: Record<string, unknown>) => string\n}\n\n/** Full component props: the owner share plus the injected face. */\nexport interface AddWslWorkspaceProps extends AddWslWorkspaceInjected {\n /** Whether the sidebar renders wide content (false = 56px rail). */\n wide: boolean\n}\n\n/**\n * Build the Linux child path one level below a parent, for the breadcrumb/\n * browse drill.\n * @param parent - the currently listed absolute path (`/` for root).\n * @param name - the child directory name.\n * @returns the child's absolute Linux path.\n */\nexport function dirChildPath(parent: string, name: string): string {\n return parent === '/' ? `/${name}` : `${parent}/${name}`\n}\n\n/** A tiny inline terminal glyph for the dialog's directory rows. */\nfunction WslGlyph({ size = 16 }: { size?: number }): React.ReactElement {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"2.5\" y=\"4.5\" width=\"19\" height=\"15\" rx=\"2.5\" stroke=\"currentColor\" strokeWidth=\"1.6\" />\n <path d=\"M6 9l3.2 2.6L6 14\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n <path d=\"M12 14h5\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\n/**\n * The \"Add WSL workspace…\" footer action and its dialog.\n * @param props - owner share + injected face.\n */\nexport function AddWslWorkspace({ wide, t, checkPreset, listDistros, listDir, check, createWorkspace }: AddWslWorkspaceProps): React.ReactElement | null {\n const [open, setOpen] = useState(false)\n const [opening, setOpening] = useState(false)\n const [distros, setDistros] = useState<string[]>([])\n const [distro, setDistro] = useState('')\n const [pathInput, setPathInput] = useState('/home/')\n const [username, setUsername] = useState('')\n const [listing, setListing] = useState<WslDirListing | null>(null)\n const [browsePath, setBrowsePath] = useState('/')\n const [browsing, setBrowsing] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [busy, setBusy] = useState(false)\n // Monotone browse-request sequence: stale responses for a superseded browse are dropped.\n const browseSeq = useRef(0)\n\n const refreshBrowse = async (root: string, targetDistro: string): Promise<void> => {\n const seq = ++browseSeq.current\n setBrowsing(true)\n setBrowsePath(root)\n try {\n const value = await listDir(targetDistro, root)\n if (seq === browseSeq.current) setListing(value)\n } catch {\n // A failed browse (permission, missing dir) is non-fatal: keep old listing.\n if (seq === browseSeq.current) {\n setListing(null)\n setError((previous) => previous ?? t('error.loadDir'))\n }\n } finally {\n if (seq === browseSeq.current) setBrowsing(false)\n }\n }\n\n useEffect(() => {\n if (!open) return\n let cancelled = false\n setError(null)\n setOpening(true)\n void (async () => {\n let presetIssue: string | undefined\n try {\n presetIssue = await checkPreset()\n } catch {\n presetIssue = t('error.loadDistros')\n }\n let names: string[]\n try {\n names = await listDistros()\n } catch {\n if (cancelled) return\n setOpening(false)\n setError(t('error.loadDistros'))\n return\n }\n if (cancelled) return\n setDistros(names)\n const first = names[0] ?? ''\n setDistro(first)\n // The default browse root walks from `/`; the input defaults to `/home/`.\n setBrowsing(true)\n setOpening(false)\n if (presetIssue !== undefined) setError(presetIssue)\n if (first !== '') void refreshBrowse('/', first)\n })()\n return () => { cancelled = true }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- run once per open against current t.\n }, [open])\n\n useEffect(() => {\n if (!open) return\n const onKey = (event: KeyboardEvent): void => {\n if (event.key === 'Escape' && !busy) setOpen(false)\n }\n window.addEventListener('keydown', onKey)\n return () => window.removeEventListener('keydown', onKey)\n }, [open, busy])\n\n if (!open) {\n // A W-letter action beside Settings at the sidebar foot; the title\n // carries the label in both wide and rail states.\n return (\n <button\n type=\"button\"\n className={wide ? 'dww-action dww-action--wide' : 'dww-action dww-action--rail'}\n title={t('action.title')}\n aria-label={t('action.title')}\n onClick={() => setOpen(true)}\n >\n <span className=\"dww-letter\" aria-hidden=\"true\">W</span>\n </button>\n )\n }\n\n const onDrill = (name: string): void => {\n const next = dirChildPath(listing?.path ?? browsePath, name)\n setPathInput(next)\n void refreshBrowse(next, distro)\n }\n\n const onUp = (): void => {\n const parent = listing?.parent ?? null\n if (parent === null) return\n setPathInput(parent)\n void refreshBrowse(parent, distro)\n }\n\n const onDistroChange = (value: string): void => {\n setDistro(value)\n void refreshBrowse(browsePath, value)\n }\n\n const onCheck = async (): Promise<void> => {\n const path = normalizeLinuxPath(pathInput)\n setError(null)\n if (!isAbsoluteLinuxPath(path) || path === '/') {\n setError(t('error.invalidPath'))\n return\n }\n let facts: WslPathCheck\n try {\n facts = await check(distro, path)\n } catch {\n setError(t('error.pathNotFound'))\n return\n }\n if (!facts.exists || !facts.isDirectory) {\n setError(t('error.pathNotFound'))\n return\n }\n void refreshBrowse(path, distro)\n }\n\n const onConfirm = async (): Promise<void> => {\n const path = normalizeLinuxPath(pathInput)\n setError(null)\n if (!isAbsoluteLinuxPath(path) || path === '/') {\n // A workspace at the distribution root would make every session start\n // at `/`; the check flow rejects it and confirm must agree.\n setError(t('error.invalidPath'))\n return\n }\n const user = username.trim()\n if (user !== '' && !isValidWslUsername(user)) {\n setError(t('error.invalidUsername'))\n return\n }\n setBusy(true)\n try {\n let facts: WslPathCheck\n try {\n facts = await check(distro, path)\n } catch {\n setError(t('error.pathNotFound'))\n return\n }\n if (!facts.exists || !facts.isDirectory) {\n setError(t('error.pathNotFound'))\n return\n }\n const failure = await createWorkspace(joinUnc(distro, path), user)\n if (failure !== undefined) {\n setError(failure)\n return\n }\n setOpen(false)\n } finally {\n setBusy(false)\n }\n }\n\n const children = (listing?.entries.filter(entry => entry.kind === 'directory') ?? []).map(entry => entry.name)\n const maskClick = (): void => { if (!busy) setOpen(false) }\n const listScroll: UIEventHandler<HTMLDivElement> = () => { /* scroll container handles overflow */ }\n\n return (\n <div className=\"dww-overlay\">\n <div className=\"dww-overlay-mask\" onClick={maskClick} />\n <div className=\"dww-card\" role=\"dialog\" aria-modal=\"true\" aria-label={t('dialog.title')}>\n <div className=\"dww-header\">\n <h2 className=\"dww-title\">{t('dialog.title')}</h2>\n <button type=\"button\" className=\"dww-close\" aria-label={t('dialog.cancel')} onClick={maskClick}>\n ✕\n </button>\n </div>\n <div className=\"dww-body\">\n {error !== null ? (\n <div className=\"dww-error\">\n {error}\n <button type=\"button\" className=\"dww-retry\" onClick={() => setError(null)}>{t('dialog.retry')}</button>\n </div>\n ) : null}\n <div className=\"dww-field\">\n <label className=\"dww-field-label\" htmlFor=\"dww-distro\">{t('dialog.distro')}</label>\n <select\n id=\"dww-distro\"\n className=\"dww-select\"\n value={distro}\n disabled={opening || busy}\n onChange={event => onDistroChange(event.target.value)}\n >\n {distros.length === 0\n ? <option value=\"\">{opening ? t('dialog.loading') : ''}</option>\n : distros.map(name => <option key={name} value={name}>{name}</option>)}\n </select>\n </div>\n <div className=\"dww-field\">\n <label className=\"dww-field-label\" htmlFor=\"dww-path\">{t('dialog.path')}</label>\n <div className=\"dww-input-row\">\n <input\n id=\"dww-path\"\n className=\"dww-input\"\n value={pathInput}\n placeholder={t('dialog.pathPlaceholder')}\n disabled={opening || busy}\n onChange={event => setPathInput(event.target.value)}\n />\n <button type=\"button\" className=\"dww-check-btn\" disabled={opening || busy} onClick={() => void onCheck()}>\n {t('dialog.check')}\n </button>\n </div>\n </div>\n <div className=\"dww-field\">\n <label className=\"dww-field-label\" htmlFor=\"dww-username\">{t('dialog.username')}</label>\n <input\n id=\"dww-username\"\n className=\"dww-input\"\n value={username}\n placeholder={t('dialog.usernamePlaceholder')}\n disabled={opening || busy}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={event => setUsername(event.target.value)}\n />\n </div>\n <div className=\"dww-feedback\">\n <div className=\"dww-breadcrumb\">{browsePath}</div>\n <div className=\"dww-dirlist\" onScroll={listScroll}>\n {browsing ? <div className=\"dww-dir-empty\">{t('dialog.loading')}</div> : (\n listing?.parent !== null && listing !== null\n ? (\n <button type=\"button\" className=\"dww-dir-row dww-dir-row--up\" onClick={onUp}>\n <WslGlyph size={14} />\n <span>{t('dialog.upLevel')}</span>\n </button>\n )\n : null\n )}\n {!browsing && (children.length === 0)\n ? <div className=\"dww-dir-empty\">{t('dialog.browseEmpty')}</div>\n : children.map(name => (\n <button type=\"button\" key={name} className=\"dww-dir-row\" onClick={() => onDrill(name)}>\n <WslGlyph size={14} />\n <span>{name}</span>\n </button>\n ))}\n </div>\n </div>\n </div>\n <div className=\"dww-actions\">\n <button type=\"button\" className=\"dww-btn\" disabled={busy} onClick={maskClick}>{t('dialog.cancel')}</button>\n <button type=\"button\" className=\"dww-btn dww-btn--primary\" disabled={busy || opening} onClick={() => void onConfirm()}>\n {busy ? t('dialog.loading') : t('dialog.confirm')}\n </button>\n </div>\n </div>\n </div>\n )\n}\n\nexport type { ApiCall }\n","/**\n * Third-party stylesheet injection for the WSL workspace UI (the plugin\n * builds no CSS bundle, so styles are injected as one idempotent `<style>`).\n * Colors derive exclusively from the `--dsw-*` design tokens.\n */\n\nconst STYLE_TAG_DATA_ATTRIBUTE = 'data-plugin=\"dsh-wsl-workspace\"'\n\nconst STYLES = `\n/* Sidebar-foot icon action beside Settings (28px round in the wide sidebar,\n 36px round in the rail), matching the shell's icon-button language. */\n.dww-action {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: 50%;\n padding: 0;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-secondary);\n transition:\n background-color 120ms var(--dsw-ease-in-out, ease-in-out),\n color 120ms var(--dsw-ease-in-out, ease-in-out);\n}\n.dww-action:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n}\n.dww-action:active:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-pressed, var(--dsw-alias-interactive-bg-hover));\n}\n.dww-action:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 1px;\n}\n.dww-action:disabled { cursor: default; opacity: 0.6; }\n.dww-action--rail {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n.dww-action svg { flex: none; }\n\n/* The W letter mark of the sidebar action (sized for wide/rail buttons). */\n.dww-letter {\n font-size: 14px;\n font-weight: 600;\n line-height: 1;\n letter-spacing: 0.02em;\n user-select: none;\n}\n.dww-action--rail .dww-letter { font-size: 17px; }\n\n/* Full-viewport overlay + centered card (mirrors the platform Mask/Dialog). */\n.dww-overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.dww-overlay-mask {\n position: absolute;\n inset: 0;\n background: var(--dsw-alias-bg-mask-1);\n backdrop-filter: var(--dsw-mask-blur);\n}\n.dww-card {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: min(440px, 100%);\n max-height: min(640px, 90vh);\n padding: 0 0 20px;\n overflow: hidden;\n border: 1px solid var(--dsw-alias-border-inverted);\n border-radius: 16px;\n background: var(--dsw-alias-bg-layer-2);\n box-shadow: var(--dsw-shadow-lv3);\n font-family: var(--dsw-font-family);\n}\n.dww-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 18px 20px 12px;\n}\n.dww-title {\n margin: 0;\n font-size: 16px;\n line-height: 24px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n.dww-close {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 0;\n border-radius: 8px;\n background: transparent;\n cursor: pointer;\n color: var(--dsw-alias-label-secondary);\n}\n.dww-close:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dww-body {\n display: flex;\n flex-direction: column;\n gap: 14px;\n min-width: 0;\n padding: 0 20px;\n overflow: auto;\n}\n.dww-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }\n.dww-field-label {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n}\n.dww-select {\n box-sizing: border-box;\n width: 100%;\n height: 36px;\n padding: 0 10px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n color: var(--dsw-alias-label-primary);\n font-size: 14px;\n}\n.dww-input-row { display: flex; gap: 8px; align-items: center; }\n.dww-input {\n box-sizing: border-box;\n flex: 1;\n height: 36px;\n min-width: 0;\n padding: 0 10px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n color: var(--dsw-alias-label-primary);\n font-size: 14px;\n}\n.dww-input:focus, .dww-select:focus {\n outline: none;\n border-color: var(--dsw-alias-state-business-primary);\n}\n.dww-check-btn {\n flex: none;\n height: 36px;\n padding: 0 12px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font-size: 12px;\n}\n.dww-check-btn:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.dww-check-btn:disabled { cursor: default; }\n\n/* Directory browse list. */\n.dww-dirlist {\n display: flex;\n flex-direction: column;\n gap: 2px;\n box-sizing: border-box;\n min-height: 120px;\n max-height: 200px;\n padding: 4px;\n overflow: auto;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n}\n.dww-breadcrumb {\n padding: 0 4px;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.dww-dir-row {\n display: flex;\n align-items: center;\n gap: 8px;\n height: 28px;\n padding: 0 8px;\n border: 0;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font-size: 13px;\n text-align: left;\n}\n.dww-dir-row:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.dww-dir-row:disabled { cursor: default; color: var(--dsw-alias-label-tertiary); }\n.dww-dir-row--up { color: var(--dsw-alias-label-secondary); }\n.dww-dir-row svg { flex: none; color: var(--dsw-alias-label-tertiary); }\n.dww-dir-empty {\n padding: 8px;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* Error strip. */\n.dww-error {\n box-sizing: border-box;\n width: 100%;\n padding: 8px 10px;\n border: 1px solid var(--dsw-alias-state-error-primary);\n border-radius: 8px;\n color: var(--dsw-alias-state-error-primary);\n font-size: 12px;\n line-height: 18px;\n}\n.dww-retry {\n margin-left: 6px;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-state-business-primary);\n cursor: pointer;\n font-size: 12px;\n text-decoration: underline;\n}\n\n/* Dialog footer actions. */\n.dww-actions {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 14px 20px 0;\n}\n.dww-btn {\n height: 36px;\n padding: 0 14px;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n font-size: 14px;\n}\n.dww-btn:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.dww-btn--primary {\n border-color: transparent;\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n.dww-btn--primary:hover:not(:disabled) { background: var(--dsw-alias-button-primary-hover); }\n.dww-btn:disabled { cursor: default; opacity: 0.6; }\n`\n\n/**\n * Idempotently inject the plugin stylesheet. No-op when a tag with the\n * plugin's data attribute already exists.\n */\nexport function ensureStyles(): void {\n if (typeof document === 'undefined') return\n if (document.querySelector(`style[${STYLE_TAG_DATA_ATTRIBUTE}]`) !== null) return\n const style = document.createElement('style')\n style.setAttribute('data-plugin', 'dsh-wsl-workspace')\n style.textContent = STYLES\n document.head.appendChild(style)\n}\n","/**\n * Bilingual dictionaries for the `wslWorkspace` locale namespace. Product copy\n * is Chinese; English is the parallel export for the standalone bundle.\n */\n\n/**\n * The `wslWorkspace` translations (Chinese, the primary product copy).\n */\nexport const zh: Record<string, string> = {\n 'action.add': 'WSL 工作区',\n 'action.title': '添加 WSL 工作区…',\n\n 'dialog.title': '添加 WSL 工作区',\n 'dialog.distro': '发行版',\n 'dialog.path': '路径',\n 'dialog.pathPlaceholder': '/home/',\n 'dialog.username': '用户名',\n 'dialog.usernamePlaceholder': '留空则使用发行版默认用户',\n 'dialog.loading': '正在加载…',\n 'dialog.browseEmpty': '此目录没有子文件夹',\n 'dialog.upLevel': '..(返回上级)',\n 'dialog.browse': '浏览',\n 'dialog.check': '检查',\n 'dialog.confirm': '创建并打开',\n 'dialog.cancel': '取消',\n 'dialog.retry': '重试',\n\n 'error.loadDistros': '无法获取 WSL 发行版列表,请确认已安装 WSL 且插件宿主端可用',\n 'error.rateLimited': '操作过于频繁,请稍后重试',\n 'error.loadDir': '无法浏览该目录',\n 'error.presetMissing': '未找到健康的 wsl preset,请确认插件宿主端已安装并配置该 preset',\n 'error.invalidPath': '请输入以 / 开头的 Linux 绝对路径',\n 'error.invalidUsername': '用户名无效:需以字母或下划线开头,仅含字母、数字、_、.、-',\n 'error.pathNotFound': '该路径不存在或是文件,请选择一个文件夹',\n 'error.createFailed': '创建工作区失败',\n}\n\n/**\n * The `wslWorkspace` translations (English).\n */\nexport const en: Record<string, string> = {\n 'action.add': 'WSL Workspace',\n 'action.title': 'Add WSL workspace…',\n\n 'dialog.title': 'Add WSL workspace',\n 'dialog.distro': 'Distro',\n 'dialog.path': 'Path',\n 'dialog.pathPlaceholder': '/home/',\n 'dialog.username': 'Username',\n 'dialog.usernamePlaceholder': 'Leave empty to use the distro default user',\n 'dialog.loading': 'Loading…',\n 'dialog.browseEmpty': 'No subdirectories here',\n 'dialog.upLevel': '.. (up)',\n 'dialog.browse': 'Browse',\n 'dialog.check': 'Check',\n 'dialog.confirm': 'Create & open',\n 'dialog.cancel': 'Cancel',\n 'dialog.retry': 'Retry',\n\n 'error.loadDistros': 'Could not list WSL distros; confirm WSL is installed and the plugin host side is reachable',\n 'error.rateLimited': 'Too many attempts; retry in a moment',\n 'error.loadDir': 'Could not browse this directory',\n 'error.presetMissing': 'No healthy \"wsl\" preset found; confirm the plugin host side installed and configured it',\n 'error.invalidPath': 'Enter an absolute Linux path starting with /',\n 'error.invalidUsername': 'Invalid username: start with a letter or underscore; only letters, digits, _ . -',\n 'error.pathNotFound': 'The path does not exist or is a file; choose a folder',\n 'error.createFailed': 'Failed to create the workspace',\n}\n","/**\n * Browser half of dsh-wsl-workspace. Registers the \"Add WSL workspace…\"\n * action beside Settings at the sidebar foot (the official\n * `sidebar.footer.action` slot), and keeps every blank session whose\n * workspace is a WSL UNC path composed from the WSL VARIANT of the mode it\n * currently runs (`standard` → `wsl-standard`, PTC → `wsl-code`, …) — so the\n * WSL execution world composes with any mode instead of being a mode itself.\n *\n * The binding is a watching effect rather than a one-shot dialog action so\n * EVERY creation path (this dialog, the workspace row's New Session, the\n * hero picker) converges on the WSL-backed composition automatically.\n */\n\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale), the\n// runtime's ClientContext, and the ui-sidebar SlotMap merge (the\n// 'sidebar.footer.action' entry) into this program.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport { check as checkApi, listDir as listDirApi, listDistros as listDistrosApi, setWorkspaceUser as setWorkspaceUserApi } from './api.ts'\nimport { AddWslWorkspace, type AddWslWorkspaceInjected } from './AddWslWorkspace.tsx'\nimport { ensureStyles } from './styles.ts'\nimport { zh, en } from './locales.ts'\nimport { isWslUnc } from '../shared/paths.ts'\n\n/** Required services (cordis fiber inject). */\nexport const inject = ['slots', 'locale', 'connection', 'sessions', 'workspaces']\n\n/** The legacy standalone WSL preset id (folded into the mode variants). */\nconst LEGACY_WSL_PRESET_ID = 'wsl'\n\n/**\n * Minimal sessions-service face. The renderer-host ctx merge types\n * `ctx.sessions` as its own SessionStore; the service the runtime actually\n * registers under that key satisfies this narrower contract, so the cast is\n * the documented boundary for a third-party plugin.\n */\ninterface WslSessionsFace {\n list: {\n getSnapshot(): { ids: string[]; byId: Record<string, { blank: boolean; cwd?: string; agentPreset?: string }> }\n subscribe(fn: () => void): () => void\n }\n noteAgentPreset(sessionId: string, agentPreset: string): void\n}\n\n/** Minimal workspaces-service face (create + start-session only). */\ninterface WslWorkspacesFace {\n create(input: { path: string }): Promise<{ workspaceId: string }>\n startSession(workspaceId?: string): void\n}\n\n/**\n * Mount the sidebar action and the auto-binding effect.\n * @param ctx - the browser plugin context.\n */\nexport function apply(ctx: ClientContext): void {\n const { api } = ctx.get('connection') as ConnectionHandle\n const workspaces = ctx.get('workspaces') as unknown as WslWorkspacesFace\n const sessions = ctx.get('sessions') as unknown as WslSessionsFace\n\n ensureStyles()\n\n ctx.effect(\n () => ctx.locale.register('wslWorkspace' as never, { zh, en }),\n 'dsh-wsl-workspace: locale dictionaries',\n )\n\n // The injected translate function reads the live locale preference.\n const t = ctx.locale.bind('wslWorkspace' as never) as unknown as (key: string, params?: Record<string, unknown>) => string\n\n const injected = (): AddWslWorkspaceInjected => ({\n t,\n checkPreset: async (): Promise<string | undefined> => {\n let roster\n try {\n const response = await api.agentPresets.list({})\n roster = response.result\n } catch (error) {\n return error instanceof Error ? error.message : String(error)\n }\n if (!roster.ok) return roster.error.message\n const healthy = roster.value.presets.find((entry: { id: string; broken?: string }) =>\n entry.id.startsWith('wsl-') && entry.broken === undefined)\n if (healthy === undefined) return t('error.presetMissing')\n return undefined\n },\n listDistros: () => listDistrosApi(),\n listDir: (distro, path) => listDirApi(distro, path),\n check: (distro, path) => checkApi(distro, path),\n createWorkspace: async (path, username): Promise<string | undefined> => {\n try {\n const view = await workspaces.create({ path })\n await setWorkspaceUserApi(path, username)\n workspaces.startSession(view.workspaceId)\n return undefined\n } catch (error) {\n return error instanceof Error ? error.message : String(error)\n }\n },\n })\n\n ctx.effect(\n () => ctx.slots.inject(\n 'sidebar.footer.action',\n () => ctx.slots.register(\n { name: 'sidebar.footer.action', id: 'wsl-workspace', inject: injected },\n AddWslWorkspace,\n ),\n ),\n 'dsh-wsl-workspace: sidebar footer action',\n )\n\n // Mode-variant binding: a blank session whose workspace is a WSL UNC path\n // is recomposed to the WSL variant of the mode it currently runs — plain\n // 标准 becomes `wsl-standard`, PTC becomes `wsl-code`, and so on — so the\n // WSL execution world composes with ANY mode instead of replacing it. The\n // host refuses non-blank sessions (agent-preset-locked), so the swap is\n // attempted at most a few times per session.\n ctx.effect(() => {\n const inFlight = new Set<string>()\n const attempts = new Map<string, number>()\n const MAX_ATTEMPTS = 3\n // Healthy `wsl-<mode>` variant ids plus the roster's default preset id\n // (what a session with no explicit choice gets). Refreshed periodically\n // so variants generated after this page loaded are picked up.\n let variants = new Set<string>()\n let defaultPreset: string | undefined\n const refreshRoster = (): void => {\n void api.agentPresets.list({}).then((response: {\n result: { ok: boolean; value: { presets: { id: string; broken?: string; isDefault?: boolean }[] } }\n }) => {\n const result = response.result\n if (!result.ok) return\n variants = new Set(result.value.presets\n .filter((entry: { id: string; broken?: string }) =>\n entry.broken === undefined && entry.id.startsWith('wsl-'))\n .map((entry: { id: string }) => entry.id))\n defaultPreset = result.value.presets.find(\n (entry: { id: string; isDefault?: boolean }) => entry.isDefault === true,\n )?.id\n }).catch(() => {\n // A failed roster read leaves the previous mapping; sessions stay on\n // their current composition until the next refresh.\n })\n }\n refreshRoster()\n const maybeBind = (): void => {\n const state = sessions.list.getSnapshot()\n for (const id of state.ids) {\n const summary = state.byId[id]\n if (summary === undefined || !summary.blank || summary.cwd === undefined) continue\n if (!isWslUnc(summary.cwd)) continue\n const current = summary.agentPreset\n if (current !== undefined && current.startsWith('wsl-')) continue\n // Legacy standalone `wsl` (now folded into the variants): remap it to\n // the default mode's variant, since the standalone preset no longer\n // exists in the roster.\n const base = current === LEGACY_WSL_PRESET_ID\n ? (defaultPreset ?? 'standard')\n : (current ?? defaultPreset)\n if (base === undefined || base === LEGACY_WSL_PRESET_ID || base.startsWith('wsl-')) continue\n const target = `wsl-${base.toLowerCase()}`\n if (!variants.has(target)) continue\n if (inFlight.has(id) || (attempts.get(id) ?? 0) >= MAX_ATTEMPTS) continue\n inFlight.add(id)\n void api.agentPresets.select({ sessionId: id, agentPreset: target })\n .then((response: { result: { ok: boolean } }) => {\n if (response.result.ok) sessions.noteAgentPreset(id, target)\n })\n .catch(() => {\n // A refused or aborted swap (session already produced output,\n // roster churn, reconnect) leaves the session on its current\n // composition; count the attempt so a stuck session stops\n // retrying after MAX_ATTEMPTS.\n attempts.set(id, (attempts.get(id) ?? 0) + 1)\n })\n .finally(() => {\n inFlight.delete(id)\n })\n }\n }\n maybeBind()\n const unsubscribe = sessions.list.subscribe(() => maybeBind())\n // Variants are generated at host boot; a page loaded before that would\n // never see them without a periodic refresh.\n const timer = window.setInterval(refreshRoster, 60_000)\n return () => {\n unsubscribe()\n window.clearInterval(timer)\n }\n }, 'dsh-wsl-workspace: WSL mode-variant binding')\n}\n"],"mappings":";;;;;;;;;;;;;;;EAOA,MAAM,WAAW;;EA4BjB,SAAS,aAAa,OAAwB;GAC5C,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC9D;;;;;;;EAQA,eAAe,KAAQ,QAAgB,SAAkC,CAAC,GAAe;GACvF,IAAI;GACJ,IAAI;IACF,WAAW,MAAM,MAAM,UAAU;KAC/B,QAAQ;KACR,SAAS,EAAE,gBAAgB,mBAAmB;KAC9C,MAAM,KAAK,UAAU;MAAE;MAAQ;KAAO,CAAC;IACzC,CAAC;GACH,SAAS,OAAO;IAEd,MAAM,IAAI,MAAM,iCAAiC,aAAa,KAAK,GAAG;GACxE;GACA,IAAI;GACJ,IAAI;IACF,WAAY,MAAM,SAAS,KAAK;GAClC,QAAQ;IAEN,MAAM,IAAI,MAAM,oCAAoC,SAAS,OAAO,EAAE;GACxE;GACA,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,SAAS,KAAK;GAChD,OAAO,SAAS;EAClB;;;;;EAMA,eAAsB,cAAiC;GACrD,OAAO,KAAe,eAAe,CAAC,CAAC;EACzC;;;;;;;EAQA,eAAsB,QAAQ,QAAgB,MAAsC;GAClF,OAAO,KAAoB,WAAW;IAAE;IAAQ;GAAK,CAAC;EACxD;;;;;;;EAQA,eAAsB,MAAM,QAAgB,MAAqC;GAC/E,OAAO,KAAmB,SAAS;IAA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Aa,SAAS,wBAAwB,KAAK,WAAW,MAAM,GAAG;MACpF,MAAM,SAAS,OAAO,KAAK,YAAY;MACvC,IAAI,CAAC,SAAS,IAAI,MAAM,GAAG;MAC3B,IAAI,SAAS,IAAI,EAAE,MAAM,SAAS,IAAI,EAAE,KAAK,MAAM,cAAc;MACjE,SAAS,IAAI,EAAE;MACf,IAAS,aAAa,OAAO;OAAE,WAAW;OAAI,aAAa;MAAO,CAAC,CAAC,CACjE,MAAM,aAA0C;OAC/C,IAAI,SAAS,OAAO,IAAI,SAAS,gBAAgB,IAAI,MAAM;MAC7D,CAAC,CAAC,CACD,YAAY;OAKX,SAAS,IAAI,KAAK,SAAS,IAAI,EAAE,KAAK,KAAK,CAAC;MAC9C,CAAC,CAAC,CACD,cAAc;OACb,SAAS,OAAO,EAAE;MACpB,CAAC;KACL;IACF;IACA,UAAU;IACV,MAAM,cAAc,SAAS,KAAK,gBAAgB,UAAU,CAAC;IAG7D,MAAM,QAAQ,OAAO,YAAY,eAAe,GAAM;IACtD,aAAa;KACX,YAAY;KACZ,OAAO,cAAc,KAAK;IAC5B;GACF,GAAG,6CAA6C;EAClD"}
|
package/lib/fs.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { a as mntToWindowsPath, c as windowsToMntPath, i as joinUnc, s as parseWslUnc, t as isAbsoluteLinuxPath } from "./paths-DBaSmi7x.js";
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
import { link, lstat, rename } from "node:fs/promises";
|
|
4
|
+
import { FsError } from "@deepseek-ai/dsh-fs";
|
|
5
|
+
import { LocalFileSystem } from "@deepseek-ai/dsh-fs-local";
|
|
6
|
+
//#region src/fs.ts
|
|
7
|
+
/**
|
|
8
|
+
* The WSL filesystem backend. Identity keys are canonical UNC paths; the
|
|
9
|
+
* Linux form is derived on demand, so both worlds stay in sync across
|
|
10
|
+
* aliases and symlinks.
|
|
11
|
+
*/
|
|
12
|
+
var WslFileSystem = class WslFileSystem extends LocalFileSystem {
|
|
13
|
+
static Config = z.object({
|
|
14
|
+
cwd: z.string(),
|
|
15
|
+
distro: z.string(),
|
|
16
|
+
diffBasisMaxBytes: z.number().default(10 * 1024 * 1024)
|
|
17
|
+
});
|
|
18
|
+
distro;
|
|
19
|
+
constructor(ctx, config) {
|
|
20
|
+
super(ctx, config);
|
|
21
|
+
this.distro = config.distro;
|
|
22
|
+
this.internals = {
|
|
23
|
+
linkFile: WslFileSystem.publishNoReplace,
|
|
24
|
+
replaceFile: WslFileSystem.replaceOverWrite,
|
|
25
|
+
copyFileDacl: WslFileSystem.skipDaclCopy
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* No-replace publication for filesystems without hard links. A real
|
|
30
|
+
* collision (a concurrent external creator won) must still surface as the
|
|
31
|
+
* original EEXIST so the guarded-create failure path classifies it; an
|
|
32
|
+
* absent target falls back to rename, which on Windows publishes without
|
|
33
|
+
* replacing anything. Safe against this backend's own writers because the
|
|
34
|
+
* per-target lock serializes them.
|
|
35
|
+
* @param tempPath - the staged file.
|
|
36
|
+
* @param destPath - the destination to create.
|
|
37
|
+
*/
|
|
38
|
+
static async publishNoReplace(tempPath, destPath) {
|
|
39
|
+
try {
|
|
40
|
+
await link(tempPath, destPath);
|
|
41
|
+
return;
|
|
42
|
+
} catch (error) {
|
|
43
|
+
let exists = false;
|
|
44
|
+
try {
|
|
45
|
+
await lstat(destPath);
|
|
46
|
+
exists = true;
|
|
47
|
+
} catch {}
|
|
48
|
+
if (exists) throw error;
|
|
49
|
+
await rename(tempPath, destPath);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Security-preserving replacement boundary: Windows rename replaces an
|
|
54
|
+
* existing destination atomically; no DACL preservation is needed over 9P.
|
|
55
|
+
* @param destPath - the file being replaced.
|
|
56
|
+
* @param tempPath - the staged replacement.
|
|
57
|
+
*/
|
|
58
|
+
static async replaceOverWrite(destPath, tempPath) {
|
|
59
|
+
await rename(tempPath, destPath);
|
|
60
|
+
}
|
|
61
|
+
/** 9P files inherit their directory's DACL; nothing to preserve. */
|
|
62
|
+
static async skipDaclCopy() {}
|
|
63
|
+
/** Translate a model/plugin path into Windows-side coordinates. */
|
|
64
|
+
translate(path, cwd) {
|
|
65
|
+
const unc = parseWslUnc(path);
|
|
66
|
+
if (unc !== null) return {
|
|
67
|
+
input: joinUnc(unc.distro, unc.linuxPath),
|
|
68
|
+
cwd: this.cwdOr(cwd)
|
|
69
|
+
};
|
|
70
|
+
if (isAbsoluteLinuxPath(path)) {
|
|
71
|
+
const win = mntToWindowsPath(path);
|
|
72
|
+
if (win !== null) return {
|
|
73
|
+
input: win,
|
|
74
|
+
cwd: this.cwdOr(cwd)
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
input: joinUnc(this.distroFor(cwd), path),
|
|
78
|
+
cwd: this.cwdOr(cwd)
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (windowsToMntPath(path) !== null) return {
|
|
82
|
+
input: path,
|
|
83
|
+
cwd: this.cwdOr(cwd)
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
input: path,
|
|
87
|
+
cwd: this.uncCwd(cwd)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** A base for absolute inputs (unused by resolution, but the parent needs one). */
|
|
91
|
+
cwdOr(cwd) {
|
|
92
|
+
return cwd ?? this.config.cwd ?? process.cwd();
|
|
93
|
+
}
|
|
94
|
+
uncCwd(cwd) {
|
|
95
|
+
const base = cwd ?? this.config.cwd;
|
|
96
|
+
if (base === void 0 || base === "") throw new FsError("wsl-fs: no cwd and no configured base for relative resolution", "FS_IO_ERROR");
|
|
97
|
+
const unc = parseWslUnc(base);
|
|
98
|
+
if (unc !== null) return joinUnc(unc.distro, unc.linuxPath);
|
|
99
|
+
if (isAbsoluteLinuxPath(base)) return joinUnc(this.distroFor(base), base);
|
|
100
|
+
if (windowsToMntPath(base) !== null) return base;
|
|
101
|
+
throw new FsError(`wsl-fs: cwd "${base}" is not in the WSL execution world`, "FS_IO_ERROR");
|
|
102
|
+
}
|
|
103
|
+
distroFor(cwd) {
|
|
104
|
+
const fromCwd = parseWslUnc(cwd ?? "");
|
|
105
|
+
if (fromCwd !== null) return fromCwd.distro;
|
|
106
|
+
const distro = this.distro;
|
|
107
|
+
if (distro === void 0 || distro === "") throw new FsError("wsl-fs: Linux path carries no distribution and none is configured", "FS_IO_ERROR");
|
|
108
|
+
return distro;
|
|
109
|
+
}
|
|
110
|
+
/** The Linux display path for a resolved Windows-side path. */
|
|
111
|
+
linuxDisplay(raw) {
|
|
112
|
+
const unc = parseWslUnc(raw);
|
|
113
|
+
if (unc !== null) return unc.linuxPath;
|
|
114
|
+
const mnt = windowsToMntPath(raw);
|
|
115
|
+
if (mnt !== null) return mnt;
|
|
116
|
+
throw new FsError(`wsl-fs: resolved path "${raw}" is outside the WSL execution world`, "FS_IO_ERROR");
|
|
117
|
+
}
|
|
118
|
+
async resolve(path, opts) {
|
|
119
|
+
if (opts?.signal?.aborted) throw new FsError("resolve aborted", "FS_ABORTED");
|
|
120
|
+
const { input, cwd } = this.translate(path, opts?.cwd);
|
|
121
|
+
const local = await super.resolve(input, {
|
|
122
|
+
cwd,
|
|
123
|
+
...opts?.signal !== void 0 ? { signal: opts.signal } : {}
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
targetKey: local.targetKey,
|
|
127
|
+
displayPath: this.linuxDisplay(String(local.displayPath))
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
processPath(target) {
|
|
131
|
+
const key = String(target.targetKey);
|
|
132
|
+
const unc = parseWslUnc(key);
|
|
133
|
+
if (unc !== null) return unc.linuxPath;
|
|
134
|
+
const mnt = windowsToMntPath(key);
|
|
135
|
+
if (mnt !== null) return mnt;
|
|
136
|
+
throw new FsError(`wsl-fs: target "${target.displayPath}" is outside the WSL execution world`, "FS_IO_ERROR");
|
|
137
|
+
}
|
|
138
|
+
fileUrl(target) {
|
|
139
|
+
return `file://${this.processPath(target).split("/").map(encodeURIComponent).join("/")}`;
|
|
140
|
+
}
|
|
141
|
+
contains(parent, child) {
|
|
142
|
+
const parentWorld = this.worldPath(parent);
|
|
143
|
+
const childWorld = this.worldPath(child);
|
|
144
|
+
if (parentWorld.distro !== childWorld.distro) return false;
|
|
145
|
+
const parentPath = parentWorld.linuxPath;
|
|
146
|
+
const childPath = childWorld.linuxPath;
|
|
147
|
+
if (childPath === parentPath) return true;
|
|
148
|
+
return parentPath === "/" ? true : childPath.startsWith(`${parentPath}/`);
|
|
149
|
+
}
|
|
150
|
+
/** One target's (distro, linuxPath) pair for containment; `undefined` distro = Windows world. */
|
|
151
|
+
worldPath(target) {
|
|
152
|
+
const key = String(target.targetKey);
|
|
153
|
+
const unc = parseWslUnc(key);
|
|
154
|
+
if (unc !== null) return {
|
|
155
|
+
distro: unc.distro,
|
|
156
|
+
linuxPath: unc.linuxPath
|
|
157
|
+
};
|
|
158
|
+
const mnt = windowsToMntPath(key);
|
|
159
|
+
if (mnt !== null) return {
|
|
160
|
+
distro: void 0,
|
|
161
|
+
linuxPath: mnt
|
|
162
|
+
};
|
|
163
|
+
throw new FsError(`wsl-fs: target "${target.displayPath}" is outside the WSL execution world`, "FS_IO_ERROR");
|
|
164
|
+
}
|
|
165
|
+
async lstat(path, opts, signal) {
|
|
166
|
+
if (signal?.aborted) throw new FsError("lstat aborted", "FS_ABORTED");
|
|
167
|
+
if (path.trim().length === 0) throw new FsError("file_path must be a non-empty string", "FS_NOT_FOUND");
|
|
168
|
+
const { input, cwd } = this.translate(path, opts?.cwd);
|
|
169
|
+
return super.lstat(input, { cwd }, signal);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { WslFileSystem, WslFileSystem as default };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=fs.js.map
|
package/lib/fs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","names":[],"sources":["../src/fs.ts"],"sourcesContent":["/**\n * WSL Service Provider for the `ctx.fs` capability seam. Backed by the host\n * filesystem over the `\\\\wsl.localhost\\<distro>\\…` 9P share — zero install\n * inside the distribution — while every model/UI-facing path is the Linux\n * path a WSL process would open (`processPath`, `displayPath`, `fileUrl`).\n * Reuses `LocalFileSystem`'s mechanics (realpath identity, atomic writes,\n * per-target locks, version guards) unchanged, because those operate on the\n * UNC path Node can open directly.\n *\n * Both UNC paths and Linux absolute paths resolve; Windows drive paths\n * resolve through their `/mnt/<drive>` form, so a WSL-composed session can\n * still touch the Windows filesystem coherently.\n * @module dsh-wsl-workspace/fs\n */\n\nimport { Context } from '@deepseek-ai/cordis'\nimport z from '@deepseek-ai/schemastery'\nimport { link, lstat, rename } from 'node:fs/promises'\nimport { FsError } from '@deepseek-ai/dsh-fs'\nimport type { FsPathInfo, FsTarget } from '@deepseek-ai/dsh-fs'\nimport { LocalFileSystem } from '@deepseek-ai/dsh-fs-local'\nimport {\n isAbsoluteLinuxPath,\n joinUnc,\n mntToWindowsPath,\n parseWslUnc,\n windowsToMntPath,\n} from './shared/paths.ts'\n\n/** Plugin config. `cwd`/`distro` are optional because UNC workdirs carry both. */\nexport interface Config {\n /** Base directory for relative paths without a per-call cwd (UNC or Linux). */\n cwd?: string\n /** Default distribution for Linux-absolute paths without a UNC cwd. */\n distro?: string\n /** Exclusive UTF-8 byte limit on each overwrite-diff side (see fs-local). */\n diffBasisMaxBytes?: number\n}\n\n/** One translated coordinate: the input the local backend opens plus its cwd. */\ninterface Translated {\n /** Absolute path to hand to the local backend (UNC or Windows drive). */\n input: string\n /** Absolute Windows-side base for relative inputs (UNC or Windows drive). */\n cwd: string\n}\n\n/**\n * The WSL filesystem backend. Identity keys are canonical UNC paths; the\n * Linux form is derived on demand, so both worlds stay in sync across\n * aliases and symlinks.\n */\nexport class WslFileSystem extends LocalFileSystem {\n static override Config: z<Config> = z.object({\n cwd: z.string(),\n distro: z.string(),\n diffBasisMaxBytes: z.number().default(10 * 1024 * 1024),\n })\n\n private readonly distro: string | undefined\n\n constructor(ctx: Context, config: Config) {\n // schemastery fills the defaults before construction; the parent validates\n // `diffBasisMaxBytes` and stores the resolved shape.\n super(ctx, config)\n this.distro = config.distro\n // The 9P/drvfs substrate has no hard links and no Win32 security semantics:\n // replace the atomic-publication boundaries the parent's fsio defaults to.\n this.internals = {\n linkFile: WslFileSystem.publishNoReplace,\n replaceFile: WslFileSystem.replaceOverWrite,\n copyFileDacl: WslFileSystem.skipDaclCopy,\n }\n }\n\n /**\n * No-replace publication for filesystems without hard links. A real\n * collision (a concurrent external creator won) must still surface as the\n * original EEXIST so the guarded-create failure path classifies it; an\n * absent target falls back to rename, which on Windows publishes without\n * replacing anything. Safe against this backend's own writers because the\n * per-target lock serializes them.\n * @param tempPath - the staged file.\n * @param destPath - the destination to create.\n */\n private static async publishNoReplace(tempPath: string, destPath: string): Promise<void> {\n try {\n await link(tempPath, destPath)\n return\n } catch (error) {\n let exists = false\n try {\n await lstat(destPath)\n exists = true\n } catch {\n // Absent destination: rename publishes the staged file.\n }\n if (exists) throw error\n await rename(tempPath, destPath)\n }\n }\n\n /**\n * Security-preserving replacement boundary: Windows rename replaces an\n * existing destination atomically; no DACL preservation is needed over 9P.\n * @param destPath - the file being replaced.\n * @param tempPath - the staged replacement.\n */\n private static async replaceOverWrite(destPath: string, tempPath: string): Promise<void> {\n await rename(tempPath, destPath)\n }\n\n /** 9P files inherit their directory's DACL; nothing to preserve. */\n private static async skipDaclCopy(): Promise<void> {}\n\n /** Translate a model/plugin path into Windows-side coordinates. */\n private translate(path: string, cwd?: string): Translated {\n const unc = parseWslUnc(path)\n if (unc !== null) {\n return { input: joinUnc(unc.distro, unc.linuxPath), cwd: this.cwdOr(cwd) }\n }\n if (isAbsoluteLinuxPath(path)) {\n // /mnt/<drive>/… names the Windows filesystem inside the Linux world\n // (the dual-access path for migration): open the drive path directly so\n // both worlds stay coherent — the display stays the /mnt form.\n const win = mntToWindowsPath(path)\n if (win !== null) return { input: win, cwd: this.cwdOr(cwd) }\n return { input: joinUnc(this.distroFor(cwd), path), cwd: this.cwdOr(cwd) }\n }\n if (windowsToMntPath(path) !== null) {\n // Windows drive paths open directly; the Linux world reaches them via /mnt.\n return { input: path, cwd: this.cwdOr(cwd) }\n }\n // Relative: resolve against the caller cwd (or the configured base).\n const base = this.uncCwd(cwd)\n return { input: path, cwd: base }\n }\n\n /** A base for absolute inputs (unused by resolution, but the parent needs one). */\n private cwdOr(cwd?: string): string {\n return cwd ?? this.config.cwd ?? process.cwd()\n }\n\n private uncCwd(cwd?: string): string {\n const base = cwd ?? this.config.cwd\n if (base === undefined || base === '') {\n throw new FsError('wsl-fs: no cwd and no configured base for relative resolution', 'FS_IO_ERROR')\n }\n const unc = parseWslUnc(base)\n if (unc !== null) return joinUnc(unc.distro, unc.linuxPath)\n if (isAbsoluteLinuxPath(base)) return joinUnc(this.distroFor(base), base)\n if (windowsToMntPath(base) !== null) return base\n throw new FsError(`wsl-fs: cwd \"${base}\" is not in the WSL execution world`, 'FS_IO_ERROR')\n }\n\n private distroFor(cwd?: string): string {\n const fromCwd = parseWslUnc(cwd ?? '')\n if (fromCwd !== null) return fromCwd.distro\n const distro = this.distro\n if (distro === undefined || distro === '') {\n throw new FsError('wsl-fs: Linux path carries no distribution and none is configured', 'FS_IO_ERROR')\n }\n return distro\n }\n\n /** The Linux display path for a resolved Windows-side path. */\n private linuxDisplay(raw: string): string {\n const unc = parseWslUnc(raw)\n if (unc !== null) return unc.linuxPath\n const mnt = windowsToMntPath(raw)\n if (mnt !== null) return mnt\n throw new FsError(`wsl-fs: resolved path \"${raw}\" is outside the WSL execution world`, 'FS_IO_ERROR')\n }\n\n override async resolve(path: string, opts?: { cwd?: string; signal?: AbortSignal }): Promise<FsTarget> {\n if (opts?.signal?.aborted) throw new FsError('resolve aborted', 'FS_ABORTED')\n const { input, cwd } = this.translate(path, opts?.cwd)\n const local = await super.resolve(input, {\n cwd,\n ...opts?.signal !== undefined ? { signal: opts.signal } : {},\n })\n return { targetKey: local.targetKey, displayPath: this.linuxDisplay(String(local.displayPath)) }\n }\n\n override processPath(target: FsTarget): string {\n const key = String(target.targetKey)\n const unc = parseWslUnc(key)\n if (unc !== null) return unc.linuxPath\n const mnt = windowsToMntPath(key)\n if (mnt !== null) return mnt\n throw new FsError(`wsl-fs: target \"${target.displayPath}\" is outside the WSL execution world`, 'FS_IO_ERROR')\n }\n\n override fileUrl(target: FsTarget): string {\n const linux = this.processPath(target)\n const encoded = linux.split('/').map(encodeURIComponent).join('/')\n return `file://${encoded}`\n }\n\n override contains(parent: FsTarget, child: FsTarget): boolean {\n const parentWorld = this.worldPath(parent)\n const childWorld = this.worldPath(child)\n if (parentWorld.distro !== childWorld.distro) return false\n const parentPath = parentWorld.linuxPath\n const childPath = childWorld.linuxPath\n if (childPath === parentPath) return true\n return parentPath === '/' ? true : childPath.startsWith(`${parentPath}/`)\n }\n\n /** One target's (distro, linuxPath) pair for containment; `undefined` distro = Windows world. */\n private worldPath(target: FsTarget): { distro: string | undefined; linuxPath: string } {\n const key = String(target.targetKey)\n const unc = parseWslUnc(key)\n if (unc !== null) return { distro: unc.distro, linuxPath: unc.linuxPath }\n const mnt = windowsToMntPath(key)\n if (mnt !== null) return { distro: undefined, linuxPath: mnt }\n throw new FsError(`wsl-fs: target \"${target.displayPath}\" is outside the WSL execution world`, 'FS_IO_ERROR')\n }\n\n override async lstat(path: string, opts?: { cwd?: string }, signal?: AbortSignal): Promise<FsPathInfo | undefined> {\n if (signal?.aborted) throw new FsError('lstat aborted', 'FS_ABORTED')\n if (path.trim().length === 0) throw new FsError('file_path must be a non-empty string', 'FS_NOT_FOUND')\n const { input, cwd } = this.translate(path, opts?.cwd)\n return super.lstat(input, { cwd }, signal)\n }\n}\n\nexport default WslFileSystem\n"],"mappings":";;;;;;;;;;;AAoDA,IAAa,gBAAb,MAAa,sBAAsB,gBAAgB;CACjD,OAAgB,SAAoB,EAA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