xstudio-linux 0.0.0-stage → 0.2.3

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 (222) hide show
  1. package/CHANGELOG.md +443 -0
  2. package/LICENSE +31 -0
  3. package/README.md +527 -2
  4. package/dist/adapter-cli/cli.d.ts +28 -0
  5. package/dist/adapter-cli/cli.js +235 -0
  6. package/dist/adapter-cli/cli.js.map +1 -0
  7. package/dist/adapter-mcp/server.d.ts +81 -0
  8. package/dist/adapter-mcp/server.js +477 -0
  9. package/dist/adapter-mcp/server.js.map +1 -0
  10. package/dist/config.d.ts +45 -0
  11. package/dist/config.js +78 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/core/catalog/pronunciation.d.ts +47 -0
  14. package/dist/core/catalog/pronunciation.js +402 -0
  15. package/dist/core/catalog/pronunciation.js.map +1 -0
  16. package/dist/core/catalog/singers.d.ts +46 -0
  17. package/dist/core/catalog/singers.js +122 -0
  18. package/dist/core/catalog/singers.js.map +1 -0
  19. package/dist/core/contracts.d.ts +348 -0
  20. package/dist/core/contracts.js +17 -0
  21. package/dist/core/contracts.js.map +1 -0
  22. package/dist/core/degrade/chain.d.ts +80 -0
  23. package/dist/core/degrade/chain.js +137 -0
  24. package/dist/core/degrade/chain.js.map +1 -0
  25. package/dist/core/diagnose/error-resolver.d.ts +51 -0
  26. package/dist/core/diagnose/error-resolver.js +202 -0
  27. package/dist/core/diagnose/error-resolver.js.map +1 -0
  28. package/dist/core/guard/skill-gate.d.ts +89 -0
  29. package/dist/core/guard/skill-gate.js +121 -0
  30. package/dist/core/guard/skill-gate.js.map +1 -0
  31. package/dist/core/midi/convert.d.ts +31 -0
  32. package/dist/core/midi/convert.js +125 -0
  33. package/dist/core/midi/convert.js.map +1 -0
  34. package/dist/core/midi/smf.d.ts +37 -0
  35. package/dist/core/midi/smf.js +422 -0
  36. package/dist/core/midi/smf.js.map +1 -0
  37. package/dist/core/render/artifacts.d.ts +37 -0
  38. package/dist/core/render/artifacts.js +417 -0
  39. package/dist/core/render/artifacts.js.map +1 -0
  40. package/dist/core/render/orchestrator.d.ts +110 -0
  41. package/dist/core/render/orchestrator.js +974 -0
  42. package/dist/core/render/orchestrator.js.map +1 -0
  43. package/dist/core/svip/codec.d.ts +30 -0
  44. package/dist/core/svip/codec.js +664 -0
  45. package/dist/core/svip/codec.js.map +1 -0
  46. package/dist/core/svip/document.d.ts +31 -0
  47. package/dist/core/svip/document.js +158 -0
  48. package/dist/core/svip/document.js.map +1 -0
  49. package/dist/core/svip/editor.d.ts +71 -0
  50. package/dist/core/svip/editor.js +245 -0
  51. package/dist/core/svip/editor.js.map +1 -0
  52. package/dist/core/svip/model.d.ts +74 -0
  53. package/dist/core/svip/model.js +158 -0
  54. package/dist/core/svip/model.js.map +1 -0
  55. package/dist/core/svip/tick.d.ts +21 -0
  56. package/dist/core/svip/tick.js +59 -0
  57. package/dist/core/svip/tick.js.map +1 -0
  58. package/dist/core/svip/validator.d.ts +39 -0
  59. package/dist/core/svip/validator.js +267 -0
  60. package/dist/core/svip/validator.js.map +1 -0
  61. package/dist/host/linux.d.ts +15 -0
  62. package/dist/host/linux.js +42 -0
  63. package/dist/host/linux.js.map +1 -0
  64. package/dist/host/sidecar.d.ts +61 -0
  65. package/dist/host/sidecar.js +365 -0
  66. package/dist/host/sidecar.js.map +1 -0
  67. package/dist/host/wine-launch.d.ts +60 -0
  68. package/dist/host/wine-launch.js +77 -0
  69. package/dist/host/wine-launch.js.map +1 -0
  70. package/dist/host/wine-paths.d.ts +30 -0
  71. package/dist/host/wine-paths.js +103 -0
  72. package/dist/host/wine-paths.js.map +1 -0
  73. package/dist/index.d.ts +20 -0
  74. package/dist/index.js +17 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/services.d.ts +55 -0
  77. package/dist/services.js +78 -0
  78. package/dist/services.js.map +1 -0
  79. package/dist/shared/errors.d.ts +61 -0
  80. package/dist/shared/errors.js +125 -0
  81. package/dist/shared/errors.js.map +1 -0
  82. package/dist/shared/paths.d.ts +8 -0
  83. package/dist/shared/paths.js +30 -0
  84. package/dist/shared/paths.js.map +1 -0
  85. package/dist/shared/schema.d.ts +26 -0
  86. package/dist/shared/schema.js +68 -0
  87. package/dist/shared/schema.js.map +1 -0
  88. package/dist/shared/types.d.ts +43 -0
  89. package/dist/shared/types.js +19 -0
  90. package/dist/shared/types.js.map +1 -0
  91. package/dist/tests/unit/artifacts.test.d.ts +1 -0
  92. package/dist/tests/unit/artifacts.test.js +243 -0
  93. package/dist/tests/unit/artifacts.test.js.map +1 -0
  94. package/dist/tests/unit/data-plane.test.d.ts +1 -0
  95. package/dist/tests/unit/data-plane.test.js +153 -0
  96. package/dist/tests/unit/data-plane.test.js.map +1 -0
  97. package/dist/tests/unit/degrade.test.d.ts +1 -0
  98. package/dist/tests/unit/degrade.test.js +133 -0
  99. package/dist/tests/unit/degrade.test.js.map +1 -0
  100. package/dist/tests/unit/diagnosis.test.d.ts +1 -0
  101. package/dist/tests/unit/diagnosis.test.js +66 -0
  102. package/dist/tests/unit/diagnosis.test.js.map +1 -0
  103. package/dist/tests/unit/errors.test.d.ts +1 -0
  104. package/dist/tests/unit/errors.test.js +83 -0
  105. package/dist/tests/unit/errors.test.js.map +1 -0
  106. package/dist/tests/unit/mcp-server.test.d.ts +1 -0
  107. package/dist/tests/unit/mcp-server.test.js +267 -0
  108. package/dist/tests/unit/mcp-server.test.js.map +1 -0
  109. package/dist/tests/unit/mcp-smoke.d.ts +6 -0
  110. package/dist/tests/unit/mcp-smoke.js +7 -0
  111. package/dist/tests/unit/mcp-smoke.js.map +1 -0
  112. package/dist/tests/unit/mcp-smoke.test.d.ts +1 -0
  113. package/dist/tests/unit/mcp-smoke.test.js +196 -0
  114. package/dist/tests/unit/mcp-smoke.test.js.map +1 -0
  115. package/dist/tests/unit/midi.test.d.ts +1 -0
  116. package/dist/tests/unit/midi.test.js +255 -0
  117. package/dist/tests/unit/midi.test.js.map +1 -0
  118. package/dist/tests/unit/pronunciation.test.d.ts +1 -0
  119. package/dist/tests/unit/pronunciation.test.js +83 -0
  120. package/dist/tests/unit/pronunciation.test.js.map +1 -0
  121. package/dist/tests/unit/registry-contract.test.d.ts +1 -0
  122. package/dist/tests/unit/registry-contract.test.js +114 -0
  123. package/dist/tests/unit/registry-contract.test.js.map +1 -0
  124. package/dist/tests/unit/render-orchestrator.test.d.ts +1 -0
  125. package/dist/tests/unit/render-orchestrator.test.js +548 -0
  126. package/dist/tests/unit/render-orchestrator.test.js.map +1 -0
  127. package/dist/tests/unit/sidecar.test.d.ts +1 -0
  128. package/dist/tests/unit/sidecar.test.js +299 -0
  129. package/dist/tests/unit/sidecar.test.js.map +1 -0
  130. package/dist/tests/unit/singers.test.d.ts +1 -0
  131. package/dist/tests/unit/singers.test.js +73 -0
  132. package/dist/tests/unit/singers.test.js.map +1 -0
  133. package/dist/tests/unit/skill-gate.test.d.ts +1 -0
  134. package/dist/tests/unit/skill-gate.test.js +182 -0
  135. package/dist/tests/unit/skill-gate.test.js.map +1 -0
  136. package/dist/tests/unit/svip-codec.test.d.ts +1 -0
  137. package/dist/tests/unit/svip-codec.test.js +182 -0
  138. package/dist/tests/unit/svip-codec.test.js.map +1 -0
  139. package/dist/tests/unit/svip-document.test.d.ts +1 -0
  140. package/dist/tests/unit/svip-document.test.js +137 -0
  141. package/dist/tests/unit/svip-document.test.js.map +1 -0
  142. package/dist/tests/unit/svip-editor.test.d.ts +1 -0
  143. package/dist/tests/unit/svip-editor.test.js +275 -0
  144. package/dist/tests/unit/svip-editor.test.js.map +1 -0
  145. package/dist/tests/unit/svip-tick.test.d.ts +1 -0
  146. package/dist/tests/unit/svip-tick.test.js +66 -0
  147. package/dist/tests/unit/svip-tick.test.js.map +1 -0
  148. package/dist/tools/common.d.ts +80 -0
  149. package/dist/tools/common.js +167 -0
  150. package/dist/tools/common.js.map +1 -0
  151. package/dist/tools/control.d.ts +21 -0
  152. package/dist/tools/control.js +376 -0
  153. package/dist/tools/control.js.map +1 -0
  154. package/dist/tools/data.d.ts +37 -0
  155. package/dist/tools/data.js +680 -0
  156. package/dist/tools/data.js.map +1 -0
  157. package/dist/tools/definition.d.ts +60 -0
  158. package/dist/tools/definition.js +44 -0
  159. package/dist/tools/definition.js.map +1 -0
  160. package/dist/tools/degrade.d.ts +3 -0
  161. package/dist/tools/degrade.js +30 -0
  162. package/dist/tools/degrade.js.map +1 -0
  163. package/dist/tools/guide.d.ts +10 -0
  164. package/dist/tools/guide.js +66 -0
  165. package/dist/tools/guide.js.map +1 -0
  166. package/dist/tools/open.d.ts +3 -0
  167. package/dist/tools/open.js +74 -0
  168. package/dist/tools/open.js.map +1 -0
  169. package/dist/tools/probe.d.ts +8 -0
  170. package/dist/tools/probe.js +132 -0
  171. package/dist/tools/probe.js.map +1 -0
  172. package/dist/tools/registry.d.ts +10 -0
  173. package/dist/tools/registry.js +16 -0
  174. package/dist/tools/registry.js.map +1 -0
  175. package/dist/version.d.ts +4 -0
  176. package/dist/version.js +19 -0
  177. package/dist/version.js.map +1 -0
  178. package/docs/DESIGN.md +553 -0
  179. package/docs/RECON-GUI.md +271 -0
  180. package/docs/RECON.md +339 -0
  181. package/docs/SPEC.md +786 -0
  182. package/docs/WINE.md +192 -0
  183. package/examples/.scratch/01-midi-to-wudi/wudi-demo.svip3 +0 -0
  184. package/examples/.scratch/01-midi-to-wudi/wudi-melody.mid +0 -0
  185. package/examples/.scratch/01-midi-to-wudi/wudi-roundtrip.mid +0 -0
  186. package/examples/.scratch/02-three-singers/melody.chenziyu.svip3 +0 -0
  187. package/examples/.scratch/02-three-singers/melody.hechang.svip3 +0 -0
  188. package/examples/.scratch/02-three-singers/melody.svip3 +0 -0
  189. package/examples/.scratch/02-three-singers/melody.wudi.svip3 +0 -0
  190. package/examples/.scratch/03-velocity-diction/phrase.svip3 +0 -0
  191. package/examples/.scratch/03-velocity-diction/phrase.svip3.bak.20261206-163755-200 +0 -0
  192. package/examples/.scratch/03-velocity-diction/phrase.svip3.bak.20261206-163755-203 +0 -0
  193. package/examples/.scratch/03-velocity-diction/phrase.svip3.bak.20261206-163755-204 +0 -0
  194. package/examples/.scratch/04-unknown-dialog-abort/dialog-demo.svip3 +0 -0
  195. package/examples/01-midi-to-wudi.mjs +144 -0
  196. package/examples/02-three-singers-compare.mjs +140 -0
  197. package/examples/03-velocity-diction-rerender.mjs +160 -0
  198. package/examples/04-unknown-dialog-abort.mjs +126 -0
  199. package/examples/README.md +101 -0
  200. package/examples/lib/harness.mjs +274 -0
  201. package/fixtures/midi/melody-480.mid +0 -0
  202. package/fixtures/midi/melody-96.mid +0 -0
  203. package/fixtures/svip/1.svip3 +0 -0
  204. package/fixtures/svip/3.svip3 +0 -0
  205. package/fixtures/uia/README.md +37 -0
  206. package/fixtures/uia/export-dialog.snapshot.json +446 -0
  207. package/fixtures/uia/main-window.snapshot.json +2997 -0
  208. package/fixtures/uia/open-dialog.snapshot.json +103 -0
  209. package/icon.svg +10 -0
  210. package/package.json +84 -4
  211. package/proto/xstudio.proto +128 -0
  212. package/scripts/check-contract.mjs +184 -0
  213. package/scripts/entry-smoke.mjs +26 -0
  214. package/scripts/inspect-svip.mjs +161 -0
  215. package/scripts/setup-venv.sh +93 -0
  216. package/scripts/wine-gui-probe.py +302 -0
  217. package/sidecar/xstudio_uia.py +1478 -0
  218. package/skills/xstudio-gui/SKILL.md +194 -0
  219. package/skills/xstudio-gui/assertions.md +103 -0
  220. package/skills/xstudio-gui/dialogs.md +90 -0
  221. package/skills/xstudio-gui/gestures.md +158 -0
  222. package/skills/xstudio-gui/ui-map.json +242 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,443 @@
