@binblink/wasmnest-plugin-sdk-desktop 0.0.1 → 0.0.2

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 (219) hide show
  1. package/README.md +24 -4
  2. package/README_en.md +1 -1
  3. package/bin/cli.js +5 -5
  4. package/bin/manifest-gen.js +4 -0
  5. package/bin/manifest-validate.js +68 -6
  6. package/bin/permission-vocabulary.json +2 -2
  7. package/dev-shell/README.md +6 -5
  8. package/dev-shell/src/loader.ts +0 -5
  9. package/dev-shell/src/mock/commands.ts +1 -1
  10. package/dev-shell/src/mock/domain-context.ts +1 -1
  11. package/dev-shell/src/shell/types.ts +21 -32
  12. package/dev-shell/src/styles/shell.css +208 -2
  13. package/dev-shell/src/styles/style.css +72 -26
  14. package/dist/index.d.ts +44 -3
  15. package/dist/index.js +69 -1
  16. package/dist/types.d.ts +52 -5
  17. package/go/.gitignore +5 -0
  18. package/go/README.md +80 -0
  19. package/go/gen/wasmnest/api-call/host-api-call/empty.s +3 -0
  20. package/go/gen/wasmnest/api-call/host-api-call/host-api-call.wasm.go +13 -0
  21. package/go/gen/wasmnest/api-call/host-api-call/host-api-call.wit.go +34 -0
  22. package/go/gen/wasmnest/app/host-app/empty.s +3 -0
  23. package/go/gen/wasmnest/app/host-app/host-app.wasm.go +29 -0
  24. package/go/gen/wasmnest/app/host-app/host-app.wit.go +108 -0
  25. package/go/gen/wasmnest/auth-center/host-auth-center/abi.go +14 -0
  26. package/go/gen/wasmnest/auth-center/host-auth-center/empty.s +3 -0
  27. package/go/gen/wasmnest/auth-center/host-auth-center/host-auth-center.wasm.go +49 -0
  28. package/go/gen/wasmnest/auth-center/host-auth-center/host-auth-center.wit.go +225 -0
  29. package/go/gen/wasmnest/clipboard/host-clipboard/abi.go +14 -0
  30. package/go/gen/wasmnest/clipboard/host-clipboard/empty.s +3 -0
  31. package/go/gen/wasmnest/clipboard/host-clipboard/host-clipboard.wasm.go +17 -0
  32. package/go/gen/wasmnest/clipboard/host-clipboard/host-clipboard.wit.go +68 -0
  33. package/go/gen/wasmnest/connection-registry/host-connection-registry/empty.s +3 -0
  34. package/go/gen/wasmnest/connection-registry/host-connection-registry/host-connection-registry.wasm.go +13 -0
  35. package/go/gen/wasmnest/connection-registry/host-connection-registry/host-connection-registry.wit.go +50 -0
  36. package/go/gen/wasmnest/crypto/host-crypto/abi.go +18 -0
  37. package/go/gen/wasmnest/crypto/host-crypto/empty.s +3 -0
  38. package/go/gen/wasmnest/crypto/host-crypto/host-crypto.wasm.go +37 -0
  39. package/go/gen/wasmnest/crypto/host-crypto/host-crypto.wit.go +139 -0
  40. package/go/gen/wasmnest/fs-desktop/host-fs-desktop/abi.go +14 -0
  41. package/go/gen/wasmnest/fs-desktop/host-fs-desktop/empty.s +3 -0
  42. package/go/gen/wasmnest/fs-desktop/host-fs-desktop/host-fs-desktop.wasm.go +21 -0
  43. package/go/gen/wasmnest/fs-desktop/host-fs-desktop/host-fs-desktop.wit.go +62 -0
  44. package/go/gen/wasmnest/http/host-http/abi.go +14 -0
  45. package/go/gen/wasmnest/http/host-http/empty.s +3 -0
  46. package/go/gen/wasmnest/http/host-http/host-http.wasm.go +13 -0
  47. package/go/gen/wasmnest/http/host-http/host-http.wit.go +40 -0
  48. package/go/gen/wasmnest/http-endpoint/host-http-endpoint/empty.s +3 -0
  49. package/go/gen/wasmnest/http-endpoint/host-http-endpoint/host-http-endpoint.wasm.go +17 -0
  50. package/go/gen/wasmnest/http-endpoint/host-http-endpoint/host-http-endpoint.wit.go +69 -0
  51. package/go/gen/wasmnest/mdns/host-mdns/empty.s +3 -0
  52. package/go/gen/wasmnest/mdns/host-mdns/host-mdns.wasm.go +29 -0
  53. package/go/gen/wasmnest/mdns/host-mdns/host-mdns.wit.go +101 -0
  54. package/go/gen/wasmnest/notify/host-notify/empty.s +3 -0
  55. package/go/gen/wasmnest/notify/host-notify/host-notify.wasm.go +13 -0
  56. package/go/gen/wasmnest/notify/host-notify/host-notify.wit.go +64 -0
  57. package/go/gen/wasmnest/peer/host-peer/abi.go +14 -0
  58. package/go/gen/wasmnest/peer/host-peer/empty.s +3 -0
  59. package/go/gen/wasmnest/peer/host-peer/host-peer.wasm.go +85 -0
  60. package/go/gen/wasmnest/peer/host-peer/host-peer.wit.go +357 -0
  61. package/go/gen/wasmnest/platform-desktop/host-platform-desktop/empty.s +3 -0
  62. package/go/gen/wasmnest/platform-desktop/host-platform-desktop/host-platform-desktop.wasm.go +21 -0
  63. package/go/gen/wasmnest/platform-desktop/host-platform-desktop/host-platform-desktop.wit.go +70 -0
  64. package/go/gen/wasmnest/plugin/abi-form/abi-form.exports.go +11 -0
  65. package/go/gen/wasmnest/plugin/abi-form/abi-form.wasm.go +13 -0
  66. package/go/gen/wasmnest/plugin/abi-form/abi-form.wit.go +7 -0
  67. package/go/gen/wasmnest/plugin/abi-form/empty.s +3 -0
  68. package/go/gen/wasmnest/plugin/command/command.exports.go +11 -0
  69. package/go/gen/wasmnest/plugin/command/command.wasm.go +19 -0
  70. package/go/gen/wasmnest/plugin/command/command.wit.go +6 -0
  71. package/go/gen/wasmnest/plugin/command/empty.s +3 -0
  72. package/go/gen/wasmnest/plugin/events/empty.s +3 -0
  73. package/go/gen/wasmnest/plugin/events/events.exports.go +52 -0
  74. package/go/gen/wasmnest/plugin/events/events.wasm.go +74 -0
  75. package/go/gen/wasmnest/plugin/events/events.wit.go +195 -0
  76. package/go/gen/wasmnest/plugin/host-bus/empty.s +3 -0
  77. package/go/gen/wasmnest/plugin/host-bus/host-bus.wasm.go +29 -0
  78. package/go/gen/wasmnest/plugin/host-bus/host-bus.wit.go +94 -0
  79. package/go/gen/wasmnest/plugin/host-config/abi.go +14 -0
  80. package/go/gen/wasmnest/plugin/host-config/empty.s +3 -0
  81. package/go/gen/wasmnest/plugin/host-config/host-config.wasm.go +13 -0
  82. package/go/gen/wasmnest/plugin/host-config/host-config.wit.go +21 -0
  83. package/go/gen/wasmnest/plugin/host-events/empty.s +3 -0
  84. package/go/gen/wasmnest/plugin/host-events/host-events.wasm.go +9 -0
  85. package/go/gen/wasmnest/plugin/host-events/host-events.wit.go +27 -0
  86. package/go/gen/wasmnest/plugin/host-fs/abi.go +14 -0
  87. package/go/gen/wasmnest/plugin/host-fs/empty.s +3 -0
  88. package/go/gen/wasmnest/plugin/host-fs/host-fs.wasm.go +33 -0
  89. package/go/gen/wasmnest/plugin/host-fs/host-fs.wit.go +86 -0
  90. package/go/gen/wasmnest/plugin/host-log/empty.s +3 -0
  91. package/go/gen/wasmnest/plugin/host-log/host-log.wasm.go +25 -0
  92. package/go/gen/wasmnest/plugin/host-log/host-log.wit.go +65 -0
  93. package/go/gen/wasmnest/plugin/host-metrics/empty.s +3 -0
  94. package/go/gen/wasmnest/plugin/host-metrics/host-metrics.wasm.go +13 -0
  95. package/go/gen/wasmnest/plugin/host-metrics/host-metrics.wit.go +34 -0
  96. package/go/gen/wasmnest/plugin/host-platform/empty.s +3 -0
  97. package/go/gen/wasmnest/plugin/host-platform/host-platform.wasm.go +21 -0
  98. package/go/gen/wasmnest/plugin/host-platform/host-platform.wit.go +85 -0
  99. package/go/gen/wasmnest/plugin/host-plugin-database/abi.go +14 -0
  100. package/go/gen/wasmnest/plugin/host-plugin-database/empty.s +3 -0
  101. package/go/gen/wasmnest/plugin/host-plugin-database/host-plugin-database.wasm.go +29 -0
  102. package/go/gen/wasmnest/plugin/host-plugin-database/host-plugin-database.wit.go +70 -0
  103. package/go/gen/wasmnest/plugin/host-storage/abi.go +14 -0
  104. package/go/gen/wasmnest/plugin/host-storage/empty.s +3 -0
  105. package/go/gen/wasmnest/plugin/host-storage/host-storage.wasm.go +21 -0
  106. package/go/gen/wasmnest/plugin/host-storage/host-storage.wit.go +44 -0
  107. package/go/gen/wasmnest/plugin/host-worker/empty.s +3 -0
  108. package/go/gen/wasmnest/plugin/host-worker/host-worker.wasm.go +17 -0
  109. package/go/gen/wasmnest/plugin/host-worker/host-worker.wit.go +50 -0
  110. package/go/gen/wasmnest/plugin/lifecycle/empty.s +3 -0
  111. package/go/gen/wasmnest/plugin/lifecycle/lifecycle.exports.go +32 -0
  112. package/go/gen/wasmnest/plugin/lifecycle/lifecycle.wasm.go +41 -0
  113. package/go/gen/wasmnest/plugin/lifecycle/lifecycle.wit.go +9 -0
  114. package/go/gen/wasmnest/plugin/manifest/empty.s +3 -0
  115. package/go/gen/wasmnest/plugin/manifest/manifest.exports.go +11 -0
  116. package/go/gen/wasmnest/plugin/manifest/manifest.wasm.go +13 -0
  117. package/go/gen/wasmnest/plugin/manifest/manifest.wit.go +6 -0
  118. package/go/gen/wasmnest/plugin/plugin/plugin.wit.go +4 -0
  119. package/go/gen/wasmnest/process/host-process/empty.s +3 -0
  120. package/go/gen/wasmnest/process/host-process/host-process.wasm.go +21 -0
  121. package/go/gen/wasmnest/process/host-process/host-process.wit.go +56 -0
  122. package/go/gen/wasmnest/pty/host-pty/abi.go +14 -0
  123. package/go/gen/wasmnest/pty/host-pty/empty.s +3 -0
  124. package/go/gen/wasmnest/pty/host-pty/host-pty.wasm.go +33 -0
  125. package/go/gen/wasmnest/pty/host-pty/host-pty.wit.go +164 -0
  126. package/go/gen/wasmnest/task/host-task/abi.go +14 -0
  127. package/go/gen/wasmnest/task/host-task/empty.s +3 -0
  128. package/go/gen/wasmnest/task/host-task/host-task.wasm.go +29 -0
  129. package/go/gen/wasmnest/task/host-task/host-task.wit.go +110 -0
  130. package/go/gen/wasmnest/timer/host-timer/empty.s +3 -0
  131. package/go/gen/wasmnest/timer/host-timer/host-timer.wasm.go +13 -0
  132. package/go/gen/wasmnest/timer/host-timer/host-timer.wit.go +25 -0
  133. package/go/gen/wasmnest/ws/host-websocket/empty.s +3 -0
  134. package/go/gen/wasmnest/ws/host-websocket/host-websocket.wasm.go +29 -0
  135. package/go/gen/wasmnest/ws/host-websocket/host-websocket.wit.go +109 -0
  136. package/go/gen/wasmnest/ws-server/host-websocket-server/empty.s +3 -0
  137. package/go/gen/wasmnest/ws-server/host-websocket-server/host-websocket-server.wasm.go +49 -0
  138. package/go/gen/wasmnest/ws-server/host-websocket-server/host-websocket-server.wit.go +220 -0
  139. package/go/go.mod +14 -0
  140. package/go/go.sum +2 -0
  141. package/go/sdk/dispatch.go +49 -0
  142. package/go/sdk/dispatch_test.go +81 -0
  143. package/go/sdk/entry_native.go +13 -0
  144. package/go/sdk/entry_wasip2.go +188 -0
  145. package/go/sdk/host_http_wasip2.go +42 -0
  146. package/go/sdk/host_wasip2.go +251 -0
  147. package/go/sdk/plugin.go +103 -0
  148. package/go/testplugin/index.js +1 -0
  149. package/go/testplugin/main.go +67 -0
  150. package/go/testplugin/plugin.json +24 -0
  151. package/go/tools/assemble-wit.mjs +152 -0
  152. package/go/tools/gen-bindings.mjs +51 -0
  153. package/go/wit/core.wit +273 -0
  154. package/go/wit/deps/api-call/cap-api-call.wit +20 -0
  155. package/go/wit/deps/app/cap-app.wit +54 -0
  156. package/go/wit/deps/auth-center/cap-auth-center.wit +124 -0
  157. package/go/wit/deps/clipboard/clipboard.wit +48 -0
  158. package/go/wit/deps/clocks/monotonic-clock.wit +45 -0
  159. package/go/wit/deps/clocks/wall-clock.wit +42 -0
  160. package/go/wit/deps/clocks/world.wit +6 -0
  161. package/go/wit/deps/connection-registry/cap-connection-registry.wit +40 -0
  162. package/go/wit/deps/crypto/cap-crypto.wit +68 -0
  163. package/go/wit/deps/filesystem/preopens.wit +8 -0
  164. package/go/wit/deps/filesystem/types.wit +634 -0
  165. package/go/wit/deps/filesystem/world.wit +6 -0
  166. package/go/wit/deps/fs-desktop/cap-fs-desktop.wit +29 -0
  167. package/go/wit/deps/http/http.wit +28 -0
  168. package/go/wit/deps/http-endpoint/cap-http.wit +44 -0
  169. package/go/wit/deps/io/error.wit +34 -0
  170. package/go/wit/deps/io/poll.wit +41 -0
  171. package/go/wit/deps/io/streams.wit +262 -0
  172. package/go/wit/deps/io/world.wit +6 -0
  173. package/go/wit/deps/mdns/mdns.wit +45 -0
  174. package/go/wit/deps/notify/notify.wit +51 -0
  175. package/go/wit/deps/peer/peer.wit +126 -0
  176. package/go/wit/deps/platform-desktop/cap-platform-desktop.wit +38 -0
  177. package/go/wit/deps/process/cap-process.wit +25 -0
  178. package/go/wit/deps/pty/pty.wit +80 -0
  179. package/go/wit/deps/random/insecure-seed.wit +25 -0
  180. package/go/wit/deps/random/insecure.wit +22 -0
  181. package/go/wit/deps/random/random.wit +26 -0
  182. package/go/wit/deps/random/world.wit +7 -0
  183. package/go/wit/deps/sockets/instance-network.wit +9 -0
  184. package/go/wit/deps/sockets/ip-name-lookup.wit +51 -0
  185. package/go/wit/deps/sockets/network.wit +145 -0
  186. package/go/wit/deps/sockets/tcp-create-socket.wit +27 -0
  187. package/go/wit/deps/sockets/tcp.wit +353 -0
  188. package/go/wit/deps/sockets/udp-create-socket.wit +27 -0
  189. package/go/wit/deps/sockets/udp.wit +266 -0
  190. package/go/wit/deps/sockets/world.wit +11 -0
  191. package/go/wit/deps/task/cap-task.wit +56 -0
  192. package/go/wit/deps/timer/cap-timer.wit +14 -0
  193. package/go/wit/deps/wasi-cli/command.wit +7 -0
  194. package/go/wit/deps/wasi-cli/environment.wit +18 -0
  195. package/go/wit/deps/wasi-cli/exit.wit +4 -0
  196. package/go/wit/deps/wasi-cli/imports.wit +20 -0
  197. package/go/wit/deps/wasi-cli/run.wit +4 -0
  198. package/go/wit/deps/wasi-cli/stdio.wit +17 -0
  199. package/go/wit/deps/wasi-cli/terminal.wit +49 -0
  200. package/go/wit/deps/ws/ws.wit +50 -0
  201. package/go/wit/deps/ws-server/cap-ws.wit +99 -0
  202. package/go/wit/go-plugin.wit +28 -0
  203. package/go/wit/plugin-face.wit +355 -0
  204. package/go/wit/wasmnest.wit +25 -0
  205. package/package.json +12 -1
  206. package/src/index.ts +8 -0
  207. package/src/types.ts +681 -630
  208. package/src/ui/AppUpdateSection.d.ts +44 -0
  209. package/src/ui/AppUpdateSection.vue +253 -0
  210. package/src/ui/NumberField.d.ts +49 -0
  211. package/src/ui/NumberField.vue +390 -0
  212. package/src/ui/Select.vue +4 -4
  213. package/src/update.ts +123 -0
  214. package/template/README.md +39 -39
  215. package/tools/componentize/Cargo.lock +30 -1
  216. package/tools/componentize/Cargo.toml +3 -0
  217. package/tools/componentize/src/main.rs +197 -94
  218. package/dev-shell/src/mock/agent-hub-commands.ts +0 -1065
  219. package/dev-shell/src/mock/agent-hub.ts +0 -42
