@shiqianjiang/ceru-plugin-cli 0.1.1 → 0.2.0

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 (153) hide show
  1. package/README.md +9 -5
  2. package/assets/catalog.json +1 -1
  3. package/assets/core-contracts.js +1 -0
  4. package/assets/index.html +94 -93
  5. package/assets/playground.js +293 -30
  6. package/assets/sandbox.js +50 -19
  7. package/assets/style.css +16 -0
  8. package/dist/dependencies.d.ts +6 -0
  9. package/dist/dependencies.js +45 -0
  10. package/dist/dev.d.ts +2 -0
  11. package/dist/dev.js +297 -144
  12. package/dist/frameworks.d.ts +2 -2
  13. package/dist/frameworks.js +11 -29
  14. package/dist/index.js +12 -4
  15. package/dist/project.d.ts +1 -0
  16. package/dist/project.js +48 -21
  17. package/dist/socket-broker.d.ts +23 -0
  18. package/dist/socket-broker.js +230 -0
  19. package/package.json +71 -67
  20. package/schemas/config.schema.json +349 -0
  21. package/templates/connected-library/js/.vscode/ceru.code-snippets +37 -9
  22. package/templates/connected-library/js/.vscode/launch.json +36 -46
  23. package/templates/connected-library/js/.vscode/tasks.json +11 -3
  24. package/templates/connected-library/js/README.md +7 -2
  25. package/templates/connected-library/js/ceru-plugin.code-workspace +8 -0
  26. package/templates/connected-library/js/package.json +4 -3
  27. package/templates/connected-library/js/src/index.js +7 -5
  28. package/templates/connected-library/ts/.vscode/ceru.code-snippets +37 -9
  29. package/templates/connected-library/ts/.vscode/launch.json +36 -46
  30. package/templates/connected-library/ts/.vscode/tasks.json +11 -3
  31. package/templates/connected-library/ts/README.md +7 -2
  32. package/templates/connected-library/ts/ceru-plugin.code-workspace +8 -0
  33. package/templates/connected-library/ts/package.json +4 -3
  34. package/templates/connected-library/ts/src/index.ts +7 -5
  35. package/templates/guest-adapter/js/.vscode/ceru.code-snippets +37 -9
  36. package/templates/guest-adapter/js/.vscode/launch.json +36 -46
  37. package/templates/guest-adapter/js/.vscode/tasks.json +11 -3
  38. package/templates/guest-adapter/js/README.md +7 -2
  39. package/templates/guest-adapter/js/ceru-plugin.code-workspace +8 -0
  40. package/templates/guest-adapter/js/package.json +4 -3
  41. package/templates/guest-adapter/ts/.vscode/ceru.code-snippets +37 -9
  42. package/templates/guest-adapter/ts/.vscode/launch.json +36 -46
  43. package/templates/guest-adapter/ts/.vscode/tasks.json +11 -3
  44. package/templates/guest-adapter/ts/README.md +7 -2
  45. package/templates/guest-adapter/ts/ceru-plugin.code-workspace +8 -0
  46. package/templates/guest-adapter/ts/package.json +4 -3
  47. package/templates/importer/js/.vscode/ceru.code-snippets +37 -9
  48. package/templates/importer/js/.vscode/launch.json +36 -46
  49. package/templates/importer/js/.vscode/tasks.json +11 -3
  50. package/templates/importer/js/README.md +8 -3
  51. package/templates/importer/js/ceru-plugin.code-workspace +8 -0
  52. package/templates/importer/js/ceru.plugin.json +8 -24
  53. package/templates/importer/js/package.json +4 -3
  54. package/templates/importer/js/src/index.js +28 -34
  55. package/templates/importer/ts/.vscode/ceru.code-snippets +37 -9
  56. package/templates/importer/ts/.vscode/launch.json +36 -46
  57. package/templates/importer/ts/.vscode/tasks.json +11 -3
  58. package/templates/importer/ts/README.md +8 -3
  59. package/templates/importer/ts/ceru-plugin.code-workspace +8 -0
  60. package/templates/importer/ts/ceru.plugin.json +8 -24
  61. package/templates/importer/ts/package.json +4 -3
  62. package/templates/importer/ts/src/index.ts +28 -34
  63. package/templates/react/js/.vscode/ceru.code-snippets +37 -9
  64. package/templates/react/js/.vscode/launch.json +36 -46
  65. package/templates/react/js/.vscode/tasks.json +11 -3
  66. package/templates/react/js/README.md +7 -2
  67. package/templates/react/js/ceru-plugin.code-workspace +8 -0
  68. package/templates/react/js/ceru.plugin.json +1 -5
  69. package/templates/react/js/package.json +4 -3
  70. package/templates/react/ts/.vscode/ceru.code-snippets +37 -9
  71. package/templates/react/ts/.vscode/launch.json +36 -46
  72. package/templates/react/ts/.vscode/tasks.json +11 -3
  73. package/templates/react/ts/README.md +7 -2
  74. package/templates/react/ts/ceru-plugin.code-workspace +8 -0
  75. package/templates/react/ts/ceru.plugin.json +1 -5
  76. package/templates/react/ts/package.json +4 -3
  77. package/templates/snapshot.json +22 -2
  78. package/templates/source/js/.vscode/ceru.code-snippets +37 -9
  79. package/templates/source/js/.vscode/launch.json +36 -46
  80. package/templates/source/js/.vscode/tasks.json +11 -3
  81. package/templates/source/js/README.md +7 -2
  82. package/templates/source/js/ceru-plugin.code-workspace +8 -0
  83. package/templates/source/js/ceru.plugin.json +9 -0
  84. package/templates/source/js/package.json +4 -3
  85. package/templates/source/js/src/index.js +29 -26
  86. package/templates/source/ts/.vscode/ceru.code-snippets +37 -9
  87. package/templates/source/ts/.vscode/launch.json +36 -46
  88. package/templates/source/ts/.vscode/tasks.json +11 -3
  89. package/templates/source/ts/README.md +7 -2
  90. package/templates/source/ts/ceru-plugin.code-workspace +8 -0
  91. package/templates/source/ts/ceru.plugin.json +9 -0
  92. package/templates/source/ts/package.json +4 -3
  93. package/templates/source/ts/src/index.ts +29 -26
  94. package/templates/vue/js/.vscode/ceru.code-snippets +37 -9
  95. package/templates/vue/js/.vscode/launch.json +36 -46
  96. package/templates/vue/js/.vscode/tasks.json +11 -3
  97. package/templates/vue/js/README.md +7 -2
  98. package/templates/vue/js/ceru-plugin.code-workspace +8 -0
  99. package/templates/vue/js/ceru.plugin.json +1 -4
  100. package/templates/vue/js/package.json +4 -3
  101. package/templates/vue/ts/.vscode/ceru.code-snippets +37 -9
  102. package/templates/vue/ts/.vscode/launch.json +36 -46
  103. package/templates/vue/ts/.vscode/tasks.json +11 -3
  104. package/templates/vue/ts/README.md +7 -2
  105. package/templates/vue/ts/ceru-plugin.code-workspace +8 -0
  106. package/templates/vue/ts/ceru.plugin.json +1 -4
  107. package/templates/vue/ts/package.json +4 -3
  108. package/templates/vue-tsx/js/.vscode/ceru.code-snippets +37 -9
  109. package/templates/vue-tsx/js/.vscode/launch.json +36 -46
  110. package/templates/vue-tsx/js/.vscode/tasks.json +11 -3
  111. package/templates/vue-tsx/js/README.md +7 -2
  112. package/templates/vue-tsx/js/ceru-plugin.code-workspace +8 -0
  113. package/templates/vue-tsx/js/ceru.plugin.json +1 -4
  114. package/templates/vue-tsx/js/package.json +4 -3
  115. package/templates/vue-tsx/ts/.vscode/ceru.code-snippets +37 -9
  116. package/templates/vue-tsx/ts/.vscode/launch.json +36 -46
  117. package/templates/vue-tsx/ts/.vscode/tasks.json +11 -3
  118. package/templates/vue-tsx/ts/README.md +7 -2
  119. package/templates/vue-tsx/ts/ceru-plugin.code-workspace +8 -0
  120. package/templates/vue-tsx/ts/ceru.plugin.json +1 -4
  121. package/templates/vue-tsx/ts/package.json +4 -3
  122. package/templates/web-dist/js/.vscode/ceru.code-snippets +37 -9
  123. package/templates/web-dist/js/.vscode/launch.json +36 -46
  124. package/templates/web-dist/js/.vscode/tasks.json +11 -3
  125. package/templates/web-dist/js/README.md +7 -2
  126. package/templates/web-dist/js/ceru-plugin.code-workspace +8 -0
  127. package/templates/web-dist/js/package.json +4 -3
  128. package/templates/web-dist/ts/.vscode/ceru.code-snippets +37 -9
  129. package/templates/web-dist/ts/.vscode/launch.json +36 -46
  130. package/templates/web-dist/ts/.vscode/tasks.json +11 -3
  131. package/templates/web-dist/ts/README.md +7 -2
  132. package/templates/web-dist/ts/ceru-plugin.code-workspace +8 -0
  133. package/templates/web-dist/ts/package.json +4 -3
  134. package/templates/web-surface/js/.vscode/ceru.code-snippets +37 -9
  135. package/templates/web-surface/js/.vscode/launch.json +36 -46
  136. package/templates/web-surface/js/.vscode/tasks.json +11 -3
  137. package/templates/web-surface/js/README.md +7 -2
  138. package/templates/web-surface/js/ceru-plugin.code-workspace +8 -0
  139. package/templates/web-surface/js/ceru.plugin.json +9 -0
  140. package/templates/web-surface/js/package.json +4 -3
  141. package/templates/web-surface/js/src/view.js +4 -1
  142. package/templates/web-surface/js/ui/search-note.css +3 -0
  143. package/templates/web-surface/ts/.vscode/ceru.code-snippets +37 -9
  144. package/templates/web-surface/ts/.vscode/launch.json +36 -46
  145. package/templates/web-surface/ts/.vscode/tasks.json +11 -3
  146. package/templates/web-surface/ts/README.md +7 -2
  147. package/templates/web-surface/ts/ceru-plugin.code-workspace +8 -0
  148. package/templates/web-surface/ts/ceru.plugin.json +9 -0
  149. package/templates/web-surface/ts/package.json +4 -3
  150. package/templates/web-surface/ts/src/view.ts +4 -1
  151. package/templates/web-surface/ts/ui/search-note.css +3 -0
  152. package/assets/shared-react.js +0 -77
  153. package/assets/shared-vue.js +0 -44
