@monkey-mini-app/dsh-mini-app 0.1.0 → 0.1.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 (317) hide show
  1. package/README.md +59 -0
  2. package/assets/apps-list.png +0 -0
  3. package/assets/complex-demo-app.png +0 -0
  4. package/assets/demo-app.png +0 -0
  5. package/assets/home.png +0 -0
  6. package/assets/sidebar-mode.png +0 -0
  7. package/lib/client.js +2024 -783
  8. package/lib/index.d.ts +5 -2
  9. package/lib/index.js +29 -16
  10. package/package.json +12 -10
  11. package/skills/monkey-mini-app/SKILL.md +182 -106
  12. package/skills/monkey-mini-app/references/catalog.md +236 -99
  13. package/skills/monkey-mini-app/references/contracts/accordion.md +30 -0
  14. package/skills/monkey-mini-app/references/contracts/activity-feed.md +12 -2
  15. package/skills/monkey-mini-app/references/contracts/alert-dialog.md +38 -0
  16. package/skills/monkey-mini-app/references/contracts/alert.md +38 -0
  17. package/skills/monkey-mini-app/references/contracts/app-shell.md +2 -2
  18. package/skills/monkey-mini-app/references/contracts/aspect-ratio.md +25 -0
  19. package/skills/monkey-mini-app/references/contracts/attachment-gallery.md +12 -2
  20. package/skills/monkey-mini-app/references/contracts/attachment.md +35 -0
  21. package/skills/monkey-mini-app/references/contracts/autocomplete.md +12 -2
  22. package/skills/monkey-mini-app/references/contracts/avatar.md +24 -0
  23. package/skills/monkey-mini-app/references/contracts/badge.md +26 -0
  24. package/skills/monkey-mini-app/references/contracts/breadcrumb.md +33 -0
  25. package/skills/monkey-mini-app/references/contracts/bubble.md +30 -0
  26. package/skills/monkey-mini-app/references/contracts/button-group.md +36 -0
  27. package/skills/monkey-mini-app/references/contracts/button.md +26 -0
  28. package/skills/monkey-mini-app/references/contracts/calendar.md +20 -0
  29. package/skills/monkey-mini-app/references/contracts/card.md +41 -0
  30. package/skills/monkey-mini-app/references/contracts/cascader.md +12 -2
  31. package/skills/monkey-mini-app/references/contracts/chart.md +32 -0
  32. package/skills/monkey-mini-app/references/contracts/checkbox.md +19 -0
  33. package/skills/monkey-mini-app/references/contracts/code-block.md +20 -2
  34. package/skills/monkey-mini-app/references/contracts/code-editor.md +30 -4
  35. package/skills/monkey-mini-app/references/contracts/collapsible.md +21 -0
  36. package/skills/monkey-mini-app/references/contracts/color-picker.md +12 -2
  37. package/skills/monkey-mini-app/references/contracts/combobox.md +34 -0
  38. package/skills/monkey-mini-app/references/contracts/command.md +41 -0
  39. package/skills/monkey-mini-app/references/contracts/comment-thread.md +12 -2
  40. package/skills/monkey-mini-app/references/contracts/commit-graph.md +50 -0
  41. package/skills/monkey-mini-app/references/contracts/confirm-dialog.md +20 -2
  42. package/skills/monkey-mini-app/references/contracts/context-menu.md +41 -0
  43. package/skills/monkey-mini-app/references/contracts/copyable.md +12 -2
  44. package/skills/monkey-mini-app/references/contracts/currency-input.md +12 -2
  45. package/skills/monkey-mini-app/references/contracts/dashboard-shell.md +41 -0
  46. package/skills/monkey-mini-app/references/contracts/data-grid.md +13 -6
  47. package/skills/monkey-mini-app/references/contracts/date-picker.md +20 -2
  48. package/skills/monkey-mini-app/references/contracts/date-range-picker.md +10 -2
  49. package/skills/monkey-mini-app/references/contracts/date-time-picker.md +20 -2
  50. package/skills/monkey-mini-app/references/contracts/date-time-range-picker.md +20 -2
  51. package/skills/monkey-mini-app/references/contracts/description-list.md +12 -2
  52. package/skills/monkey-mini-app/references/contracts/detail-panel.md +10 -2
  53. package/skills/monkey-mini-app/references/contracts/dialog.md +44 -0
  54. package/skills/monkey-mini-app/references/contracts/diff-viewer.md +21 -2
  55. package/skills/monkey-mini-app/references/contracts/donut-chart.md +14 -2
  56. package/skills/monkey-mini-app/references/contracts/drawer.md +29 -0
  57. package/skills/monkey-mini-app/references/contracts/dropdown-menu.md +49 -0
  58. package/skills/monkey-mini-app/references/contracts/duration-input.md +20 -2
  59. package/skills/monkey-mini-app/references/contracts/empty.md +40 -0
  60. package/skills/monkey-mini-app/references/contracts/env-badge.md +12 -2
  61. package/skills/monkey-mini-app/references/contracts/env-table.md +46 -0
  62. package/skills/monkey-mini-app/references/contracts/event-calendar.md +28 -20
  63. package/skills/monkey-mini-app/references/contracts/field.md +34 -0
  64. package/skills/monkey-mini-app/references/contracts/file-dropzone.md +20 -2
  65. package/skills/monkey-mini-app/references/contracts/file-tree.md +12 -2
  66. package/skills/monkey-mini-app/references/contracts/filter-bar.md +2 -2
  67. package/skills/monkey-mini-app/references/contracts/form-sheet.md +51 -0
  68. package/skills/monkey-mini-app/references/contracts/gantt.md +20 -2
  69. package/skills/monkey-mini-app/references/contracts/gauge.md +14 -2
  70. package/skills/monkey-mini-app/references/contracts/hover-card.md +21 -0
  71. package/skills/monkey-mini-app/references/contracts/input-group.md +24 -0
  72. package/skills/monkey-mini-app/references/contracts/input.md +33 -0
  73. package/skills/monkey-mini-app/references/contracts/item.md +36 -0
  74. package/skills/monkey-mini-app/references/contracts/jira-wiki.md +3 -4
  75. package/skills/monkey-mini-app/references/contracts/jql-input.md +15 -8
  76. package/skills/monkey-mini-app/references/contracts/json-viewer.md +20 -2
  77. package/skills/monkey-mini-app/references/contracts/kanban-issue-panel.md +12 -2
  78. package/skills/monkey-mini-app/references/contracts/kanban.md +10 -2
  79. package/skills/monkey-mini-app/references/contracts/kbd.md +20 -0
  80. package/skills/monkey-mini-app/references/contracts/label.md +33 -0
  81. package/skills/monkey-mini-app/references/contracts/list-detail.md +46 -0
  82. package/skills/monkey-mini-app/references/contracts/log-viewer.md +45 -4
  83. package/skills/monkey-mini-app/references/contracts/markdown-editor.md +20 -2
  84. package/skills/monkey-mini-app/references/contracts/markdown.md +12 -2
  85. package/skills/monkey-mini-app/references/contracts/marker.md +30 -0
  86. package/skills/monkey-mini-app/references/contracts/menubar.md +34 -0
  87. package/skills/monkey-mini-app/references/contracts/message-scroller.md +24 -0
  88. package/skills/monkey-mini-app/references/contracts/message.md +24 -0
  89. package/skills/monkey-mini-app/references/contracts/mini-calendar.md +20 -2
  90. package/skills/monkey-mini-app/references/contracts/native-select.md +21 -0
  91. package/skills/monkey-mini-app/references/contracts/navigation-menu.md +27 -0
  92. package/skills/monkey-mini-app/references/contracts/notification-center.md +12 -2
  93. package/skills/monkey-mini-app/references/contracts/number-field.md +20 -2
  94. package/skills/monkey-mini-app/references/contracts/page-header.md +2 -2
  95. package/skills/monkey-mini-app/references/contracts/pagination.md +33 -0
  96. package/skills/monkey-mini-app/references/contracts/password-field.md +12 -2
  97. package/skills/monkey-mini-app/references/contracts/phone-input.md +12 -2
  98. package/skills/monkey-mini-app/references/contracts/popover.md +32 -0
  99. package/skills/monkey-mini-app/references/contracts/progress-ring.md +14 -2
  100. package/skills/monkey-mini-app/references/contracts/progress.md +39 -0
  101. package/skills/monkey-mini-app/references/contracts/questionnaire.md +33 -0
  102. package/skills/monkey-mini-app/references/contracts/radar-chart.md +14 -2
  103. package/skills/monkey-mini-app/references/contracts/radio-group.md +20 -0
  104. package/skills/monkey-mini-app/references/contracts/rating.md +12 -2
  105. package/skills/monkey-mini-app/references/contracts/relative-date-picker.md +20 -2
  106. package/skills/monkey-mini-app/references/contracts/request-inspector.md +12 -2
  107. package/skills/monkey-mini-app/references/contracts/resizable.md +29 -0
  108. package/skills/monkey-mini-app/references/contracts/reveal.md +31 -0
  109. package/skills/monkey-mini-app/references/contracts/rich-text-editor.md +14 -2
  110. package/skills/monkey-mini-app/references/contracts/run-timeline.md +20 -2
  111. package/skills/monkey-mini-app/references/contracts/scroll-area.md +20 -0
  112. package/skills/monkey-mini-app/references/contracts/scrollspy.md +20 -2
  113. package/skills/monkey-mini-app/references/contracts/search-input.md +12 -2
  114. package/skills/monkey-mini-app/references/contracts/select.md +36 -0
  115. package/skills/monkey-mini-app/references/contracts/separator.md +27 -0
  116. package/skills/monkey-mini-app/references/contracts/settings-split.md +53 -0
  117. package/skills/monkey-mini-app/references/contracts/severity-chip.md +12 -2
  118. package/skills/monkey-mini-app/references/contracts/sheet.md +34 -0
  119. package/skills/monkey-mini-app/references/contracts/sidebar.md +42 -0
  120. package/skills/monkey-mini-app/references/contracts/skeleton.md +33 -0
  121. package/skills/monkey-mini-app/references/contracts/slider-range.md +12 -2
  122. package/skills/monkey-mini-app/references/contracts/slider.md +25 -0
  123. package/skills/monkey-mini-app/references/contracts/sortable-list.md +20 -2
  124. package/skills/monkey-mini-app/references/contracts/sparkline.md +13 -2
  125. package/skills/monkey-mini-app/references/contracts/spinner.md +31 -0
  126. package/skills/monkey-mini-app/references/contracts/stacked-bar-chart.md +17 -2
  127. package/skills/monkey-mini-app/references/contracts/stat-card.md +2 -2
  128. package/skills/monkey-mini-app/references/contracts/status-badge.md +2 -2
  129. package/skills/monkey-mini-app/references/contracts/stepper-item.md +39 -0
  130. package/skills/monkey-mini-app/references/contracts/stepper.md +38 -11
  131. package/skills/monkey-mini-app/references/contracts/switch.md +25 -0
  132. package/skills/monkey-mini-app/references/contracts/table-page.md +41 -0
  133. package/skills/monkey-mini-app/references/contracts/table.md +42 -0
  134. package/skills/monkey-mini-app/references/contracts/tabs.md +31 -0
  135. package/skills/monkey-mini-app/references/contracts/tag-input.md +12 -2
  136. package/skills/monkey-mini-app/references/contracts/terminal.md +13 -2
  137. package/skills/monkey-mini-app/references/contracts/test-step-list.md +12 -2
  138. package/skills/monkey-mini-app/references/contracts/textarea.md +25 -0
  139. package/skills/monkey-mini-app/references/contracts/time-picker.md +18 -2
  140. package/skills/monkey-mini-app/references/contracts/time-range-picker.md +20 -2
  141. package/skills/monkey-mini-app/references/contracts/time-wheel.md +6 -2
  142. package/skills/monkey-mini-app/references/contracts/timeline.md +20 -2
  143. package/skills/monkey-mini-app/references/contracts/timezone-select.md +20 -2
  144. package/skills/monkey-mini-app/references/contracts/toast.md +39 -0
  145. package/skills/monkey-mini-app/references/contracts/toggle-group.md +28 -0
  146. package/skills/monkey-mini-app/references/contracts/toggle.md +26 -0
  147. package/skills/monkey-mini-app/references/contracts/tooltip.md +30 -0
  148. package/skills/monkey-mini-app/references/contracts/transfer.md +12 -2
  149. package/skills/monkey-mini-app/references/contracts/tree-view.md +20 -2
  150. package/skills/monkey-mini-app/references/contracts/trend-card.md +12 -2
  151. package/skills/monkey-mini-app/references/contracts/user-picker.md +12 -2
  152. package/skills/monkey-mini-app/references/contracts/wizard-shell.md +56 -0
  153. package/skills/monkey-mini-app/references/ctx.md +123 -53
  154. package/skills/monkey-mini-app/references/eval.md +115 -0
  155. package/skills/monkey-mini-app/references/examples/alert/alert-01.tsx +17 -0
  156. package/skills/monkey-mini-app/references/examples/aspect-ratio/aspect-ratio-01.tsx +16 -0
  157. package/skills/monkey-mini-app/references/examples/attachment/attachment-01.tsx +19 -0
  158. package/skills/monkey-mini-app/references/examples/breadcrumb/breadcrumb-01.tsx +31 -0
  159. package/skills/monkey-mini-app/references/examples/bubble/bubble-01.tsx +16 -0
  160. package/skills/monkey-mini-app/references/examples/button-group/button-group-01.tsx +23 -0
  161. package/skills/monkey-mini-app/references/examples/card/card-01.tsx +19 -0
  162. package/skills/monkey-mini-app/references/examples/charts-blocks.md +15 -0
  163. package/skills/monkey-mini-app/references/examples/code-block/code-block-01.tsx +14 -0
  164. package/skills/monkey-mini-app/references/examples/code-editor/code-editor-01.tsx +15 -0
  165. package/skills/monkey-mini-app/references/examples/command/command-01.tsx +30 -0
  166. package/skills/monkey-mini-app/references/examples/confirm-dialog/confirm-dialog-01.tsx +33 -0
  167. package/skills/monkey-mini-app/references/examples/context-menu/context-menu-01.tsx +29 -0
  168. package/skills/monkey-mini-app/references/examples/dashboard-shell/dashboard-shell-01.tsx +78 -0
  169. package/skills/monkey-mini-app/references/examples/data-grid/data-grid-01.tsx +34 -0
  170. package/skills/monkey-mini-app/references/examples/data-grid/data-grid-02.tsx +88 -0
  171. package/skills/monkey-mini-app/references/examples/date-picker/date-picker-01.tsx +14 -0
  172. package/skills/monkey-mini-app/references/examples/date-range-picker/date-range-picker-01.tsx +14 -0
  173. package/skills/monkey-mini-app/references/examples/date-time-picker/date-time-picker-01.tsx +16 -0
  174. package/skills/monkey-mini-app/references/examples/date-time-range-picker/date-time-range-picker-01.tsx +15 -0
  175. package/skills/monkey-mini-app/references/examples/detail-panel/detail-panel-01.tsx +21 -0
  176. package/skills/monkey-mini-app/references/examples/dialog/dialog-01.tsx +30 -0
  177. package/skills/monkey-mini-app/references/examples/diff-viewer/diff-viewer-01.tsx +10 -0
  178. package/skills/monkey-mini-app/references/examples/dropdown-menu/dropdown-menu-01.tsx +31 -0
  179. package/skills/monkey-mini-app/references/examples/duration-input/duration-input-01.tsx +20 -0
  180. package/skills/monkey-mini-app/references/examples/editors.md +11 -0
  181. package/skills/monkey-mini-app/references/examples/empty/empty-01.tsx +19 -0
  182. package/skills/monkey-mini-app/references/examples/event-calendar/event-calendar-01.tsx +53 -0
  183. package/skills/monkey-mini-app/references/examples/file-dropzone/file-dropzone-01.tsx +14 -0
  184. package/skills/monkey-mini-app/references/examples/form-sheet/form-sheet-01.tsx +85 -0
  185. package/skills/monkey-mini-app/references/examples/forms.md +16 -0
  186. package/skills/monkey-mini-app/references/examples/gantt/gantt-01.tsx +29 -0
  187. package/skills/monkey-mini-app/references/examples/input/input-01.tsx +10 -0
  188. package/skills/monkey-mini-app/references/examples/item/item-01.tsx +19 -0
  189. package/skills/monkey-mini-app/references/examples/jql-input/jql-input-01.tsx +33 -0
  190. package/skills/monkey-mini-app/references/examples/json-viewer/json-viewer-01.tsx +10 -0
  191. package/skills/monkey-mini-app/references/examples/kanban/kanban-01.tsx +60 -0
  192. package/skills/monkey-mini-app/references/examples/label/label-01.tsx +10 -0
  193. package/skills/monkey-mini-app/references/examples/list-detail/list-detail-01.tsx +117 -0
  194. package/skills/monkey-mini-app/references/examples/log-viewer/log-viewer-01.tsx +20 -0
  195. package/skills/monkey-mini-app/references/examples/markdown-editor/markdown-editor-01.tsx +18 -0
  196. package/skills/monkey-mini-app/references/examples/marker/marker-01.tsx +16 -0
  197. package/skills/monkey-mini-app/references/examples/mini-calendar/mini-calendar-01.tsx +14 -0
  198. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-01.tsx +20 -0
  199. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-02.tsx +32 -0
  200. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-03.tsx +47 -0
  201. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-04.tsx +20 -0
  202. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-05.tsx +24 -0
  203. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-06.tsx +89 -0
  204. package/skills/monkey-mini-app/references/examples/misc-editors/misc-editors-01.tsx +114 -0
  205. package/skills/monkey-mini-app/references/examples/misc-editors/misc-editors-02.tsx +33 -0
  206. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-01.tsx +22 -0
  207. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-02.tsx +37 -0
  208. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-03.tsx +42 -0
  209. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-04.tsx +25 -0
  210. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-05.tsx +27 -0
  211. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-06.tsx +33 -0
  212. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-07.tsx +44 -0
  213. package/skills/monkey-mini-app/references/examples/misc-overlays/misc-overlays-01.tsx +43 -0
  214. package/skills/monkey-mini-app/references/examples/misc-overlays/misc-overlays-02.tsx +38 -0
  215. package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-01.tsx +21 -0
  216. package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-02.tsx +52 -0
  217. package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-03.tsx +44 -0
  218. package/skills/monkey-mini-app/references/examples/number-field/number-field-01.tsx +22 -0
  219. package/skills/monkey-mini-app/references/examples/overlays.md +11 -0
  220. package/skills/monkey-mini-app/references/examples/pagination/pagination-01.tsx +51 -0
  221. package/skills/monkey-mini-app/references/examples/primitives.md +12 -0
  222. package/skills/monkey-mini-app/references/examples/progress/progress-01.tsx +10 -0
  223. package/skills/monkey-mini-app/references/examples/relative-date-picker/relative-date-picker-01.tsx +19 -0
  224. package/skills/monkey-mini-app/references/examples/rich-text-editor/rich-text-editor-01.tsx +15 -0
  225. package/skills/monkey-mini-app/references/examples/run-timeline/run-timeline-01.tsx +17 -0
  226. package/skills/monkey-mini-app/references/examples/scrollspy/scrollspy-01.tsx +29 -0
  227. package/skills/monkey-mini-app/references/examples/separator/separator-01.tsx +10 -0
  228. package/skills/monkey-mini-app/references/examples/settings-split/settings-split-01.tsx +84 -0
  229. package/skills/monkey-mini-app/references/examples/shared/jira-wiki-sample.ts +38 -0
  230. package/skills/monkey-mini-app/references/examples/skeleton/skeleton-01.tsx +10 -0
  231. package/skills/monkey-mini-app/references/examples/slider/slider-01.tsx +22 -0
  232. package/skills/monkey-mini-app/references/examples/sortable-list/sortable-list-01.tsx +18 -0
  233. package/skills/monkey-mini-app/references/examples/spinner/spinner-01.tsx +10 -0
  234. package/skills/monkey-mini-app/references/examples/stepper/stepper-01.tsx +41 -0
  235. package/skills/monkey-mini-app/references/examples/table/table-01.tsx +25 -0
  236. package/skills/monkey-mini-app/references/examples/table-page/table-page-01.tsx +103 -0
  237. package/skills/monkey-mini-app/references/examples/time-picker/time-picker-01.tsx +19 -0
  238. package/skills/monkey-mini-app/references/examples/time-range-picker/time-range-picker-01.tsx +14 -0
  239. package/skills/monkey-mini-app/references/examples/timeline/timeline-01.tsx +18 -0
  240. package/skills/monkey-mini-app/references/examples/timezone-select/timezone-select-01.tsx +15 -0
  241. package/skills/monkey-mini-app/references/examples/toggle/toggle-01.tsx +20 -0
  242. package/skills/monkey-mini-app/references/examples/toggle-group/toggle-group-01.tsx +22 -0
  243. package/skills/monkey-mini-app/references/examples/tree-view/tree-view-01.tsx +25 -0
  244. package/skills/monkey-mini-app/references/examples/wizard-shell/wizard-shell-01.tsx +58 -0
  245. package/skills/monkey-mini-app/references/history.md +23 -7
  246. package/skills/monkey-mini-app/references/icons.md +99 -69
  247. package/skills/monkey-mini-app/references/llm-json.md +39 -26
  248. package/skills/monkey-mini-app/references/loader.md +47 -20
  249. package/skills/monkey-mini-app/references/looks/aurora-bento.md +88 -0
  250. package/skills/monkey-mini-app/references/looks/desk-split.md +89 -0
  251. package/skills/monkey-mini-app/references/looks/editorial.md +78 -0
  252. package/skills/monkey-mini-app/references/looks/glass-island.md +90 -0
  253. package/skills/monkey-mini-app/references/looks/index.md +18 -0
  254. package/skills/monkey-mini-app/references/looks/signage.md +74 -0
  255. package/skills/monkey-mini-app/references/looks/tape.md +22 -0
  256. package/skills/monkey-mini-app/references/looks/terminal.md +88 -0
  257. package/skills/monkey-mini-app/references/looks/void.md +22 -0
  258. package/skills/monkey-mini-app/references/styling.md +189 -0
  259. package/skills/monkey-mini-app/references/test.md +12 -12
  260. package/skills/monkey-mini-app/references/theme.md +197 -0
  261. package/skills/monkey-mini-app/references/tools.md +12 -12
  262. package/skills/monkey-mini-app/references/troubleshoot.md +165 -12
  263. package/skills/monkey-mini-app/templates/README.md +33 -21
  264. package/skills/monkey-mini-app/templates/{jira → board}/main.api.ts +11 -11
  265. package/skills/monkey-mini-app/templates/board/manifest.json +8 -0
  266. package/skills/monkey-mini-app/templates/board/theme.css +46 -0
  267. package/skills/monkey-mini-app/templates/board/ui.tsx +546 -0
  268. package/skills/monkey-mini-app/templates/chores/main.api.ts +35 -0
  269. package/skills/monkey-mini-app/templates/chores/manifest.json +8 -0
  270. package/skills/monkey-mini-app/templates/chores/theme.css +46 -0
  271. package/skills/monkey-mini-app/templates/chores/ui.tsx +117 -0
  272. package/skills/monkey-mini-app/templates/minimal/main.api.ts +5 -5
  273. package/skills/monkey-mini-app/templates/minimal/manifest.json +1 -2
  274. package/skills/monkey-mini-app/templates/minimal/ui.tsx +17 -8
  275. package/skills/monkey-mini-app/templates/radar/api/scan.ts +79 -0
  276. package/skills/monkey-mini-app/templates/radar/main.api.ts +29 -0
  277. package/skills/monkey-mini-app/templates/radar/manifest.json +8 -0
  278. package/skills/monkey-mini-app/templates/radar/shared/events.ts +25 -0
  279. package/skills/monkey-mini-app/templates/{insights/lib → radar/shared}/sample.ts +1 -1
  280. package/skills/monkey-mini-app/templates/radar/theme.css +47 -0
  281. package/skills/monkey-mini-app/templates/radar/ui/brief.tsx +31 -0
  282. package/skills/monkey-mini-app/templates/radar/ui.tsx +131 -0
  283. package/skills/monkey-mini-app/templates/runner/main.api.ts +91 -0
  284. package/skills/monkey-mini-app/templates/runner/manifest.json +8 -0
  285. package/skills/monkey-mini-app/templates/runner/shared/events.ts +14 -0
  286. package/skills/monkey-mini-app/templates/runner/theme.css +46 -0
  287. package/skills/monkey-mini-app/templates/runner/ui.tsx +213 -0
  288. package/skills/monkey-mini-app/templates/sheets/main.api.ts +276 -0
  289. package/skills/monkey-mini-app/templates/sheets/manifest.json +8 -0
  290. package/skills/monkey-mini-app/templates/sheets/theme.css +46 -0
  291. package/skills/monkey-mini-app/templates/sheets/ui.tsx +419 -0
  292. package/skills/monkey-mini-app/templates/{todo → today}/main.api.ts +8 -8
  293. package/skills/monkey-mini-app/templates/today/manifest.json +8 -0
  294. package/skills/monkey-mini-app/templates/today/theme.css +45 -0
  295. package/skills/monkey-mini-app/templates/today/ui/item-row.tsx +25 -0
  296. package/skills/monkey-mini-app/templates/today/ui.tsx +406 -0
  297. package/skills/monkey-mini-app/templates/{monitor → watch}/main.api.ts +8 -8
  298. package/skills/monkey-mini-app/templates/watch/manifest.json +8 -0
  299. package/skills/monkey-mini-app/templates/watch/ui.tsx +187 -0
  300. package/skills/monkey-mini-app/tsconfig.json +31 -0
  301. package/skills/monkey-mini-app/types/cdn.d.ts +1 -0
  302. package/tsup.config.ts +1 -0
  303. package/skills/monkey-mini-app/templates/agentrun/main.api.ts +0 -78
  304. package/skills/monkey-mini-app/templates/agentrun/manifest.json +0 -9
  305. package/skills/monkey-mini-app/templates/agentrun/ui.tsx +0 -125
  306. package/skills/monkey-mini-app/templates/insights/main.api.ts +0 -101
  307. package/skills/monkey-mini-app/templates/insights/manifest.json +0 -9
  308. package/skills/monkey-mini-app/templates/insights/ui.tsx +0 -138
  309. package/skills/monkey-mini-app/templates/jira/manifest.json +0 -9
  310. package/skills/monkey-mini-app/templates/jira/ui.tsx +0 -318
  311. package/skills/monkey-mini-app/templates/monitor/manifest.json +0 -9
  312. package/skills/monkey-mini-app/templates/monitor/ui.tsx +0 -176
  313. package/skills/monkey-mini-app/templates/review/main.api.ts +0 -68
  314. package/skills/monkey-mini-app/templates/review/manifest.json +0 -9
  315. package/skills/monkey-mini-app/templates/review/ui.tsx +0 -159
  316. package/skills/monkey-mini-app/templates/todo/manifest.json +0 -8
  317. package/skills/monkey-mini-app/templates/todo/ui.tsx +0 -177
