@desktalk/core 0.1.0-alpha.1

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 (281) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cli/index.d.ts +3 -0
  3. package/dist/cli/index.d.ts.map +1 -0
  4. package/dist/cli/index.js +82 -0
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/frontend/assets/frontend-B3QNYf3p.js +413 -0
  7. package/dist/frontend/assets/frontend-B3QNYf3p.js.map +1 -0
  8. package/dist/frontend/assets/frontend-B4aeXn9d.js +416 -0
  9. package/dist/frontend/assets/frontend-B4aeXn9d.js.map +1 -0
  10. package/dist/frontend/assets/frontend-BwyRSlHp.js +6513 -0
  11. package/dist/frontend/assets/frontend-BwyRSlHp.js.map +1 -0
  12. package/dist/frontend/assets/frontend-Dix2OWTT.js +229 -0
  13. package/dist/frontend/assets/frontend-Dix2OWTT.js.map +1 -0
  14. package/dist/frontend/assets/frontend-Dx41dEM9.js +407 -0
  15. package/dist/frontend/assets/frontend-Dx41dEM9.js.map +1 -0
  16. package/dist/frontend/assets/frontend-WpQng8Mt.js +1991 -0
  17. package/dist/frontend/assets/frontend-WpQng8Mt.js.map +1 -0
  18. package/dist/frontend/assets/frontend-rTwBdJbn.js +2123 -0
  19. package/dist/frontend/assets/frontend-rTwBdJbn.js.map +1 -0
  20. package/dist/frontend/assets/highlighted-body-TPN3WLV5-DD4wpkf4.js +2 -0
  21. package/dist/frontend/assets/highlighted-body-TPN3WLV5-DD4wpkf4.js.map +1 -0
  22. package/dist/frontend/assets/index-C5-XUOS7.js +1863 -0
  23. package/dist/frontend/assets/index-C5-XUOS7.js.map +1 -0
  24. package/dist/frontend/assets/index-C_e3_6yE.css +1 -0
  25. package/dist/frontend/index.html +22 -0
  26. package/dist/frontend/pcm-capture-processor.js +65 -0
  27. package/dist/i18n/manifest.json +34 -0
  28. package/dist/i18n/zh-CN.json +7 -0
  29. package/dist/index.d.ts +6 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +6 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/server/admin-routes.d.ts +14 -0
  34. package/dist/server/admin-routes.d.ts.map +1 -0
  35. package/dist/server/admin-routes.js +118 -0
  36. package/dist/server/admin-routes.js.map +1 -0
  37. package/dist/server/api-routes.d.ts +8 -0
  38. package/dist/server/api-routes.d.ts.map +1 -0
  39. package/dist/server/api-routes.js +203 -0
  40. package/dist/server/api-routes.js.map +1 -0
  41. package/dist/server/auth-routes.d.ts +19 -0
  42. package/dist/server/auth-routes.d.ts.map +1 -0
  43. package/dist/server/auth-routes.js +155 -0
  44. package/dist/server/auth-routes.js.map +1 -0
  45. package/dist/server/dtfs-routes.d.ts +3 -0
  46. package/dist/server/dtfs-routes.d.ts.map +1 -0
  47. package/dist/server/dtfs-routes.js +183 -0
  48. package/dist/server/dtfs-routes.js.map +1 -0
  49. package/dist/server/index.d.ts +15 -0
  50. package/dist/server/index.d.ts.map +1 -0
  51. package/dist/server/index.js +158 -0
  52. package/dist/server/index.js.map +1 -0
  53. package/dist/server/monaco-routes.d.ts +3 -0
  54. package/dist/server/monaco-routes.d.ts.map +1 -0
  55. package/dist/server/monaco-routes.js +45 -0
  56. package/dist/server/monaco-routes.js.map +1 -0
  57. package/dist/server/voice-routes.d.ts +7 -0
  58. package/dist/server/voice-routes.d.ts.map +1 -0
  59. package/dist/server/voice-routes.js +142 -0
  60. package/dist/server/voice-routes.js.map +1 -0
  61. package/dist/server/ws-routes.d.ts +29 -0
  62. package/dist/server/ws-routes.d.ts.map +1 -0
  63. package/dist/server/ws-routes.js +334 -0
  64. package/dist/server/ws-routes.js.map +1 -0
  65. package/dist/services/ai/action-tool.d.ts +9 -0
  66. package/dist/services/ai/action-tool.d.ts.map +1 -0
  67. package/dist/services/ai/action-tool.js +51 -0
  68. package/dist/services/ai/action-tool.js.map +1 -0
  69. package/dist/services/ai/app-tools.d.ts +15 -0
  70. package/dist/services/ai/app-tools.d.ts.map +1 -0
  71. package/dist/services/ai/app-tools.js +119 -0
  72. package/dist/services/ai/app-tools.js.map +1 -0
  73. package/dist/services/ai/chat-service.d.ts +27 -0
  74. package/dist/services/ai/chat-service.d.ts.map +1 -0
  75. package/dist/services/ai/chat-service.js +213 -0
  76. package/dist/services/ai/chat-service.js.map +1 -0
  77. package/dist/services/ai/create-liveapp-tool.d.ts +15 -0
  78. package/dist/services/ai/create-liveapp-tool.d.ts.map +1 -0
  79. package/dist/services/ai/create-liveapp-tool.js +142 -0
  80. package/dist/services/ai/create-liveapp-tool.js.map +1 -0
  81. package/dist/services/ai/desktop-tool.d.ts +27 -0
  82. package/dist/services/ai/desktop-tool.d.ts.map +1 -0
  83. package/dist/services/ai/desktop-tool.js +106 -0
  84. package/dist/services/ai/desktop-tool.js.map +1 -0
  85. package/dist/services/ai/edit-history.d.ts +16 -0
  86. package/dist/services/ai/edit-history.d.ts.map +1 -0
  87. package/dist/services/ai/edit-history.js +137 -0
  88. package/dist/services/ai/edit-history.js.map +1 -0
  89. package/dist/services/ai/edit-tool.d.ts +9 -0
  90. package/dist/services/ai/edit-tool.d.ts.map +1 -0
  91. package/dist/services/ai/edit-tool.js +113 -0
  92. package/dist/services/ai/edit-tool.js.map +1 -0
  93. package/dist/services/ai/generate-html-tool.d.ts +15 -0
  94. package/dist/services/ai/generate-html-tool.d.ts.map +1 -0
  95. package/dist/services/ai/generate-html-tool.js +140 -0
  96. package/dist/services/ai/generate-html-tool.js.map +1 -0
  97. package/dist/services/ai/generate-icon-tool.d.ts +10 -0
  98. package/dist/services/ai/generate-icon-tool.d.ts.map +1 -0
  99. package/dist/services/ai/generate-icon-tool.js +58 -0
  100. package/dist/services/ai/generate-icon-tool.js.map +1 -0
  101. package/dist/services/ai/html-bridge-script.d.ts +2 -0
  102. package/dist/services/ai/html-bridge-script.d.ts.map +1 -0
  103. package/dist/services/ai/html-bridge-script.js +2 -0
  104. package/dist/services/ai/html-bridge-script.js.map +1 -0
  105. package/dist/services/ai/html-guidelines-tool.d.ts +3 -0
  106. package/dist/services/ai/html-guidelines-tool.d.ts.map +1 -0
  107. package/dist/services/ai/html-guidelines-tool.js +157 -0
  108. package/dist/services/ai/html-guidelines-tool.js.map +1 -0
  109. package/dist/services/ai/html-stream-coordinator.d.ts +92 -0
  110. package/dist/services/ai/html-stream-coordinator.d.ts.map +1 -0
  111. package/dist/services/ai/html-stream-coordinator.js +314 -0
  112. package/dist/services/ai/html-stream-coordinator.js.map +1 -0
  113. package/dist/services/ai/html-theme-link.d.ts +9 -0
  114. package/dist/services/ai/html-theme-link.d.ts.map +1 -0
  115. package/dist/services/ai/html-theme-link.js +12 -0
  116. package/dist/services/ai/html-theme-link.js.map +1 -0
  117. package/dist/services/ai/html-ui-script.d.ts +9 -0
  118. package/dist/services/ai/html-ui-script.d.ts.map +1 -0
  119. package/dist/services/ai/html-ui-script.js +9 -0
  120. package/dist/services/ai/html-ui-script.js.map +1 -0
  121. package/dist/services/ai/image-generation-service.d.ts +26 -0
  122. package/dist/services/ai/image-generation-service.d.ts.map +1 -0
  123. package/dist/services/ai/image-generation-service.js +205 -0
  124. package/dist/services/ai/image-generation-service.js.map +1 -0
  125. package/dist/services/ai/manual-pages/desktop-actions.md +36 -0
  126. package/dist/services/ai/manual-pages/desktop-windows.md +24 -0
  127. package/dist/services/ai/manual-pages/dt-badge.md +36 -0
  128. package/dist/services/ai/manual-pages/dt-button.md +38 -0
  129. package/dist/services/ai/manual-pages/dt-card.md +22 -0
  130. package/dist/services/ai/manual-pages/dt-chart.md +261 -0
  131. package/dist/services/ai/manual-pages/dt-divider.md +25 -0
  132. package/dist/services/ai/manual-pages/dt-grid.md +29 -0
  133. package/dist/services/ai/manual-pages/dt-list-view.md +96 -0
  134. package/dist/services/ai/manual-pages/dt-markdown-editor.md +90 -0
  135. package/dist/services/ai/manual-pages/dt-markdown.md +86 -0
  136. package/dist/services/ai/manual-pages/dt-select.md +21 -0
  137. package/dist/services/ai/manual-pages/dt-stack.md +31 -0
  138. package/dist/services/ai/manual-pages/dt-stat.md +43 -0
  139. package/dist/services/ai/manual-pages/dt-table-view.md +120 -0
  140. package/dist/services/ai/manual-pages/dt-tooltip.md +18 -0
  141. package/dist/services/ai/manual-pages/editing-preview.md +25 -0
  142. package/dist/services/ai/manual-pages/html-actions.md +74 -0
  143. package/dist/services/ai/manual-pages/html-bridge.md +187 -0
  144. package/dist/services/ai/manual-pages/html-components.md +66 -0
  145. package/dist/services/ai/manual-pages/html-examples.md +185 -0
  146. package/dist/services/ai/manual-pages/html-layouts.md +128 -0
  147. package/dist/services/ai/manual-pages/html-storage.md +153 -0
  148. package/dist/services/ai/manual-pages/html-tokens.md +26 -0
  149. package/dist/services/ai/manual-pages/index.d.ts +10 -0
  150. package/dist/services/ai/manual-pages/index.d.ts.map +1 -0
  151. package/dist/services/ai/manual-pages/index.js +186 -0
  152. package/dist/services/ai/manual-pages/index.js.map +1 -0
  153. package/dist/services/ai/manual-tool.d.ts +3 -0
  154. package/dist/services/ai/manual-tool.d.ts.map +1 -0
  155. package/dist/services/ai/manual-tool.js +104 -0
  156. package/dist/services/ai/manual-tool.js.map +1 -0
  157. package/dist/services/ai/pi-session-service.d.ts +101 -0
  158. package/dist/services/ai/pi-session-service.d.ts.map +1 -0
  159. package/dist/services/ai/pi-session-service.js +697 -0
  160. package/dist/services/ai/pi-session-service.js.map +1 -0
  161. package/dist/services/ai/providers.d.ts +21 -0
  162. package/dist/services/ai/providers.d.ts.map +1 -0
  163. package/dist/services/ai/providers.js +93 -0
  164. package/dist/services/ai/providers.js.map +1 -0
  165. package/dist/services/ai/redo-edit-tool.d.ts +9 -0
  166. package/dist/services/ai/redo-edit-tool.d.ts.map +1 -0
  167. package/dist/services/ai/redo-edit-tool.js +44 -0
  168. package/dist/services/ai/redo-edit-tool.js.map +1 -0
  169. package/dist/services/ai/system-prompt.d.ts +7 -0
  170. package/dist/services/ai/system-prompt.d.ts.map +1 -0
  171. package/dist/services/ai/system-prompt.js +72 -0
  172. package/dist/services/ai/system-prompt.js.map +1 -0
  173. package/dist/services/ai/undo-edit-tool.d.ts +9 -0
  174. package/dist/services/ai/undo-edit-tool.d.ts.map +1 -0
  175. package/dist/services/ai/undo-edit-tool.js +44 -0
  176. package/dist/services/ai/undo-edit-tool.js.map +1 -0
  177. package/dist/services/ai/window-tools.d.ts +27 -0
  178. package/dist/services/ai/window-tools.d.ts.map +1 -0
  179. package/dist/services/ai/window-tools.js +155 -0
  180. package/dist/services/ai/window-tools.js.map +1 -0
  181. package/dist/services/backend-host.d.ts +10 -0
  182. package/dist/services/backend-host.d.ts.map +1 -0
  183. package/dist/services/backend-host.js +117 -0
  184. package/dist/services/backend-host.js.map +1 -0
  185. package/dist/services/backend-ipc.d.ts +60 -0
  186. package/dist/services/backend-ipc.d.ts.map +1 -0
  187. package/dist/services/backend-ipc.js +2 -0
  188. package/dist/services/backend-ipc.js.map +1 -0
  189. package/dist/services/backend-process-manager.d.ts +60 -0
  190. package/dist/services/backend-process-manager.d.ts.map +1 -0
  191. package/dist/services/backend-process-manager.js +203 -0
  192. package/dist/services/backend-process-manager.js.map +1 -0
  193. package/dist/services/filesystem.d.ts +8 -0
  194. package/dist/services/filesystem.d.ts.map +1 -0
  195. package/dist/services/filesystem.js +94 -0
  196. package/dist/services/filesystem.js.map +1 -0
  197. package/dist/services/i18n.d.ts +28 -0
  198. package/dist/services/i18n.d.ts.map +1 -0
  199. package/dist/services/i18n.js +76 -0
  200. package/dist/services/i18n.js.map +1 -0
  201. package/dist/services/liveapp-icon.d.ts +9 -0
  202. package/dist/services/liveapp-icon.d.ts.map +1 -0
  203. package/dist/services/liveapp-icon.js +28 -0
  204. package/dist/services/liveapp-icon.js.map +1 -0
  205. package/dist/services/liveapps.d.ts +12 -0
  206. package/dist/services/liveapps.d.ts.map +1 -0
  207. package/dist/services/liveapps.js +84 -0
  208. package/dist/services/liveapps.js.map +1 -0
  209. package/dist/services/logger.d.ts +34 -0
  210. package/dist/services/logger.d.ts.map +1 -0
  211. package/dist/services/logger.js +74 -0
  212. package/dist/services/logger.js.map +1 -0
  213. package/dist/services/messaging.d.ts +14 -0
  214. package/dist/services/messaging.d.ts.map +1 -0
  215. package/dist/services/messaging.js +41 -0
  216. package/dist/services/messaging.js.map +1 -0
  217. package/dist/services/miniapp-icon.d.ts +9 -0
  218. package/dist/services/miniapp-icon.d.ts.map +1 -0
  219. package/dist/services/miniapp-icon.js +25 -0
  220. package/dist/services/miniapp-icon.js.map +1 -0
  221. package/dist/services/miniapp-registry.d.ts +73 -0
  222. package/dist/services/miniapp-registry.d.ts.map +1 -0
  223. package/dist/services/miniapp-registry.js +144 -0
  224. package/dist/services/miniapp-registry.js.map +1 -0
  225. package/dist/services/onboarding-config.d.ts +37 -0
  226. package/dist/services/onboarding-config.d.ts.map +1 -0
  227. package/dist/services/onboarding-config.js +76 -0
  228. package/dist/services/onboarding-config.js.map +1 -0
  229. package/dist/services/preferences.d.ts +10 -0
  230. package/dist/services/preferences.d.ts.map +1 -0
  231. package/dist/services/preferences.js +48 -0
  232. package/dist/services/preferences.js.map +1 -0
  233. package/dist/services/proxy-dispatcher.d.ts +18 -0
  234. package/dist/services/proxy-dispatcher.d.ts.map +1 -0
  235. package/dist/services/proxy-dispatcher.js +33 -0
  236. package/dist/services/proxy-dispatcher.js.map +1 -0
  237. package/dist/services/storage.d.ts +7 -0
  238. package/dist/services/storage.d.ts.map +1 -0
  239. package/dist/services/storage.js +55 -0
  240. package/dist/services/storage.js.map +1 -0
  241. package/dist/services/theme-css.d.ts +21 -0
  242. package/dist/services/theme-css.d.ts.map +1 -0
  243. package/dist/services/theme-css.js +213 -0
  244. package/dist/services/theme-css.js.map +1 -0
  245. package/dist/services/user-db.d.ts +69 -0
  246. package/dist/services/user-db.d.ts.map +1 -0
  247. package/dist/services/user-db.js +175 -0
  248. package/dist/services/user-db.js.map +1 -0
  249. package/dist/services/voice/audio-format.d.ts +5 -0
  250. package/dist/services/voice/audio-format.d.ts.map +1 -0
  251. package/dist/services/voice/audio-format.js +27 -0
  252. package/dist/services/voice/audio-format.js.map +1 -0
  253. package/dist/services/voice/azure-openai-whisper-adapter.d.ts +23 -0
  254. package/dist/services/voice/azure-openai-whisper-adapter.d.ts.map +1 -0
  255. package/dist/services/voice/azure-openai-whisper-adapter.js +60 -0
  256. package/dist/services/voice/azure-openai-whisper-adapter.js.map +1 -0
  257. package/dist/services/voice/openai-whisper-adapter.d.ts +22 -0
  258. package/dist/services/voice/openai-whisper-adapter.d.ts.map +1 -0
  259. package/dist/services/voice/openai-whisper-adapter.js +61 -0
  260. package/dist/services/voice/openai-whisper-adapter.js.map +1 -0
  261. package/dist/services/voice/stt-adapter.d.ts +31 -0
  262. package/dist/services/voice/stt-adapter.d.ts.map +1 -0
  263. package/dist/services/voice/stt-adapter.js +8 -0
  264. package/dist/services/voice/stt-adapter.js.map +1 -0
  265. package/dist/services/voice/vad-segmenter.d.ts +68 -0
  266. package/dist/services/voice/vad-segmenter.d.ts.map +1 -0
  267. package/dist/services/voice/vad-segmenter.js +159 -0
  268. package/dist/services/voice/vad-segmenter.js.map +1 -0
  269. package/dist/services/voice/voice-session.d.ts +54 -0
  270. package/dist/services/voice/voice-session.d.ts.map +1 -0
  271. package/dist/services/voice/voice-session.js +137 -0
  272. package/dist/services/voice/voice-session.js.map +1 -0
  273. package/dist/services/window-manager.d.ts +94 -0
  274. package/dist/services/window-manager.d.ts.map +1 -0
  275. package/dist/services/window-manager.js +282 -0
  276. package/dist/services/window-manager.js.map +1 -0
  277. package/dist/services/workspace.d.ts +51 -0
  278. package/dist/services/workspace.d.ts.map +1 -0
  279. package/dist/services/workspace.js +144 -0
  280. package/dist/services/workspace.js.map +1 -0
  281. package/package.json +89 -0
