Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|---|---|---|---|
| DeepSeek Harness(`@deepseek-ai/dsh` 及子包) | Agent Runtime | MIT | 以 npm 包形式随运行环境分发 |
| Cordis(`@deepseek-ai/cordis`) | 插件框架 | MIT | npm 包 |
| Node.js 24.19.0 | JavaScript Runtime | MIT(详见 Node 发行版 LICENSE) | 运行环境内置 |
| Node.js 24.22.2 | JavaScript Runtime | MIT(详见 Node 发行版 LICENSE) | 运行环境内置 |
| npm / pnpm | 包管理器 | Artistic-2.0(npm)/ MIT(pnpm) | 随 Node 分发 |
| Debian GNU/Linux rootfs | Linux 用户空间 | 各包按 Debian 版权文件分别授权 | debootstrap 构建;各包许可证见 rootfs 内 `/usr/share/doc/*/copyright` |
| PRoot(`libproot.so` / `libproot-loader.so` / `libandroid-shmem.so`) | 用户态沙箱(chroot 替代) | GPL-2+(以源码 COPYING 为准) | 二进制来自 termux-packages 构建;源码见下方链接 |
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
<string name="settings_import_running_msg">جارٍ نسخ وتثبيت الحزمة المختارة (حزمة بيئة التشغيل الرسمية حوالي 200 ميغابايت، خصص بضع دقائق). لا تغادر هذه الصفحة أو أغلق التطبيق.</string>
<string name="settings_import_running_title">جارٍ الاستيراد…</string>
<string name="settings_import_runtime_confirm_action">استيراد</string>
<string name="settings_import_runtime_confirm_msg">اختر حزمة بيئة تشغيل (.zip أو .tar.gz / .tar.zst).\n\nتحتوي على بيئة التشغيل نفسها:\n• base (نظام Debian الجذري المختزل)\n• node (Node 24.19.0)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(لا يتضمن DSH؛ طبقة DSH لن تُستبدل.)\n\nيُعيِّن الاستيراد و يستبدل بيئة التشغيل الافتراضية (base/node/android-side) وقد يُسبب فقدان البيانات داخل الصندوق الرملي؛ لا تتأثر طبقة DSH (runtime-current/dsh) و user-data/.dsh. هل تريد المتابعة؟</string>
<string name="settings_import_runtime_confirm_msg">اختر حزمة بيئة تشغيل (.zip أو .tar.gz / .tar.zst).\n\nتحتوي على بيئة التشغيل نفسها:\n• base (نظام Debian الجذري المختزل)\n• node (Node 24.22.2)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(لا يتضمن DSH؛ طبقة DSH لن تُستبدل.)\n\nيُعيِّن الاستيراد و يستبدل بيئة التشغيل الافتراضية (base/node/android-side) وقد يُسبب فقدان البيانات داخل الصندوق الرملي؛ لا تتأثر طبقة DSH (runtime-current/dsh) و user-data/.dsh. هل تريد المتابعة؟</string>
<string name="settings_import_runtime_confirm_title">استيراد حزمة بيئة التشغيل</string>
<string name="settings_import_update">استيراد حزمة بيئة التشغيل (غير متصل)</string>
<string name="settings_language">اللغة</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
<string name="settings_import_running_msg">Copiando e instalando el paquete seleccionado (el paquete oficial del entorno de ejecución tiene aproximadamente 200 MB, permite unos minutos). No salgas de esta página ni cierres la aplicación.</string>
<string name="settings_import_running_title">Importando…</string>
<string name="settings_import_runtime_confirm_action">Importar</string>
<string name="settings_import_runtime_confirm_msg">Selecciona un paquete del entorno de ejecución (.zip o .tar.gz / .tar.zst).\n\nContiene el entorno de ejecución en sí:\n• base (sistema de archivos raíz de Debian recortado)\n• node (Node 24.19.0)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH NO está incluido; la capa de DSH no se reemplaza.)\n\nLa importación restablece y reemplaza el entorno de ejecución virtual del sistema (base/node/android-side) y puede causar pérdida de datos dentro del entorno aislado; la capa de DSH (runtime-current/dsh) y user-data/.dsh no se ven afectados. ¿Continuar?</string>
<string name="settings_import_runtime_confirm_msg">Selecciona un paquete del entorno de ejecución (.zip o .tar.gz / .tar.zst).\n\nContiene el entorno de ejecución en sí:\n• base (sistema de archivos raíz de Debian recortado)\n• node (Node 24.22.2)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH NO está incluido; la capa de DSH no se reemplaza.)\n\nLa importación restablece y reemplaza el entorno de ejecución virtual del sistema (base/node/android-side) y puede causar pérdida de datos dentro del entorno aislado; la capa de DSH (runtime-current/dsh) y user-data/.dsh no se ven afectados. ¿Continuar?</string>
<string name="settings_import_runtime_confirm_title">Importar paquete del entorno de ejecución</string>
<string name="settings_import_update">Importar paquete del entorno de ejecución (sin conexión)</string>
<string name="settings_language">Idioma</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
<string name="settings_import_running_msg">Copie et installation du paquet sélectionné (le paquet officiel de l\'environnement d\'exécution fait environ 200 Mo, prévoyez quelques minutes). Ne quittez pas cette page et ne fermez pas l\'application.</string>
<string name="settings_import_running_title">Importation en cours…</string>
<string name="settings_import_runtime_confirm_action">Importer</string>
<string name="settings_import_runtime_confirm_msg">Sélectionnez un paquet d\'environnement d\'exécution (.zip ou .tar.gz / .tar.zst).\n\nIl contient l\'environnement d\'exécution lui-même :\n• base (racine Debian allégée)\n• node (Node 24.19.0)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH n\'est PAS inclus ; la couche DSH n\'est pas remplacée.)\n\nL\'importation réinitialise et remplace l\'environnement d\'exécution virtuel (base/node/android-side) et peut entraîner des pertes de données dans le bac à sable ; la couche DSH (runtime-current/dsh) et user-data/.dsh ne sont pas affectés. Continuer ?</string>
<string name="settings_import_runtime_confirm_msg">Sélectionnez un paquet d\'environnement d\'exécution (.zip ou .tar.gz / .tar.zst).\n\nIl contient l\'environnement d\'exécution lui-même :\n• base (racine Debian allégée)\n• node (Node 24.22.2)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH n\'est PAS inclus ; la couche DSH n\'est pas remplacée.)\n\nL\'importation réinitialise et remplace l\'environnement d\'exécution virtuel (base/node/android-side) et peut entraîner des pertes de données dans le bac à sable ; la couche DSH (runtime-current/dsh) et user-data/.dsh ne sont pas affectés. Continuer ?</string>
<string name="settings_import_runtime_confirm_title">Importer un paquet d\'environnement d\'exécution</string>
<string name="settings_import_update">Importer un paquet d\'environnement d\'exécution (hors ligne)</string>
<string name="settings_language">Langue</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@
<string name="settings_import_running_msg">Копирование и установка выбранного пакета (официальный пакет среды выполнения — около 200 МБ, подождите несколько минут). Не покидайте эту страницу и не закрывайте приложение.</string>
<string name="settings_import_running_title">Импорт…</string>
<string name="settings_import_runtime_confirm_action">Импортировать</string>
<string name="settings_import_runtime_confirm_msg">Выберите пакет среды выполнения (.zip или .tar.gz / .tar.zst).\n\nСодержит саму среду выполнения:\n• base (обрезанная корневая файловая система Debian)\n• node (Node 24.19.0)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH НЕ включён; слой DSH не заменяется.)\n\nИмпорт сбрасывает и заменяет виртуальную системную среду выполнения (base/node/android-side) и может привести к потере данных внутри песочницы; слой DSH (runtime-current/dsh) и user-data/.dsh не затрагиваются. Продолжить?</string>
<string name="settings_import_runtime_confirm_msg">Выберите пакет среды выполнения (.zip или .tar.gz / .tar.zst).\n\nСодержит саму среду выполнения:\n• base (обрезанная корневая файловая система Debian)\n• node (Node 24.22.2)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH НЕ включён; слой DSH не заменяется.)\n\nИмпорт сбрасывает и заменяет виртуальную системную среду выполнения (base/node/android-side) и может привести к потере данных внутри песочницы; слой DSH (runtime-current/dsh) и user-data/.dsh не затрагиваются. Продолжить?</string>
<string name="settings_import_runtime_confirm_title">Импорт пакета среды выполнения</string>
<string name="settings_import_update">Импортировать пакет среды выполнения (офлайн)</string>
<string name="settings_language">Язык</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
<string name="settings_import_running_msg">正在复制并安装所选包(官方运行环境包约 200MB,需要一到几分钟),请勿离开本页或关闭应用。</string>
<string name="settings_import_running_title">正在导入…</string>
<string name="settings_import_runtime_confirm_action">确定导入</string>
<string name="settings_import_runtime_confirm_msg">请选择一个运行环境包(.zip 或 .tar.gz / .tar.zst)。\n\n它包含运行环境本体:\n• base(Debian 裁剪根文件系统)\n• node(Node 24.19.0)\n• android-side(proot/shmem/loader)\n• runtime-profile.json\n(不含 DSH。DSH 为独立层,不会被替换。)\n\n导入会重置并替换虚拟系统运行环境(base/node/android-side),可能导致沙盒内数据丢失;DSH 层(runtime-current/dsh)与 user-data/.dsh 不受影响。确定继续?</string>
<string name="settings_import_runtime_confirm_msg">请选择一个运行环境包(.zip 或 .tar.gz / .tar.zst)。\n\n它包含运行环境本体:\n• base(Debian 裁剪根文件系统)\n• node(Node 24.22.2)\n• android-side(proot/shmem/loader)\n• runtime-profile.json\n(不含 DSH。DSH 为独立层,不会被替换。)\n\n导入会重置并替换虚拟系统运行环境(base/node/android-side),可能导致沙盒内数据丢失;DSH 层(runtime-current/dsh)与 user-data/.dsh 不受影响。确定继续?</string>
<string name="settings_import_runtime_confirm_title">离线导入运行环境包</string>
<string name="settings_import_update">离线导入运行环境包</string>
<string name="settings_language">语言 / Language</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
<string name="settings_import_running_msg">Copying and installing the selected package (the official runtime package is about 200MB, allow a few minutes). Do not leave this page or close the app.</string>
<string name="settings_import_running_title">Importing…</string>
<string name="settings_import_runtime_confirm_action">Import</string>
<string name="settings_import_runtime_confirm_msg">Select a runtime package (.zip or .tar.gz / .tar.zst).\n\nIt contains the runtime itself:\n• base (trimmed Debian rootfs)\n• node (Node 24.19.0)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH is NOT included; the DSH layer is not replaced.)\n\nImport resets and replaces the virtual system runtime (base/node/android-side) and may cause data loss inside the sandbox; the DSH layer (runtime-current/dsh) and user-data/.dsh are not affected. Continue?</string>
<string name="settings_import_runtime_confirm_msg">Select a runtime package (.zip or .tar.gz / .tar.zst).\n\nIt contains the runtime itself:\n• base (trimmed Debian rootfs)\n• node (Node 24.22.2)\n• android-side (proot/shmem/loader)\n• runtime-profile.json\n(DSH is NOT included; the DSH layer is not replaced.)\n\nImport resets and replaces the virtual system runtime (base/node/android-side) and may cause data loss inside the sandbox; the DSH layer (runtime-current/dsh) and user-data/.dsh are not affected. Continue?</string>
<string name="settings_import_runtime_confirm_title">Import runtime package</string>
<string name="settings_import_update">Import runtime package (offline)</string>
<string name="settings_language">Language</string>
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/com/dshbox/app/common/NodeSources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ data class NodeDistSource(
}