@@ -0,0 +1,197 @@
1
+ <!-- GENERATED by scripts/gen/skill/theme.mjs — do not hand-edit.
2
+ Source: packages/ui/src/styles/globals.css + packages/panel/src/themes.ts THEME_VAR_KEYS.
3
+ Refresh with `pnpm gen:skill`. -->
4
+
5
+ # Theme tokens
6
+
7
+ Every mini-app renders inside the host theme, so ** colours come from tokens, never from literals**. Hardcoded hex does not follow the palette the user picked and is the fastest way to make a generated app look wrong in dark mode.
8
+
9
+ ## Reach for a Tailwind class first
10
+
11
+ The tokens below are exposed as Tailwind semantic utilities, which is what you should write:
12
+
13
+ ```tsx
14
+ <div className="bg-card text-card-foreground border-border ring-ring">
15
+ <span className="text-muted-foreground">…</span>
16
+ <button className="bg-primary text-primary-foreground">…</button>
17
+ </div>
18
+ ```
19
+
20
+ Use the raw `var(--token)` only where a utility cannot reach: `style={{ … }}`, SVG `fill`/`stroke`, gradients, `color-mix()`, or a value you hand to a chart component.
21
+
22
+ ## Tokens
23
+
24
+
25
+ ### Surface
26
+
27
+ | Token | Tailwind | Light | Dark |
28
+ |---|---|---|---|
29
+ | `--background` | `bg-background` | `oklch(1 0 0)` | `oklch(0.145 0 0)` |
30
+ | `--card` | `bg-card` | `oklch(1 0 0)` | `oklch(0.205 0 0)` |
31
+ | `--input` | `border-input` | `oklch(0.922 0 0)` | `oklch(1 0 0 / 15%)` |
32
+ | `--popover` | `bg-popover` | `oklch(1 0 0)` | `oklch(0.205 0 0)` |
33
+ | `--sidebar` | `bg-sidebar` | `oklch(0.985 0 0)` | `oklch(0.205 0 0)` |
34
+ | `--sidebar-accent` | `bg-sidebar-accent · text-sidebar-accent` | `oklch(0.97 0 0)` | `oklch(0.269 0 0)` |
35
+ | `--sidebar-border` | `bg-sidebar-border · text-sidebar-border` | `oklch(0.922 0 0)` | `oklch(1 0 0 / 10%)` |
36
+ | `--sidebar-foreground` | `text-sidebar-foreground` | `oklch(0.145 0 0)` | `oklch(0.985 0 0)` |
37
+ | `--sidebar-primary` | `bg-sidebar-primary · text-sidebar-primary` | `oklch(0.205 0 0)` | `oklch(0.488 0.243 264.376)` |
38
+ | `--sidebar-ring` | `bg-sidebar-ring · text-sidebar-ring` | `oklch(0.708 0 0)` | `oklch(0.556 0 0)` |
39
+
40
+ ### Text
41
+
42
+ | Token | Tailwind | Light | Dark |
43
+ |---|---|---|---|
44
+ | `--accent-foreground` | `text-accent-foreground` | `oklch(0.205 0 0)` | `oklch(0.985 0 0)` |
45
+ | `--card-foreground` | `text-card-foreground` | `oklch(0.145 0 0)` | `oklch(0.985 0 0)` |
46
+ | `--foreground` | `text-foreground` | `oklch(0.145 0 0)` | `oklch(0.985 0 0)` |
47
+ | `--muted-foreground` | `text-muted-foreground` | `oklch(0.556 0 0)` | `oklch(0.708 0 0)` |
48
+ | `--popover-foreground` | `text-popover-foreground` | `oklch(0.145 0 0)` | `oklch(0.985 0 0)` |
49
+ | `--primary-foreground` | `text-primary-foreground` | `oklch(0.985 0 0)` | `oklch(0.205 0 0)` |
50
+ | `--secondary-foreground` | `text-secondary-foreground` | `oklch(0.205 0 0)` | `oklch(0.985 0 0)` |
51
+ | `--sidebar-accent-foreground` | `text-sidebar-accent-foreground` | `oklch(0.205 0 0)` | `oklch(0.985 0 0)` |
52
+ | `--sidebar-primary-foreground` | `text-sidebar-primary-foreground` | `oklch(0.985 0 0)` | `oklch(0.985 0 0)` |
53
+
54
+ ### Brand & status
55
+
56
+ | Token | Tailwind | Light | Dark |
57
+ |---|---|---|---|
58
+ | `--accent` | `bg-accent · text-accent` | `oklch(0.97 0 0)` | `oklch(0.269 0 0)` |
59
+ | `--destructive` | `bg-destructive · text-destructive` | `oklch(0.577 0.245 27.325)` | `oklch(0.704 0.191 22.216)` |
60
+ | `--muted` | `bg-muted · text-muted` | `oklch(0.97 0 0)` | `oklch(0.269 0 0)` |
61
+ | `--primary` | `bg-primary · text-primary` | `oklch(0.205 0 0)` | `oklch(0.922 0 0)` |
62
+ | `--secondary` | `bg-secondary · text-secondary` | `oklch(0.97 0 0)` | `oklch(0.269 0 0)` |
63
+
64
+ ### Lines & focus
65
+
66
+ | Token | Tailwind | Light | Dark |
67
+ |---|---|---|---|
68
+ | `--border` | `border-border` | `oklch(0.922 0 0)` | `oklch(1 0 0 / 10%)` |
69
+ | `--ring` | `ring-ring` | `oklch(0.708 0 0)` | `oklch(0.556 0 0)` |
70
+
71
+ ### Chart
72
+
73
+ | Token | Tailwind | Light | Dark |
74
+ |---|---|---|---|
75
+ | `--chart-1` | `bg-chart-1 · text-chart-1` | `oklch(0.87 0 0)` | `oklch(0.87 0 0)` |
76
+ | `--chart-2` | `bg-chart-2 · text-chart-2` | `oklch(0.556 0 0)` | `oklch(0.556 0 0)` |
77
+ | `--chart-3` | `bg-chart-3 · text-chart-3` | `oklch(0.439 0 0)` | `oklch(0.439 0 0)` |
78
+ | `--chart-4` | `bg-chart-4 · text-chart-4` | `oklch(0.371 0 0)` | `oklch(0.371 0 0)` |
79
+ | `--chart-5` | `bg-chart-5 · text-chart-5` | `oklch(0.269 0 0)` | `oklch(0.269 0 0)` |
80
+
81
+ ### Radius, font & shadow
82
+
83
+ | Token | Tailwind | Light | Dark |
84
+ |---|---|---|---|
85
+ | `--radius` | `—` | `0.625rem` | `inherits` |
86
+
87
+ ## Notes
88
+
89
+ - Light and dark are **the same token names**; only the values change. Never branch on the mode yourself — `<html class="dark">` is set by the host.
90
+ - The host also ships named palettes (`data-palette` + `data-theme`). They override the tokens above, which is exactly why literal colours must not appear in a mini-app.
91
+ - Illustrations (`Illu*`) already map their accent to `--primary` and their greys to `--muted` / `--card`; do not restyle them.
92
+ - Radius comes from `--radius` (`--radius-sm` … `--radius-4xl` are derived), so prefer `rounded-lg` / `rounded-xl` over a fixed `px`.
93
+
94
+ 32 tokens read from `packages/ui/src/styles/globals.css`.
95
+
96
+ ## Custom host theme file
97
+
98
+ Only write this when the user **asks** for a named / branded palette. Default: pick a builtin in the panel theme pop and put **no hex** in the mini-app.
99
+
100
+ A custom theme is a **host-global** CSS file (every app can select it). mini_app_edit cannot write it — it lives outside the app dir. Use the host file tools.
101
+
102
+ ```
103
+ <dirname(runtimeRoot)>/themes/theme-<id>.css
104
+ ```
105
+
106
+ runtimeRoot comes from mini_app_list. id is [a-z0-9-]+. Create the directory if needed. Header comment name: is the label in the picker.
107
+
108
+ This file uses **short keys** (--bg), **not** the mini-app tokens above (--background). Copying the table into the file is silently ignored. Both light and dark :root[data-mode] blocks are required; missing bg / fg / primary in either mode means the file is skipped.
109
+
110
+ Pairing rules (light/dark as one family, not an invert) -> [styling.md](styling.md). Worked example: docs/assets/themes/theme-crimson.css (do not paste its hex here). Reopen the panel theme pop after writing — it re-reads /api/palettes.
111
+
112
+ | File variable | Required (both modes) |
113
+ |---|---|
114
+ | `--bg` | yes |
115
+ | `--fg` | yes |
116
+ | `--surface` | no (filled from defaults) |
117
+ | `--surface-fg` | no (filled from defaults) |
118
+ | `--border` | no (filled from defaults) |
119
+ | `--muted` | no (filled from defaults) |
120
+ | `--muted-fg` | no (filled from defaults) |
121
+ | `--primary` | yes |
122
+ | `--primary-fg` | no (filled from defaults) |
123
+ | `--secondary` | no (filled from defaults) |
124
+ | `--secondary-fg` | no (filled from defaults) |
125
+ | `--accent` | no (filled from defaults) |
126
+ | `--accent-fg` | no (filled from defaults) |
127
+ | `--destructive` | no (filled from defaults) |
128
+ | `--destructive-fg` | no (filled from defaults) |
129
+ | `--ring` | no (filled from defaults) |
130
+ | `--input` | no (filled from defaults) |
131
+ | `--radius` | no (filled from defaults) |
132
+ | `--shadow` | no (filled from defaults) |
133
+
134
+ Skeleton (fill values; do not ship this empty file):
135
+
136
+ ```css
137
+ /* name: Display name */
138
+ :root[data-mode="light"] {
139
+ --bg: ;
140
+ --fg: ;
141
+ --surface: ;
142
+ --surface-fg: ;
143
+ --border: ;
144
+ --muted: ;
145
+ --muted-fg: ;
146
+ --primary: ;
147
+ --primary-fg: ;
148
+ --secondary: ;
149
+ --secondary-fg: ;
150
+ --accent: ;
151
+ --accent-fg: ;
152
+ --destructive: ;
153
+ --destructive-fg: ;
154
+ --ring: ;
155
+ --input: ;
156
+ --radius: ;
157
+ --shadow: ;
158
+ }
159
+ :root[data-mode="dark"] {
160
+ --bg: ;
161
+ --fg: ;
162
+ --surface: ;
163
+ --surface-fg: ;
164
+ --border: ;
165
+ --muted: ;
166
+ --muted-fg: ;
167
+ --primary: ;
168
+ --primary-fg: ;
169
+ --secondary: ;
170
+ --secondary-fg: ;
171
+ --accent: ;
172
+ --accent-fg: ;
173
+ --destructive: ;
174
+ --destructive-fg: ;
175
+ --ring: ;
176
+ --input: ;
177
+ --radius: ;
178
+ --shadow: ;
179
+ }
180
+ ```
181
+
182
+ ## App-local palette (theme.css)
183
+
184
+ A mini-app may ship its own palette: `theme.css` **in the app directory** (unlike the host-global file above, `mini_app_edit` / `mini_app_write` can write it).
185
+
186
+ **Only when the style depends on the hue** — a look the app carries (a neon signage surface, a glass island whose sky is part of the layout). A plain CRUD / table / settings app must NOT ship one: it should follow whatever palette the user picked. The manifest has no theme block; the file's presence is the whole decision.
187
+
188
+ Same contract as the host-global file: short keys, both `:root[data-mode]` blocks, a `/* name: … */` header. ui.tsx still never contains a colour literal.
189
+
190
+ Behaviour in the panel:
191
+
192
+ - With the file present the app uses it by default; the theme pop lists it under the current app, tagged **`本应用`**.
193
+ - The user can pick a host palette (or **`跟随全局`**) for that app; that is stored per app and does not delete the file.
194
+ - Light / dark still follows the host — the file carries both densities.
195
+ - **First paint:** the host bakes the file's tokens into the app runner HTML when the request uses the local palette (`palette=__local__` or a bare `/app/:id` open). The panel's `mma-set-env` can still override later; without the bake, the first frame is the kit default near-white.
196
+
197
+ Reuse the skeleton from *Custom host theme file* above verbatim — same keys, same two blocks — and write it to `<appDir>/theme.css`.
@@ -1,21 +1,21 @@
1
- # ctx.tool 能调什么
1
+ # `ctx.tool` — what can be called
2
2
 
