rvlib-shipkit 2.25.0 → 2.27.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 +33 -0
- package/package.json +2 -2
- package/src/agent-time/diet.ts +77 -0
- package/src/agent-time/family.ts +72 -0
- package/src/agent-time/hooks.ts +331 -0
- package/src/agent-time/limits.ts +44 -0
- package/src/agent-time/live.ts +1 -3
- package/src/agent-time/mask.ts +96 -18
- package/src/agent-time/refused.ts +45 -0
- package/src/agent-time/render.ts +130 -17
- package/src/agent-time/report-cache.ts +57 -0
- package/src/agent-time/report.ts +349 -23
- package/src/agent-time/shape.ts +50 -3
- package/src/agent-time/store.ts +370 -95
- package/src/agent-time/timeline.ts +140 -21
- package/src/agent-time/turns.ts +18 -8
- package/src/annex/offload.ts +17 -6
- package/src/annex/tidy.ts +70 -10
- package/src/asks/ask-after.ts +40 -0
- package/src/asks/asks-queue.ts +205 -47
- package/src/assets/kit-config.ts +7 -3
- package/src/assets/kits/identity-kit.ts +289 -10
- package/src/check.ts +3 -1
- package/src/checks/SK004-gitignore-policy.check.ts +12 -5
- package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
- package/src/checks/SK026-asks-autoclose.check.ts +5 -5
- package/src/checks/SK028-readme.check.ts +7 -66
- package/src/checks/SK030-cache-audit.check.ts +6 -1
- package/src/checks/SK031-trace-audit.check.ts +2 -0
- package/src/checks/SK033-global-contribution.check.ts +3 -1
- package/src/checks/SK035-public-clean.check.ts +2 -2
- package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
- package/src/checks/SK045-slow-hooks.check.ts +47 -0
- package/src/checks/SK046-hook-records.check.ts +76 -0
- package/src/checks/SK047-login-in-description.check.ts +36 -0
- package/src/checks/SK048-one-local-file.check.ts +36 -0
- package/src/cli/cmd_Asks.ts +71 -5
- package/src/cli/cmd_Backup.ts +5 -3
- package/src/cli/cmd_Capacity.ts +2 -2
- package/src/cli/cmd_CrossRepoActivity.ts +5 -4
- package/src/cli/cmd_Db.ts +253 -0
- package/src/cli/cmd_History.ts +212 -0
- package/src/cli/cmd_Home.ts +31 -3
- package/src/cli/cmd_Hq.ts +516 -0
- package/src/cli/cmd_Machines.ts +36 -0
- package/src/cli/cmd_Media.ts +38 -6
- package/src/cli/cmd_Mv.ts +1 -1
- package/src/cli/cmd_Reflect.ts +23 -2
- package/src/cli/cmd_Releases.ts +30 -0
- package/src/cli/cmd_Review.ts +569 -118
- package/src/cli/cmd_Secret.ts +62 -12
- package/src/cli/cmd_Social.ts +83 -1
- package/src/cli/cmd_Space.ts +324 -0
- package/src/cli/cmd_Time.ts +82 -5
- package/src/cli/cmd_Tmp.ts +28 -4
- package/src/cli/cmd_Trailer.ts +14 -10
- package/src/cli/cmd_Urls.ts +56 -0
- package/src/cli/cmd_Vault.ts +583 -0
- package/src/cli/family-help.ts +4 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/registry.ts +26 -4
- package/src/collections/actions.ts +63 -13
- package/src/collections/collection-types.ts +23 -1
- package/src/collections/providers.ts +117 -23
- package/src/collections/review.ts +4 -4
- package/src/commands/runner.ts +5 -1
- package/src/contracts/contract-manifests.ts +6 -5
- package/src/contracts/contract-types.ts +6 -4
- package/src/contracts/contracts-engine.ts +11 -0
- package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
- package/src/core/budget.ts +12 -17
- package/src/core/capacity.ts +27 -18
- package/src/core/check-runner.ts +7 -4
- package/src/core/history-files.ts +9 -5
- package/src/core/layout.ts +3 -0
- package/src/core/machine-busy.ts +127 -0
- package/src/core/machine-commit.ts +6 -1
- package/src/core/machine-db.ts +368 -20
- package/src/core/machine-layout.ts +137 -0
- package/src/core/machine-read.ts +81 -0
- package/src/core/migrate-layout.ts +1 -1
- package/src/core/one-way-in-policy.ts +64 -7
- package/src/core/polling-policy.ts +27 -0
- package/src/core/retention.ts +16 -2
- package/src/core/scope.ts +107 -14
- package/src/core/signal-name.ts +6 -0
- package/src/core/slots.ts +5 -4
- package/src/core/trace-audit.ts +6 -1
- package/src/core/transient.ts +6 -0
- package/src/drill/clean.ts +25 -1
- package/src/drill/run.ts +2 -2
- package/src/drill/seal.ts +27 -4
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +66 -3
- package/src/home/app-sign.ts +15 -4
- package/src/home/daemon-jobs.ts +149 -7
- package/src/home/database-projects.ts +111 -0
- package/src/home/database-words.ts +203 -0
- package/src/home/databases.ts +460 -0
- package/src/home/global-units.ts +6 -0
- package/src/home/gui-app/ShipkitGui.swift +122 -1
- package/src/home/gui-app.ts +6 -3
- package/src/home/home-move.ts +514 -0
- package/src/home/home-paths.ts +12 -3
- package/src/home/home-routes.ts +68 -0
- package/src/home/inbox-shape.ts +24 -14
- package/src/home/machine-fold.ts +820 -0
- package/src/home/machine-host.ts +20 -5
- package/src/home/machine-repair.ts +503 -0
- package/src/home/machine-stores.ts +66 -15
- package/src/home/machine-temp.ts +547 -86
- package/src/home/resume.ts +79 -0
- package/src/home/run-daemon.ts +25 -4
- package/src/home/run-pm.ts +18 -5
- package/src/home/serve-daemon.ts +18 -3
- package/src/home/serve-web.ts +175 -7
- package/src/home/space-job.ts +115 -0
- package/src/home/space-page.ts +257 -0
- package/src/home/space-route.ts +167 -0
- package/src/home/space-words.ts +103 -0
- package/src/home/time-page-shape.ts +202 -0
- package/src/home/time-page.ts +64 -0
- package/src/home/vault-page.ts +482 -0
- package/src/home/vault-words.ts +132 -0
- package/src/hooks/leak-guard.ts +40 -13
- package/src/hooks/one-way-in-guard.ts +17 -4
- package/src/hq/cards.ts +581 -0
- package/src/hq/door-route.ts +43 -0
- package/src/hq/door.ts +163 -0
- package/src/hq/files-send.ts +348 -0
- package/src/hq/forgotten-log.ts +35 -0
- package/src/hq/history-check.ts +255 -0
- package/src/hq/history-place.ts +146 -0
- package/src/hq/history-send.ts +487 -0
- package/src/hq/hq-db.ts +99 -0
- package/src/hq/hq-local.ts +469 -0
- package/src/hq/hq-routes.ts +196 -0
- package/src/hq/hq-store.ts +599 -0
- package/src/hq/kinds/ask.ts +147 -0
- package/src/hq/kinds/card-gone.ts +83 -0
- package/src/hq/kinds/card-msg.ts +66 -0
- package/src/hq/kinds/card.ts +99 -0
- package/src/hq/kinds/index.ts +21 -0
- package/src/hq/kinds/kind.ts +126 -0
- package/src/hq/kinds/media.ts +125 -0
- package/src/hq/kinds/prompt.ts +219 -0
- package/src/hq/kinds/reflection.ts +128 -0
- package/src/hq/kinds/report.ts +55 -0
- package/src/hq/kinds/time-day.ts +236 -0
- package/src/hq/ledger.ts +473 -0
- package/src/hq/machine-key.ts +44 -0
- package/src/hq/machine-notes.ts +131 -0
- package/src/hq/outbox.ts +372 -0
- package/src/hq/replica.ts +168 -0
- package/src/hq/repo-id.ts +4 -0
- package/src/hq/report-facts.ts +117 -0
- package/src/hq/report.ts +274 -0
- package/src/hq/switch.ts +151 -0
- package/src/hq/vault-grant.ts +92 -0
- package/src/identities/identities.ts +15 -3
- package/src/identities/steps.ts +31 -0
- package/src/ledger/db.ts +73 -26
- package/src/ledger/gate-checks.ts +29 -4
- package/src/ledger/git-key.ts +3 -3
- package/src/ledger/git-scan.ts +49 -7
- package/src/ledger/run-log.ts +11 -3
- package/src/ledger/store.ts +26 -4
- package/src/media-store/backup/daemon.ts +36 -17
- package/src/media-store/backup/kept.ts +241 -0
- package/src/media-store/backup/restore.ts +14 -4
- package/src/media-store/backup/run.ts +11 -11
- package/src/media-store/backup/secret.ts +6 -4
- package/src/media-store/backup/snapshot.ts +4 -2
- package/src/media-store/backup/sources.ts +68 -20
- package/src/media-store/copy/config.ts +77 -0
- package/src/media-store/copy/copy.ts +194 -0
- package/src/media-store/copy/lifecycle.ts +43 -0
- package/src/media-store/copy/night.ts +90 -0
- package/src/media-store/copy/proof.ts +151 -0
- package/src/media-store/copy/snapshot.ts +152 -0
- package/src/media-store/copy/store.ts +62 -0
- package/src/media-store/copy/stream.ts +176 -0
- package/src/media-store/daemon.ts +66 -16
- package/src/media-store/db.ts +22 -11
- package/src/media-store/forget.ts +23 -3
- package/src/media-store/hand.ts +4 -3
- package/src/media-store/hq-find.ts +75 -0
- package/src/media-store/hq-send.ts +277 -0
- package/src/media-store/kind.ts +2 -0
- package/src/media-store/purge.ts +18 -15
- package/src/media-store/put.ts +24 -8
- package/src/media-store/remote.ts +16 -7
- package/src/media-store/space-listing.ts +240 -0
- package/src/media-store/space.ts +40 -21
- package/src/media-store/sync.ts +5 -5
- package/src/media-store/tidy.ts +98 -0
- package/src/media-store/upload.ts +3 -3
- package/src/media-store/webp.ts +66 -0
- package/src/messages/model.ts +16 -7
- package/src/messages/routes.ts +14 -4
- package/src/messages/score.ts +2 -2
- package/src/messages/suggest.ts +96 -0
- package/src/pages/frame-client.ts +10 -0
- package/src/plan/planner.ts +28 -17
- package/src/recordings/media-kind.ts +1 -0
- package/src/recordings/model.ts +1 -1
- package/src/recordings/recorder-app/Capture.swift +9 -7
- package/src/reflect/hq-corpus.ts +56 -0
- package/src/reflect/prompt-corpus.ts +3 -1
- package/src/reflect/transcript.ts +146 -36
- package/src/release/machine-words.ts +67 -0
- package/src/release/public-clean.ts +8 -3
- package/src/releases/from-card.ts +1 -1
- package/src/releases/model.ts +18 -0
- package/src/releases/routes.ts +10 -5
- package/src/releases/store.ts +23 -2
- package/src/repo-config.ts +42 -2
- package/src/review/anim.ts +2 -2
- package/src/review/auto.ts +2 -2
- package/src/review/card-db.ts +244 -0
- package/src/review/card-rows.ts +266 -0
- package/src/review/cells.ts +76 -5
- package/src/review/draft-card.ts +41 -0
- package/src/review/draft-model.ts +78 -0
- package/src/review/format.ts +29 -10
- package/src/review/gone.ts +98 -0
- package/src/review/inbox-hook.ts +35 -0
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +7 -5
- package/src/review/media-read.ts +9 -7
- package/src/review/media.ts +32 -5
- package/src/review/model.ts +214 -45
- package/src/review/move.ts +491 -0
- package/src/review/notes.ts +12 -20
- package/src/review/previews.ts +15 -19
- package/src/review/project.ts +1 -1
- package/src/review/rev.ts +8 -0
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +64 -13
- package/src/review/stage-card.ts +8 -4
- package/src/review/stage-routes.ts +1 -1
- package/src/review/store.ts +529 -83
- package/src/review/thread-fold.ts +51 -0
- package/src/review/threads.ts +147 -9
- package/src/review/trailer-auto-mock.ts +63 -0
- package/src/review/trailer-card.ts +4 -4
- package/src/review/trailer-desk.ts +41 -7
- package/src/review/trailer-media.ts +1 -0
- package/src/review/trailer-model.ts +8 -0
- package/src/review/trailer-notes.ts +1 -1
- package/src/review/trailer-routes.ts +9 -1
- package/src/review/unit.ts +6 -6
- package/src/review/watchers.ts +1 -1
- package/src/rules/untrack-generated.ts +92 -8
- package/src/secrets/held.ts +16 -0
- package/src/secrets/keychain.ts +113 -0
- package/src/secrets/list.ts +16 -6
- package/src/secrets/manager.ts +24 -10
- package/src/secrets/read.ts +257 -0
- package/src/secrets/who-reads.ts +49 -0
- package/src/serve/door-forward.ts +268 -0
- package/src/serve/door-names.ts +47 -0
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/activity-view.tsx +56 -32
- package/src/serve/hub-app/activity.css +7 -1
- package/src/serve/hub-app/asks-page.tsx +48 -0
- package/src/serve/hub-app/asks-st.ts +25 -0
- package/src/serve/hub-app/clock-svc.ts +1 -2
- package/src/serve/hub-app/col-card.tsx +64 -13
- package/src/serve/hub-app/col-list-page.tsx +122 -0
- package/src/serve/hub-app/col-list-st.ts +103 -0
- package/src/serve/hub-app/col-tables-view.tsx +10 -41
- package/src/serve/hub-app/col-tables.ts +76 -8
- package/src/serve/hub-app/cols-svc.ts +70 -16
- package/src/serve/hub-app/database-st.ts +260 -0
- package/src/serve/hub-app/database-view.tsx +289 -0
- package/src/serve/hub-app/database.css +32 -0
- package/src/serve/hub-app/entry-bar.css +14 -0
- package/src/serve/hub-app/entry-bar.tsx +33 -0
- package/src/serve/hub-app/entry-pick.ts +31 -0
- package/src/serve/hub-app/floating.tsx +1 -0
- package/src/serve/hub-app/hash-route.ts +11 -1
- package/src/serve/hub-app/header-bar.tsx +14 -18
- package/src/serve/hub-app/home-st.ts +89 -9
- package/src/serve/hub-app/home-strip.css +5 -19
- package/src/serve/hub-app/home-strip.tsx +58 -92
- package/src/serve/hub-app/home.html +7 -0
- package/src/serve/hub-app/hub-app.tsx +31 -142
- package/src/serve/hub-app/hub-types.ts +3 -1
- package/src/serve/hub-app/hub.css +109 -23
- package/src/serve/hub-app/icons.tsx +18 -1
- package/src/serve/hub-app/identities-st.ts +56 -6
- package/src/serve/hub-app/identities-view.tsx +100 -58
- package/src/serve/hub-app/identities.css +17 -15
- package/src/serve/hub-app/identity-address.ts +5 -0
- package/src/serve/hub-app/inbox-st.ts +41 -24
- package/src/serve/hub-app/inbox-view.tsx +37 -41
- package/src/serve/hub-app/inbox.css +2 -5
- package/src/serve/hub-app/index.html +7 -0
- package/src/serve/hub-app/kept-cols.tsx +7 -0
- package/src/serve/hub-app/keys.ts +28 -15
- package/src/serve/hub-app/later.tsx +26 -0
- package/src/serve/hub-app/list-filter.tsx +14 -0
- package/src/serve/hub-app/list-walk.ts +72 -3
- package/src/serve/hub-app/machines-st.ts +251 -0
- package/src/serve/hub-app/machines-view.tsx +224 -0
- package/src/serve/hub-app/machines.css +76 -0
- package/src/serve/hub-app/md-copy.tsx +79 -0
- package/src/serve/hub-app/media-view.tsx +2 -0
- package/src/serve/hub-app/messages/messages-page.tsx +79 -7
- package/src/serve/hub-app/messages/messages-st.ts +99 -3
- package/src/serve/hub-app/messages.css +14 -0
- package/src/serve/hub-app/page-keys.ts +175 -0
- package/src/serve/hub-app/pages-frames.tsx +11 -3
- package/src/serve/hub-app/palette-st.ts +58 -11
- package/src/serve/hub-app/palette-view.tsx +3 -1
- package/src/serve/hub-app/project-list.css +54 -8
- package/src/serve/hub-app/project-list.tsx +128 -59
- package/src/serve/hub-app/projects-svc.ts +78 -7
- package/src/serve/hub-app/reader-chips.tsx +13 -0
- package/src/serve/hub-app/readme-view.tsx +2 -3
- package/src/serve/hub-app/readme.css +27 -5
- package/src/serve/hub-app/reflections-page.tsx +42 -0
- package/src/serve/hub-app/reflections-st.ts +17 -0
- package/src/serve/hub-app/releases/releases-page.tsx +25 -2
- package/src/serve/hub-app/releases/releases-st.ts +1 -1
- package/src/serve/hub-app/repo-sections.ts +9 -5
- package/src/serve/hub-app/repo-st.ts +35 -8
- package/src/serve/hub-app/review/draft-card.tsx +163 -0
- package/src/serve/hub-app/review/kit.tsx +50 -7
- package/src/serve/hub-app/review/note-place.ts +1 -1
- package/src/serve/hub-app/review/review-board.tsx +2 -2
- package/src/serve/hub-app/review/review-cells.tsx +145 -65
- package/src/serve/hub-app/review/review-kit.ts +27 -1
- package/src/serve/hub-app/review/review-list.tsx +68 -30
- package/src/serve/hub-app/review/review-page.tsx +7 -8
- package/src/serve/hub-app/review/review-st.ts +111 -24
- package/src/serve/hub-app/review/review-thread.tsx +49 -19
- package/src/serve/hub-app/review/review-views.tsx +475 -144
- package/src/serve/hub-app/review/thread-control-st.ts +115 -0
- package/src/serve/hub-app/review/thread-control.tsx +74 -0
- package/src/serve/hub-app/review/thread-st.ts +73 -26
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-page.tsx +37 -16
- package/src/serve/hub-app/review/trailer-st.ts +41 -7
- package/src/serve/hub-app/review.css +267 -61
- package/src/serve/hub-app/side-lists.ts +72 -0
- package/src/serve/hub-app/sidebar.tsx +6 -3
- package/src/serve/hub-app/site/site-part.tsx +2 -8
- package/src/serve/hub-app/site/site-st.ts +4 -4
- package/src/serve/hub-app/social/comms-page.tsx +20 -5
- package/src/serve/hub-app/social/kit.tsx +30 -4
- package/src/serve/hub-app/social/post-card.tsx +139 -49
- package/src/serve/hub-app/social/serial-writes.ts +13 -0
- package/src/serve/hub-app/social/social-model.ts +11 -0
- package/src/serve/hub-app/social/social-page.tsx +94 -35
- package/src/serve/hub-app/social/social-st.ts +120 -36
- package/src/serve/hub-app/social/stage-popup.tsx +1 -1
- package/src/serve/hub-app/social/stage-st.ts +1 -1
- package/src/serve/hub-app/social/step-layout.ts +1 -1
- package/src/serve/hub-app/social.css +3 -0
- package/src/serve/hub-app/space-st.ts +209 -0
- package/src/serve/hub-app/space-view.tsx +196 -0
- package/src/serve/hub-app/space.css +27 -0
- package/src/serve/hub-app/stores/stores-page.tsx +91 -23
- package/src/serve/hub-app/stores/stores-st.ts +44 -19
- package/src/serve/hub-app/stores.css +6 -1
- package/src/serve/hub-app/theme-st.ts +22 -9
- package/src/serve/hub-app/time-charts.tsx +291 -0
- package/src/serve/hub-app/time-pages.tsx +749 -0
- package/src/serve/hub-app/time-st.ts +162 -0
- package/src/serve/hub-app/time-view.tsx +76 -0
- package/src/serve/hub-app/time.css +138 -0
- package/src/serve/hub-app/tree-build.ts +52 -42
- package/src/serve/hub-app/tree-row.tsx +4 -4
- package/src/serve/hub-app/tree-svc.ts +18 -9
- package/src/serve/hub-app/urls-svc.ts +154 -0
- package/src/serve/hub-app/urls-view.tsx +117 -0
- package/src/serve/hub-app/urls.css +30 -0
- package/src/serve/hub-app/vault-st.ts +127 -0
- package/src/serve/hub-app/vault-view.tsx +154 -0
- package/src/serve/hub-app/vault.css +38 -0
- package/src/serve/hub-app/veille/veille-st.ts +12 -10
- package/src/serve/hub-app/waiting-svc.ts +29 -0
- package/src/serve/hub-app/wikis-view.tsx +2 -2
- package/src/serve/hub-runtime.ts +15 -2
- package/src/serve/project-gutter-route.ts +27 -14
- package/src/serve/project-gutter.ts +25 -12
- package/src/serve/same-origin.ts +10 -0
- package/src/serve/serve-hub.ts +13 -4
- package/src/shipkit-files.ts +16 -2
- package/src/shipkit.ts +1 -1
- package/src/shot/shooter.ts +616 -420
- package/src/shot/shot-ask.ts +246 -155
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -2
- package/src/social/cover.ts +202 -0
- package/src/social/discord-layout.ts +37 -13
- package/src/social/drafts.ts +3 -0
- package/src/social/load.ts +23 -2
- package/src/social/media-kind.ts +2 -1
- package/src/social/publish/discord.ts +5 -2
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +28 -13
- package/src/social/routes.ts +26 -1
- package/src/social/stage.ts +1 -1
- package/src/social/stats.ts +12 -9
- package/src/social/strip.ts +4 -1
- package/src/social/thumbnail.ts +255 -0
- package/src/stores/collection.ts +15 -11
- package/src/stores/desk.ts +236 -42
- package/src/stores/model.ts +72 -6
- package/src/stores/routes.ts +37 -12
- package/src/stores/unit.ts +14 -8
- package/src/suite/judge-suites.ts +113 -16
- package/src/suite/select.ts +45 -3
- package/src/suite/suite-cli.ts +81 -34
- package/src/trailer/bed.ts +1 -1
- package/src/trailer/build.ts +134 -21
- package/src/trailer/ffmpeg.ts +7 -0
- package/src/trailer/fonts.ts +3 -2
- package/src/trailer/grammar.ts +201 -2
- package/src/trailer/graph.ts +42 -5
- package/src/trailer/look.ts +21 -0
- package/src/trailer/mock.ts +154 -0
- package/src/trailer/passage.ts +65 -26
- package/src/trailer/score/heard.ts +89 -0
- package/src/trailer/score/sound.ts +14 -8
- package/src/trailer/sound/run.ts +16 -6
- package/src/trailer/stitch.ts +26 -5
- package/src/trailer/titles.ts +82 -19
- package/src/trailer/versions.ts +1 -3
- package/src/trailer/vertical.ts +3 -1
- package/src/urls/frame.ts +195 -0
- package/src/urls/routes.ts +43 -0
- package/src/urls/rows.ts +171 -0
- package/src/urls/unit.ts +73 -0
- package/src/vault/house-keys.ts +42 -0
- package/src/vault/layout.ts +50 -0
- package/src/vault/policy.ts +165 -0
- package/src/vault/vault-audit.ts +276 -0
- package/src/vault/vault-client.ts +40 -0
- package/src/vault/vault-config.ts +159 -0
- package/src/vault/vault-destroy.ts +78 -0
- package/src/vault/vault-handover.ts +305 -0
- package/src/vault/vault-http.ts +352 -0
- package/src/vault/vault-import.ts +208 -0
- package/src/vault/vault-init.ts +328 -0
- package/src/vault/vault-minter.ts +271 -0
- package/src/vault/vault-restore.ts +333 -0
- package/src/vault/vault-serve.ts +342 -0
- package/src/vault/vault-snapshot.ts +281 -0
- package/src/veille/asks.ts +1 -1
- package/src/veille/desk.ts +2 -2
- package/src/wiki/run-wiki.ts +2 -1
- package/src/wiki/scan-md.ts +42 -2
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// a repo's messages page (`#page:messages`, wiki tools/shipkit/messages.md, The page): every message by family with its
|
|
2
2
|
// meaning and value, each phrasing scored by each reader of a run, the value for its cost, the personas, the page tops,
|
|
3
|
-
// the readers' notes
|
|
3
|
+
// the readers' notes, and the owner's suggestions (a message, a phrasing) appended to messages.md. Every other edit of
|
|
4
|
+
// the store is made as text in .shipkit/messages/
|
|
4
5
|
import { observer } from 'mobx-react-lite'
|
|
5
|
-
import { useEffect, type CSSProperties } from 'react'
|
|
6
|
+
import { useEffect, type CSSProperties, type FormEvent } from 'react'
|
|
6
7
|
import { PASS, VETO } from '../../../messages/score.ts'
|
|
7
8
|
import { MESSAGES_TABS } from '../../../messages/tabs.ts'
|
|
8
9
|
import type { RepoSt } from '../repo-st.ts'
|
|
9
|
-
import type
|
|
10
|
+
import { NEW_FAMILY, type MessagesSt, type RunView, type StoreView } from './messages-st.ts'
|
|
11
|
+
import { ThreadControl } from '../review/thread-control.tsx'
|
|
10
12
|
|
|
11
13
|
type Msg = StoreView['messages'][number]
|
|
12
14
|
|
|
@@ -40,13 +42,15 @@ const MessageCard = observer(({ ms, m }: { ms: MessagesSt; m: Msg }) => {
|
|
|
40
42
|
<h3>
|
|
41
43
|
{m.title}
|
|
42
44
|
<small>{m.id}</small>
|
|
45
|
+
<ThreadControl st={ms.st} address={`messages:${m.id}`} name={m.title} />
|
|
46
|
+
{m.toFill.length ? <span className="msg-tag" title="an agent fills these from what is built">to fill: {m.toFill.join(', ')}</span> : null}
|
|
43
47
|
</h3>
|
|
44
48
|
<dl>
|
|
45
49
|
{(['meaning', 'value', 'truth', 'never'] as const).map((k) =>
|
|
46
|
-
m.fields[k] ? (
|
|
50
|
+
m.fields[k] || m.toFill.includes(k) ? (
|
|
47
51
|
<div key={k} className="msg-field">
|
|
48
52
|
<dt>{k}</dt>
|
|
49
|
-
<dd>{m.fields[k]}</dd>
|
|
53
|
+
{m.fields[k] ? <dd>{m.fields[k]}</dd> : <dd className="msg-fill">to fill</dd>}
|
|
50
54
|
</div>
|
|
51
55
|
) : null,
|
|
52
56
|
)}
|
|
@@ -71,7 +75,7 @@ const MessageCard = observer(({ ms, m }: { ms: MessagesSt; m: Msg }) => {
|
|
|
71
75
|
{rows.map((c) => (
|
|
72
76
|
<tr key={c.id}>
|
|
73
77
|
<td className="line">
|
|
74
|
-
<span className="msg-id">{c.id}</span> {c.text} <span className="msg-src">{c.source}</span>
|
|
78
|
+
<span className="msg-id">{c.id}</span> {c.text} <span className="msg-src">{c.source}</span> <ThreadControl st={ms.st} address={`messages:${m.id}/${c.id}`} name={`${m.title}: ${c.id}`} />
|
|
75
79
|
</td>
|
|
76
80
|
<td className="cell" style={heat(meanOf(run, c.id))}>
|
|
77
81
|
<b>{meanOf(run, c.id) ?? ''}</b>
|
|
@@ -95,16 +99,74 @@ const MessageCard = observer(({ ms, m }: { ms: MessagesSt; m: Msg }) => {
|
|
|
95
99
|
</tbody>
|
|
96
100
|
</table>
|
|
97
101
|
</div>
|
|
102
|
+
<form className="msg-suggest-line" onSubmit={(e) => submit(e, () => ms.suggestPhrasing(m.id))}>
|
|
103
|
+
<input value={ms.phrasings[m.id] ?? ''} onChange={(e) => ms.setPhrasing(m.id, e.target.value)} placeholder="Suggest a phrasing: one line, in your words" aria-label={`a new phrasing of ${m.id}`} />
|
|
104
|
+
<button type="submit" disabled={ms.sending || !(ms.phrasings[m.id] ?? '').trim()}>
|
|
105
|
+
Suggest
|
|
106
|
+
</button>
|
|
107
|
+
</form>
|
|
108
|
+
<Note ms={ms} at={m.id} />
|
|
98
109
|
</section>
|
|
99
110
|
)
|
|
100
111
|
})
|
|
101
112
|
|
|
113
|
+
const Note = observer(({ ms, at }: { ms: MessagesSt; at: string }) => (ms.note?.at === at ? <p className={ms.note.ok ? 'msg-note' : 'msg-error'}>{ms.note.text}</p> : null))
|
|
114
|
+
|
|
115
|
+
const submit = (e: FormEvent, go: () => Promise<void>): void => {
|
|
116
|
+
e.preventDefault()
|
|
117
|
+
void go()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const Suggest = observer(({ ms }: { ms: MessagesSt }) => {
|
|
121
|
+
const d = ms.draft
|
|
122
|
+
const field = (k: 'meaning' | 'value' | 'phrasing', label: string, hint: string) => (
|
|
123
|
+
<label>
|
|
124
|
+
<span>{label}</span>
|
|
125
|
+
<input value={d[k]} onChange={(e) => ms.setDraft(k, e.target.value)} placeholder={hint} />
|
|
126
|
+
</label>
|
|
127
|
+
)
|
|
128
|
+
return (
|
|
129
|
+
<details className="msg-card msg-suggest" open={!!d.title || undefined}>
|
|
130
|
+
<summary>Suggest a message</summary>
|
|
131
|
+
<form onSubmit={(e) => submit(e, () => ms.suggestMessage())}>
|
|
132
|
+
<label>
|
|
133
|
+
<span>title</span>
|
|
134
|
+
<input value={d.title} onChange={(e) => ms.setDraft('title', e.target.value)} placeholder="the value in your words: easy TUI to run your workflow" required />
|
|
135
|
+
</label>
|
|
136
|
+
<label>
|
|
137
|
+
<span>family</span>
|
|
138
|
+
<span className="msg-row">
|
|
139
|
+
<select value={ms.family} onChange={(e) => ms.setDraft('family', e.target.value)}>
|
|
140
|
+
{ms.families.map((f) => (
|
|
141
|
+
<option key={f} value={f}>
|
|
142
|
+
{f}
|
|
143
|
+
</option>
|
|
144
|
+
))}
|
|
145
|
+
<option value={NEW_FAMILY}>a new family…</option>
|
|
146
|
+
</select>
|
|
147
|
+
{ms.family === NEW_FAMILY ? <input value={d.newFamily} onChange={(e) => ms.setDraft('newFamily', e.target.value)} placeholder="its name" /> : null}
|
|
148
|
+
</span>
|
|
149
|
+
</label>
|
|
150
|
+
{field('meaning', 'meaning', 'optional: what the reader must take away')}
|
|
151
|
+
{field('value', 'value', 'optional: what they gain, in their terms')}
|
|
152
|
+
{field('phrasing', 'phrasing', 'optional: a first line, as you would say it')}
|
|
153
|
+
<p className="msg-hint">What you leave empty is written « to fill », the truth always: an agent fills it from what is built, never from a wish. The store is text: .shipkit/messages/messages.md.</p>
|
|
154
|
+
<button type="submit" disabled={ms.sending || !d.title.trim()}>
|
|
155
|
+
{ms.sending ? 'Adding…' : 'Add the message'}
|
|
156
|
+
</button>
|
|
157
|
+
</form>
|
|
158
|
+
</details>
|
|
159
|
+
)
|
|
160
|
+
})
|
|
161
|
+
|
|
102
162
|
const Messages = observer(({ ms }: { ms: MessagesSt }) => {
|
|
103
163
|
const families = new Map<string, Msg[]>()
|
|
104
164
|
for (const m of ms.view?.messages ?? []) families.set(m.fields.family ?? 'other', [...(families.get(m.fields.family ?? 'other') ?? []), m])
|
|
105
165
|
return (
|
|
106
166
|
<>
|
|
107
|
-
<p className="msg-hint">Each cell is one reader, 0 to 100: understood 40 %, the value landed 30 %, appeal 20 %, belief 10 %. Rest on a cell for what that reader said.
|
|
167
|
+
<p className="msg-hint">Each cell is one reader, 0 to 100: understood 40 %, the value landed 30 %, appeal 20 %, belief 10 %. Rest on a cell for what that reader said. Suggest a message or a phrasing in your words: an agent fills each field marked « to fill » (the truth from what is built).</p>
|
|
168
|
+
<Suggest ms={ms} />
|
|
169
|
+
<Note ms={ms} at="" />
|
|
108
170
|
{[...families].map(([f, list]) => (
|
|
109
171
|
<div key={f} className="msg-family">
|
|
110
172
|
<h2>{f}</h2>
|
|
@@ -126,6 +188,16 @@ const Value = observer(({ ms }: { ms: MessagesSt }) => {
|
|
|
126
188
|
})
|
|
127
189
|
.filter((x) => x !== null)
|
|
128
190
|
.sort((a, b) => b.rate - a.rate)
|
|
191
|
+
if (rows.length === 0)
|
|
192
|
+
return (
|
|
193
|
+
<section className="msg-card">
|
|
194
|
+
<p className="msg-hint">
|
|
195
|
+
{ms.current
|
|
196
|
+
? 'This run scored none of the phrasings in the store, so no message has a best one yet.'
|
|
197
|
+
: "No run has scored the messages yet, so no phrasing has a score to rank. A run gives each phrasing to the readers and scores what they understood: `sk messages packets <run>`, then `sk messages matrix <run>` (the page « messages », The loop). A surface run tests a page's top, never these phrasings."}
|
|
198
|
+
</p>
|
|
199
|
+
</section>
|
|
200
|
+
)
|
|
129
201
|
return (
|
|
130
202
|
<section className="msg-card">
|
|
131
203
|
<p className="msg-hint">Each message's best phrasing, ranked by its score for each second spoken: a small gain said in a second can beat a big one that needs a sentence.</p>
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
// a repo's messages page as state (wiki tools/shipkit/messages.md, The page): the store read whole from the hub, the
|
|
2
|
-
// tab shown and the run it scores by, both in the address. Read when the page opens and when the window comes back
|
|
3
|
-
//
|
|
2
|
+
// tab shown and the run it scores by, both in the address. Read when the page opens and when the window comes back.
|
|
3
|
+
// Its one write is the owner's suggestion (a message, a phrasing), sent with the hash of the file it read
|
|
4
4
|
import { makeAutoObservable, runInAction } from 'mobx'
|
|
5
5
|
import type { RunView, StoreView } from '../../../messages/score.ts'
|
|
6
|
+
import type { MessageSuggestion, Suggestion } from '../../../messages/suggest.ts'
|
|
6
7
|
import type { MessagesTab } from '../../../messages/tabs.ts'
|
|
7
8
|
import { reach } from '../reach.ts'
|
|
8
9
|
import type { RepoSt } from '../repo-st.ts'
|
|
9
10
|
|
|
10
11
|
export type { RunView, StoreView }
|
|
11
12
|
|
|
13
|
+
/** the drafts outlive a reload: the words typed are never lost to a refused write or a closed tab */
|
|
14
|
+
function kept(key: string): string | null {
|
|
15
|
+
try {
|
|
16
|
+
return globalThis.localStorage?.getItem(key) ?? null
|
|
17
|
+
} catch {
|
|
18
|
+
return null
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function keep(key: string, v: string): void {
|
|
22
|
+
try { globalThis.localStorage?.setItem(key, v) } catch { /* private window: the draft lasts the tab */ }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const EMPTY: Required<MessageSuggestion> = { title: '', family: '', meaning: '', value: '', phrasing: '' }
|
|
26
|
+
export const NEW_FAMILY = '+new'
|
|
27
|
+
|
|
12
28
|
export class MessagesSt {
|
|
13
29
|
view: StoreView | null = null
|
|
14
30
|
error: string | null = null
|
|
@@ -16,9 +32,89 @@ export class MessagesSt {
|
|
|
16
32
|
/** the run picked, '' for the newest messages run */
|
|
17
33
|
picked = ''
|
|
18
34
|
private started = 0
|
|
35
|
+
/** the new message being written; `family` '' until one is picked (the first family), NEW_FAMILY for one typed in `newFamily` */
|
|
36
|
+
draft: Required<MessageSuggestion> & { newFamily: string } = { ...EMPTY, newFamily: '' }
|
|
37
|
+
/** a phrasing being written, by message id */
|
|
38
|
+
phrasings: Record<string, string> = {}
|
|
39
|
+
sending = false
|
|
40
|
+
/** what the last suggestion did, or why it was refused, shown where it was sent: a message id, or '' for the form */
|
|
41
|
+
note: { at: string; ok: boolean; text: string } | null = null
|
|
19
42
|
|
|
20
|
-
constructor(
|
|
43
|
+
constructor(readonly st: RepoSt) {
|
|
21
44
|
makeAutoObservable<this, 'st' | 'started' | 'onBack'>(this, { st: false, started: false, onBack: false })
|
|
45
|
+
try {
|
|
46
|
+
const { phrasings, ...d } = JSON.parse(kept(this.draftKey) ?? '{}') as Partial<MessagesSt['draft']> & { phrasings?: Record<string, string> }
|
|
47
|
+
this.draft = { ...this.draft, ...d }
|
|
48
|
+
this.phrasings = phrasings ?? {}
|
|
49
|
+
} catch { /* a draft from an older page: start empty */ }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private get draftKey(): string {
|
|
53
|
+
return `messages-draft:${this.st.key}`
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** the families the store already groups by, in the page's order */
|
|
57
|
+
get families(): string[] {
|
|
58
|
+
return [...new Set((this.view?.messages ?? []).map((m) => m.fields.family).filter((f): f is string => !!f))]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** the family the form shows picked */
|
|
62
|
+
get family(): string {
|
|
63
|
+
return this.draft.family || this.families[0] || NEW_FAMILY
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
setDraft(k: keyof MessagesSt['draft'], v: string): void {
|
|
67
|
+
this.draft[k] = v
|
|
68
|
+
this.saveDrafts()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
setPhrasing(id: string, v: string): void {
|
|
72
|
+
this.phrasings[id] = v
|
|
73
|
+
this.saveDrafts()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private saveDrafts(): void {
|
|
77
|
+
keep(this.draftKey, JSON.stringify({ ...this.draft, phrasings: this.phrasings }))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** a new message in the owner's words, appended to messages.md */
|
|
81
|
+
async suggestMessage(): Promise<void> {
|
|
82
|
+
const d = this.draft
|
|
83
|
+
const family = this.family === NEW_FAMILY ? d.newFamily : this.family
|
|
84
|
+
if (await this.send('', { kind: 'message', title: d.title, family, meaning: d.meaning, value: d.value, phrasing: d.phrasing }, (r) => `${r.id} added${r.phrasing ? ` with ${r.phrasing}` : ''}: an agent fills what is « to fill »`)) {
|
|
85
|
+
runInAction(() => (this.draft = { ...EMPTY, family: d.family, newFamily: '' }))
|
|
86
|
+
this.saveDrafts()
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** one more phrasing of a message, appended under it */
|
|
91
|
+
async suggestPhrasing(message: string): Promise<void> {
|
|
92
|
+
if (await this.send(message, { kind: 'phrasing', message, text: this.phrasings[message] ?? '' }, (r) => `${r.id} added to ${message}`)) {
|
|
93
|
+
runInAction(() => delete this.phrasings[message])
|
|
94
|
+
this.saveDrafts()
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private async send(at: string, s: Suggestion, said: (r: { id: string; phrasing?: string }) => string): Promise<boolean> {
|
|
99
|
+
if (this.sending) return false
|
|
100
|
+
runInAction(() => (this.sending = true))
|
|
101
|
+
try {
|
|
102
|
+
const r = await reach(this.st.url('/api/messages/suggest'), { method: 'POST', body: JSON.stringify({ ...s, expect: this.view?.hash }) })
|
|
103
|
+
const body = (await r.json()) as { id: string; phrasing?: string; view: StoreView; error?: string }
|
|
104
|
+
if (!r.ok) throw new Error(body.error ?? `HTTP ${r.status}`)
|
|
105
|
+
runInAction(() => {
|
|
106
|
+
this.view = body.view
|
|
107
|
+
this.note = { at, ok: true, text: said(body) }
|
|
108
|
+
})
|
|
109
|
+
return true
|
|
110
|
+
} catch (e) {
|
|
111
|
+
runInAction(() => (this.note = { at, ok: false, text: `refused: ${(e as Error).message}` }))
|
|
112
|
+
// the file as it reads now, so the next try is not refused for a hash the page outgrew
|
|
113
|
+
await this.load()
|
|
114
|
+
return false
|
|
115
|
+
} finally {
|
|
116
|
+
runInAction(() => (this.sending = false))
|
|
117
|
+
}
|
|
22
118
|
}
|
|
23
119
|
|
|
24
120
|
/** the messages runs, newest first: the run picker lists them */
|
|
@@ -33,3 +33,17 @@
|
|
|
33
33
|
.msg-page pre{margin:0;white-space:pre-wrap;font:12.5px/1.5 ui-monospace,Menlo,monospace}
|
|
34
34
|
.msg-error{color:var(--errink);background:var(--errbg);border:1px solid var(--errline);border-radius:7px;padding:var(--s2) var(--s3);margin:0}
|
|
35
35
|
.msg-hint{color:var(--dim);margin:0;font-size:13px}
|
|
36
|
+
.msg-fill{color:var(--warn);font-style:italic}
|
|
37
|
+
.msg-note{color:var(--ok);margin:0;font-size:13px}
|
|
38
|
+
.msg-suggest summary{cursor:pointer;font-weight:600}
|
|
39
|
+
.msg-suggest form{display:grid;gap:var(--s2);margin-top:var(--s2)}
|
|
40
|
+
.msg-suggest label{display:grid;grid-template-columns:90px 1fr;gap:var(--s3);align-items:center;font-size:13px}
|
|
41
|
+
.msg-suggest label>span:first-child{color:var(--dim)}
|
|
42
|
+
.msg-row{display:flex;gap:var(--s2);flex-wrap:wrap}
|
|
43
|
+
.msg-suggest input,.msg-suggest-line input{font:inherit;padding:var(--s1) var(--s2);border-radius:7px;border:1px solid var(--line);background:var(--bg);color:var(--ink);min-width:0;flex:1}
|
|
44
|
+
.msg-suggest button,.msg-suggest-line button{font:inherit;justify-self:start;padding:var(--s1) var(--s3);border-radius:7px;border:1px solid var(--accent);background:var(--accent);color:var(--panel);cursor:pointer}
|
|
45
|
+
.msg-suggest button:disabled,.msg-suggest-line button:disabled{background:transparent;border-color:var(--line);color:var(--dim);cursor:default}
|
|
46
|
+
.msg-suggest select{line-height:1.4;height:auto;min-height:30px}
|
|
47
|
+
.msg-card h3 .msg-tag{margin-left:var(--s2);font-weight:500;vertical-align:middle}
|
|
48
|
+
.msg-suggest-line{display:flex;gap:var(--s2)}
|
|
49
|
+
@media (max-width:600px){.msg-suggest label{grid-template-columns:1fr;gap:var(--s0)}}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// the page's keys, read on the document (hub-app.tsx listens): the command keys first (keys.ts pageKey, from
|
|
2
|
+
// anywhere, a text field included), then what the page shown claims (the atelier, the review and trailer pages), then
|
|
3
|
+
// its folds, its sections, and the side lists (side-lists.ts) with the walk's other keys
|
|
4
|
+
import { isReviewId } from '../../home/inbox-shape.ts'
|
|
5
|
+
import { PLACE_PATH, type HomeSt } from './home-st.ts'
|
|
6
|
+
import { listKey, pageKey, pageLetterKey, sectionKey } from './keys.ts'
|
|
7
|
+
import { FOLD_PAGES, type LayoutSt } from './layout-st.ts'
|
|
8
|
+
import type { Filter } from './repo-st.ts'
|
|
9
|
+
import { foldsOn } from './list-walk.ts'
|
|
10
|
+
import { repoSections } from './repo-sections.ts'
|
|
11
|
+
import type { ReviewSt } from './review/review-st.ts'
|
|
12
|
+
import { repoSides, sideKey, sidesOf, type Sides } from './side-lists.ts'
|
|
13
|
+
import { FOLLOW_KEY } from './timeline-chart.tsx'
|
|
14
|
+
|
|
15
|
+
const FILTER_BY_KEY: Record<string, Filter | undefined> = { a: 'all', n: 'needs', r: 'red' }
|
|
16
|
+
/** a text field keeps its plain keys: `/`, the arrows, the letters */
|
|
17
|
+
const typing = (t: HTMLElement): boolean => t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.tagName === 'SELECT' || t.isContentEditable
|
|
18
|
+
|
|
19
|
+
/** a text field that holds more than one line */
|
|
20
|
+
const ownsLines = (t: HTMLElement): boolean => t.tagName === 'TEXTAREA' && (t as HTMLTextAreaElement).value.includes('\n')
|
|
21
|
+
|
|
22
|
+
/** `/` `⇧/` and the arrows over the side lists (side-lists.ts), outside a text field; true when a list took the key */
|
|
23
|
+
function listKeys(e: KeyboardEvent, sides: Sides): boolean {
|
|
24
|
+
const lk = listKey(e)
|
|
25
|
+
if (lk == null || !sideKey(sides, lk)) return false
|
|
26
|
+
e.preventDefault()
|
|
27
|
+
return true
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** the walk's other keys (← → fold, Enter and space open) stay B's where the arrows are, so on a page with a C list only
|
|
31
|
+
* once ⇧↑ ⇧↓ put its cursor in B; Enter and space only where no button or link claims them */
|
|
32
|
+
const walkOwns = (e: KeyboardEvent, sides: Sides, cursor: string | null): boolean =>
|
|
33
|
+
(sides.c == null || cursor != null) && (e.key.startsWith('Arrow') || (e.target as HTMLElement).closest('button, a, select, [role="button"]') == null)
|
|
34
|
+
|
|
35
|
+
/** the identity view's keys: its lightbox first, then the side lists (its rows, the site's pages), then the walk's */
|
|
36
|
+
function identityKey(home: HomeSt, e: KeyboardEvent): void {
|
|
37
|
+
const st = home.identities
|
|
38
|
+
if (typing(e.target as HTMLElement) || e.metaKey || e.ctrlKey || e.altKey) return
|
|
39
|
+
if (st.desk?.lightbox != null && st.desk.key(e, 'social')) return e.preventDefault()
|
|
40
|
+
const sides = sidesOf(home)
|
|
41
|
+
if (listKeys(e, sides)) return
|
|
42
|
+
if (walkOwns(e, sides, st.cursor) && st.key(e.key)) e.preventDefault()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** the review of the card open on the inbox: V F R A and the card's other keys act on it there as on its repo's page */
|
|
46
|
+
const inboxReview = (home: HomeSt): ReviewSt | null => {
|
|
47
|
+
const o = home.page === 'inbox' ? home.inbox.open : null
|
|
48
|
+
return o != null && isReviewId(o.id) ? (home.repos.get(o.repo)?.review ?? null) : null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** W or T, plain and outside a text field: that side of the page folds, or unfolds */
|
|
52
|
+
function foldKey(e: KeyboardEvent, page: string, layout: LayoutSt): boolean {
|
|
53
|
+
const t = e.target as HTMLElement
|
|
54
|
+
if (e.metaKey || e.ctrlKey || e.altKey || t.tagName === 'TEXTAREA' || t.tagName === 'INPUT' || t.isContentEditable) return false
|
|
55
|
+
const k = e.key.toLowerCase()
|
|
56
|
+
if (k !== 'w' && k !== 't') return false
|
|
57
|
+
e.preventDefault()
|
|
58
|
+
layout.toggleFold(page, k === 'w' ? 'left' : 'right')
|
|
59
|
+
return true
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** the keys of the page, one listener on the document: they act on the page shown, and on nothing else. `embed`: the
|
|
63
|
+
* embed page, its page's own keys and its list alone */
|
|
64
|
+
export const pageKeys = (home: HomeSt, embed: string | null) => (e: KeyboardEvent): void => {
|
|
65
|
+
// the embed page has its page's own keys and nothing else
|
|
66
|
+
if (embed != null) {
|
|
67
|
+
const app = home.shown
|
|
68
|
+
if (app == null || typing(e.target as HTMLElement) || e.metaKey || e.ctrlKey) return
|
|
69
|
+
if ((!e.altKey || e.key.startsWith('Arrow')) && app.pageKey(e)) e.preventDefault()
|
|
70
|
+
// its own list, and no tree: the page alone
|
|
71
|
+
else if (!e.altKey) listKeys(e, { b: null, c: repoSides(app).c })
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
// the command keys beat the focus check: they work from anywhere, any page, a text field included
|
|
75
|
+
const pk = pageKey(e)
|
|
76
|
+
// ⌘↑ ⌘↓ in a text of several lines go to its start and its end
|
|
77
|
+
if (pk?.t === 'step' && ownsLines(e.target as HTMLElement)) return
|
|
78
|
+
if (pk != null) {
|
|
79
|
+
e.preventDefault()
|
|
80
|
+
if (pk.t === 'picker' || pk.t === 'search') home.palette.toggle()
|
|
81
|
+
else if (pk.t === 'dock') home.dock.cycle()
|
|
82
|
+
else if (pk.t === 'rail') home.layout.toggleRail()
|
|
83
|
+
else if (pk.t === 'home' || pk.t === 'inbox' || pk.t === 'planned' || pk.t === 'activity' || pk.t === 'insights') {
|
|
84
|
+
home.palette.close()
|
|
85
|
+
if (home.machine != null) home.navigate(PLACE_PATH[pk.t === 'home' ? 'overview' : pk.t])
|
|
86
|
+
} else if (pk.t === 'step') {
|
|
87
|
+
home.palette.close()
|
|
88
|
+
home.projects.step(pk.by)
|
|
89
|
+
} else {
|
|
90
|
+
const p = home.projects.list[pk.n - 1]
|
|
91
|
+
home.palette.close()
|
|
92
|
+
if (p != null) home.projects.click(p.name)
|
|
93
|
+
}
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
if (home.palette.open) return // the picker's input owns its keys
|
|
97
|
+
if (home.page === 'identities') {
|
|
98
|
+
if (foldKey(e, 'identities', home.layout)) return
|
|
99
|
+
return identityKey(home, e)
|
|
100
|
+
}
|
|
101
|
+
const app = home.shown
|
|
102
|
+
const t = e.target as HTMLElement
|
|
103
|
+
if (typing(t)) return
|
|
104
|
+
// a home page of its own: its lists, then the card open on the inbox, whose keys are its repo page's
|
|
105
|
+
if (app == null) {
|
|
106
|
+
if (e.metaKey || e.ctrlKey || e.altKey || listKeys(e, sidesOf(home))) return
|
|
107
|
+
const rv = e.key === 'ArrowUp' || e.key === 'ArrowDown' ? null : inboxReview(home) // ↑ ↓ are never a page's: they step a list
|
|
108
|
+
if (rv == null) return
|
|
109
|
+
// N is this list's next card, where the card's own would be the next of its repo
|
|
110
|
+
if (e.key.toLowerCase() === 'n' && !e.shiftKey && rv.stage === null) home.inbox.nextCard()
|
|
111
|
+
else if (!rv.key(e)) return
|
|
112
|
+
e.preventDefault()
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
// the tree's fold comes before a page's own ← →: with ⇧ always, as ⇧↑ ⇧↓ are its steps; plain, only while the
|
|
116
|
+
// tree holds the cursor and the key folds or unfolds that row
|
|
117
|
+
if (!e.metaKey && !e.ctrlKey && !e.altKey && (e.key === 'ArrowLeft' || e.key === 'ArrowRight') && (e.shiftKey || (app.tree.cursor != null && foldsOn(app.tree, e.key)))) {
|
|
118
|
+
if (app.tree.key(e.key)) e.preventDefault()
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
// the atelier owns its roll keys while an asset is open, and
|
|
122
|
+
// says so by consuming them
|
|
123
|
+
if (app.sel?.t === 'asset' && app.media.key(e.key)) {
|
|
124
|
+
e.preventDefault()
|
|
125
|
+
return
|
|
126
|
+
}
|
|
127
|
+
// so do the review and trailer pages (RepoSt.pageKey), ⌥ and an arrow included (a trailer's shots)
|
|
128
|
+
const plain = !e.metaKey && !e.ctrlKey && (!e.altKey || e.key.startsWith('Arrow'))
|
|
129
|
+
if (plain && app.pageKey(e)) {
|
|
130
|
+
e.preventDefault()
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
// W folds the left of a page with columns, T its right; what a page took above stays its own (T on Veille)
|
|
134
|
+
if (FOLD_PAGES.has(app.sel?.t ?? '') && foldKey(e, app.sel!.t, home.layout)) return
|
|
135
|
+
// a repo's own page, ⌥⇧ and its letter
|
|
136
|
+
const letter = pageLetterKey(e)
|
|
137
|
+
if (letter != null) {
|
|
138
|
+
const p = app.pages.byKey(letter)
|
|
139
|
+
if (p != null) {
|
|
140
|
+
e.preventDefault()
|
|
141
|
+
app.showPage(p.id)
|
|
142
|
+
}
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
const sk = sectionKey(e)
|
|
146
|
+
if (sk != null) {
|
|
147
|
+
const s = repoSections(app).find((x) => x.id === sk)
|
|
148
|
+
if (s != null) {
|
|
149
|
+
e.preventDefault()
|
|
150
|
+
s.go()
|
|
151
|
+
}
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return
|
|
155
|
+
// the lists' keys need no focus: `/` `⇧/` and the arrows from anywhere on the page (side-lists.ts)
|
|
156
|
+
const sides = repoSides(app)
|
|
157
|
+
if (listKeys(e, sides)) return
|
|
158
|
+
// the atelier's ←/→ roll, so at its first or last roll they stop there
|
|
159
|
+
const rolls = app.sel?.t === 'asset' && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')
|
|
160
|
+
if (!rolls && walkOwns(e, sides, app.tree.cursor) && app.tree.key(e.key)) {
|
|
161
|
+
e.preventDefault()
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
if (e.key === FOLLOW_KEY && (!app.live.chart.follow || !home.dock.chart.follow)) {
|
|
165
|
+
e.preventDefault()
|
|
166
|
+
app.live.chart.attach()
|
|
167
|
+
home.dock.chart.attach()
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
const f = FILTER_BY_KEY[e.key.toLowerCase()]
|
|
171
|
+
if (f != null) {
|
|
172
|
+
e.preventDefault()
|
|
173
|
+
app.setFilter(f)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -6,8 +6,9 @@ import { reaction } from 'mobx'
|
|
|
6
6
|
import { observer } from 'mobx-react-lite'
|
|
7
7
|
import { useEffect, useRef, useState } from 'react'
|
|
8
8
|
import type { RepoSt } from './repo-st.ts'
|
|
9
|
+
import { postJson } from './review/review-kit.ts'
|
|
9
10
|
|
|
10
|
-
type Msg = { shipkit?: unknown; keys?: unknown; title?: unknown; badge?: unknown; hash?: unknown; key?: unknown; code?: unknown; altKey?: unknown; shiftKey?: unknown; metaKey?: unknown; ctrlKey?: unknown }
|
|
11
|
+
type Msg = { shipkit?: unknown; keys?: unknown; title?: unknown; badge?: unknown; hash?: unknown; key?: unknown; code?: unknown; altKey?: unknown; shiftKey?: unknown; metaKey?: unknown; ctrlKey?: unknown; address?: unknown; name?: unknown; text?: unknown }
|
|
11
12
|
|
|
12
13
|
/** the keys a frame passes up as typed on the hub: ⌥ letters, ⌥⇧ letters, the home's ⌘ keys */
|
|
13
14
|
function replayKey(m: Msg): void {
|
|
@@ -63,7 +64,7 @@ const PageFrame = observer(({ app, id, on }: { app: RepoSt; id: string; on: bool
|
|
|
63
64
|
const post = (m: Record<string, unknown>): void => ref.current?.contentWindow?.postMessage({ ...m }, location.origin)
|
|
64
65
|
/** the identity the repo speaks as (its row's `speaksAs`, the default already folded in), null with none */
|
|
65
66
|
const identity = (): string | null => app.home.projects.list.find((p) => p.name === app.key)?.speaksAs ?? null
|
|
66
|
-
const hello = (): void => post({ shipkit: 'hello', keys: held.current, theme: app.home.theme.
|
|
67
|
+
const hello = (): void => post({ shipkit: 'hello', keys: held.current, theme: app.home.theme.scheme, identity: identity(), on: onNow.current })
|
|
67
68
|
const onMessage = (e: MessageEvent): void => {
|
|
68
69
|
if (e.source !== ref.current?.contentWindow || e.origin !== location.origin) return
|
|
69
70
|
const m = (e.data ?? {}) as Msg
|
|
@@ -77,11 +78,18 @@ const PageFrame = observer(({ app, id, on }: { app: RepoSt; id: string; on: bool
|
|
|
77
78
|
case 'open':
|
|
78
79
|
if (typeof m.hash === 'string' && m.hash.startsWith('#')) location.hash = m.hash
|
|
79
80
|
return
|
|
81
|
+
case 'threads':
|
|
82
|
+
if (typeof m.address === 'string') app.showReview(null, `handled=1&q=${encodeURIComponent(m.address)}`)
|
|
83
|
+
return
|
|
84
|
+
case 'note':
|
|
85
|
+
if (typeof m.address === 'string' && typeof m.text === 'string')
|
|
86
|
+
void postJson<{ id: string }>(app.url('/api/review/note'), { address: m.address, name: typeof m.name === 'string' ? m.name : m.address, text: m.text, from: id }).then((r) => app.showReview(r.id))
|
|
87
|
+
return
|
|
80
88
|
case 'key': return replayKey(m)
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
window.addEventListener('message', onMessage)
|
|
84
|
-
const theme = reaction(() => app.home.theme.
|
|
92
|
+
const theme = reaction(() => app.home.theme.scheme, (t) => post({ shipkit: 'theme', theme: t }))
|
|
85
93
|
const speaker = reaction(identity, (i) => post({ shipkit: 'identity', identity: i }))
|
|
86
94
|
// the address moved from outside (back, a pasted link): the frame takes it
|
|
87
95
|
const keys = reaction(
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
// the one picker of the page (cmd+j, keys.ts), a node of the root: the
|
|
2
2
|
// home's places (inbox, home, activity, planned, insights, archived) first, the identities and each of their
|
|
3
3
|
// accounts (their view on the home), then the shown repo's own jump
|
|
4
|
-
// targets, then every other house repo as a place to go.
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// targets, then every other house repo as a place to go. A query also
|
|
5
|
+
// reaches every url of every repo, the pages any repo opens and what waits
|
|
6
|
+
// for the owner in any repo (an ask by its number too), each with
|
|
7
|
+
// its repo's name: its words are matched one by one over the label, the
|
|
8
|
+
// kind and the repo (« ver url »). Another repo's content (its assets,
|
|
9
|
+
// its cards) is one more cmd+j away, in that repo.
|
|
7
10
|
import { makeAutoObservable } from 'mobx'
|
|
8
11
|
import type { HomeSt } from './home-st.ts'
|
|
12
|
+
import { sectionLabel, type SectionId } from './keys.ts'
|
|
9
13
|
import type { Jump } from './repo-st.ts'
|
|
10
14
|
|
|
15
|
+
/** the pages every repo opens, whatever it holds */
|
|
16
|
+
const ANY_REPO_PAGES: SectionId[] = ['readme', 'review', 'trailer', 'comms', 'shipkit', 'when', 'runs', 'plan', 'processes', 'urls', 'git']
|
|
17
|
+
|
|
18
|
+
const words = (s: string): string[] => s.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)
|
|
19
|
+
|
|
11
20
|
/** how many rows the picker shows */
|
|
12
21
|
export const PAL_ROWS = 12
|
|
13
22
|
|
|
@@ -27,9 +36,14 @@ export class PaletteSt {
|
|
|
27
36
|
return [
|
|
28
37
|
{ id: 'place:inbox', label: 'inbox', section: 'place', face: { place: 'inbox' }, run: () => st.navigate('/inbox') },
|
|
29
38
|
{ id: 'place:home', label: 'home', section: 'place', face: { place: 'home' }, run: () => st.navigate('/') },
|
|
39
|
+
{ id: 'place:machines', label: 'machines', section: 'place', face: { place: 'machines' }, run: () => st.navigate('/machines') },
|
|
40
|
+
{ id: 'place:database', label: 'database', section: 'place', face: { place: 'database' }, run: () => st.navigate('/database') },
|
|
41
|
+
{ id: 'place:vault', label: 'vault', section: 'place', face: { place: 'vault' }, run: () => st.navigate('/vault') },
|
|
42
|
+
{ id: 'place:space', label: 'space', section: 'place', face: { place: 'space' }, run: () => st.navigate('/space') },
|
|
30
43
|
{ id: 'place:activity', label: 'activity', section: 'place', face: { place: 'activity' }, run: () => st.navigate('/activity') },
|
|
31
44
|
{ id: 'place:planned', label: 'planned', section: 'place', face: { place: 'planned' }, run: () => st.navigate('/planned') },
|
|
32
45
|
{ id: 'place:insights', label: 'insights', section: 'place', face: { place: 'insights' }, run: () => st.navigate('/insights') },
|
|
46
|
+
{ id: 'place:time', label: 'time', section: 'place', face: { place: 'time' }, run: () => st.navigate('/time') },
|
|
33
47
|
{ id: 'place:recordings', label: 'recordings', section: 'place', face: { place: 'recordings' }, run: () => st.navigate('/recordings') },
|
|
34
48
|
{ id: 'place:archived', label: 'archived', section: 'place', face: { place: 'archived' }, run: () => st.navigate('/archived') },
|
|
35
49
|
]
|
|
@@ -56,11 +70,38 @@ export class PaletteSt {
|
|
|
56
70
|
return st.projects.list.filter((p) => p.name !== on).map((p) => ({ id: `repo:${p.name}`, label: p.name, section: 'repo', face: { repo: p.name }, run: () => st.select(p.name) }))
|
|
57
71
|
}
|
|
58
72
|
|
|
73
|
+
/** every url of every house repo, the shown one too: framed on its repo's urls page. They come once the home answers */
|
|
74
|
+
get urls(): Jump[] {
|
|
75
|
+
const st = this.st
|
|
76
|
+
if (st.machine == null) return []
|
|
77
|
+
return st.urls.repos.flatMap((r) => r.urls.map((u) => ({ id: `url:${r.repo}/${u.id}`, label: u.label, section: `url ${u.env}`, repo: r.repo, face: { repo: r.repo }, run: () => st.openUrl(r.repo, u.id) })))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** the pages of every repo but the one on screen, whose own are its targets */
|
|
81
|
+
get pages(): Jump[] {
|
|
82
|
+
const st = this.st
|
|
83
|
+
if (st.machine == null) return []
|
|
84
|
+
const on = st.shown?.key
|
|
85
|
+
return st.projects.list.filter((p) => p.name !== on).flatMap((p) => ANY_REPO_PAGES.map((id) => ({ id: `page:${p.name}/${id}`, label: sectionLabel(id), section: 'page', repo: p.name, face: { repo: p.name }, run: () => st.openPage(p.name, id) })))
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** what waits for the owner in every repo, the shown one too: an ask under its number, a card under its title,
|
|
89
|
+
* opened on the inbox. They come once the inbox answers */
|
|
90
|
+
get waiting(): Jump[] {
|
|
91
|
+
const st = this.st
|
|
92
|
+
if (st.machine == null) return []
|
|
93
|
+
return st.waiting.rows.map((r) => {
|
|
94
|
+
const n = r.kind === 'ask' ? /^ask:(\d+)-/.exec(r.id)?.[1] : null
|
|
95
|
+
return { id: `waiting:${r.repo}/${r.id}`, label: n != null ? `${n} · ${r.title}` : r.title, section: r.kind, repo: r.repo, face: { repo: r.repo }, run: () => st.navigate(r.open) }
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
59
99
|
get jumps(): Jump[] {
|
|
60
|
-
return [...this.places, ...this.identities, ...(this.st.shown?.jumps ?? []), ...this.others]
|
|
100
|
+
return [...this.places, ...this.identities, ...(this.st.shown?.jumps ?? []), ...this.others, ...this.urls, ...this.waiting, ...this.pages]
|
|
61
101
|
}
|
|
62
102
|
|
|
63
|
-
/**
|
|
103
|
+
/** every word of the query is in the label, the kind or the repo. Ranked on the first word: the label starts
|
|
104
|
+
* with it, a word of the label does, the label holds it, then the rest. With no query, home,
|
|
64
105
|
* activity and planned, then the shown repo's first targets, then every other repo,
|
|
65
106
|
* so a jump elsewhere is always in reach */
|
|
66
107
|
get results(): Jump[] {
|
|
@@ -72,19 +113,25 @@ export class PaletteSt {
|
|
|
72
113
|
const others = this.others
|
|
73
114
|
return [...places, ...ids, ...own.slice(0, Math.max(4, PAL_ROWS - places.length - ids.length - others.length)), ...others]
|
|
74
115
|
}
|
|
75
|
-
const
|
|
76
|
-
const
|
|
116
|
+
const asked = q.split(/\s+/)
|
|
117
|
+
const first = asked[0]!
|
|
118
|
+
const ranks: Jump[][] = [[], [], [], []]
|
|
77
119
|
for (const j of this.jumps) {
|
|
78
120
|
const l = j.label.toLowerCase()
|
|
79
|
-
|
|
80
|
-
|
|
121
|
+
const hay = `${l} ${j.section} ${j.repo ?? ''}`.toLowerCase()
|
|
122
|
+
if (!asked.every((w) => hay.includes(w))) continue
|
|
123
|
+
ranks[l.startsWith(first) ? 0 : words(l).some((w) => w.startsWith(first)) ? 1 : l.includes(first) ? 2 : 3]!.push(j)
|
|
81
124
|
}
|
|
82
|
-
return
|
|
125
|
+
return ranks.flat().slice(0, PAL_ROWS * 2)
|
|
83
126
|
}
|
|
84
127
|
|
|
85
128
|
toggle(): void {
|
|
86
129
|
this.open = !this.open
|
|
87
|
-
if (this.open)
|
|
130
|
+
if (this.open) {
|
|
131
|
+
this.st.identities.ensure()
|
|
132
|
+
void this.st.urls.load()
|
|
133
|
+
void this.st.waiting.load()
|
|
134
|
+
}
|
|
88
135
|
this.query = ''
|
|
89
136
|
this.idx = 0
|
|
90
137
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// the one picker, cmd+j (palette-st.ts): home, activity, planned and
|
|
2
|
-
// archived, the identities and their accounts, the shown repo's targets, then every other repo
|
|
2
|
+
// archived, the identities and their accounts, the shown repo's targets, then every other repo; under a query,
|
|
3
|
+
// every repo's urls and pages too, each with its repo's name. A place wears
|
|
3
4
|
// its button's icon, a repo its own icon, as the project list shows them, an identity its avatar, an account its
|
|
4
5
|
// platform's logo.
|
|
5
6
|
import { observer } from 'mobx-react-lite'
|
|
@@ -42,6 +43,7 @@ export const Palette = observer(({ app }: { app: HomeSt }) => {
|
|
|
42
43
|
onClick={() => p.run(jp)}>
|
|
43
44
|
<PalFace app={app} face={jp.face} />
|
|
44
45
|
<span className="plabel">{jp.label}</span>
|
|
46
|
+
{jp.repo == null ? null : <span className="prepo">{jp.repo}</span>}
|
|
45
47
|
<span className="pchip">{jp.section}</span>
|
|
46
48
|
{jp.key == null ? null : <kbd className="pjkey">{jp.key}</kbd>}
|
|
47
49
|
</div>
|