rvlib-shipkit 2.26.0 → 2.28.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 +36 -0
- package/package.json +1 -1
- package/src/agent-time/diet.ts +77 -0
- package/src/agent-time/family.ts +72 -0
- package/src/agent-time/hooks.ts +16 -7
- package/src/agent-time/limits.ts +44 -0
- package/src/agent-time/live.ts +12 -8
- package/src/agent-time/mask.ts +96 -18
- package/src/agent-time/refused.ts +45 -0
- package/src/agent-time/registry.ts +289 -0
- package/src/agent-time/render.ts +122 -21
- package/src/agent-time/report-cache.ts +57 -0
- package/src/agent-time/report.ts +314 -40
- package/src/agent-time/shape.ts +50 -3
- package/src/agent-time/store.ts +322 -101
- package/src/agent-time/timeline.ts +140 -21
- package/src/agent-time/turns.ts +18 -8
- package/src/annex/born.ts +2 -2
- package/src/annex/offload.ts +29 -17
- package/src/annex/tidy.ts +70 -10
- package/src/asks/ask-after.ts +44 -0
- package/src/asks/ask-bar-fold.ts +57 -0
- package/src/asks/ask-migrate.ts +280 -0
- package/src/asks/ask-steps-fold.ts +166 -0
- package/src/asks/ask-store.ts +586 -0
- package/src/assets/kit-config.ts +7 -3
- package/src/assets/kits/identity-kit.ts +361 -14
- package/src/assets/kits/poster-thumbnail.ts +282 -0
- package/src/check.ts +3 -1
- package/src/checks/SK003-claude-md-shape.check.ts +92 -25
- package/src/checks/SK004-gitignore-policy.check.ts +20 -9
- package/src/checks/SK013-one-way-in-policy.check.ts +18 -3
- package/src/checks/SK026-asks-autoclose.check.ts +9 -23
- 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/SK038-speaks-as.check.ts +3 -3
- package/src/checks/SK042-post-kinds.check.ts +26 -24
- package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
- package/src/checks/SK047-login-in-description.check.ts +36 -0
- package/src/checks/SK048-one-local-file.check.ts +36 -0
- package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
- package/src/checks/SK050-retired-commands.check.ts +127 -0
- package/src/cli/cmd_Asks.ts +244 -27
- package/src/cli/cmd_Backup.ts +153 -10
- package/src/cli/cmd_Calls.ts +1 -0
- package/src/cli/cmd_Capacity.ts +2 -2
- package/src/cli/cmd_Commands.ts +140 -34
- package/src/cli/cmd_Contracts.ts +1 -0
- 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_Keys.ts +1 -0
- package/src/cli/cmd_Lanes.ts +15 -4
- package/src/cli/cmd_Machines.ts +36 -0
- package/src/cli/cmd_Media.ts +38 -6
- package/src/cli/cmd_Messages.ts +152 -1
- package/src/cli/cmd_Needs.ts +1 -0
- package/src/cli/cmd_Reflect.ts +23 -2
- package/src/cli/cmd_Review.ts +1357 -223
- package/src/cli/cmd_Secret.ts +295 -24
- package/src/cli/cmd_Social.ts +113 -28
- package/src/cli/cmd_SocialDrafts.ts +235 -0
- package/src/cli/cmd_Sound.ts +22 -1
- package/src/cli/cmd_Space.ts +324 -0
- package/src/cli/cmd_Start.ts +3 -2
- package/src/cli/cmd_ThreadHolds.ts +34 -0
- package/src/cli/cmd_ThreadKinds.ts +146 -0
- package/src/cli/cmd_ThreadReflect.ts +83 -0
- package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
- package/src/cli/cmd_Time.ts +76 -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/cmd_When.ts +1 -0
- package/src/cli/family-help.ts +5 -3
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/kit/builtins.ts +1 -0
- package/src/cli/kit/verb.ts +6 -2
- package/src/cli/registry.ts +44 -4
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +42 -41
- package/src/collections/collection-types.ts +30 -4
- package/src/collections/md-body.ts +5 -3
- package/src/collections/pings.ts +13 -6
- package/src/collections/providers.ts +147 -61
- package/src/collections/reflections.ts +9 -4
- package/src/collections/review.ts +4 -4
- 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/discover-checks.ts +18 -3
- package/src/core/git.ts +31 -0
- package/src/core/house-layout.ts +17 -0
- package/src/core/layout.ts +13 -5
- package/src/core/locked-write.ts +4 -1
- package/src/core/machine-busy.ts +127 -0
- package/src/core/machine-commit.ts +6 -1
- package/src/core/machine-db.ts +370 -20
- package/src/core/machine-layout.ts +137 -0
- package/src/core/machine-read.ts +81 -0
- package/src/core/migrate-layout.ts +9 -11
- 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/slots.ts +5 -4
- package/src/drill/clean.ts +25 -1
- package/src/drill/run.ts +1 -1
- package/src/drill/seal.ts +27 -4
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +59 -3
- package/src/home/app-sign.ts +15 -4
- package/src/home/daemon-jobs.ts +161 -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 +18 -6
- package/src/home/home-routes.ts +76 -0
- package/src/home/inbox-shape.ts +234 -91
- package/src/home/inbox.ts +26 -71
- package/src/home/machine-fold.ts +815 -0
- package/src/home/machine-host.ts +38 -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/other-macs.ts +2 -2
- 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 +179 -10
- 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 +516 -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 +41 -6
- 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 +347 -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 +102 -0
- package/src/hq/hq-local.ts +502 -0
- package/src/hq/hq-routes.ts +204 -0
- package/src/hq/hq-store.ts +603 -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 +374 -0
- package/src/hq/replica.ts +167 -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/hq/vault-route.ts +112 -0
- package/src/identities/collection.ts +2 -2
- package/src/identities/identities.ts +24 -11
- package/src/identities/machine-route.ts +8 -3
- package/src/identities/steps.ts +31 -0
- package/src/ledger/db.ts +81 -27
- package/src/ledger/gate-checks.ts +6 -2
- package/src/ledger/run-log.ts +11 -3
- package/src/ledger/store.ts +26 -4
- package/src/media-store/backup/daemon.ts +73 -25
- package/src/media-store/backup/kept.ts +241 -0
- package/src/media-store/backup/keys.ts +1 -1
- package/src/media-store/backup/manifest.ts +20 -2
- package/src/media-store/backup/prune.ts +365 -0
- package/src/media-store/backup/restore.ts +14 -4
- package/src/media-store/backup/retention.ts +122 -0
- package/src/media-store/backup/run.ts +25 -19
- 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 +83 -31
- package/src/media-store/backup/thread-copy.ts +340 -0
- package/src/media-store/copy/config.ts +76 -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 +24 -13
- package/src/media-store/forget.ts +141 -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 +21 -17
- package/src/media-store/put.ts +24 -8
- package/src/media-store/remote.ts +16 -7
- package/src/media-store/space-listing.ts +256 -0
- package/src/media-store/space.ts +46 -26
- 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/guard.ts +49 -0
- package/src/messages/model.ts +16 -7
- package/src/messages/objects.ts +201 -0
- package/src/messages/routes.ts +14 -4
- package/src/messages/score.ts +3 -3
- package/src/messages/write.ts +285 -0
- package/src/pages/frame-client.ts +191 -4
- 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 +129 -37
- package/src/reflections/reflections-queue.ts +1 -1
- package/src/release/gate-checkout.ts +2 -1
- package/src/release/git-facts.ts +3 -2
- package/src/release/machine-words.ts +67 -0
- package/src/release/public-clean.ts +11 -5
- package/src/releases/from-card.ts +1 -1
- package/src/releases/routes.ts +10 -5
- package/src/releases/store.ts +10 -1
- package/src/repo-config.ts +71 -19
- package/src/review/anim.ts +3 -3
- package/src/review/answer-kinds.ts +131 -0
- package/src/review/auto.ts +2 -2
- package/src/review/band.ts +53 -0
- package/src/review/branch-hold.ts +84 -0
- package/src/review/card-db.ts +254 -0
- package/src/review/card-rows.ts +267 -0
- package/src/review/cells.ts +360 -57
- package/src/review/close.ts +92 -0
- package/src/review/draft-card.ts +33 -0
- package/src/review/draft-model.ts +78 -0
- package/src/review/events.ts +171 -0
- package/src/review/format.ts +152 -19
- package/src/review/glyphs.ts +63 -0
- package/src/review/gone.ts +98 -0
- package/src/review/holds-sync.ts +62 -0
- package/src/review/holds.ts +85 -0
- package/src/review/house-kind-defs.ts +41 -0
- package/src/review/inbox-hook.ts +23 -10
- package/src/review/inbox-read.ts +201 -0
- package/src/review/instructions.ts +199 -0
- package/src/review/kind-apply.ts +61 -0
- package/src/review/kind-catalog.ts +96 -0
- package/src/review/kinds.ts +278 -0
- package/src/review/lane-ask.ts +109 -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 +582 -109
- package/src/review/move.ts +491 -0
- package/src/review/need-address.ts +15 -0
- package/src/review/need-threads.ts +93 -0
- package/src/review/notes.ts +12 -20
- package/src/review/object-card.ts +48 -0
- package/src/review/object-read.ts +31 -0
- package/src/review/owner-verdict.ts +36 -0
- package/src/review/parties.ts +182 -0
- package/src/review/previews.ts +18 -20
- package/src/review/project.ts +1 -1
- package/src/review/projections.ts +235 -0
- package/src/review/referring.ts +54 -0
- package/src/review/reflection-object.ts +195 -0
- package/src/review/rev.ts +8 -0
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +194 -38
- package/src/review/secret-route.ts +80 -0
- package/src/review/snooze.ts +38 -0
- package/src/review/stage-card.ts +12 -8
- package/src/review/stage-routes.ts +1 -1
- package/src/review/store.ts +851 -124
- package/src/review/supersede.ts +116 -0
- package/src/review/take-back.ts +52 -0
- package/src/review/thread-fold.ts +64 -0
- package/src/review/threads.ts +349 -14
- package/src/review/traces.ts +218 -0
- package/src/review/trailer-auto-mock.ts +63 -0
- package/src/review/trailer-card.ts +6 -6
- 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 +77 -11
- package/src/review/verdict-items.ts +73 -0
- package/src/review/verdict-write.ts +15 -0
- package/src/review/wait.ts +85 -0
- package/src/review/watchers.ts +23 -10
- package/src/rules/untrack-generated.ts +92 -8
- package/src/scaffold/files/claude-settings-local.json +2 -0
- package/src/secrets/archive-mark.ts +52 -0
- package/src/secrets/archive.ts +83 -0
- package/src/secrets/copy.ts +14 -14
- package/src/secrets/held.ts +16 -0
- package/src/secrets/keychain-write.ts +48 -0
- package/src/secrets/keychain.ts +116 -0
- package/src/secrets/lapse-mark.ts +33 -0
- package/src/secrets/lapse.ts +60 -0
- package/src/secrets/list.ts +21 -17
- package/src/secrets/manager.ts +55 -26
- package/src/secrets/read.ts +385 -0
- package/src/secrets/tail.ts +31 -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 +49 -0
- package/src/serve/hub-app/asks-st.ts +25 -0
- package/src/serve/hub-app/auto-text.tsx +14 -6
- package/src/serve/hub-app/benign-errors.ts +15 -1
- package/src/serve/hub-app/card-head.tsx +49 -0
- package/src/serve/hub-app/check-view.tsx +3 -2
- package/src/serve/hub-app/clock-svc.ts +1 -2
- package/src/serve/hub-app/code-copy.ts +35 -0
- package/src/serve/hub-app/col-card.tsx +72 -30
- package/src/serve/hub-app/col-list-page.tsx +125 -0
- package/src/serve/hub-app/col-list-st.ts +103 -0
- package/src/serve/hub-app/col-tables-view.tsx +17 -45
- package/src/serve/hub-app/col-tables.ts +76 -8
- package/src/serve/hub-app/cols-svc.ts +18 -39
- package/src/serve/hub-app/commands/commands-page.tsx +2 -1
- package/src/serve/hub-app/controls.css +83 -0
- 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/frames-st.ts +17 -1
- package/src/serve/hub-app/git-view.tsx +3 -2
- 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 +142 -11
- package/src/serve/hub-app/home-strip.css +6 -25
- package/src/serve/hub-app/home-strip.tsx +60 -93
- package/src/serve/hub-app/home.html +10 -0
- package/src/serve/hub-app/house-wiki-view.tsx +20 -0
- package/src/serve/hub-app/hub-app.tsx +71 -166
- package/src/serve/hub-app/hub-types.ts +5 -1
- package/src/serve/hub-app/hub.css +146 -71
- package/src/serve/hub-app/icons.tsx +32 -5
- package/src/serve/hub-app/identities-st.ts +56 -6
- package/src/serve/hub-app/identities-view.tsx +104 -61
- 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 +227 -49
- package/src/serve/hub-app/inbox-view.tsx +204 -120
- package/src/serve/hub-app/inbox.css +47 -47
- package/src/serve/hub-app/index.html +10 -0
- package/src/serve/hub-app/instructions.css +30 -0
- package/src/serve/hub-app/kept-cols.tsx +7 -0
- package/src/serve/hub-app/keys.ts +32 -17
- 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/machine-st.ts +2 -2
- package/src/serve/hub-app/machines-st.ts +251 -0
- package/src/serve/hub-app/machines-view.tsx +217 -0
- package/src/serve/hub-app/machines.css +67 -0
- package/src/serve/hub-app/markdown.css +51 -0
- package/src/serve/hub-app/md-copy.tsx +57 -0
- package/src/serve/hub-app/md.ts +25 -9
- package/src/serve/hub-app/media-view.tsx +4 -2
- package/src/serve/hub-app/messages/messages-page.tsx +81 -8
- package/src/serve/hub-app/messages/messages-st.ts +99 -3
- package/src/serve/hub-app/messages.css +14 -1
- package/src/serve/hub-app/objects.css +51 -0
- package/src/serve/hub-app/page-keys.ts +175 -0
- package/src/serve/hub-app/pages-frames.tsx +21 -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/pane-boundary.tsx +72 -0
- package/src/serve/hub-app/pane-errors.ts +54 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/planned-view.tsx +3 -3
- package/src/serve/hub-app/planned.css +0 -4
- package/src/serve/hub-app/processes-view.tsx +3 -2
- package/src/serve/hub-app/project-list.css +46 -8
- package/src/serve/hub-app/project-list.tsx +125 -59
- package/src/serve/hub-app/projects-svc.ts +83 -8
- 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 +22 -6
- package/src/serve/hub-app/reflections-page.tsx +95 -0
- package/src/serve/hub-app/reflections-st.ts +17 -0
- package/src/serve/hub-app/releases/releases-page.tsx +28 -4
- package/src/serve/hub-app/releases/releases-st.ts +1 -1
- package/src/serve/hub-app/releases.css +0 -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/code-colors.ts +30 -0
- package/src/serve/hub-app/review/diff-view.tsx +75 -0
- package/src/serve/hub-app/review/dock.tsx +104 -0
- package/src/serve/hub-app/review/draft-card.tsx +163 -0
- package/src/serve/hub-app/review/group-block.tsx +209 -0
- package/src/serve/hub-app/review/instructions-view.tsx +116 -0
- package/src/serve/hub-app/review/item-verdict.tsx +38 -0
- package/src/serve/hub-app/review/kind-states.tsx +193 -0
- package/src/serve/hub-app/review/kind-view.tsx +1 -37
- package/src/serve/hub-app/review/kit.tsx +75 -29
- package/src/serve/hub-app/review/lane-bar.tsx +64 -0
- package/src/serve/hub-app/review/note-place.ts +1 -1
- package/src/serve/hub-app/review/object-card.tsx +62 -0
- package/src/serve/hub-app/review/object-panel.tsx +179 -0
- package/src/serve/hub-app/review/question-views.tsx +385 -0
- package/src/serve/hub-app/review/review-board.tsx +2 -2
- package/src/serve/hub-app/review/review-cells.tsx +148 -87
- package/src/serve/hub-app/review/review-kit.ts +27 -1
- package/src/serve/hub-app/review/review-list.tsx +160 -65
- package/src/serve/hub-app/review/review-page.tsx +12 -12
- package/src/serve/hub-app/review/review-st.ts +174 -47
- package/src/serve/hub-app/review/review-thread.tsx +214 -53
- package/src/serve/hub-app/review/review-views.tsx +494 -159
- package/src/serve/hub-app/review/thread-close.tsx +124 -0
- 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 +288 -41
- package/src/serve/hub-app/review/trailer-card.tsx +2 -2
- 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/trailer-timeline.tsx +2 -2
- package/src/serve/hub-app/review.css +462 -97
- package/src/serve/hub-app/section-head.tsx +51 -0
- 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/calendar.tsx +5 -11
- package/src/serve/hub-app/social/comms-page.tsx +43 -15
- package/src/serve/hub-app/social/kit.tsx +32 -13
- package/src/serve/hub-app/social/next-release.tsx +3 -5
- package/src/serve/hub-app/social/post-card.tsx +142 -49
- package/src/serve/hub-app/social/post-page.tsx +80 -0
- package/src/serve/hub-app/social/problems.tsx +5 -9
- package/src/serve/hub-app/social/serial-writes.ts +13 -0
- package/src/serve/hub-app/social/social-model.ts +24 -5
- package/src/serve/hub-app/social/social-page.tsx +95 -36
- package/src/serve/hub-app/social/social-st.ts +162 -41
- 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 +10 -17
- 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 +97 -25
- 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/thread-row.tsx +101 -0
- package/src/serve/hub-app/time-ago.tsx +3 -2
- 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 +77 -0
- package/src/serve/hub-app/time.css +135 -0
- package/src/serve/hub-app/tree-build.ts +52 -42
- package/src/serve/hub-app/tree-row.tsx +3 -11
- 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-page.tsx +2 -11
- package/src/serve/hub-app/veille/veille-st.ts +12 -10
- package/src/serve/hub-app/veille.css +0 -1
- package/src/serve/hub-app/waiting-svc.ts +29 -0
- package/src/serve/hub-app/when-view.tsx +6 -3
- package/src/serve/hub-app/wiki-st.ts +30 -4
- package/src/serve/hub-app/wikis-view.tsx +6 -5
- package/src/serve/hub-runtime.ts +35 -8
- package/src/serve/project-gutter-route.ts +42 -19
- package/src/serve/project-gutter.ts +16 -50
- package/src/serve/same-origin.ts +13 -0
- package/src/serve/secret-gate.ts +21 -0
- package/src/serve/serve-hub.ts +38 -20
- package/src/serve/tailnet-caller.ts +117 -0
- package/src/shipkit-files.ts +16 -2
- package/src/shipkit.ts +3 -3
- package/src/shot/shooter.ts +616 -420
- package/src/shot/shot-ask.ts +246 -155
- package/src/site/desk.ts +4 -4
- package/src/smoke/run-smoke.ts +6 -6
- package/src/social/brands.ts +4 -0
- package/src/social/card-drafts.ts +11 -19
- package/src/social/cover.ts +202 -0
- package/src/social/desk-index.ts +34 -13
- package/src/social/discord-layout.ts +37 -13
- package/src/social/drafts.ts +7 -4
- package/src/social/import-drafts.ts +244 -0
- package/src/social/kind-pages.ts +3 -3
- package/src/social/kinds.ts +1 -1
- package/src/social/load.ts +111 -65
- package/src/social/media-kind.ts +68 -160
- package/src/social/media-of.ts +5 -4
- package/src/social/open.ts +3 -2
- package/src/social/post-object.ts +120 -0
- package/src/social/post-sources.ts +136 -0
- package/src/social/post-text.ts +103 -0
- package/src/social/posts.ts +378 -0
- package/src/social/presence.ts +7 -5
- package/src/social/publish/discord.ts +5 -2
- package/src/social/publish/index.ts +17 -5
- package/src/social/publish/secret.ts +4 -4
- package/src/social/release-stage.ts +79 -63
- package/src/social/routes.ts +89 -24
- package/src/social/stage.ts +43 -58
- package/src/social/stats.ts +12 -9
- package/src/social/strip.ts +4 -1
- package/src/social/text.ts +4 -3
- package/src/social/thumbnail.ts +347 -0
- package/src/social/tracker.ts +1 -1
- package/src/social/writes.ts +12 -29
- package/src/stores/collection.ts +15 -11
- package/src/stores/desk.ts +246 -47
- package/src/stores/model.ts +72 -6
- package/src/stores/routes.ts +37 -12
- package/src/stores/unit.ts +16 -10
- package/src/suite/judge-suites.ts +41 -11
- package/src/suite/select.ts +45 -3
- package/src/suite/suite-cli.ts +16 -10
- 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/eleven.ts +33 -3
- 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 +360 -0
- package/src/vault/vault-import.ts +213 -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/veille/identity.ts +2 -2
- package/src/wiki/graph-pages.ts +13 -1
- package/src/wiki/scan-md.ts +1 -1
- package/src/asks/asks-queue.ts +0 -266
- package/src/social/migrate.ts +0 -123
package/src/cli/cmd_Backup.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Every module loads inside execute: the cli registers this file on every `sk` call
|
|
4
4
|
import { Command, Option } from 'clipanion'
|
|
5
5
|
|
|
6
|
-
const DETAILS = `the files of the house that no git and no Space keeps (the veille logs, the media index and the machine db as sqlite snapshots, the rail order, the machine's private folder, the agents' memories, each house repo's untracked .shipkit/ files, its hand tuned .comfy-ts/ files, its gitignored *.local.* files, and what its repo.config.ts names under backup: paths kept whole, sqlite files) go up to the owner's private Space under backup/<sha256>, each run under backup/runs/ with its parts under backup/parts/ (a part unchanged since the last run is not written again).
|
|
6
|
+
const DETAILS = `the files of the house that no git and no Space keeps (the veille logs, the media index and the machine db as sqlite snapshots, the rail order, the machine's private folder, the agents' memories, each house repo's untracked .shipkit/ files, its hand tuned .comfy-ts/ files, its gitignored *.local.* files, and what its repo.config.ts names under backup: paths kept whole, sqlite files) go up to the owner's private Space under backup/<sha256>, each run under backup/runs/ with its parts under backup/parts/ (a part unchanged since the last run is not written again). The retention of the house config (serve.backupRetention) keeps every run of the last hours, then the newest of each day, week and month it counts; after each run the daemon deletes this machine's other runs and the objects only they named (sk backup prune). Secrets never go: a file whose name or text says it holds one is refused, with the reason. The daemon runs it on change (debounced) and every 6 h. Page: wiki tools/shipkit/media-store.md, Backup`
|
|
7
7
|
|
|
8
8
|
type Ctx = { stdout: NodeJS.WritableStream; stderr: NodeJS.WritableStream }
|
|
9
9
|
|
|
@@ -42,7 +42,7 @@ export class BackupCommand extends Command {
|
|
|
42
42
|
static override paths = [['backup']]
|
|
43
43
|
static override usage = Command.Usage({
|
|
44
44
|
category: 'Media',
|
|
45
|
-
description: 'the machine-only state of the house up to the private Space now
|
|
45
|
+
description: 'the machine-only state of the house up to the private Space now, secrets refused',
|
|
46
46
|
details: `${DETAILS}\n\nA run reads every source, hashes it (a sqlite: a consistent snapshot first), sends each object the Space lacks, then writes ONE manifest (path, sha, size, time of every file), last. A run whose state equals the last one writes nothing. --check sends nothing: it prints what the Space lacks, what changed since the last run, and what is refused, and exits 1 when something waits.`,
|
|
47
47
|
examples: [['back up now', 'sk backup'], ['what is not backed up yet', 'sk backup --check']],
|
|
48
48
|
})
|
|
@@ -87,35 +87,121 @@ export class BackupRunsCommand extends Command {
|
|
|
87
87
|
static override usage = Command.Usage({
|
|
88
88
|
category: 'Media',
|
|
89
89
|
description: 'the backup runs in the Space, newest first: the count per machine, then time, machine and key',
|
|
90
|
-
details: `${DETAILS}\n\nThe first line counts the runs per machine; the newest ${RUNS_SHOWN} follow, newest first
|
|
90
|
+
details: `${DETAILS}\n\nThe first line counts the runs per machine; the newest ${RUNS_SHOWN} follow, newest first, each with the retention slots that keep it, or « goes at the next prune ». --all lists every run, oldest first.`,
|
|
91
91
|
examples: [['the latest runs', 'sk backup runs'], ['every run', 'sk backup runs --all']],
|
|
92
92
|
})
|
|
93
93
|
all = Option.Boolean('--all', false, { description: 'every run, oldest first' })
|
|
94
94
|
async execute(): Promise<number> {
|
|
95
95
|
return run(this.context, async (h) => {
|
|
96
|
+
const { runSlots, houseRetention, pinnedRuns } = await import('../media-store/backup/prune.ts')
|
|
96
97
|
const { runsOf } = await import('../media-store/backup/manifest.ts')
|
|
97
|
-
const
|
|
98
|
+
const { policy, why } = await houseRetention()
|
|
99
|
+
const pins = await pinnedRuns()
|
|
100
|
+
const rows = policy ? await runSlots(h.space, { policy, now: Date.now(), pinned: [...pins.keys()], pinLabel: (k) => pins.get(k) }) : (await runsOf(h.space)).map((r) => ({ run: r, host: r.machine, slots: null }))
|
|
98
101
|
const per = new Map<string, number>()
|
|
99
|
-
for (const r of
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
for (const r of rows) per.set(r.host ?? '(host unread)', (per.get(r.host ?? '(host unread)') ?? 0) + 1)
|
|
103
|
+
const going = rows.filter((r) => r.slots?.length === 0).length
|
|
104
|
+
h.out(`${rows.length} runs: ${[...per].map(([m, n]) => `${n} of ${m}`).join(', ')}${policy ? `; ${going} go at the next prune` : ''}${!this.all && rows.length > RUNS_SHOWN ? `; the newest ${RUNS_SHOWN} below, --all for every one` : ''}`)
|
|
105
|
+
if (!policy) h.out(`note: ${why}`)
|
|
106
|
+
const slotText = (s: string[] | null): string => (s == null ? '' : ` ${s.length ? s.join(', ') : 'goes at the next prune'}`)
|
|
107
|
+
for (const r of this.all ? rows : rows.slice(-RUNS_SHOWN).reverse()) h.out(`${r.run.at.toISOString()} ${r.host ?? '(host unread)'} ${r.run.key} ${(r.run.size / 1e3).toFixed(0)} kB${slotText(r.slots)}`)
|
|
102
108
|
return 0
|
|
103
109
|
})
|
|
104
110
|
}
|
|
105
111
|
}
|
|
106
112
|
|
|
113
|
+
export class BackupUndeleteCommand extends Command {
|
|
114
|
+
static override paths = [['backup', 'undelete']]
|
|
115
|
+
static override usage = Command.Usage({
|
|
116
|
+
category: 'Media',
|
|
117
|
+
description: 'a prune undone within its 7 days of trash: these keys, or every delete since a time, back',
|
|
118
|
+
details: `${DETAILS}\n\nA prune deletes with a delete marker: the bucket keeps the versions for 7 days, then the trash goes. This removes the markers, so each object is back as it was. Name the keys (runs, parts, bytes under backup/), or --since a time to undo every delete since then. Undo a whole apply with --since its start, then run sk backup drill.`,
|
|
119
|
+
examples: [['undo an apply', 'sk backup undelete --since 2026-11-20T18:40Z'], ['one run back', 'sk backup undelete backup/runs/20261110T120000Z-laptop-0123456789ab.json.gz']],
|
|
120
|
+
})
|
|
121
|
+
since = Option.String('--since', { description: 'every key deleted at or after this time: 2026-11-20T18:40Z or 20261120T184000Z' })
|
|
122
|
+
keys = Option.Rest()
|
|
123
|
+
async execute(): Promise<number> {
|
|
124
|
+
try {
|
|
125
|
+
const { undeleteBackup } = await import('../media-store/forget.ts')
|
|
126
|
+
const { parseAt } = await import('../media-store/backup/keys.ts')
|
|
127
|
+
const r = await undeleteBackup({ ...(this.keys.length ? { keys: this.keys } : {}), ...(this.since ? { since: parseAt(this.since).getTime() } : {}) })
|
|
128
|
+
this.context.stdout.write(`ok: ${r.back.length} objects back${r.back.length ? `, first ${r.back[0]}` : ''}\n`)
|
|
129
|
+
for (const f of r.failed.slice(0, 5)) this.context.stderr.write(`FAIL: ${f.key}: ${f.error}\n`)
|
|
130
|
+
return r.failed.length ? 1 : 0
|
|
131
|
+
} catch (e) {
|
|
132
|
+
this.context.stderr.write(`FAIL: backup undelete: ${(e as Error).message}\n`)
|
|
133
|
+
return 1
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class BackupPinCommand extends Command {
|
|
139
|
+
static override paths = [['backup', 'pin']]
|
|
140
|
+
static override usage = Command.Usage({
|
|
141
|
+
category: 'Media',
|
|
142
|
+
description: 'a backup run kept past its retention slots for some days: the one taken before a migration',
|
|
143
|
+
details: `${DETAILS}\n\nThe run is this machine's last one unless --run names another. The pin lives in the machine db; the prune keeps the run while it holds. With no flag beyond --list, the pins that hold.`,
|
|
144
|
+
examples: [['keep the last run 30 days', "sk backup pin --why 'before the social posts migration'"], ['the pins that hold', 'sk backup pin --list']],
|
|
145
|
+
})
|
|
146
|
+
key = Option.String('--run', { description: 'the run key, as sk backup runs prints it: this machine\'s last run when absent' })
|
|
147
|
+
days = Option.String('--days', '30', { description: 'how many days the pin holds' })
|
|
148
|
+
why = Option.String('--why', '', { description: 'why it is kept, shown beside the run in sk backup runs' })
|
|
149
|
+
list = Option.Boolean('--list', false, { description: 'the pins that hold, nothing pinned' })
|
|
150
|
+
async execute(): Promise<number> {
|
|
151
|
+
const { backupPins, pinRun } = await import('../media-store/backup/prune.ts')
|
|
152
|
+
const { lastRun } = await import('../media-store/backup/run.ts')
|
|
153
|
+
try {
|
|
154
|
+
if (this.list) {
|
|
155
|
+
for (const p of backupPins()) this.context.stdout.write(`${p.key} till ${new Date(p.until).toISOString()} ${p.why}\n`)
|
|
156
|
+
return 0
|
|
157
|
+
}
|
|
158
|
+
const key = this.key ?? lastRun()?.key
|
|
159
|
+
if (!key) throw new Error('this machine wrote no run yet: sk backup first')
|
|
160
|
+
const days = Number(this.days)
|
|
161
|
+
if (!Number.isFinite(days) || days <= 0) throw new Error(`--days ${this.days}: a number of days over 0`)
|
|
162
|
+
const p = pinRun(key, days, this.why || 'pinned by hand')
|
|
163
|
+
this.context.stdout.write(`ok: ${p.key} kept till ${new Date(p.until).toISOString()}: ${p.why}\n`)
|
|
164
|
+
return 0
|
|
165
|
+
} catch (e) {
|
|
166
|
+
this.context.stderr.write(`FAIL: backup pin: ${(e as Error).message}\n`)
|
|
167
|
+
return 1
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export class BackupPruneCommand extends Command {
|
|
173
|
+
static override paths = [['backup', 'prune']]
|
|
174
|
+
static override usage = Command.Usage({
|
|
175
|
+
category: 'Media',
|
|
176
|
+
description: "this machine's runs no retention slot keeps, and the objects only they name: dry run unless --apply",
|
|
177
|
+
details: `${DETAILS}\n\nThe policy is the house config's serve.backupRetention: every run of the last allHours, then the newest of each of the last days calendar days, weeks ISO weeks and months months (UTC), a slot with no run keeping the next older one. The newest run and the run the thread drill last brought back whole always stay. A machine prunes only its own runs. An object goes only when no run that stays names it, no run of another machine names it, and it is over 48 h old; each goes with every version, its index row first. Without --apply it prints what would go. The daemon prunes after each run, at most 200 runs at a time.`,
|
|
178
|
+
examples: [['what the retention would delete', 'sk backup prune'], ['delete it', 'sk backup prune --apply']],
|
|
179
|
+
})
|
|
180
|
+
apply = Option.Boolean('--apply', false, { description: 'delete: without it, only print what would go' })
|
|
181
|
+
async execute(): Promise<number> {
|
|
182
|
+
return run(this.context, async (h) => {
|
|
183
|
+
const { pruneBackups } = await import('../media-store/backup/prune.ts')
|
|
184
|
+
const t0 = Date.now()
|
|
185
|
+
const p = await pruneBackups(h.space, { apply: this.apply })
|
|
186
|
+
for (const l of p.lines) (l.startsWith('WARN') ? h.err : h.out)(l)
|
|
187
|
+
h.out(`in ${((Date.now() - t0) / 1000).toFixed(1)} s`)
|
|
188
|
+
return p.result != null && p.result.failed.length > 0 ? 1 : 0
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
107
193
|
export class BackupRestoreCommand extends Command {
|
|
108
194
|
static override paths = [['backup', 'restore']]
|
|
109
195
|
static override usage = Command.Usage({
|
|
110
196
|
category: 'Media',
|
|
111
197
|
description: 'a backup run written back, every sha checked: to an empty folder, or in place',
|
|
112
198
|
details: `${DETAILS}\n\nThe run is this Mac's last one at or before --at (the last one when it is left out); --host reads another Mac's runs, as a new Mac restoring the one it replaces. --to writes every file under the folder, at its path under the home (the folder must be empty or new). --in-place writes over the live files: a live file with other bytes is copied to ~/.shipkit/backup-replaced/<time>/ first, and a sqlite lands beside its live file as <file>.restored (stop pm, then move it). --path keeps the files under one path of the home.`,
|
|
113
|
-
examples: [['the last run into a folder', 'sk backup restore --to ~/restore-1'], ['the veille logs as they were on a day, in place', 'sk backup restore --at 2026-11-04 --in-place --path .
|
|
199
|
+
examples: [['the last run into a folder', 'sk backup restore --to ~/restore-1'], ['the veille logs as they were on a day, in place', 'sk backup restore --at 2026-11-04 --in-place --path .shipkit/home/veille']],
|
|
114
200
|
})
|
|
115
201
|
to = Option.String('--to', { description: 'an empty or new folder the files land under' })
|
|
116
202
|
inPlace = Option.Boolean('--in-place', false, { description: 'over the live files, each one replaced copied aside first' })
|
|
117
203
|
at = Option.String('--at', { description: 'the last run at or before this time: 2026-11-04T13:50Z, 2026-11-04 or 20261104T135000Z' })
|
|
118
|
-
under = Option.String('--path', { description: 'only the files under this path of the home: .config/shipkit/home/veille' })
|
|
204
|
+
under = Option.String('--path', { description: 'only the files under this path of the home: .shipkit/home/veille (a run made before sk home move names it .config/shipkit/home/veille: either form matches)' })
|
|
119
205
|
host = Option.String('--host', { description: "another Mac's runs, by the name `sk backup runs` prints: this Mac's when absent" })
|
|
120
206
|
async execute(): Promise<number> {
|
|
121
207
|
return run(this.context, async (h) => {
|
|
@@ -159,4 +245,61 @@ export class BackupDrillCommand extends Command {
|
|
|
159
245
|
}
|
|
160
246
|
}
|
|
161
247
|
|
|
162
|
-
|
|
248
|
+
const THREADS = `the thread store (every thread of every repo of this machine, asks included: the review_* tables of the machine db) has three copies beside the live one: each backup run in the private Space, the hq replica (Litestream, the same Space), and a second copy on another machine of the house over the tailnet, its own disk. The daemon sends that copy within 10 min of a write to the store, as a snapshot of its tables gzipped under ~/.shipkit/thread-copies/<this machine>/<time>-<sha>.sqlite.gz on the peer, checked there by its sha before it takes its name; it keeps every copy of 48 h, then the newest of each day for 90 days. Page: wiki tools/shipkit/media-store-backup.md, The thread store's second copy`
|
|
249
|
+
|
|
250
|
+
export class BackupThreadsCommand extends Command {
|
|
251
|
+
static override paths = [['backup', 'threads']]
|
|
252
|
+
static override usage = Command.Usage({
|
|
253
|
+
category: 'Media',
|
|
254
|
+
description: "the thread store's second copy, on another machine of the house, sent now",
|
|
255
|
+
details: `${THREADS}\n\n--peer sets the machine (an ssh host this Mac reaches with no prompt) and keeps it in the machine db; the daemon sends the next copies there. A copy is sent only when the store moved since the last one, --force sends one anyway.`,
|
|
256
|
+
examples: [['set the peer and send', 'sk backup threads --peer second-mac'], ['send now', 'sk backup threads']],
|
|
257
|
+
})
|
|
258
|
+
peer = Option.String('--peer', { description: 'the ssh host that keeps the copies, kept for the daemon' })
|
|
259
|
+
force = Option.Boolean('--force', false, { description: 'send a copy even when the store did not move' })
|
|
260
|
+
async execute(): Promise<number> {
|
|
261
|
+
const { sendThreadCopy, setCopyPeer } = await import('../media-store/backup/thread-copy.ts')
|
|
262
|
+
try {
|
|
263
|
+
if (this.peer) setCopyPeer(this.peer)
|
|
264
|
+
const t0 = Date.now()
|
|
265
|
+
const r = await sendThreadCopy({ force: this.force || this.peer !== undefined })
|
|
266
|
+
if (r.sent == null && r.why.startsWith('the store did not move')) {
|
|
267
|
+
this.context.stdout.write(`ok: ${r.why}\n`)
|
|
268
|
+
return 0
|
|
269
|
+
}
|
|
270
|
+
if (r.sent == null) {
|
|
271
|
+
this.context.stderr.write(`FAIL: backup threads: ${r.why}\n`)
|
|
272
|
+
return 1
|
|
273
|
+
}
|
|
274
|
+
this.context.stdout.write(`ok: ${r.sent} (${mb(r.bytes)}), checked by its sha on the peer, ${r.pruned} old copies pruned, in ${((Date.now() - t0) / 1000).toFixed(1)} s\n`)
|
|
275
|
+
if (r.why) this.context.stderr.write(`WARN backup threads: ${r.why}\n`)
|
|
276
|
+
return 0
|
|
277
|
+
} catch (e) {
|
|
278
|
+
this.context.stderr.write(`FAIL: backup threads: ${(e as Error).message}\n`)
|
|
279
|
+
return 1
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export class BackupThreadsDrillCommand extends Command {
|
|
285
|
+
static override paths = [['backup', 'threads', 'drill']]
|
|
286
|
+
static override usage = Command.Usage({
|
|
287
|
+
category: 'Media',
|
|
288
|
+
description: 'both copies of the thread store brought back and compared with the live store',
|
|
289
|
+
details: `${THREADS}\n\nEach copy is restored into a scratch folder (the run through sk backup restore, every sha checked; the copy checked by the sha of its name) and each ask thread compared with the live store: the same head and messages, or moved since the copy, or dropped since (a tombstone). Exit 1 when a copy does not come back, or an ask thread is missing, differs, or lives only in the copy. The house check RV035 runs it every 6 h.`,
|
|
290
|
+
examples: [['the drill', 'sk backup threads drill']],
|
|
291
|
+
})
|
|
292
|
+
async execute(): Promise<number> {
|
|
293
|
+
const { threadDrill, sideLine } = await import('../media-store/backup/thread-copy.ts')
|
|
294
|
+
const { machineSpace } = await import('../media-store/space.ts')
|
|
295
|
+
const { homedir } = await import('node:os')
|
|
296
|
+
const t0 = Date.now()
|
|
297
|
+
const { space, why } = await machineSpace()
|
|
298
|
+
const d = await threadDrill({ space, spaceWhy: why, home: homedir() })
|
|
299
|
+
for (const s of d.sides) (s.ok ? this.context.stdout : this.context.stderr).write(`${sideLine(s)}\n`)
|
|
300
|
+
this.context.stdout.write(`${d.ok ? 'ok' : 'FAIL'}: the thread store's drill, ${d.sides.length} copies, in ${((Date.now() - t0) / 1000).toFixed(1)} s\n`)
|
|
301
|
+
return d.ok ? 0 : 1
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export const BACKUP_COMMANDS = [BackupCommand, BackupRunsCommand, BackupPruneCommand, BackupPinCommand, BackupUndeleteCommand, BackupRestoreCommand, BackupDrillCommand, BackupThreadsCommand, BackupThreadsDrillCommand]
|
package/src/cli/cmd_Calls.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { callsFile, callsReport, envPrefix, renderCallsReport, sinceOf } from '.
|
|
|
7
7
|
|
|
8
8
|
export class CallsCommand extends Command {
|
|
9
9
|
static override paths = [['calls']]
|
|
10
|
+
static gloss = 'the timed log of sk runs'
|
|
10
11
|
|
|
11
12
|
static override usage = Command.Usage({
|
|
12
13
|
category: 'Health',
|
package/src/cli/cmd_Capacity.ts
CHANGED
|
@@ -8,8 +8,8 @@ export class CapacityCommand extends Command {
|
|
|
8
8
|
|
|
9
9
|
static override usage = Command.Usage({
|
|
10
10
|
category: 'Health',
|
|
11
|
-
description: 'how many lanes this repo runs now: the machine\'s cores,
|
|
12
|
-
details: 'reads the cores, the 1 minute load and the agents whose transcript moved in the last 3 minutes, every account and repo. The answer is this repo\'s live lanes plus one a free core, never under one. --max <n> is the maximum the owner gave: it replaces the number. Only a dying machine (a load of twice its cores) stops a lane, the maximum included. Run it before a lane starts. Report only, exit 0 always.',
|
|
11
|
+
description: 'how many lanes this repo runs now: the machine\'s cores, the cores in use, the lanes live on it',
|
|
12
|
+
details: 'reads the cores, the cores really in use (the CPU times, smoothed over 20 s by the daemon, else a 0.4 s sample), the 1 minute load and the agents whose transcript moved in the last 3 minutes, every account and repo. A free core is one neither in use nor held by a live agent; the load counts only once every core is taken, and alone where the machine gives no CPU times. The answer is this repo\'s live lanes plus one a free core, never under one. --max <n> is the maximum the owner gave: it replaces the number. Only a dying machine (85% of its cores in use and a load of twice its cores, or critical memory) stops a lane, the maximum included. Run it before a lane starts. Report only, exit 0 always.',
|
|
13
13
|
examples: [
|
|
14
14
|
['before a lane starts', 'sk capacity'],
|
|
15
15
|
['with the maximum the owner gave', 'sk capacity --max 5'],
|
package/src/cli/cmd_Commands.ts
CHANGED
|
@@ -25,6 +25,12 @@ export type CommandRow = {
|
|
|
25
25
|
stamp?: string[]
|
|
26
26
|
/** listed on the essentials page */
|
|
27
27
|
essential?: Essential
|
|
28
|
+
/** a few words beside its name where the name alone misleads */
|
|
29
|
+
gloss?: string
|
|
30
|
+
/** the other paths its class answers to: `gp` for `global-processes` */
|
|
31
|
+
aliases?: string[]
|
|
32
|
+
/** an older name that still runs for the callers that type it, left out of every list (its class's `older`) */
|
|
33
|
+
older?: boolean
|
|
28
34
|
/** acts beyond this machine or spends money: the hub asks before it runs (cli/kit/verb.ts) */
|
|
29
35
|
effect?: Effect
|
|
30
36
|
/** what a kit row runs */
|
|
@@ -89,7 +95,11 @@ export function commandRows(plain: Definition[], detailed: Definition[] = [], bi
|
|
|
89
95
|
if (m.words != null) row.words = m.words
|
|
90
96
|
if (m.stamp != null) row.stamp = m.stamp
|
|
91
97
|
if (m.essential != null) row.essential = m.essential
|
|
98
|
+
if (m.gloss != null) row.gloss = m.gloss
|
|
92
99
|
if (m.effect != null) row.effect = m.effect
|
|
100
|
+
if ((c as { older?: boolean }).older === true) row.older = true
|
|
101
|
+
const aliases = ((c as { paths?: string[][] }).paths ?? []).map((p) => p.join(' ')).filter((p) => p !== path)
|
|
102
|
+
if (aliases.length > 0) row.aliases = aliases
|
|
93
103
|
const v = ROW_OF.get(c)
|
|
94
104
|
if (v != null) row.runs = runText(v.run)
|
|
95
105
|
}
|
|
@@ -127,6 +137,7 @@ export function renderCompact(rows: CommandRow[], bin = 'sk', pages: Readonly<Re
|
|
|
127
137
|
const out: string[] = []
|
|
128
138
|
let cat = ''
|
|
129
139
|
for (const r of rows) {
|
|
140
|
+
if (r.older === true) continue
|
|
130
141
|
if (r.category !== cat) { cat = r.category; out.push(`\n### ${cat}${pages?.[cat] != null ? ` → ${pages[cat]}` : ''}\n`) }
|
|
131
142
|
out.push(compactLine(r, bin))
|
|
132
143
|
}
|
|
@@ -145,53 +156,140 @@ const essentialLines = (r: CommandRow, bin: string, sep: string): string[] => {
|
|
|
145
156
|
return [`- \`${bin} ${r.path}${e.args != null ? ` ${e.args}` : ''}\`${sep}${r.description}`, ...r.examples.slice(0, e.examples ?? 0).map(([label, cmd]) => ` - \`${cmd}\`: ${label}`)]
|
|
146
157
|
}
|
|
147
158
|
|
|
148
|
-
/**
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
/** the longest gloss: a few words, never a description */
|
|
160
|
+
export const GLOSS_MAX = 40
|
|
161
|
+
|
|
162
|
+
const firstWord = (path: string): string => path.split(' ')[0]!
|
|
163
|
+
|
|
164
|
+
/** every path the rows answer to, an alias with the path of its class */
|
|
165
|
+
const pathsOf = (rows: CommandRow[]): Map<string, string | null> => {
|
|
166
|
+
const out = new Map<string, string | null>()
|
|
167
|
+
for (const r of rows) { out.set(r.path, null); for (const a of r.aliases ?? []) out.set(a, r.path) }
|
|
168
|
+
return out
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** an alias word that only mirrors another family, verb for verb: `gp` for `global-processes`. Its pair line
|
|
172
|
+
* names every one of its paths, so the word must hold no path of its own and leave no verb of the family out */
|
|
173
|
+
const mirrorOf = (w: string, paths: Map<string, string | null>): string | null => {
|
|
174
|
+
const mine = [...paths].filter(([p]) => firstWord(p) === w)
|
|
175
|
+
const of = mine[0]?.[1]
|
|
176
|
+
if (of == null || mine.some(([, o]) => o == null)) return null
|
|
177
|
+
const pw = firstWord(of)
|
|
178
|
+
if (pw === w || !mine.every(([p, o]) => o === `${pw}${p.slice(w.length)}`)) return null
|
|
179
|
+
const theirs = [...paths].filter(([p, o]) => o == null && firstWord(p) === pw)
|
|
180
|
+
return mine.length >= 2 && theirs.length === mine.length ? pw : null
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** every command of a family the page does not describe, by name: one usage span per first word, `<a|b>`
|
|
184
|
+
* when the word alone runs nothing, `[a|b]` when it runs too, a lone verb whole; an alias with what it names;
|
|
185
|
+
* a word that mirrors a family as one pair. `paths` is every path of the binary, so a bare word that runs
|
|
186
|
+
* through an alias reads as one that runs */
|
|
187
|
+
const restOf = (all: CommandRow[], bin: string, paths: Map<string, string | null>): string[] => {
|
|
188
|
+
type Name = { path: string; gloss?: string; of?: string }
|
|
189
|
+
const names: Name[] = []
|
|
190
|
+
for (const r of all) {
|
|
191
|
+
if (r.essential == null) names.push({ path: r.path, ...(r.gloss != null ? { gloss: r.gloss } : {}) })
|
|
192
|
+
for (const a of r.aliases ?? []) names.push({ path: a, gloss: `= ${bin} ${r.path}`, of: r.path })
|
|
193
|
+
}
|
|
194
|
+
const out: string[] = []
|
|
195
|
+
for (const w of [...new Set(names.map((n) => firstWord(n.path)))].sort()) {
|
|
196
|
+
const mine = names.filter((n) => firstWord(n.path) === w).sort((a, b) => a.path.localeCompare(b.path))
|
|
197
|
+
const pw = mirrorOf(w, paths)
|
|
198
|
+
if (pw != null) { out.push(`\`${bin} ${w} …\` = \`${bin} ${pw} …\``); continue }
|
|
199
|
+
const subs = mine.filter((n) => n.path !== w)
|
|
200
|
+
const bare = mine.find((n) => n.path === w)
|
|
201
|
+
const tail = (n: Name): string => (n === bare ? w : n.path.slice(w.length + 1))
|
|
202
|
+
// an alias of the same verb under another word: `review ask` = `thread ask`
|
|
203
|
+
const sameVerb = (n: Name): string | null => (n.of != null && firstWord(n.of) !== w && n.of === `${firstWord(n.of)}${n.path.slice(w.length)}` ? firstWord(n.of) : null)
|
|
204
|
+
const spans: [string, Name[]][] = subs.length >= 2
|
|
205
|
+
? [[`${bin} ${w} ${paths.has(w) ? `[${subs.map(tail).join('|')}]` : `<${subs.map(tail).join('|')}>`}`, mine]]
|
|
206
|
+
: mine.map((n) => [`${bin} ${n.path}`, [n]])
|
|
207
|
+
for (const [span, shown] of spans) {
|
|
208
|
+
const glossed = shown.filter((n) => n.gloss != null)
|
|
209
|
+
// three aliases or more of one word, verb for verb: one phrase, the others after it
|
|
210
|
+
const counts = new Map<string, number>()
|
|
211
|
+
for (const n of glossed) { const v = sameVerb(n); if (v != null) counts.set(v, (counts.get(v) ?? 0) + 1) }
|
|
212
|
+
const pw = [...counts].find(([, c]) => c >= 3)?.[0]
|
|
213
|
+
const parts = glossed.filter((n) => pw == null || sameVerb(n) !== pw).map((n) => (shown.length === 1 ? n.gloss! : `${tail(n)}: ${n.gloss}`))
|
|
214
|
+
const gloss = [...(pw != null ? [`= ${bin} ${pw} verb for verb`] : []), ...parts].join('; ')
|
|
215
|
+
out.push(`\`${span}\`${gloss === '' ? '' : ` (${gloss})`}`)
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return out
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** the command paths a page names. A described line (`— ` on shipkit's page, `: ` on a project's) names the
|
|
222
|
+
* longest registered path its command starts with. A name line (`- more:` or a family line) names `sk w`,
|
|
223
|
+
* each `sk w <a|b>`, `sk w` itself under `[a|b]`, and under `sk w …` = `sk p …` every path of `w` */
|
|
224
|
+
export function namedPaths(text: string, known: Map<string, string | null>, bin = 'sk'): { named: Set<string>; unknown: string[] } {
|
|
225
|
+
const named = new Set<string>()
|
|
226
|
+
const unknown: string[] = []
|
|
227
|
+
const longest = [...known.keys()].sort((a, b) => b.length - a.length)
|
|
228
|
+
for (const line of text.split('\n')) {
|
|
229
|
+
const d = line.startsWith(`- \`${bin} `) ? /^- `([^`]+)`(?: — |: )/.exec(line) : null
|
|
230
|
+
if (d != null) {
|
|
231
|
+
const p = longest.find((k) => d[1] === `${bin} ${k}` || d[1]!.startsWith(`${bin} ${k} `))
|
|
232
|
+
if (p != null) named.add(p)
|
|
233
|
+
else unknown.push(d[1]!)
|
|
234
|
+
continue
|
|
235
|
+
}
|
|
236
|
+
if (!line.startsWith('- ') || line.startsWith('- `')) continue
|
|
237
|
+
const rest = line.replace(new RegExp(`\`${bin} ([\\w-]+) …\` = \`${bin} ([\\w-]+) …\``, 'g'), (_pair: string, w: string, pw: string) => {
|
|
238
|
+
if (mirrorOf(w, known) !== pw) { unknown.push(`${w} … = ${pw} …`); return '' }
|
|
239
|
+
for (const k of known.keys()) if (firstWord(k) === w) named.add(k)
|
|
240
|
+
return ''
|
|
241
|
+
})
|
|
242
|
+
for (const m of rest.matchAll(new RegExp(`\`${bin} ([^\`]+)\``, 'g'))) {
|
|
243
|
+
const g = /^([\w-]+(?: [\w-]+)*?)(?: ([[<])([^\]>]*)[\]>])?$/.exec(m[1]!)
|
|
244
|
+
if (g == null) { unknown.push(m[1]!); continue }
|
|
245
|
+
const [, w, open, inner] = g
|
|
246
|
+
const these = [...(open !== '<' ? [w!] : []), ...(inner?.split('|') ?? []).map((s) => `${w} ${s}`)]
|
|
247
|
+
for (const p of these) (known.has(p) ? named.add(p) : unknown.push(p))
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return { named, unknown }
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** the guard of the page every session loads: every path the binary answers to named on it, no name the
|
|
254
|
+
* binary does not register, every gloss a few words. One line per breach */
|
|
255
|
+
export function namingProblems(rows: CommandRow[], text: string, bin = 'sk'): string[] {
|
|
256
|
+
const known = pathsOf(rows)
|
|
257
|
+
const { named, unknown } = namedPaths(text, known, bin)
|
|
258
|
+
// an older name runs for the callers that type it and is listed nowhere on purpose
|
|
259
|
+
const older = new Set(rows.filter((r) => r.older === true).flatMap((r) => [r.path, ...(r.aliases ?? [])]))
|
|
260
|
+
return [
|
|
261
|
+
...[...known.keys()].filter((p) => !named.has(p) && !older.has(p)).map((p) => `${bin} ${p}: registered, named nowhere on the page`),
|
|
262
|
+
...unknown.map((p) => `${bin} ${p}: named on the page, registered nowhere`),
|
|
263
|
+
...rows.filter((r) => (r.gloss?.length ?? 0) > GLOSS_MAX).map((r) => `${bin} ${r.path}: gloss over ${GLOSS_MAX} characters`),
|
|
264
|
+
]
|
|
155
265
|
}
|
|
156
266
|
|
|
157
|
-
/** the block of a page every session loads: the commands marked essential
|
|
158
|
-
* family, then every other family on one line with its owner page.
|
|
159
|
-
|
|
267
|
+
/** the block of a page every session loads: the commands marked essential with their description, then every
|
|
268
|
+
* other command of the family by name, then every other family on one line with its owner page. shipkit's
|
|
269
|
+
* page nests it under `##` and separates with ` — `, a project's essentials page is its own (`##`, `: `) */
|
|
270
|
+
export function renderEveryday(listed: CommandRow[], bin = 'sk', pages: Readonly<Record<string, string>> | null = null, form: { heading: string; sep: string } = { heading: '###', sep: ' — ' }): string {
|
|
271
|
+
const rows = listed.filter((r) => r.older !== true)
|
|
160
272
|
const out: string[] = []
|
|
161
273
|
const quiet: string[] = []
|
|
274
|
+
const paths = pathsOf(rows)
|
|
162
275
|
for (const category of [...new Set(rows.map((r) => r.category))]) {
|
|
163
276
|
const all = rows.filter((r) => r.category === category)
|
|
164
277
|
const mine = all.filter((r) => r.essential != null)
|
|
165
278
|
const page = pages?.[category] != null ? ` → ${pages[category]}` : ''
|
|
166
|
-
const rest = restOf(all, bin)
|
|
279
|
+
const rest = restOf(all, bin, paths)
|
|
167
280
|
if (mine.length === 0) { quiet.push(`- ${category}${page}: ${rest.join(', ')}`); continue }
|
|
168
|
-
out.push(`\n
|
|
169
|
-
for (const r of mine) out.push(...essentialLines(r, bin,
|
|
281
|
+
out.push(`\n${form.heading} ${category}${page}\n`)
|
|
282
|
+
for (const r of mine) out.push(...essentialLines(r, bin, form.sep))
|
|
170
283
|
if (rest.length > 0) out.push(`- more: ${rest.join(', ')}`)
|
|
171
284
|
}
|
|
172
|
-
if (quiet.length > 0) out.push(
|
|
285
|
+
if (quiet.length > 0) out.push(`\n${form.heading} The other families, every command by name\n`, ...quiet)
|
|
173
286
|
return out.join('\n').trim()
|
|
174
287
|
}
|
|
175
288
|
|
|
176
|
-
/**
|
|
177
|
-
* examples, and how to list the rest. Generated whole */
|
|
289
|
+
/** a project CLI's page every session loads, generated whole: the everyday block of shipkit's own page */
|
|
178
290
|
export function renderEssentials(rows: CommandRow[], bin: string, command: string): string {
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
const quiet: string[] = []
|
|
182
|
-
for (const category of [...new Set(rows.map((r) => r.category))]) {
|
|
183
|
-
const all = rows.filter((r) => r.category === category)
|
|
184
|
-
const rest = [...new Set(all.map(first))]
|
|
185
|
-
.map((w) => [w, all.filter((r) => first(r) === w && r.essential == null).length] as const)
|
|
186
|
-
.filter(([, n]) => n > 0)
|
|
187
|
-
.map(([w, n]) => `\`${bin} ${w}${all.some((r) => r.path === w) ? ' --help' : ''}\` (${n} command${n === 1 ? '' : 's'})`)
|
|
188
|
-
const mine = all.filter((r) => r.essential != null)
|
|
189
|
-
if (mine.length === 0) { quiet.push(...rest); continue }
|
|
190
|
-
out.push('', `## ${category}${rest.length > 0 ? ` (more: ${rest.join(', ')})` : ''}`, '')
|
|
191
|
-
for (const r of mine) out.push(...essentialLines(r, bin, ': '))
|
|
192
|
-
}
|
|
193
|
-
if (quiet.length > 0) out.push('', `## The other families: ${quiet.join(', ')}`)
|
|
194
|
-
return `${out.join('\n')}\n`
|
|
291
|
+
const head = `# ${bin}: the everyday commands\n\nGenerated by \`${command}\`: the commands marked \`essential\` described, every other one named. All of them described: \`${bin}\`; one with its flags: \`${bin} <command> --help\`. \`${bin} <words>\` runs as \`bun run cli <words>\` from the repo root, and as \`${bin}\` anywhere once \`bun link\` ran there.`
|
|
292
|
+
return `${head}\n\n${renderEveryday(rows, bin, null, { heading: '##', sep: ': ' })}\n`
|
|
195
293
|
}
|
|
196
294
|
|
|
197
295
|
/** a family with no owner page, and a page for a family no command has: one line each */
|
|
@@ -268,7 +366,7 @@ export class CommandsCommand extends Command {
|
|
|
268
366
|
out = Option.String('--out', { description: 'host file carrying the <bin>:commands markers. The block between them is rewritten' })
|
|
269
367
|
check = Option.Boolean('--check', false, { description: 'with --out or --essentials: exit 1 if a page is stale, write nothing' })
|
|
270
368
|
compact = Option.Boolean('--compact', false, { description: 'one line per command: no flags, no examples (they are `<bin> <command> --help`)' })
|
|
271
|
-
everyday = Option.Boolean('--everyday', false, { description: 'the
|
|
369
|
+
everyday = Option.Boolean('--everyday', false, { description: 'the form of a page every session loads: the commands marked essential described, every other command named' })
|
|
272
370
|
essentials = Option.String('--essentials', { description: 'the everyday commands page, rewritten whole from the commands marked essential' })
|
|
273
371
|
|
|
274
372
|
async execute(): Promise<number> {
|
|
@@ -297,6 +395,11 @@ export class CommandsCommand extends Command {
|
|
|
297
395
|
for (const b of bad) write(`FAIL: ${b}\n`)
|
|
298
396
|
if (bad.length > 0) { write(' fix: one row per family in src/cli/family-pages.ts, the wiki page that owns it\n'); return 1 }
|
|
299
397
|
}
|
|
398
|
+
if (this.out != null && this.everyday) {
|
|
399
|
+
const bad = namingProblems(rows, render(), bin)
|
|
400
|
+
for (const b of bad) write(`FAIL: ${b}\n`)
|
|
401
|
+
if (bad.length > 0) { write(' fix: renderEveryday in src/cli/cmd_Commands.ts names every registered command\n'); return 1 }
|
|
402
|
+
}
|
|
300
403
|
if ((this.constructor as typeof CommandsCommand).shapeRule) {
|
|
301
404
|
const bad = shapeProblems(rows, bin)
|
|
302
405
|
for (const b of bad) write(`FAIL: ${b}\n`)
|
|
@@ -309,6 +412,9 @@ export class CommandsCommand extends Command {
|
|
|
309
412
|
if (this.essentials != null) {
|
|
310
413
|
const cmd = `${bin} commands${this.out != null ? ` --out ${this.out}` : ''} --essentials ${this.essentials}`
|
|
311
414
|
const text = renderEssentials(rows, bin, cmd)
|
|
415
|
+
const bad = namingProblems(rows, text, bin)
|
|
416
|
+
for (const b of bad) write(`FAIL: ${b}\n`)
|
|
417
|
+
if (bad.length > 0) { write(' fix: renderEveryday in rvlib-shipkit src/cli/cmd_Commands.ts names every registered command\n'); return 1 }
|
|
312
418
|
if (existsSync(this.essentials) && readFileSync(this.essentials, 'utf8') === text) write(`ok: ${this.essentials} current\n`)
|
|
313
419
|
else if (this.check) { write(`FAIL: ${this.essentials} is STALE — the essential commands moved\n fix: ${cmd}\n`); code = 1 }
|
|
314
420
|
else { writeFileSync(this.essentials, text); write(`ok: ${this.essentials} rewritten\n`) }
|
|
@@ -323,7 +429,7 @@ export class CommandsCommand extends Command {
|
|
|
323
429
|
const shown = this.everyday ? `${rows.filter((r) => r.essential != null).length} everyday commands of ${rows.length}` : `${rows.length} commands`
|
|
324
430
|
if (next === host) { write(`ok: ${this.out} command index current (${shown})\n`); return code }
|
|
325
431
|
if (this.check) {
|
|
326
|
-
write(`FAIL: ${this.out} command index is STALE — ${this.everyday ? 'the everyday commands, a description or a
|
|
432
|
+
write(`FAIL: ${this.out} command index is STALE — ${this.everyday ? 'the everyday commands, a description or a command name moved in the binary' : 'the binary registers commands the page does not list'}\n`)
|
|
327
433
|
write(` fix: ${bin === 'sk' ? 'shipkit' : bin} commands${this.everyday ? ' --everyday' : this.compact ? ' --compact' : ''} --out ${this.out}\n`)
|
|
328
434
|
return 1
|
|
329
435
|
}
|
package/src/cli/cmd_Contracts.ts
CHANGED
|
@@ -42,9 +42,10 @@ export async function daemonDeclared(port = Number(process.env.SHIPKIT_DAEMON_PO
|
|
|
42
42
|
const dot = (r: ActivityRow): string => {
|
|
43
43
|
const c = r.status
|
|
44
44
|
if (c == null) return '·'
|
|
45
|
-
|
|
46
|
-
if (c.state === '
|
|
47
|
-
|
|
45
|
+
const held = c.hands.length > 0 ? `, ${c.hands.length} waiting on the owner` : ''
|
|
46
|
+
if (c.state === 'red') return `● ${c.reds.length} red${held}`
|
|
47
|
+
if (c.state === 'orange') return `● ${c.warns.length} warn${held}`
|
|
48
|
+
return `● green${held}`
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
const commitLine = (c: ActivityCommit, now: number, old: boolean): string =>
|
|
@@ -60,7 +61,7 @@ export function renderActivity(a: ActivityAnswer, cap: number): string[] {
|
|
|
60
61
|
const branch = r.branch ?? (r.detached == null ? '' : `detached ${r.detached}`)
|
|
61
62
|
out.push(`${r.name} ${dot(r)} ${branch} (${upstreamWords(r)})`)
|
|
62
63
|
for (const c of r.failing ?? []) {
|
|
63
|
-
out.push(` ${c.status === 'fail' ? '✗' : '!'} ${c.id}${c.at == null ? '' : ` (${ageShort(c.at, a.now)})`}`)
|
|
64
|
+
out.push(` ${c.status === 'fail' ? '✗' : c.held === true ? '🤝' : '!'} ${c.id}${c.at == null ? '' : ` (${ageShort(c.at, a.now)})`}`)
|
|
64
65
|
for (const l of c.lines) out.push(` ${l}`)
|
|
65
66
|
}
|
|
66
67
|
if (r.error != null) out.push(` git failed: ${r.error}`)
|