3
- **不要把本文件当固定目录。** 工具集随 dsh profile / 插件 / MCP 变化。
3
+ **Do not treat this file as a catalogue.** The tool set changes with the dsh profile, plugins and MCP servers.
4
4
 
5
- 生成或改 `main.api.ts` **并且确实要用 `ctx.tool`** 时才:
5
+ Only when you are writing or changing a `main.api.ts` **that really uses `ctx.tool`**:
6
6
 
7
- 1. 调聊天工具 `mini_app_list_ctx_tools`(无参)
8
- 2. 人类调试才 `curl -s http://127.0.0.1:17880/api/ctx-tools`
7
+ 1. Call the chat tool `mini_app_list_ctx_tools` (no arguments)
8
+ 2. For human debugging only: `curl -s http://127.0.0.1:17880/api/ctx-tools`
9
9
 
10
- 返回 `{ count, tools: [{ name, description, schema }] }`。
11
- `name` 就是 `ctx.tool(name, args)` 的第一参;`schema` 是参数形状(可能叫 parameters / inputSchema)。
10
+ Result: `{ count, tools: [{ name, description, schema }] }`.
11
+ `name` is the first argument of `ctx.tool(name, args)`; `schema` describes the parameters (may be called parameters / inputSchema).
12
12
 
13
- `args` 必须是普通 JSON 对象(`{}` 可以)。禁止 `{ input: "..." }`、`Date`、function、`AbortSignal`。无参工具传 `{}`。
13
+ `args` must be a plain JSON object (`{}` is fine). Never `{ input: "..." }`, `Date`, functions or `AbortSignal`. Pass `{}` for tools that take nothing.
14
14
 
