@deepseek-ai/dsh-headless 0.0.1-rc.2 → 0.0.1-rc.3

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 CHANGED
@@ -3,4 +3,4 @@
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/bundle/headless/README.md
5
5
  README.md: 3d9ca350f5f8891e60cfc57c9ca89ef57d9790d3
6
- README.zh.md: 1dcba9635b37efebeb0cc1129cc67bc7c01d0d1d
6
+ README.zh.md: a05019b8d01518a83a54f2637ff4daf80061c0ed
package/README.zh.md CHANGED
@@ -4,17 +4,17 @@
4
4
 
5
5
  dsh 一次性任务组合包。[`cordis.patch.yml`](cordis.patch.yml) 直接叠加在 [`dsh-base`](../base/README.md) 之上:提供编码 persona 和工具模式、禁用 HMR(热模块替换)、将 Code Mode 的 worker 作为核心执行能力挂载,并插入本包的 `headless-runner` 插件(配置为 `{task}`,从注入的 `headlessStartup` 提供方解析)。它不挂载任何 Host、HTTP server、Web runtime 或浏览器插件。
6
6
 
7
- Loader 结算后,runner 读取共享的 [`ctx.agentDefaultModel`](../../core/agent-default-model/README.md),通过 `ctx.agents` 创建一个全新的持久化 Agent(智能体),将任务作为普通用户消息提交,并等待完全停稳。它对 Session 执行 flush 后再汇总自身持有的持久化事件区间,将最后一条非空 assistant 文本写入 stdout,再经启动器提供的 `ctx.appExit` 宿主钩子([`dsh-cmdline`](../../boot/cmdline/README.md))请求退出(最终 `turn/end` 完成 → 0,否则为 1)。最终 reason 为 `error` 时,还会将持久化的 code 与 message 写入 stderr;成功运行时 stderr 保持为空。进程不会打开监听端口。任务文本就是这个应用的命令行:普通 `headless-startup` 提供方([`src/startup.ts`](src/startup.ts))注入 `ctx.cmdlineArgs`([`dsh-cmdline`](../../boot/cmdline/README.md)),读取 `dsh --profile headless "task"` 的位置参数、打印应用自己的 `--help`,并提供 `headlessStartup`;runner 注入该服务,再从惰性配置中读取任务。缺失或只有空白的任务会在 runner 激活前被拒绝。
7
+ Loader 结算后,runner 读取共享的 [`ctx.agentDefaultModel`](../../core/agent-default-model/README.md),通过 `ctx.agents` 创建一个全新的持久化 Agent(智能体),将任务作为普通用户消息提交,并等待完全停稳。它对 Session 执行 flush 后再汇总自身持有的持久化事件区间,将最后一条非空 assistant 文本写入 stdout,再经启动器提供的 `ctx.appExit` 宿主钩子([`dsh-cmdline`](../../boot/cmdline/README.md))请求退出(最终 `turn/end` 完成 → 0,否则为 1)。最终结束原因为 `error` 时,还会将 code 与 message 写入 stderr;成功运行时 stderr 保持为空。进程不会打开监听端口。任务文本就是这个应用的命令行:普通 `headless-startup` 提供方([`src/startup.ts`](src/startup.ts))注入 `ctx.cmdlineArgs`([`dsh-cmdline`](../../boot/cmdline/README.md)),读取 `dsh --profile headless "task"` 的位置参数、打印应用自己的 `--help`,并提供 `headlessStartup`;runner 注入该服务,再从惰性配置中读取任务。缺失或只有空白的任务会在 runner 激活前被拒绝。
8
8
 
9
9
  ## 模型体验
10
10
 
11
- 无影响,因为 runner 把任务作为普通用户消息提交;提示词与工具归 base 和 headless 组合包中的相应行所有。
11
+ 无影响,因为 runner 把任务作为普通用户消息提交;提示词与工具由 base 和 headless 组合包中的相应条目提供。
12
12
 
13
13
  #### KV Cache 影响
14
14
 
15
15
  无;runner 不向请求前缀添加任何内容。
16
16
 
17
- ## 已知限制与延期工作
17
+ ## 已知限制与暂缓事项
18
18
 
19
19
  - **只提交一个任务**:runner 没有用于交互式后续输入的 surface;它会等待 Agent 在返回 idle 前完成的所有工作,并打印该区间内最后一条非空 assistant 消息。
20
20
  - **`ctx.appExit` 由启动器持有**:在 `dsh` 启动器之外启动 headless profile 会在激活时明确报错,直到宿主提供该退出请求。
package/cordis.patch.yml CHANGED
@@ -22,7 +22,7 @@
22
22
  - insert:
23
23
  # Code Mode is a core execution capability, not a Web component.
24
24
  - id: code-runtime