@@ -0,0 +1 @@
1
+ var i=r=>!!r&&typeof r=="object"&&!Array.isArray(r),s=(r,e=4096)=>typeof r=="string"&&r.length<=e,o=r=>Number.isFinite(r)&&Number(r)>=0;function l(r){if(!i(r)||!["pluginId","providerId","kind","id"].every(e=>s(r[e],2048)&&r[e].length>0))throw new Error("Invalid resource reference");if(r.data!==void 0){if(!i(r.data))throw new Error("Invalid resource private data");let e;try{e=JSON.stringify(r.data)}catch{throw new Error("Resource private data must be JSON")}if(new TextEncoder().encode(e).byteLength>64*1024)throw new Error("Resource private data exceeds 64 KiB")}}function c(r){if(!i(r)||!Array.isArray(r.items)||r.items.length>1e4)throw new Error("Invalid content page");if(r.nextCursor!=null&&(!s(r.nextCursor,2048)||!r.nextCursor.length))throw new Error("Invalid pagination cursor");for(let e of r.items){if(!i(e)||!s(e.title)||!Array.isArray(e.capabilities)||!e.capabilities.every(t=>s(t,128)))throw new Error("Invalid content item");if(l(e.ref),e.ref.kind==="track"){if(!i(e.metadata)||!Array.isArray(e.metadata.artists)||!e.metadata.artists.every(t=>s(t)))throw new Error("Track metadata must contain artists");if(e.metadata.durationMs!==void 0&&!o(e.metadata.durationMs))throw new Error("Invalid track duration")}if(e.ref.kind==="playlist"&&e.playlist!==void 0){if(!i(e.playlist))throw new Error("Invalid playlist metadata");if(e.playlist.trackCount!==void 0&&(!Number.isInteger(e.playlist.trackCount)||e.playlist.trackCount<0))throw new Error("Invalid playlist track count")}if(e.ref.kind==="chart"&&e.chart!==void 0&&!i(e.chart))throw new Error("Invalid chart metadata")}}function p(r){if(!i(r)||typeof r.ok!="boolean")throw new Error("Invalid resolve result");if(r.ok){if(!s(r.url,8192))throw new Error("Invalid playback URL");let e=new URL(r.url);if(!["http:","https:"].includes(e.protocol))throw new Error("Invalid playback protocol");if(r.expiresAt!==void 0&&!o(r.expiresAt))throw new Error("Invalid playback expiry");return}if(!i(r.error)||!s(r.error.code,128)||!s(r.error.message,65536))throw new Error("Invalid music fault")}function m(r){if(!i(r)||r.version!==1||!Number.isFinite(r.offsetMs)||!Array.isArray(r.lines)||r.lines.length>2e4)throw new Error("Invalid lyrics document");l(r.track);let e=-1;for(let t of r.lines){if(!i(t)||!o(t.startTimeMs)||t.startTimeMs<e||!s(t.text,65536))throw new Error("Invalid lyric line");if(e=t.startTimeMs,t.endTimeMs!==void 0&&(!o(t.endTimeMs)||t.endTimeMs<t.startTimeMs))throw new Error("Invalid lyric line end");for(let a of["translation","romanization"])if(t[a]!==void 0&&!s(t[a],65536))throw new Error("Invalid lyric translation");if(t.words!==void 0){if(!Array.isArray(t.words)||t.words.length>1e4)throw new Error("Invalid lyric words");let a=t.startTimeMs;for(let n of t.words){if(!i(n)||!o(n.startTimeMs)||!o(n.endTimeMs)||n.endTimeMs<n.startTimeMs||n.startTimeMs<a||!s(n.text,65536))throw new Error("Invalid lyric word");a=n.startTimeMs}}}if(r.plainText!==void 0&&!s(r.plainText,1048576))throw new Error("Invalid plain lyrics")}var d={network:{title:"\u8BBF\u95EE\u516C\u7F51\u670D\u52A1",permissions:["network.request","network.socket"]},localNetwork:{title:"\u8BBF\u95EE\u5C40\u57DF\u7F51\u4E0E\u672C\u673A\u670D\u52A1",permissions:["network.private","network.discovery"]},account:{title:"\u8BFB\u53D6\u767B\u5F55\u72B6\u6001\u4E0E\u57FA\u672C\u8D26\u53F7\u8D44\u6599",permissions:["account.profile"]},libraryRead:{title:"\u8BFB\u53D6\u6B4C\u5355\u4E0E\u6536\u85CF",permissions:["library.read"]},libraryManage:{title:"\u521B\u5EFA\u548C\u4FEE\u6539\u6B4C\u5355\u4E0E\u6536\u85CF",permissions:["library.write"]},libraryDelete:{title:"\u5220\u9664\u6B4C\u5355\u4E0E\u6B4C\u66F2\u8BB0\u5F55",permissions:["library.delete"]},playbackRead:{title:"\u8BFB\u53D6\u64AD\u653E\u72B6\u6001\u548C\u961F\u5217",permissions:["player.read"]},playbackControl:{title:"\u63A7\u5236\u64AD\u653E\u548C\u64AD\u653E\u961F\u5217",permissions:["player.control","playback.fallback.hold"]},downloads:{title:"\u7BA1\u7406\u4E0B\u8F7D\u4EFB\u52A1",permissions:["downloads.create","downloads.manage"]},files:{title:"\u4F7F\u7528\u7528\u6237\u9009\u5B9A\u7684\u6587\u4EF6",permissions:["files.read","files.write"]},localMusic:{title:"\u7D22\u5F15\u672C\u5730\u97F3\u4E50\u548C\u7F16\u8F91\u6807\u7B7E",permissions:["localMusic.read","localMusic.write"]},clipboardRead:{title:"\u8BFB\u53D6\u526A\u8D34\u677F",permissions:["clipboard.read"]},clipboardWrite:{title:"\u5199\u5165\u526A\u8D34\u677F",permissions:["clipboard.write"]},notifications:{title:"\u53D1\u9001\u7CFB\u7EDF\u901A\u77E5",permissions:["notifications.system"]},external:{title:"\u5728\u7CFB\u7EDF\u6D4F\u89C8\u5668\u6253\u5F00\u94FE\u63A5",permissions:["external.open"]},settingsRead:{title:"\u8BFB\u53D6\u8F6F\u4EF6\u504F\u597D",permissions:["settings.read"]},settingsWrite:{title:"\u4FEE\u6539\u8F6F\u4EF6\u504F\u597D",permissions:["settings.write"]},window:{title:"\u63A7\u5236\u8F6F\u4EF6\u7A97\u53E3",permissions:["window.control"]},hotkeys:{title:"\u6CE8\u518C\u5168\u5C40\u5FEB\u6377\u952E",permissions:["hotkeys.register"]},sharing:{title:"\u53D1\u5E03\u548C\u64A4\u9500\u5206\u4EAB",permissions:["sharing.publish","sharing.revoke"]},roomsRead:{title:"\u8BFB\u53D6\u4E00\u8D77\u542C\u623F\u95F4\u72B6\u6001",permissions:["rooms.read"]},roomsControl:{title:"\u52A0\u5165\u623F\u95F4\u548C\u63A7\u5236\u4E00\u8D77\u542C",permissions:["rooms.control"]},ai:{title:"\u4F7F\u7528\u8F6F\u4EF6 AI \u670D\u52A1",permissions:["ai.use"]},devices:{title:"\u63A7\u5236\u97F3\u9891\u8BBE\u5907\u4E0E\u6295\u653E",permissions:["devices.control"]},uiAppearance:{title:"\u4FEE\u6539\u8F6F\u4EF6\u5168\u5C40\u5916\u89C2",permissions:["ui.styles.global"]},background:{title:"\u540E\u53F0\u4EFB\u52A1",permissions:["background.run"]},credentials:{title:"\u4F7F\u7528\u672C\u63D2\u4EF6\u5DF2\u4FDD\u5B58\u7684\u8FDE\u63A5\u51ED\u636E",permissions:["credentials.use"]},credentialExport:{title:"\u8BFB\u53D6\u672C\u63D2\u4EF6\u8FDE\u63A5\u51ED\u636E\u660E\u6587",permissions:["credentials.read"]},guestPlugins:{title:"\u5B89\u88C5\u548C\u8FD0\u884C\u517C\u5BB9\u5B50\u63D2\u4EF6",permissions:["guests.manage","guests.run"]},services:{title:"\u8C03\u7528\u5176\u4ED6\u63D2\u4EF6\u63D0\u4F9B\u7684\u670D\u52A1",permissions:["services.consume"]}};function u(r){return Object.keys(d).find(e=>d[e].permissions.includes(r))}export{d as PERMISSION_GROUPS,c as assertContentPage,m as assertLyricsDocument,p as assertResolveResult,l as assertResourceRef,u as permissionGroup};
package/assets/index.html CHANGED
@@ -1,93 +1,94 @@
1
- <!doctype html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width,initial-scale=1" />
6
- <title>Ceru Plugin Dev</title>
7
- <link rel="stylesheet" href="/style.css" />
8
- </head>
9
- <body>
10
- <header>
11
- <div>
12
- <span class="badge">CERU / DEV HOST</span>
13
- <h1 id="plugin-name">插件调试工作台</h1>
14
- <p id="plugin-meta">TypeScript · 单文件构建 · 隔离运行</p>
15
- </div>
16
- <div class="header-actions">
17
- <span id="status" class="status">启动中</span><button id="restart">重新运行</button
18
- ><button id="stop">停止</button>
19
- </div>
20
- </header>
21
- <div id="build-error" class="error hidden"></div>
22
- <main>
23
- <aside>
24
- <section>
25
- <h2>能力注册</h2>
26
- <div id="registrations"></div>
27
- </section>
28
- <section>
29
- <h2>界面与兼容模块</h2>
30
- <div id="views"></div>
31
- </section>
32
- <section>
33
- <h2>运行时配置</h2>
34
- <p class="hint">仅保存在当前开发会话中。</p>
35
- <textarea id="config" spellcheck="false">{}</textarea
36
- ><button id="apply-config">应用配置并重载</button>
37
- </section>
38
- <section>
39
- <h2>权限模拟</h2>
40
- <div id="permissions"></div>
41
- </section>
42
- </aside>
43
- <article>
44
- <section>
45
- <h2>搜索与解析</h2>
46
- <div class="row">
47
- <select id="provider"></select
48
- ><input id="query" placeholder="输入关键词" /><button id="search" class="primary">
49
- 调用搜索</button
50
- ><button id="cancel">取消调用</button>
51
- </div>
52
- <div id="results" class="results">
53
- <div class="empty">插件启动后可以调用已注册的搜索方法。</div>
54
- </div>
55
- <pre id="result-detail"></pre>
56
- </section>
57
- <section>
58
- <h2>界面预览</h2>
59
- <div id="preview" class="preview"><div class="empty">选择左侧的页面。</div></div>
60
- </section>
61
- <section>
62
- <h2>宿主资源</h2>
63
- <p class="hint">
64
- 平台图标可直接写入 Manifest:<code>icon: { kind: 'host', name: 'platform.tx' }</code>
65
- </p>
66
- <div id="icons" class="icons"></div>
67
- <div id="static-assets" class="static-assets"></div>
68
- <p class="hint">工具:<code>ctx.utils.lodash</code> · 64 个带类型提示的常用方法</p>
69
- </section>
70
- </article>
71
- <section class="log-column">
72
- <div class="row">
73
- <h2>运行日志</h2>
74
- <button id="clear-log">清空</button>
75
- </div>
76
- <p class="hint">
77
- 使用 VS Code 的 “Attach to Ceru plugin” 或 Electron DevTools 调试 TS
78
- 源码。日志已对常见敏感字段脱敏。
79
- </p>
80
- <div id="logs"></div>
81
- </section>
82
- </main>
83
- <div id="runners" class="hidden"></div>
84
- <footer>
85
- 这是开发 Host。实际运行逻辑与界面;网络默认拒绝。生产安装授权、凭据保险箱、Guest
86
- 安装及完整音乐业务仍由正式 Host 实现。
87
- </footer>
88
- <script nonce="{{NONCE}}">
89
- window.CERU_DEV_TOKEN={{TOKEN}};
90
- </script>
91
- <script src="/playground.js"></script>
92
- </body>
93
- </html>
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <title>Ceru Plugin Dev</title>
7
+ <link rel="stylesheet" href="/style.css" />
8
+ </head>
9
+ <body>
10
+ <header>
11
+ <div>
12
+ <span class="badge">CERU / DEV HOST</span>
13
+ <h1 id="plugin-name">插件调试工作台</h1>
14
+ <p id="plugin-meta">TypeScript · 单文件构建 · 隔离运行</p>
15
+ </div>
16
+ <div class="header-actions">
17
+ <span id="status" class="status">启动中</span><button id="restart">重新运行</button
18
+ ><button id="stop">停止</button>
19
+ </div>
20
+ </header>
21
+ <div id="build-error" class="error hidden"></div>
22
+ <main>
23
+ <aside>
24
+ <section>
25
+ <h2>能力注册</h2>
26
+ <div id="registrations"></div>
27
+ </section>
28
+ <section>
29
+ <h2>界面与兼容模块</h2>
30
+ <div id="views"></div>
31
+ </section>
32
+ <section>
33
+ <h2>运行时配置</h2>
34
+ <p class="hint">仅保存在当前开发会话中。</p>
35
+ <textarea id="config" spellcheck="false">{}</textarea
36
+ ><button id="apply-config">应用配置并重载</button>
37
+ </section>
38
+ <section>
39
+ <h2>权限模拟</h2>
40
+ <div id="permissions"></div>
41
+ </section>
42
+ </aside>
43
+ <article>
44
+ <section>
45
+ <h2>搜索与解析</h2>
46
+ <div class="row">
47
+ <select id="provider" disabled aria-label="搜索来源"></select
48
+ ><input id="query" placeholder="输入关键词" disabled /><button id="search" class="primary" disabled>
49
+ 调用搜索</button
50
+ ><button id="cancel" disabled>取消调用</button>
51
+ </div>
52
+ <p id="search-status" class="hint" role="status" aria-live="polite">正在读取插件能力…</p>
53
+ <div id="results" class="results">
54
+ <div class="empty">插件启动后可以调用已注册的搜索方法。</div>
55
+ </div>
56
+ <pre id="result-detail"></pre>
57
+ </section>
58
+ <section>
59
+ <h2>界面预览</h2>
60
+ <div id="preview" class="preview"><div class="empty">选择左侧的页面。</div></div>
61
+ </section>
62
+ <section>
63
+ <h2>宿主资源</h2>
64
+ <p class="hint">
65
+ 平台图标可直接写入 Manifest:<code>icon: { kind: 'host', name: 'platform.tx' }</code>
66
+ </p>
67
+ <div id="icons" class="icons"></div>
68
+ <div id="static-assets" class="static-assets"></div>
69
+ <p class="hint">工具:<code>ctx.utils.lodash</code> · 64 个带类型提示的常用方法</p>
70
+ </section>
71
+ </article>
72
+ <section class="log-column">
73
+ <div class="row">
74
+ <h2>运行日志</h2>
75
+ <button id="clear-log">清空</button>
76
+ </div>
77
+ <p class="hint">
78
+ 使用 VS Code 的 “Attach to Ceru plugin” 或 Electron DevTools 调试 TS
79
+ 源码。日志已对常见敏感字段脱敏。
80
+ </p>
81
+ <div id="logs"></div>
82
+ </section>
83
+ </main>
84
+ <div id="runners" class="hidden"></div>
85
+ <footer>
86
+ 这是开发 Host。实际运行逻辑与界面;网络默认拒绝。生产安装授权、凭据保险箱、Guest
87
+ 安装及完整音乐业务仍由正式 Host 实现。
88
+ </footer>
89
+ <script nonce="{{NONCE}}">
90
+ window.CERU_DEV_TOKEN={{TOKEN}};
91
+ </script>
92
+ <script type="module" src="/playground.js"></script>
93
+ </body>
94
+ </html>