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