@@ -1,42 +0,0 @@
1
- /**
2
- * Agent Hub 插件领域 mock(dev-shell 专用,纯通用接线)
3
- *
4
- * 浏览器中 Rust WASM 后端不可用,app 经 `env.appInvoke` 发的命令只能由前端
5
- * mock 顶上。本模块注册 agent-hub 五个领域(探测/安装/Skills/供应商/使用统计)
6
- * 的命令 handler 骨架(经 `DomainContext` 落到全局命令表),并模拟事件回流
7
- * (`plugin:agent-hub:*` 全量状态推送,经 Tauri 事件垫片送达 app 的 listen),
8
- * 使插件在 dev-shell 中展示「有数据」的完整形态:
9
- * - 探测:detect 逐 CLI 延时推进 detecting → 终态(种子为终态目标)
10
- * - 安装:run 剧本逐行回显输出、测速/检查更新延时出结果、换源改写 npmrc 状态
11
- * - Skills:扫描动画、编辑保存(hash 重算 → 分发转 stale)、分发/GitHub 安装/本地导入
12
- * - 供应商:预设 CRUD、反向导入(种子发现条目)、应用(claude 桥接冲突演示)
13
- * - 使用统计:扫描 syncing → ok、看板聚合、会话分页、日志详情读取
14
- *
15
- * 本模块不包含任何具体业务 mock 数据:全部演示种子由插件工程持有(入口导出
16
- * devMock:detection / install / skills / providers / usage 五个子域),
17
- * 注入时按 pluginId 经 getDevMock 取种子驱动命令返回值与事件;未导出对应
18
- * 子域的插件不受影响(各子域命令不注册)。
19
- *
20
- * 2026-10-25:命令实现(种子派生状态 / 安装模拟 / 五域 handler)拆至
21
- * agent-hub-commands.ts,本文件只做种子查找门面。
22
- */
23
- import { getDevMock } from '../registry'
24
- import type { DomainContext } from './domain-context'
25
- import { registerAgentHubMockImpl, type AgentHubSeed } from './agent-hub-commands'
26
-
27
- /**
28
- * 注册 agent-hub 领域命令 mock(loader 在 activate 前调用)
29
- *
30
- * 仅注册种子中存在的子域命令;返回 Disposable 供插件 deactivate 清理定时器
31
- */
32
- export function registerAgentHubMock(context: DomainContext, pluginId: string): {
33
- dispose(): void
34
- } {
35
- // SAFETY: dev-shell 刻意不收录插件包类型(SDK 不依赖插件),种子形状按
36
- // 插件 devMockTypes.ts 的领域接口本地镜像后 cast——运行期种子字段是这些
37
- // 接口的超集(额外字段经索引签名透传),cast 只收窄不丢字段
38
- const seed = getDevMock(pluginId) as unknown as AgentHubSeed | undefined
39
- if (!seed) return { dispose() {} }
40
-
41
- return registerAgentHubMockImpl(context, seed)
42
- }