@monkey-mini-app/dsh-mini-app 0.1.1 → 0.1.5

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 (312) hide show
  1. package/README.md +29 -27
  2. package/lib/client.js +2024 -783
  3. package/lib/index.d.ts +2 -0
  4. package/lib/index.js +20 -7
  5. package/package.json +10 -9
  6. package/skills/monkey-mini-app/SKILL.md +181 -114
  7. package/skills/monkey-mini-app/references/catalog.md +236 -99
  8. package/skills/monkey-mini-app/references/contracts/accordion.md +30 -0
  9. package/skills/monkey-mini-app/references/contracts/activity-feed.md +12 -2
  10. package/skills/monkey-mini-app/references/contracts/alert-dialog.md +38 -0
  11. package/skills/monkey-mini-app/references/contracts/alert.md +38 -0
  12. package/skills/monkey-mini-app/references/contracts/app-shell.md +2 -2
  13. package/skills/monkey-mini-app/references/contracts/aspect-ratio.md +25 -0
  14. package/skills/monkey-mini-app/references/contracts/attachment-gallery.md +12 -2
  15. package/skills/monkey-mini-app/references/contracts/attachment.md +35 -0
  16. package/skills/monkey-mini-app/references/contracts/autocomplete.md +12 -2
  17. package/skills/monkey-mini-app/references/contracts/avatar.md +24 -0
  18. package/skills/monkey-mini-app/references/contracts/badge.md +26 -0
  19. package/skills/monkey-mini-app/references/contracts/breadcrumb.md +33 -0
  20. package/skills/monkey-mini-app/references/contracts/bubble.md +30 -0
  21. package/skills/monkey-mini-app/references/contracts/button-group.md +36 -0
  22. package/skills/monkey-mini-app/references/contracts/button.md +26 -0
  23. package/skills/monkey-mini-app/references/contracts/calendar.md +20 -0
  24. package/skills/monkey-mini-app/references/contracts/card.md +41 -0
  25. package/skills/monkey-mini-app/references/contracts/cascader.md +12 -2
  26. package/skills/monkey-mini-app/references/contracts/chart.md +32 -0
  27. package/skills/monkey-mini-app/references/contracts/checkbox.md +19 -0
  28. package/skills/monkey-mini-app/references/contracts/code-block.md +20 -2
  29. package/skills/monkey-mini-app/references/contracts/code-editor.md +30 -4
  30. package/skills/monkey-mini-app/references/contracts/collapsible.md +21 -0
  31. package/skills/monkey-mini-app/references/contracts/color-picker.md +12 -2
  32. package/skills/monkey-mini-app/references/contracts/combobox.md +34 -0
  33. package/skills/monkey-mini-app/references/contracts/command.md +41 -0
  34. package/skills/monkey-mini-app/references/contracts/comment-thread.md +12 -2
  35. package/skills/monkey-mini-app/references/contracts/commit-graph.md +50 -0
  36. package/skills/monkey-mini-app/references/contracts/confirm-dialog.md +20 -2
  37. package/skills/monkey-mini-app/references/contracts/context-menu.md +41 -0
  38. package/skills/monkey-mini-app/references/contracts/copyable.md +12 -2
  39. package/skills/monkey-mini-app/references/contracts/currency-input.md +12 -2
  40. package/skills/monkey-mini-app/references/contracts/dashboard-shell.md +41 -0
  41. package/skills/monkey-mini-app/references/contracts/data-grid.md +13 -6
  42. package/skills/monkey-mini-app/references/contracts/date-picker.md +20 -2
  43. package/skills/monkey-mini-app/references/contracts/date-range-picker.md +10 -2
  44. package/skills/monkey-mini-app/references/contracts/date-time-picker.md +20 -2
  45. package/skills/monkey-mini-app/references/contracts/date-time-range-picker.md +20 -2
  46. package/skills/monkey-mini-app/references/contracts/description-list.md +12 -2
  47. package/skills/monkey-mini-app/references/contracts/detail-panel.md +10 -2
  48. package/skills/monkey-mini-app/references/contracts/dialog.md +44 -0
  49. package/skills/monkey-mini-app/references/contracts/diff-viewer.md +21 -2
  50. package/skills/monkey-mini-app/references/contracts/donut-chart.md +12 -2
  51. package/skills/monkey-mini-app/references/contracts/drawer.md +29 -0
  52. package/skills/monkey-mini-app/references/contracts/dropdown-menu.md +49 -0
  53. package/skills/monkey-mini-app/references/contracts/duration-input.md +20 -2
  54. package/skills/monkey-mini-app/references/contracts/empty.md +40 -0
  55. package/skills/monkey-mini-app/references/contracts/env-badge.md +12 -2
  56. package/skills/monkey-mini-app/references/contracts/env-table.md +46 -0
  57. package/skills/monkey-mini-app/references/contracts/event-calendar.md +28 -20
  58. package/skills/monkey-mini-app/references/contracts/field.md +34 -0
  59. package/skills/monkey-mini-app/references/contracts/file-dropzone.md +20 -2
  60. package/skills/monkey-mini-app/references/contracts/file-tree.md +12 -2
  61. package/skills/monkey-mini-app/references/contracts/filter-bar.md +2 -2
  62. package/skills/monkey-mini-app/references/contracts/form-sheet.md +51 -0
  63. package/skills/monkey-mini-app/references/contracts/gantt.md +20 -2
  64. package/skills/monkey-mini-app/references/contracts/gauge.md +12 -2
  65. package/skills/monkey-mini-app/references/contracts/hover-card.md +21 -0
  66. package/skills/monkey-mini-app/references/contracts/input-group.md +24 -0
  67. package/skills/monkey-mini-app/references/contracts/input.md +33 -0
  68. package/skills/monkey-mini-app/references/contracts/item.md +36 -0
  69. package/skills/monkey-mini-app/references/contracts/jira-wiki.md +3 -4
  70. package/skills/monkey-mini-app/references/contracts/jql-input.md +15 -8
  71. package/skills/monkey-mini-app/references/contracts/json-viewer.md +20 -2
  72. package/skills/monkey-mini-app/references/contracts/kanban-issue-panel.md +12 -2
  73. package/skills/monkey-mini-app/references/contracts/kanban.md +10 -2
  74. package/skills/monkey-mini-app/references/contracts/kbd.md +20 -0
  75. package/skills/monkey-mini-app/references/contracts/label.md +33 -0
  76. package/skills/monkey-mini-app/references/contracts/list-detail.md +46 -0
  77. package/skills/monkey-mini-app/references/contracts/log-viewer.md +45 -4
  78. package/skills/monkey-mini-app/references/contracts/markdown-editor.md +20 -2
  79. package/skills/monkey-mini-app/references/contracts/markdown.md +12 -2
  80. package/skills/monkey-mini-app/references/contracts/marker.md +30 -0
  81. package/skills/monkey-mini-app/references/contracts/menubar.md +34 -0
  82. package/skills/monkey-mini-app/references/contracts/message-scroller.md +24 -0
  83. package/skills/monkey-mini-app/references/contracts/message.md +24 -0
  84. package/skills/monkey-mini-app/references/contracts/mini-calendar.md +20 -2
  85. package/skills/monkey-mini-app/references/contracts/native-select.md +21 -0
  86. package/skills/monkey-mini-app/references/contracts/navigation-menu.md +27 -0
  87. package/skills/monkey-mini-app/references/contracts/notification-center.md +12 -2
  88. package/skills/monkey-mini-app/references/contracts/number-field.md +20 -2
  89. package/skills/monkey-mini-app/references/contracts/page-header.md +2 -2
  90. package/skills/monkey-mini-app/references/contracts/pagination.md +33 -0
  91. package/skills/monkey-mini-app/references/contracts/password-field.md +12 -2
  92. package/skills/monkey-mini-app/references/contracts/phone-input.md +12 -2
  93. package/skills/monkey-mini-app/references/contracts/popover.md +32 -0
  94. package/skills/monkey-mini-app/references/contracts/progress-ring.md +12 -2
  95. package/skills/monkey-mini-app/references/contracts/progress.md +39 -0
  96. package/skills/monkey-mini-app/references/contracts/questionnaire.md +33 -0
  97. package/skills/monkey-mini-app/references/contracts/radar-chart.md +12 -2
  98. package/skills/monkey-mini-app/references/contracts/radio-group.md +20 -0
  99. package/skills/monkey-mini-app/references/contracts/rating.md +12 -2
  100. package/skills/monkey-mini-app/references/contracts/relative-date-picker.md +20 -2
  101. package/skills/monkey-mini-app/references/contracts/request-inspector.md +12 -2
  102. package/skills/monkey-mini-app/references/contracts/resizable.md +29 -0
  103. package/skills/monkey-mini-app/references/contracts/reveal.md +31 -0
  104. package/skills/monkey-mini-app/references/contracts/rich-text-editor.md +14 -2
  105. package/skills/monkey-mini-app/references/contracts/run-timeline.md +20 -2
  106. package/skills/monkey-mini-app/references/contracts/scroll-area.md +20 -0
  107. package/skills/monkey-mini-app/references/contracts/scrollspy.md +20 -2
  108. package/skills/monkey-mini-app/references/contracts/search-input.md +12 -2
  109. package/skills/monkey-mini-app/references/contracts/select.md +36 -0
  110. package/skills/monkey-mini-app/references/contracts/separator.md +27 -0
  111. package/skills/monkey-mini-app/references/contracts/settings-split.md +53 -0
  112. package/skills/monkey-mini-app/references/contracts/severity-chip.md +12 -2
  113. package/skills/monkey-mini-app/references/contracts/sheet.md +34 -0
  114. package/skills/monkey-mini-app/references/contracts/sidebar.md +42 -0
  115. package/skills/monkey-mini-app/references/contracts/skeleton.md +33 -0
  116. package/skills/monkey-mini-app/references/contracts/slider-range.md +12 -2
  117. package/skills/monkey-mini-app/references/contracts/slider.md +25 -0
  118. package/skills/monkey-mini-app/references/contracts/sortable-list.md +20 -2
  119. package/skills/monkey-mini-app/references/contracts/sparkline.md +12 -2
  120. package/skills/monkey-mini-app/references/contracts/spinner.md +31 -0
  121. package/skills/monkey-mini-app/references/contracts/stacked-bar-chart.md +16 -2
  122. package/skills/monkey-mini-app/references/contracts/stat-card.md +2 -2
  123. package/skills/monkey-mini-app/references/contracts/status-badge.md +2 -2
  124. package/skills/monkey-mini-app/references/contracts/stepper-item.md +39 -0
  125. package/skills/monkey-mini-app/references/contracts/stepper.md +38 -11
  126. package/skills/monkey-mini-app/references/contracts/switch.md +25 -0
  127. package/skills/monkey-mini-app/references/contracts/table-page.md +41 -0
  128. package/skills/monkey-mini-app/references/contracts/table.md +42 -0
  129. package/skills/monkey-mini-app/references/contracts/tabs.md +31 -0
  130. package/skills/monkey-mini-app/references/contracts/tag-input.md +12 -2
  131. package/skills/monkey-mini-app/references/contracts/terminal.md +13 -2
  132. package/skills/monkey-mini-app/references/contracts/test-step-list.md +12 -2
  133. package/skills/monkey-mini-app/references/contracts/textarea.md +25 -0
  134. package/skills/monkey-mini-app/references/contracts/time-picker.md +18 -2
  135. package/skills/monkey-mini-app/references/contracts/time-range-picker.md +20 -2
  136. package/skills/monkey-mini-app/references/contracts/time-wheel.md +6 -2
  137. package/skills/monkey-mini-app/references/contracts/timeline.md +20 -2
  138. package/skills/monkey-mini-app/references/contracts/timezone-select.md +20 -2
  139. package/skills/monkey-mini-app/references/contracts/toast.md +39 -0
  140. package/skills/monkey-mini-app/references/contracts/toggle-group.md +28 -0
  141. package/skills/monkey-mini-app/references/contracts/toggle.md +26 -0
  142. package/skills/monkey-mini-app/references/contracts/tooltip.md +30 -0
  143. package/skills/monkey-mini-app/references/contracts/transfer.md +12 -2
  144. package/skills/monkey-mini-app/references/contracts/tree-view.md +20 -2
  145. package/skills/monkey-mini-app/references/contracts/trend-card.md +12 -2
  146. package/skills/monkey-mini-app/references/contracts/user-picker.md +12 -2
  147. package/skills/monkey-mini-app/references/contracts/wizard-shell.md +56 -0
  148. package/skills/monkey-mini-app/references/ctx.md +123 -53
  149. package/skills/monkey-mini-app/references/eval.md +115 -0
  150. package/skills/monkey-mini-app/references/examples/alert/alert-01.tsx +17 -0
  151. package/skills/monkey-mini-app/references/examples/aspect-ratio/aspect-ratio-01.tsx +16 -0
  152. package/skills/monkey-mini-app/references/examples/attachment/attachment-01.tsx +19 -0
  153. package/skills/monkey-mini-app/references/examples/breadcrumb/breadcrumb-01.tsx +31 -0
  154. package/skills/monkey-mini-app/references/examples/bubble/bubble-01.tsx +16 -0
  155. package/skills/monkey-mini-app/references/examples/button-group/button-group-01.tsx +23 -0
  156. package/skills/monkey-mini-app/references/examples/card/card-01.tsx +19 -0
  157. package/skills/monkey-mini-app/references/examples/charts-blocks.md +15 -0
  158. package/skills/monkey-mini-app/references/examples/code-block/code-block-01.tsx +14 -0
  159. package/skills/monkey-mini-app/references/examples/code-editor/code-editor-01.tsx +15 -0
  160. package/skills/monkey-mini-app/references/examples/command/command-01.tsx +30 -0
  161. package/skills/monkey-mini-app/references/examples/confirm-dialog/confirm-dialog-01.tsx +33 -0
  162. package/skills/monkey-mini-app/references/examples/context-menu/context-menu-01.tsx +29 -0
  163. package/skills/monkey-mini-app/references/examples/dashboard-shell/dashboard-shell-01.tsx +78 -0
  164. package/skills/monkey-mini-app/references/examples/data-grid/data-grid-01.tsx +34 -0
  165. package/skills/monkey-mini-app/references/examples/data-grid/data-grid-02.tsx +88 -0
  166. package/skills/monkey-mini-app/references/examples/date-picker/date-picker-01.tsx +14 -0
  167. package/skills/monkey-mini-app/references/examples/date-range-picker/date-range-picker-01.tsx +14 -0
  168. package/skills/monkey-mini-app/references/examples/date-time-picker/date-time-picker-01.tsx +16 -0
  169. package/skills/monkey-mini-app/references/examples/date-time-range-picker/date-time-range-picker-01.tsx +15 -0
  170. package/skills/monkey-mini-app/references/examples/detail-panel/detail-panel-01.tsx +21 -0
  171. package/skills/monkey-mini-app/references/examples/dialog/dialog-01.tsx +30 -0
  172. package/skills/monkey-mini-app/references/examples/diff-viewer/diff-viewer-01.tsx +10 -0
  173. package/skills/monkey-mini-app/references/examples/dropdown-menu/dropdown-menu-01.tsx +31 -0
  174. package/skills/monkey-mini-app/references/examples/duration-input/duration-input-01.tsx +20 -0
  175. package/skills/monkey-mini-app/references/examples/editors.md +11 -0
  176. package/skills/monkey-mini-app/references/examples/empty/empty-01.tsx +19 -0
  177. package/skills/monkey-mini-app/references/examples/event-calendar/event-calendar-01.tsx +53 -0
  178. package/skills/monkey-mini-app/references/examples/file-dropzone/file-dropzone-01.tsx +14 -0
  179. package/skills/monkey-mini-app/references/examples/form-sheet/form-sheet-01.tsx +85 -0
  180. package/skills/monkey-mini-app/references/examples/forms.md +16 -0
  181. package/skills/monkey-mini-app/references/examples/gantt/gantt-01.tsx +29 -0
  182. package/skills/monkey-mini-app/references/examples/input/input-01.tsx +10 -0
  183. package/skills/monkey-mini-app/references/examples/item/item-01.tsx +19 -0
  184. package/skills/monkey-mini-app/references/examples/jql-input/jql-input-01.tsx +33 -0
  185. package/skills/monkey-mini-app/references/examples/json-viewer/json-viewer-01.tsx +10 -0
  186. package/skills/monkey-mini-app/references/examples/kanban/kanban-01.tsx +60 -0
  187. package/skills/monkey-mini-app/references/examples/label/label-01.tsx +10 -0
  188. package/skills/monkey-mini-app/references/examples/list-detail/list-detail-01.tsx +117 -0
  189. package/skills/monkey-mini-app/references/examples/log-viewer/log-viewer-01.tsx +20 -0
  190. package/skills/monkey-mini-app/references/examples/markdown-editor/markdown-editor-01.tsx +18 -0
  191. package/skills/monkey-mini-app/references/examples/marker/marker-01.tsx +16 -0
  192. package/skills/monkey-mini-app/references/examples/mini-calendar/mini-calendar-01.tsx +14 -0
  193. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-01.tsx +20 -0
  194. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-02.tsx +32 -0
  195. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-03.tsx +47 -0
  196. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-04.tsx +20 -0
  197. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-05.tsx +24 -0
  198. package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-06.tsx +89 -0
  199. package/skills/monkey-mini-app/references/examples/misc-editors/misc-editors-01.tsx +114 -0
  200. package/skills/monkey-mini-app/references/examples/misc-editors/misc-editors-02.tsx +33 -0
  201. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-01.tsx +22 -0
  202. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-02.tsx +37 -0
  203. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-03.tsx +42 -0
  204. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-04.tsx +25 -0
  205. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-05.tsx +27 -0
  206. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-06.tsx +33 -0
  207. package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-07.tsx +44 -0
  208. package/skills/monkey-mini-app/references/examples/misc-overlays/misc-overlays-01.tsx +43 -0
  209. package/skills/monkey-mini-app/references/examples/misc-overlays/misc-overlays-02.tsx +38 -0
  210. package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-01.tsx +21 -0
  211. package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-02.tsx +52 -0
  212. package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-03.tsx +44 -0
  213. package/skills/monkey-mini-app/references/examples/number-field/number-field-01.tsx +22 -0
  214. package/skills/monkey-mini-app/references/examples/overlays.md +11 -0
  215. package/skills/monkey-mini-app/references/examples/pagination/pagination-01.tsx +51 -0
  216. package/skills/monkey-mini-app/references/examples/primitives.md +12 -0
  217. package/skills/monkey-mini-app/references/examples/progress/progress-01.tsx +10 -0
  218. package/skills/monkey-mini-app/references/examples/relative-date-picker/relative-date-picker-01.tsx +19 -0
  219. package/skills/monkey-mini-app/references/examples/rich-text-editor/rich-text-editor-01.tsx +15 -0
  220. package/skills/monkey-mini-app/references/examples/run-timeline/run-timeline-01.tsx +17 -0
  221. package/skills/monkey-mini-app/references/examples/scrollspy/scrollspy-01.tsx +29 -0
  222. package/skills/monkey-mini-app/references/examples/separator/separator-01.tsx +10 -0
  223. package/skills/monkey-mini-app/references/examples/settings-split/settings-split-01.tsx +84 -0
  224. package/skills/monkey-mini-app/references/examples/shared/jira-wiki-sample.ts +38 -0
  225. package/skills/monkey-mini-app/references/examples/skeleton/skeleton-01.tsx +10 -0
  226. package/skills/monkey-mini-app/references/examples/slider/slider-01.tsx +22 -0
  227. package/skills/monkey-mini-app/references/examples/sortable-list/sortable-list-01.tsx +18 -0
  228. package/skills/monkey-mini-app/references/examples/spinner/spinner-01.tsx +10 -0
  229. package/skills/monkey-mini-app/references/examples/stepper/stepper-01.tsx +41 -0
  230. package/skills/monkey-mini-app/references/examples/table/table-01.tsx +25 -0
  231. package/skills/monkey-mini-app/references/examples/table-page/table-page-01.tsx +103 -0
  232. package/skills/monkey-mini-app/references/examples/time-picker/time-picker-01.tsx +19 -0
  233. package/skills/monkey-mini-app/references/examples/time-range-picker/time-range-picker-01.tsx +14 -0
  234. package/skills/monkey-mini-app/references/examples/timeline/timeline-01.tsx +18 -0
  235. package/skills/monkey-mini-app/references/examples/timezone-select/timezone-select-01.tsx +15 -0
  236. package/skills/monkey-mini-app/references/examples/toggle/toggle-01.tsx +20 -0
  237. package/skills/monkey-mini-app/references/examples/toggle-group/toggle-group-01.tsx +22 -0
  238. package/skills/monkey-mini-app/references/examples/tree-view/tree-view-01.tsx +25 -0
  239. package/skills/monkey-mini-app/references/examples/wizard-shell/wizard-shell-01.tsx +58 -0
  240. package/skills/monkey-mini-app/references/history.md +23 -7
  241. package/skills/monkey-mini-app/references/icons.md +99 -69
  242. package/skills/monkey-mini-app/references/llm-json.md +39 -26
  243. package/skills/monkey-mini-app/references/loader.md +47 -20
  244. package/skills/monkey-mini-app/references/looks/aurora-bento.md +88 -0
  245. package/skills/monkey-mini-app/references/looks/desk-split.md +89 -0
  246. package/skills/monkey-mini-app/references/looks/editorial.md +78 -0
  247. package/skills/monkey-mini-app/references/looks/glass-island.md +90 -0
  248. package/skills/monkey-mini-app/references/looks/index.md +18 -0
  249. package/skills/monkey-mini-app/references/looks/signage.md +74 -0
  250. package/skills/monkey-mini-app/references/looks/tape.md +22 -0
  251. package/skills/monkey-mini-app/references/looks/terminal.md +88 -0
  252. package/skills/monkey-mini-app/references/looks/void.md +22 -0
  253. package/skills/monkey-mini-app/references/styling.md +189 -0
  254. package/skills/monkey-mini-app/references/test.md +12 -12
  255. package/skills/monkey-mini-app/references/theme.md +197 -0
  256. package/skills/monkey-mini-app/references/tools.md +12 -12
  257. package/skills/monkey-mini-app/references/troubleshoot.md +165 -12
  258. package/skills/monkey-mini-app/templates/README.md +33 -21
  259. package/skills/monkey-mini-app/templates/{jira → board}/main.api.ts +11 -11
  260. package/skills/monkey-mini-app/templates/board/manifest.json +8 -0
  261. package/skills/monkey-mini-app/templates/board/theme.css +46 -0
  262. package/skills/monkey-mini-app/templates/board/ui.tsx +546 -0
  263. package/skills/monkey-mini-app/templates/chores/main.api.ts +35 -0
  264. package/skills/monkey-mini-app/templates/chores/manifest.json +8 -0
  265. package/skills/monkey-mini-app/templates/chores/theme.css +46 -0
  266. package/skills/monkey-mini-app/templates/chores/ui.tsx +117 -0
  267. package/skills/monkey-mini-app/templates/minimal/main.api.ts +5 -5
  268. package/skills/monkey-mini-app/templates/minimal/manifest.json +1 -2
  269. package/skills/monkey-mini-app/templates/minimal/ui.tsx +17 -8
  270. package/skills/monkey-mini-app/templates/radar/api/scan.ts +79 -0
  271. package/skills/monkey-mini-app/templates/radar/main.api.ts +29 -0
  272. package/skills/monkey-mini-app/templates/radar/manifest.json +8 -0
  273. package/skills/monkey-mini-app/templates/radar/shared/events.ts +25 -0
  274. package/skills/monkey-mini-app/templates/{insights/lib → radar/shared}/sample.ts +1 -1
  275. package/skills/monkey-mini-app/templates/radar/theme.css +47 -0
  276. package/skills/monkey-mini-app/templates/radar/ui/brief.tsx +31 -0
  277. package/skills/monkey-mini-app/templates/radar/ui.tsx +131 -0
  278. package/skills/monkey-mini-app/templates/runner/main.api.ts +91 -0
  279. package/skills/monkey-mini-app/templates/runner/manifest.json +8 -0
  280. package/skills/monkey-mini-app/templates/runner/shared/events.ts +14 -0
  281. package/skills/monkey-mini-app/templates/runner/theme.css +46 -0
  282. package/skills/monkey-mini-app/templates/runner/ui.tsx +213 -0
  283. package/skills/monkey-mini-app/templates/sheets/main.api.ts +276 -0
  284. package/skills/monkey-mini-app/templates/sheets/manifest.json +8 -0
  285. package/skills/monkey-mini-app/templates/sheets/theme.css +46 -0
  286. package/skills/monkey-mini-app/templates/sheets/ui.tsx +419 -0
  287. package/skills/monkey-mini-app/templates/{todo → today}/main.api.ts +8 -8
  288. package/skills/monkey-mini-app/templates/today/manifest.json +8 -0
  289. package/skills/monkey-mini-app/templates/today/theme.css +45 -0
  290. package/skills/monkey-mini-app/templates/today/ui/item-row.tsx +25 -0
  291. package/skills/monkey-mini-app/templates/today/ui.tsx +406 -0
  292. package/skills/monkey-mini-app/templates/{monitor → watch}/main.api.ts +8 -8
  293. package/skills/monkey-mini-app/templates/watch/manifest.json +8 -0
  294. package/skills/monkey-mini-app/templates/watch/ui.tsx +187 -0
  295. package/skills/monkey-mini-app/tsconfig.json +31 -0
  296. package/skills/monkey-mini-app/types/cdn.d.ts +1 -0
  297. package/tsup.config.ts +1 -0
  298. package/skills/monkey-mini-app/templates/agentrun/main.api.ts +0 -78
  299. package/skills/monkey-mini-app/templates/agentrun/manifest.json +0 -9
  300. package/skills/monkey-mini-app/templates/agentrun/ui.tsx +0 -125
  301. package/skills/monkey-mini-app/templates/insights/main.api.ts +0 -101
  302. package/skills/monkey-mini-app/templates/insights/manifest.json +0 -9
  303. package/skills/monkey-mini-app/templates/insights/ui.tsx +0 -138
  304. package/skills/monkey-mini-app/templates/jira/manifest.json +0 -9
  305. package/skills/monkey-mini-app/templates/jira/ui.tsx +0 -318
  306. package/skills/monkey-mini-app/templates/monitor/manifest.json +0 -9
  307. package/skills/monkey-mini-app/templates/monitor/ui.tsx +0 -176
  308. package/skills/monkey-mini-app/templates/review/main.api.ts +0 -68
  309. package/skills/monkey-mini-app/templates/review/manifest.json +0 -9
  310. package/skills/monkey-mini-app/templates/review/ui.tsx +0 -159
  311. package/skills/monkey-mini-app/templates/todo/manifest.json +0 -8
  312. package/skills/monkey-mini-app/templates/todo/ui.tsx +0 -177
