@mzzsfy/dsh-shell-select 0.3.1 → 0.4.0
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.md +10 -4
- package/cordis.patch.yml +181 -29
- package/package.json +19 -13
- package/src/apply-state.mjs +13 -0
- package/src/client.js +103 -46
- package/src/config.mjs +108 -14
- package/src/executor.mjs +204 -101
- package/src/guard-state.mjs +26 -0
- package/src/guard.js +14 -6
- package/src/index.js +157 -0
- package/src/takeover.mjs +167 -0
- package/src/tool.mjs +39 -13
- package/src/web-routes.mjs +91 -0
- package/test/client-card.test.mjs +14 -3
- package/test/client-render.test.mjs +170 -0
- package/test/config-entry.test.mjs +13 -8
- package/test/config.test.mjs +57 -4
- package/test/deny-config.test.mjs +8 -8
- package/test/executor-seam.test.mjs +3 -3
- package/test/executor.test.mjs +150 -121
- package/test/guard-state.test.mjs +46 -1
- package/test/preset-drift.test.mjs +49 -69
- package/test/takeover-shell.test.mjs +397 -0
- package/test/web-routes.test.mjs +267 -0
package/README.md
CHANGED
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Windows shell 链接管:禁用官方 `pwsh` 工具与执行器,替换为可配置多客户端的 `shell` 工具——pwsh / git bash / cmd / WSL / 任意第三方实现,自定义路径,多个客户端并存,设默认,模型经工具参数按名选择。
|
|
4
4
|
|
|
5
|
+
**宿主要求 ≥ 0.1.7-rc.1**:预设面用 preset-* 声明行(patch 引用 `@deepseek-ai/dsh-agent-preset`,0.1.7 起提供);装到更旧宿主会因该包缺失导致组合树加载失败——0.1.5 及以下请勿安装本包。
|
|
6
|
+
|
|
5
7
|
## 工作方式
|
|
6
8
|
|
|
7
|
-
- bundle
|
|
9
|
+
- **运行时接管**:bundle 补丁不静态禁用官方 `tool-pwsh`、`pwsh-sandbox` 两行——boot 期官方 pwsh 链先服务,主行(`ctx.shell` 执行器 + `shell` 工具 + systemPrompt 段)apply 落定后经 `entry.update` 运行时禁用官方两行(dsh-market 同款,内存态不持久),再挂载执行器接管。本包任意死法(import 崩/apply 崩/被禁/卸载)下官方行保持启用,官方 pwsh 链自服务,系统不出现 shell 全灭窗口;重启后由行树声明态收敛。web 行(设置页数据通道,`inject: ['webServer', 'settings']` 声明式门控——服务就绪才激活)与 guard 哨兵行同 patch 插入。
|
|
10
|
+
- 配置事实源 = 主行 Config(dsh 0.1.7 settings 面以 profile 条目为存储,ns `shell-select`);自带设置页经 `settings.configure({ auto: false })` 抑制原生自动页,写路径 `settings.replace`,配置变更由 cordis 行重载活生效(工具描述随行重建即时更新)。
|
|
8
11
|
- client 半区 `dsh.client.inject` 声明(官方机制,dsh-client-file-upload 等官方包同款):保证 client 运行时模块表中 `primitives`/`slots` 面在场;primitives 另有 try/catch 降级自绘兜底。
|
|
9
12
|
- 本包执行器完整实现官方 `ctx.shell` seam(`resolve`/`run`/`start`/`runFor`/`startFor`/`entryFor`/`sandboxMode`),结构官方 PwshLocalExecutor 同构(实例状态/方法全公有——cordis 服务代理会把经 `ctx.shell` 调用的方法 `this` 重定向到阴影对象,`#` 私有触发品牌检查错误)。
|
|
10
|
-
- preset
|
|
13
|
+
- preset 面收口(0.1.7 架构):agent 面整体移入会话预设(preset-* 声明行内联 roster,web 表面在根组合树禁用全部 agent 工具行)。本包 patch insert 自带预设 `shell-select`(standard 内联 roster 全量 − tool-pwsh 行,逐项同构官方 standard.patch.yml)并覆写 `agent-preset-registry` 的 default:win32 默认预设切到本包预设(POSIX 保持 standard,行为与上游一致)。用户显式选择其他预设恒优先——官方 minimal/cordis/ptc 预设自带 persistent pwsh 终端链,显式选用时不在接管范围。上游预设漂移由 `test/preset-drift.test.mjs` 逐行守卫,升级后按官方实文对表。
|
|
11
14
|
- 沙箱语义官方同构:`danger-full-access` 直跑;受限模式经 `ctx.sandbox.confine` 包装并按官方方言分类拒绝/runner 失败,权限模型不变。
|
|
12
|
-
- 死态自愈:用户 patch
|
|
15
|
+
- 死态自愈:用户 patch 层禁用主行的窗口(接管中 runtime-disable 残留)内,guard 哨兵(id 含 `/`,市场不写该层)代挂官方 `dsh-tool-pwsh` + `dsh-pwsh-sandbox` 恢复 host 面服务与 boot 组合(预载失败退避重试,至多 3 次),任一方复活先卸代挂。哨兵/复活让位语义逐项同构 `dsh-llm-pi-gateway`。边界:cordis 服务按 fiber 树解析,代挂对 agent preset 作用域不可见,死态窗口新会话的 preset tool-pwsh 行拒挂(报错清晰)属预期。
|
|
16
|
+
- escape hatch(用户想用官方 pwsh 链):market 禁用 shell-select 或 user patch 写 `- id: shell-select / disabled: true`——主行退场后官方行保持启用自服务,重启后官方自然回归;删除禁行重启即恢复接管。(官方两行带平台表达式,行级 `disabled: false` 与宿主默认启用同形,不作让位信号。)
|
|
13
17
|
- POSIX 上本包全部行停用,官方 bash 链不受影响。
|
|
14
18
|
|
|
15
19
|
## 工具
|
|
@@ -28,7 +32,7 @@ Windows shell 链接管:禁用官方 `pwsh` 工具与执行器,替换为可配
|
|
|
28
32
|
- 非终端意图回退简版行:摘要 + 可展开原文 + 检查按钮。
|
|
29
33
|
- 图标取官方 `dsh-client-ui-primitives`(StateDot/IconApi/IconInspect/Chevron),模块表缺席时降级自绘。
|
|
30
34
|
|
|
31
|
-
## 配置(
|
|
35
|
+
## 配置(行条目 `shell-select`,settings 面同名 ns)
|
|
32
36
|
|
|
33
37
|
```yaml
|
|
34
38
|
shell-select:
|
|
@@ -84,6 +88,8 @@ env 优先级(同键高右):内置覆盖集(NO_COLOR/PAGER/GIT_PAGER)< 条目 `e
|
|
|
84
88
|
name: '@mzzsfy/dsh-shell-select'
|
|
85
89
|
- id: shell-select/guard
|
|
86
90
|
name: '@mzzsfy/dsh-shell-select/guard'
|
|
91
|
+
- id: shell-select/web
|
|
92
|
+
name: '@mzzsfy/dsh-shell-select/web'
|
|
87
93
|
```
|
|
88
94
|
|
|
89
95
|
测试:`node --test "test/*.test.mjs"`(包目录内)。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,43 +1,192 @@
|
|
|
1
1
|
# shell-select bundle patch:Windows shell 链零感知接管(同构 dsh-llm-pi-gateway)。
|
|
2
|
-
# 官方 tool-pwsh 与 pwsh-sandbox
|
|
3
|
-
#
|
|
4
|
-
#
|
|
2
|
+
# 官方 tool-pwsh 与 pwsh-sandbox 行【不再静态禁用】:主行 apply 落定后经
|
|
3
|
+
# entry.update 运行时禁用(dsh-market 同款,内存态不持久),本包任意死法
|
|
4
|
+
# (import 崩/apply 崩/被禁/卸载)下官方 pwsh 链保持启用自服务,系统不出现
|
|
5
|
+
# shell 全灭窗口(不变式与场景见 运行时接管-BDD.md)。主行提供 ctx.shell
|
|
6
|
+
# 执行器、shell 工具与 systemPrompt 段,web 行提供设置页数据通道,guard 行
|
|
7
|
+
# 哨兵自愈(死窗=接管中主行被禁的内存残留)。
|
|
5
8
|
#
|
|
6
9
|
# 平台门控:本包全部 insert 行在非 win32 停用(host 半区 apply 内另有平台早退,
|
|
7
|
-
# 双重防护)
|
|
8
|
-
#
|
|
10
|
+
# 双重防护)。POSIX 官方 bash 链(tool-bash/bash-sandbox)与本包零接触;官方
|
|
11
|
+
# pwsh 两行在 POSIX 本就被 dsh-base 平台表达式停用,Linux 行为与无本包逐字
|
|
12
|
+
# 一致。接管空间判定:官方两行 win32 平台默认 disabled=false(启用),与用户
|
|
13
|
+
# 显式启用在行树不可区分,凡非 true 即接管空间;POSIX 显式启用场景被 apply
|
|
14
|
+
# 平台早退拦截,不会越过宿主平台门控强启官方行。
|
|
9
15
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
16
|
+
# escape hatch(用户想用官方 pwsh 链):market 禁用 shell-select,或 user patch
|
|
17
|
+
# 写 `- id: shell-select / disabled: true`——主行退场后官方行保持启用自服务
|
|
18
|
+
# (接管中被禁由 guard 代挂),重启后官方自然回归;删除禁行重启即恢复接管。
|
|
13
19
|
#
|
|
14
20
|
# 哨兵自愈与复活让位语义逐项同构 packages/dsh-llm-pi-gateway 的 guard/takeover,
|
|
15
21
|
# 差异仅两处:官方代挂对象为 tool-pwsh + pwsh-sandbox 两行;行配置读官方
|
|
16
22
|
# `shell` settings 节(pwsh-sandbox 经其 Config 消费,保持官方 pwshPath 配置)。
|
|
17
23
|
#
|
|
18
|
-
# preset 面:
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
# preset 面:0.1.7 起 agent 面整体移入预设(preset-* 声明行内联 roster,旧
|
|
25
|
+
# agent-presets roots 挂载机制已移除)。本包 patch insert 自带预设声明
|
|
26
|
+
# (standard 全量 − tool-pwsh 行,逐项同构 dsh-web-app presets/standard.patch.yml)
|
|
27
|
+
# 并覆写 agent-preset-registry 的 default——win32 切到本包预设、POSIX 保持
|
|
28
|
+
# standard(本包行在 POSIX 全停用,行为须与上游逐字一致)。用户显式选择恒优先;
|
|
29
|
+
# 上游 standard 漂移由 test/preset-drift.test.mjs 守卫,升级后须对表。
|
|
30
|
+
|
|
31
|
+
# ── 预设面(0.1.7 架构):声明本包预设并接管 default ─────────────────────────
|
|
32
|
+
# 0.1.7 的 agent 面整体移入预设:web 表面在根组合树禁用全部 agent 工具行,
|
|
33
|
+
# 由 preset-* 声明行(@deepseek-ai/dsh-agent-preset,config.plugins 内联 roster)
|
|
34
|
+
# 决定每个会话的工具面。旧架构的 agent-presets 行(roots 目录挂载)已不存在,
|
|
35
|
+
# 覆写它只会得到 "patch: entry not found" 且 default 保持 standard——standard
|
|
36
|
+
# 内联 roster 的 tool-pwsh(win32 启用)即模型工具面,pwsh 未被接管。
|
|
37
|
+
# 收口 = 两段:insert 本包预设声明(standard 全量 − tool-pwsh),覆写
|
|
38
|
+
# agent-preset-registry 的 default(patch 语义为整体替换 config,须逐键重述)。
|
|
39
|
+
# win32 default 切到本包预设;POSIX 保持 standard(本包行在 POSIX 全停用,
|
|
40
|
+
# 行为须与上游逐字一致)。用户显式选择其他预设恒优先;官方 minimal/cordis/ptc
|
|
41
|
+
# 预设自带 persistent pwsh 链,显式选用时不在接管范围(README 已标注)。
|
|
42
|
+
|
|
43
|
+
- insert:
|
|
44
|
+
- id: preset-shell-select
|
|
45
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
46
|
+
disabled: !!js process.platform !== 'win32'
|
|
47
|
+
config:
|
|
48
|
+
id: shell-select
|
|
49
|
+
name: Shell 管理
|
|
50
|
+
order: 2
|
|
51
|
+
plugins:
|
|
52
|
+
- id: persona
|
|
53
|
+
name: '@deepseek-ai/dsh-persona'
|
|
54
|
+
config:
|
|
55
|
+
suffix: Your working directory is {{cwd}}.
|
|
56
|
+
prefix: >-
|
|
57
|
+
You are a coding agent powered by the {{model}} model.
|
|
58
|
+
- id: agent-instructions
|
|
59
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
60
|
+
config:
|
|
61
|
+
maxBytes: 65536
|
|
62
|
+
- id: tool-bash
|
|
63
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
64
|
+
disabled: !!js process.platform === 'win32'
|
|
65
|
+
- id: tool-fs
|
|
66
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
67
|
+
- id: tool-fs-search
|
|
68
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
69
|
+
config:
|
|
70
|
+
sampleOverCapGlobResults: false
|
|
71
|
+
- id: tool-jobs
|
|
72
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
73
|
+
- id: skill-filesystem
|
|
74
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
75
|
+
- id: tool-skill
|
|
76
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
77
|
+
- id: command-goal
|
|
78
|
+
name: '@deepseek-ai/dsh-command-goal'
|
|
79
|
+
- id: tool-goal
|
|
80
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
81
|
+
- id: planning
|
|
82
|
+
name: cordis:group
|
|
83
|
+
group: true
|
|
84
|
+
isolate:
|
|
85
|
+
planMode: true
|
|
86
|
+
config:
|
|
87
|
+
- id: plan-mode
|
|
88
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
89
|
+
config:
|
|
90
|
+
section: |
|
|
91
|
+
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
92
|
+
|
|
93
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
94
|
+
|
|
95
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
96
|
+
|
|
97
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
98
|
+
|
|
99
|
+
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
100
|
+
|
|
101
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
102
|
+
- id: compaction
|
|
103
|
+
name: cordis:group
|
|
104
|
+
group: true
|
|
105
|
+
isolate:
|
|
106
|
+
compaction: true
|
|
107
|
+
toolResultPruner: true
|
|
108
|
+
config:
|
|
109
|
+
- id: compaction-basic
|
|
110
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
111
|
+
- id: command-compact
|
|
112
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
113
|
+
- id: tool-result-pruner
|
|
114
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
115
|
+
config:
|
|
116
|
+
thresholdChars: 8192
|
|
117
|
+
headChars: 4096
|
|
118
|
+
tailChars: 1024
|
|
119
|
+
- id: delegation
|
|
120
|
+
name: cordis:group
|
|
121
|
+
group: true
|
|
122
|
+
isolate:
|
|
123
|
+
workflowEngine: true
|
|
124
|
+
config:
|
|
125
|
+
- id: tool-subagent-control
|
|
126
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
127
|
+
- id: tool-subagent-list-agents
|
|
128
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
129
|
+
- id: tool-subagent
|
|
130
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
131
|
+
config:
|
|
132
|
+
provider: spawn
|
|
133
|
+
toolName: subagent
|
|
134
|
+
modelSelectionSettings: true
|
|
135
|
+
backgroundMode: continuable
|
|
136
|
+
- id: tool-subagent-fork
|
|
137
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
138
|
+
config:
|
|
139
|
+
provider: fork
|
|
140
|
+
toolName: subagent_fork
|
|
141
|
+
backgroundMode: continuable
|
|
142
|
+
- id: tool-subagent-codex
|
|
143
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
144
|
+
disabled: true
|
|
145
|
+
config:
|
|
146
|
+
provider: codex
|
|
147
|
+
toolName: subagent_codex
|
|
148
|
+
backgroundMode: one-shot
|
|
149
|
+
maxDepth: provider-managed
|
|
150
|
+
- id: tool-subagent-claude-code
|
|
151
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
152
|
+
disabled: true
|
|
153
|
+
config:
|
|
154
|
+
provider: claude-code
|
|
155
|
+
toolName: subagent_claude_code
|
|
156
|
+
backgroundMode: one-shot
|
|
157
|
+
maxDepth: provider-managed
|
|
158
|
+
- id: workflow-ptc
|
|
159
|
+
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
160
|
+
config:
|
|
161
|
+
provider: spawn
|
|
162
|
+
- id: tool-workflow
|
|
163
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
164
|
+
- id: tool-ralph
|
|
165
|
+
name: '@deepseek-ai/dsh-tool-ralph'
|
|
166
|
+
disabled: true
|
|
167
|
+
config:
|
|
168
|
+
subagentProvider: spawn
|
|
169
|
+
maxRounds: 64
|
|
170
|
+
- id: tool-ask-user
|
|
171
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
172
|
+
- id: tool-todo
|
|
173
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
174
|
+
config:
|
|
175
|
+
allowParallelInProgress: true
|
|
176
|
+
- id: tool-web
|
|
177
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
178
|
+
config:
|
|
179
|
+
fetch: true
|
|
180
|
+
searchTimeoutMs: 60000
|
|
181
|
+
- id: present
|
|
182
|
+
name: '@deepseek-ai/dsh-tool-present'
|
|
183
|
+
- id: tool-plugin-manager
|
|
184
|
+
name: '@deepseek-ai/dsh-plugin-manager/tools'
|
|
185
|
+
disabled: true
|
|
186
|
+
|
|
187
|
+
- id: agent-preset-registry
|
|
37
188
|
config:
|
|
38
189
|
default: !!js "process.platform === 'win32' ? 'shell-select' : 'standard'"
|
|
39
|
-
roots:
|
|
40
|
-
- path: !!js decodeURIComponent(new URL('node_modules/@mzzsfy/dsh-shell-select/presets/', ctx.baseUrl).pathname).replace(/^\/([A-Za-z]:)/, '$1')
|
|
41
190
|
|
|
42
191
|
- insert:
|
|
43
192
|
- id: shell-select
|
|
@@ -46,3 +195,6 @@
|
|
|
46
195
|
- id: shell-select/guard
|
|
47
196
|
name: '@mzzsfy/dsh-shell-select/guard'
|
|
48
197
|
disabled: !!js process.platform !== 'win32'
|
|
198
|
+
- id: shell-select/web
|
|
199
|
+
name: '@mzzsfy/dsh-shell-select/web'
|
|
200
|
+
disabled: !!js process.platform !== 'win32'
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mzzsfy/dsh-shell-select",
|
|
3
3
|
"description": "Windows shell 接管:替换默认 pwsh 工具为可配置多客户端的 shell 工具(git bash/WSL/cmd/pwsh,自定义路径,默认客户端,模型按名选择)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "src/
|
|
6
|
+
"main": "src/index.js",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./src/
|
|
8
|
+
".": "./src/index.js",
|
|
9
|
+
"./executor": "./src/executor.mjs",
|
|
9
10
|
"./guard": "./src/guard.js",
|
|
11
|
+
"./web": "./src/web-routes.mjs",
|
|
10
12
|
"./client": "./src/client.js",
|
|
11
13
|
"./package.json": "./package.json"
|
|
12
14
|
},
|
|
@@ -23,7 +25,8 @@
|
|
|
23
25
|
"@deepseek-ai/dsh-client-ui-primitives",
|
|
24
26
|
"@deepseek-ai/dsh-client-ui-conversation"
|
|
25
27
|
]
|
|
26
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"hostMin": "0.1.7-rc.1"
|
|
27
30
|
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"test": "node --test \"test/*.test.mjs\"",
|
|
@@ -39,27 +42,30 @@
|
|
|
39
42
|
},
|
|
40
43
|
"peerDependencies": {
|
|
41
44
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
45
|
+
"@deepseek-ai/dsh-agent-preset": ">=0.1.7-rc.1",
|
|
42
46
|
"@deepseek-ai/dsh-http-proxy": ">=0.1.5-rc.2",
|
|
43
47
|
"@deepseek-ai/dsh-jobs": ">=0.1.5-rc.2",
|
|
44
48
|
"@deepseek-ai/dsh-llm": ">=0.1.5-rc.2",
|
|
45
49
|
"@deepseek-ai/dsh-sandbox": ">=0.1.5-rc.2",
|
|
50
|
+
"@deepseek-ai/dsh-settings": ">=0.1.7-rc.1",
|
|
46
51
|
"@deepseek-ai/dsh-shell": ">=0.1.5-rc.2",
|
|
47
52
|
"@deepseek-ai/dsh-subprocess": ">=0.1.5-rc.2",
|
|
48
53
|
"@deepseek-ai/dsh-timeout": ">=0.1.5-rc.2",
|
|
49
54
|
"@deepseek-ai/dsh-tools": ">=0.1.5-rc.2",
|
|
50
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
55
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
51
56
|
},
|
|
52
57
|
"devDependencies": {
|
|
53
58
|
"@deepseek-ai/cordis": "4.0.2",
|
|
54
|
-
"@deepseek-ai/dsh-http-proxy": "0.1.5-rc.2",
|
|
55
|
-
"@deepseek-ai/dsh-jobs": "0.1.5-rc.2",
|
|
56
|
-
"@deepseek-ai/dsh-llm": "0.1.5-rc.2",
|
|
57
|
-
"@deepseek-ai/dsh-sandbox": "0.1.5-rc.2",
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
59
|
+
"@deepseek-ai/dsh-http-proxy": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
60
|
+
"@deepseek-ai/dsh-jobs": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
61
|
+
"@deepseek-ai/dsh-llm": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
62
|
+
"@deepseek-ai/dsh-sandbox": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
63
|
+
"@deepseek-ai/dsh-scope": "0.1.5-rc.2",
|
|
64
|
+
"@deepseek-ai/dsh-shell": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
65
|
+
"@deepseek-ai/dsh-subprocess": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
66
|
+
"@deepseek-ai/dsh-timeout": "0.1.5-rc.2 || 0.1.5-rc.3",
|
|
61
67
|
"@deepseek-ai/dsh-tools": "0.1.5-rc.2",
|
|
62
|
-
"@deepseek-ai/schemastery": "3.18.
|
|
68
|
+
"@deepseek-ai/schemastery": "3.18.4",
|
|
63
69
|
"js-yaml": "4.3.2"
|
|
64
70
|
},
|
|
65
71
|
"files": [
|
package/src/apply-state.mjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// apply 生命周期旗标:guard 据此识别本行功能性停摆。
|
|
2
2
|
// pending = apply 进行中或中途崩溃;active = 全部装配落定;inactive = 声明式早退。
|
|
3
3
|
// 中途崩溃停留 pending,guard 对 pending 保守不代挂(不越权重启他人)。
|
|
4
|
+
// takeoverTrace 记录运行时接管序列的事件轨迹(guard-status 只读暴露,排障用),
|
|
5
|
+
// append 式:决策/禁用/退场/挂载/回滚各节点一行,每次 apply 重置。
|
|
4
6
|
|
|
5
7
|
let state = 'pending'
|
|
8
|
+
let takeoverTrace = []
|
|
6
9
|
|
|
7
10
|
export function beginShellSelectApply() {
|
|
8
11
|
state = 'pending'
|
|
12
|
+
takeoverTrace = []
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
export function endShellSelectApplyActive() {
|
|
@@ -19,3 +23,12 @@ export function endShellSelectApplyInactive() {
|
|
|
19
23
|
export function shellSelectApplyState() {
|
|
20
24
|
return state
|
|
21
25
|
}
|
|
26
|
+
|
|
27
|
+
export function recordTakeover(event) {
|
|
28
|
+
takeoverTrace = [...takeoverTrace, { at: new Date().toISOString(), ...event }]
|
|
29
|
+
if (takeoverTrace.length > 32) takeoverTrace = takeoverTrace.slice(-32)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function shellSelectTakeoverTrace() {
|
|
33
|
+
return takeoverTrace
|
|
34
|
+
}
|