rvlib-shipkit 2.29.0 → 2.30.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/CHANGELOG.md +20 -1
- package/package.json +2 -1
- package/src/advisors/app-graph.ts +1 -1
- package/src/advisors/expose.ts +5 -1
- package/src/advisors/r2.ts +7 -9
- package/src/advisors/routes.ts +29 -2
- package/src/advisors/scan.ts +11 -0
- package/src/agent-time/accounts-usage.ts +8 -0
- package/src/agent-time/claude-sessions.ts +32 -0
- package/src/agent-time/hooks.ts +1 -1
- package/src/agent-time/live.ts +5 -2
- package/src/agent-time/registry.ts +186 -89
- package/src/agent-time/store.ts +6 -4
- package/src/asks/ask-doc.ts +2 -2
- package/src/asks/ask-store.ts +22 -7
- package/src/check.ts +9 -1
- package/src/checks/SK001-package-json-shape.check.ts +1 -0
- package/src/checks/SK003-claude-md-shape.check.ts +1 -0
- package/src/checks/SK004-gitignore-policy.check.ts +12 -6
- package/src/checks/SK008-reviewer-agent.check.ts +4 -7
- package/src/checks/SK013-one-way-in-policy.check.ts +1 -0
- package/src/checks/SK017-vscode-hub-task.check.ts +1 -0
- package/src/checks/SK024-identity-colors.check.ts +1 -1
- package/src/checks/SK027-agent-wiki-links.check.ts +2 -1
- package/src/checks/SK033-global-contribution.check.ts +1 -0
- package/src/checks/SK034-commit-gates-armed.check.ts +1 -0
- package/src/checks/SK039-vscode-watch-generated.check.ts +1 -0
- package/src/checks/SK049-thread-answers-hook.check.ts +9 -5
- package/src/checks/SK050-retired-commands.check.ts +1 -0
- package/src/checks/SK051-no-formatter.check.ts +1 -0
- package/src/cli/channel-run.ts +17 -0
- package/src/cli/cmd_Advisors.ts +28 -7
- package/src/cli/cmd_Asks.ts +2 -2
- package/src/cli/cmd_Backup.ts +5 -1
- package/src/cli/cmd_CacheAudit.ts +1 -1
- package/src/cli/cmd_Channel.ts +43 -0
- package/src/cli/cmd_GlobalProcesses.ts +1 -0
- package/src/cli/cmd_Home.ts +12 -5
- package/src/cli/cmd_Hooks.ts +1 -1
- package/src/cli/cmd_Hq.ts +43 -0
- package/src/cli/cmd_Lanes.ts +15 -3
- package/src/cli/cmd_Media.ts +8 -3
- package/src/cli/cmd_Orchestrator.ts +253 -84
- package/src/cli/cmd_OrchestratorRole.ts +163 -0
- package/src/cli/cmd_Review.ts +142 -165
- package/src/cli/cmd_Secret.ts +44 -14
- package/src/cli/cmd_Shot.ts +2 -4
- package/src/cli/cmd_Sound.ts +1 -0
- package/src/cli/cmd_Urls.ts +3 -3
- package/src/cli/inbox-hook-run.ts +109 -0
- package/src/cli/registry.ts +6 -2
- package/src/cli/review-here.ts +136 -0
- package/src/cli.ts +45 -14
- package/src/collections/actions.ts +5 -4
- package/src/collections/checks.ts +5 -0
- package/src/collections/collection-types.ts +4 -3
- package/src/collections/pings.ts +4 -1
- package/src/collections/providers.ts +6 -4
- package/src/collections/tests.ts +7 -4
- package/src/core/app-icon-frame.ts +62 -0
- package/src/core/app-icon.ts +179 -17
- package/src/core/archived.ts +10 -7
- package/src/core/check-ctx.ts +38 -4
- package/src/core/check-pass.ts +7 -0
- package/src/core/foreign.ts +87 -0
- package/src/core/gui-color.ts +75 -0
- package/src/core/hub-theme.ts +1 -3
- package/src/core/layout.ts +3 -0
- package/src/core/machine-commit.ts +9 -1
- package/src/core/one-lib.ts +2 -1
- package/src/core/one-way-in-policy.ts +17 -12
- package/src/core/owner-word-policy.ts +123 -0
- package/src/core/panel-shades.ts +140 -0
- package/src/core/repo-gui-color.ts +16 -0
- package/src/core/role-policy.ts +17 -0
- package/src/core/scope.ts +6 -3
- package/src/core/tmux-policy.ts +264 -0
- package/src/core/unit-icon.ts +43 -0
- package/src/fleet/push-fleet.ts +2 -0
- package/src/fleet/scan-fleet.ts +3 -0
- package/src/gate/cache-audit.ts +7 -1
- package/src/gate/gate-checks.ts +14 -9
- package/src/gate/run-fix.ts +30 -5
- package/src/gate/run-fixers.ts +8 -3
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +2 -1
- package/src/home/daemon-guard.ts +20 -2
- package/src/home/daemon-jobs.ts +26 -18
- package/src/home/gui-app/ShipkitGui.swift +2012 -144
- package/src/home/gui-app/icon.svg +8 -0
- package/src/home/gui-app.ts +94 -30
- package/src/home/home-routes.ts +53 -9
- package/src/home/home-start.ts +27 -3
- package/src/home/inbox-shape.ts +7 -3
- package/src/home/log-follow.ts +117 -0
- package/src/home/machine-fold.ts +1 -1
- package/src/home/open-app.ts +9 -3
- package/src/home/page-build.ts +5 -1
- package/src/home/page-held.ts +1 -1
- package/src/home/pm-config.ts +0 -8
- package/src/home/pm.ts +62 -5
- package/src/home/process-apps.ts +70 -23
- package/src/home/process-rows.ts +16 -1
- package/src/home/push-sources.ts +18 -13
- package/src/home/resources.ts +16 -7
- package/src/home/run-daemon.ts +4 -1
- package/src/home/run-pm.ts +1 -1
- package/src/home/serve-daemon.ts +13 -4
- package/src/home/serve-web.ts +141 -17
- package/src/home/space-page.ts +3 -3
- package/src/home/space-route.ts +2 -2
- package/src/home/supervise.ts +2 -1
- package/src/home/vault-page.ts +2 -1
- package/src/home/web-places.ts +239 -0
- package/src/home/widgets.ts +16 -2
- package/src/hooks/commit-message.ts +11 -9
- package/src/hooks/one-way-in-guard.ts +145 -68
- package/src/hooks/run-hooks.ts +15 -5
- package/src/hooks/shared-file.ts +273 -83
- package/src/hooks/shell-writes.ts +620 -0
- package/src/hooks/write-log.ts +149 -0
- package/src/hq/door-route.ts +63 -7
- package/src/hq/door.ts +45 -12
- package/src/hq/history-send.ts +3 -1
- package/src/hq/hq-db.ts +10 -3
- package/src/hq/hq-local.ts +24 -5
- package/src/hq/hq-routes.ts +3 -1
- package/src/hq/hq-store.ts +9 -3
- package/src/hq/kinds/index.ts +2 -1
- package/src/hq/kinds/kind.ts +9 -4
- package/src/hq/kinds/presence-rule.ts +56 -0
- package/src/hq/kinds/presence.ts +210 -0
- package/src/hq/kinds/report.ts +8 -5
- package/src/hq/lead-order.ts +68 -0
- package/src/hq/outbox.ts +7 -0
- package/src/hq/replica.ts +5 -7
- package/src/hq/report-facts.ts +14 -7
- package/src/hq/report.ts +47 -2
- package/src/hq/switch.ts +1 -0
- package/src/hq/terminal-hop.ts +64 -0
- package/src/hq/thread-sync.ts +13 -6
- package/src/http/door-forward.ts +10 -12
- package/src/http/door-names.ts +9 -0
- package/src/http/hop-caller.ts +23 -0
- package/src/http/hop-names.ts +14 -0
- package/src/http/loopback-serve.ts +28 -6
- package/src/http/owner-word.ts +128 -0
- package/src/http/same-origin.ts +12 -0
- package/src/{serve → http}/secret-gate.ts +3 -3
- package/src/ledger/run-log.ts +25 -1
- package/src/media-store/backup/sources.ts +53 -6
- package/src/media-store/backup/thread-copy.ts +9 -5
- package/src/media-store/copy/config.ts +10 -9
- package/src/media-store/daemon.ts +5 -2
- package/src/media-store/put.ts +3 -0
- package/src/media-store/space.ts +14 -16
- package/src/media-store/upload.ts +4 -0
- package/src/messages/collection.ts +2 -2
- package/src/messages/model.ts +6 -1
- package/src/messages/routes.ts +3 -0
- package/src/orchestrator/brief.md +8 -6
- package/src/orchestrator/channel-declare.ts +58 -0
- package/src/orchestrator/channel.ts +226 -0
- package/src/orchestrator/guards.ts +12 -3
- package/src/orchestrator/host.ts +35 -0
- package/src/orchestrator/lead-shape.ts +86 -0
- package/src/orchestrator/now.ts +88 -0
- package/src/orchestrator/phone.ts +4 -1
- package/src/orchestrator/places-file.ts +38 -0
- package/src/orchestrator/places-look.ts +180 -0
- package/src/orchestrator/places-shape.ts +151 -0
- package/src/orchestrator/places.ts +50 -0
- package/src/orchestrator/presence-shape.ts +13 -2
- package/src/orchestrator/presence.ts +26 -15
- package/src/orchestrator/push.ts +5 -10
- package/src/orchestrator/role-shape.ts +270 -0
- package/src/orchestrator/role.ts +242 -0
- package/src/orchestrator/routes.ts +136 -31
- package/src/orchestrator/sessions-shape.ts +78 -0
- package/src/orchestrator/sessions.ts +86 -0
- package/src/orchestrator/share.ts +71 -0
- package/src/orchestrator/start-notice.ts +61 -0
- package/src/orchestrator/start.ts +137 -0
- package/src/orchestrator/started.ts +55 -0
- package/src/orchestrator/stuck.ts +196 -0
- package/src/orchestrator/unheard.ts +18 -7
- package/src/pages/frame-client.ts +44 -6
- package/src/problems/failure-words.ts +80 -0
- package/src/release/run-bump.ts +26 -5
- package/src/release/run-release.ts +34 -14
- package/src/repo-config.ts +37 -9
- package/src/review/aside-at.ts +19 -0
- package/src/review/band.ts +3 -3
- package/src/review/doc-save.ts +1 -1
- package/src/review/inbox-hook.ts +12 -4
- package/src/review/inbox-read.ts +20 -7
- package/src/review/instruction-guards.ts +137 -0
- package/src/review/instructions.ts +14 -2
- package/src/review/item-db.ts +52 -2
- package/src/review/mentions.ts +6 -4
- package/src/review/model.ts +3 -2
- package/src/review/parties.ts +88 -19
- package/src/review/push.ts +32 -15
- package/src/review/routes.ts +12 -4
- package/src/review/secret-route.ts +5 -5
- package/src/review/snooze.ts +1 -16
- package/src/review/store-parties.ts +4 -2
- package/src/review/take-back.ts +2 -1
- package/src/review/threads.ts +13 -2
- package/src/review/unit.ts +3 -2
- package/src/review/view-layout.ts +8 -1
- package/src/review/watchers.ts +25 -4
- package/src/secrets/key-pair.ts +14 -0
- package/src/secrets/lapse.ts +3 -3
- package/src/secrets/manager.ts +5 -1
- package/src/secrets/name-template.ts +83 -0
- package/src/secrets/name.ts +3 -0
- package/src/secrets/read.ts +10 -6
- package/src/secrets/secrets-view.ts +299 -0
- package/src/secrets/who-reads.ts +2 -1
- package/src/serve/frame-part.ts +49 -0
- package/src/serve/hub-app/accounts-line.tsx +33 -45
- package/src/serve/hub-app/activity-st.ts +6 -5
- package/src/serve/hub-app/activity-view.tsx +10 -9
- package/src/serve/hub-app/advice-box.tsx +6 -5
- package/src/serve/hub-app/advisor-app.tsx +2 -0
- package/src/serve/hub-app/advisor-face.tsx +3 -2
- package/src/serve/hub-app/advisor.html +1 -0
- package/src/serve/hub-app/advisors-view.tsx +52 -10
- package/src/serve/hub-app/advisors.css +4 -0
- package/src/serve/hub-app/app-bridge.ts +31 -5
- package/src/serve/hub-app/asked-page.ts +24 -0
- package/src/serve/hub-app/asks-page.tsx +10 -6
- package/src/serve/hub-app/auto-text.tsx +7 -5
- package/src/serve/hub-app/card-head.tsx +3 -2
- package/src/serve/hub-app/check-view.tsx +10 -9
- package/src/serve/hub-app/checks-svc.ts +96 -32
- package/src/serve/hub-app/clock-svc.ts +24 -8
- package/src/serve/hub-app/code-copy.ts +1 -1
- package/src/serve/hub-app/col-card.tsx +2 -1
- package/src/serve/hub-app/col-list-page.tsx +12 -6
- package/src/serve/hub-app/col-list-st.ts +12 -2
- package/src/serve/hub-app/col-tables-view.tsx +8 -44
- package/src/serve/hub-app/col-tables.ts +0 -14
- package/src/serve/hub-app/cols-svc.ts +6 -12
- package/src/serve/hub-app/columns.ts +94 -0
- package/src/serve/hub-app/comfy-view.tsx +8 -7
- package/src/serve/hub-app/commands/commands-page.tsx +4 -3
- package/src/serve/hub-app/commands/commands-st.ts +2 -2
- package/src/serve/hub-app/controls.css +69 -23
- package/src/serve/hub-app/cycle-button.tsx +2 -1
- package/src/serve/hub-app/database-st.ts +1 -1
- package/src/serve/hub-app/database-view.tsx +4 -2
- package/src/serve/hub-app/deaf.tsx +27 -0
- package/src/serve/hub-app/dock-st.ts +21 -16
- package/src/serve/hub-app/dock-view.tsx +19 -12
- package/src/serve/hub-app/empty-section.tsx +30 -0
- package/src/serve/hub-app/entry-bar.css +1 -1
- package/src/serve/hub-app/entry-bar.tsx +11 -6
- package/src/serve/hub-app/entry-list.css +32 -0
- package/src/serve/hub-app/entry-list.tsx +123 -0
- package/src/serve/hub-app/entry-pick.ts +1 -1
- package/src/serve/hub-app/entry-sections.ts +140 -0
- package/src/serve/hub-app/event-stream-reader.ts +56 -0
- package/src/serve/hub-app/floating.tsx +68 -14
- package/src/serve/hub-app/geometry-view.tsx +3 -2
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/hash-route.ts +14 -2
- package/src/serve/hub-app/header-bar.tsx +53 -36
- package/src/serve/hub-app/home-st.ts +131 -14
- package/src/serve/hub-app/home-strip.css +24 -13
- package/src/serve/hub-app/home-strip.tsx +131 -66
- package/src/serve/hub-app/home.html +5 -0
- package/src/serve/hub-app/hub-app.tsx +94 -102
- package/src/serve/hub-app/hub.css +61 -94
- package/src/serve/hub-app/icons.tsx +16 -0
- package/src/serve/hub-app/identities-st.ts +19 -54
- package/src/serve/hub-app/identities-view.tsx +25 -24
- package/src/serve/hub-app/identity-address.ts +2 -2
- package/src/serve/hub-app/in-sight.ts +10 -0
- package/src/serve/hub-app/inbox-st.ts +20 -2
- package/src/serve/hub-app/inbox-view.tsx +16 -9
- package/src/serve/hub-app/inbox.css +1 -0
- package/src/serve/hub-app/index.html +5 -0
- package/src/serve/hub-app/insights-view.tsx +6 -5
- package/src/serve/hub-app/instructions.css +4 -1
- package/src/serve/hub-app/kept-cols.tsx +83 -20
- package/src/serve/hub-app/kept-width.tsx +76 -0
- package/src/serve/hub-app/keys.ts +116 -38
- package/src/serve/hub-app/layout-st.ts +109 -99
- package/src/serve/hub-app/lightbox-zoom.css +36 -0
- package/src/serve/hub-app/list-filter.tsx +15 -6
- package/src/serve/hub-app/list-head.tsx +29 -0
- package/src/serve/hub-app/list-row.ts +8 -0
- package/src/serve/hub-app/list-walk.ts +26 -105
- package/src/serve/hub-app/live-socket.ts +274 -0
- package/src/serve/hub-app/live-sources.ts +189 -0
- package/src/serve/hub-app/live-svc.ts +2 -2
- package/src/serve/hub-app/machine-st.ts +75 -14
- package/src/serve/hub-app/main-panel.css +211 -0
- package/src/serve/hub-app/main-panel.tsx +259 -0
- package/src/serve/hub-app/md.ts +4 -4
- package/src/serve/hub-app/media-svc.ts +5 -5
- package/src/serve/hub-app/media-view.tsx +13 -12
- package/src/serve/hub-app/messages/messages-page.tsx +8 -7
- package/src/serve/hub-app/messages/messages-st.ts +5 -2
- package/src/serve/hub-app/new-thread-st.ts +170 -0
- package/src/serve/hub-app/new-thread.tsx +133 -107
- package/src/serve/hub-app/orchestrator-line.tsx +115 -45
- package/src/serve/hub-app/orchestrator-places.tsx +86 -0
- package/src/serve/hub-app/orchestrator.css +57 -5
- package/src/serve/hub-app/page-keys.ts +107 -68
- package/src/serve/hub-app/page-reload.ts +46 -6
- package/src/serve/hub-app/pages-frames.tsx +40 -3
- package/src/serve/hub-app/pages-svc.ts +3 -1
- package/src/serve/hub-app/palette-st.ts +198 -43
- package/src/serve/hub-app/palette-view.tsx +32 -8
- package/src/serve/hub-app/panel-head-action.tsx +39 -0
- package/src/serve/hub-app/panel-head.tsx +70 -0
- package/src/serve/hub-app/panel-repo.ts +42 -0
- package/src/serve/hub-app/panel-source.ts +195 -0
- package/src/serve/hub-app/panel-tint.css +6 -0
- package/src/serve/hub-app/panel-tint.ts +23 -0
- package/src/serve/hub-app/panel-walk.ts +107 -0
- package/src/serve/hub-app/pill-row.tsx +2 -1
- package/src/serve/hub-app/place-path.ts +4 -0
- package/src/serve/hub-app/places-svc.ts +75 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/polled.ts +11 -1
- package/src/serve/hub-app/presence-st.ts +66 -32
- package/src/serve/hub-app/processes-view.tsx +2 -2
- package/src/serve/hub-app/project-bar.tsx +116 -0
- package/src/serve/hub-app/project-list.css +20 -173
- package/src/serve/hub-app/project-list.tsx +30 -298
- package/src/serve/hub-app/projects-svc.ts +59 -32
- package/src/serve/hub-app/push-sign.tsx +2 -1
- package/src/serve/hub-app/push-svc.ts +86 -69
- package/src/serve/hub-app/quiet-st.ts +5 -3
- package/src/serve/hub-app/rail-groups.ts +144 -0
- package/src/serve/hub-app/reader-chips.tsx +2 -1
- package/src/serve/hub-app/recordings-st.ts +2 -1
- package/src/serve/hub-app/recordings-view.tsx +19 -47
- package/src/serve/hub-app/recordings.css +0 -2
- package/src/serve/hub-app/reflections-page.tsx +10 -6
- package/src/serve/hub-app/releases/releases-page.tsx +6 -5
- package/src/serve/hub-app/repo-sections.ts +127 -38
- package/src/serve/hub-app/repo-st.ts +57 -36
- package/src/serve/hub-app/review/advisor-bar.tsx +3 -2
- package/src/serve/hub-app/review/ask-proof.tsx +79 -0
- package/src/serve/hub-app/review/attach-view.tsx +11 -10
- package/src/serve/hub-app/review/box-view.ts +479 -0
- package/src/serve/hub-app/review/box-zoom.tsx +70 -0
- package/src/serve/hub-app/review/diff-view.tsx +3 -2
- package/src/serve/hub-app/review/doc-body.tsx +2 -1
- package/src/serve/hub-app/review/dock.tsx +3 -2
- package/src/serve/hub-app/review/draft-body.tsx +4 -3
- package/src/serve/hub-app/review/faces.tsx +0 -8
- package/src/serve/hub-app/review/group-block.tsx +8 -7
- package/src/serve/hub-app/review/heard-line.tsx +4 -3
- package/src/serve/hub-app/review/instructions-view.tsx +3 -2
- package/src/serve/hub-app/review/item-verdict.tsx +40 -40
- package/src/serve/hub-app/review/kind-states.tsx +5 -4
- package/src/serve/hub-app/review/kit.tsx +24 -4
- package/src/serve/hub-app/review/lane-bar.tsx +30 -28
- package/src/serve/hub-app/review/lightbox.tsx +6 -4
- package/src/serve/hub-app/review/live-bar.tsx +7 -6
- package/src/serve/hub-app/review/live-view.tsx +6 -5
- package/src/serve/hub-app/review/object-card.tsx +2 -1
- package/src/serve/hub-app/review/object-panel.tsx +11 -10
- package/src/serve/hub-app/review/pano-view.tsx +3 -2
- package/src/serve/hub-app/review/question-views.tsx +6 -5
- package/src/serve/hub-app/review/review-cells.tsx +21 -20
- package/src/serve/hub-app/review/review-host.ts +3 -0
- package/src/serve/hub-app/review/review-kit.ts +7 -5
- package/src/serve/hub-app/review/review-list.tsx +98 -52
- package/src/serve/hub-app/review/review-page.tsx +3 -3
- package/src/serve/hub-app/review/review-st.ts +70 -14
- package/src/serve/hub-app/review/review-thread.tsx +234 -138
- package/src/serve/hub-app/review/review-views.tsx +166 -191
- package/src/serve/hub-app/review/space3d.tsx +17 -9
- package/src/serve/hub-app/review/thread-close.tsx +24 -32
- package/src/serve/hub-app/review/thread-st.ts +39 -25
- package/src/serve/hub-app/review/trailer-body.tsx +5 -4
- package/src/serve/hub-app/review/trailer-page.tsx +18 -16
- package/src/serve/hub-app/review/trailer-st.ts +3 -2
- package/src/serve/hub-app/review/trailer-timeline.tsx +10 -9
- package/src/serve/hub-app/review/trailer-voices.tsx +29 -28
- package/src/serve/hub-app/review.css +159 -42
- package/src/serve/hub-app/row-acts.tsx +126 -0
- package/src/serve/hub-app/row-face.tsx +29 -0
- package/src/serve/hub-app/running-rows.tsx +142 -0
- package/src/serve/hub-app/running-st.ts +110 -0
- package/src/serve/hub-app/search-view.tsx +3 -2
- package/src/serve/hub-app/secrets-page.tsx +290 -0
- package/src/serve/hub-app/secrets-st.ts +181 -0
- package/src/serve/hub-app/secrets.css +65 -0
- package/src/serve/hub-app/section-head.tsx +3 -2
- package/src/serve/hub-app/session-chips.tsx +55 -0
- package/src/serve/hub-app/shell.ts +56 -0
- package/src/serve/hub-app/site/site-part.tsx +6 -5
- package/src/serve/hub-app/site/site-st.ts +0 -6
- package/src/serve/hub-app/site.css +0 -1
- package/src/serve/hub-app/social/calendar.tsx +7 -6
- package/src/serve/hub-app/social/comms-page.tsx +29 -26
- package/src/serve/hub-app/social/group-editor.tsx +2 -1
- package/src/serve/hub-app/social/kit.tsx +12 -11
- package/src/serve/hub-app/social/next-release.tsx +3 -2
- package/src/serve/hub-app/social/post-card.tsx +21 -20
- package/src/serve/hub-app/social/post-page.tsx +2 -1
- package/src/serve/hub-app/social/problems.tsx +3 -2
- package/src/serve/hub-app/social/social-page.tsx +29 -27
- package/src/serve/hub-app/social/social-st.ts +4 -2
- package/src/serve/hub-app/social/stage-popup.tsx +11 -10
- package/src/serve/hub-app/social.css +7 -5
- package/src/serve/hub-app/source-acts.ts +79 -0
- package/src/serve/hub-app/source-page.tsx +17 -0
- package/src/serve/hub-app/space-view.tsx +5 -4
- package/src/serve/hub-app/stores/stores-page.tsx +21 -19
- package/src/serve/hub-app/stores/stores-st.ts +1 -1
- package/src/serve/hub-app/stores.css +1 -1
- package/src/serve/hub-app/terminal-history-st.ts +112 -0
- package/src/serve/hub-app/terminal-keys.ts +79 -0
- package/src/serve/hub-app/terminal-lib.ts +110 -0
- package/src/serve/hub-app/terminal-links.ts +55 -0
- package/src/serve/hub-app/terminal-list-st.ts +304 -0
- package/src/serve/hub-app/terminal-log-st.ts +242 -0
- package/src/serve/hub-app/terminal-out.ts +135 -0
- package/src/serve/hub-app/terminal-pages.tsx +115 -0
- package/src/serve/hub-app/terminal-panel.tsx +60 -9
- package/src/serve/hub-app/terminal-sources.tsx +335 -0
- package/src/serve/hub-app/terminal-st.ts +447 -167
- package/src/serve/hub-app/terminal-stream.ts +233 -0
- package/src/serve/hub-app/terminal-tab.tsx +64 -0
- package/src/serve/hub-app/terminal-widths.ts +30 -0
- package/src/serve/hub-app/terminal.css +50 -4
- package/src/serve/hub-app/test-view.tsx +5 -3
- package/src/serve/hub-app/tests-view.tsx +16 -15
- package/src/serve/hub-app/theme-st.ts +5 -0
- package/src/serve/hub-app/thread-row.tsx +39 -31
- package/src/serve/hub-app/time-ago.tsx +3 -2
- package/src/serve/hub-app/time-view.tsx +2 -1
- package/src/serve/hub-app/time.css +1 -1
- package/src/serve/hub-app/timeline-chart.tsx +5 -4
- package/src/serve/hub-app/timeline-view.tsx +10 -9
- package/src/serve/hub-app/tips.ts +247 -0
- package/src/serve/hub-app/tree-build.ts +40 -8
- package/src/serve/hub-app/tree-svc.ts +167 -134
- package/src/serve/hub-app/unit-icons.ts +26 -0
- package/src/serve/hub-app/url-address.ts +154 -0
- package/src/serve/hub-app/url-faces.ts +88 -0
- package/src/serve/hub-app/url-forms.tsx +183 -0
- package/src/serve/hub-app/urls-svc.ts +167 -5
- package/src/serve/hub-app/urls-view.tsx +56 -20
- package/src/serve/hub-app/urls.css +26 -0
- package/src/serve/hub-app/vault-view.tsx +5 -4
- package/src/serve/hub-app/veille/veille-page.tsx +34 -33
- package/src/serve/hub-app/veille/veille-st.ts +6 -3
- package/src/serve/hub-app/view-layout.css +3 -3
- package/src/serve/hub-app/when-view.tsx +5 -4
- package/src/serve/hub-app/wikis-view.tsx +6 -5
- package/src/serve/hub-app/words.tsx +9 -2
- package/src/serve/hub-runtime.ts +3 -2
- package/src/serve/orchestrator-host.ts +58 -0
- package/src/serve/page-live.ts +147 -0
- package/src/serve/project-gutter-route.ts +63 -2
- package/src/serve/read-worker.ts +7 -2
- package/src/serve/runs-stamp.ts +33 -0
- package/src/serve/secrets-read.ts +156 -0
- package/src/serve/serve-hub.ts +71 -22
- package/src/serve/terminal-claudes.ts +185 -0
- package/src/serve/terminal-guard.ts +10 -5
- package/src/serve/terminal-host.ts +517 -0
- package/src/serve/terminal-record.ts +104 -0
- package/src/serve/terminal-route.ts +466 -103
- package/src/serve/terminal-shells.ts +3 -0
- package/src/serve/terminal-watch.ts +102 -0
- package/src/shipkit-files.ts +9 -4
- package/src/shot/client.ts +4 -9
- package/src/shot/shooter.ts +2 -4
- package/src/shot/shot-ask.ts +2 -7
- package/src/shot/shot-theme.ts +6 -17
- package/src/social/routes.ts +2 -2
- package/src/social/writes.ts +3 -0
- package/src/suite/test-units.ts +6 -2
- package/src/trailer/sound/eleven.ts +1 -0
- package/src/urls/added.ts +111 -0
- package/src/urls/icons.ts +294 -0
- package/src/urls/places.ts +139 -0
- package/src/urls/routes.ts +17 -7
- package/src/urls/rows.ts +48 -15
- package/src/urls/unit.ts +57 -3
- package/src/urls/write-routes.ts +207 -0
- package/src/vault/vault-destroy.ts +2 -1
- package/src/vault/vault-import.ts +4 -11
- package/src/vault/vault-restore.ts +3 -2
- package/src/veille/chrome.ts +18 -3
- package/src/veille/identity.ts +6 -0
- package/src/view3d/cam.ts +30 -46
- package/src/view3d/lib.ts +20 -2
- package/src/view3d/viewer.ts +62 -88
- package/src/wiki/agent-paths.ts +2 -1
- package/src/orchestrator/deliver.ts +0 -81
- package/src/orchestrator/drill.ts +0 -129
- package/src/orchestrator/keeper.ts +0 -332
- package/src/orchestrator/pm.ts +0 -20
- package/src/orchestrator/state.ts +0 -92
- package/src/orchestrator/switch.ts +0 -86
- package/src/orchestrator/tmux.ts +0 -82
- package/src/serve/hub-app/rail-fly.tsx +0 -95
- package/src/serve/hub-app/side-lists.ts +0 -72
- package/src/serve/hub-app/sidebar.tsx +0 -62
- package/src/serve/hub-app/tree-row.tsx +0 -125
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// the new thread popup's state, ONE for the page (newThreadOf, by the page's presence store): whether it shows, the
|
|
2
|
+
// project it writes to, the session it goes to (the default ticked), the owner's words and his files. Every way in shows this one: the head line's button, the
|
|
3
|
+
// house strip's, the page's key (keys.ts NEW_THREAD_KEY) and the app's menu (app-bridge.ts newThread).
|
|
4
|
+
// The one constraint a reader breaks first: closing never drops what the owner typed. The words and the picked project
|
|
5
|
+
// are kept in the browser until they are sent; the files wait in the project's store and in this page's memory, so a
|
|
6
|
+
// reload keeps the words and drops the tags of the files the page no longer holds
|
|
7
|
+
import { makeAutoObservable, runInAction } from 'mobx'
|
|
8
|
+
import type { SessionChip } from '../../orchestrator/sessions-shape.ts'
|
|
9
|
+
import type { PresenceSt } from './presence-st.ts'
|
|
10
|
+
import { reach } from './reach.ts'
|
|
11
|
+
import { AttachSt } from './review/attach-st.ts'
|
|
12
|
+
import { kept } from './review/review-kit.ts'
|
|
13
|
+
|
|
14
|
+
/** where the draft is kept in the browser */
|
|
15
|
+
export const DRAFT_KEY = 'hub:new-thread'
|
|
16
|
+
|
|
17
|
+
export type DraftStore = { get(k: string): string | null; put(k: string, v: string | null): void }
|
|
18
|
+
|
|
19
|
+
/** a file's tag in the words, as attach-st.ts writes it */
|
|
20
|
+
const TAG = /\s?\[image \d+\]/g
|
|
21
|
+
|
|
22
|
+
/** the draft a browser kept: its words without the tags of files this page does not hold, the project picked */
|
|
23
|
+
export function draftOf(s: string | null): { text: string; pick: string } {
|
|
24
|
+
try {
|
|
25
|
+
const d = s === null ? null : (JSON.parse(s) as { text?: unknown; pick?: unknown })
|
|
26
|
+
return { text: typeof d?.text === 'string' ? d.text.replace(TAG, '') : '', pick: typeof d?.pick === 'string' ? d.pick : '' }
|
|
27
|
+
} catch {
|
|
28
|
+
return { text: '', pick: '' }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const states = new WeakMap<PresenceSt, NewThreadSt>()
|
|
33
|
+
|
|
34
|
+
/** the page's one popup state: every button and key of a page reads the same presence store, so the same popup */
|
|
35
|
+
export function newThreadOf(presence: PresenceSt): NewThreadSt {
|
|
36
|
+
let st = states.get(presence)
|
|
37
|
+
if (st === undefined) states.set(presence, (st = new NewThreadSt(presence)))
|
|
38
|
+
return st
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class NewThreadSt {
|
|
42
|
+
open = false
|
|
43
|
+
/** the way in named the project (a project's page, a project's app): the popup shows no picker */
|
|
44
|
+
fixed = false
|
|
45
|
+
/** the project the popup writes to, once named or once a file was given for it; '' until then: `target` */
|
|
46
|
+
into = ''
|
|
47
|
+
/** the project he picked on the house, kept for the next thread */
|
|
48
|
+
pick: string
|
|
49
|
+
text: string
|
|
50
|
+
sending = false
|
|
51
|
+
error = ''
|
|
52
|
+
sent: { repo: string; id: string; address: string; to?: string } | null = null
|
|
53
|
+
/** the session he ticked, '' for the default: `session` */
|
|
54
|
+
to = ''
|
|
55
|
+
/** his files, each sent to the store of the project it was given for */
|
|
56
|
+
readonly files: AttachSt
|
|
57
|
+
|
|
58
|
+
constructor(private readonly presence: PresenceSt, private readonly store: DraftStore = kept) {
|
|
59
|
+
const d = draftOf(store.get(DRAFT_KEY))
|
|
60
|
+
this.text = d.text
|
|
61
|
+
this.pick = d.pick
|
|
62
|
+
this.files = new AttachSt(
|
|
63
|
+
() => {
|
|
64
|
+
// the first file names the project for good: the files wait in its store
|
|
65
|
+
if (this.into === '') this.into = this.target
|
|
66
|
+
return `/api/home/orchestrators/upload/${encodeURIComponent(this.into)}`
|
|
67
|
+
},
|
|
68
|
+
{ get: () => this.text, set: (t) => this.setText(t) },
|
|
69
|
+
)
|
|
70
|
+
makeAutoObservable<this, 'presence' | 'store'>(this, { files: false, presence: false, store: false })
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** the project the thread starts in: the one named, else his pick, else the house's own, else the first */
|
|
74
|
+
get target(): string {
|
|
75
|
+
const a = this.presence.answer
|
|
76
|
+
return this.into || this.pick || a?.house || a?.repos[0] || ''
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** the sessions the thread can go to: the target's chips, the default first */
|
|
80
|
+
get sessions(): SessionChip[] {
|
|
81
|
+
return this.presence.sessions(this.target)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** the session the thread goes to: the one he ticked while it still listens or works, else the default (starred),
|
|
85
|
+
* else none: nobody holds it, and the next session that hears takes it */
|
|
86
|
+
get session(): SessionChip | null {
|
|
87
|
+
const all = this.sessions
|
|
88
|
+
return all.find((c) => c.session === this.to) ?? all.find((c) => c.star) ?? null
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** he ticks a session; the default's own tick goes back to following the default */
|
|
92
|
+
pickSession(session: string): void {
|
|
93
|
+
this.to = this.sessions.find((c) => c.session === session)?.star ? '' : session
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** he picks the project: on the house, while no file waits in one */
|
|
97
|
+
get picks(): boolean {
|
|
98
|
+
return !this.fixed && !this.files.any
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** words or files wait in the popup */
|
|
102
|
+
get draft(): boolean {
|
|
103
|
+
return this.text.trim() !== '' || this.files.any
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
get canSend(): boolean {
|
|
107
|
+
return !this.sending && this.text.trim() !== '' && this.target !== '' && this.files.waits === null
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** the popup, for `repo` or with its picker (null). Files that wait keep the project they were given for */
|
|
111
|
+
show(repo: string | null): void {
|
|
112
|
+
if (!this.files.any) this.into = repo ?? ''
|
|
113
|
+
this.fixed = repo !== null
|
|
114
|
+
this.error = ''
|
|
115
|
+
this.open = true
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** the popup leaves, the draft stays */
|
|
119
|
+
close(): void {
|
|
120
|
+
this.open = false
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
setPick(repo: string): void {
|
|
124
|
+
if (!this.picks) return
|
|
125
|
+
this.pick = repo
|
|
126
|
+
this.into = ''
|
|
127
|
+
this.to = ''
|
|
128
|
+
this.keep()
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** his keystrokes: a file whose tag left the words goes */
|
|
132
|
+
typed(t: string): void {
|
|
133
|
+
this.setText(t)
|
|
134
|
+
this.files.follow(t)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
setText(t: string): void {
|
|
138
|
+
this.text = t
|
|
139
|
+
this.keep()
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private keep(): void {
|
|
143
|
+
this.store.put(DRAFT_KEY, this.text.trim() === '' && this.pick === '' ? null : JSON.stringify({ text: this.text, pick: this.pick }))
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async send(): Promise<void> {
|
|
147
|
+
if (!this.canSend) return
|
|
148
|
+
const repo = this.target
|
|
149
|
+
this.sending = true
|
|
150
|
+
this.error = ''
|
|
151
|
+
try {
|
|
152
|
+
const out = this.files.outgoing(this.text.trim())
|
|
153
|
+
const to = this.session
|
|
154
|
+
const r = await reach('/api/home/orchestrators/new-thread', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ repo, text: out.text, ...(out.files.length > 0 ? { files: out.files } : {}), ...(to !== null ? { session: to.session } : {}) }) })
|
|
155
|
+
const j = (await r.json()) as { id?: string; address?: string; to?: string; error?: string }
|
|
156
|
+
runInAction(() => {
|
|
157
|
+
if (!r.ok || !j.id) return void (this.error = j.error ?? `the hub answered ${r.status}`)
|
|
158
|
+
this.files.clear(out.files)
|
|
159
|
+
this.sent = { repo, id: j.id, address: j.address ?? '', ...(j.to ? { to: j.to } : {}) }
|
|
160
|
+
this.to = ''
|
|
161
|
+
this.setText('')
|
|
162
|
+
this.open = false
|
|
163
|
+
})
|
|
164
|
+
} catch (e) {
|
|
165
|
+
runInAction(() => void (this.error = (e as Error).message))
|
|
166
|
+
} finally {
|
|
167
|
+
runInAction(() => void (this.sending = false))
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -1,120 +1,146 @@
|
|
|
1
|
-
// « new thread »: the owner's words and his files, as a new `talk:` thread
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
1
|
+
// « new thread »: the owner's words and his files, as a new `talk:` thread held by the session he ticks among the
|
|
2
|
+
// project's live sessions, the default ticked (orchestrator/routes.ts); with none, a thread nobody holds. The button opens ONE popup over the page (NewThreadDialog, mounted once by
|
|
3
|
+
// hub-app.tsx; its state new-thread-st.ts), so no line of the page grows to hold a form. Its box takes files as the
|
|
4
|
+
// reply box does (attach-view.tsx useFileBox): a paste, a drop or the paper clip, each file an `[image n]` tag at the
|
|
5
|
+
// caret and a live thumbnail over the box, staged in the project's store as it is given. On the house, a picker names
|
|
6
|
+
// the project, fixed once a file is given. Escape, « close » and a press outside close it and keep the draft
|
|
7
|
+
import { observer } from 'mobx-react-lite'
|
|
8
|
+
import { useEffect, useRef } from 'react'
|
|
9
|
+
import { appPost } from './app-bridge.ts'
|
|
9
10
|
import { AutoText } from './auto-text.tsx'
|
|
10
|
-
import {
|
|
11
|
+
import { NEW_THREAD_APP_KEY, NEW_THREAD_KEY } from './keys.ts'
|
|
12
|
+
import { newThreadOf } from './new-thread-st.ts'
|
|
13
|
+
import type { PresenceSt } from './presence-st.ts'
|
|
11
14
|
import { AttachButton, AttachThumbs, useFileBox } from './review/attach-view.tsx'
|
|
12
|
-
import {
|
|
15
|
+
import { tip } from './tips.ts'
|
|
16
|
+
|
|
17
|
+
/** the key the button names: the app's menu key in the macOS app, the page's own in a browser, which keeps ⌘N */
|
|
18
|
+
const KEY = appPost() === null ? NEW_THREAD_KEY : NEW_THREAD_APP_KEY
|
|
13
19
|
|
|
14
20
|
/** `repo`: the project page's repo; null on the house, which picks one */
|
|
15
21
|
export const NewThread = observer(({ presence, repo }: { presence: PresenceSt; repo: string | null }) => {
|
|
16
|
-
const st =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const st = newThreadOf(presence)
|
|
23
|
+
return (
|
|
24
|
+
<span className="nt-wrap">
|
|
25
|
+
{st.sent ? (
|
|
26
|
+
<a className="nt-sent" href={`/inbox?open=${encodeURIComponent(`${st.sent.repo}/${st.sent.id}`)}`}>
|
|
27
|
+
sent: {st.sent.address}
|
|
28
|
+
</a>
|
|
29
|
+
) : null}
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
className={`nt-open${st.draft ? ' draft' : ''}`}
|
|
33
|
+
aria-haspopup="dialog"
|
|
34
|
+
{...tip(st.draft ? 'your draft waits here: open it to go on, or to send it' : 'write to an agent about something new: your words start a thread, files and pictures with them', KEY)}
|
|
35
|
+
onClick={() => st.show(repo)}
|
|
36
|
+
>
|
|
37
|
+
+ new thread
|
|
38
|
+
</button>
|
|
39
|
+
</span>
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
/** the popup itself, once for the page: centred over it, the caret in its box */
|
|
44
|
+
export const NewThreadDialog = observer(({ presence }: { presence: PresenceSt }) => {
|
|
45
|
+
const st = newThreadOf(presence)
|
|
46
|
+
const at = st.files
|
|
29
47
|
const box = useRef<HTMLTextAreaElement | null>(null)
|
|
30
48
|
const files = useFileBox(at, () => box.current)
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
else {
|
|
48
|
-
at.clear(out.files)
|
|
49
|
-
st.sent = { repo: target, id: j.id, address: j.address ?? '' }
|
|
50
|
-
st.text = ''
|
|
51
|
-
st.open = false
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
} catch (e) {
|
|
55
|
-
runInAction(() => void (st.error = (e as Error).message))
|
|
56
|
-
} finally {
|
|
57
|
-
runInAction(() => void (st.sending = false))
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (!st.open)
|
|
61
|
-
return (
|
|
62
|
-
<span className="nt-wrap">
|
|
63
|
-
{st.sent ? (
|
|
64
|
-
<a className="nt-sent" href={`/inbox?open=${encodeURIComponent(`${st.sent.repo}/${st.sent.id}`)}`}>
|
|
65
|
-
sent: {st.sent.address}
|
|
66
|
-
</a>
|
|
67
|
-
) : null}
|
|
68
|
-
<button type="button" className="nt-open" onClick={() => runInAction(() => void (st.open = true))}>
|
|
69
|
-
+ new thread
|
|
70
|
-
</button>
|
|
71
|
-
</span>
|
|
72
|
-
)
|
|
73
|
-
const hearer = target ? presence.hearer(target) : null
|
|
49
|
+
const open = st.open
|
|
50
|
+
// the projects of its picker and who hears, read while it shows
|
|
51
|
+
useEffect(() => (open ? presence.use() : undefined), [presence, open])
|
|
52
|
+
// the caret after the draft's last word; closed, the focus goes back where it was
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!open) return
|
|
55
|
+
const was = document.activeElement instanceof HTMLElement ? document.activeElement : null
|
|
56
|
+
const t = box.current
|
|
57
|
+
t?.focus()
|
|
58
|
+
t?.setSelectionRange(t.value.length, t.value.length)
|
|
59
|
+
return () => was?.focus()
|
|
60
|
+
}, [open])
|
|
61
|
+
if (!open) return null
|
|
62
|
+
const target = st.target
|
|
63
|
+
const to = st.session
|
|
64
|
+
const none = !presence.reachable ? 'this hub has no sessions to send to: a new thread starts from its home' : null
|
|
74
65
|
return (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</option>
|
|
84
|
-
))}
|
|
85
|
-
</select>
|
|
86
|
-
) : (
|
|
87
|
-
<span>in {repo}</span>
|
|
88
|
-
)}
|
|
89
|
-
<span className="nt-who">{hearer ? `${hearer.repo} orchestrator hears it` : 'no orchestrator hears it at once'}</span>
|
|
90
|
-
</div>
|
|
91
|
-
<AttachThumbs at={at} />
|
|
92
|
-
<AutoText
|
|
93
|
-
autoFocus
|
|
94
|
-
rows={4}
|
|
95
|
-
el={(t) => { box.current = t }}
|
|
96
|
-
value={st.text}
|
|
97
|
-
placeholder="your words; paste, drop or pick files"
|
|
98
|
-
{...files.text}
|
|
99
|
-
onText={(t) => {
|
|
100
|
-
runInAction(() => void (st.text = t))
|
|
101
|
-
at.follow(t)
|
|
102
|
-
}}
|
|
66
|
+
// a press that starts on the veil closes it: a selection dragged out of the box does not
|
|
67
|
+
<div className="nt-veil" onMouseDown={(e) => { if (e.target === e.currentTarget) st.close() }}>
|
|
68
|
+
<div
|
|
69
|
+
className="nt-box"
|
|
70
|
+
role="dialog"
|
|
71
|
+
aria-modal="true"
|
|
72
|
+
aria-label="new thread"
|
|
73
|
+
{...files.zone}
|
|
103
74
|
onKeyDown={(e) => {
|
|
104
|
-
|
|
105
|
-
if (e.key
|
|
75
|
+
// the emoji list and a file shown large take their own Escape first
|
|
76
|
+
if (e.key !== 'Escape' || at.viewing !== null) return
|
|
77
|
+
e.stopPropagation()
|
|
78
|
+
st.close()
|
|
106
79
|
}}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
80
|
+
>
|
|
81
|
+
<div className="nt-head">
|
|
82
|
+
<b>new thread</b>
|
|
83
|
+
{st.picks ? (
|
|
84
|
+
<select value={target} onChange={(e) => st.setPick(e.target.value)} aria-label="the project">
|
|
85
|
+
{(presence.answer?.repos ?? []).map((r) => (
|
|
86
|
+
<option key={r} value={r}>
|
|
87
|
+
{r}
|
|
88
|
+
</option>
|
|
89
|
+
))}
|
|
90
|
+
</select>
|
|
91
|
+
) : (
|
|
92
|
+
<span {...tip(!st.fixed && at.any ? 'your files wait in this project: remove them to pick another' : undefined)}>in {target}</span>
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
<div className="nt-to" role="radiogroup" aria-label="the session it goes to" data-check="new-thread-to">
|
|
96
|
+
<span className="nt-tolabel">to</span>
|
|
97
|
+
{st.sessions.length === 0 ? (
|
|
98
|
+
<span className="nt-who" {...tip('no session of this project listens or works now: the thread waits, and the next session that hears takes it')}>
|
|
99
|
+
no session listens now: it waits for the next one
|
|
100
|
+
</span>
|
|
101
|
+
) : (
|
|
102
|
+
st.sessions.map((c) => (
|
|
103
|
+
<button
|
|
104
|
+
key={c.session}
|
|
105
|
+
type="button"
|
|
106
|
+
role="radio"
|
|
107
|
+
aria-checked={to?.session === c.session}
|
|
108
|
+
className={`nt-sess${to?.session === c.session ? ' on' : ''}`}
|
|
109
|
+
data-session={c.session}
|
|
110
|
+
{...tip(`${c.name}${c.place ? ` on ${c.place}` : ''}, ${c.state}${c.star ? ': the default, it hears every thread nobody holds' : ''}. It holds the thread from your first word`)}
|
|
111
|
+
onClick={() => st.pickSession(c.session)}
|
|
112
|
+
>
|
|
113
|
+
<span className={`pl-dot pl-${c.state === 'listening' ? 'idle' : 'running'}`} />
|
|
114
|
+
{c.star ? <span className="pl-star">★</span> : null}
|
|
115
|
+
{c.name}
|
|
116
|
+
{c.place ? <span className="pl-place">{c.place}</span> : null}
|
|
117
|
+
</button>
|
|
118
|
+
))
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
<AttachThumbs at={at} />
|
|
122
|
+
<AutoText
|
|
123
|
+
rows={5}
|
|
124
|
+
el={(t) => { box.current = t }}
|
|
125
|
+
value={st.text}
|
|
126
|
+
placeholder="your words; paste, drop or pick files"
|
|
127
|
+
{...files.text}
|
|
128
|
+
onText={(t) => st.typed(t)}
|
|
129
|
+
onKeyDown={(e) => {
|
|
130
|
+
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) void st.send()
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
{st.error || none ? <div className="nt-err">{st.error || none}</div> : at.waits !== null && at.any ? <div className="nt-err">{at.waits}</div> : null}
|
|
134
|
+
<div className="nt-acts">
|
|
135
|
+
<AttachButton at={at} box={() => box.current} />
|
|
136
|
+
<span className="nt-gap" />
|
|
137
|
+
<button type="button" {...tip('close it: your words and files wait here until you send them', 'Esc')} onClick={() => st.close()}>
|
|
138
|
+
close
|
|
139
|
+
</button>
|
|
140
|
+
<button type="button" className="nt-send" disabled={!st.canSend} onClick={() => void st.send()}>
|
|
141
|
+
{st.sending ? 'sending…' : 'send (⌘↵)'}
|
|
142
|
+
</button>
|
|
143
|
+
</div>
|
|
118
144
|
</div>
|
|
119
145
|
</div>
|
|
120
146
|
)
|
|
@@ -1,78 +1,148 @@
|
|
|
1
|
-
// who is live now, at the top of a project page and as the house strip (orchestrator/presence.ts):
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// who is live now, at the top of a project page and as the house strip (orchestrator/presence.ts): on a project page
|
|
2
|
+
// one chip a live top level session that listens or works, the default starred (session-chips.tsx), the deaf mark when
|
|
3
|
+
// nobody hears a thread nobody holds (deaf.tsx), then one button for its lanes and advisors, their list behind it; on
|
|
4
|
+
// the house strip a chip each, its words on hover
|
|
4
5
|
import { observer } from 'mobx-react-lite'
|
|
5
6
|
import { useEffect } from 'react'
|
|
6
|
-
import type { Present } from '../../orchestrator/presence-shape.ts'
|
|
7
|
+
import type { Hearing, Light, Present } from '../../orchestrator/presence-shape.ts'
|
|
7
8
|
import { LIGHT_WORDS } from '../../orchestrator/presence-shape.ts'
|
|
9
|
+
import { orchestratorWords, tipLines, type OrchWords } from '../../orchestrator/stuck.ts'
|
|
10
|
+
import { DEAF_PROJECT, DeafMark } from './deaf.tsx'
|
|
11
|
+
import { useFlyout } from './floating.tsx'
|
|
8
12
|
import type { HomeSt } from './home-st.ts'
|
|
13
|
+
import type { PresenceSt } from './presence-st.ts'
|
|
9
14
|
import { NewThread } from './new-thread.tsx'
|
|
15
|
+
import { PlacesButton } from './orchestrator-places.tsx'
|
|
10
16
|
import type { RepoSt } from './repo-st.ts'
|
|
17
|
+
import { SessionChips } from './session-chips.tsx'
|
|
18
|
+
import { tip } from './tips.ts'
|
|
11
19
|
|
|
12
20
|
const clock = (ms: number): string => (ms > 0 ? new Date(ms).toTimeString().slice(0, 5) : '')
|
|
13
21
|
|
|
14
22
|
const Dot = ({ p }: { p: Pick<Present, 'light'> }) => <span className={`pl-dot pl-${p.light}`} aria-label={LIGHT_WORDS[p.light]} />
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
/** an orchestrator's state in words (orchestrator/stuck.ts), as the answer read it: its light, its line, its tip */
|
|
25
|
+
const orchWords = (presence: PresenceSt, p: Present): (OrchWords & { tip: string }) | null => {
|
|
26
|
+
const k = presence.view(p.repo)?.orch ?? null
|
|
27
|
+
if (k === null) return null
|
|
28
|
+
const w = orchestratorWords(k, { hearing: presence.hearing(p.repo), now: presence.answer?.now ?? Date.now() })
|
|
29
|
+
return { ...w, tip: tipLines(w, p.terminal == null ? false : p.terminal.window === null ? 'row' : true).join('\n') }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Chip = ({ p, words, onClick }: { p: Present; words?: (OrchWords & { tip: string }) | null; onClick?: () => void }) => {
|
|
33
|
+
const says = words ? `${p.name}: ${words.line}\n${words.tip}` : `${p.name}: ${LIGHT_WORDS[p.light]} since ${clock(p.since)} · ${p.what}`
|
|
18
34
|
const inner = (
|
|
19
35
|
<>
|
|
20
|
-
<Dot p={p} />
|
|
36
|
+
<Dot p={words ?? p} />
|
|
21
37
|
<span className="pl-name">{p.name}</span>
|
|
22
38
|
</>
|
|
23
39
|
)
|
|
24
40
|
return onClick ? (
|
|
25
|
-
<button type="button" className={`pl-chip pl-k-${p.kind} pl-click`}
|
|
41
|
+
<button type="button" className={`pl-chip pl-k-${p.kind} pl-click`} {...tip(says)} onClick={onClick}>
|
|
26
42
|
{inner}
|
|
27
43
|
</button>
|
|
28
44
|
) : (
|
|
29
|
-
<span className={`pl-chip pl-k-${p.kind}`}
|
|
45
|
+
<span className={`pl-chip pl-k-${p.kind}`} {...tip(says)}>
|
|
30
46
|
{inner}
|
|
31
47
|
</span>
|
|
32
48
|
)
|
|
33
49
|
}
|
|
34
50
|
|
|
35
|
-
/** the
|
|
51
|
+
/** the worst light among them: down, needs him, running, idle. An advisor with no live share is down for as long as
|
|
52
|
+
* nobody shares with it, which is no trouble to look at: it counts for nothing here and keeps its red on its own row */
|
|
53
|
+
const WORST: Light[] = ['down', 'needs-him', 'running', 'idle']
|
|
54
|
+
export const worstLight = (ps: readonly Pick<Present, 'light' | 'kind'>[]): Light | null => {
|
|
55
|
+
const counted = ps.filter((p) => !(p.kind === 'advisor' && p.light === 'down'))
|
|
56
|
+
return WORST.find((l) => counted.some((p) => p.light === l)) ?? null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** an orchestrator's terminal, shown: the row of its Claude Code in its project's CLAUDE section, its window while none
|
|
60
|
+
* runs in it */
|
|
61
|
+
const showTerminal = (r: RepoSt, t: NonNullable<Present['terminal']>): void => {
|
|
62
|
+
const at = t.pid != null ? { section: 'claude' as const, id: String(t.pid) } : t.window !== null ? { section: 'terminals' as const, id: t.window } : null
|
|
63
|
+
if (at !== null) r.tree.bringing(() => r.go({ t: 'src', ...at }))
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const count = (n: number, one: string): string => `${n} ${one}${n === 1 ? '' : 's'}`
|
|
67
|
+
|
|
68
|
+
/** `2 lanes`, `1 lane`, `no lane` */
|
|
69
|
+
export const lanesWords = (ps: readonly Pick<Present, 'kind'>[]): string => {
|
|
70
|
+
const n = ps.filter((p) => p.kind === 'lane').length
|
|
71
|
+
return n === 0 ? 'no lane' : count(n, 'lane')
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** who works here beside the orchestrator, one row each: its light, its name, since when, what it does now, the
|
|
75
|
+
* thread a lane holds (a click opens it); an advisor is marked as one */
|
|
76
|
+
export const LanesList = ({ others, open }: { others: Present[]; open: (head: string) => void }) => {
|
|
77
|
+
const advisors = others.filter((p) => p.kind === 'advisor').length
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<div className="pl-poph">
|
|
81
|
+
{lanesWords(others)} at work{advisors > 0 ? ` · ${count(advisors, 'advisor')}` : ''}
|
|
82
|
+
</div>
|
|
83
|
+
{others.map((p) => (
|
|
84
|
+
<div key={`${p.kind}:${p.name}`} className="pl-row">
|
|
85
|
+
<Dot p={p} />
|
|
86
|
+
<b className="pl-who">{p.name}</b>
|
|
87
|
+
{p.kind === 'advisor' ? <span className="pl-tag">advisor</span> : null}
|
|
88
|
+
<span className="pl-rstate">
|
|
89
|
+
{LIGHT_WORDS[p.light]}
|
|
90
|
+
{p.since > 0 ? ` since ${clock(p.since)}` : ''}
|
|
91
|
+
</span>
|
|
92
|
+
<span className="pl-rwhat">{p.what}</span>
|
|
93
|
+
{p.thread ? (
|
|
94
|
+
<button type="button" className="pl-rthread" {...tip(`${p.thread.address}: open its thread`)} onClick={() => open(p.thread!.head)}>
|
|
95
|
+
<span className="pl-rtitle">{p.thread.title}</span>
|
|
96
|
+
{p.thread.more > 0 ? <span className="pl-rmore">+{p.thread.more} more</span> : null}
|
|
97
|
+
</button>
|
|
98
|
+
) : null}
|
|
99
|
+
</div>
|
|
100
|
+
))}
|
|
101
|
+
</>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** one button for every lane and advisor: how many lanes, a dot in the worst light among them; its list opens as the
|
|
106
|
+
* pointer or the focus arrives */
|
|
107
|
+
const LanesButton = observer(({ others, open }: { others: Present[]; open: (head: string) => void }) => {
|
|
108
|
+
const fly = useFlyout({ placement: 'bottom-end' })
|
|
109
|
+
const worst = worstLight(others)
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
<button type="button" ref={fly.ref} className={`pl-lanes${others.length === 0 ? ' none' : ''}`} {...tip(others.length === 0 ? 'no agent works in this project now: each lane at work shows here, with what it does and its thread' : null)} {...fly.props()}>
|
|
113
|
+
{worst === null ? null : <Dot p={{ light: worst }} />}
|
|
114
|
+
{lanesWords(others)}
|
|
115
|
+
</button>
|
|
116
|
+
{others.length === 0 ? null : fly.float('fpop pl-pop', <LanesList others={others} open={open} />)}
|
|
117
|
+
</>
|
|
118
|
+
)
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
/** the deaf mark of a project whose threads nobody holds reach nobody; heard, the normal state, says nothing */
|
|
122
|
+
export const HeardBy = ({ hearing }: { hearing: Hearing }) => (hearing.state === 'own' ? null : <DeafMark why={DEAF_PROJECT} />)
|
|
123
|
+
|
|
124
|
+
/** the line at the top of a project page: one row at any width. Its sessions as chips, each its words in its tip; with
|
|
125
|
+
* none that listens or works, the deaf mark alone */
|
|
36
126
|
export const OrchestratorLine = observer(({ app }: { app: RepoSt }) => {
|
|
37
127
|
const presence = app.home.presence
|
|
38
128
|
useEffect(() => presence.use(), [presence])
|
|
39
|
-
const repo = app.
|
|
129
|
+
const repo = app.houseName
|
|
40
130
|
if (!presence.reachable || presence.answer === null || repo === '') return null
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const others = all.filter((p) => p.kind !== 'orchestrator')
|
|
44
|
-
const hearer = presence.hearer(repo)
|
|
45
|
-
const term = app.home.terminal
|
|
131
|
+
const others = presence.of(repo).filter((p) => p.kind !== 'orchestrator')
|
|
132
|
+
const places = presence.places(repo)
|
|
46
133
|
return (
|
|
47
134
|
<div className="pl-line" role="status">
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
135
|
+
<span className="pl-main">
|
|
136
|
+
<SessionChips presence={presence} repo={repo} />
|
|
137
|
+
<HeardBy hearing={presence.hearing(repo)} />
|
|
138
|
+
{places !== null ? <PlacesButton presence={presence} repo={repo} places={places} /> : null}
|
|
139
|
+
{presence.error ? (
|
|
140
|
+
<span className="pl-err" {...tip(presence.error)}>
|
|
141
|
+
{presence.error}
|
|
54
142
|
</span>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<span className="pl-dot pl-down" />
|
|
59
|
-
<b>no orchestrator</b>
|
|
60
|
-
<span className="pl-words">{hearer ? `${hearer.repo} orchestrator hears this repo for it` : 'nobody hears your words here at once'}</span>
|
|
61
|
-
<button type="button" className="pl-on" disabled={presence.busy === repo} onClick={() => void presence.turn(repo, true)}>
|
|
62
|
-
{presence.busy === repo ? 'starting…' : 'turn on'}
|
|
63
|
-
</button>
|
|
64
|
-
</span>
|
|
65
|
-
)}
|
|
66
|
-
{others.map((p) => (
|
|
67
|
-
<Chip key={`${p.kind}:${p.name}`} p={p} />
|
|
68
|
-
))}
|
|
69
|
-
{presence.error ? <span className="pl-err">{presence.error}</span> : null}
|
|
70
|
-
<span className="pl-gap" />
|
|
71
|
-
{term.attach !== null ? (
|
|
72
|
-
<button type="button" className="pl-back" onClick={() => term.attachTo(null)}>
|
|
73
|
-
terminal: back to the shell
|
|
74
|
-
</button>
|
|
75
|
-
) : null}
|
|
143
|
+
) : null}
|
|
144
|
+
</span>
|
|
145
|
+
<LanesButton others={others} open={(head) => app.showReview(head)} />
|
|
76
146
|
<NewThread presence={presence} repo={repo} />
|
|
77
147
|
</div>
|
|
78
148
|
)
|
|
@@ -88,12 +158,12 @@ export const PresenceStrip = observer(({ home }: { home: HomeSt }) => {
|
|
|
88
158
|
return (
|
|
89
159
|
<div className="pl-strip" role="status">
|
|
90
160
|
<span className="pl-title">live now</span>
|
|
91
|
-
{repos.length === 0 ? <span className="pl-words">nobody: no
|
|
161
|
+
{repos.length === 0 ? <span className="pl-words">nobody: no session listens, no lane at work</span> : null}
|
|
92
162
|
{repos.map((r) => (
|
|
93
163
|
<span key={r} className="pl-repo">
|
|
94
164
|
<span className="pl-rname">{r}</span>
|
|
95
165
|
{a.presence[r]!.map((p) => (
|
|
96
|
-
<Chip key={`${p.kind}:${p.name}`} p={p} {...(p.kind === 'orchestrator' && p.
|
|
166
|
+
<Chip key={`${p.kind}:${p.name}`} p={p} {...(p.kind === 'orchestrator' ? { words: orchWords(presence, p) } : {})} {...(p.kind === 'orchestrator' && p.terminal ? { onClick: () => showTerminal(home.repo(p.repo), p.terminal!) } : {})} />
|
|
97
167
|
))}
|
|
98
168
|
</span>
|
|
99
169
|
))}
|