package/lib/index.d.ts CHANGED
@@ -2,6 +2,8 @@ import { HostConfig, AbsolutePath, AppCallContext, AgentRunOptions, HostCapabili
2
2
 
3
3
  type DshPluginConfig = {
4
4
  runtimeRoot?: string;
5
+ /** Override skill install dir. Default: ~/.dsh/skills/monkey-mini-app. */
6
+ skillDest?: string;
5
7
  };
6
8
  /** Locate runtimeRoot from plugin config only when provided; else bootstrap seed path. */
7
9
  declare function resolveRuntimeRoot(config?: DshPluginConfig): AbsolutePath;
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/index.ts
2
+ import path5 from "path";
2
3
  import { createHost } from "@monkey-mini-app/host";
3
4
 
4
5
  // src/apply-config.ts
@@ -215,6 +216,7 @@ function resolveLlmRoute(ctx, opts, hostLlm) {
215
216
  }
216
217
 
217
218
  // src/llm-stream.ts
219
+ import { DEFAULT_LLM_MAX_TOKENS } from "@monkey-mini-app/host";
218
220
  function stringifyToolResult(value) {
219
221
  if (typeof value === "string") return value;
220
222
  try {
@@ -260,7 +262,9 @@ async function collectLlmStream(llmSvc, prompt, route, opts) {
260
262
  model: route.model,
261
263
  messages: [{ role: "user", content: [{ type: "text", text }] }],
262
264
  system,
263
- maxTokens: opts?.maxTokens ?? 1024
265
+ // The host normally supplies this (see DEFAULT_LLM_MAX_TOKENS); the same constant here keeps
266
+ // a direct capability call from silently falling back to a truncating budget.
267
+ maxTokens: opts?.maxTokens ?? DEFAULT_LLM_MAX_TOKENS
264
268
  };
265
269
  const acc = [];
266
270
  let sawDelta = false;
@@ -276,7 +280,7 @@ async function collectLlmStream(llmSvc, prompt, route, opts) {
276
280
  }
277
281
  }
278
282
  const out = acc.join("");
279
- if (!out) throw new Error("llm stream empty");
283
+ if (!out) throw new Error("llm: stream empty");
280
284
  return coerceSchemaJson(out, opts);
281
285
  }
282
286
 
@@ -741,7 +745,7 @@ function resolveSkillDir() {
741
745
  const here = path2.dirname(fileURLToPath(import.meta.url));
742
746
  const candidates = [
743
747
  path2.join(here, "..", "skills", "monkey-mini-app"),
744
- path2.join(here, "..", "..", "skills", "monkey-mini-app")
748
+ path2.join(here, "..", "..", "..", "skills", "monkey-mini-app")
745
749
  ];
746
750
  for (const c of candidates) {
747
751
  if (existsSync(path2.join(c, "SKILL.md"))) return c;
@@ -1047,10 +1051,19 @@ var inject = ["tools"];
1047
1051
  async function apply(ctx, config = {}) {
1048
1052
  const hostConfig = loadPluginHostConfig(config);
1049
1053
  const themes = new DshThemeResource(hostConfig.runtimeRoot);
1050
- const host = createHost(new DshCapabilities(ctx), new DshLifecycle(ctx), {
1051
- config: hostConfig,
1052
- themes
1053
- });
1054
+ const host = createHost(
1055
+ new DshCapabilities(ctx),
1056
+ new DshLifecycle(ctx, config.skillDest ? { skillDest: path5.resolve(config.skillDest) } : {}),
1057
+ {
1058
+ config: hostConfig,
1059
+ themes,
1060
+ about: {
1061
+ adapter: "dsh",
1062
+ packageName,
1063
+ env: process.env.NODE_ENV ?? "production"
1064
+ }
1065
+ }
1066
+ );
1054
1067
  let port;
1055
1068
  try {
1056
1069
  ({ port } = await host.apply(ctx));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkey-mini-app/dsh-mini-app",
3
- "version": "0.1.1",
3
+ "version": "0.1.5",
4
4
  "description": "DeepSeek Harness plugin: mini-app host wiring, panel, and skills",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -28,10 +28,11 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "rm -rf lib && tsup",
31
- "prepare": "rm -rf lib && tsup",
32
31
  "test": "vitest run --passWithNoTests",
33
32
  "typecheck": "tsc -p tsconfig.json --noEmit",
34
- "prepublishOnly": "pnpm --filter @monkey-mini-app/ui build && node ../../scripts/generate-skill.mjs && rm -rf lib && tsup"
33
+ "prepack": "node ../../scripts/gen/skill/copy.mjs dsh",
34
+ "postpack": "node ../../scripts/gen/skill/copy.mjs clean dsh",
35
+ "prepublishOnly": "pnpm --filter @monkey-mini-app/ui build && pnpm --filter @monkey-mini-app/api build && node ../../scripts/gen/skill/index.mjs && rm -rf lib && tsup"
35
36
  },
36
37
  "dsh": {
37
38
  "bundle": {
@@ -52,13 +53,13 @@
52
53
  "monkey-mini-app"
53
54
  ],
54
55
  "dependencies": {
55
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
56
- "@deepseek-ai/dsh-session": "0.1.1-rc.2",
57
- "@deepseek-ai/dsh-subagent": "0.1.1-rc.2",
56
+ "@deepseek-ai/dsh-llm": "0.1.2-rc.1",
57
+ "@deepseek-ai/dsh-session": "0.1.2-rc.1",
58
+ "@deepseek-ai/dsh-subagent": "0.1.2-rc.1",
58
59
  "@hono/node-server": "^2.1.1",
59
- "@monkey-mini-app/host": "^0.1.0",
60
- "@monkey-mini-app/panel": "^0.1.0",
61
- "@monkey-mini-app/ui": "^0.1.0",
60
+ "@monkey-mini-app/host": "workspace:*",
61
+ "@monkey-mini-app/panel": "workspace:*",
62
+ "@monkey-mini-app/ui": "workspace:*",
62
63
  "esbuild": "^0.28.2",
63
64
  "esbuild-wasm": "^0.25.12",
64
65
  "hono": "^4.8.0",
@@ -1,21 +1,38 @@
1
1
  ---
2
2
  name: monkey-mini-app
3
- description: Create or edit local mini-apps (ui.tsx + main.api.ts). Create with mini_app_register; edit with mini_app_read + mini_app_edit; verify with mini_app_reload; smoke with mini_app_call; open with mini_app_open.
3
+ description: Create or edit local mini-apps (ui.tsx + main.api.ts) — small self-contained web tools that run in the mini-app panel. Typical asks a todo/notepad, an internal utility, a data dashboard, a monitor page, a report, a kanban board, visualising a script's output, or an LLM summary page. Trigger phrases include 做个小程序 / 小工具 / 面板 / 仪表盘 / dashboard / 看板 / 帮我可视化 / mini-app. Create with mini_app_register, change with mini_app_read + mini_app_edit, compile-verify with mini_app_reload, smoke-test with mini_app_call, reveal with mini_app_open. Not for editing host / panel / SDK source, and not for writing the dsh or pi plugin itself.
4
4
  ---
5
5
 
6
6
  # monkey-mini-app
7
7
 
8
- 生成或修改本地小程序。本 skill `~/.dsh/skills/monkey-mini-app/`(`references/`、`templates/` 同级)。
8
+ Generate or modify a local mini-app. Reference docs and templates live **next to this SKILL.md** (`references/`, `templates/`) — always open them by relative path; never assume where a given host installed the skill.
9
9
 
10
- **`ctx` / 模型 API 以本 skill [references/ctx.md](references/ctx.md)、[references/llm-json.md](references/llm-json.md) 为准**(含 `llm` / `agent` / `schema` / `onEvent`)。现网样例不要当契约:不要读 `~/.monkey-mini-app/runtime/apps/*/`。
10
+ **Language rule for this skill:** instructions are English; the Chinese in code samples is *product copy* that the end user sees. Mini-app UI text follows the host locale (the samples use Chinese because the shipped host defaults to it) do not translate user-facing strings when you adapt a template.
11
11
 
12
- ## 文件怎么落地
12
+ **`ctx` and the model APIs are defined by [references/ctx.md](references/ctx.md) and [references/llm-json.md](references/llm-json.md)** (incl. `llm` / `agent` / `schema` / `onEvent`). Live apps are not a contract: do not read `~/.monkey-mini-app/runtime/apps/*/`.
13
13
 
14
- Workspace 直接 Write `~/.monkey-mini-app/runtime/**` 会被沙箱拒绝,一律走 `mini_app_*` 工具。
14
+ ## How files reach disk
15
15
 
16
- ### 新建 app `mini_app_register`
16
+ Writing `~/.monkey-mini-app/runtime/**` directly is refused by the sandbox — always go through the `mini_app_*` tools (no curl, no bash against `:17880`).
17
17
 
18
- 脚手架创建(要 `manifest.json`)。`files` **key 是相对路径**(动态名字),value 是全文;自动建目录。常见还有 `ui.tsx`、`main.api.ts`,按需 `lib/...`、`components/...`(禁止 `..` / 绝对路径):
18
+ | Goal | Tool | Notes |
19
+ |---|---|---|
20
+ | Inspect an existing app's manifest + absolute dir | `mini_app_get({ appId })` | Call this before editing — beats guessing |
21
+ | List its source files | `mini_app_list_files({ appId })` | Skips `.git` / `storage` |
22
+ | Read one file | `mini_app_read({ appId, path })` | `startLine`/`endLine` or `offset`/`limit`; `numbered: true` for `N\|` line prefixes |
23
+ | **Edit an existing file** (main path) | `mini_app_edit({ appId, path, edits })` | `edits: [{ oldText, newText }]`; each `oldText` must be **unique** in the file. Never rewrite a whole tree to change one line |
24
+ | New file / large rewrite | `mini_app_write({ appId, path, content })` | |
25
+ | Delete one file | `mini_app_delete({ appId, path })` | `manifest.json` cannot be deleted |
26
+ | Create a whole app | `mini_app_register({ appId, files })` | `files` keys are relative paths, values full text; must include `manifest.json` |
27
+ | Validate + compile + warm cache | `mini_app_reload({ appId })` | After every round of edits — see below |
28
+ | **Add a backend npm library** | `mini_app_install({ appId, packages: [{ name: "exceljs" }] })` | Only when `main.api.ts` must `import` a real Node library. Never for `lodash` / `motion` / `axios` / `react`. Not importable from `ui.tsx`. |
29
+ | Smoke-test api methods | `mini_app_call({ appId, method, args })` | Or `calls: [{ method, args }]` for a whole set in one round trip |
30
+ | Show it to the user | `mini_app_open({ appId })` | Returns whether a panel actually received it |
31
+ | **Read runtime errors** | `mini_app_errors({ appId, since? })` | The only way to see a UI that compiled and then crashed |
32
+ | **Ask the rendered view** | `mini_app_view_eval({ appId, code? })` | Run JS in the live DOM — what actually rendered, at what size, with which styles |
33
+ | Confirm the plugin is alive | `mini_app_list()` | |
34
+
35
+ `mini_app_register` shape (`ui.tsx` + `main.api.ts` are the two entries; add `ui/…` / `api/…` / `shared/…` as needed — `..` and absolute paths are rejected):
19
36
 
20
37
  ```
21
38
  mini_app_register({
@@ -24,147 +41,183 @@ mini_app_register({
24
41
  "manifest.json": "...",
25
42
  "ui.tsx": "...",
26
43
  "main.api.ts": "...",
27
- "lib/parse.ts": "...",
28
- "components/Card.tsx": "..."
44
+ "ui/Card.tsx": "...",
45
+ "api/parse.ts": "...",
46
+ "shared/format.ts": "..."
29
47
  }
30
48
  })
31
49
  ```
32
50
 
33
- ### 改已有文件 `read` + `edit`(主路径)
51
+ Mutating tools **auto-commit** by default; pass `commit: false` to batch a few edits and let one final `mini_app_reload` close the round. Versioning (`mini_app_history_commit` / `mini_app_history_list` / `mini_app_history_reset` / `mini_app_history_revert`, single branch, revert = forward commit) → [references/history.md](references/history.md).
34
52
 
35
- 不要再用 `register` 整树重写来改一行。
53
+ **Deleting a whole app is a user action** in the panel. There is no unregister tool — do not delete the directory, do not curl `DELETE`.
36
54
 
37
- ```
38
- mini_app_list_files({ appId })
39
- mini_app_read({ appId, path: "ui.tsx" })
40
- // 可选行窗(1-indexed 闭区间):startLine/endLine;也可 offset+limit(Pi 风格)
41
- // mini_app_read({ appId, path: "ui.tsx", startLine: 10, endLine: 40 })
42
- // mini_app_read({ appId, path: "main.api.ts", offset: 1, limit: 80, numbered: true })
43
- mini_app_edit({
44
- appId,
45
- path: "ui.tsx",
46
- edits: [{ oldText: "旧片段(须唯一)", newText: "新片段" }],
47
- // commit: false // 多轮小改可先不提交,最后 reload 收口
48
- })
49
- ```
55
+ ### What `mini_app_reload` returns
56
+
57
+ `{ ok, errors, notices?, compiled, committed, caches }`. The **prefix** of each `errors[i]` names the failing layer — fix that layer, don't shotgun.
58
+
59
+ **Cache contract (do not second-guess this):** every successful reload drops the in-memory API module, UI bundle, **and app CSS** (`caches.appCss` is always `"dropped"`), and signals open panels to re-fetch. The tool also defaults to `cleanCaches: true` (purges `.autogen/` + on-disk bundles) so a stale Tailwind artifact cannot linger — pass `cleanCaches: false` only when you intentionally want to keep disk caches. Read `caches.views` to know whether a browser actually re-fetched.
50
60
 
51
- - **新建单文件 / 大段重写** → `mini_app_write({ appId, path, content })`
52
- - **删文件** → `mini_app_delete({ appId, path })`(不能删 `manifest.json`)
53
- - mutate 默认 **auto-commit**;设 `commit: false` 可攒改动
61
+ Error prefixes:
54
62
 
55
- ### 验证 + 预热缓存 `mini_app_reload`
63
+ | Prefix | Meaning | Next step |
64
+ |---|---|---|
65
+ | `appId must be reverse-DNS` | Bad id shape | Use `com.<you>.<thing>` |
66
+ | `app not registered` | Nothing on disk yet | `mini_app_register` first |
67
+ | `manifest: …` | Missing key / broken JSON | Needs `id` `name` `version` `entry` |
68
+ | `main.api: …` | Backend compile, relative-import resolution, or an undefined name | Read the rest of the message |
69
+ | `ui: …` | UI bundle failed, or an undefined name/component | Usually a disallowed import or a typo'd identifier |
70
+ | `shared: …` | Undefined name in `shared/**` (used by both sides) | Fix in `shared/` |
71
+ | `commit: …` | Compiled fine, auto-commit failed | Commit explicitly with `mini_app_history_commit` |
56
72
 
57
- 改完一轮后调用(**替代旧的 `mini_app_validate`**):校验 + **同步编译** `main.api` UI;成功且工作区有未提交改动会 auto-commit。
73
+ `committed.status` is explicit, because "nothing happened" and "I could not commit" need different follow-ups:
74
+
75
+ | `status` | Meaning |
76
+ |---|---|
77
+ | `committed` | New commit (`commitId` set) |
78
+ | `clean` | Nothing to commit — `mini_app_edit` already auto-committed it |
79
+ | `skipped` | Compile failed, so no commit was attempted |
80
+ | `failed` | Commit itself errored (`reason`; also in `errors[]`) |
81
+
82
+ **Compile green is not "it runs".** `errors[]` from an undefined identifier *is* caught now (`"greeting()" is called but never defined or imported`, often with a `did you mean`), and `notices[]` carries lower-confidence findings — read them, they are cheap. What no compile step can see is anything that only fails at render time, so finish the loop:
83
+
84
+ ### Debug loop (this is the part that used to need a human)
58
85
 
59
86
  ```
60
- mini_app_reload({ appId }) // { ok, errors, compiled, committed? }
87
+ edit mini_app_reload mini_app_open mini_app_errors mini_app_view_eval
61
88
  ```
62
89
 
63
- 然后:
90
+ 1. `mini_app_reload` until `ok: true`.
91
+ 2. `mini_app_open` — the iframe mounts and streams back anything it throws. `panel: "no-panel-connected"` means no browser is attached: the app is fine, nobody is looking, so tell the user to open the panel.
92
+ 3. Give it a moment to render, then `mini_app_errors`. Empty + never opened ≠ clean; the hint says when to re-read.
93
+ 4. `mini_app_view_eval({ appId })` (no `code` = the `#root` subtree) to see what actually drew — then ask it anything in JS: did that class apply, which node has no width, is that subtree `display:none`.
64
94
 
65
- 1. `mini_app_call({ appId, method, args })` 冒烟(不是 curl / 不是 bash `:17880`)
66
- 2. `mini_app_open({ appId })` —— 弹出侧栏「小程序」并打开该 app
95
+ `mini_app_errors` polls with `since: <lastSeq>`; a reload clears the ring, so errors after a reload are only from the new build. `mini_app_view_eval` needs a live view and says which of `not-open` / `runner-not-booted` / `stuck` it hit when it does not get one → **[references/eval.md](references/eval.md)**.
67
96
 
68
- `mini_app_list` 只需确认插件活着。显式 `mini_app_history_commit` / `_list` / `_reset` / `_revert` 仍可用。
97
+ More symptoms [references/troubleshoot.md](references/troubleshoot.md).
69
98
 
70
- ## 协议
99
+ ## Protocol
71
100
 
72
- - UI **禁止** `import` `main.api.ts`
73
- - UI:`const { call } = useDashboardApi()`,自己管 loading;`useDashboardApi` 从 `@monkeyagent/host` 导入(host 注入,不要自己实现)
74
- - 后端:`export default defineDashboard({ name, description, api })`
75
- - `call("foo")` 必须是 `api.foo`
76
- - 后端 import 只许 `@monkeyagent/dashboard` 和 `./lib` `./components`
77
- - 抓网:`ctx.http(url)` / `ctx.http(url, { method, headers, query, body, timeout })`;解析写 `./lib`
78
- - 本机命令才用 `ctx.bash`(`{ stdout, stderr, exitCode }`)
79
- - **模型**:`ctx.llm(prompt, opts?)` / `ctx.agent(goal, opts?)` → **string**。共用 opts:`provider?` `model?` `system?` `schema?` `maxTokens?` `signal?`;agent 另加 `onEvent?`。结构化 JSON → [llm-json.md](references/llm-json.md);过程事件与完整签名 → [ctx.md](references/ctx.md)
80
- - MCP / tool 参数是普通对象,禁止 `{ input: "..." }`;`ctx.tool` / `ctx.agent` / `ctx.llm` 返回值都是 **string**(tool/mcp 经宿主 stringify)
81
- - 文案给用户看;卡片标题用业务语言(「今日摘要」),不要写 `ctx.bash` / `storage/*.json`
82
- - **长耗时任务只跑采样** + 必须响应 `ctx.signal` + `scanStatus`/`progress`,见 [ctx.md](references/ctx.md)
101
+ **Two author packages:** `@monkey-mini-app/ui` (UI: `useApp` + components) and `@monkey-mini-app/api` (backend: `defineApp`, host-injected). The UI compiler externalises `react` + the UI package; the backend loader injects `defineApp` only. Any other bare import is a compile error by design.
83
102
 
84
- ## UI(@monkey-mini-app/ui)
103
+ **Layout** (enforced, not cosmetic):
85
104
 
86
- **组件库是「参考 / 便利」,不是硬性规范。** 它只是帮你省掉重复造轮子——合适的场景直接用,但**别为了用组件而用**。允许完全自由的发挥:
105
+ ```
106
+ manifest.json · ui.tsx · main.api.ts
107
+ ui/ → UI only (components, hooks) backend may NOT import it
108
+ api/ → backend only (helpers, ctx work) UI may NOT import it
109
+ shared/ → both — pure code only: no React, no DOM, no ctx, no Node
110
+ ```
111
+
112
+ A trivial app needs none of the three folders. Relative imports may use any subfolder name, but must stay inside the app dir.
113
+
114
+ - UI may **not** `import` `main.api.ts`
115
+ - UI: `const { call } = useApp()` — you own loading/error state; `useApp` comes from `@monkey-mini-app/ui` (never implement your own)
116
+ - Backend: `export default defineApp({ name, description, api })` (`name` **and** `description` are required; import `defineApp` from `@monkey-mini-app/api` — the host injects the runtime copy, nothing React gets loaded)
117
+ - `call("foo")` must be a key of `api.foo`
118
+ - Backend imports: `@monkey-mini-app/api` + relative paths inside the app dir (no npm, no Node builtins)
119
+ - Fetching: `ctx.http(url)` / `ctx.http(url, { method, headers, query, body, timeout })`; put parsing in `api/`
120
+ - Machine commands only via `ctx.bash` (`{ stdout, stderr, exitCode }`)
121
+ - **Model**: `ctx.llm(prompt, opts?)` / `ctx.agent(goal, opts?)` → **string**. Shared opts: `provider?` `model?` `system?` `schema?` `maxTokens?` `signal?`; `agent` adds `onEvent?` `maxIterations?` `cwdType?` `cwd?`. Structured JSON → [llm-json.md](references/llm-json.md); full signatures and event shapes → [ctx.md](references/ctx.md)
122
+ - MCP / tool args are plain objects — never `{ input: "..." }`; `ctx.tool` / `ctx.agent` / `ctx.llm` all return **string** (the host stringifies tool results)
123
+ - Copy is for the end user; card titles speak business (`「今日摘要」` / "Today's digest"), never `ctx.bash` or `storage/*.json`
124
+ - **Long jobs run sampled only**, must honour `ctx.signal`, and expose `scanStatus`/`progress` — see [ctx.md](references/ctx.md)
125
+
126
+ ## UI (`@monkey-mini-app/ui`)
127
+
128
+ **The component library is a convenience, not a mandate.** It exists so you stop rebuilding wheels — use it where it fits, but never contort a design to use it. Free-form UI is expected:
87
129
 
88
- - **先判断**:这个 UI 有没有现成组件?**有且合适用**(省 token、风格统一);**没有、或要独特视觉/交互、或用户明确要「自由发挥」→ 用原生元素(`div`/`span`/`button`/`input`/`table`/`svg`…)+ Tailwind classes 自行实现**,不用迁就组件库去硬凑。
89
- - **可混用**:骨架(卡片/页头/弹窗)用库组件,细节或视觉特殊处用原生 + Tailwind
90
- - **自由发挥的边界**:原生元素 + Tailwind 随意;但 UI 仍**只能** import `react` / `@monkey-mini-app/ui` / `@monkeyagent/host` / 相对 `./lib`(编译器限制,**不能 import 任意 npm 包**)。需要图表/图标/编辑器等能力时从 `@monkey-mini-app/ui` 拿,或自己用 CSS/SVG 实现。
91
- - **不用管的**:`UiProvider` host 自动包裹;布局用 Tailwind classes(库里没有 Stack/Text 这类布局件)。
130
+ - **Decide first**: is there a component for this that actually fits? **Yes use it** (fewer tokens, consistent look). **No, or the design needs its own visual/interaction, or the user asked for free play → build it from native elements (`div`/`span`/`button`/`input`/`table`/`svg`…) + Tailwind classes.** Do not bend the design to fit the library.
131
+ - **Mixing is normal**: library components for the skeleton (cards / page header / dialogs), native + Tailwind for the distinctive parts.
132
+ - **Boundary of free play**: native elements and Tailwind are unlimited, but `ui.tsx` may only import `react`, `@monkey-mini-app/ui`, `lodash` / `lodash-es`, `motion` / `motion/react`, and in-app relative paths — never `api/**`, never `../` out of the app dir, never another npm package. Hooks from `react`; components, `useApp`, and `cn` from the SDK.
133
+ - **Not your job**: the theme provider and the app runtime are wrapped by the host; there is no `Stack`/`Text` layout component — use Tailwind classes.
134
+ - Component props list **only their own API**: `className`, `style`, `onClick`, `aria-*` are never repeated (every component takes them). Conversely, **never guess the part names of a compound component** (`Dialog` + `DialogTrigger` + `DialogContent`, not `<Dialog title>`) — read its contract.
92
135
 
93
- 下面是「常用姿势」示例,**不是唯一写法**——复杂/特殊 UI 完全可以全手写。
136
+ The snippet below is a common shape, **not the only shape** — complex or bespoke UI may well be fully hand-written.
94
137
 
95
138
  ```tsx
96
- import { useEffect, useState } from "react";
97
- import { Button, Input, Card, CardContent, CardHeader, CardTitle, Textarea } from "@monkey-mini-app/ui";
98
- import { useDashboardApi } from "@monkeyagent/host";
139
+ import { useState } from "react";
140
+ import { useApp, Button, Input, Card, CardContent, CardHeader, CardTitle } from "@monkey-mini-app/ui";
99
141
 
100
142
  export default function Ui() {
101
- const { call } = useDashboardApi();
143
+ const { call } = useApp();
102
144
  const [draft, setDraft] = useState("");
103
145
  ...
104
146
  return (
105
147
  <Card className="mt-8 w-full">
106
- <CardHeader><CardTitle>名称</CardTitle></CardHeader>
148
+ <CardHeader><CardTitle>Name</CardTitle></CardHeader>
107
149
  <CardContent className="flex flex-col gap-3">
108
- <Input value={draft} onChange={(e) => setDraft(e.target.value)} placeholder="写一条" />
109
- <Button onClick={async () => { await call("add", { title: draft }); }}>添加</Button>
150
+ <Input value={draft} onChange={(e) => setDraft(e.target.value)} placeholder="Write something" />
151
+ <Button onClick={async () => { await call("add", { title: draft }); }}>Add</Button>
110
152
  </CardContent>
111
153
  </Card>
112
154
  );
113
155
  }
114
156
  ```
115
157
 
116
- - **布局用 Tailwind classes**(`flex flex-col gap-3 p-4 grid md:grid-cols-3 w-full space-y-4`),库内没有 Stack/Text 这类布局组件
117
- - **`UiProvider` host 自动包裹**(locale 跟随 host 设置),不要自己写 Provider
118
- - 组件清单(props + 类型 + 示例)→ **[references/catalog.md](references/catalog.md)** **[references/contracts/](references/contracts/)**(自动生成,改组件后 `pnpm skill:gen` 再生成)
119
- - **图标**:`import { Icon } from "@monkey-mini-app/ui"` 后用 `Icon.HelpCircle`(任意 lucide 名都行);**常用推荐子集 + 何时用** → **[references/icons.md](references/icons.md)**(不要读上千个名,看这份精简的)
120
- - **空状态插图**:`import { IlluServerStatus } from "@monkey-mini-app/ui"`(`Illu*`,已 token 化跟主题)
121
- - 组件库已内置 lucide 图标 / recharts / CodeMirror 等依赖——**不要**额外 import 这些 npm 包;从 `@monkey-mini-app/ui`
122
-
123
- | 场景 | 组件 |
158
+ - **Layout is Tailwind** (`flex flex-col gap-3 p-4 grid md:grid-cols-3 w-full space-y-4`)
159
+ - **`cn` is already in the kit** `import { cn } from "@monkey-mini-app/ui"` (`clsx` + `tailwind-merge`). Prefer it over concatenating class strings.
160
+ - **Tailwind is compiled per app from your source** — variants (`hover:` `group-hover:` `md:`), the default palette (`bg-rose-500`) and arbitrary values (`w-[437px]`) all work, so **do not fall back to inline `style` out of caution**. The one trap: class names must be complete literals — `` `bg-${x}-500` `` generates nothing, silently → **[references/styling.md](references/styling.md)**
161
+ - **Colour is tokens, never hex** the user's palette rewrites token values under `<html>`, a literal breaks dark mode → **[references/theme.md](references/theme.md)** (generated token table). **Do not invent a theme in `ui.tsx`.** Two escape hatches, both rare: a host-global custom palette (`themes/theme-<id>.css`) when the user asks for a named brand — *Custom host theme file*; or an app-local `theme.css` when the **style itself depends on a hue** (a look the app carries, e.g. neon signage) — *App-local palette*. A plain CRUD/table/settings app ships neither.
162
+ - **`lodash` is a platform module** on UI and backend (`import { groupBy, debounce } from "lodash"`). Prefer it over hand-rolled `groupBy` / `uniqBy` / `pick` / `debounce`. Bare `axios` / `ramda` / `dayjs` still fail.
163
+ - **`motion` is a platform module** (UI only — `import { motion, AnimatePresence } from "motion/react"`). Use it for enter/exit/layout, Tailwind `transition` for a one-property hover, and kit `<Reveal delay={i * 60}>` for a staggered entrance. Custom `@keyframes` are allowed — give them your own name, since keyframe names are global inside the app's document and the platform already defines `spin` / `pulse` / `enter` / `exit` / … → **[references/styling.md](references/styling.md)** *Animation*.
164
+ - **Need a library the platform does not ship** (a real file format, a binary protocol, a vendor SDK): `mini_app_install({ appId, packages: [{ name: "exceljs" }] })`, then `import ExcelJS from "exceljs"` in `main.api.ts`. Order of preference: `ctx.http` → `ctx.bash` / `ctx.tool` → install. Backend only — the UI still gets JSON through `call`.
165
+ - **Icons**: `import { Icon } from "@monkey-mini-app/ui"`, then `Icon.HelpCircle` (any lucide name works); **curated subset + when to use** → **[references/icons.md](references/icons.md)** (don't page through a thousand names)
166
+ - **Empty-state illustrations** — exactly these 10, the names are not guessable: `IlluEmpty` `IlluNoData` `IlluSearch` `IlluLoading` `IlluServerStatus` `IlluAccessDenied` `IlluPageNotFound` `IlluDataProcessing` `IlluBugFixing` `IlluCodeReview`
167
+ - Component index (props + types) → **[references/catalog.md](references/catalog.md)** and **[references/contracts/](references/contracts/)** (generated; after changing a component run `pnpm gen:skill`).
168
+ - **Prefer a ready example over writing a widget from memory**: each component contract lists [references/examples/](references/examples/) files, one scenario each (e.g. `data-grid-01` = sort+search+pagination, `data-grid-02` = rich cells via renderers). They import `react` + `@monkey-mini-app/ui` + relatives only, so copy one into `ui/` and edit — do not invent a variant no example shows.
169
+ - The SDK already bundles React / lucide / recharts — **never** import those yourself
170
+ - **Heavy editors load from a CDN on demand** (not npm): `CodeEditor` pulls CodeMirror 6 from `esm.sh`; `CodeBlock` / `DiffViewer` pull shiki; `RichTextEditor` is a local contentEditable editor (no CDN, no dependency). Do not `import` `@codemirror/*` / `shiki` / `@tiptap/*` / `@uiw/react-codemirror` (the last one brings a second React). When the CDN is blocked the components degrade — see [troubleshoot.md](references/troubleshoot.md)
171
+
172
+ | Need | Components |
124
173
  |---|---|
125
- | 页面骨架 | `AppShell` `PageHeader` `FilterBar` `DetailPanel` |
126
- | KPI 卡片 | `StatCard` `TrendCard` `StatusBadge` `SeverityChip` |
127
- | 表格 | `DataGrid` + `ColumnDef`(排序/筛选/分页/CSV 自带) |
128
- | 日期时间 | `DatePicker` `DateRangePicker` `DateTimePicker` `TimePicker` `DurationInput` `RelativeDatePicker` |
129
- | 看板/日历/计划 | `Kanban` `EventCalendar` `Gantt` `Timeline` `Stepper` |
130
- | 树/列表 | `TreeView` `SortableList` `FileTree` |
131
- | 编辑器 | `CodeEditor` `MarkdownEditor` `RichTextEditor` `CodeBlock` `Markdown` |
132
- | 检查/日志 | `DiffViewer` `JsonViewer` `LogViewer` `RequestInspector` `Terminal` |
133
- | 表单扩展 | `SearchInput` `NumberField` `TagInput` `ConfirmDialog` `FileDropzone` `Copyable` `UserPicker` |
134
- | 图表 | `DonutChart` `StackedBarChart` `Sparkline` `Gauge` `RadarChart` + L1 `Chart` |
135
- | 基础件 | `Button` `Input` `Select` `Dialog` `Sheet` `Tabs` `Card` `Badge` `Toast` `Empty` … |
136
-
137
- ## CRUD 骨架(普通记事直接改这段)
174
+ | Page skeleton | `AppShell` `PageHeader` `FilterBar` `DetailPanel` |
175
+ | KPI cards | `StatCard` `TrendCard` `StatusBadge` `SeverityChip` |
176
+ | Tables | `DataGrid` + `ColumnDef` (sorting / filtering / paging / CSV built in) |
177
+ | Date & time | `DatePicker` `DateRangePicker` `DateTimePicker` `TimePicker` `DurationInput` `RelativeDatePicker` |
178
+ | Boards / calendar / plans | `Kanban` `EventCalendar` `Gantt` `Timeline` `Stepper` |
179
+ | Trees / lists | `TreeView` `SortableList` `FileTree` |
180
+ | Editors | `CodeEditor` `MarkdownEditor` `RichTextEditor` `CodeBlock` `Markdown` |
181
+ | Inspect / logs | `DiffViewer` `JsonViewer` `LogViewer` `RequestInspector` `Terminal` |
182
+ | Form extras | `SearchInput` `NumberField` `TagInput` `ConfirmDialog` `FileDropzone` `Copyable` `UserPicker` |
183
+ | Charts | `DonutChart` `StackedBarChart` `Sparkline` `Gauge` `RadarChart` + L1 `Chart` |
184
+ | Primitives | `Button` `Input` `Select` `Dialog` `Sheet` `Tabs` `Card` `Badge` `Toast` `Empty` … |
185
+
186
+ ## CRUD skeleton (edit this for plain local notes)
138
187
 
139
188
  `manifest.json`:
140
189
 
141
190
  ```json
142
191
  {
143
192
  "id": "com.example.foo",
144
- "name": "名称",
145
- "description": "一句话",
193
+ "name": "My Mini App",
194
+ "description": "One line description for the app",
146
195
  "version": "0.1.0",
147
196
  "entry": "ui.tsx",
148
- "theme": { "followsHost": true },
149
- "acronym": "MC"
197
+ "acronym": "MA"
150
198
  }
151
199
  ```
152
200
 
153
- `acronym`(可选):双字母缩写,用于 Host 列表的卡片 monogram。不写时按中文名拼音声母自动生成(「备忘录」→ BW),英文名取前两个字母。只有想自定义缩写时才需要填(如品牌名)。
201
+ There is **no theme block**. Colour comes from the host palette unless the app ships its own
202
+ `theme.css` — see [references/theme.md](references/theme.md) → *App-local palette*.
203
+
204
+ Product strings (`name`, `description`, every label the user sees) follow the **host locale** — the shipped host defaults to Chinese, so the samples are Chinese. Instructions and comments stay English.
205
+
206
+ `acronym` (optional): two letters used as the monogram on the host's list card. Omit it and the host derives one (pinyin initials for Chinese names, e.g. `备忘录` → BW; first two letters for Latin names). Only set it to override a brand name.
154
207
 
155
208
  `main.api.ts`:
156
209
 
157
210
  ```ts
158
- import { defineDashboard } from "@monkeyagent/dashboard";
211
+ import { defineApp } from "@monkey-mini-app/api";
159
212
 
160
213
  async function loadItems(ctx) {
161
214
  const items = await ctx.storage.get("items");
162
215
  return Array.isArray(items) ? items : [];
163
216
  }
164
217
 
165
- export default defineDashboard({
166
- name: "名称",
167
- description: "一句话",
218
+ export default defineApp({
219
+ name: "My Mini App",
220
+ description: "One line description for the app",
168
221
  api: {
169
222
  async list(ctx) {
170
223
  return loadItems(ctx);
@@ -187,32 +240,46 @@ export default defineDashboard({
187
240
  });
188
241
  ```
189
242
 
190
- ## 按需再读(不要一次全打开)
243
+ ## Read on demand (do not open everything)
191
244
 
192
- | 何时 | 打开 |
245
+ | When | Open |
193
246
  |------|------|
194
- | 组件 props / 类型 / 示例 | [references/catalog.md](references/catalog.md) → [references/contracts/](references/contracts/) |
195
- | 图标子集(`Icon` 命名空间,何时用) | [references/icons.md](references/icons.md) || `ctx.*` 完整契约(含 agent `onEvent` 事件形状) | [references/ctx.md](references/ctx.md)(用 `ctx.http`,不要 bash curl) |
196
- | `schema` 结构化 JSON 例子 | [references/llm-json.md](references/llm-json.md) |
197
- | **真的要用** `ctx.tool` | `mini_app_list_ctx_tools`,再 [references/tools.md](references/tools.md) |
198
- | 相对 import、`./lib` 解析 | [references/loader.md](references/loader.md) |
199
- | 人类调试 Host `:17880` / curl | [references/test.md](references/test.md)(≠ `ctx.http`) |
200
- | 骨架基线 / 最小可运行结构 | `templates/minimal/` |
201
- | 本地 CRUD + 筛选 + 派生统计 | `templates/todo/` |
202
- | 联网数据 模型摘要(长任务/采样/取消) | `templates/insights/` |
203
- | 本机指标实时看板(system + bash) | `templates/monitor/` |
204
- | 编辑/diff/日志/用例表格(复杂组件示例) | `templates/review/` |
205
- | `ctx.agent` 多步任务 + 过程/取消 | `templates/agentrun/` |
206
- | 看板/表格双视图 + 编辑 + AI(flagship) | `templates/jira/` |
207
- | **先把 7 个模板的指引侧重读一遍再选** | [`templates/README.md`](templates/README.md) |
208
- | 报错 | [references/troubleshoot.md](references/troubleshoot.md) |
209
-
210
- 普通 storage CRUD **先用上面骨架**,不要为了记笔记去读整份 Todo。模板是风格样板:中文产品文案、`call` 自己管 loading/error、后端可用 TypeScript。
247
+ | Component props / types | [references/catalog.md](references/catalog.md) → [references/contracts/](references/contracts/) |
248
+ | **Which Tailwind classes work / how to colour** | [references/styling.md](references/styling.md) |
249
+ | **What actually rendered (live DOM query)** | [references/eval.md](references/eval.md) — recipes, output format, the four `view` states |
250
+ | **Theme token table + custom host theme file** | [references/theme.md](references/theme.md) (generated — do not hand-edit) |
251
+ | **A runnable starting point for one component** | contract's `## Examples` → [references/examples/](references/examples/) (each file = one scenario: `@title` + `@scenario`; layout/pattern recipes in `examples/<group>.md`) |
252
+ | Icon subset (`Icon` namespace, when to use) | [references/icons.md](references/icons.md) |
253
+ | Full `ctx.*` contract (incl. agent `onEvent` shapes) | [references/ctx.md](references/ctx.md) (use `ctx.http`, not bash curl) |
254
+ | Structured JSON via `schema` | [references/llm-json.md](references/llm-json.md) |
255
+ | **Actually using** `ctx.tool` | `mini_app_list_ctx_tools` first, then [references/tools.md](references/tools.md) |
256
+ | Relative imports, `ui` / `api` / `shared` layout | [references/loader.md](references/loader.md) |
257
+ | Human debugging of host `:17880` / curl | [references/test.md](references/test.md) (≠ `ctx.http`) |
258
+ | Errors | [references/troubleshoot.md](references/troubleshoot.md) |
259
+ | Versioning / rollback | [references/history.md](references/history.md) |
260
+ | **A named visual style** (only if the user asked) | [references/looks/index.md](references/looks/index.md) — recipes, not apps |
261
+
262
+ **Templates are product facades, cut by interaction loop.** Read [`templates/README.md`](templates/README.md). Lift the pattern — do not paste whole files. Looks are optional; do not open them unless the user named a style.
263
+
264
+ | Loop | Template |
265
+ |---|---|
266
+ | One `call` / connectivity | `templates/minimal/` |
267
+ | Open → my screen → one record | `templates/today/` |
268
+ | Items move in 2D status | `templates/board/` |
269
+ | Trigger → wait → read (cancel) | `templates/radar/` |
270
+ | File in, grid work (`mini_app_install`) | `templates/sheets/` |
271
+ | The UI *is* the run (`ctx.agent`) | `templates/runner/` |
272
+ | Named buttons, this machine, no model | `templates/chores/` |
273
+ | Numbers move by themselves | `templates/watch/` |
274
+
275
+ For a plain note **start from the skeleton above**. Product copy follows the host locale.
211
276
 
212
277
  ## Checklist
213
278
 
214
- - [ ] 新建用 `mini_app_register`;改已有用 `mini_app_read` + `mini_app_edit`(或 `write`)
215
- - [ ] `mini_app_reload` 编译通过
216
- - [ ] `mini_app_call` 冒烟通过(不是 curl)
217
- - [ ] `mini_app_open`
218
- - [ ] call api 键;UI fetch / secrets / llm
279
+ - [ ] New app via `mini_app_register`; edits via `mini_app_get` / `mini_app_list_files` + `mini_app_read` + `mini_app_edit` (or `write`)
280
+ - [ ] Started from the closest template(s), lifted patterns/structure rather than pasting whole files
281
+ - [ ] `mini_app_reload` compiles (located the failure by `errors[i]` prefix) and `notices[]` was read
282
+ - [ ] `mini_app_call` smoke test passes (not curl) — batch with `calls: []` instead of N round trips
283
+ - [ ] `mini_app_open`, then `mini_app_errors` **compile green it renders**; do not stop at the build
284
+ - [ ] `mini_app_view_eval` confirms the styling actually applied (no hardcoded hex, no composed class names)
285
+ - [ ] `call` keys ⊆ `api` keys; no fetch / secrets / llm in the UI; compound part names taken from a contract, not memory