@deepseek-ai/dsh-experimental-webworker-runtime 0.1.6-alpha.1 → 0.1.6-alpha.2
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/README.i18n.yaml +2 -2
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/lib/client.js +1 -38
- package/lib/index.js +4 -0
- package/lib/types/client/apply-injections.d.ts +2 -14
- package/lib/types/node/external_packages/execa.d.ts +3 -0
- package/lib/types/node/external_packages/libreoffice-kit.d.ts +6 -0
- package/lib/worker.js +21 -0
- package/package.json +21 -20
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/experimental/webworker-runtime/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 6a6911824c8c71b3deb5037d1ecf629771211a26
|
|
6
|
+
README.zh.md: c0ef4275507725bc6f1178ab2568c4fb6127479a
|
package/README.md
CHANGED
|
@@ -53,7 +53,9 @@ None; this package neither assembles nor sends a provider request.
|
|
|
53
53
|
|
|
54
54
|
- **The worker composition writes plaintext session logs** (`compression: 'none'` boot patch): it carries no Zstandard codec, so exported logs are `.jsonl`, never `.jsonl.zstd`.
|
|
55
55
|
- **`node:dns/promises`, `node:vm`, `node:net`, `node:sqlite`, `node:worker_threads` are structural stubs**: every call reports its refusal on the console and throws. Rows needing native DNS, a real process, or realm isolation cannot run here.
|
|
56
|
+
- **Host package commands are unavailable**: `execa` reports an explicit worker-host refusal; the preview cannot run pnpm or install native dependencies.
|
|
56
57
|
- **PTC Node programs are unavailable**: the process shim exposes `/dsh/bin/node` as its executable identity so the provider can activate, but the Worker has neither a Node executable nor `stripTypeScriptTypes`. Program execution fails before launching a child.
|
|
58
|
+
- **Office conversion requires a Node Host**: the LibreOffice kit replacement rejects converter creation with `unavailable`. The browser image excludes the kit and its engine dependencies; the Office preview reports that conversion is unavailable.
|
|
57
59
|
- **Filesystem watchers observe only the mounted VFS**: image seeding is silent and the VFS has no symlinks or external writers. `persistent`, `ref()`, and `unref()` preserve the Node API but cannot control a dedicated Worker's lifetime because browsers expose no ref-counted event loop.
|
|
58
60
|
- **Worker confinement is a VFS boundary, not kernel Landlock**: `read-only` and `workspace-write` run the unchanged `@deepseek-ai/node-addon-system/landlock-run` JavaScript and launcher argv, but the process layer implements the logical `landlock-run` executable and enforces its grants on every shell filesystem request. `full` therefore covers the Worker command table and mounted VFS only; it does not claim arbitrary native-process execution or Linux kernel isolation.
|
|
59
61
|
- **The worker bundle pins a path inside `@yarnpkg/parsers`** — the build resolves the package's own `lib/shell.js` instead of its root, whose barrel also re-exports the Syml parser and so drags js-yaml into a bundle that never parses that format (around 175 kB, plus its module body at worker start). The path is derived from the package manifest, so a layout change fails the build rather than reinstating the barrel; upgrading the dependency means re-checking that the shell parser still lives there.
|
package/README.zh.md
CHANGED
|
@@ -53,7 +53,9 @@ kind: "package-library"
|
|
|
53
53
|
|
|
54
54
|
- **worker 组合写明文会话日志**(`compression: 'none'` boot patch):不带 Zstandard 编解码器,导出日志是 `.jsonl`,不会是 `.jsonl.zstd`。
|
|
55
55
|
- **`node:dns/promises`、`node:vm`、`node:net`、`node:sqlite`、`node:worker_threads` 是结构化 stub**:每次调用在 console 报告拒绝并抛出。需要原生 DNS、真进程或真 realm 隔离的行在此无法运行。
|
|
56
|
+
- **宿主包管理命令不可用**:`execa` 明确报告 worker host 不支持该调用;预览无法运行 pnpm 或安装原生依赖。
|
|
56
57
|
- **PTC Node 程序不可用**:process shim 用 `/dsh/bin/node` 表示可执行文件身份,使 provider 能够激活,但 Worker 既没有 Node 可执行文件,也没有 `stripTypeScriptTypes`。程序执行会在启动子进程前失败。
|
|
58
|
+
- **Office 转换需要 Node Host**:LibreOffice kit 的替代模块以 `unavailable` 拒绝创建转换器。浏览器镜像排除 kit 及其引擎依赖;Office 预览提示转换不可用。
|
|
57
59
|
- **文件 watcher 只能观察已挂载的 VFS**:镜像 seed 不产生事件,VFS 也没有符号链接或外部写入方。`persistent`、`ref()` 和 `unref()` 保留 Node API,但浏览器没有引用计数事件循环,因此这些接口不能控制 dedicated Worker 的生存期。
|
|
58
60
|
- **Worker confinement 是 VFS 边界,不是内核 Landlock**:`read-only` 和 `workspace-write` 运行未经修改的 `@deepseek-ai/node-addon-system/landlock-run` JavaScript 与 launcher argv,进程层则实现逻辑 `landlock-run` 可执行文件,并在 shell 的每次文件系统请求上执行其授权。`full` 仅覆盖 Worker 命令表和已挂载 VFS,不表示能够执行任意 native 进程,也不表示 Linux 内核隔离。
|
|
59
61
|
- **worker 束钉住了 `@yarnpkg/parsers` 的包内路径**——构建解析到该包自己的 `lib/shell.js` 而非包根,因为包根 barrel 还 re-export 了 Syml 解析器,会把 js-yaml 拖进一个从不解析该格式的束(约 175 kB,外加 worker 启动时的模块体求值)。该路径由包 manifest 派生,包内布局一变即构建期失败、不会静默退回 barrel;升级这个依赖时须复核 shell 解析器是否仍在那里。
|
package/lib/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { applyIndexInjections } from "@deepseek-ai/dsh-client-web/injections";
|
|
1
2
|
//#region src/image-layout.ts
|
|
2
3
|
/**
|
|
3
4
|
* Leaf name of the packed base image: one gzip member holding the ustar archive.
|
|
@@ -481,44 +482,6 @@ var WorkerTunnel = class {
|
|
|
481
482
|
}
|
|
482
483
|
};
|
|
483
484
|
//#endregion
|
|
484
|
-
//#region src/client/apply-injections.ts
|
|
485
|
-
function assertNever(row) {
|
|
486
|
-
throw new Error(`webworker-runtime: unknown index injection row ${JSON.stringify(row)}`);
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Execute every row in table order.
|
|
490
|
-
* @param rows - Injection table from the boot payload.
|
|
491
|
-
* @param loadScript - Executes one script-src row; the tunnel's `loadBundle`,
|
|
492
|
-
* because the row URLs (`/plugins/...`) resolve only through the worker.
|
|
493
|
-
*/
|
|
494
|
-
async function applyIndexInjections(rows, loadScript) {
|
|
495
|
-
for (const row of rows) switch (row.kind) {
|
|
496
|
-
case "global":
|
|
497
|
-
globalThis[row.name] = row.value;
|
|
498
|
-
break;
|
|
499
|
-
case "script": {
|
|
500
|
-
const el = document.createElement("script");
|
|
501
|
-
el.textContent = row.text;
|
|
502
|
-
(row.placement === "head" ? document.head : document.body).append(el);
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
case "script-src":
|
|
506
|
-
await loadScript(row.src);
|
|
507
|
-
break;
|
|
508
|
-
case "script-preload": break;
|
|
509
|
-
case "style": {
|
|
510
|
-
const el = document.createElement("style");
|
|
511
|
-
el.textContent = row.text;
|
|
512
|
-
document.head.append(el);
|
|
513
|
-
break;
|
|
514
|
-
}
|
|
515
|
-
case "html":
|
|
516
|
-
(row.placement === "head" ? document.head : document.body).insertAdjacentHTML("beforeend", row.html);
|
|
517
|
-
break;
|
|
518
|
-
default: assertNever(row);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
//#endregion
|
|
522
485
|
//#region src/client/source-chooser.ts
|
|
523
486
|
/** Pre-boot filesystem-source chooser for static WebWorker previews. */
|
|
524
487
|
const EMPTY_SOURCE = "none";
|
package/lib/index.js
CHANGED
|
@@ -728,10 +728,12 @@ const MODULE_PROXIES = {
|
|
|
728
728
|
"node:vm": "./node/builtin_modules/mock/vm.ts",
|
|
729
729
|
"node:worker_threads": "./node/builtin_modules/mock/worker_threads.ts",
|
|
730
730
|
"node:sqlite": "./node/builtin_modules/mock/sqlite.ts",
|
|
731
|
+
"@deepseek-ai/libreoffice-kit": "./node/external_packages/libreoffice-kit.ts",
|
|
731
732
|
"@deepseek-ai/node-addon-system/flock": "./node/external_packages/node-addon-system-flock.ts",
|
|
732
733
|
"koffi": "./node/external_packages/koffi.ts",
|
|
733
734
|
"sharp": "./node/external_packages/sharp.ts",
|
|
734
735
|
"node-pty": "./node/external_packages/node-pty.ts",
|
|
736
|
+
"execa": "./node/external_packages/execa.ts",
|
|
735
737
|
"@vscode/ripgrep": "./node/external_packages/ripgrep.ts",
|
|
736
738
|
"@earendil-works/pi-ai": "./node/external_packages/pi-ai.ts",
|
|
737
739
|
"ws": "./node/external_packages/ws.ts"
|
|
@@ -750,9 +752,11 @@ const MODULE_PROXY_PREFIXES = { "@earendil-works/pi-ai/": "./node/external_packa
|
|
|
750
752
|
const REPLACED_EXTERNAL_PACKAGES = [
|
|
751
753
|
"@earendil-works/pi-ai",
|
|
752
754
|
"@vscode/ripgrep",
|
|
755
|
+
"@deepseek-ai/libreoffice-kit",
|
|
753
756
|
"@deepseek-ai/node-addon-system/flock",
|
|
754
757
|
"koffi",
|
|
755
758
|
"node-pty",
|
|
759
|
+
"execa",
|
|
756
760
|
"sharp",
|
|
757
761
|
"ws"
|
|
758
762
|
];
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* form renders the same rows into index.html text; a static worker page has
|
|
4
|
-
* no served HTML, so it executes the table directly. Rows execute strictly in
|
|
5
|
-
* table order, so a global row lands before the scripts that read it.
|
|
6
|
-
*/
|
|
7
|
-
import type { IndexInjection } from '@deepseek-ai/dsh-host-webserver';
|
|
8
|
-
/**
|
|
9
|
-
* Execute every row in table order.
|
|
10
|
-
* @param rows - Injection table from the boot payload.
|
|
11
|
-
* @param loadScript - Executes one script-src row; the tunnel's `loadBundle`,
|
|
12
|
-
* because the row URLs (`/plugins/...`) resolve only through the worker.
|
|
13
|
-
*/
|
|
14
|
-
export declare function applyIndexInjections(rows: readonly IndexInjection[], loadScript: (src: string) => Promise<void>): Promise<void>;
|
|
1
|
+
/** Shared page-side interpreter for asynchronous Host startup. */
|
|
2
|
+
export { applyIndexInjections } from '@deepseek-ai/dsh-client-web/injections';
|
|
15
3
|
//# sourceMappingURL=apply-injections.d.ts.map
|
package/lib/worker.js
CHANGED
|
@@ -21402,6 +21402,17 @@ const koffi = {
|
|
|
21402
21402
|
call: notImplementedFail(MODULE$3, "call")
|
|
21403
21403
|
};
|
|
21404
21404
|
//#endregion
|
|
21405
|
+
//#region src/node/external_packages/libreoffice-kit.ts
|
|
21406
|
+
/** Office conversion requires a Node Host; the browser preview carries no engine assets. */
|
|
21407
|
+
var libreoffice_kit_exports = /* @__PURE__ */ __exportAll({ createConverter: () => createConverter });
|
|
21408
|
+
/**
|
|
21409
|
+
* Refuse converter creation with the kit's unavailable error code.
|
|
21410
|
+
* @returns A rejected promise consumed by the Host office-to-pdf provider.
|
|
21411
|
+
*/
|
|
21412
|
+
function createConverter() {
|
|
21413
|
+
return Promise.reject(Object.assign(notAvailableError("@deepseek-ai/libreoffice-kit", "createConverter"), { code: "unavailable" }));
|
|
21414
|
+
}
|
|
21415
|
+
//#endregion
|
|
21405
21416
|
//#region src/node/external_packages/node-pty.ts
|
|
21406
21417
|
/**
|
|
21407
21418
|
* `node-pty` stub: pseudo-terminals belong to the excluded surface. Terminal
|
|
@@ -21424,6 +21435,12 @@ var node_pty_default = {
|
|
|
21424
21435
|
open
|
|
21425
21436
|
};
|
|
21426
21437
|
//#endregion
|
|
21438
|
+
//#region src/node/external_packages/execa.ts
|
|
21439
|
+
/** Host package commands cannot install dependencies in the browser preview. */
|
|
21440
|
+
var execa_exports = /* @__PURE__ */ __exportAll({ execa: () => execa });
|
|
21441
|
+
/** Refuse external package commands in the worker host. */
|
|
21442
|
+
const execa = notImplementedFail("execa", "execa");
|
|
21443
|
+
//#endregion
|
|
21427
21444
|
//#region src/node/external_packages/pi-ai.ts
|
|
21428
21445
|
/**
|
|
21429
21446
|
* `@earendil-works/pi-ai` stub, including its `/providers/all` and `/api/*.lazy`
|
|
@@ -21648,9 +21665,11 @@ const Server = WebSocketServer;
|
|
|
21648
21665
|
const REPLACED_EXTERNAL_PACKAGES = [
|
|
21649
21666
|
"@earendil-works/pi-ai",
|
|
21650
21667
|
"@vscode/ripgrep",
|
|
21668
|
+
"@deepseek-ai/libreoffice-kit",
|
|
21651
21669
|
"@deepseek-ai/node-addon-system/flock",
|
|
21652
21670
|
"koffi",
|
|
21653
21671
|
"node-pty",
|
|
21672
|
+
"execa",
|
|
21654
21673
|
"sharp",
|
|
21655
21674
|
"ws"
|
|
21656
21675
|
];
|
|
@@ -21709,10 +21728,12 @@ const BUILTINS = {
|
|
|
21709
21728
|
};
|
|
21710
21729
|
/** Exact package or subpath specifiers served by worker stubs and fakes. */
|
|
21711
21730
|
const EXTERNALS = {
|
|
21731
|
+
"@deepseek-ai/libreoffice-kit": () => libreoffice_kit_exports,
|
|
21712
21732
|
"@deepseek-ai/node-addon-system/flock": () => node_addon_system_flock_exports,
|
|
21713
21733
|
"koffi": () => koffi_exports,
|
|
21714
21734
|
"sharp": () => sharp_exports,
|
|
21715
21735
|
"node-pty": () => node_pty_exports,
|
|
21736
|
+
"execa": () => execa_exports,
|
|
21716
21737
|
"ws": () => ws_exports,
|
|
21717
21738
|
"@vscode/ripgrep": () => ripgrep_exports,
|
|
21718
21739
|
"@earendil-works/pi-ai": () => pi_ai_exports
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-experimental-webworker-runtime",
|
|
3
3
|
"description": "Browser-only harness runtime: in-memory VFS, module transform and loader, postMessage tunnel, and the dedicated Web Worker assembly, with the Node-compatibility layer that lets the host tree run unchanged",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,14 +34,15 @@
|
|
|
34
34
|
"buffer": "^6.0.3",
|
|
35
35
|
"picomatch": "^4.0.4",
|
|
36
36
|
"readable-stream": "^4.7.0",
|
|
37
|
-
"@deepseek-ai/dsh-
|
|
37
|
+
"@deepseek-ai/dsh-client-web": "^0.1.6-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-util-crypto": "^0.1.6-alpha.2"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
40
42
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
41
|
-
"@deepseek-ai/dsh-client-
|
|
42
|
-
"@deepseek-ai/dsh-client-
|
|
43
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.
|
|
44
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
43
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-client-modules": "^0.1.6-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.2"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/picomatch": "^3.0.2",
|
|
@@ -49,20 +50,20 @@
|
|
|
49
50
|
"chokidar": "^5.0.0",
|
|
50
51
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
51
52
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-client-file-upload": "^0.1.6-alpha.
|
|
56
|
-
"@deepseek-ai/dsh-client-modules": "^0.1.6-alpha.
|
|
57
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.
|
|
58
|
-
"@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-session
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.
|
|
63
|
-
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.
|
|
64
|
-
"@deepseek-ai/
|
|
65
|
-
"@deepseek-ai/
|
|
53
|
+
"@deepseek-ai/dsh-api-gateway": "^0.1.6-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-bash-sandbox": "^0.1.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-client-file-upload": "^0.1.6-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-modules": "^0.1.6-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.6-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
|
|
65
|
+
"@deepseek-ai/node-addon-system": "^0.1.2",
|
|
66
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.2"
|
|
66
67
|
},
|
|
67
68
|
"files": [
|
|
68
69
|
"lib/index.js",
|