dsh-cabinet-mode 0.2.2 → 0.2.4
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/CHANGELOG.md +20 -0
- package/README.md +11 -16
- package/README.zh.md +11 -9
- package/client.js +1940 -2048
- package/docs/images/avatars/README.md +19 -0
- package/docs/images/avatars/dali.png +0 -0
- package/docs/images/avatars/hanlin.png +0 -0
- package/docs/images/avatars/lead.png +0 -0
- package/docs/images/avatars/prompts.json +1 -0
- package/docs/images/avatars/works.png +0 -0
- package/docs/images/avatars/yushi.png +0 -0
- package/package.json +1 -1
- package/scripts/test-avatars.mjs +27 -0
- package/scripts/verify.mjs +1 -1
- package/src/avatars/dali.png +0 -0
- package/src/avatars/hanlin.png +0 -0
- package/src/avatars/lead.png +0 -0
- package/src/avatars/works.png +0 -0
- package/src/avatars/yushi.png +0 -0
- package/src/avatars.js +1941 -2049
- package/src/build_avatars.py +2 -2
|
@@ -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
|
+
"version": "0.2.4",
|
|
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.');
|
package/scripts/verify.mjs
CHANGED
|
@@ -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
|
});
|
package/src/avatars/dali.png
CHANGED
|
Binary file
|
package/src/avatars/hanlin.png
CHANGED
|
Binary file
|
package/src/avatars/lead.png
CHANGED
|
Binary file
|
package/src/avatars/works.png
CHANGED
|
Binary file
|
package/src/avatars/yushi.png
CHANGED
|
Binary file
|