kaizen-agent 1.86.0 → 1.87.1
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/settings.ts +16 -17
- package/cli/state.ts +15 -29
- package/cli/task-service.ts +79 -17
- package/cli/tasks.ts +2 -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 +188 -58
- package/package.json +21 -4
- package/skills/kaizen/spec.md +10 -3
- 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 +113 -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 +134 -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 +397 -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.ts → term/term.ts} +48 -20
- 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 -103
- 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 -628
- 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 -505
- package/web/notebook.js +0 -519
- package/web/notebook.ts +0 -1254
- package/web/popup.html +0 -141
- package/web/video.js +0 -575
- /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
- /package/web/{term-paste.ts → term/term-paste.ts} +0 -0
package/web/board/panel.ts
DELETED
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
import { store } from "./store.ts";
|
|
2
|
-
import { showTerm, termStop } from "./agent-term.ts";
|
|
3
|
-
import { load, post } from "./api.ts";
|
|
4
|
-
import { APPROVAL, answer, confirmAnswers, confirmRevise, decide, decided, resumable, resume } from "./approvals.ts";
|
|
5
|
-
import { cardEl, formPopup, key, render, runPopup } from "./cards.ts";
|
|
6
|
-
import { chat } from "./chat.ts";
|
|
7
|
-
import { stopDictation } from "./dictation.ts";
|
|
8
|
-
import { $, html, raw } from "./dom.ts";
|
|
9
|
-
import { fixForm, fixOff } from "./fixes.ts";
|
|
10
|
-
import { gitPending, gitShown, gitTab } from "./git.ts";
|
|
11
|
-
import { ICON, WORD, need } from "./labels.ts";
|
|
12
|
-
import { attach, brief, md, planQuestions, preview, progress } from "./markdown.ts";
|
|
13
|
-
import { toast } from "./toast.ts";
|
|
14
|
-
import { view } from "./views.ts";
|
|
15
|
-
import { isPhone } from "./phone.ts";
|
|
16
|
-
import { openWorkspace } from "./run-view.ts";
|
|
17
|
-
|
|
18
|
-
// ---- detail panel
|
|
19
|
-
// A run's tabs, its phases in board order. A card opens on its column's tab.
|
|
20
|
-
const TABS = [
|
|
21
|
-
["Request", "request"],
|
|
22
|
-
["Notes", "notes"],
|
|
23
|
-
["Explore", "explore"],
|
|
24
|
-
["Plan", "plan"],
|
|
25
|
-
["Backlog", "backlog"],
|
|
26
|
-
["Work", "impl"],
|
|
27
|
-
["Review", "review"],
|
|
28
|
-
["Source control", "git"],
|
|
29
|
-
["Preview", "preview"],
|
|
30
|
-
];
|
|
31
|
-
// keepTab: a link already chose the tab.
|
|
32
|
-
const cap = (t) => t.charAt(0).toUpperCase() + t.slice(1);
|
|
33
|
-
// "2026-10-18-board-ui-revision" or "board-ui-revision" reads "Board UI revision".
|
|
34
|
-
const readable = (t) =>
|
|
35
|
-
/\s/.test(t)
|
|
36
|
-
? t
|
|
37
|
-
: cap(
|
|
38
|
-
t
|
|
39
|
-
.replace(/^\d{4}-\d{2}-\d{2}-/, "")
|
|
40
|
-
.split(/[-_]/)
|
|
41
|
-
.map((w) => (/^(ui|ux|api|cli|ai|ci|id|url|pr|tui|ios|pwa)$/i.test(w) ? w.toUpperCase() : w))
|
|
42
|
-
.join(" "),
|
|
43
|
-
);
|
|
44
|
-
// Set while a card waits for its workspace to mount this panel: the tab it asked for survives.
|
|
45
|
-
let keepNext = false;
|
|
46
|
-
export function open(c, keepTab) {
|
|
47
|
-
// A run is worked on in its workspace, which docks this panel; so is everything on a phone.
|
|
48
|
-
// Tasks keep the panel on the Board and Tasks pages. An archived run has no workspace row: it stays here to be restored.
|
|
49
|
-
const here = view === "board" || view === "tasks";
|
|
50
|
-
if (view !== "run" && (isPhone() || !here || (c.kind === "run" && !c.archived))) {
|
|
51
|
-
keepNext = !!keepTab;
|
|
52
|
-
return void openWorkspace(c);
|
|
53
|
-
}
|
|
54
|
-
keepTab ||= keepNext;
|
|
55
|
-
keepNext = false;
|
|
56
|
-
stopDictation(true); // the panel body is about to be replaced
|
|
57
|
-
fixOff.clear();
|
|
58
|
-
store.openKey = key(c);
|
|
59
|
-
$("panel").classList.add("open");
|
|
60
|
-
$("scrim").classList.add("on");
|
|
61
|
-
// A run is titled as its card is, its slug made readable; the id stays in the tooltip.
|
|
62
|
-
$("ptitle").textContent = c.kind === "idea" ? brief(c.text).head : readable(c.title || c.text);
|
|
63
|
-
$("ptitle").title = c.kind === "idea" ? "" : c.id || "";
|
|
64
|
-
render();
|
|
65
|
-
$("pterm").hidden = true;
|
|
66
|
-
if (c.kind === "idea") {
|
|
67
|
-
store.runDoc = null;
|
|
68
|
-
$("psub").innerHTML = c.status === "starting" && !c.archived ? steps(c) : html`<span class="pst"><span class="st d-idea"><svg><use href="#s-idea"/></svg></span>Task</span><span class="pst dim">${c.where.split(/[\\/]/).pop() || c.where}</span>`;
|
|
69
|
-
$("ptabs").innerHTML = "";
|
|
70
|
-
taskBody(c);
|
|
71
|
-
const foot = $("pfoot");
|
|
72
|
-
foot.innerHTML = c.archived
|
|
73
|
-
? `<button class="btn pri" data-a="restore">Restore</button>`
|
|
74
|
-
: c.status === "idea"
|
|
75
|
-
? `<button class="btn ghost danger" data-a="delete">Delete</button><button class="btn ghost" data-a="archive">Archive</button><span class="dec"><button class="btn" data-a="reject">Reject</button><button class="btn" data-a="edit">Edit</button><button class="btn pri" data-a="run">Run</button></span>`
|
|
76
|
-
: `<span class="note">${c.pty ? "Starting: the agent runs below." : "Starting: a run was launched for this task. No terminal with your agent? Run it again."}</span><span class="dec"><button class="btn" data-a="run">Run again</button></span>`;
|
|
77
|
-
foot.querySelectorAll("[data-a]").forEach(
|
|
78
|
-
(b) =>
|
|
79
|
-
(b.onclick = () => {
|
|
80
|
-
const a = b.dataset.a;
|
|
81
|
-
if (a === "archive" || a === "restore") {
|
|
82
|
-
toggleArchive(c, a === "archive");
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
// Over the page it is on, as Start does: no trip to the board.
|
|
86
|
-
if (a === "run") return runPopup(c);
|
|
87
|
-
formPopup(c, a);
|
|
88
|
-
}),
|
|
89
|
-
);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (!keepTab)
|
|
93
|
-
store.lastTab = store.tab =
|
|
94
|
-
c.stage === "explore" ? "explore" : c.status === "abandoned" ? "plan" : { 1: "plan", 2: "backlog", 3: "review", 4: "preview" }[c.column] || "request";
|
|
95
|
-
return openRun(c, false);
|
|
96
|
-
}
|
|
97
|
-
// A building run's Backlog tab opens with its progress, above the deferred items. The
|
|
98
|
-
// first draw of a run animates nothing; later ones animate what moved, the bar included.
|
|
99
|
-
let lastProg = null;
|
|
100
|
-
function showProgress(c) {
|
|
101
|
-
const src = c.column === 2 && store.runDoc.progress,
|
|
102
|
-
prev = lastProg && lastProg.id === c.id ? lastProg : null,
|
|
103
|
-
h = src ? progress(src, prev && prev.st) : "";
|
|
104
|
-
if (!h) return;
|
|
105
|
-
lastProg = {
|
|
106
|
-
id: c.id,
|
|
107
|
-
st: [...src.matchAll(/^\s*-\s*(todo|doing|done):/gm)].map((m) => m[1]),
|
|
108
|
-
w: +/width:(\d+)%/.exec(h)[1],
|
|
109
|
-
};
|
|
110
|
-
$("pbody").innerHTML = html`${raw(h)}${store.runDoc.backlog ? html`<h3>Backlog</h3>${raw(md(store.runDoc.backlog, true))}` : ""}`;
|
|
111
|
-
const bar = $("pbody").querySelector(".pbar i");
|
|
112
|
-
if (prev && prev.w !== lastProg.w) {
|
|
113
|
-
bar.style.width = prev.w + "%";
|
|
114
|
-
bar.offsetWidth;
|
|
115
|
-
bar.style.width = lastProg.w + "%";
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// The header's Plan → Build → Review → Done bar: steps before the card's column are done,
|
|
119
|
-
// its own is ringed in the run's status colour (waiting amber, stalled red), the rest wait.
|
|
120
|
-
const STEPS = ["Plan", "Build", "Review", "Done"];
|
|
121
|
-
function runSteps(c) {
|
|
122
|
-
let st: any = {};
|
|
123
|
-
try { st = JSON.parse(store.runDoc?.state || "{}"); } catch {}
|
|
124
|
-
return c.stage === "explore" || st.explore_status === "completed" || st.explore_status === "active" ? ["Explore", ...STEPS] : STEPS;
|
|
125
|
-
}
|
|
126
|
-
function steps(c) {
|
|
127
|
-
const phases = runSteps(c), offset = phases.length - 4;
|
|
128
|
-
const at = c.status === "done" ? phases.length : c.stage === "explore" ? 0 : Math.max(0, (c.column || 0) - 1) + offset,
|
|
129
|
-
tip = cap(WORD[c.status] || c.status) + (c.awaiting ? `: ${need(c.awaiting)}` : "");
|
|
130
|
-
return html`<span class="steps s-${c.status}" title="${tip}" aria-label="${tip}">${raw(
|
|
131
|
-
phases.map((n, i) => `<span class="${i < at ? "ok" : i === at ? "now" : ""}"><i></i>${n}</span>`).join(""),
|
|
132
|
-
)}</span>`;
|
|
133
|
-
}
|
|
134
|
-
// The run workspace's header: the project beside the picker (runner, agent, mode in its
|
|
135
|
-
// tooltip), then the stage the run is in as one word and a bar that slides to it.
|
|
136
|
-
let lastAt = { id: "", w: 0 };
|
|
137
|
-
function meta(c) {
|
|
138
|
-
let st: any = {};
|
|
139
|
-
try {
|
|
140
|
-
st = JSON.parse(store.runDoc?.state || "{}");
|
|
141
|
-
} catch {}
|
|
142
|
-
const proj = String(c.where || "").split(/[\\/]/).filter(Boolean).pop() || "";
|
|
143
|
-
const phases = runSteps(c), offset = phases.length - 4;
|
|
144
|
-
const at = c.status === "done" ? phases.length - 1 : c.stage === "explore" ? 0 : Math.min(3, Math.max(0, (c.column || 1) - 1)) + offset,
|
|
145
|
-
word = phases[at] + (c.status === "waiting" ? ", needs you" : c.status === "stalled" ? ", stalled" : ""),
|
|
146
|
-
w = c.status === "done" ? 100 : ((at + 0.5) / phases.length) * 100;
|
|
147
|
-
const from = lastAt.id === c.id ? lastAt.w : 0;
|
|
148
|
-
lastAt = { id: c.id, w };
|
|
149
|
-
if (from !== w)
|
|
150
|
-
requestAnimationFrame(() => {
|
|
151
|
-
const i = $("psub").querySelector(".rprog i") as HTMLElement;
|
|
152
|
-
if (!i) return;
|
|
153
|
-
i.style.width = from + "%";
|
|
154
|
-
i.offsetWidth;
|
|
155
|
-
i.style.width = w + "%";
|
|
156
|
-
});
|
|
157
|
-
return html`<div class="rmeta" title="${[st.runner, st.agent, st.mode].filter(Boolean).join(", ")}">${proj}</div><div class="rprog s-${c.status}" title="${cap(WORD[c.status] || c.status) + (c.awaiting ? `: ${need(c.awaiting)}` : "")}"><span>${word}</span><b><i style="width:${w}%"></i></b></div>`;
|
|
158
|
-
}
|
|
159
|
-
// A task's panel: its terminal while the run it started is being born there, else its notes.
|
|
160
|
-
export function taskBody(c) {
|
|
161
|
-
// In the run workspace the agent is a centre tab; on the Tasks page a task shows its notes only.
|
|
162
|
-
if (c.pty && view !== "run" && view !== "tasks") showTerm(c);
|
|
163
|
-
else {
|
|
164
|
-
termStop();
|
|
165
|
-
chat(c, c.notes, c.archived || c.status !== "idea");
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
export async function openRun(c, refresh, again) {
|
|
169
|
-
if (!refresh || !store.runDoc || store.runDoc.id !== c.id || again) {
|
|
170
|
-
const d = await fetch(`/run/${encodeURIComponent(c.id)}?dir=${encodeURIComponent(c.state)}`).then((r) => r.json());
|
|
171
|
-
// Another card opened while this was fetched: its doc would redraw that card as this run.
|
|
172
|
-
if (store.openKey !== key(c)) return;
|
|
173
|
-
// A file list being confirmed, or a push under way, keeps the doc it was drawn from.
|
|
174
|
-
if (refresh && $("pfoot").querySelector(".inl,[data-busy],.more[open]")) return;
|
|
175
|
-
store.runDoc = d;
|
|
176
|
-
}
|
|
177
|
-
if (store.openKey !== key(c)) return;
|
|
178
|
-
// The fetch above may have finished after a newer /state: draw the card as it is now
|
|
179
|
-
// (a resumed agent's terminal, not the one that ended).
|
|
180
|
-
c = store.S.cards.find((x) => key(x) === store.openKey) || c;
|
|
181
|
-
// A refresh while notes are being typed would wipe the textarea.
|
|
182
|
-
// The textarea is hidden under the rich editor: focus anywhere in the notes counts.
|
|
183
|
-
if (refresh && $("pbody").querySelector(".notes")?.contains(document.activeElement)) return;
|
|
184
|
-
// The board's own status mark, then what it waits on: chips, not a dotted line.
|
|
185
|
-
$("psub").innerHTML = c.status === "abandoned" ? html`<span class="pst"><span class="st d-${ICON[c.status] || "idea"}"><svg><use href="#s-${ICON[c.status] || "idea"}"/></svg></span>${cap(WORD[c.status] || c.status)}</span>` +
|
|
186
|
-
(c.awaiting ? html`<span class="pst dim">${cap(need(c.awaiting))}</span>` : "") +
|
|
187
|
-
(c.parent ? html`<span class="pst link" title="Filed by this run">${c.parent}</span>` : "") : view === "run" || innerWidth > 640 ? meta(c) : steps(c);
|
|
188
|
-
// Only tabs with something in them show. A card whose agent runs in the board gets its
|
|
189
|
-
// terminal behind the header's terminal button, chosen once right after a launch from here.
|
|
190
|
-
const tabs = TABS.filter(
|
|
191
|
-
(t) =>
|
|
192
|
-
t[1] === "request" ||
|
|
193
|
-
t[1] === "notes" ||
|
|
194
|
-
(t[1] === "git"
|
|
195
|
-
? gitShown(c)
|
|
196
|
-
: t[1] === "preview"
|
|
197
|
-
? preview(store.runDoc.impl)
|
|
198
|
-
: store.runDoc[t[1]] || (t[1] === "backlog" && c.column === 2 && store.runDoc.progress)),
|
|
199
|
-
);
|
|
200
|
-
if (store.wantTerm === key(c)) store.wantTerm = null;
|
|
201
|
-
// The agent is a centre tab of the run workspace only: the panel never shows a terminal.
|
|
202
|
-
if (store.tab === "term") store.tab = store.lastTab;
|
|
203
|
-
// In the run workspace Preview is a centre tab, so the panel never shows it.
|
|
204
|
-
if (view === "run" && store.tab === "preview") store.tab = "review";
|
|
205
|
-
// A tab not written yet falls back to the latest one that is.
|
|
206
|
-
if (store.tab !== "term" && !tabs.some((t) => t[1] === store.tab))
|
|
207
|
-
store.tab = [...tabs].reverse().find((t) => t[1] !== "notes" && t[1] !== "git" && !(view === "run" && t[1] === "preview"))[1];
|
|
208
|
-
if (store.tab !== "term") store.lastTab = store.tab;
|
|
209
|
-
$("panel").classList.toggle("wide", store.tab === "term");
|
|
210
|
-
const pt = $("pterm");
|
|
211
|
-
pt.hidden = true;
|
|
212
|
-
pt.classList.toggle("on", store.tab === "term");
|
|
213
|
-
pt.setAttribute("aria-pressed", store.tab === "term");
|
|
214
|
-
pt.title = pt.ariaLabel = store.tab === "term" ? "Close terminal" : "Terminal";
|
|
215
|
-
pt.onclick = () => {
|
|
216
|
-
store.tab = store.tab === "term" ? store.lastTab : "term";
|
|
217
|
-
openRun(c, true);
|
|
218
|
-
};
|
|
219
|
-
$("ptabs").innerHTML = tabs
|
|
220
|
-
.map((t) => html`<button class="${t[1] === store.tab ? "on" : ""}" data-k="${t[1]}" title="${t[0]}"><svg aria-hidden="true"><use href="#t-${t[1]}"/></svg><span>${t[0]}</span></button>`)
|
|
221
|
-
.join("");
|
|
222
|
-
[...$("ptabs").children].forEach(
|
|
223
|
-
(b) =>
|
|
224
|
-
(b.onclick = () => {
|
|
225
|
-
// In the run workspace Preview is a centre tab, not a panel tab.
|
|
226
|
-
if (view === "run" && b.dataset.k === "preview") return void dispatchEvent(new Event("kz-run-preview"));
|
|
227
|
-
$("panel").classList.remove("pn");
|
|
228
|
-
store.tab = b.dataset.k;
|
|
229
|
-
openRun(c, true);
|
|
230
|
-
}),
|
|
231
|
-
);
|
|
232
|
-
const k = store.tab,
|
|
233
|
-
doc = k === "preview" ? preview(store.runDoc.impl) && attach(preview(store.runDoc.impl), c) : store.runDoc[k];
|
|
234
|
-
if (k !== "term") termStop();
|
|
235
|
-
if (k === "term") showTerm(c);
|
|
236
|
-
else if (k === "notes") {
|
|
237
|
-
const ro = c.archived || c.status === "done" || c.status === "abandoned";
|
|
238
|
-
chat(c, doc, ro);
|
|
239
|
-
} else if (k === "git") gitTab(c, refresh);
|
|
240
|
-
else
|
|
241
|
-
$("pbody").innerHTML = doc
|
|
242
|
-
? raw(md(doc, k === "backlog"))
|
|
243
|
-
: html`<p style="color:var(--dim)">No ${{ request: "request", explore: "exploration brief", plan: "plan", impl: "work report", preview: "preview", review: "review", backlog: "backlog" }[k]} yet.</p>`;
|
|
244
|
-
if (k === "backlog") showProgress(c);
|
|
245
|
-
if (k === "review" && !c.healed) fixForm(c);
|
|
246
|
-
// The notebook's notes that link here, each opening that note: above the run's own notes.
|
|
247
|
-
if (k === "notes" && store.runDoc.linkedFrom && store.runDoc.linkedFrom.length)
|
|
248
|
-
$("pbody").insertAdjacentHTML(
|
|
249
|
-
"afterbegin",
|
|
250
|
-
html`<h3>Linked from notes</h3><ul class="lnk">${store.runDoc.linkedFrom.map((n) => html`<li><a href="/notebook?dir=${encodeURIComponent(c.state)}&note=${encodeURIComponent(n)}">${n}</a></li>`)}</ul>`,
|
|
251
|
-
);
|
|
252
|
-
// Only the panel the link asked for: another card opened meanwhile drops the mark.
|
|
253
|
-
if (hit && !refresh) {
|
|
254
|
-
if (hit.k === key(c)) mark(hit);
|
|
255
|
-
else hit = null;
|
|
256
|
-
}
|
|
257
|
-
const foot = $("pfoot");
|
|
258
|
-
// A refresh while the commit is being confirmed would wipe the message.
|
|
259
|
-
if (refresh && foot.querySelector(".inl,[data-busy],.more[open]")) return;
|
|
260
|
-
// Git work left on a finished run: the footer points at the Source control tab, which holds it.
|
|
261
|
-
const arch =
|
|
262
|
-
(k !== "git" && gitPending(c) ? `<button class="btn" data-a="gittab">Source control</button>` : "") +
|
|
263
|
-
(c.archived
|
|
264
|
-
? `<button class="btn pri" data-a="restore">Restore</button>`
|
|
265
|
-
: `<button class="btn ghost" data-a="archive">Archive</button>`);
|
|
266
|
-
// A plan that asks questions takes their answers with the approval.
|
|
267
|
-
// One the board cannot read is said, so it is answered in the terminal instead of skipped.
|
|
268
|
-
const pq = c.status === "waiting" && c.awaiting === "approvals.plan" ? planQuestions(store.runDoc.plan) : [],
|
|
269
|
-
qs = pq || [];
|
|
270
|
-
// Its in-card agent ended on a waiting or done run: reopen that conversation, nothing sent.
|
|
271
|
-
const rs = c.pty && !c.pty.alive ? `<button class="btn" data-a="resume">Resume session</button>` : "";
|
|
272
|
-
if (c.archived) foot.innerHTML = raw(arch);
|
|
273
|
-
else if (c.healed && c.awaiting === "approvals.review")
|
|
274
|
-
foot.innerHTML = html`<span class="note">Finished by its agent without your approval. Nothing is committed until you approve.</span>${raw(arch + rs)}<button class="btn pri" data-a="accept">Approve</button>`;
|
|
275
|
-
else if ((c.status === "waiting" || c.awaiting === "findings") && APPROVAL[c.awaiting]) {
|
|
276
|
-
const sent = decided.has(answer(c)),
|
|
277
|
-
asks = !pq
|
|
278
|
-
? " Has questions: answer in its terminal."
|
|
279
|
-
: qs.length
|
|
280
|
-
? ` ${qs.length === 1 ? "1 question" : qs.length + " questions"}.`
|
|
281
|
-
: "";
|
|
282
|
-
const more =
|
|
283
|
-
`<button data-a="archive">Archive</button>${c.column === 1 ? `<button data-a="toidea">Back to task</button>` : ""}<hr><button data-a="ab" class="danger">Abandon</button>`;
|
|
284
|
-
foot.innerHTML = html`<span class="note">${sent ? "Sent to your agent." : APPROVAL[c.awaiting] + asks}</span><details class="more"><summary class="btn ghost">More</summary><div class="menu-pop">${raw(more)}</div></details>${raw(rs)}<span class="dec"><button class="btn" data-a="revise"${sent ? " disabled" : ""}>Revise</button><button class="btn pri" data-a="approve"${sent ? " disabled" : ""}>${c.awaiting === "explore" ? "Continue to Plan" : c.awaiting === "findings" ? "Approve as-is" : "Approve"}</button></span>`;
|
|
285
|
-
} else if (c.status === "waiting")
|
|
286
|
-
foot.innerHTML = html`<span class="note">Waiting: ${need(c.awaiting)}.</span>${raw(arch)}<button class="btn ghost" data-a="ab">Abandon</button>${raw(rs)}`;
|
|
287
|
-
else if (c.status === "done" && c.accept === "needs")
|
|
288
|
-
foot.innerHTML = html`<span class="note">Done, not approved: its agent finished without your approval. Nothing is committed until you approve.</span>${raw(arch + rs)}<button class="btn pri" data-a="accept">Approve</button>`;
|
|
289
|
-
else if (c.status === "done") foot.innerHTML = raw(arch + rs);
|
|
290
|
-
else if (c.status === "abandoned") foot.innerHTML = raw(arch);
|
|
291
|
-
else
|
|
292
|
-
foot.innerHTML = html`<span class="note">${c.pty && !c.pty.alive ? "Agent ended early." : c.status === "stalled" ? "Stalled." : ""}</span>${raw(arch)}<button class="btn ghost" data-a="ab">Abandon</button>${resumable(c) ? html`<button class="btn pri" data-a="resume">Resume</button>` : ""}`;
|
|
293
|
-
if (c.stage === "explore") foot.insertAdjacentHTML("beforeend", '<button class="btn" data-a="skip-explore">Skip Explore</button>');
|
|
294
|
-
foot.querySelectorAll("[data-a]").forEach(
|
|
295
|
-
(b) =>
|
|
296
|
-
(b.onclick = () => {
|
|
297
|
-
const a = b.dataset.a;
|
|
298
|
-
if (a === "skip-explore") {
|
|
299
|
-
b.disabled = true;
|
|
300
|
-
post("/explore/skip", { dir: c.state, id: c.id }).then((r) => {
|
|
301
|
-
if (r.ok) toast("Skip Explore sent to the agent");
|
|
302
|
-
else b.disabled = false;
|
|
303
|
-
});
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
if (a === "archive" || a === "restore") {
|
|
307
|
-
toggleArchive(c, a === "archive");
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
if (a === "gittab") {
|
|
311
|
-
store.tab = "git";
|
|
312
|
-
openRun(c, true);
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
if (a === "accept") {
|
|
316
|
-
b.disabled = true;
|
|
317
|
-
post("/accept", { dir: c.state, id: c.id }).then((r) => {
|
|
318
|
-
if (r.ok) toast("Approved");
|
|
319
|
-
else b.disabled = false;
|
|
320
|
-
});
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
if (a === "approve") {
|
|
324
|
-
if (qs.length) confirmAnswers(c, qs);
|
|
325
|
-
else decide(c, b);
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
if (a === "revise") {
|
|
329
|
-
confirmRevise(c);
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
if (a === "resume") {
|
|
333
|
-
resume(c, b);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (a === "toidea") {
|
|
337
|
-
post("/to-task", { dir: c.state, id: c.id }).then((r) => {
|
|
338
|
-
if (r.ok) toast("Back in Tasks");
|
|
339
|
-
load();
|
|
340
|
-
});
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
formPopup(c, "reject");
|
|
344
|
-
}),
|
|
345
|
-
);
|
|
346
|
-
}
|
|
347
|
-
// A link from a note (?run= or ?idea=, with dir, tab, item) opens that card's panel;
|
|
348
|
-
// a finding or backlog item named is scrolled to and marked. Found by its text, since
|
|
349
|
-
// the rendered list does not carry the numbers.
|
|
350
|
-
let hit = null;
|
|
351
|
-
export function deep() {
|
|
352
|
-
const p = new URLSearchParams(location.search),
|
|
353
|
-
d = p.get("dir"),
|
|
354
|
-
id = p.get("run"),
|
|
355
|
-
task = p.get("idea");
|
|
356
|
-
// A workspace address (?view=run&idea=) is the run view's own, not a note's deep link.
|
|
357
|
-
if ((!id && task === null) || p.get("view") === "run") return;
|
|
358
|
-
history.replaceState(null, "", location.pathname + "?all=1");
|
|
359
|
-
const c = store.S.cards.find(
|
|
360
|
-
(x) => x.state === d && (id ? x.kind === "run" && x.id === id : x.kind === "idea" && x.text === task),
|
|
361
|
-
);
|
|
362
|
-
if (!c) {
|
|
363
|
-
toast(id ? "That run was not found" : "That task was not found");
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
const m = /^(finding|backlog)-(\d+)$/.exec(p.get("item") || "");
|
|
367
|
-
// An item's tab is its own when the link does not name one.
|
|
368
|
-
const n = p.get("tab") || (m ? (m[1] === "finding" ? "review" : "backlog") : ""),
|
|
369
|
-
t = TABS.find((x) => x[1] === (n === "work" ? "impl" : n));
|
|
370
|
-
if (t) store.tab = t[1];
|
|
371
|
-
hit = m ? { type: m[1], n: +m[2], k: key(c) } : null;
|
|
372
|
-
open(c, !!t);
|
|
373
|
-
}
|
|
374
|
-
// A run's panel on the tab of one of its items, that item scrolled to and marked.
|
|
375
|
-
export function openAt(c, type, n) {
|
|
376
|
-
store.tab = type === "finding" ? "review" : "backlog";
|
|
377
|
-
hit = { type, n, k: key(c) };
|
|
378
|
-
open(c, true);
|
|
379
|
-
}
|
|
380
|
-
// What md() leaves of a line as text: no backticks or stars, a link reduced to its words.
|
|
381
|
-
function mark(h) {
|
|
382
|
-
hit = null;
|
|
383
|
-
const flat = (t) =>
|
|
384
|
-
String(t)
|
|
385
|
-
.replace(/!?\[([^\]]*)\]\([^)\s]+\)/g, "$1")
|
|
386
|
-
.replace(/[`*]/g, "")
|
|
387
|
-
.replace(/\s+/g, " ")
|
|
388
|
-
.trim();
|
|
389
|
-
const b = [...(store.runDoc.backlog || "").matchAll(/^\s*-\s*(?:open|done|rejected):\s*(.*)$/gm)];
|
|
390
|
-
const text = h.type === "finding" ? (store.runDoc.findings || []).find((f) => f.n === h.n)?.text : b[h.n - 1]?.[1];
|
|
391
|
-
if (!text) {
|
|
392
|
-
toast("That item is not in this run");
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
const want = flat(text).slice(0, 60),
|
|
396
|
-
el = [...$("pbody").querySelectorAll("li,p")].find(
|
|
397
|
-
(e) => !e.closest(".prog") && flat(e.textContent).includes(want),
|
|
398
|
-
);
|
|
399
|
-
if (!el) return;
|
|
400
|
-
el.scrollIntoView({ block: "center" });
|
|
401
|
-
el.classList.add("hit");
|
|
402
|
-
setTimeout(() => el.classList.remove("hit"), 2400);
|
|
403
|
-
}
|
|
404
|
-
export async function toggleArchive(c, archived) {
|
|
405
|
-
const r = await post(
|
|
406
|
-
"/archive",
|
|
407
|
-
c.kind === "idea" ? { dir: c.state, text: c.text, archived } : { dir: c.state, id: c.id, archived },
|
|
408
|
-
);
|
|
409
|
-
if (r.ok) toast(archived ? "Archived" : "Restored");
|
|
410
|
-
close();
|
|
411
|
-
load();
|
|
412
|
-
}
|
|
413
|
-
export function close() {
|
|
414
|
-
if (view !== "board" && view !== "run" && view !== "tasks") return;
|
|
415
|
-
const k = store.openKey;
|
|
416
|
-
stopDictation(true);
|
|
417
|
-
termStop();
|
|
418
|
-
store.openKey = null;
|
|
419
|
-
store.runDoc = null;
|
|
420
|
-
$("panel").classList.remove("open");
|
|
421
|
-
$("scrim").classList.remove("on");
|
|
422
|
-
render();
|
|
423
|
-
if (k) cardEl(k)?.focus({ preventScroll: true });
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export function initPanel() {
|
|
427
|
-
// Answering an approval from the panel opens your agent on the run, told the decision and,
|
|
428
|
-
// for a revise, the comment. Answered approvals are remembered outside the footer, which
|
|
429
|
-
// every refresh rebuilds, so a second press cannot open a second agent. Keyed by when the
|
|
430
|
-
// run last moved: the same approval reached again after a revise is a new question.
|
|
431
|
-
// The footer's More menu is a <details>: close it on a click anywhere else.
|
|
432
|
-
document.addEventListener("click", (e) => {
|
|
433
|
-
for (const d of document.querySelectorAll(".more[open]")) if (!d.contains(e.target)) d.open = false;
|
|
434
|
-
});
|
|
435
|
-
$("pclose").onclick = close;
|
|
436
|
-
$("scrim").onclick = close;
|
|
437
|
-
}
|
package/web/board/phone-setup.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// The phone card: Settings → Phone and the onboarding phone step. Walks the user from no
|
|
2
|
-
// Tailscale to a QR the phone scans, through /phone/setup on the board.
|
|
3
|
-
import { html, raw } from "./dom.ts";
|
|
4
|
-
|
|
5
|
-
type State = { state: "missing" | "login" | "ready" | "connected"; account: string; url: string; phones: { name: string; online: boolean }[]; qr: string };
|
|
6
|
-
|
|
7
|
-
const DOWNLOAD = "https://tailscale.com/download";
|
|
8
|
-
|
|
9
|
-
async function call(body?: object) {
|
|
10
|
-
try {
|
|
11
|
-
const r = await fetch("/phone/setup", body ? { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) } : undefined);
|
|
12
|
-
return await r.json();
|
|
13
|
-
} catch {
|
|
14
|
-
return { error: "The board did not answer." };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const btn = (a: string, text: string, pri = false) => html`<button type="button" class="btn${pri ? " pri" : ""}" data-ph="${a}">${text}</button>`;
|
|
19
|
-
const ol = (items: unknown[]) => html`<ol class="ph-steps">${items.map((i) => html`<li>${i}</li>`)}</ol>`;
|
|
20
|
-
|
|
21
|
-
function body(s: State, err: string, busy: boolean) {
|
|
22
|
-
const e = err ? html`<p class="ph-err" role="alert">${err}</p>` : "";
|
|
23
|
-
const acct = s.account ? html`<b>${s.account}</b>` : "the same account";
|
|
24
|
-
if (s.state === "missing")
|
|
25
|
-
return html`<p>Your phone reaches this computer through Tailscale, a free private network between your own devices.</p>${ol([
|
|
26
|
-
"Install Tailscale on this computer and log in.",
|
|
27
|
-
"Install it on your phone too and log in with the same account.",
|
|
28
|
-
])}<div class="ph-row"><a class="btn pri" href="${DOWNLOAD}" target="_blank" rel="noopener">Install Tailscale</a>${btn("check", "Check again")}</div>${e}`;
|
|
29
|
-
if (s.state === "login")
|
|
30
|
-
return html`<p>Tailscale is installed but not logged in on this computer.</p><div class="ph-row">${btn("login", busy ? "Opening…" : "Log in to Tailscale", true)}${btn("check", "Check again")}</div>${e}`;
|
|
31
|
-
if (s.state === "ready")
|
|
32
|
-
return html`<p>Tailscale is running${s.account ? html` as ${acct}` : ""}. Connect to show the code your phone scans.</p><div class="ph-row">${btn("connect", busy ? "Connecting…" : "Connect phone", true)}</div>${e}`;
|
|
33
|
-
const on = s.phones.some((p) => p.online);
|
|
34
|
-
return html`<div class="ph-on">${s.qr ? html`<div class="ph-qr" aria-label="QR code for ${s.url}">${raw(s.qr)}</div>` : ""}<div><p class="ph-h">On your phone</p>${ol([
|
|
35
|
-
html`Install Tailscale from the <a href="${DOWNLOAD}" target="_blank" rel="noopener">App Store or Play Store</a>.`,
|
|
36
|
-
s.account ? html`Log in with ${acct}, the account this computer uses.` : "Log in with the same account as this computer.",
|
|
37
|
-
html`Scan this code with the camera, or open <a href="${s.url}" target="_blank" rel="noopener">${s.url}</a>.`,
|
|
38
|
-
"Choose Add to Home screen so it opens like an app.",
|
|
39
|
-
])}<p class="ph-st"><i class="ph-dot${on ? " on" : ""}"></i>${on ? `Phone online: ${s.phones.filter((p) => p.online).map((p) => p.name).join(", ")}` : s.phones.length ? "Phone on your tailnet, offline right now" : "No phone on your tailnet yet"}</p></div></div><p class="ph-note">Anyone on your tailnet can use this board. Keep the tailnet to your own devices, or limit it with Tailscale access rules.</p>${e}`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Draws into `el` and keeps it current while it is on the page.
|
|
43
|
-
export async function mountPhone(el: HTMLElement) {
|
|
44
|
-
let s: State | null = null, err = "", busy = false;
|
|
45
|
-
const draw = () => {
|
|
46
|
-
if (s) el.innerHTML = String(body(s, err, busy));
|
|
47
|
-
};
|
|
48
|
-
const load = async () => {
|
|
49
|
-
const r = await call();
|
|
50
|
-
if (r.error) err = r.error;
|
|
51
|
-
else s = r;
|
|
52
|
-
draw();
|
|
53
|
-
};
|
|
54
|
-
el.innerHTML = `<p class="ph-wait">Checking Tailscale…</p>`;
|
|
55
|
-
el.onclick = async (ev) => {
|
|
56
|
-
const a = (ev.target as HTMLElement).closest<HTMLElement>("[data-ph]")?.dataset.ph;
|
|
57
|
-
if (!a || busy) return;
|
|
58
|
-
err = "";
|
|
59
|
-
if (a === "check") return load();
|
|
60
|
-
busy = true;
|
|
61
|
-
draw();
|
|
62
|
-
const r = await call({ do: a });
|
|
63
|
-
busy = false;
|
|
64
|
-
if (r.error) err = r.error;
|
|
65
|
-
else if (a === "login") {
|
|
66
|
-
if (r.url) window.open(r.url, "_blank", "noopener");
|
|
67
|
-
// The sign-in happens in the browser: look again until Tailscale is running, for two minutes.
|
|
68
|
-
for (let i = 0; i < 40 && el.isConnected && s?.state === "login"; i++) {
|
|
69
|
-
await new Promise((ok) => setTimeout(ok, 3000));
|
|
70
|
-
const n = await call();
|
|
71
|
-
if (!n.error) s = n;
|
|
72
|
-
}
|
|
73
|
-
} else s = r;
|
|
74
|
-
draw();
|
|
75
|
-
};
|
|
76
|
-
await load();
|
|
77
|
-
// The phone's dot follows it joining the tailnet; stops once the card leaves the page.
|
|
78
|
-
const t = setInterval(() => (el.isConnected ? s?.state === "connected" && !busy && void load() : clearInterval(t)), 10_000);
|
|
79
|
-
}
|