@monkey-mini-app/dsh-mini-app 0.1.0 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/assets/apps-list.png +0 -0
- package/assets/complex-demo-app.png +0 -0
- package/assets/demo-app.png +0 -0
- package/assets/home.png +0 -0
- package/assets/sidebar-mode.png +0 -0
- package/lib/client.js +2024 -783
- package/lib/index.d.ts +5 -2
- package/lib/index.js +29 -16
- package/package.json +12 -10
- package/skills/monkey-mini-app/SKILL.md +182 -106
- 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 +14 -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 +14 -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 +14 -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 +14 -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 +13 -2
- package/skills/monkey-mini-app/references/contracts/spinner.md +31 -0
- package/skills/monkey-mini-app/references/contracts/stacked-bar-chart.md +17 -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
|
@@ -1,35 +1,98 @@
|
|
|
1
1
|
# RunContext `ctx`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Every `api.*` method (`defineApp({ api })` keys) receives the same `ctx`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Always available
|
|
6
6
|
|
|
7
|
-
| API |
|
|
8
|
-
|
|
9
|
-
| `ctx.appId` | string |
|
|
10
|
-
| `ctx.appDir` | string |
|
|
11
|
-
| `ctx.storage.get(key)` | value
|
|
12
|
-
| `ctx.storage.set(key, value)` | | JSON
|
|
7
|
+
| API | Returns | Notes |
|
|
8
|
+
|-----|---------|-------|
|
|
9
|
+
| `ctx.appId` | string | Reverse-DNS id of the running mini-app |
|
|
10
|
+
| `ctx.appDir` | string | Absolute directory of this app (`runtime/apps/<appId>`) |
|
|
11
|
+
| `ctx.storage.get(key)` | value or `null` | Backed by `storage/main.storage.json` |
|
|
12
|
+
| `ctx.storage.set(key, value)` | | Value must be JSON-serialisable |
|
|
13
13
|
| `ctx.storage.delete` / `clear` | | |
|
|
14
|
-
| `ctx.storage.table(name)` |
|
|
15
|
-
| `ctx.
|
|
16
|
-
| `ctx.
|
|
17
|
-
| `ctx.
|
|
14
|
+
| `ctx.storage.table(name)` | same API | Independent table in the same app (`{name}.storage.json`); `name` = `[A-Za-z0-9_-]` |
|
|
15
|
+
| `ctx.storage.bytes()` | number | Bytes this table occupies — for your own "is this getting big" logging |
|
|
16
|
+
| `ctx.state` | object | In-memory; the same reference as `defineApp.state` |
|
|
17
|
+
| `ctx.config` | `{ theme, palette, chatLanguage, hostPort, llm }` | This host's own settings only (settings page / top bar), **not** a dsh settings dump. `theme` = `light`\|`dark`\|`system` (a *preference* — resolve `system` yourself if you need a concrete mode); `palette` = `default`\|`ocean`\|`violet`\|`slate` |
|
|
18
|
+
| `ctx.credentials` | `Record<string,string>` | Secrets **supplied by the host** — a mini-app cannot declare them. `{}` when the host has no credential service: read by key, show a usable empty state when missing, never invent key names |
|
|
18
19
|
| `ctx.log(...args)` | | console |
|
|
19
|
-
| `ctx.signal` | AbortSignal
|
|
20
|
-
| `ctx.push(
|
|
21
|
-
| `ctx.system.metrics()` | os
|
|
20
|
+
| `ctx.signal` | AbortSignal or undefined | Cancel signal for the current call (aborted when the user hits "stop"). In long jobs check `if (ctx.signal?.aborted) throw new Error("cancelled")` between batches/loops and pass it to `sleep` too |
|
|
21
|
+
| `ctx.push(name, params)` | SSE to this app's UI | Live channel for `useApp().on(name, cb)`. Fire-and-forget, never throws; `params` must be JSON-serialisable. Host keeps the last 200 events **per app**, so a reconnecting or later-opened UI replays them (`Last-Event-ID`) |
|
|
22
|
+
| `ctx.system.metrics()` | os snapshot | |
|
|
22
23
|
|
|
23
|
-
##
|
|
24
|
+
## Typed events
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
`ctx.push("stage", …)` and `useApp().on("stage", …)` are joined by a **string**, and no type can
|
|
27
|
+
cross the seam: `ui.tsx` may not import `main.api.ts` (AGENTS.md → Hard constraints 1), so the
|
|
28
|
+
compiler cannot see that the two names must agree. A typo produces an app that renders perfectly
|
|
29
|
+
and never updates.
|
|
30
|
+
|
|
31
|
+
Declare the names once in `shared/` — the one tree both sides may import — and let the literal be
|
|
32
|
+
the source of truth:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// shared/events.ts (pure isomorphic: no React, no ctx, no DOM)
|
|
36
|
+
export const EV = {
|
|
37
|
+
progress: "progress",
|
|
38
|
+
latest: "latest",
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
export type Events = {
|
|
42
|
+
progress: { running: boolean; step: string; done: number; total: number; error?: string };
|
|
43
|
+
latest: { items: { title: string }[]; digest: { headline: string; bullets: string[] } | null; at: number };
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type Progress = Events["progress"];
|
|
47
|
+
export type Payload = Events["latest"];
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
// api/scan.ts (or main.api.ts)
|
|
52
|
+
import { EV, type Progress } from "../shared/events";
|
|
53
|
+
const next: Progress = { running: true, step: "fetch", done: 1, total: 3 };
|
|
54
|
+
ctx.push(EV.progress, next);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
// ui.tsx
|
|
59
|
+
import { EV, type Progress } from "./shared/events";
|
|
60
|
+
const { on } = useApp();
|
|
61
|
+
useEffect(() => on(EV.progress, (p) => setProgress(p as Progress)), [on]);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Rename `EV.progress` once — both sides move. The `Events` map is the payload contract.
|
|
65
|
+
Worked example: `templates/radar/shared/events.ts`. `mini_app_reload` still notices a leftover
|
|
66
|
+
string literal that nothing pushes (`"stga"`); names that go through `EV.*` are the source of truth.
|
|
67
|
+
|
|
68
|
+
## Choosing a table
|
|
69
|
+
|
|
70
|
+
Tables are independent namespaces over the same API: `ctx.storage.table("reads")` gives you a table
|
|
71
|
+
whose keys cannot collide with the default one. There is no `keys()`, no enumeration and no query —
|
|
72
|
+
every method addresses exactly one key. Each table is one JSON file; every `set` rewrites that file,
|
|
73
|
+
so **what shares a table is a real cost**, not just a naming preference:
|
|
74
|
+
|
|
75
|
+
| Data | Put it in |
|
|
76
|
+
|---|---|
|
|
77
|
+
| A handful of settings (source list, thresholds, UI prefs) | default `ctx.storage` — small, and you read it whole anyway |
|
|
78
|
+
| Anything that **grows**: fetched article bodies, run logs, activity, per-day records, snapshots | its own `ctx.storage.table("reads")` |
|
|
79
|
+
| Both of the above in one app | two tables — otherwise your settings rewrite rides along with every log line |
|
|
80
|
+
|
|
81
|
+
Large lists should be **one key per row** (`await rows.set(id, row)`), not one giant array under a
|
|
82
|
+
single key. `ctx.storage.bytes()` answers "how big is this table right now". Past roughly 512 KB the
|
|
83
|
+
host surfaces a **panel banner** (writes are never blocked) with the heaviest keys and a copy-paste
|
|
84
|
+
prompt you can hand to an agent to do the split.
|
|
85
|
+
|
|
86
|
+
## Host capabilities
|
|
87
|
+
|
|
88
|
+
| API | Signature | Returns | Fallback | Failure |
|
|
89
|
+
|-----|-----------|---------|----------|---------|
|
|
90
|
+
| `http(url)` / `http(url, opts)` | opts: `method?` `headers?` `query?` `body?` `timeout?` (default 8s). Automatically combines `ctx.signal` (stop aborts the request) | `{ ok, status, headers, text, json }`. `json` is set only when Content-Type contains json **and** parsing succeeds, else `null`. HTTP 4xx/5xx **do not throw** — check `ok`/`status`. http/https only | Node `fetch` | `http: timeout` / `http: only http/https` / `http: response too large` / `http: …` |
|
|
91
|
+
| `bash(command)` | string | `{ stdout, stderr, exitCode }` | Local `bash -c`, 120s/8MB → dsh `shell.run`. For machine commands; **do not** shell out to `curl` | `bash unavailable` |
|
|
92
|
+
| `tool(name, args)` | args is a **plain object**, never `{input}` | **string** | dsh tools | error containing `tool:` when the host exposes no tool service |
|
|
93
|
+
| `mcp(name, args?)` | no `mcp_` prefix | string | tries `tool(name)` then `tool("mcp__"+name)`. dsh registers `mcp__<server>__<tool>`, e.g. `ctx.mcp("everything__echo", { message: "hi" })` | first-attempt error |
|
|
94
|
+
| `llm(prompt, opts?)` | see **ModelCallOptions** below | **string** | dsh `llm.stream` | `llm: no dsh model service` / `llm stream empty` |
|
|
95
|
+
| `agent(goal, opts?)` | **ModelCallOptions** + `onEvent?` (below) | **string** | dsh one-shot agent (isolated from the chat session); may loop over tools. Do not fake an agent with repeated `ctx.llm` calls | `agent: … unbound` / `empty result` / `cancelled` |
|
|
33
96
|
|
|
34
97
|
```ts
|
|
35
98
|
const r = await ctx.http("https://example.com/api", {
|
|
@@ -42,18 +105,19 @@ if (!r.ok) throw new Error("HTTP " + r.status);
|
|
|
42
105
|
const data = r.json ?? JSON.parse(r.text);
|
|
43
106
|
```
|
|
44
107
|
|
|
45
|
-
POST
|
|
108
|
+
POST: `ctx.http(url, { method: "POST", body: { a: 1 } })` (objects are JSON-encoded). For RSS/HTML use `r.text`.
|
|
46
109
|
|
|
47
|
-
### ModelCallOptions
|
|
110
|
+
### ModelCallOptions (shared minimum for `llm` / `agent`)
|
|
48
111
|
|
|
49
112
|
```ts
|
|
50
113
|
type ModelCallOptions = {
|
|
51
|
-
provider?: string; //
|
|
114
|
+
provider?: string; // defaults to the host's current model; usually omitted
|
|
52
115
|
model?: string;
|
|
53
116
|
system?: string;
|
|
54
|
-
schema?: object; // JSON Schema
|
|
55
|
-
maxTokens?: number;
|
|
56
|
-
|
|
117
|
+
schema?: object; // JSON Schema — use it when you need an object, then JSON.parse the result
|
|
118
|
+
maxTokens?: number; // host default 4096 when unset — raise it for wide arrays
|
|
119
|
+
retryTimes?: number; // attempts IN TOTAL (1 = no retry); llm default 3, agent default 1
|
|
120
|
+
signal?: AbortSignal; // ctx.signal already exists inside an api call, so this is optional
|
|
57
121
|
};
|
|
58
122
|
|
|
59
123
|
// llm
|
|
@@ -66,23 +130,29 @@ await ctx.agent(goal, opts?: ModelCallOptions & {
|
|
|
66
130
|
onEvent?: (ev: AgentEvent) => void;
|
|
67
131
|
/**
|
|
68
132
|
* Working dir mode (default "process").
|
|
69
|
-
* app =
|
|
70
|
-
*
|
|
133
|
+
* app = this mini-app's directory; process = host start dir; temp = temp dir; custom = absolute cwd.
|
|
134
|
+
* Passing only a cwd path implies custom. cwd + a non-custom cwdType is an error.
|
|
71
135
|
*/
|
|
72
136
|
cwdType?: "app" | "process" | "temp" | "custom";
|
|
73
|
-
cwd?: string; //
|
|
137
|
+
cwd?: string; // absolute path; required for custom
|
|
74
138
|
}): Promise<string>
|
|
75
139
|
```
|
|
76
140
|
|
|
77
|
-
|
|
141
|
+
Routing: `opts.provider/model` → host `agent-default-model` → `deepseek-official` / `deepseek-v4-flash`. No `host.json` edit needed.
|
|
78
142
|
|
|
79
|
-
### `opts.schema
|
|
143
|
+
### `opts.schema` (llm + agent)
|
|
80
144
|
|
|
81
|
-
|
|
145
|
+
A soft "reply with JSON only" constraint plus fence stripping — **the return value is still a string**, you `JSON.parse` it. Examples → [llm-json.md](llm-json.md). Keep the prompt short: state the task, push the constraints into `schema`.
|
|
82
146
|
|
|
83
|
-
### `opts.onEvent
|
|
147
|
+
### `opts.onEvent` (agent only) — full event shapes
|
|
84
148
|
|
|
85
|
-
|
|
149
|
+
The return value is still the final string; `onEvent` only observes the run. To show progress in the UI pass
|
|
150
|
+
`streamTo: "agent"` — the host mirrors every event as `ctx.push("agent", event)`:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
await ctx.agent(goal, { streamTo: "agent", maxIterations: 12 });
|
|
154
|
+
// UI: on("agent", (ev) => …) — see templates/runner
|
|
155
|
+
```
|
|
86
156
|
|
|
87
157
|
```ts
|
|
88
158
|
type AgentEvent =
|
|
@@ -91,37 +161,37 @@ type AgentEvent =
|
|
|
91
161
|
| { type: "tool"; phase: "start" | "end"; name: string; args?: unknown; result?: unknown }
|
|
92
162
|
| { type: "turn"; phase: "start"; turn: number }
|
|
93
163
|
| { type: "turn"; phase: "end"; turn: number; reason?: { kind: string; error?: unknown; reason?: unknown } }
|
|
94
|
-
// reason.kind
|
|
164
|
+
// common reason.kind: completed | blocked | error | aborted | max-tokens
|
|
95
165
|
| { type: "error"; message: string }
|
|
96
166
|
| { type: "done"; text: string };
|
|
97
167
|
|
|
98
168
|
const trace = [];
|
|
99
|
-
const text = await ctx.agent("
|
|
169
|
+
const text = await ctx.agent("Summarise the material into insights", {
|
|
100
170
|
schema: { type: "object", properties: { summary: { type: "string" } }, required: ["summary"] },
|
|
101
171
|
onEvent: (ev) => {
|
|
102
172
|
trace.push(ev);
|
|
103
|
-
|
|
173
|
+
ctx.push("agentEvent", ev); // live to the UI; do NOT persist per event — that rewrites the
|
|
174
|
+
// whole file once per step, for a buffer nobody reads mid-run
|
|
104
175
|
},
|
|
105
176
|
});
|
|
106
177
|
const insight = JSON.parse(text);
|
|
107
178
|
```
|
|
108
179
|
|
|
109
|
-
`ctx.agent`
|
|
110
|
-
|
|
180
|
+
`ctx.agent` is isolated from the user's chat session (ephemeral, disposed when it finishes).
|
|
111
181
|
|
|
112
|
-
##
|
|
182
|
+
## Listing live tools
|
|
113
183
|
|
|
114
|
-
|
|
184
|
+
Call the chat tool `mini_app_list_ctx_tools` **only when `main.api.ts` will actually use `ctx.tool`**. Skip it for storage / http / bash / llm-only apps.
|
|
115
185
|
|
|
116
|
-
|
|
186
|
+
The backend can also call `ctx.listTools()`. Never assume `read` / `write` / `bash` exist or that their parameter names are stable.
|
|
117
187
|
|
|
118
|
-
##
|
|
188
|
+
## Long jobs: sample and honour cancellation
|
|
119
189
|
|
|
120
|
-
|
|
190
|
+
Multi-source fetch × LLM analysis — **do not run it in full**:
|
|
121
191
|
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
192
|
+
- **Sample the flow end to end**: of 10 RSS feeds take 2 representative sources; of N batches run 1 (e.g. the hottest 16–24 items) to prove the whole path; fall back to heuristics for the rest. Tell the user "sample first, full run is a switch away".
|
|
193
|
+
- **Hard batch cap**: limit LLM batches (e.g. `MAX_BATCHES = 2`) so one call never runs ten minutes.
|
|
194
|
+
- **Always honour cancellation**:
|
|
125
195
|
```ts
|
|
126
196
|
async function sleep(ms: number, signal?: AbortSignal) {
|
|
127
197
|
return new Promise((resolve) => {
|
|
@@ -130,8 +200,8 @@ const insight = JSON.parse(text);
|
|
|
130
200
|
signal?.addEventListener("abort", () => { clearTimeout(t); resolve(); }, { once: true });
|
|
131
201
|
});
|
|
132
202
|
}
|
|
133
|
-
//
|
|
203
|
+
// between batches
|
|
134
204
|
if (ctx.signal?.aborted) throw new Error("cancelled");
|
|
135
205
|
await sleep(400, ctx.signal);
|
|
136
206
|
```
|
|
137
|
-
-
|
|
207
|
+
- **Async progress**: `ctx.push(name, payload)` from the background job; the UI fetches one snapshot on mount (`runStatus`) and then applies pushed events — do **not** `setInterval` a status method. Keep writing the snapshot to storage as well, so an app opened cold still shows the last state. Buffer is 200/app: if the UI sees an `app:gap` (`onAny` receives `{ name: "*", data: { gap: true } }`), refetch the snapshot.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Asking the rendered view (`mini_app_view_eval`)
|
|
2
|
+
|
|
3
|
+
`mini_app_errors` tells you an app crashed. This tells you **what it drew** — which is the
|
|
4
|
+
question left over once the build is green and the panel shows something, just not the thing
|
|
5
|
+
you meant.
|
|
6
|
+
|
|
7
|
+
You send JavaScript; it runs inside the app's rendered iframe; you get text back. Nothing is
|
|
8
|
+
pre-decided about what to look at, so there is no "the tool doesn't support that" case.
|
|
9
|
+
|
|
10
|
+
## When to ask, and when not to
|
|
11
|
+
|
|
12
|
+
| Situation | Do this instead |
|
|
13
|
+
|---|---|
|
|
14
|
+
| It compiled and the panel is blank / errored | `mini_app_errors` — cheaper, and a crash is already reported to you |
|
|
15
|
+
| "Did this Tailwind class / theme token actually apply?" | ask the view (below) |
|
|
16
|
+
| "Is this node zero-size / hidden / not in the tree?" | ask the view |
|
|
17
|
+
| "Is this centred? Does it look good?" | **do not ask the view** — there are no pixels here. Describe the change and let the user judge |
|
|
18
|
+
| Backend returned the wrong thing | `mini_app_call` — no browser involved |
|
|
19
|
+
|
|
20
|
+
It needs a **live iframe**: `mini_app_open({ appId })` first. If nothing is rendering the app
|
|
21
|
+
you get `view: "not-open"`, not an empty answer.
|
|
22
|
+
|
|
23
|
+
Every query runs on a budget: `timeoutMs` (default 1500, capped at 8000), echoed back as
|
|
24
|
+
`budgetMs` so a near-miss is visible. If it expires, the host asks your view a trivial question
|
|
25
|
+
and the answer decides what you're told: `pending` means the page is healthy and your expression
|
|
26
|
+
is still running — raise `timeoutMs` or split the click-wait-assert into separate calls;
|
|
27
|
+
`stuck` means even the probe went unanswered, i.e. the main thread is genuinely blocked.
|
|
28
|
+
|
|
29
|
+
## The three names you get
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
mma.$(sel, root?) // Element | null
|
|
33
|
+
mma.$$(sel, root?) // Array<Element> — a real array, so .map() / .filter() / [0] work
|
|
34
|
+
mma.selector(el) // a CSS string you can hand straight back to mma.$()
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Everything else is standard DOM (`textContent`, `dataset`, `getBoundingClientRect`,
|
|
38
|
+
`classList`, `closest`, `children`). Host-side data is one same-origin `fetch` away:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
const r = await fetch("/api/app/com.example.todo/errors");
|
|
42
|
+
return (await r.json()).errors.map((e) => e.message);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`code` is an **async function body**, so it must `return`. Omit it for the default, which is
|
|
46
|
+
`return mma.$("#root")` — a shallow tree, and the cheapest way to see what you drew.
|
|
47
|
+
|
|
48
|
+
## Recipes
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// 1. Did the class land? (compare the two colours, do not eyeball the name)
|
|
52
|
+
const el = mma.$("button.btn");
|
|
53
|
+
const cs = getComputedStyle(el);
|
|
54
|
+
return { class: el.className, bg: cs.backgroundColor, color: cs.color };
|
|
55
|
+
|
|
56
|
+
// 2. Which nodes rendered to nothing? (a class that never compiled, or a false condition)
|
|
57
|
+
return mma.$$("#root *").filter((n) => n.getBoundingClientRect().width === 0 && n.children.length === 0)
|
|
58
|
+
.map((n) => mma.selector(n) + " " + n.className);
|
|
59
|
+
|
|
60
|
+
// 3. Something is off-screen — find it by geometry, not by guessing the layout
|
|
61
|
+
return mma.$$("#root *").filter((n) => { const b = n.getBoundingClientRect();
|
|
62
|
+
return b.right > innerWidth + 1 || b.bottom > innerHeight + 1; }).map(mma.selector);
|
|
63
|
+
|
|
64
|
+
// 4. Walk deeper than the default 2 levels: return the node itself
|
|
65
|
+
return mma.$(".toolbar");
|
|
66
|
+
|
|
67
|
+
// 5. Is a hidden branch the reason?
|
|
68
|
+
return mma.$$(".notes").map((n) => ({ sel: mma.selector(n), display: getComputedStyle(n).display }));
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Pattern: **`$$` to find, `selector` to name, `$` to go back in.** A list of elements comes
|
|
72
|
+
back as one line each without children — that is a locator, and it is deliberately cheap;
|
|
73
|
+
return one of those nodes to see its subtree.
|
|
74
|
+
|
|
75
|
+
## Reading the answer
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
# 6 lines shown of 6 in subtree · 1 query hit · depth 2 · coords: viewport px (scrolls with page) · viewport 1024x768 · 0.3KB · 4ms
|
|
79
|
+
div#root.panel.flex x=16 y=64 w=380 h=812 (2 children)
|
|
80
|
+
h2.title x=16 y=64 w=200 h=24 "Panel"
|
|
81
|
+
aside.notes x=16 y=564 w=380 h=212 (1 child) display:none
|
|
82
|
+
+2 deeper levels not shown — return that node to go on
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
* Containers report `(N children)`, never their whole text — a panel's text is the page.
|
|
86
|
+
* `x= y= w= h=` are **viewport pixels** (they move with scroll), stated in the header.
|
|
87
|
+
* `display:none` / `visibility:hidden` / `opacity:0` / `detached` are flags, not bugs. An
|
|
88
|
+
element with no box has no geometry to complain about.
|
|
89
|
+
* The header states how much you got. If it says `STOPPED by bytes`, the rest is missing.
|
|
90
|
+
|
|
91
|
+
## When it fails, `view` says whose fault it is
|
|
92
|
+
|
|
93
|
+
| `view` | Meaning | Next step |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `live` + `ok: false` | your JavaScript failed — `error.kind` is `syntax` or `runtime`, with `line`/`source`/`caret` into **your** code | fix the query |
|
|
96
|
+
| `not-open` | nothing is rendering this app | `mini_app_open`, then retry |
|
|
97
|
+
| `runner-not-booted` | the iframe exists but its script never ran | the bundle or the page is broken → `mini_app_errors`, then `mini_app_open` |
|
|
98
|
+
| `stuck` | the script ran and then stopped answering | the main thread is blocked (an app loop, or one of yours) — **no tool fixes this**: ask the user to reload the tab |
|
|
99
|
+
|
|
100
|
+
The distinction between the last three matters: only `not-open` is fixed by opening, and only
|
|
101
|
+
`stuck` means something is running that never ends — which needs a human, not another tool call.
|
|
102
|
+
|
|
103
|
+
## Limits, stated plainly
|
|
104
|
+
|
|
105
|
+
* **A synchronous infinite loop freezes more than the query.** The executor never gets the
|
|
106
|
+
thread back, so nothing can interrupt it — and the wedged iframe blocks the whole panel
|
|
107
|
+
page with it, which means no tool call can recover it. If you send a loop that does not
|
|
108
|
+
terminate, tell the user to reload the tab. Prefer `mma.$$` + `.filter` / `.map` over
|
|
109
|
+
hand-rolled walks; they are shorter and they terminate.
|
|
110
|
+
* The reply is capped at `min(maxBytes, 6144)` — about 1.5 k tokens. If you need more, ask a
|
|
111
|
+
narrower question rather than raising the cap; four small queries beat one big dump.
|
|
112
|
+
* Not a screenshot. No pixels, no "is this pretty", no cross-origin frames (an `<iframe>` in
|
|
113
|
+
your app is a different document — its subtree is reported as one node).
|
|
114
|
+
* It reads the **live** DOM, so an app that loads data on mount answers differently before and
|
|
115
|
+
after its fetch settles. If a query comes back emptier than expected, ask again.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf Alert
|
|
3
|
+
* @title Alert
|
|
4
|
+
* @scenario Inline, non-blocking notice inside a page or panel — title + description, colours follow the semantic theme. Use for 'saved', '2 checks failed'; reach for Toast for transient confirmations and Dialog when the user must acknowledge.
|
|
5
|
+
*/
|
|
6
|
+
import { Alert, AlertDescription, AlertTitle } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function Alert01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<Alert>
|
|
12
|
+
<AlertTitle>Heads up</AlertTitle>
|
|
13
|
+
<AlertDescription>Something needs attention.</AlertDescription>
|
|
14
|
+
</Alert>
|
|
15
|
+
</>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf AspectRatio
|
|
3
|
+
* @title AspectRatio
|
|
4
|
+
* @scenario A media/skeleton placeholder that must keep a fixed ratio (16/9 here) while its container resizes — prevents layout shift when images or embeds load late.
|
|
5
|
+
*/
|
|
6
|
+
import { AspectRatio } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function AspectRatio01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div className="w-48">
|
|
12
|
+
<AspectRatio ratio={16 / 9} className="rounded-lg bg-muted" />
|
|
13
|
+
</div>
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf Attachment
|
|
3
|
+
* @title Attachment
|
|
4
|
+
* @scenario A file chip in a list — icon, name, meta line and a remove affordance; the shape used for uploaded files or chat attachments.
|
|
5
|
+
*/
|
|
6
|
+
import { Attachment, AttachmentContent, AttachmentDescription, AttachmentTitle } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function Attachment01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<Attachment>
|
|
12
|
+
<AttachmentContent>
|
|
13
|
+
<AttachmentTitle>report.pdf</AttachmentTitle>
|
|
14
|
+
<AttachmentDescription>PDF · 120 KB</AttachmentDescription>
|
|
15
|
+
</AttachmentContent>
|
|
16
|
+
</Attachment>
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf Breadcrumb
|
|
3
|
+
* @title Breadcrumb
|
|
4
|
+
* @scenario Deep-navigation path where the current level is not a link and separators are automatic; use for drill-down pages (org / team / project / run).
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
Breadcrumb,
|
|
8
|
+
BreadcrumbItem,
|
|
9
|
+
BreadcrumbLink,
|
|
10
|
+
BreadcrumbList,
|
|
11
|
+
BreadcrumbPage,
|
|
12
|
+
BreadcrumbSeparator,
|
|
13
|
+
} from "@monkey-mini-app/ui";
|
|
14
|
+
|
|
15
|
+
export default function Breadcrumb01Example() {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<Breadcrumb>
|
|
19
|
+
<BreadcrumbList>
|
|
20
|
+
<BreadcrumbItem>
|
|
21
|
+
<BreadcrumbLink href="#">Home</BreadcrumbLink>
|
|
22
|
+
</BreadcrumbItem>
|
|
23
|
+
<BreadcrumbSeparator />
|
|
24
|
+
<BreadcrumbItem>
|
|
25
|
+
<BreadcrumbPage>Demo</BreadcrumbPage>
|
|
26
|
+
</BreadcrumbItem>
|
|
27
|
+
</BreadcrumbList>
|
|
28
|
+
</Breadcrumb>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf Bubble
|
|
3
|
+
* @title Bubble
|
|
4
|
+
* @scenario One side of a chat transcript — agent vs user bubble without hand-rolling alignment or spacing.
|
|
5
|
+
*/
|
|
6
|
+
import { Bubble, BubbleContent } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function Bubble01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<Bubble>
|
|
12
|
+
<BubbleContent>Can you rerun login-spec?</BubbleContent>
|
|
13
|
+
</Bubble>
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf ButtonGroup
|
|
3
|
+
* @title Button / ButtonGroup
|
|
4
|
+
* @scenario Related buttons fused into one visual unit (joined borders/radius) — e.g. Save + dropdown Split action; distinct from Toolbar/ToggleGroup because there is no pressed state.
|
|
5
|
+
*/
|
|
6
|
+
import { Button, ButtonGroup } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function ButtonGroup01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div className="flex flex-wrap gap-2">
|
|
12
|
+
<Button data-testid="primitive-button">Default</Button>
|
|
13
|
+
<Button variant="outline">Outline</Button>
|
|
14
|
+
<Button variant="ghost">Ghost</Button>
|
|
15
|
+
<Button variant="destructive">Destructive</Button>
|
|
16
|
+
<ButtonGroup>
|
|
17
|
+
<Button variant="outline">One</Button>
|
|
18
|
+
<Button variant="outline">Two</Button>
|
|
19
|
+
</ButtonGroup>
|
|
20
|
+
</div>
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf Card
|
|
3
|
+
* @title Card
|
|
4
|
+
* @scenario The default content container: header (title + description), body, optional footer. Start here for any panel before writing custom borders/padding.
|
|
5
|
+
*/
|
|
6
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function Card01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<Card>
|
|
12
|
+
<CardHeader>
|
|
13
|
+
<CardTitle>Card</CardTitle>
|
|
14
|
+
</CardHeader>
|
|
15
|
+
<CardContent>Interactive container.</CardContent>
|
|
16
|
+
</Card>
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- generated by scripts/gen/skill — do not edit -->
|
|
2
|
+
|
|
3
|
+
# Examples · charts-blocks
|
|
4
|
+
|
|
5
|
+
Multi-component demos: layout/pattern recipes with no single subject component.
|
|
6
|
+
Copy the whole file into `ui.tsx` (or split it) — imports are `react` + `@monkey-mini-app/ui` only.
|
|
7
|
+
|
|
8
|
+
| example | what it shows | scenario |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| [`misc-charts-blocks-01.tsx`](./misc-charts-blocks/misc-charts-blocks-01.tsx) | PageHeader / FilterBar | Page chrome working together: PageHeader (title + description + primary action) with a FilterBar row beneath — the standard screen top for list/monitor pages. |
|
|
11
|
+
| [`misc-charts-blocks-02.tsx`](./misc-charts-blocks/misc-charts-blocks-02.tsx) | StatCard / TrendCard / Sparkline / Gauge / ProgressRing | KPI strip: StatCard for numbers with delta, TrendCard adding a sparkline, plus Sparkline/Gauge/ProgressRing for compact meters in one row. |
|
|
12
|
+
| [`misc-charts-blocks-03.tsx`](./misc-charts-blocks/misc-charts-blocks-03.tsx) | Donut / StackedBar / Radar | Recharts-backed set: DonutChart for share-of-total, StackedBarChart for composition over time, RadarChart for multi-axis scorecards — all fed plain arrays. |
|
|
13
|
+
| [`misc-charts-blocks-04.tsx`](./misc-charts-blocks/misc-charts-blocks-04.tsx) | StatusBadge / SeverityChip / EnvBadge | Status vocabulary in one view: StatusBadge (pass/fail/flaky, lowercase statuses), SeverityChip (P0–P3) and EnvBadge (dev/stg/prd) so triage rows read consistently. |
|
|
14
|
+
| [`misc-charts-blocks-05.tsx`](./misc-charts-blocks/misc-charts-blocks-05.tsx) | ActivityFeed / NotificationCenter / CommentThread / TestStepList | Feed-style blocks: ActivityFeed, NotificationCenter and CommentThread share an items-in / rows-out shape; TestStepList shows pass/fail steps per case. |
|
|
15
|
+
| [`misc-charts-blocks-06.tsx`](./misc-charts-blocks/misc-charts-blocks-06.tsx) | DescriptionList / RequestInspector / Terminal / FileTree / AttachmentGallery | Inspect/debug kit on one screen: DescriptionList for metadata, RequestInspector for a method/url/response, Terminal for command output, FileTree and AttachmentGallery for artifacts. |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf CodeBlock
|
|
3
|
+
* @title CodeBlock
|
|
4
|
+
* @scenario Read-only highlighted source with filename, language badge and copy button (shiki via CDN); use when the code is shown, not edited.
|
|
5
|
+
*/
|
|
6
|
+
import { CodeBlock } from "@monkey-mini-app/ui";
|
|
7
|
+
|
|
8
|
+
export default function CodeBlock01Example() {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<CodeBlock language="ts" code={`type Run = { id: string }\nexport const run: Run = { id: \"1\" }\n`} />
|
|
12
|
+
</>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf CodeEditor
|
|
3
|
+
* @title CodeEditor
|
|
4
|
+
* @scenario Editable source with syntax highlighting and line numbers (CodeMirror 6 via CDN). Reach for it when the user changes config/scripts in-app; degrade to Textarea if the network blocks the CDN.
|
|
5
|
+
* @hint CodeMirror 6
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
|
|
9
|
+
import { CodeEditor } from "@monkey-mini-app/ui";
|
|
10
|
+
|
|
11
|
+
export default function CodeEditor01Example() {
|
|
12
|
+
const [code, setCode] = React.useState("export const n = 1\n");
|
|
13
|
+
|
|
14
|
+
return <CodeEditor value={code} onChange={setCode} language="ts" />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf Command
|
|
3
|
+
* @title Command
|
|
4
|
+
* @scenario Cmd-K style palette: fuzzy input over grouped actions with an empty state, mounted inline rather than as a dialog.
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
Command,
|
|
8
|
+
CommandEmpty,
|
|
9
|
+
CommandGroup,
|
|
10
|
+
CommandInput,
|
|
11
|
+
CommandItem,
|
|
12
|
+
CommandList,
|
|
13
|
+
} from "@monkey-mini-app/ui";
|
|
14
|
+
|
|
15
|
+
export default function Command01Example() {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<Command className="h-40 w-72 rounded-xl border">
|
|
19
|
+
<CommandInput placeholder="Search…" />
|
|
20
|
+
<CommandList>
|
|
21
|
+
<CommandEmpty>No results</CommandEmpty>
|
|
22
|
+
<CommandGroup>
|
|
23
|
+
<CommandItem>Open grid</CommandItem>
|
|
24
|
+
<CommandItem>New run</CommandItem>
|
|
25
|
+
</CommandGroup>
|
|
26
|
+
</CommandList>
|
|
27
|
+
</Command>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @exampleOf ConfirmDialog
|
|
3
|
+
* @title ConfirmDialog / Toast
|
|
4
|
+
* @scenario Destructive-action guard — one click opens a yes/no dialog, cancel keeps state; pair with toast for the result. Do not hand-roll a Dialog for confirmations.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
|
|
8
|
+
import { Button, ConfirmDialog, toast } from "@monkey-mini-app/ui";
|
|
9
|
+
|
|
10
|
+
export default function ConfirmDialog01Example() {
|
|
11
|
+
const [confirm, setConfirm] = React.useState(false);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<div className="flex gap-2">
|
|
16
|
+
<Button variant="destructive" onClick={() => setConfirm(true)}>
|
|
17
|
+
Delete
|
|
18
|
+
</Button>
|
|
19
|
+
<Button variant="outline" onClick={() => toast.add({ title: "Saved", description: "Run updated." })}>
|
|
20
|
+
Toast
|
|
21
|
+
</Button>
|
|
22
|
+
</div>
|
|
23
|
+
<ConfirmDialog
|
|
24
|
+
open={confirm}
|
|
25
|
+
onOpenChange={setConfirm}
|
|
26
|
+
title="Delete this run?"
|
|
27
|
+
description="This cannot be undone."
|
|
28
|
+
confirmLabel="Delete"
|
|
29
|
+
onConfirm={() => setConfirm(false)}
|
|
30
|
+
/>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|