15
- ## app 时的优先级
15
+ ## Priority when writing an app
16
16
 
17
17
  1. `ctx.storage` / `ctx.http` / `ctx.bash` / `ctx.llm` / `ctx.system.metrics`
18
- 2. 只有明确要复用 dsh 已有工具(读工作区文件等)才 `ctx.tool`
19
- 3. MCP `ctx.mcp("server__tool", args)`,不要 `{ input }`
18
+ 2. `ctx.tool` only when you clearly want to reuse an existing host tool (reading workspace files, etc.)
19
+ 3. MCP via `ctx.mcp("server__tool", args)` — never wrapped in `{ input }`
20
20
 
21
- `ctx.listTools()` 在后端同样返回这份快照。
21
+ `ctx.listTools()` in the backend returns the same snapshot.
@@ -1,12 +1,165 @@
1
- # 排错
2
-
3
- | 现象 | 先查 |
4
- |------|------|
5
- | `/api/apps` 404 | dsh 插件没起来或 port 不是 17880 |
6
- | `already been declared defineDashboard` | 旧 loader;当前应只从 require dashboard 来 |
7
- | 对象字面量/正则被编坏 | `compileAppSource` 乱剥 `: type` |
8
- | `llm unavailable` + 其实聊天能用 | 应走 `ctx.llm.stream`;或 POST `/api/llm-config` |
9
- | bash `policy.mode` undefined | 用本地 `bash -c` 路径,不要依赖坏的 sandbox policy |
10
- | UI 空白 / CDN | esm.sh 被拦 |
11
- | iframe 一条缝 | 不是 app 的问题,是 host iframe 高度 |
12
- | MCP 没反应 | args 不要包 `{ input }` |
1
+ # Troubleshooting
2
+
3
+ Match the **literal message** you got. `mini_app_reload` prefixes each `errors[]` entry with the failing layer; `mini_app_call` surfaces backend runtime messages; `mini_app_errors` surfaces **UI** runtime messages (the ones no compile step can see).
4
+
5
+ ## The UI is blank / wrong and the build was green
6
+
7
+ That is expected: a bundle can compile and still throw at render. The loop is
8
+
9
+ ```
10
+ mini_app_reload mini_app_open mini_app_errors mini_app_view_eval
11
+ ```
12
+
13
+ `mini_app_errors` returns `kind` + `message` + `componentStack`. `componentStack` names the component that threw, which a raw browser stack does not.
14
+
15
+ | `kind` | Meaning | Typical cause |
16
+ |---|---|---|
17
+ | `render` | Thrown while React was rendering — caught by the app's error boundary | undefined name, bad props, a hook called conditionally |
18
+ | `module` | The compiled bundle never evaluated | bad import, SDK missing, entry mismatch |
19
+ | `uncaught` | Threw outside render | an event handler, a timer callback |
20
+ | `async` | A promise rejected with no handler | `call()` without a `catch`, un-awaited fetch |
21
+
22
+ If the ring is empty you probably never opened it — the hint says so. An app that renders **but looks wrong** is a `mini_app_view_eval` question, not an error question.
23
+
24
+ ### `mini_app_view_eval` did not answer
25
+
26
+ | `view` | Meaning | Next step |
27
+ |---|---|---|
28
+ | `not-open` | no browser is attached, or nothing is showing this app | `mini_app_open`, then retry |
29
+ | `runner-not-booted` | the iframe exists but its script never ran | `mini_app_errors` (a `module` error), then `mini_app_open` |
30
+ | `pending` | your query is **still running** in a healthy view | raise `timeoutMs` (default 1500, max 8000) or return before awaiting. Nothing is broken and the user must not be told to reload — the host proved that by getting an answer to a trivial probe |
31
+ | `stuck` | the script ran, then stopped answering, and even the trivial probe went unanswered — the thread really is blocked | a `while (true)` in your own `code` does this, and it wedges the panel page too: tell the user to reload the tab |
32
+ | `live` + `ok: false` | the view is fine, **your query** failed | `error.line` / `error.source` point into your JS |
33
+
34
+ More → [eval.md](eval.md).
35
+
36
+ ## "Did my change actually take effect?"
37
+
38
+ `mini_app_reload` answers this in its own result, so you never have to infer it from a
39
+ screenshot. **CSS is part of the contract, not an afterthought:** a successful reload always
40
+ drops the in-memory build of the API module, the UI bundle **and** the app's Tailwind CSS
41
+ (`appCss: "dropped"`), then tells every attached panel to re-fetch. There is no "CSS somehow
42
+ stayed" path — if `caches.appCss` is not `"dropped"`, something else is wrong.
43
+
44
+ ```json
45
+ { "ok": true, "caches": { "uiBundle": "dropped", "appCss": "dropped", "autogen": "removed", "views": "reload sent to 1 attached panel" } }
46
+ ```
47
+
48
+ - `views: "no panel attached — nothing was showing this app"` → the browser never re-fetched,
49
+ because there was nothing to re-fetch. Call `mini_app_open`.
50
+ - `views: "not sent (compile failed)"` → fix the compile; the memos still went, so the next
51
+ attempt cannot inherit the old bytes.
52
+ - **`cleanCaches` defaults to `true` on the tool** — on-disk build output (`.autogen/`, cached
53
+ bundles) is purged and rebuilt, so a stale Tailwind artifact cannot survive a normal reload.
54
+ Pass `cleanCaches: false` only when you deliberately want to keep those files (faster, but
55
+ you are trusting the disk cache). The underlying `AppsManager.reload` API still defaults to
56
+ `false` when called without opts; only the tool flips the default.
57
+
58
+ To prove the frame is a *new document*, compare `performance.timeOrigin` across the reload —
59
+ the refreshed URL carries a cache-buster, so a real reload always changes it:
60
+
61
+ ```
62
+ mini_app_view_eval({ appId, code: "return performance.timeOrigin" }) → reload → ask again
63
+ ```
64
+
65
+ Unchanged means it never reloaded. Then assert your *content* too: query a string only the new
66
+ code can print, rather than looking at the panel.
67
+
68
+ ## `LLM_JSON_INVALID` / `LLM_RETRY_EXHAUSTED`
69
+
70
+ `ctx.llm(prompt, { schema })` retried and still got nothing parseable. The message lists every
71
+ attempt (`err.attempts`: `kind` `json` | `transport`, `error`, `bytes`, `head`) — read it before
72
+ changing anything, the shape of the bad answer *is* the diagnosis:
73
+
74
+ | The attempts say | Meaning | Fix |
75
+ |---|---|---|
76
+ | `transport`, 0 bytes every time | the model never answered | provider/config, not your prompt |
77
+ | `json` with `head` = prose ("Here is the JSON:") | the schema instruction lost to the chatty system prompt | shorten `system`, put constraints in `schema` |
78
+ | `json` with `head` = truncated object, `bytes` suspiciously round | hit the output ceiling | pass a bigger `maxTokens`, or ask for fewer items |
79
+ | `json` with `head` = reasoning text | the budget died before the answer | bigger `maxTokens`; a reasoning model needs headroom |
80
+
81
+ Never wrap `ctx.llm` in a hand-rolled salvage parser: the retries and the evidence are already the
82
+ same thing, one layer down.
83
+
84
+ ## `mini_app_reload` → `errors[i]` prefix
85
+
86
+ | Message | Root cause | Next step |
87
+ |---|---|---|
88
+ | `appId must be reverse-DNS (e.g. com.example.todo)` | Bad appId shape | Use `com.<you>.<thing>`; no Chinese, spaces or underscores |
89
+ | `app not registered; call mini_app_register({ appId, files })` | Nothing on disk for that id | `mini_app_register` first — do not `edit` |
90
+ | `app not found: <id>` | Same, or a typo in the id | Check `mini_app_list` |
91
+ | `manifest: manifest missing <key>` | Missing `id` / `name` / `version` / `entry` | All four are required; `entry` is usually `"ui.tsx"` |
92
+ | `manifest: manifest is not valid JSON` | JSON syntax (trailing comma, comment) | `manifest.json` allows **no** comments or trailing commas |
93
+ | `manifest: manifest id is not a valid AppId` | `manifest.id` differs from appId or is malformed | They must be equal |
94
+ | `missing main.api.ts` | No backend entry | Create `main.api.ts` (a single `list` method is fine) |
95
+ | `main.api: …` | Backend compile failed / relative import unresolved | Read the tail; see "backend messages" below |
96
+ | `main.api: "x()" is called but never defined or imported` | Typo or missing import in the backend | Fix the name; reload re-checks |
97
+ | `ui: …` | UI bundle failed | Read the tail; see "UI messages" below |
98
+ | `ui: JSX component <X /> is not defined or imported` | Used a component you never imported | Add it to the `@monkey-mini-app/ui` import |
99
+ | `ui: hook "useX" is called but not imported` | Hook used without `import { useX } from "react"` | Import it — hooks are never globals |
100
+ | `shared: …` | Undefined name in `shared/**` | Fix in `shared/` — both sides import from there |
101
+ | `ui compiler not wired` | The host has no UI compiler attached | Host install problem, not an app problem ("Host-side" section) |
102
+ | `commit: …` | Compiled fine, the auto-commit failed | Changes are on disk; commit explicitly with `mini_app_history_commit` |
103
+
104
+ ### `committed.status` after a reload
105
+
106
+ | `status` | Meaning | Do |
107
+ |---|---|---|
108
+ | `committed` | A new commit was made | — |
109
+ | `clean` | Nothing changed since your last `mini_app_edit` (it auto-commits) | Nothing — this is normal |
110
+ | `skipped` | Compile failed, so nothing was committed | Fix `errors[]` first |
111
+ | `failed` | Commit itself errored (`reason`) | `mini_app_history_commit`, or check the git dir |
112
+
113
+ ## Runtime / smoke-test messages
114
+
115
+ | Message | Root cause | Fix |
116
+ |---|---|---|
117
+ | `Method not found: <m>` | `call("<m>")` is not a key of `api` | Align with `defineApp({ api })` keys (case-sensitive) |
118
+ | `main.api must export defineApp({ name, description, api })` | Missing `export default defineApp({...})` | Add the default export |
119
+ | `defineApp requires name and description` | One of them is missing | Provide both |
120
+ | `defineApp.api must be an object` | `api` written as a function or array | `api: { async list(ctx) {…} }` |
121
+ | `backend cannot import '<spec>'. Install it first: mini_app_install(...)` | The app needs that library but it is not in its own `node_modules` | Run `mini_app_install({ appId, packages: [{ name: "<spec>" }] })`, then `mini_app_reload`. Do **not** move the import into `ui.tsx` |
122
+ | `backend cannot import '<spec>' (no package.json)` | Same, and nothing has ever been installed for this app | `mini_app_install` creates the manifest — never hand-write `package.json` |
123
+ | `backend cannot import '<spec>': it resolves outside this app's node_modules` | The app is reaching the plugin's/repo's dependency tree | Reinstall the package into the app; a host dependency is not an app dependency |
124
+ | `Cannot find package '<x>'`-style npm failure from `mini_app_install` | Typo, no network, or the name is not on the registry | Fix the name/version; report the npm stderr to the user rather than inventing a substitute |
125
+ | `backend cannot import '<spec>': ui/** is UI-only` | Backend reached into the UI tree | Move the shared logic to `shared/**` |
126
+ | `backend import escapes app dir: <spec>` | Backend imported `../` past the app root | Keep every import inside the app dir |
127
+ | `unsafe relative path: <rel>` | Path contained `..` or was absolute | `mini_app_*` `path` values are app-relative |
128
+ | `register requires manifest.json` | `files` had no manifest | Add it |
129
+ | `cancelled` | The user pressed stop and `ctx.signal` fired | Expected behaviour; long jobs must wire it (see ctx.md) |
130
+
131
+ ## UI compile messages
132
+
133
+ | Message | Root cause | Fix |
134
+ |---|---|---|
135
+ | `UI cannot import main.api.ts; use useApp() from @monkey-mini-app/ui` | UI imported the backend | Go through `call(method, args)` |
136
+ | `UI cannot import api/**: "<spec>"` | UI reached into the backend tree | Move the shared logic to `shared/**` |
137
+ | `UI import escapes the app dir: "<spec>"` | `../` pointed at a sibling app or outside | Keep every import inside the app dir |
138
+ | `missing ui entry (ui.tsx / App.tsx)` | `manifest.entry` points at a file that isn't there | Match `entry` to the real file |
139
+ | `Failed to resolve import "<pkg>"` | Imported an npm package the app directory does not have | UI: `react` / `@monkey-mini-app/ui` / in-app relative paths. React, lucide and recharts already ship inside the SDK |
140
+
141
+ ## It compiles but looks wrong
142
+
143
+ | Symptom | Check first | Note |
144
+ |---|---|---|
145
+ | A class did nothing | Whether the class name is a **complete literal** | Tailwind scans source text: `` `bg-${x}-500` `` generates **no CSS and no error**. Full names only → [styling.md](styling.md) |
146
+ | Colours wrong in dark mode | Any hardcoded hex | Use tokens → [theme.md](theme.md); the user's palette rewrites token values |
147
+ | Custom theme file does not appear | Wrote `--background` or only one mode | File keys are `--bg` / `--fg` / `--primary` in **both** light and dark → [theme.md](theme.md) *Custom host theme file*; reopen the theme pop |
148
+ | A node rendered to nothing | Its box and its classes, from the view | `mini_app_view_eval({ appId, code: 'return mma.$$("#root *").filter(n => !n.getBoundingClientRect().width).map(mma.selector)' })` — usually a class that never compiled, or a condition that never matched |
149
+ | A token looks unset | The **computed** value, not the class name | `const cs = getComputedStyle(mma.$(".x")); return { color: cs.color, bg: cs.backgroundColor };` → [styling.md](styling.md) |
150
+ | Panel still shows the old app after a fix | It should have refreshed on its own (`app:reload`) | If the browser was not attached to `/api/events`, use the panel's reload button |
151
+ | The iframe is a thin strip | **Not an app problem** | Host iframe height; refresh or reopen the panel |
152
+ | Blank page, no console error | Whether `#root.boot` gets cleared | That is load art only; it must be gone before mount |
153
+ | Editor missing / code not highlighted | `CodeEditor` `CodeBlock` `DiffViewer` | They fetch CodeMirror / shiki from `esm.sh` on demand; on a blocked network they degrade. **Do not** `pnpm add` them and do not `import @codemirror/*` / `shiki` |
154
+ | Rich text editor looks plain | `RichTextEditor` | It is a local contentEditable editor — no CDN, no dependency |
155
+ | `ctx.http` times out | `http: timeout` / `http: only http/https` / `http: response too large` | Pass `timeout`; http/https only; page or sample large payloads |
156
+ | `ctx.llm` says no model service / stream empty | Model not configured | A human configures it in settings or `POST /api/llm-config`; app code stays `await ctx.llm(...)` |
157
+ | `ctx.tool` reports no tool service | This profile has no tools | Use `storage` / `http` / `bash`; check first with `mini_app_list_ctx_tools` |
158
+ | MCP does nothing | Args wrapped as `{ input }` | Pass the business object directly |
159
+
160
+ ## Host side (human debugging — not the app's fault)
161
+
162
+ | Symptom | Handling |
163
+ |---|---|
164
+ | `:17880/api/apps` returns 404 | Plugin not started, or the port is not 17880 — see [test.md](test.md) |
165
+ | `@monkey-mini-app/... dist not found` | Host install is missing build output; a maintainer runs `node scripts/build/ui.mjs && node scripts/build/sdk.mjs` |
@@ -1,24 +1,36 @@
1
- # Mini-app 模板指引
1
+ # Mini-app templates
2
2
 
