@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.
- package/README.md +29 -27
- package/lib/client.js +2024 -783
- package/lib/index.d.ts +2 -0
- package/lib/index.js +20 -7
- package/package.json +10 -9
- package/skills/monkey-mini-app/SKILL.md +181 -114
- package/skills/monkey-mini-app/references/catalog.md +236 -99
- package/skills/monkey-mini-app/references/contracts/accordion.md +30 -0
- package/skills/monkey-mini-app/references/contracts/activity-feed.md +12 -2
- package/skills/monkey-mini-app/references/contracts/alert-dialog.md +38 -0
- package/skills/monkey-mini-app/references/contracts/alert.md +38 -0
- package/skills/monkey-mini-app/references/contracts/app-shell.md +2 -2
- package/skills/monkey-mini-app/references/contracts/aspect-ratio.md +25 -0
- package/skills/monkey-mini-app/references/contracts/attachment-gallery.md +12 -2
- package/skills/monkey-mini-app/references/contracts/attachment.md +35 -0
- package/skills/monkey-mini-app/references/contracts/autocomplete.md +12 -2
- package/skills/monkey-mini-app/references/contracts/avatar.md +24 -0
- package/skills/monkey-mini-app/references/contracts/badge.md +26 -0
- package/skills/monkey-mini-app/references/contracts/breadcrumb.md +33 -0
- package/skills/monkey-mini-app/references/contracts/bubble.md +30 -0
- package/skills/monkey-mini-app/references/contracts/button-group.md +36 -0
- package/skills/monkey-mini-app/references/contracts/button.md +26 -0
- package/skills/monkey-mini-app/references/contracts/calendar.md +20 -0
- package/skills/monkey-mini-app/references/contracts/card.md +41 -0
- package/skills/monkey-mini-app/references/contracts/cascader.md +12 -2
- package/skills/monkey-mini-app/references/contracts/chart.md +32 -0
- package/skills/monkey-mini-app/references/contracts/checkbox.md +19 -0
- package/skills/monkey-mini-app/references/contracts/code-block.md +20 -2
- package/skills/monkey-mini-app/references/contracts/code-editor.md +30 -4
- package/skills/monkey-mini-app/references/contracts/collapsible.md +21 -0
- package/skills/monkey-mini-app/references/contracts/color-picker.md +12 -2
- package/skills/monkey-mini-app/references/contracts/combobox.md +34 -0
- package/skills/monkey-mini-app/references/contracts/command.md +41 -0
- package/skills/monkey-mini-app/references/contracts/comment-thread.md +12 -2
- package/skills/monkey-mini-app/references/contracts/commit-graph.md +50 -0
- package/skills/monkey-mini-app/references/contracts/confirm-dialog.md +20 -2
- package/skills/monkey-mini-app/references/contracts/context-menu.md +41 -0
- package/skills/monkey-mini-app/references/contracts/copyable.md +12 -2
- package/skills/monkey-mini-app/references/contracts/currency-input.md +12 -2
- package/skills/monkey-mini-app/references/contracts/dashboard-shell.md +41 -0
- package/skills/monkey-mini-app/references/contracts/data-grid.md +13 -6
- package/skills/monkey-mini-app/references/contracts/date-picker.md +20 -2
- package/skills/monkey-mini-app/references/contracts/date-range-picker.md +10 -2
- package/skills/monkey-mini-app/references/contracts/date-time-picker.md +20 -2
- package/skills/monkey-mini-app/references/contracts/date-time-range-picker.md +20 -2
- package/skills/monkey-mini-app/references/contracts/description-list.md +12 -2
- package/skills/monkey-mini-app/references/contracts/detail-panel.md +10 -2
- package/skills/monkey-mini-app/references/contracts/dialog.md +44 -0
- package/skills/monkey-mini-app/references/contracts/diff-viewer.md +21 -2
- package/skills/monkey-mini-app/references/contracts/donut-chart.md +12 -2
- package/skills/monkey-mini-app/references/contracts/drawer.md +29 -0
- package/skills/monkey-mini-app/references/contracts/dropdown-menu.md +49 -0
- package/skills/monkey-mini-app/references/contracts/duration-input.md +20 -2
- package/skills/monkey-mini-app/references/contracts/empty.md +40 -0
- package/skills/monkey-mini-app/references/contracts/env-badge.md +12 -2
- package/skills/monkey-mini-app/references/contracts/env-table.md +46 -0
- package/skills/monkey-mini-app/references/contracts/event-calendar.md +28 -20
- package/skills/monkey-mini-app/references/contracts/field.md +34 -0
- package/skills/monkey-mini-app/references/contracts/file-dropzone.md +20 -2
- package/skills/monkey-mini-app/references/contracts/file-tree.md +12 -2
- package/skills/monkey-mini-app/references/contracts/filter-bar.md +2 -2
- package/skills/monkey-mini-app/references/contracts/form-sheet.md +51 -0
- package/skills/monkey-mini-app/references/contracts/gantt.md +20 -2
- package/skills/monkey-mini-app/references/contracts/gauge.md +12 -2
- package/skills/monkey-mini-app/references/contracts/hover-card.md +21 -0
- package/skills/monkey-mini-app/references/contracts/input-group.md +24 -0
- package/skills/monkey-mini-app/references/contracts/input.md +33 -0
- package/skills/monkey-mini-app/references/contracts/item.md +36 -0
- package/skills/monkey-mini-app/references/contracts/jira-wiki.md +3 -4
- package/skills/monkey-mini-app/references/contracts/jql-input.md +15 -8
- package/skills/monkey-mini-app/references/contracts/json-viewer.md +20 -2
- package/skills/monkey-mini-app/references/contracts/kanban-issue-panel.md +12 -2
- package/skills/monkey-mini-app/references/contracts/kanban.md +10 -2
- package/skills/monkey-mini-app/references/contracts/kbd.md +20 -0
- package/skills/monkey-mini-app/references/contracts/label.md +33 -0
- package/skills/monkey-mini-app/references/contracts/list-detail.md +46 -0
- package/skills/monkey-mini-app/references/contracts/log-viewer.md +45 -4
- package/skills/monkey-mini-app/references/contracts/markdown-editor.md +20 -2
- package/skills/monkey-mini-app/references/contracts/markdown.md +12 -2
- package/skills/monkey-mini-app/references/contracts/marker.md +30 -0
- package/skills/monkey-mini-app/references/contracts/menubar.md +34 -0
- package/skills/monkey-mini-app/references/contracts/message-scroller.md +24 -0
- package/skills/monkey-mini-app/references/contracts/message.md +24 -0
- package/skills/monkey-mini-app/references/contracts/mini-calendar.md +20 -2
- package/skills/monkey-mini-app/references/contracts/native-select.md +21 -0
- package/skills/monkey-mini-app/references/contracts/navigation-menu.md +27 -0
- package/skills/monkey-mini-app/references/contracts/notification-center.md +12 -2
- package/skills/monkey-mini-app/references/contracts/number-field.md +20 -2
- package/skills/monkey-mini-app/references/contracts/page-header.md +2 -2
- package/skills/monkey-mini-app/references/contracts/pagination.md +33 -0
- package/skills/monkey-mini-app/references/contracts/password-field.md +12 -2
- package/skills/monkey-mini-app/references/contracts/phone-input.md +12 -2
- package/skills/monkey-mini-app/references/contracts/popover.md +32 -0
- package/skills/monkey-mini-app/references/contracts/progress-ring.md +12 -2
- package/skills/monkey-mini-app/references/contracts/progress.md +39 -0
- package/skills/monkey-mini-app/references/contracts/questionnaire.md +33 -0
- package/skills/monkey-mini-app/references/contracts/radar-chart.md +12 -2
- package/skills/monkey-mini-app/references/contracts/radio-group.md +20 -0
- package/skills/monkey-mini-app/references/contracts/rating.md +12 -2
- package/skills/monkey-mini-app/references/contracts/relative-date-picker.md +20 -2
- package/skills/monkey-mini-app/references/contracts/request-inspector.md +12 -2
- package/skills/monkey-mini-app/references/contracts/resizable.md +29 -0
- package/skills/monkey-mini-app/references/contracts/reveal.md +31 -0
- package/skills/monkey-mini-app/references/contracts/rich-text-editor.md +14 -2
- package/skills/monkey-mini-app/references/contracts/run-timeline.md +20 -2
- package/skills/monkey-mini-app/references/contracts/scroll-area.md +20 -0
- package/skills/monkey-mini-app/references/contracts/scrollspy.md +20 -2
- package/skills/monkey-mini-app/references/contracts/search-input.md +12 -2
- package/skills/monkey-mini-app/references/contracts/select.md +36 -0
- package/skills/monkey-mini-app/references/contracts/separator.md +27 -0
- package/skills/monkey-mini-app/references/contracts/settings-split.md +53 -0
- package/skills/monkey-mini-app/references/contracts/severity-chip.md +12 -2
- package/skills/monkey-mini-app/references/contracts/sheet.md +34 -0
- package/skills/monkey-mini-app/references/contracts/sidebar.md +42 -0
- package/skills/monkey-mini-app/references/contracts/skeleton.md +33 -0
- package/skills/monkey-mini-app/references/contracts/slider-range.md +12 -2
- package/skills/monkey-mini-app/references/contracts/slider.md +25 -0
- package/skills/monkey-mini-app/references/contracts/sortable-list.md +20 -2
- package/skills/monkey-mini-app/references/contracts/sparkline.md +12 -2
- package/skills/monkey-mini-app/references/contracts/spinner.md +31 -0
- package/skills/monkey-mini-app/references/contracts/stacked-bar-chart.md +16 -2
- package/skills/monkey-mini-app/references/contracts/stat-card.md +2 -2
- package/skills/monkey-mini-app/references/contracts/status-badge.md +2 -2
- package/skills/monkey-mini-app/references/contracts/stepper-item.md +39 -0
- package/skills/monkey-mini-app/references/contracts/stepper.md +38 -11
- package/skills/monkey-mini-app/references/contracts/switch.md +25 -0
- package/skills/monkey-mini-app/references/contracts/table-page.md +41 -0
- package/skills/monkey-mini-app/references/contracts/table.md +42 -0
- package/skills/monkey-mini-app/references/contracts/tabs.md +31 -0
- package/skills/monkey-mini-app/references/contracts/tag-input.md +12 -2
- package/skills/monkey-mini-app/references/contracts/terminal.md +13 -2
- package/skills/monkey-mini-app/references/contracts/test-step-list.md +12 -2
- package/skills/monkey-mini-app/references/contracts/textarea.md +25 -0
- package/skills/monkey-mini-app/references/contracts/time-picker.md +18 -2
- package/skills/monkey-mini-app/references/contracts/time-range-picker.md +20 -2
- package/skills/monkey-mini-app/references/contracts/time-wheel.md +6 -2
- package/skills/monkey-mini-app/references/contracts/timeline.md +20 -2
- package/skills/monkey-mini-app/references/contracts/timezone-select.md +20 -2
- package/skills/monkey-mini-app/references/contracts/toast.md +39 -0
- package/skills/monkey-mini-app/references/contracts/toggle-group.md +28 -0
- package/skills/monkey-mini-app/references/contracts/toggle.md +26 -0
- package/skills/monkey-mini-app/references/contracts/tooltip.md +30 -0
- package/skills/monkey-mini-app/references/contracts/transfer.md +12 -2
- package/skills/monkey-mini-app/references/contracts/tree-view.md +20 -2
- package/skills/monkey-mini-app/references/contracts/trend-card.md +12 -2
- package/skills/monkey-mini-app/references/contracts/user-picker.md +12 -2
- package/skills/monkey-mini-app/references/contracts/wizard-shell.md +56 -0
- package/skills/monkey-mini-app/references/ctx.md +123 -53
- package/skills/monkey-mini-app/references/eval.md +115 -0
- package/skills/monkey-mini-app/references/examples/alert/alert-01.tsx +17 -0
- package/skills/monkey-mini-app/references/examples/aspect-ratio/aspect-ratio-01.tsx +16 -0
- package/skills/monkey-mini-app/references/examples/attachment/attachment-01.tsx +19 -0
- package/skills/monkey-mini-app/references/examples/breadcrumb/breadcrumb-01.tsx +31 -0
- package/skills/monkey-mini-app/references/examples/bubble/bubble-01.tsx +16 -0
- package/skills/monkey-mini-app/references/examples/button-group/button-group-01.tsx +23 -0
- package/skills/monkey-mini-app/references/examples/card/card-01.tsx +19 -0
- package/skills/monkey-mini-app/references/examples/charts-blocks.md +15 -0
- package/skills/monkey-mini-app/references/examples/code-block/code-block-01.tsx +14 -0
- package/skills/monkey-mini-app/references/examples/code-editor/code-editor-01.tsx +15 -0
- package/skills/monkey-mini-app/references/examples/command/command-01.tsx +30 -0
- package/skills/monkey-mini-app/references/examples/confirm-dialog/confirm-dialog-01.tsx +33 -0
- package/skills/monkey-mini-app/references/examples/context-menu/context-menu-01.tsx +29 -0
- package/skills/monkey-mini-app/references/examples/dashboard-shell/dashboard-shell-01.tsx +78 -0
- package/skills/monkey-mini-app/references/examples/data-grid/data-grid-01.tsx +34 -0
- package/skills/monkey-mini-app/references/examples/data-grid/data-grid-02.tsx +88 -0
- package/skills/monkey-mini-app/references/examples/date-picker/date-picker-01.tsx +14 -0
- package/skills/monkey-mini-app/references/examples/date-range-picker/date-range-picker-01.tsx +14 -0
- package/skills/monkey-mini-app/references/examples/date-time-picker/date-time-picker-01.tsx +16 -0
- package/skills/monkey-mini-app/references/examples/date-time-range-picker/date-time-range-picker-01.tsx +15 -0
- package/skills/monkey-mini-app/references/examples/detail-panel/detail-panel-01.tsx +21 -0
- package/skills/monkey-mini-app/references/examples/dialog/dialog-01.tsx +30 -0
- package/skills/monkey-mini-app/references/examples/diff-viewer/diff-viewer-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/dropdown-menu/dropdown-menu-01.tsx +31 -0
- package/skills/monkey-mini-app/references/examples/duration-input/duration-input-01.tsx +20 -0
- package/skills/monkey-mini-app/references/examples/editors.md +11 -0
- package/skills/monkey-mini-app/references/examples/empty/empty-01.tsx +19 -0
- package/skills/monkey-mini-app/references/examples/event-calendar/event-calendar-01.tsx +53 -0
- package/skills/monkey-mini-app/references/examples/file-dropzone/file-dropzone-01.tsx +14 -0
- package/skills/monkey-mini-app/references/examples/form-sheet/form-sheet-01.tsx +85 -0
- package/skills/monkey-mini-app/references/examples/forms.md +16 -0
- package/skills/monkey-mini-app/references/examples/gantt/gantt-01.tsx +29 -0
- package/skills/monkey-mini-app/references/examples/input/input-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/item/item-01.tsx +19 -0
- package/skills/monkey-mini-app/references/examples/jql-input/jql-input-01.tsx +33 -0
- package/skills/monkey-mini-app/references/examples/json-viewer/json-viewer-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/kanban/kanban-01.tsx +60 -0
- package/skills/monkey-mini-app/references/examples/label/label-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/list-detail/list-detail-01.tsx +117 -0
- package/skills/monkey-mini-app/references/examples/log-viewer/log-viewer-01.tsx +20 -0
- package/skills/monkey-mini-app/references/examples/markdown-editor/markdown-editor-01.tsx +18 -0
- package/skills/monkey-mini-app/references/examples/marker/marker-01.tsx +16 -0
- package/skills/monkey-mini-app/references/examples/mini-calendar/mini-calendar-01.tsx +14 -0
- package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-01.tsx +20 -0
- package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-02.tsx +32 -0
- package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-03.tsx +47 -0
- package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-04.tsx +20 -0
- package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-05.tsx +24 -0
- package/skills/monkey-mini-app/references/examples/misc-charts-blocks/misc-charts-blocks-06.tsx +89 -0
- package/skills/monkey-mini-app/references/examples/misc-editors/misc-editors-01.tsx +114 -0
- package/skills/monkey-mini-app/references/examples/misc-editors/misc-editors-02.tsx +33 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-01.tsx +22 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-02.tsx +37 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-03.tsx +42 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-04.tsx +25 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-05.tsx +27 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-06.tsx +33 -0
- package/skills/monkey-mini-app/references/examples/misc-forms/misc-forms-07.tsx +44 -0
- package/skills/monkey-mini-app/references/examples/misc-overlays/misc-overlays-01.tsx +43 -0
- package/skills/monkey-mini-app/references/examples/misc-overlays/misc-overlays-02.tsx +38 -0
- package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-01.tsx +21 -0
- package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-02.tsx +52 -0
- package/skills/monkey-mini-app/references/examples/misc-primitives/misc-primitives-03.tsx +44 -0
- package/skills/monkey-mini-app/references/examples/number-field/number-field-01.tsx +22 -0
- package/skills/monkey-mini-app/references/examples/overlays.md +11 -0
- package/skills/monkey-mini-app/references/examples/pagination/pagination-01.tsx +51 -0
- package/skills/monkey-mini-app/references/examples/primitives.md +12 -0
- package/skills/monkey-mini-app/references/examples/progress/progress-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/relative-date-picker/relative-date-picker-01.tsx +19 -0
- package/skills/monkey-mini-app/references/examples/rich-text-editor/rich-text-editor-01.tsx +15 -0
- package/skills/monkey-mini-app/references/examples/run-timeline/run-timeline-01.tsx +17 -0
- package/skills/monkey-mini-app/references/examples/scrollspy/scrollspy-01.tsx +29 -0
- package/skills/monkey-mini-app/references/examples/separator/separator-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/settings-split/settings-split-01.tsx +84 -0
- package/skills/monkey-mini-app/references/examples/shared/jira-wiki-sample.ts +38 -0
- package/skills/monkey-mini-app/references/examples/skeleton/skeleton-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/slider/slider-01.tsx +22 -0
- package/skills/monkey-mini-app/references/examples/sortable-list/sortable-list-01.tsx +18 -0
- package/skills/monkey-mini-app/references/examples/spinner/spinner-01.tsx +10 -0
- package/skills/monkey-mini-app/references/examples/stepper/stepper-01.tsx +41 -0
- package/skills/monkey-mini-app/references/examples/table/table-01.tsx +25 -0
- package/skills/monkey-mini-app/references/examples/table-page/table-page-01.tsx +103 -0
- package/skills/monkey-mini-app/references/examples/time-picker/time-picker-01.tsx +19 -0
- package/skills/monkey-mini-app/references/examples/time-range-picker/time-range-picker-01.tsx +14 -0
- package/skills/monkey-mini-app/references/examples/timeline/timeline-01.tsx +18 -0
- package/skills/monkey-mini-app/references/examples/timezone-select/timezone-select-01.tsx +15 -0
- package/skills/monkey-mini-app/references/examples/toggle/toggle-01.tsx +20 -0
- package/skills/monkey-mini-app/references/examples/toggle-group/toggle-group-01.tsx +22 -0
- package/skills/monkey-mini-app/references/examples/tree-view/tree-view-01.tsx +25 -0
- package/skills/monkey-mini-app/references/examples/wizard-shell/wizard-shell-01.tsx +58 -0
- package/skills/monkey-mini-app/references/history.md +23 -7
- package/skills/monkey-mini-app/references/icons.md +99 -69
- package/skills/monkey-mini-app/references/llm-json.md +39 -26
- package/skills/monkey-mini-app/references/loader.md +47 -20
- package/skills/monkey-mini-app/references/looks/aurora-bento.md +88 -0
- package/skills/monkey-mini-app/references/looks/desk-split.md +89 -0
- package/skills/monkey-mini-app/references/looks/editorial.md +78 -0
- package/skills/monkey-mini-app/references/looks/glass-island.md +90 -0
- package/skills/monkey-mini-app/references/looks/index.md +18 -0
- package/skills/monkey-mini-app/references/looks/signage.md +74 -0
- package/skills/monkey-mini-app/references/looks/tape.md +22 -0
- package/skills/monkey-mini-app/references/looks/terminal.md +88 -0
- package/skills/monkey-mini-app/references/looks/void.md +22 -0
- package/skills/monkey-mini-app/references/styling.md +189 -0
- package/skills/monkey-mini-app/references/test.md +12 -12
- package/skills/monkey-mini-app/references/theme.md +197 -0
- package/skills/monkey-mini-app/references/tools.md +12 -12
- package/skills/monkey-mini-app/references/troubleshoot.md +165 -12
- package/skills/monkey-mini-app/templates/README.md +33 -21
- package/skills/monkey-mini-app/templates/{jira → board}/main.api.ts +11 -11
- package/skills/monkey-mini-app/templates/board/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/board/theme.css +46 -0
- package/skills/monkey-mini-app/templates/board/ui.tsx +546 -0
- package/skills/monkey-mini-app/templates/chores/main.api.ts +35 -0
- package/skills/monkey-mini-app/templates/chores/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/chores/theme.css +46 -0
- package/skills/monkey-mini-app/templates/chores/ui.tsx +117 -0
- package/skills/monkey-mini-app/templates/minimal/main.api.ts +5 -5
- package/skills/monkey-mini-app/templates/minimal/manifest.json +1 -2
- package/skills/monkey-mini-app/templates/minimal/ui.tsx +17 -8
- package/skills/monkey-mini-app/templates/radar/api/scan.ts +79 -0
- package/skills/monkey-mini-app/templates/radar/main.api.ts +29 -0
- package/skills/monkey-mini-app/templates/radar/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/radar/shared/events.ts +25 -0
- package/skills/monkey-mini-app/templates/{insights/lib → radar/shared}/sample.ts +1 -1
- package/skills/monkey-mini-app/templates/radar/theme.css +47 -0
- package/skills/monkey-mini-app/templates/radar/ui/brief.tsx +31 -0
- package/skills/monkey-mini-app/templates/radar/ui.tsx +131 -0
- package/skills/monkey-mini-app/templates/runner/main.api.ts +91 -0
- package/skills/monkey-mini-app/templates/runner/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/runner/shared/events.ts +14 -0
- package/skills/monkey-mini-app/templates/runner/theme.css +46 -0
- package/skills/monkey-mini-app/templates/runner/ui.tsx +213 -0
- package/skills/monkey-mini-app/templates/sheets/main.api.ts +276 -0
- package/skills/monkey-mini-app/templates/sheets/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/sheets/theme.css +46 -0
- package/skills/monkey-mini-app/templates/sheets/ui.tsx +419 -0
- package/skills/monkey-mini-app/templates/{todo → today}/main.api.ts +8 -8
- package/skills/monkey-mini-app/templates/today/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/today/theme.css +45 -0
- package/skills/monkey-mini-app/templates/today/ui/item-row.tsx +25 -0
- package/skills/monkey-mini-app/templates/today/ui.tsx +406 -0
- package/skills/monkey-mini-app/templates/{monitor → watch}/main.api.ts +8 -8
- package/skills/monkey-mini-app/templates/watch/manifest.json +8 -0
- package/skills/monkey-mini-app/templates/watch/ui.tsx +187 -0
- package/skills/monkey-mini-app/tsconfig.json +31 -0
- package/skills/monkey-mini-app/types/cdn.d.ts +1 -0
- package/tsup.config.ts +1 -0
- package/skills/monkey-mini-app/templates/agentrun/main.api.ts +0 -78
- package/skills/monkey-mini-app/templates/agentrun/manifest.json +0 -9
- package/skills/monkey-mini-app/templates/agentrun/ui.tsx +0 -125
- package/skills/monkey-mini-app/templates/insights/main.api.ts +0 -101
- package/skills/monkey-mini-app/templates/insights/manifest.json +0 -9
- package/skills/monkey-mini-app/templates/insights/ui.tsx +0 -138
- package/skills/monkey-mini-app/templates/jira/manifest.json +0 -9
- package/skills/monkey-mini-app/templates/jira/ui.tsx +0 -318
- package/skills/monkey-mini-app/templates/monitor/manifest.json +0 -9
- package/skills/monkey-mini-app/templates/monitor/ui.tsx +0 -176
- package/skills/monkey-mini-app/templates/review/main.api.ts +0 -68
- package/skills/monkey-mini-app/templates/review/manifest.json +0 -9
- package/skills/monkey-mini-app/templates/review/ui.tsx +0 -159
- package/skills/monkey-mini-app/templates/todo/manifest.json +0 -8
- 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
|
-
|
|
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(
|
|
1051
|
-
|
|
1052
|
-
|
|
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.
|
|
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
|
-
"
|
|
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.
|
|
56
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
57
|
-
"@deepseek-ai/dsh-subagent": "0.1.
|
|
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": "
|
|
60
|
-
"@monkey-mini-app/panel": "
|
|
61
|
-
"@monkey-mini-app/ui": "
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14
|
+
## How files reach disk
|
|
15
15
|
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
"
|
|
28
|
-
"
|
|
44
|
+
"ui/Card.tsx": "...",
|
|
45
|
+
"api/parse.ts": "...",
|
|
46
|
+
"shared/format.ts": "..."
|
|
29
47
|
}
|
|
30
48
|
})
|
|
31
49
|
```
|
|
32
50
|
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
52
|
-
- **删文件** → `mini_app_delete({ appId, path })`(不能删 `manifest.json`)
|
|
53
|
-
- mutate 默认 **auto-commit**;设 `commit: false` 可攒改动
|
|
61
|
+
Error prefixes:
|
|
54
62
|
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
97
|
+
More symptoms → [references/troubleshoot.md](references/troubleshoot.md).
|
|
69
98
|
|
|
70
|
-
##
|
|
99
|
+
## Protocol
|
|
71
100
|
|
|
72
|
-
- UI
|
|
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
|
-
|
|
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
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
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
|
-
|
|
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 {
|
|
97
|
-
import { Button, Input, Card, CardContent, CardHeader, CardTitle
|
|
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 } =
|
|
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
|
|
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 }); }}
|
|
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
|
-
-
|
|
117
|
-
- **`
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
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
|
-
|
|
|
126
|
-
| KPI
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
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
|
-
"
|
|
149
|
-
"acronym": "MC"
|
|
197
|
+
"acronym": "MA"
|
|
150
198
|
}
|
|
151
199
|
```
|
|
152
200
|
|
|
153
|
-
|
|
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 {
|
|
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
|
|
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
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
- [ ]
|
|
215
|
-
- [ ]
|
|
216
|
-
- [ ] `
|
|
217
|
-
- [ ] `
|
|
218
|
-
- [ ]
|
|
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
|