object NodeSources {
/** node 层版本基线(与 runtime-bundle/build_node.sh / RUNTIME_LAYERS.md 一致,随版本更新)。 */
const val NODE_VERSION = "24.19.0"
/** node 层版本基线(与 runtime-bundle/build_node.sh 一致,随版本更新)。 */
const val NODE_VERSION = "24.22.2"

/** APK ABI → node dist 架构名(模拟器 x86_64 对应 x64)。 */
fun nodeArch(supportedAbi: String?): String = when (supportedAbi) {
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD_RUNBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bash tools/pipeline_dryrun.sh

### 1.4 构建
```bash
export NODE_VERSION=24.19.0
export NODE_VERSION=24.22.2
export BUNDLE_VERSION=0.1.0
export ZSTD_LEVEL=19 # zstd 存在时用;不存在则 pack 脚本自动 gzip
bash tools/build_arm64_runtime_bundle.sh # 默认 trixie arm64
Expand Down
17 changes: 10 additions & 7 deletions docs/L4-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

## 1. 作用
- DSH 的 `node-pty`(终端伪终端)等原生模块需要 **glibc + 编译工具链**(make/gcc/g++/cmake/pkg-config)。
- Node 24.19.0 的预编译二进制是 **arm64 Linux** 而非 pty 用;`node-pty` 的 `.node` 原生产物必须用与目标机一致的 **WSL2 arm64 glibc** 预先编译,再打进 DSH 层/或 base 层。
- Node 24.22.2 的预编译二进制是 **arm64 Linux** 而非 pty 用;`node-pty` 的 `.node` 原生产物必须用与目标机一致的 **WSL2 arm64 glibc** 预先编译,再打进 DSH 层/或 base 层。

## 2. 分层归属
| 层 | 归属 | 是否含 L4 工具链 |
|----|------|------------------|
| base (L0) | Debian 裁剪根 | **不含** make/gcc/cmake(仅 glibc + 基础二进制 + 终端依赖) |
| node (L1) | Node 24.19.0 | 仅 Node 运行时 + npm;不含二次编译工具 |
| node (L1) | Node 24.22.2 | 仅 Node 运行时 + npm;不含二次编译工具 |
| android-side (L3) | proot/shmem/loader | 仅宿主侧 so;不含 guest 工具链 |
| dsh (独立产物) | DSH 包 + **预编译 node-pty** | **含** 编译好的 arm64 .node |

Expand All @@ -22,7 +22,7 @@
sudo apt-get update && sudo apt-get install -y \
debootstrap qemu-user-static zstd \
build-essential python3 make g++ gcc cmake pkg-config
node --version # 应等于 24.19.0(即 NODE_VERSION)
node --version # 应等于 24.22.2(即 NODE_VERSION)
```

## 4. node-pty 预编译(一次性,WSL2 arm64)
Expand All @@ -33,13 +33,16 @@ npm rebuild --build-from-source
```
产物:`build/Release/pty.node`(arm64 Linux glibc)。打进 DSH 层后,运行时的 `@deepseek-ai/dsh/...` 直接加载该 `.node`,无需在设备上编译。

## 5. Node 24.19.0 + arm64 预编译清单
- `build_node.sh` 默认 `NODE_VERSION=24.19.0`(可在 `bundle.yaml`/`build_arm64_runtime_bundle.sh` 覆盖)。
- Node 官方 arm64 预编译:`node-v24.19.0-linux-arm64.tar.xz`(构建机为 arm64 时直接用官方产物)。
## 5. Node 24.22.2 + arm64 预编译清单
- `build_node.sh` 默认 `NODE_VERSION=24.22.2`(可在 `bundle.yaml`/`build_arm64_runtime_bundle.sh` 覆盖)。
- Node 官方 arm64 预编译:`node-v24.22.2-linux-arm64.tar.xz`(构建机为 arm64 时直接用官方产物)。
- **一次性 arm64 native 预编译清单**(写入 `runtime-bundle/native-manifest.json`,供 DSH 层打包复用):

> 注(2026-11-06 审计补注):下面这份清单只是**示例**——`runtime-bundle/native-manifest.json` 文件本身未入库,本仓代码不调用它。其中 `node-pty` 的 `abi` 值(127)**未在构建机实测验证**:node-pty 是在仓外的 WSL2 构建机上、于 DSH 源码树内编译的(见第 4 节),其 ABI 取决于构建机当时所用的 Node 版本,本仓构建链无从定死。实际产物的 ABI 需在 WSL2 构建机上、用目标 Node 跑 `node -p process.versions.modules` 核对后,再回填本示例。

```json
{
"node": { "arch": "arm64", "version": "24.19.0", "binary": "node-v24.19.0-linux-arm64.tar.xz", "sha256": "<sha256>" },
"node": { "arch": "arm64", "version": "24.22.2", "binary": "node-v24.22.2-linux-arm64.tar.xz", "sha256": "<sha256>" },
"node-pty": { "arch": "arm64", "abi": 127, "artifact": "node_modules/node-pty/build/Release/pty.node", "built_in": "wsl2-arm64-debian" },
"glibc": "2.36+",
"notes": "across arm64 linux glibc; compiled once in WSL2, deployed inside the DSH layer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SafetyModeTest {
AggregateError: loader entries failed to apply
Error: failed to import loader entry bad-a (bad-a): BOOM-A: import 阶段故意抛错
Error: failed to apply loader entry bad-b (bad-b): BOOM-B: apply 阶段故意抛错
Node.js v24.19.0
Node.js v24.22.2
""".trimIndent()
val hits = FailureAttribution.parse(text)
// 三条都要认出来:链根 include(随后被"受保护"规则滤掉)+ 两个真正的坏插件。
Expand All @@ -66,9 +66,9 @@ class SafetyModeTest {
// 每次尝试都以 `Node.js v…` 结尾,用它分段:旧的失败不该再被拿来隔离。
val text = """
failed to apply loader entry old-one (old-one): boom
Node.js v24.19.0
Node.js v24.22.2
failed to import loader entry new-one (new-one): boom2
Node.js v24.19.0
Node.js v24.22.2
""".trimIndent()
assertEquals(listOf("new-one"), FailureAttribution.parse(text).map { it.id })
}
Expand Down Expand Up @@ -108,9 +108,9 @@ class SafetyModeTest {
// 以及 DSH 已经起来之后又白隔离一次)。
val text = """
failed to import loader entry bad-a (bad-a): BOOM-A
Node.js v24.19.0
Node.js v24.22.2
failed to apply loader entry bad-b (bad-b): BOOM-B
Node.js v24.19.0
Node.js v24.22.2
""".trimIndent()
assertEquals(2, FailureAttribution.trailerCount(text))
// 尚未收尾(正在启动)的尝试:计数不变 = 不算失败。
Expand All @@ -124,10 +124,10 @@ class SafetyModeTest {
fun `失败原文摘要给的是点名行`() {
val text = """
failed to import loader entry bad-a (bad-a): BOOM-A
Node.js v24.19.0
Node.js v24.22.2
something else
failed to apply loader entry bad-b (bad-b): BOOM-B
Node.js v24.19.0
Node.js v24.22.2
""".trimIndent()
val snippet = FailureAttribution.failureSnippet(text)
assertTrue(snippet, snippet.contains("bad-b"))
Expand Down
2 changes: 1 addition & 1 deletion runtime-bundle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
FROM --platform=linux/arm64 debian:trixie-slim

ARG DSH_VERSION=0.1.0-rc.6
ARG NODE_VERSION=22.17.0
ARG NODE_VERSION=24.22.2
ARG NODE_DISTRO=linux-arm64

ENV DEBIAN_FRONTEND=noninteractive
Expand Down
Loading
Loading