3
- 每个模板是不同的**参考场景**:一个「布局原型」× 一条「能力轴」,告诉你**什么时候抄它、它主要教什么**。先看这张表定位,再决定细读哪个模板(避免把 7 个都读一遍)。
3
+ Each template is a **product facade**: one interaction loop × one default Look. Use the table to find the closest starting point — real apps routinely take pieces from several.
4
4
 
5
- | 模板 | 一句话 | 什么时候抄它 | 主要教你 |
5
+ Looks (style recipes, not apps) live in [`../references/looks/`](../references/looks/index.md). Open them only when the user names a style.
6
+
7
+ | Template | Loop | Copy it when | What it teaches |
6
8
  |---|---|---|---|
7
- | [minimal](./minimal/) | 最简可运行的骨架 | 刚起步 / 连通检查 / 只要个能跑的壳 | `defineDashboard` + `useDashboardApi().call` 一次往返 + `AppShell`/`PageHeader` 骨架 |
8
- | [todo](./todo/) | 本地 CRUD + 筛选 + 派生统计 | 记本地数据、要增删改查+状态过滤 | `ctx.storage` + 一屏固定内滚 + `FilterBar` + `storage.table()` 多表 |
9
- | [insights](./insights/) | 联网数据 模型摘要(长任务) | 外部数据+智能提炼、会慢 | `ctx.http` + `ctx.llm({schema})` + **采样/进度/`ctx.signal` 取消**(`scan`/`scanStatus` 轮询) |
10
- | [monitor](./monitor/) | 本机指标实时看板 | 监控/大盘/图表/KPI | `ctx.system.metrics()` + `ctx.bash`(只做 host 没有的 ps/df) + 轮询隐藏即停 |
11
- | [review](./review/) | 代码/文本对比 + 用例表格 | 审阅/diff/用例、要编辑回写 | `DiffViewer`(original/modified) + `CodeEditor` + `DataGrid` 列筛/排序 + 写回 |
12
- | [agentrun](./agentrun/) | 让模型干多步活并展示过程 | 需要 `ctx.agent`(**唯一**示范)+ 取消/进度 | `ctx.agent` + `onEvent`→storage→UI 轮询 + 模块级 `AbortController` 取消 |
13
- | [jira](./jira/) | 复杂业务仿真(多视图+状态机+AI 辅助) | 工单/Jira/项目管理类、多视图、要 AI | `Kanban`+`DataGrid` 双视图 + 详情 `Sheet` 编辑 + 状态色板 + `ctx.llm` 生成用户可确认草稿 |
14
-
15
- ## 怎么用
16
-
17
- 1. **只读你需要的模板**,不要全读。按「一句话 / 什么时候抄它」定位。
18
- 2. 模板内带 `// ⭐ 关键:...` 的注释是**教学点** —— 扫注释就能抓到要点(如 `ctx.agent`、`storage.table`、`ctx.signal` 取消、`DiffViewer` original/modified、`StatusBadge` 认小写状态)。
19
- 3. **通用约定**(每个都遵守,不分模板):
20
- - UI 只 `import`:`react` / `@monkey-mini-app/ui` / `@monkeyagent/host` / `./lib`。禁止其它 npm(app 目录无 node_modules)。
21
- - 图标:`import { Icon } from "@monkey-mini-app/ui"` `<Icon.HelpCircle />`(常用子集见 [../references/icons.md](../references/icons.md))。空状态插图:`import { IlluServerStatus } from "@monkey-mini-app/ui"`。
22
- - 唯一访问后端的入口:`useDashboardApi().call(method, args)`,method 必须是 `defineDashboard({ api })` 的键。
23
- - 布局 `AppShell`(可选 `sidebar`/`header`)+ `PageHeader`(`title`/`description`/`actions`)。
24
- - 列表/看板/表格数据用 `key` 字段做增删改定位。
9
+ | [minimal](./minimal/) | one `call` | Starting out / connectivity | `defineApp` + `useApp().call` + `AppShell` skeleton. No Look. |
10
+ | [today](./today/) | open see my screen one record | Personal home, "what first" | `ctx.storage` + `storage.table()` + `ListDetail` + glass-island |
11
+ | [board](./board/) | items move in 2D status | Pipelines, "who is blocked" | `Kanban` + `DataGrid` + `Sheet` + `ctx.llm` confirm. aurora-bento |
12
+ | [radar](./radar/) | I trigger → wait → read (cancel) | Fetch sources, write a brief, long job | `ctx.push`/`on` names in `shared/events.ts`; long job in `api/`; brief in `ui/`. editorial |
13
+ | [sheets](./sheets/) | file in, grid work | `.xlsx` / column stats / compare | **`mini_app_install`** (`exceljs`) + lodash aggregates + `DataGrid`. desk-split |
14
+ | [runner](./runner/) | the UI *is* the run | Multi-step model work | `ctx.agent` + `streamTo` + SSE. terminal |
15
+ | [chores](./chores/) | named buttons, no model | One button on this machine | `ctx.bash` stdout in `Terminal`. Not a prompt. |
16
+ | [watch](./watch/) | numbers move by themselves | Live status, stop when hidden | `ctx.system.metrics()` + polling that stops when hidden. tape. **Reveal** |
17
+
18
+ ## Templates that need a library
19
+
20
+ `sheets/` ships **no** `package.json`. After `mini_app_register`, install first, then reload:
21
+
22
+ ```
23
+ mini_app_install({ appId: "com.example.sheets", packages: [{ name: "exceljs" }] })
24
+ mini_app_reload({ appId: "com.example.sheets" })
25
+ ```
26
+
27
+ ## How to use them
28
+
29
+ 1. **Start from the closest loop** (the table). Open others when the app spans loops.
30
+ 2. **Lift the pattern, not the file.** Comments marked `// ⭐` are the teaching points.
31
+ 3. Looks are optional. Kit components first; Tailwind for the distinctive grammar. No hex.
32
+ 4. **Three facades ship a `theme.css`** (`today`, `runner`, `chores`) because their look is
33
+ hue-dependent — the panel shows it as a palette tagged `本应用` and the user can switch away.
34
+ The other facades follow the host palette on purpose. Do not add one to a plain CRUD app
35
+ ([../references/theme.md](../references/theme.md) → *App-local palette*).
36
+ 5. Visible copy in these samples is Chinese. Instructions and comments are English.
@@ -1,9 +1,9 @@
1
- import { defineDashboard } from "@monkeyagent/dashboard";
1
+ import { defineApp } from "@monkey-mini-app/api";
2
2
 