1
+ # Changelog
2
+
3
+ All notable changes to `xstudio-linux` are documented here.
4
+
5
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) ·
6
+ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.3] — 2026-12-06
9
+
10
+ Accessibility-bridge investigation completed (all paths attempted), plus
11
+ keyboard-channel fixes that make the window layer stable.
12
+
13
+ ### Investigated (docs/WINE.md §4 rewritten as an attempt record)
14
+
15
+ - AT-SPI bus reachable, Wine process has no connection to it.
16
+ - wine-staging 11.23 `uiautomationcore.dll.so` contains zero AT-SPI/dbus
17
+ references — no bridge exists in this build.
18
+ - `wine explorer /desktop` attempted live: nests the app (sidecar gained
19
+ one-level nested window search), but no AT-SPI application appears and
20
+ keyboard routing gains a second Wine-internal hop. Normal launch remains
21
+ the recommended mode.
22
+ - Conclusion: element tree stays unreachable until Wine ships a UIA→AT-SPI
23
+ bridge; export automation and machine-observable render progress remain on
24
+ honest degraded paths.
25
+
26
+ ### Fixed
27
+
28
+ - **uinput device lifetime**: the virtual keyboard device was destroyed
29
+ immediately after emitting keys, and KWin/libinput missed them (journal
30
+ evidence: "Failed to open /dev/input/eventN device"). The device now lives
31
+ ~1.7 s (detected destroy timer) — keys are delivered reliably.
32
+ - **KWin activation script name collision**: `loadScript` returned −1 on a
33
+ registered name; script names now carry a UUID suffix.
34
+ - **wine-desktop nesting**: the sidecar searches one level of child windows,
35
+ so `xstudio_probe`/`activate` work under `wine explorer /desktop=…` too.
36
+ - **Foreground semantics**: ancestor containers (the wine-desktop window)
37
+ count as "the app owns the foreground".
38
+
39
+ ## [0.2.2] — 2026-12-06
40
+
41
+ The full loop works under Wine without the accessibility tree.
42
+
43
+ ### The insight
44
+
45
+ Keyboard synthesis is routed by the **Wayland compositor**, not the X server.
46
+ XTEST and `/dev/uinput` events reach plain X11 clients but never reached Wine —
47
+ until the window is activated at the KWin compositor level. After a temporary
48
+ KWin script sets `workspace.activeWindow`, a `/dev/uinput` Space key reached
49
+ Wine (verified by Wine CPU activity, an `XsToast`, and two TLS connections from
50
+ the Wine process to NetEase cloud hosts right after the render trigger).
51
+
52
+ ### Added
53
+
54
+ - **`xstudio_open`** (25th tool): opens a project by relaunching the exe with
55
+ the file as an argument — the single-instance app forwards the path
56
+ (verified live: window title becomes `网易云音乐·X Studio - <file>.svip3`).
57
+ No keyboard, no accessibility tree. Also wired as the orchestrator's
58
+ project-open fallback whenever the tree is unavailable.
59
+ - **Two-level window activation** in `activate_window`: KWin scripting
60
+ (compositor focus — the layer that routes keyboard) + EWMH deiconify/raise.
61
+ - **`/dev/uinput` keyboard channel** in `send_keys` (kernel-level, preferred)
62
+ with XTEST as fallback; combo syntax (`ctrl+o`, `Return`, `F5`, …) and an
63
+ extended keymap (digits, punctuation, F1–F12, modifiers).
64
+ - **Keyboard playback fallback**: when the play button cannot be found in the
65
+ tree, `startPlayback` sends Space through the sidecar (uinput first).
66
+ - **Window-level `preview_wait` fallback**: when the tree is unavailable it
67
+ polls the title/toast state and returns `completed: false` with honest
68
+ evidence instead of a tree error.
69
+ - **`XSTUDIO_SKILL_LOADED=1`** environment gate for standalone CLI/MCP: the
70
+ documented unlock for the nine GUI tools after reading the skill.
71
+
72
+ ### Fixed
73
+
74
+ - `GuiSidecar.probe()` argument passthrough, `xstudio_open`/gate registration
75
+ plumbing (25/25/25 contract), PID-level foreground check (Wine toasts and
76
+ dialogs count as "the user is in X Studio"), space tokenization in the
77
+ uinput path, `struct` import in the sidecar.
78
+
79
+ ### Verified live (2026-12-06, reference machine)
80
+
81
+ - `xstudio_open` opened `C:\xstudio-projects\new-song.svip3` in the running
82
+ instance (title polling OK).
83
+ - `xstudio_preview_trigger` full chain: probe(activate) → title match →
84
+ Space via uinput → **Wine established TLS connections to NetEase cloud**.
85
+ - `xstudio_preview_wait` window-level polling returns honest
86
+ `completed:false` evidence.
87
+ - 173/173 tests, contract 25/25/25, MCP smoke, entry smoke, 4 examples.
88
+
89
+ ## [0.2.1] — 2026-12-06
90
+
91
+ Window-layer capabilities, verified live against the running Wine instance.
92
+
93
+ ### Added
94
+
95
+ - **Window activation**: `xstudio_probe --json '{"activate":true}'` raises X
96
+ Studio via the window manager. Two-step under KWin/XWayland (verified
97
+ live): `WM_CHANGE_STATE` NormalState deiconifies, then EWMH
98
+ `_NET_ACTIVE_WINDOW` raises. The orchestrator calls it before opening the
99
+ project, so the classic minimized/focus-lost failure modes fix themselves.
100
+ `probe` now also reports `mapped` (iconic detection), `backend`
101
+ (`atspi` only when the tree is truly exposed, otherwise `x11-only`) and
102
+ `atspiLib` (importability diagnostics).
103
+ - **XTEST keyboard input** (`send_keys`): implemented directly in
104
+ python-xlib — no xdotool dependency. ASCII/Latin-1 verified live; CJK
105
+ characters fail explicitly with an input-method hint. `send_keys` is now a
106
+ window-level op: `xstudio_ui_act {op:"send_keys", value:"…"}` no longer
107
+ requires a snapshot `ref` and works without the accessibility tree.
108
+ - **Environment bootstrap**: `pnpm run setup:venv` /
109
+ `setup:venv.sh` creates `.venv/` (system-site-packages + python-xlib) and
110
+ verifies both backends; `check:venv` re-verifies.
111
+
112
+ ### Fixed
113
+
114
+ - `GuiSidecar.probe()` dropped its argument client-side — the `activate`
115
+ option never reached the sidecar (found by the iconify→activate→restore
116
+ live round trip).
117
+ - `xstudio_probe`'s sidecar URL had one extra `../` after the file move
118
+ (reported `sidecar: missing`); probe now also surfaces the window state
119
+ (title/mapped/foreground) through the sidecar without a circular import.
120
+ - Stale error message referencing `uia.ps1`/PowerShell replaced with the
121
+ Python sidecar equivalents; snapshot output now carries
122
+ `tree_available` + `snapshot_token`.
123
+
124
+ ### Verified live (reference machine, 2026-12-06)
125
+
126
+ - iconify → `xstudio_probe {"activate":true}` → WM_STATE Normal, foreground,
127
+ input focus on the window; `send_keys` delivers XTEST keystrokes to the app.
128
+ - `preview_trigger` degradation paths: `GUI_FOCUS_LOST` fast-fail with the
129
+ activate hint; tree-missing `GUI_ACTION_FAILED` names the missing UI.
130
+ - 173/173 tests, contract 24/24/24, MCP smoke, entry smoke, 4 examples.
131
+
132
+ ## [0.2.0] — 2026-12-05
133
+
134
+ Linux/Wine standalone edition. Branch `linux-standalone`; the `main` branch
135
+ preserves the Windows/DSH 0.1.2 state.
136
+
137
+ ### Removed
138
+
139
+ - **DeepSeek Harness host layer.** `adapter-dsh/` plugin entry, Cordis context
140
+ wiring, the skill-gate host probe and `cordis.patch.yml` are gone; the
141
+ package is a plain TypeScript library + CLI + MCP server. The single runtime
142
+ `@deepseek-ai/schemastery` dependency was replaced by a hand-rolled config
143
+ validator (`src/config.ts`); `@deepseek-ai/cordis` (never imported) and
144
+ `@deepseek-ai/dsh-tools` (one test) were dropped with it.
145
+ - **Tavily knowledge enrichment** (`src/core/tavily/`, fixtures, five test
146
+ files): singer catalog refresh, network pronunciation lookup and network
147
+ dialog diagnosis were removed. The package now makes **zero outbound
148
+ network calls** — the singer catalog is the built-in seed list, phonemes
149
+ come from the deterministic local rule table, and unknown dialogs always
150
+ return the safe `manual` action. `via` no longer contains `"tavily"`.
151
+ - **Windows UIA sidecar** (`sidecar/uia.ps1`, `src/host/win.ts`).
152
+
153
+ ### Added
154
+
155
+ - **Standalone CLI** (`src/adapter-cli/cli.ts`, bin `xstudio`):
156
+ `xstudio --list-tools`, `xstudio <tool> --json '<args>'`,
157
+ `xstudio <tool> --args @file.json`, `--config`, `--version`. One process per
158
+ call; exit 0/1 follows `ok`, 2 on usage errors.
159
+ - **Programmatic API** (`src/index.ts`): `resolveConfig`, `createServices`,
160
+ `buildToolDefinitions`, `defineTool`, error/envelope exports.
161
+ - **Wine path translation** (`src/host/wine-paths.ts`): dosdevices symlink
162
+ scan + explicit `wine.driveMappings` overrides + `Z:` fallback; wired into
163
+ the orchestrator at project-open, export-dir picker and both
164
+ `file_path_label` comparisons.
165
+ - **Linux host probes** (`src/host/linux.ts`): `pgrep -f` process discovery
166
+ and `xdotool` foreground title.
167
+ - **Python AT-SPI2/X11 sidecar** (`sidecar/xstudio_uia.py`): the exact
168
+ JSON-lines protocol of the Windows sidecar (same methods, same ref token
169
+ scheme, same error codes, same destructive blacklist). Backends degrade
170
+ independently: pyatspi → gi Atspi for the tree, Xlib → xdotool for windows;
171
+ `probe` reports which backend is live.
172
+ - **Wine GUI calibration probe** (`scripts/wine-gui-probe.py`, `pnpm run
173
+ wine:probe`): read-only report of X11 windows, the matcher result and the
174
+ AT-SPI tree; documented in `docs/WINE.md`.
175
+ - **Install-dir auto-detection**: first existing candidate under the Wine
176
+ prefix when neither config nor `XSTUDIO_INSTALL_DIR` names one.
177
+ - Config section `wine: { prefix, driveMappings }`; `workspaceDir` default
178
+ moved to `~/.xstudio/`.
179
+
180
+ ### Changed
181
+
182
+ - Package renamed `dsh-xstudio` → `xstudio-linux`, version 0.2.0; exports
183
+ `.` / `./mcp` / `./cli`; bins `xstudio` + `xstudio-mcp`.
184
+ - Environment variables `DSH_XSTUDIO_*` → `XSTUDIO_*`; `XSTUDIO_PYTHON`
185
+ replaces the pwsh knob; `TAVILY_API_KEY` is no longer read.
186
+ - The MCP server, skill gate (`NEED_SKILL`), skill content, contract checker
187
+ and CI continue to work unchanged in spirit; CI moved to `ubuntu-latest`
188
+ (Node 20/22/24) plus a Python sidecar-protocol job.
189
+ - Tests: 174 total (173 pass, 1 platform-skip) — Tavily suites removed,
190
+ catalog/pronunciation/diagnosis suites rewritten for local-only behavior,
191
+ new expectations for wine paths and the Python sidecar spawn.
192
+
193
+ ### Verified
194
+
195
+ - typecheck clean; `node --test` from dist/: 173 pass / 0 fail.
196
+ - contract check OK (24 registry / 24 MCP / 24 README).
197
+ - MCP stdio smoke pass; entry smoke pass; all four examples exit 0.
198
+ - CLI exercised live on a real machine against real fixtures
199
+ (`xstudio_probe` detected the running Wine instance; `xstudio_project_read`
200
+ decoded `fixtures/svip/1.svip3`).
201
+ - Wine GUI calibration on the reference machine: AT-SPI desktop reachable,
202
+ Wine/X Studio application not exposed (expected; see docs/WINE.md §4) —
203
+ GUI element actions degrade explicitly to `GUI_REF_NOT_FOUND` → guide.
204
+
205
+
206
+ ## [0.1.2] — 2026-10-18
207
+
208
+ ### Added
209
+
210
+ - **Hard runtime gate: GUI control-plane tools now require the `xstudio-gui`
211
+ skill to be loaded before invocation.** Unmet precondition returns structured
212
+ `NEED_SKILL` with actionable next-step guidance (including the UIA-wedge
213
+ recovery procedure). Data-plane tools are unaffected. Falls back to a one-time
214
+ prompt when the host does not expose skill-load state, so tools can never
215
+ become permanently unreachable.
216
+ - The gate is per session, derived from the host session history: a successful
217
+ `skill({name:"xstudio-gui"})` call (direct, assistant-message or PTC-nested)
218
+ or a successful read of `skills/xstudio-gui/SKILL.md`. `xstudio_probe` and
219
+ the skill-loading action itself are exempt; only the eight GUI tools are gated.
220
+ - `NEED_SKILL` is a first-class error code whose `hint` names the destructive
221
+ blacklist, focus-gate semantics, dialog escalation and the UIA-wedge recovery.
222
+ **This gate depends on the `asXStudioError` passthrough fix listed under
223
+ Fixed below** — without it `NEED_SKILL` would have been flattened to
224
+ `PROJECT_INVALID` and the guidance unreadable. Passthrough is regression-tested.
225
+ - `SKILL.md` gained the UIA channel wedge section (defect #1: modal `#32770`
226
+ blocks the Qt UIA provider — kill the sidecar instead of retrying to timeout),
227
+ the explicit unknown-dialog human-escalation rule, and the export combo-popup
228
+ limitation (defect #2).
229
+ - Guidance prompt now states the hard rule and correct order: load skill →
230
+ probe → operate; do not retry to bypass.
231
+ - Contract checker additionally asserts that every GUI tool description names
232
+ the required skill, and that no non-GUI tool claims a gate.
233
+
234
+ ### Fixed
235
+
236
+ - **Unify the foreground-guard error code to `GUI_FOCUS_LOST` across all GUI
237
+ tools.** GUI-sidecar failures had been crossing the tool boundary with the
238
+ wrong code: `asXStudioError` (the catch-all in the tool wrapper) flattened
239
+ every non-`XStudioError` throw to the default `PROJECT_INVALID`, so sidecar
240
+ rejections surfaced as `PROJECT_INVALID` even though the sidecar protocol had
241
+ sent the stable code. `asXStudioError` now preserves any structured error that
242
+ carries a stable plugin code (`SidecarError` with `GUI_REF_NOT_FOUND` /
243
+ `GUI_FOCUS_LOST` / `GUI_ACTION_FAILED`, and the knowledge-plane `TAVILY_*`
244
+ codes); only untyped errors fall back to the caller-supplied code. Observable
245
+ result: `xstudio_ui_act`'s foreground guard and stale-ref rejection now
246
+ report `GUI_FOCUS_LOST` / `GUI_REF_NOT_FOUND` — consistent with the
247
+ orchestrator-level codes and with skill §2/§6. Discovered by live end-to-end
248
+ QA 2026-10-18. New `src/tests/unit/errors.test.ts` pins the coercion contract
249
+ (8 tests).
250
+
251
+ ### Verification
252
+
253
+ - 236/236 unit tests (11 new gate cases), contract check OK (24/24/24/24).
254
+ - Live: ungated session blocked with `NEED_SKILL` in 36 ms and **zero sidecar
255
+ calls** (sidecar process count constant across three blocked invocations);
256
+ after `skill({name:"xstudio-gui"})` the same snapshot returned the live tree
257
+ (37 elements on the app's start window; 131 when a project open); a fresh
258
+ independent agent session was blocked twice (NEED_SKILL, not a one-time pass)
259
+ while its data-plane `project_read` succeeded; `xstudio_probe` remained
260
+ available.
261
+ - Gate ordering verified live and by test: the skill gate runs **before** the
262
+ sidecar request and **before** the foreground check, so a model that has not
263
+ read the skill sees `NEED_SKILL` rather than `GUI_FOCUS_LOST`.
264
+
265
+ ## [0.1.1] — 2026-10-18
266
+
267
+ Live Tavily integration through the official Tavily CLI, plus post-release fixes
268
+ from the live verification round.
269
+
270
+ ### Added
271
+
272
+ - Tavily credentials from the Tavily CLI file `~/.tavily/config.json`
273
+ (`tavily.oauthConfigPath`, default that path; `''` disables discovery):
274
+ - a plain `api_key` (from `tvly login --api-key`) is used with the REST API
275
+ `https://api.tavily.com/search`;
276
+ - a `tvly login` OAuth session is used with Tavily's MCP endpoint
277
+ `https://mcp.tavily.com/mcp` (Streamable HTTP JSON-RPC: `initialize` →
278
+ `notifications/initialized` → `tools/call tavily_search`), normalized into
279
+ the same sanitized `TavilySearchResult`.
280
+ - The plugin never writes, refreshes or revokes the CLI's credentials; an expired
281
+ access token degrades with a typed `oauth-expired` failure and a
282
+ "run `tvly login`" hint (≈24 h lifetime).
283
+ - `xstudio_probe` reports `tavily.authMode` (`api-key` / `oauth` / `none`).
284
+ - Built-in singer catalog expanded to the documented WOWAIDO roster (伍笛 plus
285
+ the 12 debut members) with a targeted roster refresh query; new live-roster
286
+ fixture and parser test.
287
+
288
+ ### Fixed
289
+
290
+ - Tool content blocks rendered the **arguments** instead of the **result** in
291
+ MCP `tools/call`: the local `jsonRender` adapter is called as `(args, value)`
292
+ but rendered its first parameter. `content` and `structuredContent` now agree.
293
+ - `xstudio_batch` reported success without materializing the output file when a
294
+ job's target singer equalled the source singer (the document writer's no-op
295
+ path wrote nothing). Batch now materializes `out_path` and reports `changed`.
296
+ - Live `xstudio_singers_list({refresh:true})` parsed no singers from a generic
297
+ search and fell back; the targeted roster query now yields `via: "tavily"`
298
+ with 13 names in this environment.
299
+
300
+ ### Verification
301
+
302
+ - 217/217 unit tests pass, including new OAuth/MCP transport tests (credential
303
+ parsing, auth precedence, expiry, SSE framing, sanitization, breaker
304
+ integration).
305
+ - Live through the installed plugin (2026-10-18): `xstudio_probe` →
306
+ `authMode: "oauth"`; `xstudio_singers_list({refresh:true})` → 13 singers,
307
+ `via: "tavily"`; rare-character pronunciation → `via: "tavily"`; unknown
308
+ dialog diagnosis through `xstudio_ui_dialog_respond` → `via: "tavily"`.
309
+ - **Live end-to-end render round (2026-10-18, human-confirmed):**
310
+ `xstudio_preview_trigger` acked twice with the full step chain (probe
311
+ pid/foreground → project-open short-circuit → `play_or_pause_btn_` invoke);
312
+ `xstudio_preview_wait` returned `playing=true` with the progress bar
313
+ advancing; the user heard the vocal ~3–4 s after the second trigger, with no
314
+ error dialog and a CPU spike. Export remains deferred (defect #2).
315
+ - Two modal-`#32770` UIA-channel wedge incidents were reproduced and survived
316
+ (kill sidecar → host respawns → snapshot recovers); root-caused as defect #1
317
+ and the recovery procedure written into `SKILL.md` for 0.1.2.
318
+
319
+ ## [0.1.0](https://example.invalid/dsh-xstudio/releases/tag/v0.1.0) — 2026-10-18
320
+
321
+ First public release: X Studio (NetEase Cloud Music edition) `.svip3` data
322
+ plane + UIA control plane + Tavily knowledge enrichment for DeepSeek Harness
323
+ 0.2.1-rc.2, exposed as both a DSH Host plugin and a stdio MCP server.
324
+
325
+ ### Added
326
+
327
+ - **Data plane (24 tools total; 15 data-plane).** `xstudio_probe`,
328
+ `xstudio_singers_list`, `xstudio_project_read`, `xstudio_project_create`,
329
+ `xstudio_note_add`, `xstudio_note_remove`, `xstudio_note_edit`,
330
+ `xstudio_tempo_set`, `xstudio_timesig_set`, `xstudio_velocity_set`,
331
+ `xstudio_gain_set`, `xstudio_lyrics_align`, `xstudio_midi_import`,
332
+ `xstudio_midi_export`, `xstudio_batch`.
333
+ - **`.svip3` codec** for the reverse-engineered `xstudio.proto` protobuf
334
+ message: byte-identical decode→encode round trip on two real 363-byte
335
+ fixtures, unknown-field preservation, absolute-tick note semantics
336
+ (PPQ = 480), `source_path` normalization, atomic writes with
337
+ `*.bak.<timestamp>` backups and no-op write detection.
338
+ - **GUI control plane** through a PowerShell 7 / .NET `UIAutomation` sidecar:
339
+ `xstudio_preview_trigger`, `xstudio_preview_wait`, `xstudio_export_run`,
340
+ `xstudio_ui_snapshot`, `xstudio_ui_act`, `xstudio_ui_assert`,
341
+ `xstudio_ui_dialog_respond`, `xstudio_ui_abort`. Snapshot-scoped refs only,
342
+ no cached coordinates, one action per call, destructive-dialog blacklist,
343
+ step/wall-clock/consecutive-failure budgets, fail-fast assertions.
344
+ - **Tavily knowledge layer**: singer catalog refresh (7-day TTL cache),
345
+ polyphone pronunciation lookup for low-confidence characters (one character +
346
+ 2-character context only), unknown-dialog diagnosis returning an action enum
347
+ only. Shared client with a 3-failure/300-second circuit breaker, sliding
348
+ window rate limit, sanitized results, and explicit `local-fallback` behavior
349
+ when disabled, unkeyed, offline or cooling down.
350
+ - **Degrade path**: `xstudio_guide_print` prints manual menu paths/steps
351
+ (`render`, `export`, `dialogs`, `recovery`) whenever the GUI cannot be driven.
352
+ - **Dual channel**: the same definitions power the DSH Host plugin and the
353
+ stdio MCP server (`node dist/adapter-mcp/server.js`, MCP 2024-11-05,
354
+ newline-delimited JSON-RPC 2.0, `structuredContent` + `isError` on results);
355
+ `scripts/check-contract.mjs` fails CI if the two surfaces or the README tool
356
+ table drift.
357
+ - **Bundled skill** `skills/xstudio-gui/` (SKILL.md, ui-map.json, gestures.md,
358
+ dialogs.md, assertions.md) registered through `ctx.skills` when available,
359
+ plus a model-facing guidance system-prompt section.
360
+ - **Config**: Schemastery-validated Loader row covering install dir, workspace,
361
+ backup policy, GUI budgets, degradation chain and the full `tavily` subtree;
362
+ MCP server reads `--config` JSON and `DSH_XSTUDIO_*` / `TAVILY_API_KEY` env
363
+ overrides.
364
+ - **Docs & release**: README (compliance red lines first, tool tables,
365
+ degradation matrix, blacklist, Not Supported, troubleshooting), `docs/DESIGN.md`,
366
+ the normative `docs/SPEC.md`, the evidence record `docs/RECON.md`, GUI recon,
367
+ `proto/xstudio.proto`, real fixtures, five runnable examples, `.dsh/mcp.yml`
368
+ template, MIT LICENSE, GitHub Actions CI.
369
+ - **Tests**: node:test suites for codec round-trip/unknown fields, note CRUD and
370
+ absolute positions, document backup/no-op writes, MIDI parse/write, Tavily
371
+ client/sanitizer/breaker/cache, singer catalog, pronunciation, dialog
372
+ diagnosis, degrade chain, tool data plane, MCP JSON-RPC protocol and
373
+ DSH↔MCP contract.
374
+
375
+ ### Verification status at release
376
+
377
+ - ✅ **Verified live in the desktop profile (2026-10-18):** package installed via
378
+ `plugin_manager install_bundle` (`application: "applied"`, bundle
379
+ `dsh-xstudio` 0.1.0); 24 `xstudio_*` tools visible; `xstudio-gui` skill and
380
+ `dsh-xstudio` guidance prompt section active; `Config` schema projected;
381
+ `xstudio_probe` (installed/running/workspace/sidecar/Tavily state),
382
+ `xstudio_singers_list` (local fallback + warning),
383
+ `project_read` / `note_add` / `note_edit` / `tempo_set` / `velocity_set` on a real
384
+ fixture copy (byte-level `*.bak` backup created), `ui_snapshot` (live
385
+ elements, `Qt622QWindowIcon`), `ui_assert` on window text, `guide_print`.
386
+ - ✅ **Verified by executable checks:** `.svip3` round trip byte-identical on real
387
+ fixtures; field semantics, tick math and absolute positions; data-plane
388
+ behavior; Tavily layer against mock/fixture responses (offline); MCP protocol
389
+ framing + spawned-server smoke; tool-surface contract (24/24/24); full test
390
+ suite 210/210 passing; all five examples run against the built `dist/`.
391
+ - ⚠️ **Not verified live in this environment (as of 0.1.0):** Tavily live calls
392
+ (no `TAVILY_API_KEY` configured — superseded by the 0.1.1 live round), and the
393
+ full open-project / cloud-render / export end-to-end. The open-project +
394
+ render path was subsequently verified live with human-confirmed audio in the
395
+ 0.1.1 round; export remains deferred (defect #2). These paths are unit-tested
396
+ with a fake/fixture layer and degrade explicitly at runtime.
397
+ - ℹ️ The 创造模式 (Cordis) preset could not be exercised as the session preset:
398
+ this session's agent preset is `liangshen`, and preset selection is a Web-UI
399
+ action. `docs/preset-output-snapshot.txt` records the recovered baseline and
400
+ the permitted deviations.
401
+ - ℹ️ GitHub Actions workflow is provided but has not run on GitHub from this
402
+ environment (no remote configured).
403
+
404
+ ### Known limitations
405
+
406
+ - From-scratch projects cannot preserve future unknown fields; edit a template
407
+ project when forward compatibility matters.
408
+ - Export format/sample rate/bitrate live only in the GUI export dialog, never
409
+ in the `.svip3` file.
410
+ - Read-only pass-through fields (`internal_clock_base` 115200 ≠ PPQ, `total_ticks`,
411
+ `flags`, `visibility_mask`, track `start_tick`/`end_tick`, `note_flag`,
412
+ `expr_param_*` −1.0 sentinel) are never reinterpreted.
413
+ - One singing track per project; instrument/multi-track editing is not
414
+ implemented. No per-note expression or hide editing.
415
+ - `xstudio_batch` writes files only; each variant still needs a separate GUI
416
+ render/export run.
417
+ - Windows only (PowerShell 7 + .NET UIAutomation sidecar).
418
+ - No login, resource-download, paywall or DRM automation by design.
419
+
420
+ ### Security / compliance
421
+
422
+ No binary patching, injection or credential extraction; no auth/paywall/DRM
423
+ bypass; no vendor binaries bundled; local user instance only; no fake worker
424
+ shared-memory protocol; ToS purpose limited to interoperability and personal
425
+ creative assistance.
426
+
427
+ Reverse-engineered protobuf schema disclosed as such; immediate takedown on a
428
+ rights-holder request.
429
+
430
+ Tavily: public pages only, no login-gated crawling, TTL-bounded cache, no
431
+ search-history retention, API key never logged; search results are sanitized
432
+ data and can never be executed (diagnosis returns a predefined enum only).
433
+
434
+ ## [Unreleased]
435
+
436
+ _No unreleased changes._ The `asXStudioError` passthrough fix that had been
437
+ staged here shipped in **0.1.2**, which the skill gate depends on.
438
+
439
+ Deferred backlog (tracked as defects, not pending changes): #1 UIA-channel wedge
440
+ runspace wrapping (v0.2.0 target), #2 export combo-popup UIA reachability,
441
+ #4 `preview_wait` silent-tail sensitivity, #5 `FOCUS_YIELD` resume event,
442
+ #6 HomeWidget-state trigger wording.
443
+
package/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-xstudio contributors
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.
22
+
23
+ ---
24
+
25
+ Scope note: this license covers only the source code and documentation in
26
+ this repository. It grants no rights to NetEase Cloud Music / X Studio, their
27
+ binaries, voice models or other assets, none of which are distributed here.
28
+ This project is an independent interoperability effort and is not affiliated
29
+ with or endorsed by NetEase Cloud Music, Microsoft Xiaoice, or the DeepSeek
30
+ Harness maintainers. If a rights holder believes this project oversteps, open
31
+ an issue titled "takedown" and the repository will be removed promptly.