dsh-cabinet-mode 0.2.3 → 0.2.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/cordis.patch.yml CHANGED
@@ -26,11 +26,11 @@
26
26
  name: '@deepseek-ai/dsh-persona'
27
27
  config:
28
28
  prefix: |-
29
- 你是大明科研司·内阁成员,运行在 DeepSeek Harness 之上。内阁设首辅一人,阁臣分曹:翰林院编修、工部主事、大理寺评事、都察院御史。
29
+ 你是大明科研司·内阁成员,运行在 DeepSeek Harness 之上。内阁设首辅一人,阁臣分曹:翰林院编修、工部主事、大理寺评事、监察御史。
30
30
 
31
31
  【身份判定】
32
32
  1. 首辅判据:若系统/运行上下文中出现精确短语 `You are the Team Lead named "lead".`,你就是内阁首辅。
33
- 2. 阁臣判据:若出现精确短语 `You are teammate "<name>".` 或 `Your Team Lead is named "lead".`,你就是阁臣;以该短语中的 <name> 或首辅分派时写明的衙门身份自称(翰林院编修/工部主事/大理寺评事/都察院御史)。
33
+ 2. 阁臣判据:若出现精确短语 `You are teammate "<name>".` 或 `Your Team Lead is named "lead".`,你就是阁臣;以该短语中的 <name> 或首辅分派时写明的衙门身份自称(翰林院编修/工部主事/大理寺评事/监察御史)。
34
34
  3. 判据只有上述精确短语:不要用「是否持有 spawn_teammate 等团队工具」判断身份(Team 工具对所有成员可见);也不要用字样匹配(首辅上下文同样含 teammates 一词)。
35
35
  4. 都没有时按阁臣行事,并在回复中说明身份未定。任何情况下不得自封首辅。
36
36
 
@@ -38,13 +38,13 @@
38
38
  你是内阁首辅(队长),对用户所托负总责,六条职责:
39
39
  一、审题:先读懂用户真正所求与边界;含混处先问,给备选,不臆测。
40
40
  二、拟旨拆解:把目标拆成可执行子任务,逐条写清目标、交付物、验收标准、写入范围与依赖顺序。
41
- 三、分派:按衙门分派阁臣——翰林院编修主调研,工部主事主执行,大理寺评事主核验,都察院御史主验收;说明串行或并行;有依赖必串行。
41
+ 三、分派:按衙门分派阁臣——翰林院编修主调研,工部主事主执行,大理寺评事主核验,监察御史主验收;说明串行或并行;有依赖必串行。
42
42
  四、裁断:成员分歧、卡点、范围争议由你拍板并说明依据,不把决定权下推,不骑墙。
43
43
  五、汇总:收齐产出后去重、对齐,按用户原话逐项回对,指出未做到与未验证之处。
44
44
  六、闭环:验收合格方可交差;失败、遗留与风险必须明写,不得隐瞒。
45
45
 
46
46
  首辅令制(强制,不可省略):
47
- 1. 接到任务必须先拆解,再分派——不得跳过分派直接开工。拆解后立即用 spawn_teammate 把子任务点名分派给相应阁臣(翰林院编修/工部主事/大理寺评事/都察院御史),并用 team_task_create 建任务板,逐条写明目标、交付物、验收标准、写入范围与依赖顺序;有依赖的串行,无依赖的并行。
47
+ 1. 接到任务必须先拆解,再分派——不得跳过分派直接开工。拆解后立即用 spawn_teammate 把子任务点名分派给相应阁臣(翰林院编修/工部主事/大理寺评事/监察御史),并用 team_task_create 建任务板,逐条写明目标、交付物、验收标准、写入范围与依赖顺序;有依赖的串行,无依赖的并行。
48
48
  2. 令出即行,全程自主推进,不等待用户逐步确认。分派后主动跟进、裁断卡点、收齐产出、验收闭环,不放任任务悬空。
49
49
  3. 执行类工作一律委派,禁止首辅亲自执行。调研、写码、改文件、跑命令、抓数据、生成产物等执行类工作,必须委派给对应衙门的阁臣完成;首辅亲自只做审题、拆解、裁断、汇总、验收五件事。无人可派或确需首辅亲办时,须先在对话中向用户说明理由并获明确同意,方可亲办;未经同意不得以任何理由自行执行。
50
50
  4. 委派非免责:成员产出须经核验方许采信。
@@ -54,7 +54,7 @@
54
54
  【阁臣职责与规矩】(仅阁臣适用)
55
55
  你是阁臣(下属),受首辅节制,不代行首辅职权。
56
56
  1. 接令先复述任务与写入范围,确认边界后开工;只在分派范围内写,不擅自扩大。
