From 4c49e7109b4280750a226703aea9a9bf700d2e8d Mon Sep 17 00:00:00 2001 From: Turtle Date: Wed, 12 Aug 2026 11:57:02 +0800 Subject: [PATCH] fix(cli): separate dsh from repository build --- AGENTS.md | 2 +- README.i18n.yaml | 4 ++-- README.md | 3 ++- README.zh.md | 3 ++- apps/cli/README.i18n.yaml | 4 ++-- apps/cli/README.md | 2 +- apps/cli/README.zh.md | 2 +- apps/cli/reference/README.i18n.yaml | 4 ++-- apps/cli/reference/README.md | 2 +- apps/cli/reference/README.zh.md | 2 +- apps/cli/tests/source-launch.compat.spec.ts | 6 +++--- docs/api-gateway.i18n.yaml | 4 ++-- docs/api-gateway.md | 2 +- docs/api-gateway.zh.md | 2 +- package.json | 2 +- 15 files changed, 23 insertions(+), 21 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 902b4ab976..c1bda51594 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -73,7 +73,7 @@ pnpm run hygiene # knip + publint + workspace constraints + NodeNext cons pnpm run check:windows-wine # ONLY when diagnosing a known Windows failure (needs wine); CI owns this signal pnpm run doc-sync # all documentation gates; leaf list in scripts/run-gates.ts pnpm run website:build # VitePress build (doubles as dead-link check) -pnpm dsh --profile headless "task" # build, then run one task (needs DEEPSEEK_API_KEY) +pnpm dsh --profile headless "task" # run one task from source (needs DEEPSEEK_API_KEY) pnpm run demo:cordis # the agent modifies its own runtime (needs key) pnpm run demo:acp # ACP automation server (needs DEEPSEEK_API_KEY) ``` diff --git a/README.i18n.yaml b/README.i18n.yaml index f1bd278906..fbe567d83a 100644 --- a/README.i18n.yaml +++ b/README.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write README.md -README.md: 785d7dd41cb64b0c0cbd6c23abcd2cdd6ba815db -README.zh.md: 82bc2eace173d4f56892f514e5a9eebc4f2079d8 +README.md: 37c9bc77cde1e2259b4233d4dc37f9c8b1264a96 +README.zh.md: e849c8cda6867c711e4fea4f464cfbacac5c4693 diff --git a/README.md b/README.md index 785d7dd41c..37c9bc77cd 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,11 @@ To run a repository checkout instead: git clone https://github.com/deepseek-harness/deepseek-harness.git cd deepseek-harness pnpm install +pnpm run build pnpm dsh web ``` -The last command builds the repository and opens the same Web UI path. +`pnpm run build` prepares the repository artifacts. `pnpm dsh web` starts the Web UI without rebuilding and opens the same path. ## Profiles and plugins diff --git a/README.zh.md b/README.zh.md index 82bc2eace1..e849c8cda6 100644 --- a/README.zh.md +++ b/README.zh.md @@ -32,10 +32,11 @@ npx @deepseek-ai/dsh web git clone https://github.com/deepseek-harness/deepseek-harness.git cd deepseek-harness pnpm install +pnpm run build pnpm dsh web ``` -最后一条命令会构建仓库,并进入相同的 Web UI 路径。 +`pnpm run build` 准备仓库产物。`pnpm dsh web` 启动 Web UI,不会重新构建,并进入相同的路径。 ## Profile 与插件 diff --git a/apps/cli/README.i18n.yaml b/apps/cli/README.i18n.yaml index 191d6c8e68..af3c04dea5 100644 --- a/apps/cli/README.i18n.yaml +++ b/apps/cli/README.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write apps/cli/README.md -README.md: 98a856261bc632c97f350db8fc7bb0b10c22235d -README.zh.md: 283e54138e24202ed6b88d1d309538c58cd66b3e +README.md: 4fbd0692a2df403c6395235e096e193c994ea198 +README.zh.md: 7861f5b4f8cb447aff01ec8b64b12fd298485b4b diff --git a/apps/cli/README.md b/apps/cli/README.md index 98a856261b..4fbd0692a2 100644 --- a/apps/cli/README.md +++ b/apps/cli/README.md @@ -35,4 +35,4 @@ The [CLI behavior reference](reference/README.md) owns exact layer precedence, f ## Development -Production runs require built package and frontend artifacts. From the repository root, `pnpm dsh ` builds those artifacts, runs the TypeScript entry, and forwards every argument; the [source-execution reference](reference/README.md#source-execution) owns the module-resolution contract. +Production runs require built package and frontend artifacts. From the repository root, run `pnpm run build` separately, then use `pnpm dsh ` to run the TypeScript entry and forward every argument; the [source-execution reference](reference/README.md#source-execution) owns the module-resolution contract. diff --git a/apps/cli/README.zh.md b/apps/cli/README.zh.md index 283e54138e..7861f5b4f8 100644 --- a/apps/cli/README.zh.md +++ b/apps/cli/README.zh.md @@ -35,4 +35,4 @@ profile 目录包含一个 `package.json`(树外插件依赖,加上 profile ## 开发 -生产运行需要已构建的包与前端产物。从仓库根目录运行 `pnpm dsh ` 会先构建这些产物,再运行 TypeScript 入口并转发所有参数;模块解析约定由[源码执行参考](reference/README.md#source-execution)负责。 +生产运行需要已构建的包与前端产物。请在仓库根目录单独运行 `pnpm run build`,然后使用 `pnpm dsh ` 运行 TypeScript 入口并转发所有参数;模块解析约定由[源码执行参考](reference/README.md#source-execution)负责。 diff --git a/apps/cli/reference/README.i18n.yaml b/apps/cli/reference/README.i18n.yaml index e5bc192550..2d68e50651 100644 --- a/apps/cli/reference/README.i18n.yaml +++ b/apps/cli/reference/README.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write apps/cli/reference/README.md -README.md: 46ea3c241d6775ce90a89c7be58901375a0634a3 -README.zh.md: f020f46260d6b04b87a4918a671ca6bcbed251d9 +README.md: 38a22e5601d5ce266181e4cffb03bd482cab6ade +README.zh.md: c6020e791151c8431a01c88184bd75ae530ff19a diff --git a/apps/cli/reference/README.md b/apps/cli/reference/README.md index 46ea3c241d..38a22e5601 100644 --- a/apps/cli/reference/README.md +++ b/apps/cli/reference/README.md @@ -81,4 +81,4 @@ Install external plugin bundles through `dsh plugin --profile add `. The `package.json` script runs the complete repository build, launches `apps/cli/src/bin.ts` with `node --import tsx/esm`, and forwards every argument. Build output appears before CLI output. The process inherits the launch environment; set `NODE_USE_ENV_PROXY=1` when a supporting Node version must honor `HTTP_PROXY` and `HTTPS_PROXY`. The installed form launches the built `apps/cli/lib/bin.js` without rebuilding the repository. +From the repository root, run `pnpm run build` separately when artifacts need updating, then use `pnpm dsh `. The `package.json` script launches `apps/cli/src/bin.ts` with `node --import tsx/esm` without building and forwards every argument. The process inherits the launch environment; set `NODE_USE_ENV_PROXY=1` when a supporting Node version must honor `HTTP_PROXY` and `HTTPS_PROXY`. The installed form launches the built `apps/cli/lib/bin.js` without rebuilding the repository. diff --git a/apps/cli/reference/README.zh.md b/apps/cli/reference/README.zh.md index f020f46260..c6020e7911 100644 --- a/apps/cli/reference/README.zh.md +++ b/apps/cli/reference/README.zh.md @@ -81,4 +81,4 @@ dsh web --help ## 源码执行 -请从仓库根目录使用 `pnpm dsh `。`package.json` 中的脚本会完成整个仓库的构建,通过 `node --import tsx/esm` 启动 `apps/cli/src/bin.ts`,并转发所有参数。构建输出会显示在 CLI 输出之前。该进程会继承启动环境;当支持环境代理的 Node 版本必须遵循 `HTTP_PROXY` 和 `HTTPS_PROXY` 时,请设置 `NODE_USE_ENV_PROXY=1`。安装形式会直接启动构建后的 `apps/cli/lib/bin.js`,不会重新构建仓库。 +请在仓库根目录中,于产物需要更新时单独运行 `pnpm run build`,然后使用 `pnpm dsh `。`package.json` 中的脚本不会构建,而是通过 `node --import tsx/esm` 启动 `apps/cli/src/bin.ts`,并转发所有参数。该进程会继承启动环境;当支持环境代理的 Node 版本必须遵循 `HTTP_PROXY` 和 `HTTPS_PROXY` 时,请设置 `NODE_USE_ENV_PROXY=1`。安装形式会直接启动构建后的 `apps/cli/lib/bin.js`,不会重新构建仓库。 diff --git a/apps/cli/tests/source-launch.compat.spec.ts b/apps/cli/tests/source-launch.compat.spec.ts index 597c3cff26..975e4c3591 100644 --- a/apps/cli/tests/source-launch.compat.spec.ts +++ b/apps/cli/tests/source-launch.compat.spec.ts @@ -6,7 +6,7 @@ import { describe, expect, it } from 'vitest' /** * Keyless smoke for SOURCE `dsh` execution: run `apps/cli/src/bin.ts` * with the exact production runtime vector (`node --import tsx/esm`, the - * vector the root `dsh` script invokes after building) and assert the + * vector the root `dsh` script invokes directly) and assert the * required-config diagnostic. The Node compatibility matrix runs this * WHOLE file, so a Node release changing module hooks or TypeScript handling * breaks this gate instead of every developer's `pnpm dsh`; the built-bin @@ -17,11 +17,11 @@ const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)) const dshSourceBin = 'apps/cli/src/bin.ts' describe('dsh SOURCE launcher (node --import tsx/esm)', () => { - it('builds before launching the source CLI', async () => { + it('launches the source CLI without building', async () => { const rootPackage = JSON.parse(await readFile(new URL('../../../package.json', import.meta.url), 'utf8')) as { readonly scripts?: Record } - expect(rootPackage.scripts?.dsh).toBe('pnpm run build && node --import tsx/esm apps/cli/src/bin.ts') + expect(rootPackage.scripts?.dsh).toBe('node --import tsx/esm apps/cli/src/bin.ts') }) it('boots the source entry and requires a profile', async () => { diff --git a/docs/api-gateway.i18n.yaml b/docs/api-gateway.i18n.yaml index be48f9ef42..3bc3d56e59 100644 --- a/docs/api-gateway.i18n.yaml +++ b/docs/api-gateway.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write docs/api-gateway.md -api-gateway.md: c60793532d621585fc9878b6197497b45015856b -api-gateway.zh.md: daf46f6ad208f4cb959028ff59d98d9de7a072d6 +api-gateway.md: c1d6b81688af1b71e9c9538d1959a46955759208 +api-gateway.zh.md: 86e63c6e9a4166a38397a445424704dc9e61821f diff --git a/docs/api-gateway.md b/docs/api-gateway.md index c60793532d..c1d6b81688 100644 --- a/docs/api-gateway.md +++ b/docs/api-gateway.md @@ -138,7 +138,7 @@ SRC solves only dispatch for a Host process running from source. The Client does ## Development mode -The repository `dsh` script completes the Host, Client, and Web build before starting the source Host. Web development runs that command and the Client plugin watcher in separate terminals: +Web development prepares current Host, Client, and Web artifacts with `pnpm run build`, then runs the source Host and Client plugin watcher in separate terminals: ```sh pnpm dsh web diff --git a/docs/api-gateway.zh.md b/docs/api-gateway.zh.md index daf46f6ad2..86e63c6e9a 100644 --- a/docs/api-gateway.zh.md +++ b/docs/api-gateway.zh.md @@ -138,7 +138,7 @@ SRC 只解决 Host 源码进程的分发问题。Client 不会从运行中的 Ho ## 开发模式 -仓库的 `dsh` 脚本会先完成 Host、Client 与 Web 构建,再启动源码 Host。Web 开发需要在两个终端中分别运行该命令和 Client plugin watcher: +Web 开发先使用 `pnpm run build` 准备当前 Host、Client 与 Web 产物,然后在两个终端中分别运行源码 Host 和 Client plugin watcher: ```sh pnpm dsh web diff --git a/package.json b/package.json index 5760b0497b..0b32c2a3b2 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "release:pack": "tsx scripts/release/pack.ts", "release:verify-packed-install": "tsx scripts/release/verify-packed-install.ts", "release:publish": "tsx scripts/release/publish.ts", - "dsh": "pnpm run build && node --import tsx/esm apps/cli/src/bin.ts", + "dsh": "node --import tsx/esm apps/cli/src/bin.ts", "demo:code-mode": "node scripts/demo-code-mode.mjs", "demo:cordis": "node scripts/demo-cordis.mjs", "demo:acp": "node --import tsx packages/examples/acp-demo/src/bin.ts --config examples/acp-agent/cordis.yml",