kaizen-agent 1.85.2 → 1.87.0
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 +1 -1
- package/cli/annotate-proxy.ts +6 -3
- package/cli/build-web.ts +46 -16
- package/cli/dev.ts +67 -0
- package/cli/docs.ts +1 -1
- package/cli/notes.ts +9 -3
- package/cli/ports.ts +121 -0
- package/cli/rea.ts +99 -11
- package/cli/settings.ts +16 -17
- package/cli/state.ts +15 -29
- package/cli/task-service.ts +114 -34
- package/cli/tasks.ts +8 -2
- package/cli/term-image.ts +18 -0
- package/cli/ui-audit.allow.json +0 -1
- package/cli/ui-audit.ts +12 -12
- package/cli/web.ts +197 -61
- package/package.json +21 -4
- package/skills/kaizen/spec.md +12 -4
- package/skills/optional/disk-cleanup/SKILL.md +60 -0
- package/skills/optional/disk-cleanup/skill.json +1 -0
- package/skills/optional/disk-cleanup/tui.py +90 -0
- package/tsconfig.json +16 -0
- package/web/README.md +105 -0
- package/web/{annotate.js → annotate/annotate.ts} +51 -50
- package/web/boot/boot.ts +7 -0
- package/web/components/annotate/annotate-bar.tsx +78 -0
- package/web/components/annotate/annotate-panel.tsx +20 -0
- package/web/components/annotate/annotate-settings.tsx +60 -0
- package/web/components/annotate/index.ts +1 -0
- package/web/components/annotate/notes-list.tsx +75 -0
- package/web/components/board/board-card.tsx +177 -0
- package/web/components/board/board-column.tsx +212 -0
- package/web/components/board/board-mode-switch.tsx +21 -0
- package/web/components/board/board-popups.tsx +45 -0
- package/web/components/board/card-footer.tsx +58 -0
- package/web/components/board/card-form.tsx +168 -0
- package/web/components/board/card-kids.tsx +53 -0
- package/web/components/board/clear-menu.tsx +36 -0
- package/web/components/board/filter-box.tsx +42 -0
- package/web/components/board/index.ts +6 -0
- package/web/components/board/run-form.tsx +129 -0
- package/web/components/board/severity-menu.tsx +44 -0
- package/web/components/board/status-strip.tsx +75 -0
- package/web/components/board/task-form.tsx +140 -0
- package/web/components/board/ws-card.tsx +38 -0
- package/web/components/context/context-panel.tsx +244 -0
- package/web/components/context/index.ts +1 -0
- package/web/components/decision/decision-bar.tsx +422 -0
- package/web/components/decision/index.ts +1 -0
- package/web/components/decision/inline-form.tsx +47 -0
- package/web/components/decision/plan-answers-form.tsx +78 -0
- package/web/components/decision/revise-form.tsx +65 -0
- package/web/components/decision/task-reply-form.tsx +48 -0
- package/web/components/footer/foot-bar.tsx +67 -0
- package/web/components/footer/index.ts +1 -0
- package/web/components/git/git-ask.tsx +88 -0
- package/web/components/git/git-commits.tsx +53 -0
- package/web/components/git/git-confirm.tsx +78 -0
- package/web/components/git/git-counts.tsx +10 -0
- package/web/components/git/git-files.tsx +113 -0
- package/web/components/git/git-head.tsx +70 -0
- package/web/components/git/git-icon.tsx +25 -0
- package/web/components/git/git-message.tsx +44 -0
- package/web/components/git/git-split.tsx +64 -0
- package/web/components/git/git-tab.tsx +55 -0
- package/web/components/git/index.ts +1 -0
- package/web/components/home/chat-list.tsx +57 -0
- package/web/components/home/home-composer.tsx +169 -0
- package/web/components/home/home-message.tsx +120 -0
- package/web/components/home/home-window.tsx +253 -0
- package/web/components/home/home-ws-add.tsx +47 -0
- package/web/components/home/index.ts +6 -0
- package/web/components/home/onboarding-dialog.tsx +371 -0
- package/web/components/icebox/board-chip.tsx +27 -0
- package/web/components/icebox/board-menu.tsx +41 -0
- package/web/components/icebox/bulk-bar.tsx +41 -0
- package/web/components/icebox/capture-box.tsx +155 -0
- package/web/components/icebox/choice-menu.tsx +39 -0
- package/web/components/icebox/collection-dialog.tsx +60 -0
- package/web/components/icebox/favicon.tsx +39 -0
- package/web/components/icebox/index.ts +10 -0
- package/web/components/icebox/kind-label.tsx +22 -0
- package/web/components/icebox/kind-menu.tsx +20 -0
- package/web/components/icebox/promote-form.tsx +93 -0
- package/web/components/icebox/reply-box.tsx +88 -0
- package/web/components/icebox/request-actions.tsx +141 -0
- package/web/components/icebox/request-badges.tsx +13 -0
- package/web/components/icebox/request-card.tsx +99 -0
- package/web/components/icebox/request-detail.tsx +43 -0
- package/web/components/icebox/request-images.tsx +33 -0
- package/web/components/icebox/request-phone-row.tsx +181 -0
- package/web/components/icebox/request-row.tsx +120 -0
- package/web/components/icebox/service-chip.tsx +58 -0
- package/web/components/icebox/snooze-menu.tsx +83 -0
- package/web/components/icebox/source-card.tsx +225 -0
- package/web/components/icebox/source-drawer.tsx +112 -0
- package/web/components/icebox/source-form.tsx +147 -0
- package/web/components/icebox/swipe-deck.tsx +242 -0
- package/web/components/layout/index.ts +1 -0
- package/web/components/layout/page-frame.tsx +44 -0
- package/web/components/markdown/index.ts +1 -0
- package/web/components/markdown/markdown.tsx +156 -0
- package/web/components/notebook/editor-pane.tsx +23 -0
- package/web/components/notebook/index.ts +5 -0
- package/web/components/notebook/note-body.tsx +172 -0
- package/web/components/notebook/note-tree.tsx +99 -0
- package/web/components/notebook/notes-head.tsx +37 -0
- package/web/components/notebook/notes-side.tsx +46 -0
- package/web/components/notes/index.ts +1 -0
- package/web/components/notes/note-composer.tsx +90 -0
- package/web/components/notes/notes-chat.tsx +58 -0
- package/web/components/panes/browser-pane.tsx +281 -0
- package/web/components/panes/index.ts +3 -0
- package/web/components/panes/preview-pane.tsx +91 -0
- package/web/components/panes/terminal-pane.tsx +52 -0
- package/web/components/phone/haptic.tsx +29 -0
- package/web/components/phone/index.ts +6 -0
- package/web/components/phone/phone-card.tsx +118 -0
- package/web/components/phone/phone-home.tsx +304 -0
- package/web/components/phone/phone-sheets.tsx +103 -0
- package/web/components/phone/qr-code.tsx +6 -0
- package/web/components/phone/usage-chips.tsx +85 -0
- package/web/components/phone/whatsapp-card.tsx +85 -0
- package/web/components/project/add-project-dialog.tsx +435 -0
- package/web/components/project/index.ts +3 -0
- package/web/components/project/project-bar.tsx +101 -0
- package/web/components/project/ws-menu.tsx +21 -0
- package/web/components/rail/agent-chips.tsx +110 -0
- package/web/components/rail/index.ts +4 -0
- package/web/components/rail/rail-filter.tsx +118 -0
- package/web/components/rail/rail-list.tsx +259 -0
- package/web/components/rail/source-marks.tsx +21 -0
- package/web/components/resources/index.ts +1 -0
- package/web/components/resources/resources-popup.tsx +490 -0
- package/web/components/run/doc-body.tsx +123 -0
- package/web/components/run/file-viewer.tsx +53 -0
- package/web/components/run/fix-form.tsx +88 -0
- package/web/components/run/index.ts +16 -0
- package/web/components/run/inline-md.tsx +30 -0
- package/web/components/run/key-hint.tsx +29 -0
- package/web/components/run/pane-gutter.tsx +52 -0
- package/web/components/run/pane-header.tsx +35 -0
- package/web/components/run/pane.tsx +140 -0
- package/web/components/run/panel-grip.tsx +49 -0
- package/web/components/run/panel-head.tsx +56 -0
- package/web/components/run/panel-tabs.tsx +35 -0
- package/web/components/run/phase-steps.tsx +37 -0
- package/web/components/run/project-notes.tsx +49 -0
- package/web/components/run/run-add-menu.tsx +80 -0
- package/web/components/run/run-bar.tsx +40 -0
- package/web/components/run/run-empty.tsx +10 -0
- package/web/components/run/run-footer.tsx +53 -0
- package/web/components/run/run-history.tsx +24 -0
- package/web/components/run/run-panes.tsx +78 -0
- package/web/components/run/run-picker.tsx +51 -0
- package/web/components/run/run-progress.tsx +30 -0
- package/web/components/run/run-tabs.tsx +147 -0
- package/web/components/run/run-wait.tsx +18 -0
- package/web/components/search/index.ts +1 -0
- package/web/components/search/search-palette.tsx +159 -0
- package/web/components/settings/account-rows.tsx +128 -0
- package/web/components/settings/agent-rows.tsx +249 -0
- package/web/components/settings/automation-rows.tsx +211 -0
- package/web/components/settings/browser-row.tsx +111 -0
- package/web/components/settings/cleanup-row.tsx +32 -0
- package/web/components/settings/commit-input.tsx +39 -0
- package/web/components/settings/index.ts +4 -0
- package/web/components/settings/integration-row.tsx +158 -0
- package/web/components/settings/mic-row.tsx +48 -0
- package/web/components/settings/orchestration-flow.tsx +87 -0
- package/web/components/settings/setting-row.tsx +131 -0
- package/web/components/settings/settings-item.tsx +78 -0
- package/web/components/settings/settings-loading.tsx +41 -0
- package/web/components/settings/settings-nav.tsx +119 -0
- package/web/components/settings/settings-scope.tsx +66 -0
- package/web/components/settings/settings-section.tsx +33 -0
- package/web/components/settings/skill-card.tsx +131 -0
- package/web/components/settings/stepper.tsx +74 -0
- package/web/components/settings/update-bar.tsx +167 -0
- package/web/components/shared/action-menu.tsx +76 -0
- package/web/components/shared/ask-host.tsx +18 -0
- package/web/components/shared/attach-button.tsx +23 -0
- package/web/components/shared/chip.tsx +19 -0
- package/web/components/shared/client-mark.tsx +15 -0
- package/web/components/shared/confirm-dialog.tsx +35 -0
- package/web/components/shared/empty-state.tsx +29 -0
- package/web/components/shared/field.tsx +77 -0
- package/web/components/shared/filter-popover.tsx +29 -0
- package/web/components/shared/form-frame.tsx +19 -0
- package/web/components/shared/icon-button.tsx +50 -0
- package/web/components/shared/index.ts +18 -0
- package/web/components/shared/mic-button.tsx +75 -0
- package/web/components/shared/pager.tsx +49 -0
- package/web/components/shared/picker.tsx +108 -0
- package/web/components/shared/project-mark.tsx +38 -0
- package/web/components/shared/segmented.tsx +43 -0
- package/web/components/shared/state-dot.tsx +4 -0
- package/web/components/shared/status-mark.tsx +26 -0
- package/web/components/shell/index.ts +3 -0
- package/web/components/shell/rail.tsx +259 -0
- package/web/components/shell/sprite.tsx +124 -0
- package/web/components/shell/wordmark.tsx +13 -0
- package/web/components/task/artifact-view.tsx +148 -0
- package/web/components/task/chat-bubble.tsx +43 -0
- package/web/components/task/filter-menu.tsx +38 -0
- package/web/components/task/index.ts +7 -0
- package/web/components/task/result-checks.tsx +34 -0
- package/web/components/task/result-view.tsx +103 -0
- package/web/components/task/status-badge.tsx +24 -0
- package/web/components/task/task-row.tsx +34 -0
- package/web/components/task/typing-dots.tsx +16 -0
- package/web/components/terminal/index.ts +3 -0
- package/web/components/terminal/terminal-bar.tsx +91 -0
- package/web/components/terminal/terminal-grid.tsx +149 -0
- package/web/components/terminal/terminal-modes.tsx +23 -0
- package/web/components/terminal/terminal-tile.tsx +139 -0
- package/web/dist/annotate.js +24 -0
- package/web/dist/board.css +718 -0
- package/web/dist/board.js +115 -0
- package/web/dist/boot.js +2 -0
- package/web/dist/notebook.css +319 -0
- package/web/dist/notebook.js +89 -0
- package/web/dist/popup.css +41 -0
- package/web/dist/popup.js +13 -0
- package/web/{term.js → dist/term.js} +48 -48
- package/web/dist/ui.css +3 -0
- package/web/dist/video.js +108 -0
- package/web/html/board.html +17 -0
- package/web/html/notes.html +14 -0
- package/web/html/popup.html +13 -0
- package/web/{video.html → html/video.html} +14 -15
- package/web/lib/annotate/index.ts +2 -0
- package/web/lib/annotate/notes.ts +105 -0
- package/web/lib/annotate/page.ts +121 -0
- package/web/lib/annotate/rules.ts +37 -0
- package/web/lib/annotate/session.ts +336 -0
- package/web/lib/board/board-actions.ts +119 -0
- package/web/lib/board/board-open.ts +12 -0
- package/web/lib/board/board-store.ts +159 -0
- package/web/lib/board/filter-box.ts +7 -0
- package/web/lib/board/index.ts +10 -0
- package/web/lib/board/nav.ts +29 -0
- package/web/lib/board/on-state.ts +90 -0
- package/web/lib/board/popups.ts +22 -0
- package/web/lib/board/snapshot.ts +105 -0
- package/web/lib/board/strip.ts +43 -0
- package/web/{board → lib/board}/ws-board.ts +1 -1
- package/web/lib/context/context-rules.ts +27 -0
- package/web/lib/context/context-store.ts +95 -0
- package/web/lib/context/feed.ts +28 -0
- package/web/lib/context/index.ts +3 -0
- package/web/lib/core/api.ts +86 -0
- package/web/lib/core/ask.ts +24 -0
- package/web/lib/core/board.ts +290 -0
- package/web/lib/core/brief.ts +31 -0
- package/web/lib/core/format.ts +8 -0
- package/web/lib/core/host.ts +107 -0
- package/web/lib/core/index.ts +16 -0
- package/web/{board → lib/core}/labels.ts +6 -5
- package/web/lib/core/layers.ts +7 -0
- package/web/lib/core/leave.ts +7 -0
- package/web/lib/core/motion.ts +10 -0
- package/web/{board/toast.ts → lib/core/notices.ts} +2 -20
- package/web/lib/core/notifier.ts +15 -0
- package/web/lib/core/store.ts +39 -0
- package/web/lib/core/term-handle.ts +8 -0
- package/web/lib/core/toast.ts +29 -0
- package/web/lib/core/utils.ts +15 -0
- package/web/lib/decision/index.ts +1 -0
- package/web/lib/decision/plan-questions.ts +39 -0
- package/web/lib/dictation/chunks.ts +93 -0
- package/web/lib/dictation/dictation-store.ts +22 -0
- package/web/lib/dictation/engine.ts +265 -0
- package/web/lib/dictation/index.ts +5 -0
- package/web/lib/dictation/mic.ts +42 -0
- package/web/lib/dictation/terminal-dictation.ts +50 -0
- package/web/lib/footer/footer-rules.ts +13 -0
- package/web/lib/footer/footer-store.ts +42 -0
- package/web/lib/footer/index.ts +2 -0
- package/web/lib/git/git-actions.ts +110 -0
- package/web/lib/git/git-panel.ts +43 -0
- package/web/lib/git/git-store.ts +47 -0
- package/web/lib/git/git.ts +170 -0
- package/web/lib/git/index.ts +4 -0
- package/web/lib/home/home-engine.ts +16 -0
- package/web/lib/home/home-events.ts +9 -0
- package/web/lib/home/home-store.ts +247 -0
- package/web/lib/home/home-window.ts +193 -0
- package/web/lib/home/home.ts +85 -0
- package/web/lib/home/index.ts +7 -0
- package/web/lib/home/onboarding.ts +199 -0
- package/web/lib/home/use-float-drag.ts +62 -0
- package/web/lib/icebox/icebox-actions.ts +518 -0
- package/web/lib/icebox/icebox-store.ts +112 -0
- package/web/lib/icebox/icebox-view.ts +48 -0
- package/web/lib/icebox/icebox.ts +273 -0
- package/web/lib/icebox/index.ts +8 -0
- package/web/lib/icebox/use-card-drag.ts +82 -0
- package/web/lib/icebox/use-ice-keys.ts +75 -0
- package/web/lib/icebox/use-icebox.ts +41 -0
- package/web/lib/icebox/use-row-swipe.ts +107 -0
- package/web/lib/markdown/index.ts +1 -0
- package/web/lib/markdown/markdown.ts +136 -0
- package/web/lib/notebook/autosave.ts +131 -0
- package/web/lib/notebook/deal.ts +58 -0
- package/web/lib/notebook/engine-complete.ts +128 -0
- package/web/lib/notebook/engine-preview.ts +287 -0
- package/web/lib/notebook/engine-types.ts +26 -0
- package/web/lib/notebook/engine-widgets.ts +218 -0
- package/web/lib/notebook/engine.ts +74 -0
- package/web/lib/notebook/index.ts +9 -0
- package/web/lib/notebook/kit-loader.ts +16 -0
- package/web/lib/notebook/kit.ts +12 -0
- package/web/{notes-lib.ts → lib/notebook/text.ts} +11 -10
- package/web/lib/notebook/vault-actions.ts +239 -0
- package/web/lib/notebook/vault-rules.ts +74 -0
- package/web/lib/notebook/vault-session.ts +73 -0
- package/web/lib/notebook/vault-store.ts +63 -0
- package/web/lib/notes/index.ts +4 -0
- package/web/lib/notes/md-html.ts +115 -0
- package/web/lib/notes/notes-actions.ts +32 -0
- package/web/lib/notes/notes-store.ts +22 -0
- package/web/lib/notes/notes.ts +58 -0
- package/web/{board → lib/notes}/rich.ts +1 -2
- package/web/lib/phone/index.ts +7 -0
- package/web/lib/phone/phone-actions.ts +77 -0
- package/web/lib/phone/phone-home.ts +102 -0
- package/web/lib/phone/phone-setup.ts +59 -0
- package/web/lib/phone/phone-sheet.ts +25 -0
- package/web/lib/phone/phone-store.ts +32 -0
- package/web/lib/phone/sheet-swipe.ts +55 -0
- package/web/lib/phone/use-phone-setup.ts +89 -0
- package/web/lib/project/add-project.ts +37 -0
- package/web/lib/project/branch.ts +14 -0
- package/web/lib/project/index.ts +5 -0
- package/web/lib/project/project-bar.ts +76 -0
- package/web/lib/project/project-pick.ts +36 -0
- package/web/lib/project/ws-menu.ts +8 -0
- package/web/lib/rail/agents.ts +63 -0
- package/web/lib/rail/card-links.ts +20 -0
- package/web/lib/rail/index.ts +7 -0
- package/web/lib/rail/rail-actions.ts +74 -0
- package/web/lib/rail/rail-boot.ts +99 -0
- package/web/lib/rail/rail-store.ts +85 -0
- package/web/lib/rail/rules.ts +241 -0
- package/web/lib/rail/source-marks.ts +17 -0
- package/web/lib/rail/use-rank-drag.ts +108 -0
- package/web/lib/resources/index.ts +3 -0
- package/web/lib/resources/resources-actions.ts +59 -0
- package/web/lib/resources/resources-store.ts +48 -0
- package/web/lib/resources/rules.ts +56 -0
- package/web/lib/router/index.ts +3 -0
- package/web/lib/router/route-rules.ts +96 -0
- package/web/lib/router/route-store.ts +115 -0
- package/web/lib/router/use-route-classes.ts +15 -0
- package/web/lib/run/browser.ts +53 -0
- package/web/lib/run/card-terminal.ts +32 -0
- package/web/lib/run/doc.ts +42 -0
- package/web/lib/run/grip.ts +8 -0
- package/web/lib/run/index.ts +19 -0
- package/web/lib/run/kept.ts +58 -0
- package/web/lib/run/layout-store.ts +156 -0
- package/web/lib/run/layout.ts +195 -0
- package/web/lib/run/panel-actions.ts +104 -0
- package/web/lib/run/panel-derive.ts +148 -0
- package/web/lib/run/panel-store.ts +125 -0
- package/web/lib/run/preview.ts +105 -0
- package/web/lib/run/run-actions.ts +118 -0
- package/web/lib/run/run-view-store.ts +134 -0
- package/web/lib/run/term-loader.ts +19 -0
- package/web/lib/run/use-panel-run.ts +125 -0
- package/web/lib/run/use-run-lifecycle.ts +70 -0
- package/web/lib/run/viewer.ts +12 -0
- package/web/lib/run/workspace.ts +281 -0
- package/web/lib/run/ws-actions.ts +293 -0
- package/web/lib/run/ws-derive.ts +50 -0
- package/web/lib/run/ws-draw.ts +102 -0
- package/web/lib/run/ws-store.ts +21 -0
- package/web/lib/run/ws-tabs.ts +125 -0
- package/web/lib/search/index.ts +3 -0
- package/web/lib/search/search-match.ts +48 -0
- package/web/lib/search/search-rows.ts +228 -0
- package/web/lib/search/search.ts +30 -0
- package/web/lib/search/use-search-rows.ts +22 -0
- package/web/lib/server/attention.ts +29 -0
- package/web/lib/server/index.ts +6 -0
- package/web/lib/server/poll-rules.ts +57 -0
- package/web/lib/server/poller.ts +210 -0
- package/web/lib/server/server-store.ts +39 -0
- package/web/lib/server/types.ts +31 -0
- package/web/lib/server/use-server.ts +19 -0
- package/web/lib/settings/agent-favicons.ts +14 -0
- package/web/lib/settings/index.ts +7 -0
- package/web/lib/settings/panel-settings.ts +29 -0
- package/web/lib/settings/settings-actions.ts +357 -0
- package/web/lib/settings/settings-store.ts +114 -0
- package/web/lib/settings/settings.ts +413 -0
- package/web/lib/settings/skill-icons.ts +24 -0
- package/web/lib/settings/update.ts +70 -0
- package/web/lib/shared/data-urls.ts +32 -0
- package/web/lib/shared/index.ts +4 -0
- package/web/lib/shared/use-draft.ts +38 -0
- package/web/lib/shared/use-narrow.ts +11 -0
- package/web/lib/shared/use-pager.ts +24 -0
- package/web/lib/shell/appearance.ts +97 -0
- package/web/lib/shell/help-store.ts +4 -0
- package/web/lib/shell/index.ts +4 -0
- package/web/lib/shell/shell-store.ts +23 -0
- package/web/lib/shell/stored-look.ts +47 -0
- package/web/lib/task/index.ts +7 -0
- package/web/lib/task/task-results.ts +92 -0
- package/web/lib/task/tasks.ts +132 -0
- package/web/lib/task/use-live-frame.ts +85 -0
- package/web/lib/task/use-saved-text.ts +25 -0
- package/web/lib/task/use-task.ts +161 -0
- package/web/lib/task/use-tasks.ts +50 -0
- package/web/{board → lib/task}/zoom.ts +25 -12
- package/web/lib/terminal/hidden-badge.ts +15 -0
- package/web/lib/terminal/index.ts +8 -0
- package/web/lib/terminal/layout.ts +138 -0
- package/web/{term-font.ts → lib/terminal/term-font.ts} +3 -2
- package/web/lib/terminal/terminal-store.ts +65 -0
- package/web/lib/terminal/terms-feed.ts +37 -0
- package/web/lib/terminal/use-arranged.ts +15 -0
- package/web/lib/terminal/use-terminal-keys.ts +37 -0
- package/web/lib/url/index.ts +1 -0
- package/web/lib/url/safe-url.ts +9 -0
- package/web/notebook/notebook.ts +27 -0
- package/web/notebook/notes-lib.ts +3 -0
- package/web/pages/board/App.tsx +76 -0
- package/web/pages/board/header.tsx +83 -0
- package/web/pages/board/help.tsx +59 -0
- package/web/pages/board/host-bridge.ts +94 -0
- package/web/pages/board/host.tsx +19 -0
- package/web/pages/board/keys.ts +112 -0
- package/web/pages/board/live.ts +39 -0
- package/web/pages/board/main.ts +32 -0
- package/web/pages/board/pages.tsx +86 -0
- package/web/pages/board/panel.tsx +157 -0
- package/web/pages/board/portal.tsx +39 -0
- package/web/pages/board/use-boot.ts +13 -0
- package/web/pages/board/views.ts +63 -0
- package/web/pages/board-page.tsx +62 -0
- package/web/pages/home-page.tsx +127 -0
- package/web/pages/icebox-page.tsx +440 -0
- package/web/pages/notebook/App.tsx +35 -0
- package/web/pages/notebook-page.tsx +50 -0
- package/web/pages/popup/App.tsx +207 -0
- package/web/pages/settings-page.tsx +111 -0
- package/web/pages/task-page.tsx +383 -0
- package/web/pages/tasks-page.tsx +151 -0
- package/web/pages/terminal-page.tsx +15 -0
- package/web/popup/popup.ts +7 -0
- package/web/term/term-paste.ts +10 -0
- package/web/{term.ts → term/term.ts} +101 -27
- package/web/ui/alert-dialog.tsx +39 -0
- package/web/ui/badge.tsx +20 -0
- package/web/ui/button.tsx +37 -0
- package/web/ui/checkbox.tsx +20 -0
- package/web/ui/command.tsx +41 -0
- package/web/ui/dialog.tsx +28 -0
- package/web/ui/dropdown-menu.tsx +54 -0
- package/web/ui/icon.tsx +17 -0
- package/web/ui/index.ts +21 -0
- package/web/ui/input.tsx +9 -0
- package/web/ui/label.tsx +7 -0
- package/web/ui/legacy/board.css +715 -0
- package/web/{notes.html → ui/legacy/notes.css} +23 -157
- package/web/ui/legacy/popup.css +40 -0
- package/web/ui/popover.tsx +28 -0
- package/web/ui/select.tsx +61 -0
- package/web/ui/sheet.tsx +43 -0
- package/web/ui/skeleton.tsx +6 -0
- package/web/ui/sonner.tsx +25 -0
- package/web/ui/spinner.tsx +12 -0
- package/web/ui/switch.tsx +18 -0
- package/web/ui/tabs.tsx +18 -0
- package/web/ui/textarea.tsx +14 -0
- package/web/ui/theme.css +125 -0
- package/web/ui/toggle.tsx +8 -0
- package/web/ui/tooltip.tsx +26 -0
- package/web/{video.ts → video/video.ts} +5 -5
- package/web/board/add-project.ts +0 -147
- package/web/board/agent-favicons.ts +0 -9
- package/web/board/agent-term.ts +0 -51
- package/web/board/annotate-lib.ts +0 -19
- package/web/board/annotate.ts +0 -221
- package/web/board/api.ts +0 -180
- package/web/board/approvals.ts +0 -109
- package/web/board/badge.ts +0 -115
- package/web/board/cards.ts +0 -1080
- package/web/board/chat.ts +0 -128
- package/web/board/context.ts +0 -248
- package/web/board/dictation.ts +0 -343
- package/web/board/dom.ts +0 -132
- package/web/board/drafts.ts +0 -21
- package/web/board/fixes.ts +0 -89
- package/web/board/git.ts +0 -416
- package/web/board/home-ws.ts +0 -266
- package/web/board/home.ts +0 -421
- package/web/board/icebox.ts +0 -1788
- package/web/board/keys.ts +0 -121
- package/web/board/live.ts +0 -87
- package/web/board/main.ts +0 -94
- package/web/board/markdown.ts +0 -210
- package/web/board/onboarding.ts +0 -227
- package/web/board/panel.ts +0 -437
- package/web/board/phone-setup.ts +0 -79
- package/web/board/phone.ts +0 -219
- package/web/board/projects.ts +0 -277
- package/web/board/resources.ts +0 -170
- package/web/board/run-pick.ts +0 -41
- package/web/board/run-view.ts +0 -1316
- package/web/board/search-match.ts +0 -20
- package/web/board/search.ts +0 -330
- package/web/board/settings-accounts.ts +0 -76
- package/web/board/settings-agents.ts +0 -102
- package/web/board/settings-automations.ts +0 -71
- package/web/board/settings-cleanup.ts +0 -42
- package/web/board/settings-orchestration.ts +0 -32
- package/web/board/settings-pages.ts +0 -62
- package/web/board/settings-skills.ts +0 -86
- package/web/board/settings-voice.ts +0 -28
- package/web/board/settings.ts +0 -490
- package/web/board/store.ts +0 -47
- package/web/board/task-page.ts +0 -615
- package/web/board/task-results.ts +0 -234
- package/web/board/tasks.ts +0 -242
- package/web/board/terms.ts +0 -390
- package/web/board/update.ts +0 -171
- package/web/board/viewer.ts +0 -47
- package/web/board/views.ts +0 -164
- package/web/board/whatsapp-setup.ts +0 -149
- package/web/board/workspace.ts +0 -650
- package/web/board/ws-board-ui.ts +0 -95
- package/web/board/ws-tabs.ts +0 -227
- package/web/board.html +0 -1563
- package/web/board.js +0 -500
- package/web/notebook.js +0 -514
- package/web/notebook.ts +0 -1254
- package/web/popup.html +0 -141
- package/web/video.js +0 -570
- /package/web/{term.css → dist/term.css} +0 -0
- /package/web/{board/term-sessions.ts → lib/terminal/sessions.ts} +0 -0
- /package/web/{board/terminal-viewport.ts → lib/terminal/viewport.ts} +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Ranking projects: press a project's bar and drag it up or down (pointer events, so a mouse and a finger work alike).
|
|
2
|
+
// A mouse starts after 5 px of movement; a finger after a 300 ms hold without moving, so a quick swipe still scrolls the
|
|
3
|
+
// sidebar. The view says which bar is lifted and which slot the line shows; letting go calls `onDrop` with the new order.
|
|
4
|
+
// Escape or a cancelled pointer puts it back. The click that ends a drag does not fold (`swallow`).
|
|
5
|
+
import { useEffect, useRef, useState, type RefObject } from "react";
|
|
6
|
+
import { landingSlot, rankedOrder } from "./rules.ts";
|
|
7
|
+
|
|
8
|
+
export type RankView = { lift: string | null; to: number };
|
|
9
|
+
const IDLE: RankView = { lift: null, to: -1 };
|
|
10
|
+
type Drag = {
|
|
11
|
+
dir: string;
|
|
12
|
+
bar: HTMLElement;
|
|
13
|
+
id: number;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
hold?: ReturnType<typeof setTimeout>;
|
|
17
|
+
to: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function useRankDrag(ref: RefObject<HTMLElement | null>, onDrop: (order: string[]) => void) {
|
|
21
|
+
const [view, setView] = useState<RankView>(IDLE);
|
|
22
|
+
const click = useRef(false);
|
|
23
|
+
const drop = useRef(onDrop);
|
|
24
|
+
drop.current = onDrop;
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const box = ref.current;
|
|
27
|
+
if (!box) return;
|
|
28
|
+
let d: Drag | null = null,
|
|
29
|
+
ranking = false;
|
|
30
|
+
const groups = () => [...box.querySelectorAll<HTMLElement>(":scope > .pgrp")];
|
|
31
|
+
const show = (v: RankView) => setView((o) => (o.lift === v.lift && o.to === v.to ? o : v));
|
|
32
|
+
const end = (save: boolean) => {
|
|
33
|
+
if (!d) return;
|
|
34
|
+
clearTimeout(d.hold);
|
|
35
|
+
const was = ranking,
|
|
36
|
+
{ dir, to } = d;
|
|
37
|
+
const dirs = groups().map((g) => g.querySelector<HTMLElement>(".proj")!.dataset.proj!);
|
|
38
|
+
d = null;
|
|
39
|
+
ranking = false;
|
|
40
|
+
show(IDLE);
|
|
41
|
+
if (was) click.current = true; // the click that follows this pointerup
|
|
42
|
+
const next = was && save ? rankedOrder(dirs, dir, to) : null;
|
|
43
|
+
if (next) drop.current(next);
|
|
44
|
+
if (was) setTimeout(() => (click.current = false), 0);
|
|
45
|
+
};
|
|
46
|
+
const start = () => {
|
|
47
|
+
if (!d) return;
|
|
48
|
+
ranking = true;
|
|
49
|
+
show({ lift: d.dir, to: d.to });
|
|
50
|
+
try {
|
|
51
|
+
d.bar.setPointerCapture(d.id);
|
|
52
|
+
} catch {}
|
|
53
|
+
navigator.vibrate?.(8);
|
|
54
|
+
};
|
|
55
|
+
const down = (e: PointerEvent) => {
|
|
56
|
+
const bar = (e.target as HTMLElement).closest<HTMLElement>(".pgrp > .proj");
|
|
57
|
+
if (!bar || e.button !== 0 || bar.parentElement?.parentElement !== box) return;
|
|
58
|
+
d = { dir: bar.dataset.proj!, bar, id: e.pointerId, x: e.clientX, y: e.clientY, to: -1 };
|
|
59
|
+
if (e.pointerType !== "mouse") d.hold = setTimeout(start, 300);
|
|
60
|
+
};
|
|
61
|
+
const move = (e: PointerEvent) => {
|
|
62
|
+
if (!d || e.pointerId !== d.id) return;
|
|
63
|
+
const far = Math.hypot(e.clientX - d.x, e.clientY - d.y);
|
|
64
|
+
if (!ranking) {
|
|
65
|
+
if (e.pointerType === "mouse" ? far > 5 : far > 8) e.pointerType === "mouse" ? start() : end(false);
|
|
66
|
+
if (!ranking) return;
|
|
67
|
+
}
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
d.to = landingSlot(
|
|
70
|
+
groups().map((g) => g.getBoundingClientRect()),
|
|
71
|
+
e.clientY,
|
|
72
|
+
);
|
|
73
|
+
show({ lift: d.dir, to: d.to });
|
|
74
|
+
};
|
|
75
|
+
const up = (e: PointerEvent) => d && e.pointerId === d.id && end(true);
|
|
76
|
+
const cancel = () => end(false);
|
|
77
|
+
// A held finger: no page scroll and no long-press menu while it drags.
|
|
78
|
+
const touch = (e: TouchEvent) => ranking && e.preventDefault();
|
|
79
|
+
const menu = (e: Event) => d && e.preventDefault();
|
|
80
|
+
const key = (e: KeyboardEvent) => {
|
|
81
|
+
if (ranking && e.key === "Escape") (e.preventDefault(), end(false));
|
|
82
|
+
};
|
|
83
|
+
box.addEventListener("pointerdown", down);
|
|
84
|
+
box.addEventListener("pointermove", move);
|
|
85
|
+
box.addEventListener("pointerup", up);
|
|
86
|
+
box.addEventListener("pointercancel", cancel);
|
|
87
|
+
box.addEventListener("touchmove", touch, { passive: false });
|
|
88
|
+
box.addEventListener("contextmenu", menu, true);
|
|
89
|
+
addEventListener("keydown", key);
|
|
90
|
+
return () => {
|
|
91
|
+
clearTimeout(d?.hold);
|
|
92
|
+
box.removeEventListener("pointerdown", down);
|
|
93
|
+
box.removeEventListener("pointermove", move);
|
|
94
|
+
box.removeEventListener("pointerup", up);
|
|
95
|
+
box.removeEventListener("pointercancel", cancel);
|
|
96
|
+
box.removeEventListener("touchmove", touch);
|
|
97
|
+
box.removeEventListener("contextmenu", menu, true);
|
|
98
|
+
removeEventListener("keydown", key);
|
|
99
|
+
};
|
|
100
|
+
}, [ref]);
|
|
101
|
+
// True once for the click that ends a drag.
|
|
102
|
+
const swallow = () => {
|
|
103
|
+
const was = click.current;
|
|
104
|
+
click.current = false;
|
|
105
|
+
return was;
|
|
106
|
+
};
|
|
107
|
+
return { view, swallow };
|
|
108
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// The popup's requests: both reads, killing a terminal, opening one, and the disk cleanup.
|
|
2
|
+
import { host, toast } from "@lib/core";
|
|
3
|
+
import { setResources, useResources } from "./resources-store.ts";
|
|
4
|
+
|
|
5
|
+
export async function loadResources() {
|
|
6
|
+
try {
|
|
7
|
+
const res = await (await fetch("/resources")).json();
|
|
8
|
+
const h = useResources.getState().history;
|
|
9
|
+
setResources({ res, history: [...h, (res.system.used / res.system.total) * 100].slice(-60) });
|
|
10
|
+
} catch {
|
|
11
|
+
/* board restarting */
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export async function loadDisk(refresh = false) {
|
|
15
|
+
try {
|
|
16
|
+
setResources({ disk: await (await fetch("/resources/storage" + (refresh ? "?refresh=1" : ""))).json() });
|
|
17
|
+
} catch {
|
|
18
|
+
/* board restarting */
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export async function killTerminal(key: string) {
|
|
22
|
+
setResources({ confirm: "" });
|
|
23
|
+
const r = await fetch("/pty/kill", {
|
|
24
|
+
method: "POST",
|
|
25
|
+
headers: { "content-type": "application/json" },
|
|
26
|
+
body: JSON.stringify({ key }),
|
|
27
|
+
}).catch(() => null);
|
|
28
|
+
setResources({ failed: r?.ok ? "" : "Could not kill that terminal." });
|
|
29
|
+
await loadResources();
|
|
30
|
+
}
|
|
31
|
+
// Cleanup: a new Claude Code in the Home window, starting on the disk-cleanup skill.
|
|
32
|
+
export const startCleanup = () =>
|
|
33
|
+
void host.open.homeStart({ agent: "claude", prompt: "/disk-cleanup" });
|
|
34
|
+
// Open: the board shows that terminal in its workspace; with no board to answer, the page goes there.
|
|
35
|
+
export function openTerminal(t: { key: string; dir?: string; ws: string }) {
|
|
36
|
+
setResources({ open: false, confirm: "", failed: "" });
|
|
37
|
+
if (!host.open.term({ dir: t.dir, ws: t.ws, key: t.key }))
|
|
38
|
+
location.href = `/?view=ws&dir=${encodeURIComponent(t.dir ?? "")}&ws=${encodeURIComponent(t.ws)}`;
|
|
39
|
+
}
|
|
40
|
+
export async function loadPorts() {
|
|
41
|
+
try {
|
|
42
|
+
const r = await fetch("/ports");
|
|
43
|
+
// Not ok: a board started before the Ports list existed has no such route; say so instead of reading forever.
|
|
44
|
+
setResources(r.ok ? { ports: await r.json(), portsError: "" } : { portsError: "The board is older than this list: restart it to see ports." });
|
|
45
|
+
} catch {
|
|
46
|
+
setResources({ portsError: "The board did not answer." });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Stop: the board stops what listens on that port (a process of this user, never the board itself), then the list is read again.
|
|
50
|
+
export async function stopPortOf(port: number) {
|
|
51
|
+
setResources({ confirmPort: 0 });
|
|
52
|
+
try {
|
|
53
|
+
const r = await fetch("/port/stop", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ port }) });
|
|
54
|
+
if (!r.ok) toast(`Could not stop localhost:${port}: ${((await r.json()) as { error?: string }).error ?? "unknown error"}`);
|
|
55
|
+
} catch {
|
|
56
|
+
toast(`Could not stop localhost:${port}: the board did not answer`);
|
|
57
|
+
}
|
|
58
|
+
await loadPorts();
|
|
59
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// The footer resource popup's state: the last /resources and /resources/storage reads, memory over the last minutes (kept in
|
|
2
|
+
// this page only), which tiles are open (kept in this browser) and the terminal being asked about killing.
|
|
3
|
+
import { create } from "zustand";
|
|
4
|
+
import type { Disk, Port, Resources } from "./rules.ts";
|
|
5
|
+
|
|
6
|
+
const flag = (k: string) => {
|
|
7
|
+
try {
|
|
8
|
+
return localStorage.getItem(k) === "1";
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const useResources = create<{
|
|
14
|
+
res: Resources | null;
|
|
15
|
+
disk: Disk | null;
|
|
16
|
+
history: number[];
|
|
17
|
+
ports: Port[] | null;
|
|
18
|
+
portsError: string;
|
|
19
|
+
confirmPort: number; // the port whose Stop awaits Keep or Stop
|
|
20
|
+
open: boolean; // the popup
|
|
21
|
+
memOpen: boolean;
|
|
22
|
+
diskOpen: boolean;
|
|
23
|
+
confirm: string; // the terminal key whose Kill awaits Keep or Kill
|
|
24
|
+
failed: string;
|
|
25
|
+
}>()(() => ({
|
|
26
|
+
res: null,
|
|
27
|
+
disk: null,
|
|
28
|
+
history: [],
|
|
29
|
+
ports: null,
|
|
30
|
+
portsError: "",
|
|
31
|
+
confirmPort: 0,
|
|
32
|
+
open: false,
|
|
33
|
+
memOpen: flag("kz-res-mem"),
|
|
34
|
+
diskOpen: flag("kz-res-disk"),
|
|
35
|
+
confirm: "",
|
|
36
|
+
failed: "",
|
|
37
|
+
}));
|
|
38
|
+
export const setResources = useResources.setState;
|
|
39
|
+
export function foldTile(which: "mem" | "disk") {
|
|
40
|
+
const k = which === "mem" ? "memOpen" : "diskOpen",
|
|
41
|
+
v = !useResources.getState()[k];
|
|
42
|
+
try {
|
|
43
|
+
localStorage.setItem("kz-res-" + which, v ? "1" : "0");
|
|
44
|
+
} catch {}
|
|
45
|
+
useResources.setState({ [k]: v });
|
|
46
|
+
}
|
|
47
|
+
// The popup closed: a half-answered Kill question and an old failure go with it.
|
|
48
|
+
export const setOpen = (open: boolean) => useResources.setState(open ? { open } : { open, confirm: "", confirmPort: 0, failed: "" });
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// The footer resource popup's numbers without the DOM (tested in resources-rules.test.ts): sizes, the bar's parts and the
|
|
2
|
+
// rings and sparkline paths.
|
|
3
|
+
export type Terminal = {
|
|
4
|
+
key: string;
|
|
5
|
+
title: string;
|
|
6
|
+
agent?: string;
|
|
7
|
+
project?: string;
|
|
8
|
+
ws: string;
|
|
9
|
+
dir?: string;
|
|
10
|
+
rss?: number | null;
|
|
11
|
+
};
|
|
12
|
+
// A port a process of one of the board's projects listens on (GET /ports).
|
|
13
|
+
export type Port = { port: number; pid: number; name: string; cmd: string; cwd: string; project: string };
|
|
14
|
+
export type Resources = { system: { used: number; total: number }; kaizen: number; terminals: Terminal[] };
|
|
15
|
+
export type Disk = { at?: number; total: number; rows: { name: string; bytes: number }[]; scanning?: boolean };
|
|
16
|
+
|
|
17
|
+
export const size = (n: number) => {
|
|
18
|
+
if (n < 1024 ** 2) return `${Math.round(n / 1024)} KB`;
|
|
19
|
+
if (n < 1024 ** 3) return `${Math.round(n / 1024 ** 2)} MB`;
|
|
20
|
+
return `${(n / 1024 ** 3).toFixed(1)} GB`;
|
|
21
|
+
};
|
|
22
|
+
export const usedPct = (r: Resources) => Math.round((r.system.used / r.system.total) * 100);
|
|
23
|
+
// The ring's circumference (r 15) and the part of it a percentage fills.
|
|
24
|
+
export const RING = 94.25;
|
|
25
|
+
export const ringDash = (pct: number) => ((pct / 100) * RING).toFixed(1);
|
|
26
|
+
// Memory in three parts: Kaizen and its terminals, the other apps, what is free.
|
|
27
|
+
export const memParts = (r: Resources): [string, number][] => [
|
|
28
|
+
["Kaizen and its terminals", r.kaizen],
|
|
29
|
+
["Other apps", Math.max(0, r.system.used - r.kaizen)],
|
|
30
|
+
["Free", Math.max(0, r.system.total - r.system.used)],
|
|
31
|
+
];
|
|
32
|
+
// The largest rows, the rest folded into one, so the bar stays readable.
|
|
33
|
+
export const topParts = (rows: { name: string; bytes: number }[]): [string, number][] => {
|
|
34
|
+
const head = rows.slice(0, 4).map((r) => [r.name, r.bytes] as [string, number]),
|
|
35
|
+
left = rows.slice(4).reduce((n, r) => n + r.bytes, 0);
|
|
36
|
+
return left ? [...head, ["Other", left]] : head;
|
|
37
|
+
};
|
|
38
|
+
export const shareOf = (parts: [string, number][], v: number) =>
|
|
39
|
+
Math.round((v / (parts.reduce((n, p) => n + p[1], 0) || 1)) * 100);
|
|
40
|
+
// Heaviest terminal first.
|
|
41
|
+
export const heaviest = (ts: Terminal[]) => [...ts].sort((a, b) => (b.rss ?? 0) - (a.rss ?? 0));
|
|
42
|
+
// The last minutes of memory use as an area and a line in a 100 x 36 box; null until there are two points.
|
|
43
|
+
export function sparkPoints(history: number[]): { line: string; area: string } | null {
|
|
44
|
+
if (history.length < 2) return null;
|
|
45
|
+
const x = (i: number) => (i / (history.length - 1)) * 100,
|
|
46
|
+
y = (v: number) => 36 - v * 0.34;
|
|
47
|
+
const line = history.map((v, i) => `${x(i).toFixed(1)},${y(v).toFixed(1)}`).join(" ");
|
|
48
|
+
return { line, area: `0,36 ${line} 100,36` };
|
|
49
|
+
}
|
|
50
|
+
// Folder name of a terminal's workspace for its second line.
|
|
51
|
+
export const wsName = (t: Terminal) => `${t.project || "Home"} / ${t.ws.split(/[\\/]/).pop() || "main"}`;
|
|
52
|
+
// A process's command for a row: the program by its name, then the rest, cut to fit ("/usr/bin/node /app/vite.js --port 5173" -> "node /app/vite.js --port 5173").
|
|
53
|
+
export const shortCmd = (cmd: string, max = 56) => {
|
|
54
|
+
const t = cmd.trim().replace(/\s+/g, " ").replace(/^(\S*[\\/])?([^\\/\s]+)/, "$2");
|
|
55
|
+
return t.length > max ? t.slice(0, max - 1) + "…" : t;
|
|
56
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Which page the board shows, without the DOM (tested in router.test.ts): the view an address or a name asks for, what a phone
|
|
2
|
+
// does with it, the <body> classes the legacy stylesheet keys on, the address a view has, the pages that are drawn when first
|
|
3
|
+
// opened, and the run an address names.
|
|
4
|
+
export type View =
|
|
5
|
+
"home" | "chat" | "device" | "board" | "tasks" | "task" | "run" | "sources" | "terminal" | "settings";
|
|
6
|
+
const KNOWN = ["settings", "sources", "terminal", "board", "tasks", "task", "run", "chat", "device"];
|
|
7
|
+
// The view a name (the ?view= value or a menu item) asks for. Aliases: icebox is sources, ws is the run workspace, ideas is
|
|
8
|
+
// tasks; anything unknown is Home. A phone keeps Runs and Tasks reachable and has no Board, Icebox or Chat page; a computer
|
|
9
|
+
// has no Runs page.
|
|
10
|
+
export function resolveView(name: string | null | undefined, phone: boolean): View {
|
|
11
|
+
let v = name === "icebox" ? "sources" : name === "ws" ? "run" : name === "ideas" ? "tasks" : (name ?? "");
|
|
12
|
+
if (!KNOWN.includes(v)) v = "home";
|
|
13
|
+
if (phone ? v === "board" || v === "sources" : v === "chat" || v === "device") v = "home";
|
|
14
|
+
return v as View;
|
|
15
|
+
}
|
|
16
|
+
export const viewOf = (search: string, phone: boolean) => resolveView(new URLSearchParams(search).get("view"), phone);
|
|
17
|
+
// The view a page opens on. Only the board's own address names a view, wherever the board is served (at "/" or under a
|
|
18
|
+
// prefix): the Notebook page (<html data-kit>) lights the Board icon, as it always did.
|
|
19
|
+
export const startView = (search: string, phone: boolean, notebook: boolean): View => (notebook ? "board" : viewOf(search, phone));
|
|
20
|
+
|
|
21
|
+
// The classes on <body> that show one page area and its header buttons (web/ui/legacy/board.css keys on them).
|
|
22
|
+
export function bodyClasses(v: View, phone: boolean) {
|
|
23
|
+
const ph = phone && v === "home";
|
|
24
|
+
return {
|
|
25
|
+
paged: v !== "board",
|
|
26
|
+
ice: v === "sources",
|
|
27
|
+
setv: v === "settings",
|
|
28
|
+
termv: v === "terminal",
|
|
29
|
+
homev: (v === "home" && !ph) || v === "chat",
|
|
30
|
+
phomev: ph || v === "device",
|
|
31
|
+
pdevv: v === "device",
|
|
32
|
+
taskv: v === "tasks",
|
|
33
|
+
taskpagev: v === "task",
|
|
34
|
+
runv: v === "run",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// The address a view has when it is opened from the menu (a run and a task push their own).
|
|
38
|
+
export const urlFor = (v: View, pathname: string) =>
|
|
39
|
+
v === "home" ? pathname : "?view=" + (v === "sources" ? "icebox" : v);
|
|
40
|
+
// The side menu item that is lit and the header's title for a view (a phone's run workspace belongs to its Runs tab).
|
|
41
|
+
export const litItem = (v: View, phone: boolean) =>
|
|
42
|
+
v === "task" ? (phone ? "device" : "tasks") : v === "run" && phone ? "device" : v;
|
|
43
|
+
const TITLES: Record<string, string> = {
|
|
44
|
+
sources: "Icebox",
|
|
45
|
+
tasks: "Tasks",
|
|
46
|
+
task: "Task",
|
|
47
|
+
run: "Run",
|
|
48
|
+
terminal: "Terminal",
|
|
49
|
+
chat: "Chat",
|
|
50
|
+
device: "Runs",
|
|
51
|
+
};
|
|
52
|
+
// Home reads Chat on a computer and shows the wordmark on a phone (the header's title is the logo there).
|
|
53
|
+
export const viewTitle = (v: View, phone: boolean) =>
|
|
54
|
+
v === "home" ? (phone ? "kaizen" : "Chat") : (TITLES[v] ?? "Board");
|
|
55
|
+
// The pages that are drawn the first time they open and kept after; and the React page the core stores call it.
|
|
56
|
+
export const pageSeen = (v: View, phone: boolean) =>
|
|
57
|
+
v === "tasks"
|
|
58
|
+
? "tasks"
|
|
59
|
+
: v === "task"
|
|
60
|
+
? "task"
|
|
61
|
+
: v === "sources"
|
|
62
|
+
? "icebox"
|
|
63
|
+
: (v === "home" && !phone) || v === "chat"
|
|
64
|
+
? "home"
|
|
65
|
+
: "";
|
|
66
|
+
export type Page = "tasks" | "task" | "icebox" | "";
|
|
67
|
+
export const pageOf = (v: View): Page =>
|
|
68
|
+
v === "tasks" ? "tasks" : v === "task" ? "task" : v === "sources" ? "icebox" : "";
|
|
69
|
+
// The run a ?view=run (or ?view=ws) address names: a workspace by folder and path, a run by id, a task by its text.
|
|
70
|
+
export type RunRoute = { dir: string; ws?: string; id?: string; idea?: string };
|
|
71
|
+
export function runOf(search: string): RunRoute | null {
|
|
72
|
+
const p = new URLSearchParams(search);
|
|
73
|
+
if (p.get("view") !== "run" && p.get("view") !== "ws") return null;
|
|
74
|
+
const dir = p.get("dir");
|
|
75
|
+
if (!dir) return null;
|
|
76
|
+
return {
|
|
77
|
+
dir,
|
|
78
|
+
...(p.get("ws") ? { ws: p.get("ws")! } : {}),
|
|
79
|
+
...(p.get("id") ? { id: p.get("id")! } : {}),
|
|
80
|
+
...(p.get("idea") !== null ? { idea: p.get("idea")! } : {}),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// A link from a note (?run= or ?idea=, with dir, tab, item) names a card to open in the panel, on one of its tabs, a finding or
|
|
85
|
+
// backlog item marked. null: the address is not one (a workspace address, ?view=run&idea=, is the run view's own). An item's
|
|
86
|
+
// tab is its own when the link names none; `work` is the Work tab's old name.
|
|
87
|
+
export type Deep = { dir: string | null; run: string | null; idea: string | null; tab: string; item: { type: "finding" | "backlog"; n: number } | null };
|
|
88
|
+
export function deepOf(search: string): Deep | null {
|
|
89
|
+
const p = new URLSearchParams(search),
|
|
90
|
+
run = p.get("run"),
|
|
91
|
+
idea = p.get("idea");
|
|
92
|
+
if ((!run && idea === null) || p.get("view") === "run") return null;
|
|
93
|
+
const m = /^(finding|backlog)-(\d+)$/.exec(p.get("item") || ""),
|
|
94
|
+
n = p.get("tab") || (m ? (m[1] === "finding" ? "review" : "backlog") : "");
|
|
95
|
+
return { dir: p.get("dir"), run, idea, tab: n === "work" ? "impl" : n, item: m ? { type: m[1] as "finding" | "backlog", n: +m[2]! } : null };
|
|
96
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// The board's router as state (Zustand): the view the address names (?view=, no router library), what the side menu lights and the
|
|
2
|
+
// header titles, the pages opened so far, the address's query and the run it names. `navigate` is the only way a view changes:
|
|
3
|
+
// it sets the store (the App draws the page and sets the <body> classes from it), pushes the address, and calls the engine
|
|
4
|
+
// hooks for the engines (the docked panel, the run workspace, Settings).
|
|
5
|
+
import { flushSync } from "react-dom";
|
|
6
|
+
import { create } from "zustand";
|
|
7
|
+
import { isPhone, vt } from "@lib/core";
|
|
8
|
+
import {
|
|
9
|
+
bodyClasses,
|
|
10
|
+
litItem,
|
|
11
|
+
pageOf,
|
|
12
|
+
pageSeen,
|
|
13
|
+
resolveView,
|
|
14
|
+
runOf,
|
|
15
|
+
urlFor,
|
|
16
|
+
startView,
|
|
17
|
+
viewTitle,
|
|
18
|
+
type Page,
|
|
19
|
+
type RunRoute,
|
|
20
|
+
type View,
|
|
21
|
+
} from "./route-rules.ts";
|
|
22
|
+
|
|
23
|
+
export type Route = {
|
|
24
|
+
view: View;
|
|
25
|
+
lit: string; // the side menu item marked as the current page
|
|
26
|
+
title: string; // the header's title
|
|
27
|
+
mark: boolean; // the header shows the wordmark instead of the title (a phone's Home)
|
|
28
|
+
page: Page; // the React page the Tasks, task and Icebox hooks work for
|
|
29
|
+
seen: string[]; // pages drawn the first time they open and kept after
|
|
30
|
+
search: string; // location.search at the last change: the row it names is lit
|
|
31
|
+
run: RunRoute | null; // the workspace or run the address names
|
|
32
|
+
menu: boolean; // the phone's navigation menu is open
|
|
33
|
+
visit: number; // counts `navigate` calls: a view opened again (a card or workspace opened in place) is a new visit
|
|
34
|
+
};
|
|
35
|
+
const about = (v: View, phone: boolean) => ({
|
|
36
|
+
view: v,
|
|
37
|
+
lit: litItem(v, phone),
|
|
38
|
+
title: viewTitle(v, phone),
|
|
39
|
+
mark: v === "home" && phone,
|
|
40
|
+
page: pageOf(v),
|
|
41
|
+
});
|
|
42
|
+
const seeing = (seen: string[], v: View, phone: boolean) => {
|
|
43
|
+
const p = pageSeen(v, phone);
|
|
44
|
+
return p && !seen.includes(p) ? [...seen, p] : seen;
|
|
45
|
+
};
|
|
46
|
+
// The first paint already shows the page the address names.
|
|
47
|
+
const first = (): Route => {
|
|
48
|
+
const search = typeof location === "undefined" ? "" : location.search,
|
|
49
|
+
phone = typeof matchMedia === "undefined" ? false : isPhone(),
|
|
50
|
+
v = startView(search, phone, typeof document !== "undefined" && document.documentElement.hasAttribute("data-kit"));
|
|
51
|
+
return { ...about(v, phone), seen: seeing([], v, phone), search, run: runOf(search), menu: false, visit: 0 };
|
|
52
|
+
};
|
|
53
|
+
export const useRoute = create<Route>()(first);
|
|
54
|
+
export const getRoute = useRoute.getState;
|
|
55
|
+
|
|
56
|
+
// The engine's side of a view change: `prepare` before the store changes (the task page learns which task), `leave` before
|
|
57
|
+
// the address is pushed (a workspace's terminals unmount, the panel closes), `enter` after it (the page's own start-up);
|
|
58
|
+
// `before` is a menu click that wants something set first.
|
|
59
|
+
type Hooks = {
|
|
60
|
+
before?(v: View): void;
|
|
61
|
+
prepare?(v: View): void;
|
|
62
|
+
leave?(v: View, was: View): void;
|
|
63
|
+
enter?(v: View, was: View): void;
|
|
64
|
+
};
|
|
65
|
+
let hooks: Hooks = {};
|
|
66
|
+
export const setRouterHooks = (h: Hooks) => (hooks = h);
|
|
67
|
+
|
|
68
|
+
// The address changed without a view change (a card or a workspace opened in place): the row it names lights.
|
|
69
|
+
// The header's title for a view whose name is not the view's own (a workspace is titled by its run or branch).
|
|
70
|
+
export const setTitle = (title: string) => useRoute.setState({ title });
|
|
71
|
+
export const touchRoute = () => useRoute.setState({ search: location.search, run: runOf(location.search) });
|
|
72
|
+
export function navigate(to: string | null | undefined, push = false) {
|
|
73
|
+
const phone = isPhone(),
|
|
74
|
+
v = resolveView(to, phone),
|
|
75
|
+
was = getRoute().view;
|
|
76
|
+
hooks.prepare?.(v);
|
|
77
|
+
// At once: a view transition reads the new title and the lit menu item as the callback returns.
|
|
78
|
+
flushSync(() => useRoute.setState((r) => ({ ...about(v, phone), seen: seeing(r.seen, v, phone), menu: false, visit: r.visit + 1 })));
|
|
79
|
+
hooks.leave?.(v, was);
|
|
80
|
+
// The workspace's address names its card (the run view pushes it); a task pushes its own.
|
|
81
|
+
if (push && v !== was && v !== "run" && v !== "task") history.pushState(null, "", urlFor(v, location.pathname));
|
|
82
|
+
touchRoute();
|
|
83
|
+
hooks.enter?.(v, was);
|
|
84
|
+
}
|
|
85
|
+
// Home's chat holds a stream the person is reading: true while its page shows.
|
|
86
|
+
export const homeShows = () => bodyClasses(getRoute().view, isPhone()).homev;
|
|
87
|
+
export const toggleMenu = () => useRoute.setState((r) => ({ menu: !r.menu }));
|
|
88
|
+
// The menu's links and the browser's back and forward: one place. A second click on the Board goes back to where the first
|
|
89
|
+
// one came from.
|
|
90
|
+
let boardBack = false;
|
|
91
|
+
// A menu entry's click (the side menu's anchors, and the Search palette's pages): the page opens with a history entry; the Board
|
|
92
|
+
// entry is a toggle, a second press goes back to where it came from.
|
|
93
|
+
export function menuGo(name: string) {
|
|
94
|
+
hooks.before?.(resolveView(name, isPhone()));
|
|
95
|
+
if (name === "board" && getRoute().view === "board") {
|
|
96
|
+
const back = boardBack;
|
|
97
|
+
boardBack = false;
|
|
98
|
+
return void (back ? history.back() : vt(() => navigate("home", true)));
|
|
99
|
+
}
|
|
100
|
+
vt(() => {
|
|
101
|
+
navigate(name, true);
|
|
102
|
+
boardBack = name === "board";
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
export function startRouter() {
|
|
106
|
+
addEventListener("popstate", () => vt(() => navigate(new URLSearchParams(location.search).get("view"))));
|
|
107
|
+
document.addEventListener("click", (e) => {
|
|
108
|
+
const a = (e.target as Element).closest?.<HTMLAnchorElement>(".rail a[data-view], .rail a.home");
|
|
109
|
+
if (!a || e.ctrlKey || e.metaKey || e.shiftKey || e.button) return;
|
|
110
|
+
const name = a.classList.contains("home") ? "home" : a.dataset.view!;
|
|
111
|
+
if (name === "notes" || name === "video") return;
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
menuGo(name);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import { isPhone } from "@lib/core";
|
|
3
|
+
import { bodyClasses } from "./route-rules.ts";
|
|
4
|
+
import { useRoute } from "./route-store.ts";
|
|
5
|
+
|
|
6
|
+
// The page the router names is the one the stylesheet shows: the <body> classes follow the route (and the phone menu).
|
|
7
|
+
export function useRouteClasses() {
|
|
8
|
+
const view = useRoute((r) => r.view),
|
|
9
|
+
menu = useRoute((r) => r.menu);
|
|
10
|
+
useLayoutEffect(() => {
|
|
11
|
+
const on = bodyClasses(view, isPhone());
|
|
12
|
+
for (const [k, v] of Object.entries(on)) document.body.classList.toggle(k, v);
|
|
13
|
+
document.body.classList.toggle("phone-menu-open", menu);
|
|
14
|
+
}, [view, menu]);
|
|
15
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// The Browser tab's address and history as plain data. `load` counts the times the frame must load the address
|
|
2
|
+
// (go, back, forward, reload); a page that navigated on its own only changes the address (`landed`), so the frame is
|
|
3
|
+
// not loaded a second time.
|
|
4
|
+
export type Nav = { url: string; back: string[]; fwd: string[]; load: number };
|
|
5
|
+
export const DEFAULT_URL = "http://localhost:3000";
|
|
6
|
+
export const browseKey = (k: string) => "kz-browse:" + k;
|
|
7
|
+
// The address kept for a workspace, else localhost:3000.
|
|
8
|
+
export function startUrl(k: string): string {
|
|
9
|
+
try {
|
|
10
|
+
return localStorage.getItem(browseKey(k)) || DEFAULT_URL;
|
|
11
|
+
} catch {
|
|
12
|
+
return DEFAULT_URL;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function keepUrl(k: string, u: string) {
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem(browseKey(k), u);
|
|
18
|
+
} catch {}
|
|
19
|
+
}
|
|
20
|
+
// A typed address without a scheme is http.
|
|
21
|
+
export const withScheme = (v: string) => (/^https?:\/\//.test(v.trim()) ? v.trim() : "http://" + v.trim());
|
|
22
|
+
export const isLoopback = (u: string) => /^https?:\/\/(localhost|127\.0\.0\.1|\[::1\])(:|\/|$)/.test(u);
|
|
23
|
+
export const start = (url: string): Nav => ({ url, back: [], fwd: [], load: 0 });
|
|
24
|
+
export const navTo = (n: Nav, u: string, push = true): Nav =>
|
|
25
|
+
push && n.url !== u
|
|
26
|
+
? { url: u, back: [...n.back, n.url], fwd: [], load: n.load + 1 }
|
|
27
|
+
: { ...n, url: u, load: n.load + 1 };
|
|
28
|
+
export const navReload = (n: Nav): Nav => navTo(n, n.url, false);
|
|
29
|
+
export const navBack = (n: Nav): Nav =>
|
|
30
|
+
n.back.length ? { url: n.back.at(-1)!, back: n.back.slice(0, -1), fwd: [...n.fwd, n.url], load: n.load + 1 } : n;
|
|
31
|
+
export const navFwd = (n: Nav): Nav =>
|
|
32
|
+
n.fwd.length ? { url: n.fwd.at(-1)!, back: [...n.back, n.url], fwd: n.fwd.slice(0, -1), load: n.load + 1 } : n;
|
|
33
|
+
export const landed = (n: Nav, u: string): Nav =>
|
|
34
|
+
u === n.url ? n : { url: u, back: [...n.back, n.url], fwd: [], load: n.load };
|
|
35
|
+
|
|
36
|
+
export const FAR =
|
|
37
|
+
"This page is on the computer running kaizen; from this device localhost is the device itself. Use Open in browser on that computer.";
|
|
38
|
+
// What /expose answered for a loopback page on a device that is not the board's computer.
|
|
39
|
+
export type Exposed = { ok: boolean; url?: string; hint?: string; error?: string };
|
|
40
|
+
const json = { "content-type": "application/json" };
|
|
41
|
+
export const expose = (url: string): Promise<Exposed> =>
|
|
42
|
+
fetch("/expose", { method: "POST", headers: json, body: JSON.stringify({ url }) }).then((r) => r.json());
|
|
43
|
+
// Whether a site can be framed (X-Frame-Options / frame-ancestors): the browser only shows its own error page otherwise.
|
|
44
|
+
export const frameable = (url: string): Promise<{ frameable?: boolean }> =>
|
|
45
|
+
fetch("/frameable?url=" + encodeURIComponent(url)).then((r) => r.json());
|
|
46
|
+
// A Chromium app window on the board's computer (POST /open-url); the error to say when it did not open, or null.
|
|
47
|
+
export async function openAppWindow(url: string): Promise<string | null> {
|
|
48
|
+
const r = await fetch("/open-url", { method: "POST", headers: json, body: JSON.stringify({ url }) }).catch(
|
|
49
|
+
() => null,
|
|
50
|
+
);
|
|
51
|
+
if (r?.ok) return null;
|
|
52
|
+
return "Could not open a browser window" + (r ? ": " + ((await r.json().catch(() => ({}))) as any).error : "");
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getServer, load } from "@lib/server";
|
|
2
|
+
import { getPanel, setPanel } from "./panel-store.ts";
|
|
3
|
+
|
|
4
|
+
// ---- the in-card agent (agents run in the card). The terminal is React (components/panes/terminal-pane.tsx, drawn by
|
|
5
|
+
// pages/board/panel.tsx into #pbody). A terminal is mounted once per session and kept (`terms`), hidden while another body
|
|
6
|
+
// shows, so a tab or card switch never reconnects it and its screen and focus are as they were; it goes when its session does.
|
|
7
|
+
let termKey: string | null = null;
|
|
8
|
+
export function termStop() {
|
|
9
|
+
if (termKey)
|
|
10
|
+
setPanel((s) => (s.body === "term" ? { body: "", term: null, wide: false } : { term: null, wide: false }));
|
|
11
|
+
termKey = null;
|
|
12
|
+
}
|
|
13
|
+
export function showTerm(c: { pty: { key: string } }) {
|
|
14
|
+
const k = c.pty.key;
|
|
15
|
+
if (termKey === k && getPanel().body === "term") return;
|
|
16
|
+
termStop();
|
|
17
|
+
termKey = k;
|
|
18
|
+
setPanel((s) => ({
|
|
19
|
+
body: "term",
|
|
20
|
+
term: { key: k, onEnd: () => load(true) },
|
|
21
|
+
wide: true,
|
|
22
|
+
terms: s.terms.some((t) => t.key === k) ? s.terms : [...s.terms, { key: k, onEnd: () => load(true) }],
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
// A terminal whose session no card has any more is unmounted.
|
|
26
|
+
export function pruneTerms() {
|
|
27
|
+
const live = new Set(
|
|
28
|
+
getServer().state.cards.flatMap((c: any) => (c.pty ? [c.pty.key, ...(c.pty.all ?? [])] : [])) as string[],
|
|
29
|
+
);
|
|
30
|
+
const { terms } = getPanel();
|
|
31
|
+
if (terms.some((t) => !live.has(t.key))) setPanel({ terms: terms.filter((t) => live.has(t.key)) });
|
|
32
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// The run panel's document tabs (Request, Explore, Plan, Backlog, Work, Review, Preview), with no DOM: what an empty tab
|
|
2
|
+
// says, a building run's progress list read from its progress.md, and the line a link to a finding or backlog item points at.
|
|
3
|
+
export const NONE: Record<string, string> = {
|
|
4
|
+
request: "request",
|
|
5
|
+
explore: "exploration brief",
|
|
6
|
+
plan: "plan",
|
|
7
|
+
impl: "work report",
|
|
8
|
+
preview: "preview",
|
|
9
|
+
review: "review",
|
|
10
|
+
backlog: "backlog",
|
|
11
|
+
};
|
|
12
|
+
export type Step = { st: "todo" | "doing" | "done"; text: string };
|
|
13
|
+
// progress.md: one `- todo|doing|done: text` line per Work-list item.
|
|
14
|
+
export function parseProgress(src: string): { steps: Step[]; done: number; pct: number } | null {
|
|
15
|
+
const steps = [...src.matchAll(/^\s*-\s*(todo|doing|done):\s*(.*)$/gm)].map((m) => ({
|
|
16
|
+
st: m[1] as Step["st"],
|
|
17
|
+
text: m[2]!,
|
|
18
|
+
}));
|
|
19
|
+
if (!steps.length) return null;
|
|
20
|
+
const done = steps.filter((s) => s.st === "done").length;
|
|
21
|
+
return { steps, done, pct: Math.round((done / steps.length) * 100) };
|
|
22
|
+
}
|
|
23
|
+
// The statuses and bar width last drawn for a run: the next draw marks what moved and slides the bar from there.
|
|
24
|
+
export type Drawn = { id: string; st: string[]; w: number };
|
|
25
|
+
export const moved = (prev: Drawn | null, steps: Step[], i: number) =>
|
|
26
|
+
!!prev && !!prev.st[i] && prev.st[i] !== steps[i]!.st;
|
|
27
|
+
// What markdown leaves of a line as text: no backticks or stars, a link reduced to its words.
|
|
28
|
+
export const flat = (t: unknown) =>
|
|
29
|
+
String(t)
|
|
30
|
+
.replace(/!?\[([^\]]*)\]\([^)\s]+\)/g, "$1")
|
|
31
|
+
.replace(/[`*]/g, "")
|
|
32
|
+
.replace(/\s+/g, " ")
|
|
33
|
+
.trim();
|
|
34
|
+
// The text of the finding or backlog item a link names (its first 60 characters, as flat text), or null when the run has no such item.
|
|
35
|
+
export function hitNeedle(
|
|
36
|
+
doc: { backlog?: string; findings?: { n: number; text: string }[] },
|
|
37
|
+
hit: { type: string; n: number },
|
|
38
|
+
): string | null {
|
|
39
|
+
const items = [...(doc.backlog || "").matchAll(/^\s*-\s*(?:open|done|rejected):\s*(.*)$/gm)];
|
|
40
|
+
const text = hit.type === "finding" ? (doc.findings || []).find((f) => f.n === hit.n)?.text : items[hit.n - 1]?.[1];
|
|
41
|
+
return text ? flat(text).slice(0, 60) : null;
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The run panel's width: dragged from its left edge, kept in localStorage, and clamped to between 260 px (or 60% of the
|
|
2
|
+
// window when that is wider) and what was asked for.
|
|
3
|
+
export const GRIP_KEY = "kz-rpanel-w";
|
|
4
|
+
export const GRIP_MIN = 260;
|
|
5
|
+
export const gripWidth = (w: number, win: number) =>
|
|
6
|
+
Math.round(Math.min(Math.max(GRIP_MIN, win * 0.6), Math.max(GRIP_MIN, w)));
|
|
7
|
+
export const setPanelWidth = (w: number) =>
|
|
8
|
+
document.documentElement.style.setProperty("--rpanel-w", `${gripWidth(w, innerWidth)}px`);
|