57
- 2. 本衙职责:翰林院编修主调研与文献考据;工部主事主动手执行与产出;大理寺评事主独立核验;都察院御史主验收并按律弹劾缺陷。
57
+ 2. 本衙职责:翰林院编修主调研与文献考据;工部主事主动手执行与产出;大理寺评事主独立核验;监察御史主验收并按律弹劾缺陷。
58
58
  3. 遇阻必带三件回报首辅:已做什么、卡在哪里、需要什么;不空手抛问。
59
59
  4. 产出必附证据:路径、行号、命令输出;未实测标「未验证」,禁以推测冒充实测。
60
60
  5. 默认只调研不改码,写操作以任务明确授权为限;不编造数据来源;不改 live 配置。
@@ -0,0 +1,19 @@
1
+ # Cabinet portrait design / 内阁头像设计
2
+
3
+ These are original AI-generated chibi illustrations. The requested reference is 撷芳主人《大明衣冠图志》; no individual plate was inspected or copied, and these images are not claimed to reproduce the book. The costume setting draws on the textual sources below, with simplified embroidery for small UI portraits.
4
+
5
+ 本组为原创 AI 生成 Q 版插画。用户指定参考撷芳主人《大明衣冠图志》,但本次未逐页核对或复制画册图版,不宣称逐幅复刻或完整历史复原。采用明中后期常服的乌纱帽、圆领袍、方形胸补;纹样为适应头像而作简化。
6
+
7
+ | Key | Role / 官职设定 | Rank and badge / 品级与补纹 |
8
+ | --- | --- | --- |
9
+ | lead | 内阁首辅,以加一品衔大学士作艺术设定 | 鹤 / crane; 首辅本身不是固定品阶 |
10
+ | hanlin | 翰林院编修 | 正七品,鸂鶒 / ornamental duck |
11
+ | works | 工部主事 | 正六品,鹭鸶 / egret |
12
+ | dali | 大理寺评事 | 正七品,鸂鶒 / ornamental duck |
13
+ | yushi | 监察御史(旧名“都察院御史”继续作为兼容别名) | 正七品,风宪官獬豸 / xiezhi |
14
+
15
+ Sources: [《明史》卷六十七·舆服三](https://zh.wikisource.org/wiki/明史/卷67), [卷七十二·职官一](https://zh.wikisource.org/wiki/明史/卷72), [卷七十三·职官二](https://zh.wikisource.org/wiki/明史/卷73). The five-to-seven-rank blue rule concerns 公服; the chosen burgundy, teal, rust, slate and plum palette is artistic, not a claim about mandatory 常服 colours. 大理寺评事 is not assigned the censor's xiezhi badge.
16
+
17
+ The original PNGs are 1254×1254. Run `python3 src/build_avatars.py` from the repository root (Pillow required) to regenerate all 128×128 PNGs, `src/avatars.js`, and the marked avatar region of `client.js`. Exact generation prompts are recorded in [prompts.json](prompts.json). Existing role matching and original member names are preserved.
18
+
19
+ Full-size and 128px artwork are visually reviewed; automated tests only check PNG dimensions and byte parity between files and embedded modules. At 22–24px, embroidery details are not reliably readable: use the adjacent role and member labels, not colour or badge alone, to identify a member.
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ [{"key":"lead","prompt":"Use case: historical-scene. Create one original square 1024x1024 avatar for a Chinese Ming dynasty cabinet software panel, a polished coherent chibi illustrated portrait (not a copied book plate), clean thin dark outlines, soft matte colors, subtle paper texture. Half-length portrait, full black wushamao official cap with two plain horizontal side wings entirely inside frame, big expressive face, upper torso and a LARGE fully visible square embroidered chest rank badge, lower crop at waist, no hands covering badge. Plain pale ivory background with subtle circular warm-gold halo; uncluttered, legible down to 24px and 128px. Subject: dignified mature chief grand secretary, gentle confident smile, small neat dark moustache and short beard. Artistic character setting: grand secretary with an additional first-rank title, NOT claiming all chief secretaries have that rank. Ming mid/late period round-collar robe in muted deep burgundy, white inner collar, plain black cap, square dark chest badge edged gold featuring ONE WHITE CRANE with red crown, long neck and long legs, distinct crane silhouette above stylized clouds. Important: ordinary official changfu, no dragon/python robe, no emperor yellow, no crown, no Qing hat/button/beads, no peacock feather, no jeweled headdress, no earrings, no text or labels or watermark. Keep cap, face and square crane badge prominent, not full-body. This establishes the style for a set of five."},{"key":"hanlin","prompt":"Use case: historical-scene. Create ONE original square chibi Ming-dynasty official portrait, same coherent thin-line matte illustrated style, paper texture, head proportions, black plain wushamao cap with two horizontal side wings, pale ivory background and subtle circular halo as the supplied STYLE reference. Reference is style/composition only; replace character and rank badge as specified. Upper torso portrait, complete cap within image, round-collar plain robe and white inner collar, LARGE fully visible square embroidered rank badge centered on chest, no hands or objects over badge. Keep all details simple and high contrast for 128px avatar. No text, watermark, dragon/python robe, imperial crown, Qing topknot/hat button/bead necklace, jeweled headgear, earrings. Ordinary mid/late Ming changfu. Robe color is an artistic UI distinction, not a claimed rank regulation. Young scholarly Hanlin compiler, clean-shaven, gentle thoughtful expression, muted teal robe and cool jade halo. Seventh rank: square badge depicts a SINGLE MANDARIN-DUCK-LIKE XICHI WATERFOWL (鸂鶒), compact body floating above little ripples, short duck bill, short neck, distinctive crest and raised decorative wing feather. A duck, NOT a crane/heron with long legs; no mammal."},{"key":"works","prompt":"Use case: historical-scene. Create ONE original square chibi Ming-dynasty official portrait, same coherent thin-line matte illustrated style, paper texture, head proportions, black plain wushamao cap with two horizontal side wings, pale ivory background and subtle circular halo as the supplied STYLE reference. Reference is style/composition only; replace character and rank badge as specified. Upper torso portrait, complete cap within image, round-collar plain robe and white inner collar, LARGE fully visible square embroidered rank badge centered on chest, no hands or objects over badge. Keep all details simple and high contrast for 128px avatar. No text, watermark, dragon/python robe, imperial crown, Qing topknot/hat button/bead necklace, jeweled headgear, earrings. Ordinary mid/late Ming changfu. Robe color is an artistic UI distinction, not a claimed rank regulation. Practical confident adult Ministry of Works principal secretary, clean-shaven, slightly broad eyebrows, muted rust-red robe and warm terracotta halo. Sixth rank: square chest badge depicts a SINGLE WHITE EGRET (鹭鸶), long slim S-curved neck, slender pointed bill, long thin legs standing in shallow water, a little flowing crest behind its head, NO red crane crown, NOT a duck or beast."},{"key":"dali","prompt":"Use case: historical-scene. Create ONE original square chibi Ming-dynasty official portrait, same coherent thin-line matte illustrated style, paper texture, head proportions, black plain wushamao cap with two horizontal side wings, pale ivory background and subtle circular halo as the supplied STYLE reference. Reference is style/composition only; replace character and rank badge as specified. Upper torso portrait, complete cap within image, round-collar plain robe and white inner collar, LARGE fully visible square embroidered rank badge centered on chest, no hands or objects over badge. Keep all details simple and high contrast for 128px avatar. No text, watermark, dragon/python robe, imperial crown, Qing topknot/hat button/bead necklace, jeweled headgear, earrings. Ordinary mid/late Ming changfu. Robe color is an artistic UI distinction, not a claimed rank regulation. Thoughtful serious adult Dali Temple pingshi judicial reviewer, clean-shaven with more angular eyebrows than Hanlin, muted slate-indigo robe and blue-gray halo. Seventh rank: square chest badge depicts a SINGLE XICHI WATERFOWL (鸂鶒), compact duck body, short duck bill and short neck, crested head and ornamental upright wing feather, floating on ripples. A duck NOT a xiezhi or any mammal, NOT long-neck crane/heron. Plain male official cap, no jewelry."},{"key":"yushi","prompt":"Use case: historical-scene. Create ONE original square chibi Ming-dynasty official portrait, same coherent thin-line matte illustrated style, paper texture, head proportions, black plain wushamao cap with two horizontal side wings, pale ivory background and subtle circular halo as the supplied STYLE reference. Reference is style/composition only; replace character and rank badge as specified. Upper torso portrait, complete cap within image, round-collar plain robe and white inner collar, LARGE fully visible square embroidered rank badge centered on chest, no hands or objects over badge. Keep all details simple and high contrast for 128px avatar. No text, watermark, dragon/python robe, imperial crown, Qing topknot/hat button/bead necklace, jeweled headgear, earrings. Ordinary mid/late Ming changfu. Robe color is an artistic UI distinction, not a claimed rank regulation. Stern attentive adult supervising censor, clean-shaven, sharply defined eyebrows, muted plum robe and pale mauve halo. Censorate insignia: LARGE square chest badge depicts a SINGLE XIEZHI (獬豸), an unmistakable four-legged goat/deer-like mythical justice beast, hooves, leonine mane, ONE straight central horn on forehead, dark bronze-gold silhouette in side view, tail and four legs clearly visible. NOT a bird, NOT a dragon, NOT two antlers. Plain black cap with NO animal motif on cap."}]
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cabinet-mode",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Cabinet Mode (内阁模式) for DeepSeek Harness: a declarative DSH bundle that adds a dual-identity Lead/teammate agent preset for the Great Ming Research Bureau cabinet team.",
5
5
  "license": "MIT",
6
6
  "icon": "./icon.svg",
@@ -0,0 +1,27 @@
1
+ import assert from 'node:assert/strict';
2
+ import { readFileSync } from 'node:fs';
3
+ import vm from 'node:vm';
4
+ import { AVATARS, PLACEHOLDERS } from '../src/avatars.js';
5
+
6
+ const root = new URL('../', import.meta.url);
7
+ const keys = ['lead', 'hanlin', 'works', 'dali', 'yushi'];
8
+ const client = readFileSync(new URL('client.js', root), 'utf8');
9
+ const region = client.slice(client.indexOf('// #region avatars'), client.indexOf('// #endregion avatars'));
10
+ const embedded = vm.runInNewContext(`${region}\n({ AVATARS, AVATAR_PLACEHOLDERS })`);
11
+ assert.deepEqual(Object.keys(AVATARS), keys);
12
+ assert.equal(new Set(Object.values(AVATARS)).size, keys.length);
13
+ assert.equal(PLACEHOLDERS.length, 0);
14
+ assert.equal(embedded.AVATAR_PLACEHOLDERS.length, 0);
15
+ for (const key of keys) {
16
+ assert.equal(embedded.AVATARS[key], AVATARS[key], `${key}: stale browser data URL`);
17
+ const bytes = Buffer.from(AVATARS[key].split(',')[1], 'base64');
18
+ assert.deepEqual(bytes, readFileSync(new URL(`src/avatars/${key}.png`, root)), `${key}: stale module data URL`);
19
+ for (const path of [`src/avatars/${key}.png`, `docs/images/avatars/${key}.png`]) {
20
+ const png = readFileSync(new URL(path, root));
21
+ assert.equal(png.subarray(0, 8).toString('hex'), '89504e470d0a1a0a', path);
22
+ assert.equal(png.readUInt32BE(16), png.readUInt32BE(20), `${path}: non-square`);
23
+ assert.ok(png.readUInt32BE(16) >= 128, `${path}: too small`);
24
+ }
25
+ assert.equal(bytes.readUInt32BE(16), 128);
26
+ }
27
+ console.log('Five distinct avatars: source dimensions, PNG bytes and both embedded modules agree.');
@@ -36,6 +36,18 @@ for (const [name, expected] of [
36
36
  ]) assert.equal(client.displayName(name), expected);
37
37
  for (const name of ['hanlinx', 'works-', 'gongbu2x']) assert.match(client.avatarFor(name), /^data:image\/svg\+xml/);
38
38
  assert.equal(client.avatarFor('gongbu2'), client.avatarFor('works'));
39
+ // Display Chinese offices without changing the original runtime identity.
40
+ for (const [key, title] of [
41
+ ['lead', '内阁首辅'], ['hanlin', '翰林院编修'], ['works', '工部主事'],
42
+ ['dali', '大理寺评事'], ['yushi', '监察御史'],
43
+ ]) {
44
+ assert.equal(client.displayName(key), title + ' · ' + key);
45
+ assert.equal(client.displayName(title), title);
46
+ assert.equal(client.avatarFor(key), client.avatarFor(title));
47
+ }
48
+ assert.equal(client.displayName('都察院御史'), '监察御史 · 都察院御史');
49
+ assert.equal(client.avatarFor('都察院御史-一'), client.avatarFor('监察御史-一'));
50
+ for (const language of [client.zh, client.en]) assert.equal(language['lead.tag'], '内阁首辅');
39
51
 
40
52
  const render = (team, language) => client.CabinetPanel({
41
53
  sessionId: 'lead-session',
@@ -243,7 +243,7 @@ if (existsSync(PATCH_PATH)) {
243
243
  }
244
244
 
245
245
  // ---------- fallback scripts ----------
246
- for (const test of ['test-install.mjs', 'test-client.mjs']) {
246
+ for (const test of ['test-install.mjs', 'test-client.mjs', 'test-avatars.mjs']) {
247
247
  const result = spawnSync(process.execPath, [join(ROOT, 'scripts', test)], {
248
248
  encoding: 'utf8', timeout: 30000, windowsHide: true,
249
249
  });
Binary file
Binary file
Binary file
Binary file
Binary file