3
- // ⭐ 关键:列表/看板数据项的"key"字段很重要 —— 拖拽/更新都用它定位(还记得 idKey="key" 的坑)。
4
- // Jira 仿真:改状态/负责人/优先级、加评论、AI 记工时。
3
+ // ⭐ key: the "key" field of list/kanban items matters — drag & update both locate by it (remember the idKey="key" pitfall).
4
+ // Jira simulation: change status/assignee/priority, add comments, AI worklog.
5
5
  export type Issue = {
6
- key: string; // 例如 "BUG-104"
6
+ key: string; // e.g. "BUG-104"
7
7
  type: "Story" | "Task" | "Bug" | "Epic";
8
8
  summary: string;
9
9
  status: "To Do" | "In Progress" | "Done" | "Blocked";
@@ -36,15 +36,15 @@ function touch(i: Issue): Issue {
36
36
  return { ...i, updatedAt: Date.now() };
37
37
  }
38
38
 
39
- export default defineDashboard({
40
- name: "Jira 看板",
41
- description: "看板/表格双视图 · 状态与评论编辑 · AI 记工时",
39
+ export default defineApp({
40
+ name: "阶段看板",
41
+ description: "看板/表格双视图 · 状态与评论 · AI 记一笔",
42
42
  api: {
43
43
  async list(ctx) {
44
44
  const issues = await load(ctx);
45
45
  return { issues };
46
46
  },
47
- // ⭐ 关键:乐观更新 + 持久化 —— 拖拽/改字段先改内存再落库;UI key 定位
47
+ // ⭐ key: optimistic update + persistence drag/field edits change memory first, then save; the UI locates items by key
48
48
  async update(ctx, args?: { key?: string; patch?: Partial<Issue> }) {
49
49
  const key = args?.key;
50
50
  if (!key) throw new Error("缺少 key");
@@ -74,14 +74,14 @@ export default defineDashboard({
74
74
  await save(ctx, next);
75
75
  return next.find((i) => i.key === key);
76
76
  },
77
- // 状态汇总:按 status 计数(简约色板用)
77
+ // status summary: counts per status (for the compact palette)
78
78
  async summary(ctx) {
79
79
  const issues = await load(ctx);
80
80
  const byStatus: Record<string, number> = {};
81
81
  for (const i of issues) byStatus[i.status] = (byStatus[i.status] || 0) + 1;
82
82
  return { byStatus, total: issues.length };
83
83
  },
84
- // ⭐ 关键:AI 记工时 —— ctx.llm(schema) issue 的近期变动生成一条 worklog 草稿,用户确认后再存
84
+ // ⭐ key: AI worklog ctx.llm(schema) turns the issue's recent activity into a worklog draft; saved only after the user confirms
85
85
  async worklogDraft(ctx, args?: { key?: string }) {
86
86
  const key = args?.key;
87
87
  const issues = await load(ctx);
@@ -95,7 +95,7 @@ export default defineDashboard({
95
95
  const parsed = JSON.parse(raw) as { note?: string };
96
96
  return { note: String(parsed.note ?? "").trim() || issue.summary };
97
97
  },
98
- // 确认后存成一条评论(worklog 前缀)
98
+ // after confirmation, saved as a comment (with the worklog prefix)
99
99
  async logWork(ctx, args?: { key?: string; note?: string; minutes?: number }) {
100
100
  const key = args?.key;
101
101
  const minutes = Number(args?.minutes ?? 0) || 0;
@@ -0,0 +1,8 @@
1
+ {
2
+ "id": "com.example.board",
3
+ "name": "阶段看板",
4
+ "description": "多条东西按阶段往前推 · 看板/表格 · AI 记一笔",
5
+ "version": "0.1.0",
6
+ "entry": "ui.tsx",
7
+ "acronym": "KB"
8
+ }
@@ -0,0 +1,46 @@
1
+ /* name: 极光便当 */
2
+ /* Look-owned palette: the ground is an aurora, so the hue IS the identity. Light is the
3
+ indigo-violet field (A1), dark the graphite aurora-green (A2) — the lab picked the best
4
+ side of each; a palette file has two blocks, so that is legal and reads intentional. */
5
+ :root[data-mode="light"] {
6
+ --bg: #c9cdf1;
7
+ --fg: #20213a;
8
+ --surface: #ffffff;
9
+ --surface-fg: #20213a;
10
+ --border: #c2c6e8;
11
+ --muted: #dfe2f5;
12
+ --muted-fg: #565a7e;
13
+ --primary: #6d5ae0;
14
+ --primary-fg: #ffffff;
15
+ --secondary: #e2e4f6;
16
+ --secondary-fg: #20213a;
17
+ --accent: #e9e3fb;
18
+ --accent-fg: #20213a;
19
+ --destructive: #c0392b;
20
+ --destructive-fg: #ffffff;
21
+ --ring: #6d5ae0;
22
+ --input: #c2c6e8;
23
+ --radius: 16px;
24
+ --shadow: rgba(35, 30, 90, 0.35);
25
+ }
26
+ :root[data-mode="dark"] {
27
+ --bg: #0e1512;
28
+ --fg: #dff2e8;
29
+ --surface: #141d19;
30
+ --surface-fg: #dff2e8;
31
+ --border: #1e2c25;
32
+ --muted: #101f19;
33
+ --muted-fg: #6f9784;
34
+ --primary: #3ee39a;
35
+ --primary-fg: #06140d;
36
+ --secondary: #16241d;
37
+ --secondary-fg: #dff2e8;
38
+ --accent: #13281f;
39
+ --accent-fg: #dff2e8;
40
+ --destructive: #ff6b5e;
41
+ --destructive-fg: #14060a;
42
+ --ring: #3ee39a;
43
+ --input: #1e2c25;
44
+ --radius: 16px;
45
+ --shadow: rgba(0, 0, 0, 0.55);
46
+ }