@morlay/session-mode-profile 0.0.1-alpha.2
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/LICENSE +21 -0
- package/README.md +34 -0
- package/cordis.patch.yml +227 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +53 -0
- package/src/index.ts +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 morlay
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @morlay/session-mode-profile
|
|
2
|
+
|
|
3
|
+
会话模式与注入面:**一次装齐五块**——本部署自己的 agent preset 声明、会话模式行(各模式的会话级扩展定义)、
|
|
4
|
+
subagent 服务接管行、注入通道与它的收口行、工具说明(汉化 + 用法分组)。
|
|
5
|
+
|
|
6
|
+
| 装什么 | 数据从哪来 |
|
|
7
|
+
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
8
|
+
| `preset-mode-switch`(本部署的 agent preset) | [`@morlay/dsh-agent-toolkit/rows`](../../profile/dsh-agent-toolkit/src/rows.ts) 的 `TOOLKIT_PRESET_ROWS` |
|
|
9
|
+
| `session-mode`(模式定义 + `preset` 映射) | [`@morlay/dsh-session-mode/rows`](../../profile/dsh-session-mode/src/rows.ts) |
|
|
10
|
+
| subagent 行(禁官方行 + 插 `subagent-fork`) | [`@morlay/dsh-subagent/rows`](../../subagent/dsh-subagent/src/rows.ts) |
|
|
11
|
+
| `context-assembler` + `context-assembler-scope` | [`@morlay/dsh-context-assembler/rows`](../../context/dsh-context-assembler/src/rows.ts) |
|
|
12
|
+
| 官方 roster 保留(不再禁 `ui-agent-preset`) | 我们的模式入口挂在会话头部工具槽位(list),两套并存 |
|
|
13
|
+
| `tool-guidance`(汉化 + 用法分组) | [`@morlay/dsh-agent-toolkit/rows`](../../profile/dsh-agent-toolkit/src/rows.ts) |
|
|
14
|
+
|
|
15
|
+
行清单只有一份真源:数据住在能力包里,本包只把它们的 `rows` 出口按装配顺序展开(`tsdown.config.ts`)。
|
|
16
|
+
|
|
17
|
+
**一个 preset,两个模式**:`coding` / `chat` 都挂 `preset-mode-switch`(`config.id` 就是会话里记的身份),
|
|
18
|
+
差异全由**会话级收口**表达(persona / `allowTools` / `instructions` / `runtimeContext`)。行清单里
|
|
19
|
+
**不放注入面**:`agent-instructions` 与 `tool-skill` 由通道提供,`tool-guidance` 是 host 平面行
|
|
20
|
+
(它往通道这个 host 单例注册用法正文,两个平面各一份会互相顶掉)。新会话的默认 preset 在配置层指向它
|
|
21
|
+
([`@morlay/mydsh-profile`](../mydsh-profile/README.md) 的 `agent-preset-registry.default`)。
|
|
22
|
+
理由与代价见 [ADR-自己注册preset](./.agents/adrs/20260929-自己注册preset.md)。
|
|
23
|
+
|
|
24
|
+
**注入面按会话判归谁**:`context-assembler` 这一行装的是通道本体 + `agent-instructions` + `skill-catalog`,
|
|
25
|
+
两条面方向相反——
|
|
26
|
+
|
|
27
|
+
- **工作区指令让位**:官方 `standard` / `ptc` / `cordis` 的 preset 自带 `@deepseek-ai/dsh-agent-instructions`,
|
|
28
|
+
那些会话的工作区指令由 preset 提供;`preset-mode-switch` 的行清单里没有那一行,两个模式的会话都由这一行提供。
|
|
29
|
+
- **skill 面由通道提供**:`skill` 工具按会话注册进 agent 自己那一层,遮蔽 preset 的 `@deepseek-ai/dsh-tool-skill`
|
|
30
|
+
那一份(官方 preset 会话如此;我们自己的行清单里没有上游那一行),目录也由我们发布。
|
|
31
|
+
|
|
32
|
+
模式开关(`instructions: false`)只收得住这一行这一侧;官方 preset 自带的注入在它之外,所以切模式时官方
|
|
33
|
+
preset 该换还是要换(`SessionModes.select` 只在目标与当前不同时才换)。理由与上游判据见
|
|
34
|
+
[ADR-工作区指令让位skill面由通道抢面](../../context/dsh-context-assembler/.agents/adrs/20260929-工作区指令让位skill面由通道抢面.md)。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# 本文件由 packages/bundles/session-mode-profile/tsdown.config.ts 生成,请勿手工编辑
|
|
2
|
+
- insert:
|
|
3
|
+
- id: ui-primitives-fork
|
|
4
|
+
name: "@morlay/dsh-client-ui-primitives"
|
|
5
|
+
- insert:
|
|
6
|
+
- id: preset-mode-switch
|
|
7
|
+
name: "@deepseek-ai/dsh-agent-preset"
|
|
8
|
+
config:
|
|
9
|
+
id: mode-switch
|
|
10
|
+
name: 手动切换模式
|
|
11
|
+
description: 本部署的行清单:两个会话模式共享它,差异由会话级收口(提示词 / 工具白名单 / 注入开关)决定。
|
|
12
|
+
order: 5
|
|
13
|
+
plugins:
|
|
14
|
+
- id: toolkit-ask
|
|
15
|
+
name: cordis:group
|
|
16
|
+
group: true
|
|
17
|
+
config:
|
|
18
|
+
- id: tool-ask-user
|
|
19
|
+
name: "@deepseek-ai/dsh-tool-ask-user"
|
|
20
|
+
- id: toolkit-delegation
|
|
21
|
+
name: cordis:group
|
|
22
|
+
group: true
|
|
23
|
+
config:
|
|
24
|
+
- id: tool-subagent-control
|
|
25
|
+
name: "@deepseek-ai/dsh-tool-subagent-control"
|
|
26
|
+
- id: tool-subagent-list-agents
|
|
27
|
+
name: "@deepseek-ai/dsh-tool-subagent-control/list-agents"
|
|
28
|
+
- id: tool-subagent
|
|
29
|
+
name: "@deepseek-ai/dsh-tool-subagent"
|
|
30
|
+
config:
|
|
31
|
+
provider: spawn
|
|
32
|
+
toolName: subagent
|
|
33
|
+
backgroundMode: continuable
|
|
34
|
+
- id: tool-subagent-fork
|
|
35
|
+
name: "@deepseek-ai/dsh-tool-subagent"
|
|
36
|
+
config:
|
|
37
|
+
provider: fork
|
|
38
|
+
toolName: subagent_fork
|
|
39
|
+
backgroundMode: continuable
|
|
40
|
+
- id: workflow-ptc
|
|
41
|
+
name: "@deepseek-ai/dsh-workflow-ptc"
|
|
42
|
+
config:
|
|
43
|
+
provider: spawn
|
|
44
|
+
- id: tool-workflow
|
|
45
|
+
name: "@deepseek-ai/dsh-tool-workflow"
|
|
46
|
+
isolate:
|
|
47
|
+
workflowEngine: true
|
|
48
|
+
- id: toolkit-flow
|
|
49
|
+
name: cordis:group
|
|
50
|
+
group: true
|
|
51
|
+
config:
|
|
52
|
+
- id: tool-todo
|
|
53
|
+
name: "@deepseek-ai/dsh-tool-todo"
|
|
54
|
+
config:
|
|
55
|
+
allowParallelInProgress: true
|
|
56
|
+
- id: command-goal
|
|
57
|
+
name: "@deepseek-ai/dsh-command-goal"
|
|
58
|
+
- id: tool-goal
|
|
59
|
+
name: "@deepseek-ai/dsh-tool-goal"
|
|
60
|
+
- id: present
|
|
61
|
+
name: "@deepseek-ai/dsh-tool-present"
|
|
62
|
+
- id: toolkit-fs
|
|
63
|
+
name: cordis:group
|
|
64
|
+
group: true
|
|
65
|
+
config:
|
|
66
|
+
- id: tool-fs
|
|
67
|
+
name: "@deepseek-ai/dsh-tool-fs"
|
|
68
|
+
- id: tool-fs-search
|
|
69
|
+
name: "@deepseek-ai/dsh-tool-fs-search"
|
|
70
|
+
config:
|
|
71
|
+
sampleOverCapGlobResults: false
|
|
72
|
+
- id: toolkit-shell
|
|
73
|
+
name: cordis:group
|
|
74
|
+
group: true
|
|
75
|
+
config:
|
|
76
|
+
- id: tool-bash
|
|
77
|
+
name: "@deepseek-ai/dsh-tool-bash"
|
|
78
|
+
disabled: !!js process.platform==="win32"
|
|
79
|
+
- id: tool-pwsh
|
|
80
|
+
name: "@deepseek-ai/dsh-tool-pwsh"
|
|
81
|
+
disabled: !!js process.platform!=="win32"
|
|
82
|
+
- id: tool-jobs
|
|
83
|
+
name: "@deepseek-ai/dsh-tool-jobs"
|
|
84
|
+
- id: toolkit-skill
|
|
85
|
+
name: cordis:group
|
|
86
|
+
group: true
|
|
87
|
+
config:
|
|
88
|
+
- id: skill-filesystem
|
|
89
|
+
name: "@deepseek-ai/dsh-skill-filesystem"
|
|
90
|
+
- id: toolkit-web
|
|
91
|
+
name: cordis:group
|
|
92
|
+
group: true
|
|
93
|
+
config:
|
|
94
|
+
- id: tool-web
|
|
95
|
+
name: "@deepseek-ai/dsh-tool-web"
|
|
96
|
+
config:
|
|
97
|
+
fetch: true
|
|
98
|
+
searchTimeoutMs: 60000
|
|
99
|
+
- id: compaction
|
|
100
|
+
name: cordis:group
|
|
101
|
+
group: true
|
|
102
|
+
config:
|
|
103
|
+
- id: compaction-basic
|
|
104
|
+
name: "@deepseek-ai/dsh-compaction-basic"
|
|
105
|
+
- id: command-compact
|
|
106
|
+
name: "@deepseek-ai/dsh-command-compact"
|
|
107
|
+
- id: tool-result-pruner
|
|
108
|
+
name: "@deepseek-ai/dsh-compaction-tool-result-pruner"
|
|
109
|
+
config:
|
|
110
|
+
thresholdChars: 8192
|
|
111
|
+
headChars: 4096
|
|
112
|
+
tailChars: 1024
|
|
113
|
+
isolate:
|
|
114
|
+
compaction: true
|
|
115
|
+
toolResultPruner: true
|
|
116
|
+
- id: planning
|
|
117
|
+
name: cordis:group
|
|
118
|
+
group: true
|
|
119
|
+
config:
|
|
120
|
+
- id: plan-mode
|
|
121
|
+
name: "@deepseek-ai/dsh-plan-mode"
|
|
122
|
+
config:
|
|
123
|
+
section: |-
|
|
124
|
+
你处于计划模式。在 exit_plan_mode 成功、或用户切换会话模式之前,一直留在计划模式。
|
|
125
|
+
|
|
126
|
+
先探索:用非破坏性的读、搜索、静态分析与检查,把计划落到真实仓库上。不要做任何写操作——不改文件、不改配置、不跑会重写被跟踪文件的格式化或代码生成、不提交,也不要把计划执行掉。优先用仓库里已有的函数与写法,不要新造机制。
|
|
127
|
+
|
|
128
|
+
用户的对话式同意(包括对你自己提问的肯定回答)不构成批准,也不结束计划模式;把确认到的决定并进计划里。
|
|
129
|
+
|
|
130
|
+
工具目录在模式之间保持一致(请求缓存稳定),所以这些规则压过任何后续工具说明或用法正文里“去改文件”的建议;那些工具仍列在目录里,只是这一步不能用。不要用 todo_write 跟踪规划阶段:它跟的是批准之后的实施,计划本身归 exit_plan_mode。
|
|
131
|
+
|
|
132
|
+
能自己查清的事实自己查。只有用户拥有的选择、或检查无法回答的实质歧义才用 ask_user_question;不要问代码在哪、现在怎么跑这类自己能查明的问题。
|
|
133
|
+
|
|
134
|
+
计划要决策完备:目标与成功判据;按子系统分组的改动;公共 API、schema 与数据流的变化;边界情况与失败模式;测试与验收判据;显式假设。可审即可,不必长到别人照它实现还要自己做设计决定。
|
|
135
|
+
|
|
136
|
+
就绪时调 exit_plan_mode,正文是完整的计划 markdown(以 # 标题开头),并让它成为那一条回复里唯一且最后的工具调用:它把计划交出去等批准,实施只在批准之后的步骤里开始。不要把最终计划当普通回复贴出来,也不要用散文或 ask_user_question 问“要不要继续”。评审驳回就吸收反馈重新提交;评审通道不可用或被中断时留在计划模式、让用户手动切模式,不要自己往下做。
|
|
137
|
+
isolate:
|
|
138
|
+
planMode: true
|
|
139
|
+
- id: fs-intent-relax
|
|
140
|
+
name: "@morlay/dsh-agent-toolkit/relax-intent"
|
|
141
|
+
- insert:
|
|
142
|
+
- id: session-mode
|
|
143
|
+
name: "@morlay/dsh-session-mode"
|
|
144
|
+
config:
|
|
145
|
+
default: coding
|
|
146
|
+
modes:
|
|
147
|
+
coding:
|
|
148
|
+
preset: mode-switch
|
|
149
|
+
name: 编码模式
|
|
150
|
+
description: 功能完整的编码 Agent:文件、Shell、检索、联网等工具常驻,其余用法说明按需加载。
|
|
151
|
+
role:
|
|
152
|
+
- main
|
|
153
|
+
- subagent
|
|
154
|
+
persona:
|
|
155
|
+
prefix: |-
|
|
156
|
+
你是一个经验丰富的编程专家,YAGNI 是你的编程哲学,PDCA 是你的行为规范。
|
|
157
|
+
全程用中文(专有名词除外),包括但不限于思考,回答,工具描述,subagent 提示词;思考不要陷入重复循环,一旦循环立即退出;思考聚焦需求理解与方案设计,不预演具体代码实现,正确性由验证环节确认。
|
|
158
|
+
suffix: 你的工作目录在 `{{cwd}}`
|
|
159
|
+
allowTools:
|
|
160
|
+
- ask_user_question
|
|
161
|
+
- subagent
|
|
162
|
+
- subagent_fork
|
|
163
|
+
- list_subagent_models
|
|
164
|
+
- workflow
|
|
165
|
+
- todo_write
|
|
166
|
+
- exit_plan_mode
|
|
167
|
+
- get_goal
|
|
168
|
+
- create_goal
|
|
169
|
+
- update_goal
|
|
170
|
+
- present
|
|
171
|
+
- read
|
|
172
|
+
- write
|
|
173
|
+
- edit
|
|
174
|
+
- glob
|
|
175
|
+
- grep
|
|
176
|
+
- read_image
|
|
177
|
+
- bash
|
|
178
|
+
- pwsh
|
|
179
|
+
- job_output
|
|
180
|
+
- job_list
|
|
181
|
+
- job_kill
|
|
182
|
+
- skill
|
|
183
|
+
- spawn_teammate
|
|
184
|
+
- send_message
|
|
185
|
+
- list_agents
|
|
186
|
+
- wait_agent
|
|
187
|
+
- interrupt_agent
|
|
188
|
+
- team_task_create
|
|
189
|
+
- team_task_list
|
|
190
|
+
- team_task_get
|
|
191
|
+
- team_task_update
|
|
192
|
+
- web_fetch
|
|
193
|
+
- web_search
|
|
194
|
+
chat:
|
|
195
|
+
preset: mode-switch
|
|
196
|
+
name: 对话模式
|
|
197
|
+
description: 只做对话:提问与联网(搜索、抓取)三件工具,不注入系统提示词、工作区指令与技能目录。
|
|
198
|
+
role:
|
|
199
|
+
- main
|
|
200
|
+
persona:
|
|
201
|
+
prefix: 你是一个助手。全程用中文(专有名词除外),包括但不限于思考,回答,工具描述;思考不要陷入重复循环,一旦循环立即退出。
|
|
202
|
+
allowTools:
|
|
203
|
+
- ask_user_question
|
|
204
|
+
- web_search
|
|
205
|
+
- web_fetch
|
|
206
|
+
instructions: false
|
|
207
|
+
runtimeContext: false
|
|
208
|
+
- insert:
|
|
209
|
+
- id: subagent
|
|
210
|
+
name: "@morlay/dsh-subagent"
|
|
211
|
+
config:
|
|
212
|
+
localizedReturnGuidancePresets:
|
|
213
|
+
- mode-switch
|
|
214
|
+
- insert:
|
|
215
|
+
- id: context-assembler
|
|
216
|
+
name: "@morlay/dsh-context-assembler"
|
|
217
|
+
config:
|
|
218
|
+
capabilities:
|
|
219
|
+
- assembler
|
|
220
|
+
- agent-instructions
|
|
221
|
+
- skill-catalog
|
|
222
|
+
- insert:
|
|
223
|
+
- id: context-assembler-scope
|
|
224
|
+
name: "@morlay/dsh-context-assembler/scope"
|
|
225
|
+
- insert:
|
|
226
|
+
- id: tool-guidance
|
|
227
|
+
name: "@morlay/dsh-agent-toolkit/guidance"
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Session Modes & Injection",
|
|
4
|
+
"description": "Session modes (coding / chat, each riding one official preset) plus the injection channel, tool guidance (localized copy, usage groups) and the subagent takeover rows; the official roster is turned off."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@morlay/session-mode-profile",
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
|
+
"description": "会话模式与注入面:会话模式行 + 注入通道 + 工具说明(汉化)+ subagent 服务接管行,一次装齐。",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bundle-entry",
|
|
7
|
+
"dsh",
|
|
8
|
+
"dsh-bundle"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/morlay/dsh-plugin.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"locale/*.json",
|
|
17
|
+
"dist",
|
|
18
|
+
"src",
|
|
19
|
+
"cordis.patch.yml",
|
|
20
|
+
"!**/__tests__"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./dist/index.mjs",
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
27
|
+
"./locale/*.json": "./locale/*.json"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@morlay/dsh-agent-toolkit": "0.0.1-alpha.4",
|
|
31
|
+
"@morlay/dsh-client-ui-primitives": "0.0.2-alpha.9",
|
|
32
|
+
"@morlay/dsh-context-assembler": "0.0.1-alpha.4",
|
|
33
|
+
"@morlay/dsh-session-mode": "0.0.1-alpha.5",
|
|
34
|
+
"@morlay/dsh-subagent": "0.0.1-alpha.3"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@deepseek-ai/cordis-plugin-include": "1.0.9",
|
|
38
|
+
"@local/devkit": "0.1.0",
|
|
39
|
+
"@types/js-yaml": "^4.0.9",
|
|
40
|
+
"js-yaml": "^4.1.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@deepseek-ai/cordis": "^4.0.4"
|
|
44
|
+
},
|
|
45
|
+
"dsh": {
|
|
46
|
+
"bundle": {
|
|
47
|
+
"patch": "./cordis.patch.yml"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "pnpm exec tsdown"
|
|
52
|
+
}
|
|
53
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|