@@ -0,0 +1,86 @@
1
+ # `<dt-markdown>`
2
+
3
+ Themed markdown renderer for rich text, documentation, notes, and AI-generated prose. Content can be inline between the tags or assigned through the `.content` JS property.
4
+
5
+ ## Attributes
6
+
7
+ - `streaming` — shows a blinking caret and tolerates incomplete markdown while content updates
8
+ - `unsafe-html` — allows raw HTML in the markdown source
9
+ - `.content` JS property — markdown source string; overrides inline text content
10
+ - `dt-link-click` event — emitted with `{ href }` when a rendered link is clicked
11
+
12
+ **When to use:** Use for READMEs, release notes, help panels, generated reports, and any text that is more naturally authored as markdown than raw HTML.
13
+
14
+ ## Examples
15
+
16
+ ```html
17
+ <dt-markdown id="release-notes"></dt-markdown>
18
+
19
+ <dt-markdown id="stream-output" streaming></dt-markdown>
20
+
21
+ <script>
22
+ document.getElementById('release-notes').content = `# Release Notes
23
+
24
+ - Added virtualized tables
25
+ - Improved command latency
26
+ - Fixed stale auth session refresh
27
+
28
+ > All systems are operational.`;
29
+
30
+ const output = document.getElementById('stream-output');
31
+ output.content = '# Build Report\n\nCollecting results';
32
+ setTimeout(() => {
33
+ output.content = '# Build Report\n\nCollecting results...\n\n- Core: passed\n- UI: passed';
34
+ output.streaming = false;
35
+ }, 600);
36
+ </script>
37
+ ```
38
+
39
+ ## Full-Page Example — Markdown Viewer
40
+
41
+ ```html
42
+ <!doctype html>
43
+ <html>
44
+ <head>
45
+ <meta charset="utf-8" />
46
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
47
+ <title>Release Notes</title>
48
+ <style>
49
+ body {
50
+ background: var(--dt-bg);
51
+ }
52
+
53
+ #notes {
54
+ max-height: 420px;
55
+ overflow: auto;
56
+ }
57
+ </style>
58
+ </head>
59
+ <body>
60
+ <h1>Release Notes</h1>
61
+ <dt-card>
62
+ <dt-markdown id="notes"></dt-markdown>
63
+ </dt-card>
64
+
65
+ <script>
66
+ document.getElementById('notes').content = `# DeskTalk 0.8.0
67
+
68
+ ## Highlights
69
+
70
+ - Added virtualized list and table components
71
+ - Improved miniapp activation performance
72
+ - Refined storage docs for LiveApps
73
+
74
+ ## Verification
75
+
76
+ | Package | Status |
77
+ | ------- | ------ |
78
+ | Core | Passed |
79
+ | UI | Passed |
80
+ | Miniapp | Passed |
81
+
82
+ > Use \`dt-link-click\` if you want to intercept links inside rendered markdown.`;
83
+ </script>
84
+ </body>
85
+ </html>
86
+ ```
@@ -0,0 +1,21 @@
1
+ # `<dt-select>`
2
+
3
+ Dropdown select component.
4
+
5
+ ## Attributes
6
+
7
+ - `value` — selected value
8
+ - `placeholder` — placeholder text
9
+ - `disabled` — disable the select
10
+ - `align` — `left` or `right` alignment
11
+
12
+ ## Example
13
+
14
+ ```html
15
+ <label>Language</label>
16
+ <dt-select>
17
+ <option>English</option>
18
+ <option>Spanish</option>
19
+ <option>French</option>
20
+ </dt-select>
21
+ ```
@@ -0,0 +1,31 @@
1
+ # `<dt-stack>`
2
+
3
+ Flexbox stack for vertical or horizontal layouts.
4
+
5
+ Use `direction="row"` for horizontal layouts and `direction="column"` for vertical layouts.
6
+ Never use `direction="horizontal"` or `direction="vertical"`.
7
+
8
+ ## Attributes
9
+
10
+ - `direction` — stack direction: `column` (default) or `row` only
11
+ - `gap` — spacing between items: `0`, `4`, `8`, `12`, `16`, `20`, `24`, `32` (default: `16`)
12
+ - `align` — cross-axis alignment: `start`, `center`, `end`, `stretch` (default: `stretch`)
13
+
14
+ **When to use:** Use for linear arrangements (buttons in a row, cards in a vertical list). Row stacks automatically wrap to column on narrow views.
15
+
16
+ ## Examples
17
+
18
+ ```html
19
+ <!-- Vertical stack (default) -->
20
+ <dt-stack>
21
+ <dt-card>Item 1</dt-card>
22
+ <dt-card>Item 2</dt-card>
23
+ <dt-card>Item 3</dt-card>
24
+ </dt-stack>
25
+
26
+ <!-- Horizontal row (wraps to column on narrow views) -->
27
+ <dt-stack direction="row" gap="12">
28
+ <dt-button>Save</dt-button>
29
+ <dt-button variant="secondary">Cancel</dt-button>
30
+ </dt-stack>
31
+ ```
@@ -0,0 +1,43 @@
1
+ # `<dt-stat>`
2
+
3
+ Metric/KPI display component. Shows a label, value, and optional description.
4
+
5
+ ## Attributes
6
+
7
+ - `label` — the metric label (e.g., "CPU Usage")
8
+ - `value` — the metric value (e.g., "42%")
9
+ - `description` — optional descriptive text
10
+ - `size` — size: `sm`, `md` (default), `lg`
11
+ - `variant` — visual style: `default`, `outlined`, `filled`
12
+ - `trend` — trend indicator: `up`, `down`, `neutral`
13
+ - `trend-value` — value to display with trend (e.g., "+5%")
14
+
15
+ **When to use:** Use for dashboard metrics, system monitoring, KPI displays.
16
+
17
+ ## Examples
18
+
19
+ ```html
20
+ <dt-stat label="CPU Usage" value="42%"></dt-stat>
21
+
22
+ <dt-stat label="Memory" value="8.2 GB" description="of 16 GB used"></dt-stat>
23
+
24
+ <dt-stat label="Uptime" value="99.9%" size="lg" variant="filled"></dt-stat>
25
+
26
+ <dt-stat
27
+ label="Traffic"
28
+ value="12.5k"
29
+ description="visitors today"
30
+ trend="up"
31
+ trend-value="+18%"
32
+ ></dt-stat>
33
+ ```
34
+
35
+ ## Full-Page Example — Stat Cards
36
+
37
+ ```html
38
+ <dt-grid cols="3" min-width="150">
39
+ <dt-stat label="CPU Usage" value="42%"></dt-stat>
40
+ <dt-stat label="Memory" value="8.2 GB" description="of 16 GB used"></dt-stat>
41
+ <dt-stat label="Disk" value="256 GB" description="free space" variant="filled"></dt-stat>
42
+ </dt-grid>
43
+ ```
@@ -0,0 +1,120 @@
1
+ # `<dt-table-view>` and `<dt-column>`
2
+
3
+ Virtualized table for structured row/column data. Column definitions stay declarative in HTML, and sorting is event-driven.
4
+
5
+ ## `<dt-table-view>` Attributes
6
+
7
+ - `row-height` — fixed row height in px
8
+ - `sortable` — enables sortable header affordances
9
+ - `striped` — alternating row backgrounds
10
+ - `bordered` — cell borders
11
+ - `empty-text` — empty-state text
12
+ - `.rows` JS property — array of row objects
13
+ - `dt-sort` event — emitted with `{ field, direction }`; update `.rows` yourself
14
+ - `dt-row-click` event — emitted when a row is clicked
15
+
16
+ ## `<dt-column>` Attributes
17
+
18
+ - `field` — row field key
19
+ - `header` — column header label
20
+ - `width` — column width in px or `auto`
21
+ - `min-width` — minimum column width
22
+ - `align` — `left`, `center`, or `right`
23
+
24
+ If a `<dt-column>` contains a `<template>`, its cells use that template. `data-field="x"` binds text content and `data-field-variant="y"` binds attributes.
25
+
26
+ **When to use:** Use for process lists, CSV-style datasets, summaries from shell commands, and other multi-column records.
27
+
28
+ ## Examples
29
+
30
+ ```html
31
+ <dt-table-view id="process-table" row-height="40" sortable striped>
32
+ <dt-column field="name" header="Process" width="220"></dt-column>
33
+ <dt-column field="cpu" header="CPU %" width="100" align="right"></dt-column>
34
+ <dt-column field="status" header="Status" width="140">
35
+ <template>
36
+ <dt-badge data-field="status" data-field-variant="statusVariant"></dt-badge>
37
+ </template>
38
+ </dt-column>
39
+ </dt-table-view>
40
+
41
+ <script>
42
+ const table = document.getElementById('process-table');
43
+ const rows = [
44
+ { name: 'node', cpu: '12.4', status: 'running', statusVariant: 'success' },
45
+ { name: 'cron', cpu: '1.2', status: 'idle', statusVariant: 'neutral' },
46
+ ];
47
+
48
+ table.rows = rows;
49
+ table.addEventListener('dt-sort', (event) => {
50
+ const { field, direction } = event.detail;
51
+ table.rows = [...rows].sort((a, b) =>
52
+ direction === 'asc'
53
+ ? String(a[field]).localeCompare(String(b[field]), undefined, { numeric: true })
54
+ : String(b[field]).localeCompare(String(a[field]), undefined, { numeric: true }),
55
+ );
56
+ });
57
+ </script>
58
+ ```
59
+
60
+ ## Full-Page Example — Sortable Process Table
61
+
62
+ ```html
63
+ <!doctype html>
64
+ <html>
65
+ <head>
66
+ <meta charset="utf-8" />
67
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
68
+ <title>Processes</title>
69
+ <style>
70
+ body {
71
+ background: var(--dt-bg);
72
+ }
73
+
74
+ #process-table {
75
+ height: 360px;
76
+ }
77
+ </style>
78
+ </head>
79
+ <body>
80
+ <h1>Processes</h1>
81
+ <dt-card>
82
+ <dt-table-view id="process-table" row-height="40" sortable striped>
83
+ <dt-column field="name" header="Process" width="220"></dt-column>
84
+ <dt-column field="cpu" header="CPU %" width="100" align="right"></dt-column>
85
+ <dt-column field="memory" header="Memory" width="120" align="right"></dt-column>
86
+ <dt-column field="status" header="Status" width="120">
87
+ <template>
88
+ <dt-badge data-field="status" data-field-variant="statusVariant"></dt-badge>
89
+ </template>
90
+ </dt-column>
91
+ </dt-table-view>
92
+ </dt-card>
93
+
94
+ <script>
95
+ const table = document.getElementById('process-table');
96
+ const rows = [
97
+ {
98
+ name: 'node',
99
+ cpu: '12.5',
100
+ memory: '256 MB',
101
+ status: 'running',
102
+ statusVariant: 'success',
103
+ },
104
+ { name: 'redis', cpu: '4.1', memory: '128 MB', status: 'idle', statusVariant: 'neutral' },
105
+ { name: 'cron', cpu: '0.7', memory: '32 MB', status: 'degraded', statusVariant: 'warning' },
106
+ ];
107
+
108
+ table.rows = rows;
109
+ table.addEventListener('dt-sort', (event) => {
110
+ const { field, direction } = event.detail;
111
+ table.rows = [...rows].sort((a, b) =>
112
+ direction === 'asc'
113
+ ? String(a[field]).localeCompare(String(b[field]), undefined, { numeric: true })
114
+ : String(b[field]).localeCompare(String(a[field]), undefined, { numeric: true }),
115
+ );
116
+ });
117
+ </script>
118
+ </body>
119
+ </html>
120
+ ```
@@ -0,0 +1,18 @@
1
+ # `<dt-tooltip>`
2
+
3
+ Use `<dt-tooltip>` for hover or focus hints around interactive elements.
4
+
5
+ ## Attributes
6
+
7
+ - `content` — tooltip text
8
+ - `placement` — `top`, `bottom`, `left`, `right`
9
+ - `delay` — show delay in ms
10
+ - `disabled` — disable tooltip
11
+
12
+ ## Example
13
+
14
+ ```html
15
+ <dt-tooltip content="Save file" placement="top">
16
+ <dt-button>Save</dt-button>
17
+ </dt-tooltip>
18
+ ```
@@ -0,0 +1,25 @@
1
+ # Preview Editing
2
+
3
+ Use this workflow when the user asks to change content already shown in a Preview window.
4
+
5
+ ## Preferred Flow
6
+
7
+ 1. Call the focused Preview action `Get State`.
8
+ 2. Read `file.path` from the result — this is a **home-relative** path.
9
+ 3. Join `file.path` with the `Home` directory from `[Desktop Context]` to get the absolute path.
10
+ 4. Use the built-in `read` tool on the absolute path.
11
+ 5. Call `edit` with an exact `oldText` match. (`edit` accepts both absolute and home-relative paths.)
12
+ 6. Use `undo_edit` or `redo_edit` later with the same file path if needed.
13
+
14
+ ## Rules
15
+
16
+ - Prefer `edit` over regenerating HTML when the request is a targeted revision.
17
+ - Do not guess the file path.
18
+ - Do not edit blind; always inspect the current file first.
19
+ - `oldText` must match exactly once or the tool fails.
20
+ - After `edit`, `undo_edit`, or `redo_edit`, Preview reload is automatic through DeskTalk events.
21
+ - If the LiveApp uses `DeskTalk.storage` and you change the expected data shape, also inspect and migrate the relevant storage files.
22
+
23
+ ## When to Regenerate Instead
24
+
25
+ Regenerate with `create_liveapp` only when the user wants a new visual artifact, a major redesign, or content that is not already represented by the current Preview document.
@@ -0,0 +1,74 @@
1
+ # LiveApp Actions
2
+
3
+ LiveApps can register actions that the AI can invoke by name.
4
+
5
+ Use `window.DeskTalk.actions` to register, replace, or remove actions at runtime.
6
+
7
+ ## API
8
+
9
+ ```html
10
+ <script>
11
+ await window.DeskTalk.actions.register({
12
+ name: 'Add Task',
13
+ description: 'Create a task in the board',
14
+ params: {
15
+ title: { type: 'string', description: 'Task title', required: true },
16
+ column: { type: 'string', description: 'Optional target column' },
17
+ },
18
+ handler: async ({ title, column }) => {
19
+ addTask(title, column || 'Todo');
20
+ return { created: true };
21
+ },
22
+ });
23
+
24
+ await window.DeskTalk.actions.unregister('Add Task');
25
+ await window.DeskTalk.actions.clear();
26
+ </script>
27
+ ```
28
+
29
+ ## Behavior
30
+
31
+ - `register()` requires `name` and `handler`.
32
+ - Registering an action with an existing name replaces the previous action.
33
+ - `handler` receives one params object and can return any JSON-serializable result.
34
+ - `unregister(name)` removes one action.
35
+ - `clear()` removes all LiveApp-registered actions for the current page state.
36
+
37
+ ## Sub-Page Pattern
38
+
39
+ When the user navigates between in-app views, clear old actions before registering the new view's actions.
40
+
41
+ ```html
42
+ <script>
43
+ function showBoardPage() {
44
+ window.DeskTalk.actions.clear();
45
+ window.DeskTalk.actions.register({
46
+ name: 'Add Task',
47
+ description: 'Create a task in the board',
48
+ handler: async ({ title }) => {
49
+ addTask(title);
50
+ },
51
+ params: {
52
+ title: { type: 'string', required: true },
53
+ },
54
+ });
55
+ }
56
+
57
+ function showSettingsPage() {
58
+ window.DeskTalk.actions.clear();
59
+ window.DeskTalk.actions.register({
60
+ name: 'Save Settings',
61
+ description: 'Persist the current settings form',
62
+ handler: async () => saveSettings(),
63
+ });
64
+ }
65
+ </script>
66
+ ```
67
+
68
+ ## Reloads
69
+
70
+ LiveApp actions are tied to the current iframe session.
71
+
72
+ - If the LiveApp reloads, previous action registrations are cleared.
73
+ - Re-register actions during page startup or view initialization.
74
+ - The AI will see the latest registered actions in the focused Preview window's Desktop Context.
@@ -0,0 +1,187 @@
1
+ # HTML Bridge
2
+
3
+ Generated previews automatically receive `window.DeskTalk`.
4
+
5
+ For persistent app data, use `window.DeskTalk.storage`. Read `html/storage` for the full storage reference.
6
+
7
+ For external HTTP APIs, use `window.DeskTalk.request(...)` instead of plain browser `fetch()` when the request may hit another origin.
8
+
9
+ For AI-invokable LiveApp actions, use `window.DeskTalk.actions`. Read `html/actions` for the full actions reference.
10
+
11
+ ## Reading State
12
+
13
+ Use `await window.DeskTalk.getState(selector)`.
14
+
15
+ Supported selectors:
16
+
17
+ - `desktop.summary`
18
+ - `desktop.windows`
19
+ - `desktop.focusedWindow`
20
+ - `theme.current`
21
+ - `preview.context`
22
+
23
+ Example:
24
+
25
+ ```html
26
+ <script>
27
+ async function loadDesktopState() {
28
+ const desktop = await window.DeskTalk.getState('desktop.summary');
29
+ console.log(desktop.windows);
30
+ }
31
+ </script>
32
+ ```
33
+
34
+ ## Running Commands
35
+
36
+ `DeskTalk.exec` and `DeskTalk.execute` are equivalent.
37
+
38
+ - Shell string form: `await DeskTalk.exec("ls -la")`
39
+ - Explicit args form: `await DeskTalk.exec("git", ["status", "--short"])`
40
+ - Optional options object: `await DeskTalk.exec("git", ["status"], { cwd: "subdir" })`
41
+
42
+ Prefer explicit args when user input may be involved.
43
+
44
+ `DeskTalk.exec()` returns a structured result object, not just stdout text.
45
+
46
+ TypeScript shape:
47
+
48
+ ```ts
49
+ type DeskTalkExecResult = {
50
+ ok: boolean;
51
+ exitCode: number | null;
52
+ stdout: string;
53
+ stderr: string;
54
+ timedOut: boolean;
55
+ truncated: boolean;
56
+ command: {
57
+ program: string;
58
+ args: string[];
59
+ cwd: string;
60
+ };
61
+ };
62
+ ```
63
+
64
+ Example value:
65
+
66
+ ```ts
67
+ const result: DeskTalkExecResult = {
68
+ ok: true,
69
+ exitCode: 0,
70
+ stdout: 'file-a\nfile-b\n',
71
+ stderr: '',
72
+ timedOut: false,
73
+ truncated: false,
74
+ command: {
75
+ program: 'ls',
76
+ args: ['-la'],
77
+ cwd: '/path/to/working/dir',
78
+ },
79
+ };
80
+ ```
81
+
82
+ Typical usage:
83
+
84
+ ```html
85
+ <script>
86
+ async function listFiles() {
87
+ const result = await window.DeskTalk.exec('ls', ['-la']);
88
+
89
+ if (!result.ok) {
90
+ console.error('Command failed:', result.stderr || result.exitCode);
91
+ return;
92
+ }
93
+
94
+ console.log(result.stdout);
95
+ }
96
+ </script>
97
+ ```
98
+
99
+ ## Network Requests
100
+
101
+ Use `await window.DeskTalk.request(url, options)` for HTTP requests that need backend proxying.
102
+
103
+ - Prefer `DeskTalk.request(...)` over browser `fetch()` for cross-origin API calls.
104
+ - Response bodies come back as text. Parse JSON yourself with `JSON.parse(result.body)`.
105
+ - You can pass either `body` or `json` in options, not both.
106
+ - `GET` and `HEAD` requests cannot include a body.
107
+ - Private and localhost destinations are blocked by policy.
108
+
109
+ TypeScript shape:
110
+
111
+ ```ts
112
+ type DeskTalkRequestResult = {
113
+ ok: boolean;
114
+ status: number;
115
+ statusText: string;
116
+ headers: Record<string, string>;
117
+ body: string;
118
+ truncated: boolean;
119
+ url: string;
120
+ };
121
+ ```
122
+
123
+ Examples:
124
+
125
+ ```html
126
+ <script>
127
+ async function loadTasks() {
128
+ const result = await window.DeskTalk.request('https://api.example.com/tasks', {
129
+ headers: {
130
+ accept: 'application/json',
131
+ },
132
+ });
133
+
134
+ if (!result.ok) {
135
+ throw new Error(`Request failed: ${result.status} ${result.statusText}`);
136
+ }
137
+
138
+ return JSON.parse(result.body);
139
+ }
140
+
141
+ async function createTask(title) {
142
+ const result = await window.DeskTalk.request('https://api.example.com/tasks', {
143
+ method: 'POST',
144
+ json: { title, status: 'todo' },
145
+ headers: {
146
+ authorization: 'Bearer <token>',
147
+ },
148
+ });
149
+
150
+ return JSON.parse(result.body);
151
+ }
152
+ </script>
153
+ ```
154
+
155
+ Use `DeskTalk.request(...)` for API/data fetching and `DeskTalk.exec(...)` only for constrained shell workflows the user actually asked for.
156
+
157
+ ## Persistent Storage
158
+
159
+ Use `DeskTalk.storage` for durable LiveApp data.
160
+
161
+ - KV: `await DeskTalk.storage.get('settings')`, `await DeskTalk.storage.set('settings', value)`
162
+ - Collections: `const tasks = DeskTalk.storage.collection('tasks')`
163
+ - Use collections for lists of records instead of writing large JSON blobs manually.
164
+
165
+ Example:
166
+
167
+ ```html
168
+ <script>
169
+ const tasks = window.DeskTalk.storage.collection('tasks');
170
+
171
+ async function addTask(title) {
172
+ await tasks.insert({
173
+ id: crypto.randomUUID(),
174
+ title,
175
+ status: 'todo',
176
+ createdAt: Date.now(),
177
+ });
178
+ }
179
+ </script>
180
+ ```
181
+
182
+ ## Safety
183
+
184
+ - Dangerous commands such as `rm`, `chmod`, `sudo`, `kill`, or destructive git subcommands trigger a native confirmation dialog.
185
+ - Catastrophic commands such as formatting disks or `rm` against `/` are blocked outright.
186
+ - The bridge is for constrained interaction; do not assume unrestricted shell access.
187
+ - Prefer `DeskTalk.storage` over shell commands for normal app persistence.
@@ -0,0 +1,66 @@
1
+ # HTML Components
2
+
3
+ DeskTalk injects shared UI primitives into every generated Preview document.
4
+
5
+ ## Auto-Injected Assets
6
+
7
+ - A `<link data-dt-theme>` stylesheet is injected automatically when `create_liveapp` runs.
8
+ - That stylesheet includes the full `--dt-*` token set for the current theme and accent color.
9
+ - It also includes base styling for `body`, headings, paragraphs, links, tables, `code`, and `pre`.
10
+ - A `window.DeskTalk` bridge is also injected automatically.
11
+ - All web component definitions (`dt-*` elements) are automatically available.
12
+ - That bridge includes persistent storage APIs through `window.DeskTalk.storage`.
13
+
14
+ ## Typography
15
+
16
+ Headings (`h1`-`h6`) and paragraphs (`p`) are pre-styled by the injected stylesheet.
17
+
18
+ - Never add CSS rules or inline styles that target headings or paragraphs directly.
19
+ - Do not override their font size, weight, family, color, margin, line height, letter spacing, or text transform.
20
+ - Use native tags and let the injected theme styles handle typography.
21
+ - If you need muted or secondary text, use utility classes such as `.text-muted` and `.text-secondary`.
22
+
23
+ ## Utility Classes
24
+
25
+ - `.text-muted` — muted/tertiary text color
26
+ - `.text-secondary` — secondary text color
27
+ - `.accent-bg` — accent-subtle background
28
+
29
+ Use these before creating one-off visual treatments.
30
+
31
+ ---
32
+
33
+ ## Available Components
34
+
35
+ Each component has its own manual page with full attributes and examples.
36
+
37
+ ### Layout
38
+
39
+ - `html/components/dt-grid` — Auto-responsive grid layout
40
+ - `html/components/dt-stack` — Flexbox stack for vertical or horizontal layouts (`direction` must be `row` or `column`, never `horizontal` / `vertical`)
41
+
42
+ ### Display
43
+
44
+ - `html/components/dt-card` — Visually grouped content container
45
+ - `html/components/dt-stat` — Metric/KPI display
46
+ - `html/components/dt-badge` — Inline status pill/badge
47
+ - `html/components/dt-divider` — Horizontal or vertical separator
48
+
49
+ ### Interactive
50
+
51
+ - `html/components/dt-button` — Themed button for actions
52
+ - `html/components/dt-select` — Dropdown select
53
+ - `html/components/dt-tooltip` — Hover/focus hints
54
+
55
+ ### Data
56
+
57
+ - `html/components/dt-list-view` — Virtualized list for long collections
58
+ - `html/components/dt-table-view` — Virtualized table for structured data
59
+ - `html/components/dt-chart` — Interactive charts (via `.data` JS property)
60
+
61
+ ### Content
62
+
63
+ - `html/components/dt-markdown` — Themed markdown renderer
64
+ - `html/components/dt-markdown-editor` — WYSIWYG markdown editor
65
+
66
+ Call `read_manual` with one of the paths above for full documentation.