@tbox.cn/dsh-acp-full-app 0.0.0-stage → 0.1.0-rc.10
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/cordis.patch.yml +37 -0
- package/lib/index.d.ts +31 -0
- package/lib/index.js +4 -0
- package/package.json +40 -3
- package/README.md +0 -3
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# dsh-acp-full-app 结构行集(acp 链 bundle;通用层零 tboxcode 词汇——行 id 用官方对位名)。
|
|
2
|
+
# 行组规格见 .agents/designs/proposed/2026-10-01-overview.md。
|
|
3
|
+
#
|
|
4
|
+
# 四行 insert:
|
|
5
|
+
# acp-app-startup = 本包 startup 插件(启动闩 / 有界关停——help 失败不启动传输)
|
|
6
|
+
# tool-ask-user = 提问工具挂载(elicitation answerer 桥的工具面前提;
|
|
7
|
+
# config mode: legacy 定死——question-native-no-port 挂载点唯一化,
|
|
8
|
+
# timed 为 web 专用增强不启用)
|
|
9
|
+
# tool-subagent = 委派工具挂载(原生单实例——继承范式,子组合 ≡ 父;acp 链无
|
|
10
|
+
# registry,presets.configured === false 不查 agentPresets 服务
|
|
11
|
+
# 〔0.2.1 tool-subagent/src/index.ts 挂载校验〕;maxDepth: 1 深度
|
|
12
|
+
# 封锁显式钉住;不带 modelSelectionSettings——scope 服务 acp 缺席
|
|
13
|
+
# 即挂载 fail,探针实证;决策:subagent-native-adoption)
|
|
14
|
+
# acp = 全功能 ACP server(行级 inject 启动闩——插件加载前置等待)
|
|
15
|
+
#
|
|
16
|
+
# 依赖树纪律:insert 行 name 指向的包必须在 profile 依赖树内(spike-cmdline 矩阵:
|
|
17
|
+
# 树内物理优先)——@tbox.cn/dsh-acp-full 与 @deepseek-ai/dsh-tool-ask-user、
|
|
18
|
+
# @deepseek-ai/dsh-tool-subagent 由本包 dependencies 声明带入。
|
|
19
|
+
- insert:
|
|
20
|
+
- id: acp-app-startup
|
|
21
|
+
name: '@tbox.cn/dsh-acp-full-app'
|
|
22
|
+
|
|
23
|
+
- id: tool-ask-user
|
|
24
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
25
|
+
config:
|
|
26
|
+
mode: legacy
|
|
27
|
+
|
|
28
|
+
- id: tool-subagent
|
|
29
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
30
|
+
config:
|
|
31
|
+
provider: spawn
|
|
32
|
+
toolName: subagent
|
|
33
|
+
maxDepth: 1
|
|
34
|
+
|
|
35
|
+
- id: acp
|
|
36
|
+
name: '@tbox.cn/dsh-acp-full'
|
|
37
|
+
inject: [acpAppStartup]
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
/** 稳定 cordis 插件名(patch 行 inject 引用)。 */
|
|
5
|
+
declare const name = "acp-app-startup";
|
|
6
|
+
/** 命令行解析依赖(launcher 提供)。 */
|
|
7
|
+
declare const inject: string[];
|
|
8
|
+
/** acp 行等待的就绪服务名。 */
|
|
9
|
+
declare const ACP_APP_STARTUP_SERVICE = "acpAppStartup";
|
|
10
|
+
/** 看门狗注入面(单测驱动探测/心跳/回调——无 cordis 依赖)。 */
|
|
11
|
+
interface ParentLivenessWatchOptions {
|
|
12
|
+
parentPid: number;
|
|
13
|
+
intervalMs?: number;
|
|
14
|
+
/** 探测父进程存活;缺省 `kill(pid, 0)`(ESRCH=死 / EPERM=活)。 */
|
|
15
|
+
probe?: (pid: number) => boolean;
|
|
16
|
+
/** 父死回调(至多触发一次)。 */
|
|
17
|
+
onLost: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 父进程存活性看门狗:cli 被外层 SIGKILL 时 stdio 管道写端可能仍被上游持有
|
|
21
|
+
* (EOF 永不触发),dsh 孙进程将无限期持有会话写租约。探测 `kill(ppid, 0)`:
|
|
22
|
+
* ESRCH = 父死 → onLost(接 appExit 有界关停);EPERM = 父存活(他用户)。
|
|
23
|
+
* pid 复用误判接受(最坏少杀一次,无过杀风险)。ppid <= 1(启动即孤儿)不武装。
|
|
24
|
+
* 仅 acp-app bundle 挂载——server 的 ready 后孤儿语义(server-envelope 契约)不受影响。
|
|
25
|
+
* @returns 停止函数(idempotent)。
|
|
26
|
+
*/
|
|
27
|
+
declare function startParentLivenessWatch(options: ParentLivenessWatchOptions): () => void;
|
|
28
|
+
/** 接受调用 → 发布就绪 + 绑定 EOF 关停与父存活看门狗;解析失败不发布(传输不装载)。 */
|
|
29
|
+
declare function apply(ctx: Context): void;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ACP_APP_STARTUP_SERVICE, ParentLivenessWatchOptions, apply, inject, name, startParentLivenessWatch };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Command as e}from"commander";import{exitOnStdinEnd as t,parseCmdline as n}from"@deepseek-ai/dsh-cmdline";const r=`acp-app-startup`,i=[`cmdlineArgs`],a=`acpAppStartup`;function o(){return new e().name(`dsh --profile tboxcode-acp`).description(`Serve automation clients over Agent Client Protocol stdio.`).helpOption(`-h, --help`,`show this help`).addHelpText(`after`,`
|
|
2
|
+
Example:
|
|
3
|
+
dsh --profile tboxcode-acp serve ACP until the client disconnects
|
|
4
|
+
`)}function s(e){let t=e.intervalMs??2e3,n=e.probe??c;if(e.parentPid<=1)return()=>{};let r=!1,i=setInterval(()=>{if(r)return;let t=!0;try{t=n(e.parentPid)}catch{t=!0}t||(r=!0,clearInterval(i),e.onLost())},t);return i.unref?.(),()=>clearInterval(i)}function c(e){try{return process.kill(e,0),!0}catch(e){return e.code!==`ESRCH`}}function l(e){let t=e.get(`appExit`),n=e.get(`appReady`);if(t===void 0||n===void 0)return;let r=s({parentPid:process.ppid,onLost:()=>{n.onReady(()=>t(0))}});e.effect(()=>r,`acp-app.parent-watch`)}function u(e){let r=o();r.action(()=>{t(e,`acp-app.stdin`),l(e),e.provide(a,{accepted:!0})}),n(e,r)}export{a as ACP_APP_STARTUP_SERVICE,u as apply,i as inject,r as name,s as startParentLivenessWatch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/dsh-acp-full-app",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-rc.10",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "profile bundle:dsh-base 组合 + 启动闩 / 有界关停(对位官方 dsh-acp-app 的 automation 导向精简面)+ tool-ask-user 挂载行(elicitation 能力前提)",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib",
|
|
17
|
+
"cordis.patch.yml"
|
|
18
|
+
],
|
|
19
|
+
"dsh": {
|
|
20
|
+
"bundle": {
|
|
21
|
+
"patch": "./cordis.patch.yml"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@deepseek-ai/dsh-cmdline": "0.2.1-rc.2",
|
|
26
|
+
"@deepseek-ai/dsh-tool-ask-user": "0.2.1-rc.2",
|
|
27
|
+
"@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.2"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
31
|
+
"@deepseek-ai/dsh-cmdline": "0.2.1-rc.2",
|
|
32
|
+
"commander": "^15.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
36
|
+
"@deepseek-ai/dsh-cmdline": "0.2.1-rc.2",
|
|
37
|
+
"commander": "^15.0.0"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsdown",
|
|
41
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
42
|
+
}
|
|
6
43
|
}
|
package/README.md
DELETED