@linxin666/dsh-pet 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.
Files changed (87) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +65 -2
  3. package/README.zh.md +65 -2
  4. package/assets/decorations/whale/decoration.json +20 -0
  5. package/assets/decorations/whale/whale-frames.png +0 -0
  6. package/contracts/pet-manifest-v2.schema.json +281 -0
  7. package/contracts/status-decoration-v1.schema.json +144 -0
  8. package/contracts/voice-pack-v1.schema.json +234 -0
  9. package/lib/client.js +251 -43
  10. package/lib/client.js.map +1 -1
  11. package/lib/index.js +1139 -100
  12. package/lib/types/access.d.ts +16 -0
  13. package/lib/types/access.d.ts.map +1 -0
  14. package/lib/types/access.js +20 -0
  15. package/lib/types/chatter.d.ts +61 -3
  16. package/lib/types/chatter.d.ts.map +1 -1
  17. package/lib/types/chatter.js +71 -12
  18. package/lib/types/client/PetSettingsCard.d.ts +4 -0
  19. package/lib/types/client/PetSettingsCard.d.ts.map +1 -1
  20. package/lib/types/client/PetSettingsCard.js +11 -3
  21. package/lib/types/client/PetSprite.d.ts.map +1 -1
  22. package/lib/types/client/PetSprite.js +111 -4
  23. package/lib/types/client/locales.d.ts +4 -0
  24. package/lib/types/client/locales.d.ts.map +1 -1
  25. package/lib/types/client/locales.js +4 -0
  26. package/lib/types/client/renderers/live2d/Live2dVisualMount.d.ts.map +1 -1
  27. package/lib/types/client/renderers/live2d/Live2dVisualMount.js +1 -0
  28. package/lib/types/client/renderers/live2d/runtime.d.ts +13 -1
  29. package/lib/types/client/renderers/live2d/runtime.d.ts.map +1 -1
  30. package/lib/types/client/renderers/live2d.d.ts.map +1 -1
  31. package/lib/types/client/renderers/live2d.js +133 -25
  32. package/lib/types/client/settings-form.d.ts.map +1 -1
  33. package/lib/types/client/settings-form.js +9 -6
  34. package/lib/types/contracts/status-decoration.d.ts +85 -0
  35. package/lib/types/contracts/status-decoration.d.ts.map +1 -0
  36. package/lib/types/contracts/status-decoration.js +21 -0
  37. package/lib/types/decoration.d.ts +39 -0
  38. package/lib/types/decoration.d.ts.map +1 -0
  39. package/lib/types/decoration.js +210 -0
  40. package/lib/types/event-projection.d.ts +8 -3
  41. package/lib/types/event-projection.d.ts.map +1 -1
  42. package/lib/types/event-projection.js +9 -4
  43. package/lib/types/image-dimensions.d.ts +26 -0
  44. package/lib/types/image-dimensions.d.ts.map +1 -0
  45. package/lib/types/image-dimensions.js +77 -0
  46. package/lib/types/index.d.ts +2 -0
  47. package/lib/types/index.d.ts.map +1 -1
  48. package/lib/types/index.js +3 -1
  49. package/lib/types/registry.d.ts +55 -2
  50. package/lib/types/registry.d.ts.map +1 -1
  51. package/lib/types/registry.js +240 -16
  52. package/lib/types/routes.d.ts +6 -1
  53. package/lib/types/routes.d.ts.map +1 -1
  54. package/lib/types/routes.js +163 -32
  55. package/lib/types/service.d.ts +33 -0
  56. package/lib/types/service.d.ts.map +1 -1
  57. package/lib/types/service.js +42 -3
  58. package/lib/types/voice-pack.d.ts +98 -0
  59. package/lib/types/voice-pack.d.ts.map +1 -0
  60. package/lib/types/voice-pack.js +384 -0
  61. package/package.json +11 -10
  62. package/src/access.ts +40 -0
  63. package/src/chatter.test.ts +89 -2
  64. package/src/chatter.ts +120 -14
  65. package/src/client/PetSettingsCard.tsx +26 -2
  66. package/src/client/PetSprite.test.tsx +325 -12
  67. package/src/client/PetSprite.tsx +150 -25
  68. package/src/client/locales.ts +4 -0
  69. package/src/client/renderers/live2d/Live2dVisualMount.test.tsx +72 -0
  70. package/src/client/renderers/live2d/Live2dVisualMount.tsx +1 -0
  71. package/src/client/renderers/live2d/runtime.ts +8 -2
  72. package/src/client/renderers/live2d.test.ts +233 -9
  73. package/src/client/renderers/live2d.ts +143 -30
  74. package/src/client/settings-form.ts +8 -6
  75. package/src/contracts/status-decoration.ts +78 -0
  76. package/src/decoration.test.ts +178 -0
  77. package/src/decoration.ts +220 -0
  78. package/src/event-projection.ts +10 -5
  79. package/src/image-dimensions.test.ts +85 -0
  80. package/src/image-dimensions.ts +76 -0
  81. package/src/index.ts +3 -1
  82. package/src/registry.test.ts +276 -0
  83. package/src/registry.ts +274 -15
  84. package/src/routes.ts +162 -33
  85. package/src/service.ts +59 -3
  86. package/src/voice-pack.test.ts +216 -0
  87. package/src/voice-pack.ts +413 -0
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Status-decoration manifest v1 — fail-closed structure + warn-and-drop
3
+ * content, mirroring the pet manifest-v2 discipline (issue #623 M5,
4
+ * protocol #567). Unknown top-level fields, unsafe entry paths, out-of-
5
+ * range geometry and unknown renderer content reject the descriptor with
6
+ * human-readable diagnostics; per-phase binding issues drop that binding
7
+ * only. The JSON Schema twin lives at
8
+ * contracts/status-decoration-v1.schema.json; this hand-rolled parser is
9
+ * authoritative. Keep this file erasable-syntax-only (scripts/ import it
10
+ * under node's strip-only mode).
11
+ * @module @linxin666/dsh-pet/decoration
12
+ */
13
+ import { isAbsolute } from 'node:path';
14
+ import { PET_ACTIVITY_PHASES } from './manifest-v2.js';
15
+ /** Geometry and content caps (the adopted PNG/WebP sprite-strip bounds). */
16
+ export const DECORATION_CELL_MAX = 256;
17
+ export const DECORATION_COLUMNS_MAX = 16;
18
+ export const DECORATION_DURATION_MAX_MS = 2000;
19
+ export const DECORATION_ENTRY_EXTENSIONS = ['.webp', '.png'];
20
+ export const DECORATION_DISPLAY_NAME_MAX = 64;
21
+ /** Field allow-list (drift-locked to the schema twin in tests). */
22
+ export const KNOWN_DECORATION_TOP_LEVEL = new Set([
23
+ '$schema', 'decorationManifestVersion', 'id', 'displayName', 'license',
24
+ 'entry', 'cell', 'columns', 'frameMs', 'durations', 'loop', 'phases',
25
+ ]);
26
+ const PET_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
27
+ const PATH_SEGMENT_PATTERN = /^[A-Za-z0-9._-]+$/;
28
+ class Diagnostics {
29
+ list = [];
30
+ source;
31
+ constructor(source) { this.source = source; }
32
+ error(message) { this.list.push({ level: 'error', message: this.source + ': ' + message }); }
33
+ warn(message) { this.list.push({ level: 'warning', message: this.source + ': ' + message }); }
34
+ get hasErrors() { return this.list.some(d => d.level === 'error'); }
35
+ }
36
+ function isRecord(value) {
37
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
38
+ }
39
+ function unknownKeys(source, known) {
40
+ return Object.keys(source).filter(key => !known.has(key));
41
+ }
42
+ /** Positive integer in [min, max], else undefined. */
43
+ function finiteInt(value, min, max) {
44
+ return typeof value === 'number' && Number.isInteger(value) && value >= min && value <= max
45
+ ? value
46
+ : undefined;
47
+ }
48
+ /**
49
+ * Validate a descriptor-relative entry path: no absolute paths, no
50
+ * backslashes, no traversal, plain safe segments only, and an exact
51
+ * lowercase PNG/WebP extension (the adopted entry discipline — SVG/CSS are
52
+ * not accepted). The extension match is case-sensitive on purpose: the
53
+ * asset route serves the declared path verbatim, so a case-mismatched
54
+ * suffix (frames.PNG vs frames.png) would pass a lenient check but 403 on
55
+ * case-sensitive filesystems.
56
+ * Returns the normalized path or undefined.
57
+ */
58
+ export function safeDecorationEntry(raw) {
59
+ if (typeof raw !== 'string' || raw.trim() === '')
60
+ return undefined;
61
+ const value = raw.trim();
62
+ if (value.length > 256)
63
+ return undefined;
64
+ if (isAbsolute(value) || value.includes('\\') || /^[a-z][a-z0-9+.-]*:/i.test(value))
65
+ return undefined;
66
+ const segments = value.split('/').filter(segment => segment !== '');
67
+ if (segments.length === 0)
68
+ return undefined;
69
+ if (segments.some(segment => segment === '.' || segment === '..' || !PATH_SEGMENT_PATTERN.test(segment)))
70
+ return undefined;
71
+ const last = segments[segments.length - 1];
72
+ const dot = last.lastIndexOf('.');
73
+ if (dot <= 0 || !DECORATION_ENTRY_EXTENSIONS.includes(last.slice(dot)))
74
+ return undefined;
75
+ return segments.join('/');
76
+ }
77
+ /** Normalize one phase binding value; undefined (warning) on bad content. */
78
+ function normalizeSegment(raw, columns, diag) {
79
+ if (raw === 'hide')
80
+ return 'hide';
81
+ if (!isRecord(raw)) {
82
+ diag.warn('phase binding must be "hide" or { from, to }; binding dropped');
83
+ return undefined;
84
+ }
85
+ const from = finiteInt(raw.from, 0, columns - 1);
86
+ const to = finiteInt(raw.to, 0, columns - 1);
87
+ if (from === undefined || to === undefined || from > to) {
88
+ diag.warn('phase frame segment out of range; binding dropped');
89
+ return undefined;
90
+ }
91
+ return { from, to };
92
+ }
93
+ /**
94
+ * Parse and validate one decoration.json document. Fail-closed over the
95
+ * structure (types, key sets, paths, ranges); phase-binding content issues
96
+ * drop that binding only (warn-and-drop, the registry never-throw rule).
97
+ */
98
+ export function parseDecorationManifest(raw, source = 'decoration.json') {
99
+ const diag = new Diagnostics(source);
100
+ if (!isRecord(raw)) {
101
+ diag.error('descriptor must be a JSON object');
102
+ return { ok: false, diagnostics: diag.list };
103
+ }
104
+ for (const key of unknownKeys(raw, KNOWN_DECORATION_TOP_LEVEL)) {
105
+ diag.error('unknown top-level field ' + JSON.stringify(key));
106
+ }
107
+ if (raw.decorationManifestVersion !== 1) {
108
+ diag.error('decorationManifestVersion must be 1');
109
+ }
110
+ const id = typeof raw.id === 'string' ? raw.id.trim() : '';
111
+ if (!PET_ID_PATTERN.test(id)) {
112
+ diag.error('id must be a lowercase kebab id');
113
+ }
114
+ if (id.length > 64) {
115
+ diag.error('id must be at most 64 characters');
116
+ }
117
+ const license = typeof raw.license === 'string' ? raw.license.trim() : '';
118
+ if (license === '')
119
+ diag.error('license is required (asset provenance)');
120
+ if (license.length > 128) {
121
+ diag.error('license must be at most 128 characters');
122
+ }
123
+ const entry = safeDecorationEntry(raw.entry);
124
+ if (entry === undefined) {
125
+ diag.error('entry must be a safe relative PNG/WebP path');
126
+ }
127
+ const rawCell = isRecord(raw.cell) ? raw.cell : {};
128
+ for (const key of Object.keys(rawCell)) {
129
+ if (key !== 'width' && key !== 'height')
130
+ diag.warn('unknown cell field ' + JSON.stringify(key) + ' ignored');
131
+ }
132
+ const cellWidth = finiteInt(rawCell.width, 1, DECORATION_CELL_MAX);
133
+ const cellHeight = finiteInt(rawCell.height, 1, DECORATION_CELL_MAX);
134
+ if (cellWidth === undefined || cellHeight === undefined) {
135
+ diag.error('cell width/height must be integers in [1, ' + DECORATION_CELL_MAX + ']');
136
+ }
137
+ const columns = finiteInt(raw.columns, 1, DECORATION_COLUMNS_MAX);
138
+ if (columns === undefined) {
139
+ diag.error('columns must be an integer in [1, ' + DECORATION_COLUMNS_MAX + ']');
140
+ }
141
+ if (diag.hasErrors || id === '' || entry === undefined || columns === undefined) {
142
+ return { ok: false, diagnostics: diag.list };
143
+ }
144
+ const displayName = typeof raw.displayName === 'string' && raw.displayName.trim() !== ''
145
+ ? raw.displayName.trim().slice(0, DECORATION_DISPLAY_NAME_MAX)
146
+ : id;
147
+ let loop;
148
+ if (raw.loop === undefined || typeof raw.loop === 'boolean') {
149
+ loop = raw.loop ?? true;
150
+ }
151
+ else {
152
+ diag.warn('loop must be a boolean; defaulting to true');
153
+ loop = true;
154
+ }
155
+ const rawDurations = raw.durations;
156
+ let durations;
157
+ if (Array.isArray(rawDurations)) {
158
+ const usable = rawDurations.filter((v) => typeof v === 'number' && Number.isInteger(v) && v >= 1 && v <= DECORATION_DURATION_MAX_MS);
159
+ if (usable.length !== columns) {
160
+ diag.warn('durations length must equal columns; using the constant frameMs instead');
161
+ durations = [];
162
+ }
163
+ else {
164
+ durations = usable;
165
+ }
166
+ }
167
+ else if (rawDurations !== undefined) {
168
+ diag.warn('durations must be an array; using the constant frameMs instead');
169
+ durations = [];
170
+ }
171
+ else {
172
+ durations = [];
173
+ }
174
+ if (durations.length === 0) {
175
+ const frameMs = finiteInt(raw.frameMs, 1, DECORATION_DURATION_MAX_MS) ?? 120;
176
+ durations = Array.from({ length: columns }, () => frameMs);
177
+ }
178
+ const phases = {};
179
+ const rawPhases = raw.phases;
180
+ if (isRecord(rawPhases)) {
181
+ for (const [key, value] of Object.entries(rawPhases)) {
182
+ if (!PET_ACTIVITY_PHASES.includes(key)) {
183
+ diag.warn('unknown phase ' + JSON.stringify(key) + '; binding ignored');
184
+ continue;
185
+ }
186
+ const segment = normalizeSegment(value, columns, diag);
187
+ if (segment !== undefined)
188
+ phases[key] = segment;
189
+ }
190
+ }
191
+ else if (rawPhases !== undefined) {
192
+ diag.warn('phases must be an object; all phases hide');
193
+ }
194
+ const visible = Object.values(phases).some(segment => segment !== 'hide');
195
+ if (!visible)
196
+ diag.warn('no phase shows the ornament; the decoration stays hidden');
197
+ const manifest = {
198
+ decorationManifestVersion: 1,
199
+ id,
200
+ displayName,
201
+ license,
202
+ entry,
203
+ cell: { width: cellWidth, height: cellHeight },
204
+ columns,
205
+ durations,
206
+ loop,
207
+ phases,
208
+ };
209
+ return { ok: true, manifest, diagnostics: diag.list };
210
+ }
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import type { SessionEvent } from '@deepseek-ai/dsh-session';
14
14
  import type { PetStateInput } from './state.ts';
15
- import { StatusVoice, WhisperEngine } from './chatter.ts';
15
+ import { StatusVoice, WhisperEngine, type VoicePoolsProvider } from './chatter.ts';
16
16
  /** Runtime shape of the optional legacy activity event. */
17
17
  export interface ActivityStatusEventLike {
18
18
  phase?: string;
@@ -36,8 +36,13 @@ export interface PetActivityTransition {
36
36
  /** A fresh inner whisper woken by this event's model output, when any. */
37
37
  whisper?: string;
38
38
  }
39
- /** Fresh projection runtime for a newly seen session. */
40
- export declare function emptyProjectionRuntime(): ProjectionRuntime;
39
+ /**
40
+ * Fresh projection runtime for a newly seen session. The optional voice-pack
41
+ * provider (pet-center M4, issue #677) hands both chatter engines their
42
+ * pools; engines resolve overrides at draw time, so swapping the provider's
43
+ * pack re-voices live runtimes without rebuilding them.
44
+ */
45
+ export declare function emptyProjectionRuntime(pools?: VoicePoolsProvider): ProjectionRuntime;
41
46
  /** Whether a legacy phase is part of the pet's supported vocabulary. */
42
47
  export declare function isActivityPhase(phase: string): phase is PetStateInput['phase'];
43
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"event-projection.d.ts","sourceRoot":"","sources":["../../src/event-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAe,aAAa,EAAE,MAAM,cAAc,CAAA;AAEtE,2DAA2D;AAC3D,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,cAAc,EAAE,OAAO,CAAA;IACvB,qEAAqE;IACrE,KAAK,EAAE,WAAW,CAAA;IAClB,mEAAmE;IACnE,QAAQ,EAAE,aAAa,CAAA;CACxB;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yDAAyD;AACzD,wBAAgB,sBAAsB,IAAI,iBAAiB,CAQ1D;AAQD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,GAAE,MAAmB,GACzB,qBAAqB,GAAG,SAAS,CAwFnC"}
1
+ {"version":3,"file":"event-projection.d.ts","sourceRoot":"","sources":["../../src/event-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAe,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE/F,2DAA2D;AAC3D,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,cAAc,EAAE,OAAO,CAAA;IACvB,qEAAqE;IACrE,KAAK,EAAE,WAAW,CAAA;IAClB,mEAAmE;IACnE,QAAQ,EAAE,aAAa,CAAA;CACxB;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAQpF;AAQD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,GAAE,MAAmB,GACzB,qBAAqB,GAAG,SAAS,CAwFnC"}
@@ -11,14 +11,19 @@
11
11
  * @module @linxin666/dsh-pet/event-projection
12
12
  */
13
13
  import { StatusVoice, toolArgHint, WhisperEngine } from './chatter.js';
14
- /** Fresh projection runtime for a newly seen session. */
15
- export function emptyProjectionRuntime() {
14
+ /**
15
+ * Fresh projection runtime for a newly seen session. The optional voice-pack
16
+ * provider (pet-center M4, issue #677) hands both chatter engines their
17
+ * pools; engines resolve overrides at draw time, so swapping the provider's
18
+ * pack re-voices live runtimes without rebuilding them.
19
+ */
20
+ export function emptyProjectionRuntime(pools) {
16
21
  return {
17
22
  activeTools: new Set(),
18
23
  officialEventsSeen: false,
19
24
  stepHadFailure: false,
20
- voice: new StatusVoice(),
21
- whispers: new WhisperEngine(),
25
+ voice: new StatusVoice(pools),
26
+ whispers: new WhisperEngine(pools),
22
27
  };
23
28
  }
24
29
  /** Keep tool names readable inside the compact status bubble. */
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Minimal PNG/WebP dimension reader — header-only, no decoding, no
3
+ * dependencies. Used by the decoration registry to verify a strip's actual
4
+ * pixel geometry matches its descriptor (single-row sprite strip; the client
5
+ * renders by frame-column offsets, so a mismatched strip silently shows the
6
+ * wrong frames). Parsing is best-effort: an unrecognized or truncated header
7
+ * returns undefined (the caller decides whether to warn).
8
+ *
9
+ * PNG: signature (8) + IHDR chunk — length (4) + 'IHDR' (4) + width (4) +
10
+ * height (4), both big-endian uint32 at fixed offsets 16/20.
11
+ * WebP: RIFF header (12) + chunk — 'VP8X' extended (width-1/height-1 as
12
+ * little-endian uint24 at 24/27), 'VP8L' lossless (packed 14-bit dims at
13
+ * 21), or 'VP8 ' lossy (frame header, low 14 bits of the uint16 at 26/28).
14
+ * @module @linxin666/dsh-pet/image-dimensions
15
+ */
16
+ export interface ImageDimensions {
17
+ width: number;
18
+ height: number;
19
+ }
20
+ /**
21
+ * Read image pixel dimensions from a PNG or WebP buffer. Returns undefined
22
+ * for formats this reader does not recognize (never throws). Callers treat
23
+ * undefined as "cannot verify", not as an error.
24
+ */
25
+ export declare function imageDimensions(buf: Buffer): ImageDimensions | undefined;
26
+ //# sourceMappingURL=image-dimensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-dimensions.d.ts","sourceRoot":"","sources":["../../src/image-dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AA8CD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAGxE"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Minimal PNG/WebP dimension reader — header-only, no decoding, no
3
+ * dependencies. Used by the decoration registry to verify a strip's actual
4
+ * pixel geometry matches its descriptor (single-row sprite strip; the client
5
+ * renders by frame-column offsets, so a mismatched strip silently shows the
6
+ * wrong frames). Parsing is best-effort: an unrecognized or truncated header
7
+ * returns undefined (the caller decides whether to warn).
8
+ *
9
+ * PNG: signature (8) + IHDR chunk — length (4) + 'IHDR' (4) + width (4) +
10
+ * height (4), both big-endian uint32 at fixed offsets 16/20.
11
+ * WebP: RIFF header (12) + chunk — 'VP8X' extended (width-1/height-1 as
12
+ * little-endian uint24 at 24/27), 'VP8L' lossless (packed 14-bit dims at
13
+ * 21), or 'VP8 ' lossy (frame header, low 14 bits of the uint16 at 26/28).
14
+ * @module @linxin666/dsh-pet/image-dimensions
15
+ */
16
+ const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
17
+ /** Read the pixel size of a PNG buffer, or undefined when unrecognized. */
18
+ function pngDimensions(buf) {
19
+ if (buf.length < 24)
20
+ return undefined;
21
+ if (!buf.subarray(0, 8).equals(PNG_SIGNATURE))
22
+ return undefined;
23
+ if (buf.toString('ascii', 12, 16) !== 'IHDR')
24
+ return undefined;
25
+ return { width: buf.readUInt32BE(16), height: buf.readUInt32BE(20) };
26
+ }
27
+ /** Read the pixel size of a WebP buffer, or undefined when unrecognized. */
28
+ function webpDimensions(buf) {
29
+ if (buf.length < 21)
30
+ return undefined;
31
+ if (buf.toString('ascii', 0, 4) !== 'RIFF')
32
+ return undefined;
33
+ if (buf.toString('ascii', 8, 12) !== 'WEBP')
34
+ return undefined;
35
+ const fourcc = buf.toString('ascii', 12, 16);
36
+ if (fourcc === 'VP8X') {
37
+ // Extended header: 1-byte flags at 20, then width-1/height-1 uint24 LE.
38
+ if (buf.length < 30)
39
+ return undefined;
40
+ return {
41
+ width: 1 + buf.readUIntLE(24, 3),
42
+ height: 1 + buf.readUIntLE(27, 3),
43
+ };
44
+ }
45
+ if (fourcc === 'VP8L') {
46
+ // Lossless header: 0x2f marker at 20, then 14-bit width / 14-bit height
47
+ // packed into the little-endian uint32 at 21.
48
+ if (buf.length < 25)
49
+ return undefined;
50
+ const bits = buf.readUInt32LE(21);
51
+ return {
52
+ width: 1 + (bits & 0x3fff),
53
+ height: 1 + ((bits >>> 14) & 0x3fff),
54
+ };
55
+ }
56
+ if (fourcc === 'VP8 ') {
57
+ // Lossy frame header: 3-byte tag + 3-byte start code, then width/height
58
+ // as uint16 LE whose low 14 bits carry the dimension.
59
+ if (buf.length < 30)
60
+ return undefined;
61
+ return {
62
+ width: buf.readUInt16LE(26) & 0x3fff,
63
+ height: buf.readUInt16LE(28) & 0x3fff,
64
+ };
65
+ }
66
+ return undefined;
67
+ }
68
+ /**
69
+ * Read image pixel dimensions from a PNG or WebP buffer. Returns undefined
70
+ * for formats this reader does not recognize (never throws). Callers treat
71
+ * undefined as "cannot verify", not as an error.
72
+ */
73
+ export function imageDimensions(buf) {
74
+ if (buf.length >= 12 && buf.toString('ascii', 0, 4) === 'RIFF')
75
+ return webpDimensions(buf);
76
+ return pngDimensions(buf);
77
+ }
@@ -47,6 +47,7 @@ export declare function makePetSettingsSchema(fallbackPetId: string): z<Schemast
47
47
  bottom: z<number, number>;
48
48
  petId: z<string, string>;
49
49
  enabled: z<boolean, boolean>;
50
+ decorationEnabled: z<boolean, boolean>;
50
51
  }>, Schemastery.ObjectT<{
51
52
  visible: z<boolean, boolean>;
52
53
  size: z<number, number>;
@@ -54,6 +55,7 @@ export declare function makePetSettingsSchema(fallbackPetId: string): z<Schemast
54
55
  bottom: z<number, number>;
55
56
  petId: z<string, string>;
56
57
  enabled: z<boolean, boolean>;
58
+ decorationEnabled: z<boolean, boolean>;
57
59
  }>>;
58
60
  /** Register the pet service and its API + asset routes on the context. */
59
61
  export declare const apply: typeof applyImpl;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAG7C,OAAO,CAAC,MAAM,aAAa,CAAA;AAC3B,OAAO,EAAsC,KAAK,SAAS,EAA2B,MAAM,cAAc,CAAA;AAM1G,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC9D,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,YAAY,EACV,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,GACN,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,gBAAgB,GACjB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,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YAAY,EACZ,cAAc,EACd,kBAAkB,GACnB,MAAM,eAAe,CAAA;AACtB,YAAY,EACV,aAAa,EACb,QAAQ,EACR,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,aAAa,CAAA;AAEpB,sEAAsE;AACtE,eAAO,MAAM,IAAI,QAAQ,CAAA;AAEzB,+DAA+D;AAC/D,eAAO,MAAM,MAAM,UAAgB,CAAA;AAEnC;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM;;;;;;;;;;;;;;;;IAU1D;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK,kBAA6C,CAAA;AAE/D,iBAAS,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,SAAc,GAAG,IAAI,CAgE7D"}
@@ -45,6 +45,7 @@ export function makePetSettingsSchema(fallbackPetId) {
45
45
  bottom: z.number().step(1).min(0).max(DISPLAY_INSET_MAX).default(20),
46
46
  petId: z.string().default(fallbackPetId),
47
47
  enabled: z.boolean().default(true),
48
+ decorationEnabled: z.boolean().default(true),
48
49
  });
49
50
  }
50
51
  /** Register the pet service and its API + asset routes on the context. */
@@ -71,6 +72,7 @@ function applyImpl(ctx, config = {}) {
71
72
  bottom: service.display().bottom,
72
73
  petId: service.selectedPetId(),
73
74
  enabled: config.enabled ?? true,
75
+ decorationEnabled: config.decorationEnabled ?? true,
74
76
  };
75
77
  // The browser half talks to the pet through same-origin JSON endpoints and
76
78
  // loads each pet's atlas from the registry's own media route (RPC domains
@@ -78,7 +80,7 @@ function applyImpl(ctx, config = {}) {
78
80
  // pattern as dsh-remote-web-ui's /api/pair family). The routes are
79
81
  // registered while the plugin is enabled; toggling the setting off makes
80
82
  // the pet API disappear until it is re-enabled.
81
- const routes = makePetRoutes({ service });
83
+ const routes = makePetRoutes({ service, ctx });
82
84
  let disposeRoutes;
83
85
  const syncRoutes = () => {
84
86
  const enabled = current().enabled ?? true;
@@ -28,6 +28,8 @@
28
28
  */
29
29
  import type { ActivityPhase, PetAnimation } from './state.ts';
30
30
  import { type PetRemarks, type PetRemarksManifest } from './remarks.ts';
31
+ import { type PetPanelView, type VoicePack } from './voice-pack.ts';
32
+ import { type DecorationView } from './contracts/status-decoration.ts';
31
33
  import { type PetRendererKind } from './manifest-v2.ts';
32
34
  /** Fixed row order of the 9-state animation contract. */
33
35
  export declare const PET_ROW_ORDER: readonly PetAnimation[];
@@ -158,6 +160,8 @@ export interface PetDefinition {
158
160
  atlasUrl: string;
159
161
  /** Browser URL of the manifest (served by the host asset route). */
160
162
  manifestUrl: string;
163
+ /** Hover-panel chrome overrides (voice.json 'panel'; pet-center M4). */
164
+ panel?: PetPanelView;
161
165
  }
162
166
  /** A resolved pet plus its host-side file location. */
163
167
  export interface PetEntry extends PetDefinition {
@@ -173,6 +177,11 @@ export interface PetEntry extends PetDefinition {
173
177
  servable: readonly string[];
174
178
  /** Normalized per-pet remark pools (manifest 'remarks'), when declared. */
175
179
  remarks?: PetRemarks;
180
+ /**
181
+ * Normalized per-pet voice pack (the directory's voice.json; pet-center
182
+ * M4). Host-side only — the browser half receives its 'panel' slice.
183
+ */
184
+ voice?: VoicePack;
176
185
  }
177
186
  /** Registry load result: resolved entries plus load warnings. */
178
187
  export interface PetRegistry {
@@ -183,6 +192,31 @@ export interface PetRegistry {
183
192
  byId(id: string): PetEntry | undefined;
184
193
  /** The pet an installation falls back to when the selection is unknown. */
185
194
  defaultEntry(): PetEntry;
195
+ /**
196
+ * The global voice override ('$DSH_HOME/pets/.voice.json'), when present —
197
+ * layers under every per-pet pack and over the built-in pools (M4, #677).
198
+ */
199
+ globalVoice?: VoicePack;
200
+ /**
201
+ * Status decorations (pet-center M5, #567): built-in 'assets/decorations'
202
+ * entries overridden by same-id user entries under
203
+ * '$DSH_HOME/pets/decorations'. Independent of the pet entries. Optional
204
+ * so prebuilt test registries without decorations keep compiling.
205
+ */
206
+ decorations?: DecorationEntry[];
207
+ /** Look up one decoration by id. */
208
+ decorationById?(id: string): DecorationEntry | undefined;
209
+ }
210
+ /** One resolved status decoration plus its host-side file location. */
211
+ export interface DecorationEntry extends DecorationView {
212
+ /** Absolute directory holding the descriptor and strip. */
213
+ dir: string;
214
+ /** Strip path relative to 'dir' (declared by the descriptor). */
215
+ entryPath: string;
216
+ /** Descriptor-relative files the decoration asset route may serve. */
217
+ servable: readonly string[];
218
+ /** Asset license identifier (required by the descriptor). */
219
+ license: string;
186
220
  }
187
221
  /** One structured registry diagnostic (manifest-v2 era). */
188
222
  export interface PetRegistryDiagnostic {
@@ -212,6 +246,16 @@ export declare function resolvePetManifest(raw: unknown, dir: string, options?:
212
246
  assetPrefix?: string;
213
247
  warnings?: string[];
214
248
  }): PetEntry | undefined;
249
+ /**
250
+ * Scan-time read ceiling for user-authored JSON descriptors (voice.json,
251
+ * .voice.json, decoration.json): the registry reads these synchronously at
252
+ * plugin startup, and a pathological file — multi-GB, or a FIFO/device
253
+ * symlink — must not hang or exhaust the host before the warn-and-drop
254
+ * discipline can apply (review-spd follow-up, pet-center M4/M5).
255
+ */
256
+ export declare const PET_SCAN_JSON_CAP: number;
257
+ /** Decoration asset URL prefix (served by the decoration route, M5). */
258
+ export declare const DECORATION_ASSET_PREFIX = "/api/pet/decoration";
215
259
  /**
216
260
  * Load the pet registry: built-in 'assets/*' first, then the hatch-pet
217
261
  * custom pets directory, then composed 'extra' manifests (each later source
@@ -219,8 +263,17 @@ export declare function resolvePetManifest(raw: unknown, dir: string, options?:
219
263
  * bad manifest: it skips it and records a warning.
220
264
  */
221
265
  export declare function loadPetRegistry(options: PetRegistryOptions): PetRegistry;
222
- /** Strip host-only fields, leaving the client-visible definition. */
223
- export declare function petEntryView(entry: PetEntry): PetDefinition;
266
+ /** The built-in default decoration id (M5): the first reference ornament. */
267
+ export declare const DEFAULT_DECORATION_ID = "whale";
268
+ /** Strip host-only fields, leaving the browser-visible decoration view. */
269
+ export declare function decorationView(entry: DecorationEntry): DecorationView;
270
+ /**
271
+ * Strip host-only fields, leaving the client-visible definition. When the
272
+ * registry carries a global voice pack, its panel chrome layers under the
273
+ * entry's own pack (per-slot merge, pet > global), mirroring the voice-pool
274
+ * layering (pet-center M4, issue #677).
275
+ */
276
+ export declare function petEntryView(entry: PetEntry, globalVoice?: VoicePack): PetDefinition;
224
277
  /** The absolute file a pet's atlas resolves to (host asset route). */
225
278
  export declare function petAtlasFile(entry: PetEntry): string;
226
279
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAuB,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE5F,OAAO,EAAgE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGrH,yDAAyD;AACzD,eAAO,MAAM,aAAa,EAAE,SAAS,YAAY,EAUhD,CAAA;AAED,6BAA6B;AAC7B,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,OAAqC,CAAA;AACpE,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB,IAAI,CAAA;AACpC,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,IAAI,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAAgC,CAAA;AAElF,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,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