25
- name: '@deepseek-ai/dsh-code-runtime-worker'
25
+ name: '@deepseek-ai/dsh-code-runtime-worker-thread'
26
26
 
27
27
  - id: headless-startup
28
28
  name: '@deepseek-ai/dsh-headless/startup'
package/lib/startup.js CHANGED
@@ -24,23 +24,19 @@ Examples:
24
24
  `);
25
25
  }
26
26
  /**
27
- * Turn the parsed command line into the runner's task.
28
- * @param program - the parsed headless command.
29
- * @returns the runner's service value.
30
- */
31
- function planHeadlessStartup(program) {
32
- const task = program.args.join(" ");
33
- if (task.trim() === "") program.error("error: a task is required, for example: dsh --profile headless \"run the tests\"");
34
- return { task };
35
- }
36
- /**
37
- * Parse and provide the one-shot task as an ordinary Cordis service.
27
+ * Parse and provide the one-shot task as an ordinary Cordis service. The
28
+ * command's action publishes the task; a missing or whitespace-only task is a
29
+ * usage error, so on rejection (and on `--help`) nothing is provided.
38
30
  * @param ctx - plugin context carrying the command line.
39
- * @returns nothing once the task is provided, or when the command requested exit.
40
31
  */
41
32
  function apply(ctx) {
42
- const values = parseCmdline(ctx, headlessCommand(), planHeadlessStartup);
43
- if (values !== void 0) ctx.provide(HEADLESS_STARTUP_SERVICE, values);
33
+ const program = headlessCommand();
34
+ program.action(() => {
35
+ const task = program.args.join(" ");
36
+ if (task.trim() === "") program.error("error: a task is required, for example: dsh --profile headless \"run the tests\"");
37
+ ctx.provide(HEADLESS_STARTUP_SERVICE, { task });
38
+ });
39
+ parseCmdline(ctx, program);
44
40
  }
45
41
  //#endregion
46
42
  export { HEADLESS_STARTUP_SERVICE, apply, inject, name };
@@ -17,9 +17,10 @@ export interface HeadlessStartupValues {
17
17
  task: string;
18
18
  }
19
19
  /**
20
- * Parse and provide the one-shot task as an ordinary Cordis service.
20
+ * Parse and provide the one-shot task as an ordinary Cordis service. The
21
+ * command's action publishes the task; a missing or whitespace-only task is a
22
+ * usage error, so on rejection (and on `--help`) nothing is provided.
21
23
  * @param ctx - plugin context carrying the command line.
22
- * @returns nothing once the task is provided, or when the command requested exit.
23
24
  */
24
25
  export declare function apply(ctx: Context): void;
25
26
  //# sourceMappingURL=startup.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-headless",
3
3
  "description": "The dsh one-shot bundle: a direct core Agent/Session runner over dsh-base with no Host, HTTP, or browser layer",
4
- "version": "0.0.1-rc.2",
4
+ "version": "0.0.1-rc.3",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -45,26 +45,26 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "commander": "^15.0.0",
48
- "@deepseek-ai/dsh-cmdline": "^0.0.1-rc.2",
49
- "@deepseek-ai/dsh-code-runtime-worker": "^0.0.1-rc.2",
48
+ "@deepseek-ai/dsh-cmdline": "^0.0.1-rc.3",
49
+ "@deepseek-ai/dsh-code-runtime-worker-thread": "^0.0.1-rc.3",
50
50
  "@deepseek-ai/schemastery": "^3.18.1-rc.1"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@deepseek-ai/cordis-plugin-loader": "^1.0.1-rc.1",
54
- "@deepseek-ai/dsh-agent": "^0.0.1-rc.2",
55
- "@deepseek-ai/dsh-agent-default-model": "^0.0.1-rc.2",
56
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
57
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.2",
58
- "@deepseek-ai/dsh-session": "^0.0.1-rc.2",
59
- "@deepseek-ai/cordis": "^4.0.1-rc.1"
54
+ "@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
55
+ "@deepseek-ai/dsh-agent-default-model": "^0.0.1-rc.3",
56
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
57
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
58
+ "@deepseek-ai/cordis": "^4.0.1-rc.1",
59
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.3"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@deepseek-ai/cordis-plugin-loader": "^1.0.1-rc.1",
63
- "@deepseek-ai/dsh-agent": "^0.0.1-rc.2",
64
- "@deepseek-ai/dsh-agent-default-model": "^0.0.1-rc.2",
65
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
66
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.2",
67
- "@deepseek-ai/cordis": "^4.0.1-rc.1",
68
- "@deepseek-ai/dsh-session": "^0.0.1-rc.2"
63
+ "@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
64
+ "@deepseek-ai/dsh-agent-default-model": "^0.0.1-rc.3",
65
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
66
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
67
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.3",
68
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
69
69
  }
70
70
  }