@morlay/dsh-preset 0.0.3 → 0.0.5
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 +75 -16
- package/cordis.patch.yml +37 -11
- package/package.json +6 -2
- package/src/__tests__/generated-presets.spec.ts +2 -2
- package/src/__tests__/patch.spec.ts +96 -0
- package/tool/generate-presets.ts +2 -2
package/README.md
CHANGED
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
## 内容
|
|
8
8
|
|
|
9
|
-
| 文件 | 作用
|
|
10
|
-
| -------------------------- |
|
|
11
|
-
| `cordis.patch.yml` | bundle patch:禁用官方 preset、注册本包 preset 为默认、声明个人 `llm-pi-ai` route |
|
|
12
|
-
| `tool/generate-presets.ts` | 从上游生成 preset 的模块 + tsdown hooks
|
|
13
|
-
| `dist/presets/standard/` | 构建产物:自定义 preset「标准模式」(由上游 `standard` 生成)
|
|
14
|
-
| `dist/presets/ptc/` | 构建产物:自定义 preset「PTC 模式」(由上游 `ptc` 生成)
|
|
9
|
+
| 文件 | 作用 |
|
|
10
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `cordis.patch.yml` | bundle patch:禁用官方 preset、注册本包 preset 为默认、声明个人 `llm-pi-ai` route、覆盖沙箱规则、插入 `prompt-reminder` 行 |
|
|
12
|
+
| `tool/generate-presets.ts` | 从上游生成 preset 的模块 + tsdown hooks |
|
|
13
|
+
| `dist/presets/standard/` | 构建产物:自定义 preset「标准模式」(由上游 `standard` 生成) |
|
|
14
|
+
| `dist/presets/ptc/` | 构建产物:自定义 preset「PTC 模式」(由上游 `ptc` 生成) |
|
|
15
|
+
|
|
16
|
+
`cordis.patch.yml` 里插入的 `prompt-reminder`(`@morlay/dsh-prompt-reminder`)把被
|
|
17
|
+
裁掉的系统提示词 section 降级为 `<system-reminder>` user 消息,见「工具说明降级为
|
|
18
|
+
reminder」。
|
|
15
19
|
|
|
16
20
|
## 禁用官方 preset
|
|
17
21
|
|
|
@@ -69,11 +73,40 @@ section 在插件构造时注册;dev 模式重启 `just custom dev`/`just cust
|
|
|
69
73
|
roster(id 沿用官方名以走客户端语言字典),以及桌面形态下 preset 必须落在 dsh 包的
|
|
70
74
|
`config/agent-presets` 挂载点(见 dsh-desktopify 的 `dsh.desktop.agentPresets`)。
|
|
71
75
|
|
|
76
|
+
## 工具说明降级为 reminder,不进系统提示词
|
|
77
|
+
|
|
78
|
+
上游把每个工具的跨调用说明(`tool:bash`、`tool:read`、…)、Agent Teams 协作规则、
|
|
79
|
+
harness 源码位置、Web GUI 说明都注册成系统提示词的 section。本部署实测它们占
|
|
80
|
+
9200 字符里的约 7400:条数多、篇幅大、挤在上下文最前面,稀释真正要遵守的那几行
|
|
81
|
+
纪律。`cordis.patch.yml` 因此在 host plane 插一行:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
- insert:
|
|
85
|
+
- id: prompt-reminder
|
|
86
|
+
name: "@morlay/dsh-prompt-reminder"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
一处定义覆盖全部 preset(standard / ptc 以及后续新增的)——这是与具体 preset 无关
|
|
90
|
+
的部署级策略,preset composition 不各自带这一行,生成器也就不必碰它。该插件注册
|
|
91
|
+
在 root scope,会收到每个 agent 的装配与 pre-step 事件(含子 agent):
|
|
92
|
+
|
|
93
|
+
- 装配(`system-prompt/assemble` 瀑布)时保留 `keep` 名单——默认是部署级
|
|
94
|
+
`deployment:persona-prefix` / `deployment:persona-suffix`——内的 section,其余
|
|
95
|
+
非空 section 从 assembly 移除并按 order 捕获文本;
|
|
96
|
+
- pre-step 时把捕获的文本作为一条 `<system-reminder>` user 消息注入,紧随本轮
|
|
97
|
+
用户消息之后;文本不变不重复注入,`plan:policy` / `tools:ptc-only` 这类按模式
|
|
98
|
+
渲染的 section 变化时追加一条新的全量 reminder(首行声明最新一条覆盖更早的)。
|
|
99
|
+
|
|
100
|
+
于是系统提示词只剩首尾两段个人提示词,其余内容仍在上下文里、但不再占系统提示词
|
|
101
|
+
的位置,也不再随模式切换改动。**为什么不用 `persona` 行的 `complete: true`**:那会
|
|
102
|
+
连 suffix 一起丢,且子 agent 自己注册同名 persona 时 `complete` 语义消失,保留 /
|
|
103
|
+
降级会不一致;本插件按 `keep` 名单匹配 section 名,两种 agent 行为一致。完整行为与
|
|
104
|
+
配置见 `packages/preset/dsh-prompt-reminder/README.md`。
|
|
105
|
+
|
|
72
106
|
## 工作区指令走官方行为,候选收紧为 AGENTS 系列
|
|
73
107
|
|
|
74
|
-
preset 里的 `agent-instructions`
|
|
75
|
-
|
|
76
|
-
仍按官方语义作为 user 消息注入一次。生成器只覆盖该行 config 的两个字段:
|
|
108
|
+
preset 里的 `agent-instructions` 行是官方 `@deepseek-ai/dsh-agent-instructions`:
|
|
109
|
+
baseline 按官方语义作为 user 消息注入一次。生成器只覆盖该行 config 的两个字段:
|
|
77
110
|
|
|
78
111
|
```yaml
|
|
79
112
|
instructionFileCandidates: ["AGENTS.md"] # 上游默认 ['AGENTS.md','CLAUDE.md']
|
|
@@ -82,8 +115,10 @@ localInstructionFileCandidates: ["AGENTS.local.md"] # 上游默认还含 CLAUDE.
|
|
|
82
115
|
|
|
83
116
|
即**不读 CLAUDE 系列**(本部署不需要 CLAUDE 兼容);`maxBytes` 等其余字段跟随上游。
|
|
84
117
|
|
|
85
|
-
|
|
86
|
-
|
|
118
|
+
本仓库曾有一个把 baseline 落点改成 system-prompt section 的 fork
|
|
119
|
+
(`@morlay/dsh-agent-instructions-as-prompt`),一直未接入默认打包;提示词分层定为
|
|
120
|
+
「系统提示词只留 persona、其余走 reminder」之后它已删除——baseline 留在 user 消息
|
|
121
|
+
通道与这个分层一致。
|
|
87
122
|
|
|
88
123
|
## preset 由构建生成,不是手工副本
|
|
89
124
|
|
|
@@ -102,10 +137,11 @@ pnpm --filter @morlay/dsh-preset run generate-presets [outDir]
|
|
|
102
137
|
```
|
|
103
138
|
|
|
104
139
|
脚本把上游 composition 当**数据**读入:`js-yaml` 用 include 的
|
|
105
|
-
`entryListSchema` 解析(`!!js` 标签保留为表达式节点)→ 在 JS
|
|
106
|
-
`persona`
|
|
107
|
-
|
|
108
|
-
persona
|
|
140
|
+
`entryListSchema` 解析(`!!js` 标签保留为表达式节点)→ 在 JS 里改三处(删掉
|
|
141
|
+
`persona` 行、把 `agent-instructions` 行的候选收紧为 AGENTS 系列、插入
|
|
142
|
+
`prompt-reminder` 行)→ `dump` 回 YAML。因此上游任何结构性改动(新增 / 重命名
|
|
143
|
+
row、改字段)都自动跟随,不依赖易碎的文本锚点;上游若删掉 `persona` 行,目标
|
|
144
|
+
(preset 不自带 persona)本就达成,脚本照常通过。
|
|
109
145
|
|
|
110
146
|
脚本先**整目录清空**输出目录再生成:产物完全派生自脚本,残留目录(改过
|
|
111
147
|
`source`、旧命名)不该留下——否则 discovery 会把它们当有效 preset 扫出来。
|
|
@@ -118,7 +154,23 @@ persona)本就达成,脚本照常通过。
|
|
|
118
154
|
|
|
119
155
|
1. 升级 `DEEPSEEK_HARNESS_VERSION` 并 sync/patch/build。
|
|
120
156
|
2. `pnpm --filter @morlay/dsh-preset run build`(build:done 会重新生成)
|
|
121
|
-
3. `pnpm exec vitest run packages/preset
|
|
157
|
+
3. `pnpm exec vitest run packages/preset` 确认无 drift(含 reminder 插件的行为测试)。
|
|
158
|
+
|
|
159
|
+
## 沙箱装配与规则(部署级)
|
|
160
|
+
|
|
161
|
+
本 bundle 的 `cordis.patch.yml` 里一次做完三件事:禁用官方 `sandbox` / `fs-sandbox`
|
|
162
|
+
两行、插入 `- id: sandbox-local` 行、写上 `rw` / `r-` / `--` 条目(唯一真源,本 README
|
|
163
|
+
不复制一份以免两处漂移);条目语法、优先级与各平台表达能力见
|
|
164
|
+
[`@morlay/dsh-sandbox-local` 的 README](../../sandbox/dsh-sandbox-local/README.md)。
|
|
165
|
+
|
|
166
|
+
放本 bundle 而不是示例 app 的 `cordis.patch.yml`:bundle patch 在 dev(web / desktop)
|
|
167
|
+
与打包形态都会应用,app 的 patch 只在打包时作为 seed 的 profile patch 生效。
|
|
168
|
+
|
|
169
|
+
两个前置条件:
|
|
170
|
+
|
|
171
|
+
- **本包的 `dependencies` 必须声明 `@morlay/dsh-sandbox-local`**:插入行的 `name` 要能在
|
|
172
|
+
profile 的依赖树里解析(profile 的 `nodeLinker: hoisted` 由本包的依赖把它带进去)。
|
|
173
|
+
- **规则变化要重启**:profile 在启动时装载,`access` 在插件构造时解析(模板也是)。
|
|
122
174
|
|
|
123
175
|
## 装配
|
|
124
176
|
|
|
@@ -159,6 +211,13 @@ profile 里把内容物化到该挂载点;`includeShippedRoot: false` 两种
|
|
|
159
211
|
## 维护注意
|
|
160
212
|
|
|
161
213
|
- `package.json` 的 `files` 必须含 `dist`(preset 在其中)与 `tool`,否则发布产物缺内容。
|
|
214
|
+
- `cordis.patch.yml` 插入的 `@morlay/dsh-prompt-reminder` 必须能被 **profile** 的依赖
|
|
215
|
+
树解析:示例 app 已在 `dependencies` 声明;换工作区时要一并声明,否则该行加载失败、
|
|
216
|
+
工具说明会留在系统提示词里。
|
|
217
|
+
- 沙箱装配(禁用官方两行 + 插入 `sandbox-local` 行 + 规则)全在本 bundle 的 patch 里,
|
|
218
|
+
app 的 `dsh.profile.bundles` 不需要额外列 `@morlay/dsh-sandbox-local`;
|
|
219
|
+
`@morlay/dsh-sandbox-local` 自带的 bundle patch 供把该包作为独立 bundle 采用的部署
|
|
220
|
+
使用,与本 bundle 同时上线会重复插入同一行。
|
|
162
221
|
- 生成器显式设 `quotingType: '"'`:`yaml.dump` 默认单引号而仓库 oxfmt 偏好双引号,
|
|
163
222
|
不指定会让生成器与 formatter 来回改;产物在 gitignore 的 dist 里,本就不参与 fmt。
|
|
164
223
|
- **dev 模式需要先构建**:`just dev` / `just desktop` / `just bundle` 都先跑
|
package/cordis.patch.yml
CHANGED
|
@@ -2,21 +2,16 @@
|
|
|
2
2
|
config:
|
|
3
3
|
includeHarnessIdentity: false
|
|
4
4
|
includeRuntimeContext: false
|
|
5
|
-
personaSuffix:
|
|
5
|
+
personaSuffix: |-
|
|
6
|
+
你的工作目录在 `{{cwd}}`,工作目录内的 AGENTS.md 的规则非常重要,必须严格遵守
|
|
6
7
|
personaPrefix: |-
|
|
7
8
|
你是一个经验丰富的编程专家,YAGNI 是你的编程哲学,PDCA 是你的行为规范
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## 语言和行为
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
- **全局提示词**:
|
|
15
|
-
- 所有思考、分析、推理过程、工具调用描述等必须使用中文,专有名词除外
|
|
16
|
-
- 思考不要陷入重复循环,一旦循环,立即退出
|
|
17
|
-
- 思考聚焦需求理解与方案设计(要点、流程、验证策略),不预演具体代码实现;代码在 Do 阶段基于实际文件状态输出,正确性由 Check 验证
|
|
18
|
-
|
|
19
|
-
协议:动手前读相关 `AGENTS.md`(不凭记忆);过程中自检、违反即纠正;交付前核对红线与验证证据,未验证项必须标注;无法遵守时立即说明(不静默忽略、不自行判定「不适用」);派发子代理时把约束写进任务说明。
|
|
12
|
+
- 所有思考、分析、推理过程、工具调用描述等必须使用中文,专有名词除外
|
|
13
|
+
- 思考不要陷入重复循环,一旦循环,立即退出
|
|
14
|
+
- 思考聚焦需求理解与方案设计(要点、流程、验证策略),不预演具体代码实现;代码在 Do 阶段基于实际文件状态输出,正确性由 Check 验证
|
|
20
15
|
|
|
21
16
|
- id: agent-presets
|
|
22
17
|
config:
|
|
@@ -62,3 +57,34 @@
|
|
|
62
57
|
low: low
|
|
63
58
|
high: high
|
|
64
59
|
max: max
|
|
60
|
+
|
|
61
|
+
# 沙箱装配(唯一真源,就地完成):官方 `sandbox`(ctx.sandbox)与 `fs-sandbox`
|
|
62
|
+
# (ctx.fs)两行在这里禁用,由 `@morlay/dsh-sandbox-local` 注册同名服务;规则随本
|
|
63
|
+
# insert 行一起写死,不再依赖任何额外 bundle 层(漏装配时规则会静默失效,只剩
|
|
64
|
+
# workspace + /tmp 可写)。
|
|
65
|
+
- id: sandbox
|
|
66
|
+
disabled: true
|
|
67
|
+
|
|
68
|
+
- id: fs-sandbox
|
|
69
|
+
disabled: true
|
|
70
|
+
|
|
71
|
+
# 沙箱规则:`rw <path>` 追加工作区之外的可写根,`-- <pattern>` 拒绝访问(读 + 写)。
|
|
72
|
+
- insert:
|
|
73
|
+
- id: sandbox-local
|
|
74
|
+
name: "@morlay/dsh-sandbox-local"
|
|
75
|
+
config:
|
|
76
|
+
access: |-
|
|
77
|
+
rw /tmp
|
|
78
|
+
rw {{ env.XDG_CACHE_HOME }}
|
|
79
|
+
rw {{ env.XDG_STATE_HOME }}
|
|
80
|
+
rw {{ env.XDG_DATA_HOME }}
|
|
81
|
+
r- {{ env.XDG_CONFIG_HOME }}
|
|
82
|
+
-- mise.*.toml
|
|
83
|
+
-- **/*.pem
|
|
84
|
+
|
|
85
|
+
# 提示词分层:系统提示词只留上面的 persona,工具说明 / Agent Teams 规则 / plan
|
|
86
|
+
# 规则等由该插件降级为 <system-reminder> user 消息。部署级策略,在这里定义一次
|
|
87
|
+
# 即覆盖全部 preset(含子 agent),preset composition 不再各自带这一行。
|
|
88
|
+
- insert:
|
|
89
|
+
- id: prompt-reminder
|
|
90
|
+
name: "@morlay/dsh-prompt-reminder"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-preset",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Personal dsh profile bundle: disables the shipped agent presets, builds generated standard / ptc presets into dist,
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Personal dsh profile bundle: disables the shipped agent presets, builds generated standard / ptc presets into dist, declares personal llm-pi-ai provider routes, and carries the deployment sandbox access rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
7
7
|
"dsh-bundle",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"./package.json": "./package.json",
|
|
26
26
|
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
27
27
|
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@morlay/dsh-prompt-reminder": "^0.0.2",
|
|
30
|
+
"@morlay/dsh-sandbox-local": "^0.0.2"
|
|
31
|
+
},
|
|
28
32
|
"devDependencies": {
|
|
29
33
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
30
34
|
"@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.2",
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
/** 上游 preset 里承载工作区指令的行 id。 */
|
|
30
30
|
const INSTRUCTIONS_ROW_ID = "agent-instructions";
|
|
31
31
|
|
|
32
|
-
/**
|
|
32
|
+
/** 上游那行指向的官方插件(产物须保持官方名;提示词分层由 profile 的 patch 承担)。 */
|
|
33
33
|
const UPSTREAM_INSTRUCTIONS_PLUGIN = "@deepseek-ai/dsh-agent-instructions";
|
|
34
34
|
|
|
35
35
|
/** 产物里指令候选的文件名(字面量:不读 CLAUDE 系列)。 */
|
|
@@ -105,7 +105,7 @@ describe("generated presets", () => {
|
|
|
105
105
|
expect(productRow?.config?.localInstructionFileCandidates).toEqual(["AGENTS.local.md"]);
|
|
106
106
|
// 其余 config 字段跟随上游(如 maxBytes 的字节预算)。
|
|
107
107
|
expect(productRow?.config?.maxBytes).toBe(upstreamRow?.config?.maxBytes);
|
|
108
|
-
//
|
|
108
|
+
// 提示词分层(prompt-reminder)是 profile 的 bundle patch,不进 preset 产物。
|
|
109
109
|
expect(
|
|
110
110
|
product.some((row) => typeof row.name === "string" && row.name.startsWith("@morlay/")),
|
|
111
111
|
).toBe(false);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// 装配守卫:prompt-reminder 是 host plane 的唯一装配点。被误删 / 改名时提示词分层
|
|
2
|
+
// 静默失效(工具说明回到系统提示词),这里 fail loud;persona 是 keep 名单的唯一
|
|
3
|
+
// 提供者,删掉它系统提示词会变空。
|
|
4
|
+
//
|
|
5
|
+
// 沙箱同理:官方 `sandbox` / `fs-sandbox` 的禁用与本包 `sandbox-local` 行的插入必须在
|
|
6
|
+
// 同一层——官方行还在时 `ctx.sandbox` / `ctx.fs` 由官方实现提供,access 规则没有生效点,
|
|
7
|
+
// 命令照跑但规则全部失效(只剩 workspace + /tmp 可写),且没有任何报错。
|
|
8
|
+
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { entryListSchema } from "@deepseek-ai/cordis-plugin-include";
|
|
12
|
+
import yaml from "js-yaml";
|
|
13
|
+
import { describe, expect, it } from "vitest";
|
|
14
|
+
|
|
15
|
+
const PATCH_PATH = join(process.cwd(), "packages/preset/dsh-preset/cordis.patch.yml");
|
|
16
|
+
const UPSTREAM_BASE_PATCH = join(
|
|
17
|
+
process.cwd(),
|
|
18
|
+
"vendor/deepseek-harness/packages/bundle/base/cordis.patch.yml",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/** patch 的一行;只用到覆盖目标、禁用与 insert 的新增行。 */
|
|
22
|
+
interface PatchRow {
|
|
23
|
+
id?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
config?: Record<string, unknown>;
|
|
26
|
+
insert?: { id?: string; name?: string; config?: Record<string, unknown> }[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 用 include 的 entry schema 解析:patch 里含 `!!js` 表达式,默认 schema 会拒绝。
|
|
30
|
+
const rows = yaml.load(readFileSync(PATCH_PATH, "utf8"), {
|
|
31
|
+
schema: entryListSchema,
|
|
32
|
+
}) as PatchRow[];
|
|
33
|
+
|
|
34
|
+
/** 本层 insert 出来的行。 */
|
|
35
|
+
const inserted = rows.flatMap((row) => row.insert ?? []);
|
|
36
|
+
|
|
37
|
+
/** 本层的 `sandbox-local` 行(装配沙箱替换的那个)。 */
|
|
38
|
+
const sandboxRow = inserted.find((row) => row.id === "sandbox-local");
|
|
39
|
+
|
|
40
|
+
describe("dsh-preset patch wiring", () => {
|
|
41
|
+
it("declares the prompt-reminder row exactly once, on the local plugin", () => {
|
|
42
|
+
const reminders = inserted.filter((row) => row.id === "prompt-reminder");
|
|
43
|
+
|
|
44
|
+
expect(reminders).toHaveLength(1);
|
|
45
|
+
expect(reminders[0]?.name).toBe("@morlay/dsh-prompt-reminder");
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("keeps the deployment persona the reminder keeps in the system prompt", () => {
|
|
49
|
+
const config = rows.find((row) => row.id === "system-prompt")?.config;
|
|
50
|
+
|
|
51
|
+
expect(config?.personaPrefix).toBeTruthy();
|
|
52
|
+
expect(config?.personaSuffix).toBeTruthy();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("disables the shipped sandbox rows and mounts the replacement in one layer", () => {
|
|
56
|
+
expect(rows.filter((row) => row.disabled === true).map((row) => row.id)).toEqual([
|
|
57
|
+
"sandbox",
|
|
58
|
+
"fs-sandbox",
|
|
59
|
+
]);
|
|
60
|
+
expect(inserted.filter((row) => row.id === "sandbox-local")).toHaveLength(1);
|
|
61
|
+
expect(sandboxRow?.name).toBe("@morlay/dsh-sandbox-local");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("names rows that still exist in the shipped base bundle", () => {
|
|
65
|
+
// 上游改名或移动这两行时,本层的 disabled 会被 include 静默跳过(warn+skip),
|
|
66
|
+
// 沙箱替换随之失效;这里对着 vendor 里的 base patch 校验一次。
|
|
67
|
+
const upstreamIds = new Set(
|
|
68
|
+
[...readFileSync(UPSTREAM_BASE_PATCH, "utf8").matchAll(/^\s*- id: (\S+)$/gm)].map(
|
|
69
|
+
(match) => match[1]!,
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
for (const id of ["sandbox", "fs-sandbox"]) {
|
|
74
|
+
expect(upstreamIds.has(id), `missing upstream row: ${id}`).toBe(true);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("carries the deployment sandbox rules on the inserted row", () => {
|
|
79
|
+
// 规则随本 bundle 分发(跨 dev / 打包形态一致),不再依赖另一层 bundle。
|
|
80
|
+
const access = sandboxRow?.config?.access;
|
|
81
|
+
|
|
82
|
+
expect(typeof access).toBe("string");
|
|
83
|
+
expect(String(access)).toContain("rw {{ env.XDG_CACHE_HOME }}");
|
|
84
|
+
expect(String(access)).toContain("rw {{ env.XDG_DATA_HOME }}");
|
|
85
|
+
expect(String(access)).toContain("-- mise.*.toml");
|
|
86
|
+
expect(String(access)).toContain("-- **/*.pem");
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("depends on the bundle whose service classes the inserted row mounts", () => {
|
|
90
|
+
const manifest = JSON.parse(
|
|
91
|
+
readFileSync(join(process.cwd(), "packages/preset/dsh-preset/package.json"), "utf8"),
|
|
92
|
+
) as { dependencies?: Record<string, string> };
|
|
93
|
+
|
|
94
|
+
expect(manifest.dependencies?.["@morlay/dsh-sandbox-local"]).toBeTruthy();
|
|
95
|
+
});
|
|
96
|
+
});
|
package/tool/generate-presets.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* `agent-instructions` 行的指令候选收紧为 AGENTS 系列),再 `dump` 回 YAML。
|
|
10
10
|
* 上游任何结构性改动(新增/重命名 row、改字段)都自动跟随,不依赖易碎的文本锚点。
|
|
11
11
|
*
|
|
12
|
-
* `agent-instructions`
|
|
13
|
-
*
|
|
12
|
+
* `agent-instructions` 行是上游官方插件:工作区指令的 baseline 留在 user 消息通道,
|
|
13
|
+
* 与「系统提示词只留 persona、其余走 reminder」的分层一致。
|
|
14
14
|
*
|
|
15
15
|
* 产物落在 `dist/` 而非源码树:dist 是构建输出(gitignore),既不会与 oxfmt
|
|
16
16
|
* 互相改格式,也不会把派生文件混进源码。
|