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
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// `sk thread kinds`: the kinds a thread's address may name in this repo, the repo's own then the house's, each with its
|
|
2
|
+
// key's shape and what it declares (wiki tools/shipkit/threads-how-it-fits.md, Kinds). The one place an agent reads
|
|
3
|
+
// which word to type, so one subject never becomes two threads under two words
|
|
4
|
+
import { Command, Option } from 'clipanion'
|
|
5
|
+
|
|
6
|
+
export class ThreadKindsCommand extends Command {
|
|
7
|
+
static override paths = [['thread', 'kinds']]
|
|
8
|
+
static override usage = Command.Usage({
|
|
9
|
+
category: 'Review',
|
|
10
|
+
description: "the kinds an address may name here, each with its key's shape, the repo's own first",
|
|
11
|
+
details: 'An address is <kind>:<key>. The repo declares its own kinds in its review({ kinds }) unit; the house kinds (screen, asset, file, page…) exist in every repo. An agent writes no other word: post, ask, propose and attach refuse it. --values lists the kinds a field of a proposed change holds (--type). Page: wiki tools/shipkit/threads-how-it-fits.md, Kinds',
|
|
12
|
+
examples: [
|
|
13
|
+
['which word for my object', 'sk thread kinds'],
|
|
14
|
+
['as json', 'sk thread kinds --json'],
|
|
15
|
+
['the house catalog, for the page every session loads', 'sk thread kinds --out wiki/tools/shipkit/thread-kinds.md'],
|
|
16
|
+
['every object with its icon, the page read on demand', 'sk thread kinds --objects wiki/tools/shipkit/thread-objects.md'],
|
|
17
|
+
],
|
|
18
|
+
})
|
|
19
|
+
json = Option.Boolean('--json', false, { description: 'one json object: the address kinds and the value kinds' })
|
|
20
|
+
values = Option.Boolean('--values', false, { description: 'the value kinds a field of a proposed change holds' })
|
|
21
|
+
out = Option.String('--out', { description: 'a page with the shipkit:thread-kinds markers: the house catalog (every kind, its widget, one command) is rewritten between them' })
|
|
22
|
+
objects = Option.String('--objects', { description: 'a page with the shipkit:thread-objects markers: every kind, value kind and message type as a table with its icon in its colour, rewritten between them; the icons as SVG files in references/<page name>/ beside it' })
|
|
23
|
+
check = Option.Boolean('--check', false, { description: 'with --out or --objects: exit 1 when a page or an icon is stale or a kind has no widget, write nothing' })
|
|
24
|
+
|
|
25
|
+
async execute(): Promise<number> {
|
|
26
|
+
if (this.out !== undefined || this.objects !== undefined) {
|
|
27
|
+
const a = this.out === undefined ? 0 : await this.catalog(this.out)
|
|
28
|
+
const b = this.objects === undefined ? 0 : await this.objectsPage(this.objects)
|
|
29
|
+
return Math.max(a, b)
|
|
30
|
+
}
|
|
31
|
+
if (this.check) {
|
|
32
|
+
this.context.stderr.write('FAIL: --check compares a page with the registry: name it with --out <page>\n')
|
|
33
|
+
return 1
|
|
34
|
+
}
|
|
35
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
36
|
+
const { openReview } = await import('../review/project.ts')
|
|
37
|
+
const { specOf } = await import('../review/store.ts')
|
|
38
|
+
const { addressKinds, DIFF_TYPES, HOUSE_KINDS, kindOfValue } = await import('../review/kinds.ts')
|
|
39
|
+
let dir: string
|
|
40
|
+
try {
|
|
41
|
+
dir = (await openReview(findRepoRoot(process.cwd()))).dir
|
|
42
|
+
} catch (e) {
|
|
43
|
+
this.context.stderr.write(`FAIL: review: ${e instanceof Error ? e.message : String(e)}\n`)
|
|
44
|
+
return 1
|
|
45
|
+
}
|
|
46
|
+
const spec = specOf(dir)
|
|
47
|
+
const kinds = addressKinds(spec).map((k) => {
|
|
48
|
+
const d = spec.kinds[k.word] ?? HOUSE_KINDS[k.word]
|
|
49
|
+
const has = [d?.view ? `view ${d.view.page}` : '', d?.diff?.page ? `diff page ${d.diff.page}` : d?.diff?.draw ? `diff ${d.diff.draw}` : '', d?.questions ? `questions ${Object.keys(d.questions).join(' ')}` : '', d?.actions ? `actions ${Object.keys(d.actions).join(' ')}` : '']
|
|
50
|
+
return { ...k, has: has.filter(Boolean) }
|
|
51
|
+
})
|
|
52
|
+
const values = DIFF_TYPES.map((t) => ({ word: t, label: kindOfValue(t).label }))
|
|
53
|
+
if (this.json) {
|
|
54
|
+
this.context.stdout.write(`${JSON.stringify({ kinds, values })}\n`)
|
|
55
|
+
return 0
|
|
56
|
+
}
|
|
57
|
+
const out: string[] = []
|
|
58
|
+
if (this.values) out.push(...values.map((v) => `${v.word.padEnd(8)} ${v.label}`))
|
|
59
|
+
else {
|
|
60
|
+
const w = Math.max(...kinds.map((k) => `${k.word}:${k.address}`.length))
|
|
61
|
+
for (const own of [true, false]) {
|
|
62
|
+
const rows = kinds.filter((k) => k.own === own)
|
|
63
|
+
if (rows.length === 0) continue
|
|
64
|
+
out.push(own ? "this repo's kinds" : 'house kinds')
|
|
65
|
+
for (const k of rows) out.push(` ${`${k.word}:${k.address}`.padEnd(w)} ${k.label}${k.has.length ? ` (${k.has.join(', ')})` : ''}`)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
this.context.stdout.write(`${out.join('\n')}\n`)
|
|
69
|
+
return 0
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** the house catalog into its page: refused while a kind has no widget */
|
|
73
|
+
private async catalog(page: string): Promise<number> {
|
|
74
|
+
const { existsSync, readFileSync, writeFileSync } = await import('node:fs')
|
|
75
|
+
const { BEGIN, END, catalogProblems, renderCatalog } = await import('../review/kind-catalog.ts')
|
|
76
|
+
const { spliceMarkedBlock } = await import('../core/doc-block.ts')
|
|
77
|
+
const say = (s: string): void => void this.context.stdout.write(`${s}\n`)
|
|
78
|
+
const problems = catalogProblems()
|
|
79
|
+
if (problems.length > 0) {
|
|
80
|
+
say(`FAIL: ${problems.length} kind(s) with no widget, in review/kinds.ts or review/kind-catalog.ts:`)
|
|
81
|
+
for (const p of problems) say(` ${p}`)
|
|
82
|
+
return 1
|
|
83
|
+
}
|
|
84
|
+
if (!existsSync(page)) {
|
|
85
|
+
say(`FAIL: ${page} does not exist`)
|
|
86
|
+
return 1
|
|
87
|
+
}
|
|
88
|
+
const host = readFileSync(page, 'utf8')
|
|
89
|
+
const next = spliceMarkedBlock(host, renderCatalog(), BEGIN, END)
|
|
90
|
+
if (next === null) {
|
|
91
|
+
say(`FAIL: ${page} has no ${BEGIN} / ${END} markers`)
|
|
92
|
+
return 1
|
|
93
|
+
}
|
|
94
|
+
if (next === host) {
|
|
95
|
+
say(`ok: ${page} thread kinds current`)
|
|
96
|
+
return 0
|
|
97
|
+
}
|
|
98
|
+
if (this.check) {
|
|
99
|
+
say(`FAIL: ${page} is STALE: a kind, its widget or its command moved in the registry\n fix: sk thread kinds --out ${page}`)
|
|
100
|
+
return 1
|
|
101
|
+
}
|
|
102
|
+
writeFileSync(page, next)
|
|
103
|
+
say(`ok: ${page} thread kinds rewritten`)
|
|
104
|
+
return 0
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** the objects page and its icons: the table between its markers, one SVG a kind, value kind or message type in the
|
|
108
|
+
* folder named like the page; an icon no row names any more is removed */
|
|
109
|
+
private async objectsPage(page: string): Promise<number> {
|
|
110
|
+
const { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } = await import('node:fs')
|
|
111
|
+
const { basename, dirname, join } = await import('node:path')
|
|
112
|
+
const { OBJECTS_BEGIN, OBJECTS_END, renderObjects } = await import('../review/kind-catalog.ts')
|
|
113
|
+
const { spliceMarkedBlock } = await import('../core/doc-block.ts')
|
|
114
|
+
const say = (s: string): void => void this.context.stdout.write(`${s}\n`)
|
|
115
|
+
if (!existsSync(page)) {
|
|
116
|
+
say(`FAIL: ${page} does not exist`)
|
|
117
|
+
return 1
|
|
118
|
+
}
|
|
119
|
+
const name = basename(page).replace(/\.md$/, '')
|
|
120
|
+
// a topic folder holds its pages and its references/ (RV008): the icons are references of the page
|
|
121
|
+
const dir = join(dirname(page), 'references', name)
|
|
122
|
+
const { md, files } = renderObjects(`references/${name}`)
|
|
123
|
+
const host = readFileSync(page, 'utf8')
|
|
124
|
+
const next = spliceMarkedBlock(host, md, OBJECTS_BEGIN, OBJECTS_END)
|
|
125
|
+
if (next === null) {
|
|
126
|
+
say(`FAIL: ${page} has no ${OBJECTS_BEGIN} / ${OBJECTS_END} markers`)
|
|
127
|
+
return 1
|
|
128
|
+
}
|
|
129
|
+
const had = existsSync(dir) ? readdirSync(dir).filter((f) => f.endsWith('.svg')) : []
|
|
130
|
+
const stale = [...Object.entries(files).filter(([f, svg]) => !had.includes(f) || readFileSync(join(dir, f), 'utf8') !== svg).map(([f]) => f), ...had.filter((f) => files[f] === undefined)]
|
|
131
|
+
if (next === host && stale.length === 0) {
|
|
132
|
+
say(`ok: ${page} thread objects current`)
|
|
133
|
+
return 0
|
|
134
|
+
}
|
|
135
|
+
if (this.check) {
|
|
136
|
+
say(`FAIL: ${page} is STALE: ${next === host ? '' : 'its table, '}${stale.length > 0 ? `${stale.length} icon(s) in ${dir}/` : ''} moved in the registry\n fix: sk thread kinds --objects ${page}`)
|
|
137
|
+
return 1
|
|
138
|
+
}
|
|
139
|
+
mkdirSync(dir, { recursive: true })
|
|
140
|
+
for (const f of had) if (files[f] === undefined) rmSync(join(dir, f))
|
|
141
|
+
for (const [f, svg] of Object.entries(files)) writeFileSync(join(dir, f), svg)
|
|
142
|
+
if (next !== host) writeFileSync(page, next)
|
|
143
|
+
say(`ok: ${page} thread objects rewritten, ${Object.keys(files).length} icons in ${dir}/`)
|
|
144
|
+
return 0
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// `sk thread reflect` and `sk thread fold-reflections`: a reflection is an object, never a thread of its own (wiki
|
|
2
|
+
// tools/shipkit/threads-how-it-fits.md, The model). The first writes one and links it into the thread the agent holds,
|
|
3
|
+
// in one call; the second folds the reflection threads the machine opened before, re-runnable
|
|
4
|
+
import { Command, Option } from 'clipanion'
|
|
5
|
+
|
|
6
|
+
export class ThreadReflectCommand extends Command {
|
|
7
|
+
static override paths = [['thread', 'reflect']]
|
|
8
|
+
static override usage = Command.Usage({
|
|
9
|
+
category: 'Review',
|
|
10
|
+
description: 'log friction with the house system: a reflection file, linked into the thread you hold',
|
|
11
|
+
details:
|
|
12
|
+
"Writes .shipkit/reflections/<YYYYMMDD>-<slug>.md (the slug from the title; never over an existing file) and links reflection:<repo>/<file> into the thread you hold in this repo (your lane's by SK_AGENT, else your session's), or the one --in names. He sees it there as a box with accept, ask to rework, discard, and on the repo's reflections page. Holding none, it shows on that page alone. --body - reads stdin. A body with no heading gets the title as its heading. Page: wiki tools/shipkit/threads-how-it-fits.md, The model",
|
|
13
|
+
examples: [
|
|
14
|
+
['a note from a file', 'sk thread reflect "the guard refuses a monitor" --body note.md'],
|
|
15
|
+
['from stdin, into a named thread', 'sk thread reflect "the gate cries wolf" --body - --in page:threads/richer'],
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
title = Option.String()
|
|
19
|
+
body = Option.String('--body', { required: true, description: 'the markdown: a file, or - for stdin' })
|
|
20
|
+
into = Option.String('--in', { description: 'the thread to link it into, by its address or an item id (else the one you hold)' })
|
|
21
|
+
|
|
22
|
+
async execute(): Promise<number> {
|
|
23
|
+
const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
24
|
+
try {
|
|
25
|
+
const { readFileSync } = await import('fs')
|
|
26
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
27
|
+
const { loadRepoConfig } = await import('../repo-config.ts')
|
|
28
|
+
const { writeReflection } = await import('../review/reflection-object.ts')
|
|
29
|
+
const root = findRepoRoot(process.cwd())
|
|
30
|
+
const repo = (await loadRepoConfig(root)).name
|
|
31
|
+
const body = this.body === '-' ? await new Response(Bun.stdin.stream()).text() : readFileSync(this.body, 'utf8')
|
|
32
|
+
let into: string | undefined
|
|
33
|
+
if (this.into !== undefined) {
|
|
34
|
+
const { readAll, specOf, storeDir } = await import('../review/store.ts')
|
|
35
|
+
const { threadOfAddress } = await import('../review/threads.ts')
|
|
36
|
+
const dir = storeDir(root)
|
|
37
|
+
const t = threadOfAddress(this.into, readAll(dir).items, specOf(dir))
|
|
38
|
+
into = t?.head.item.id ?? this.into
|
|
39
|
+
}
|
|
40
|
+
const w = writeReflection(root, repo, { title: this.title, body, ...(into !== undefined ? { into } : {}) })
|
|
41
|
+
out(`ok: .shipkit/reflections/${w.file} written, ${w.address}`)
|
|
42
|
+
out(w.linked === null ? 'note: you hold no thread here, so it shows on the reflections page alone (--in <thread> links it)' : `ok: linked into ${w.linked}: the owner sees it there with accept, ask to rework, discard`)
|
|
43
|
+
return 0
|
|
44
|
+
} catch (e) {
|
|
45
|
+
this.context.stderr.write(`FAIL: reflect: ${(e as Error).message}\n`)
|
|
46
|
+
return 1
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class ThreadFoldReflectionsCommand extends Command {
|
|
52
|
+
static override paths = [['thread', 'fold-reflections']]
|
|
53
|
+
static override usage = Command.Usage({
|
|
54
|
+
category: 'Review',
|
|
55
|
+
description: 'the reflection threads the machine opened, folded into their objects; a look unless --go',
|
|
56
|
+
details:
|
|
57
|
+
"A reflection is an object read from its file; a thread opens on it only when someone discusses it. Each reflection:<repo>/<file> thread with none of the owner's words or acts (a read mark is no act) gets a machine fixed, « folded into its object »: done, kept, never deleted. One where the owner spoke or acted stays, referring to the object. Re-runnable: a folded one is counted, never written again. Run sk backup and sk backup pin first. Page: wiki tools/shipkit/threads-how-it-fits.md, The model",
|
|
58
|
+
examples: [
|
|
59
|
+
['what it would fold in every house store', 'sk thread fold-reflections --all'],
|
|
60
|
+
['fold them', 'sk thread fold-reflections --all --go'],
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
go = Option.Boolean('--go', false, { description: 'write the folds' })
|
|
64
|
+
all = Option.Boolean('--all', false, { description: 'every house store of this machine, not only this repo' })
|
|
65
|
+
|
|
66
|
+
async execute(): Promise<number> {
|
|
67
|
+
const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
68
|
+
const { homedir } = await import('os')
|
|
69
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
70
|
+
const { houseRepos } = await import('../serve/project-gutter.ts')
|
|
71
|
+
const { foldReflectionThreads } = await import('../review/reflection-object.ts')
|
|
72
|
+
const root = findRepoRoot(process.cwd())
|
|
73
|
+
const stores = this.all ? houseRepos(root, homedir()).repos.map((r) => ({ name: r.name, path: r.path })) : [{ name: root.split('/').at(-1) ?? root, path: root }]
|
|
74
|
+
const total = { threads: 0, folded: 0, kept: 0, already: 0 }
|
|
75
|
+
for (const s of stores) {
|
|
76
|
+
const f = await foldReflectionThreads(s.path, { go: this.go })
|
|
77
|
+
for (const k of Object.keys(total) as (keyof typeof total)[]) total[k] += f[k]
|
|
78
|
+
if (f.threads > 0) out(`${s.name}: ${f.threads} reflection threads: ${f.folded} ${this.go ? 'folded' : 'to fold'}, ${f.kept} kept (the owner's words or acts), ${f.already} folded already`)
|
|
79
|
+
}
|
|
80
|
+
out(`${this.go ? 'ok' : 'look'}: ${stores.length} stores, ${total.threads} reflection threads: ${total.folded} ${this.go ? 'folded' : 'to fold (--go)'}, ${total.kept} kept, ${total.already} folded already`)
|
|
81
|
+
return 0
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// `sk thread sync-needs`: the checks' threads of every house repo made to match its hub's needs now,
|
|
2
|
+
// the same pass the hub runs with its ping (wiki tools/shipkit/threads-how-it-fits.md, The model). Re-runnable: what
|
|
3
|
+
// already stands writes nothing. It reads the needs from the home, so a repo whose hub is down is named and skipped
|
|
4
|
+
import { Command, Option } from 'clipanion'
|
|
5
|
+
|
|
6
|
+
export class ThreadSyncNeedsCommand extends Command {
|
|
7
|
+
static override paths = [['thread', 'sync-needs']]
|
|
8
|
+
static override usage = Command.Usage({
|
|
9
|
+
category: 'Review',
|
|
10
|
+
description: "the checks' threads of every house repo, made to match its hub's needs now",
|
|
11
|
+
details: "One thread per check that fails or warns (check:<repo>/<id>), written by the machine: nobody holds it, it is an agent's move, waiting for an agent until one takes it, and a need gone writes fixed. A reflection opens no thread: it is an object its repo's reflections page lists, and a thread opened on one is fixed once its file is gone. The hub runs the same pass once a minute; this runs it now, re-runnable, and prints each repo's threads by who acts now before and after. Page: wiki tools/shipkit/threads-how-it-fits.md, The model",
|
|
12
|
+
examples: [['every house repo', 'sk thread sync-needs'], ['one repo', 'sk thread sync-needs --repo orchard']],
|
|
13
|
+
})
|
|
14
|
+
repo = Option.Array('--repo', [], { description: 'only these repos (else every repo the home serves)' })
|
|
15
|
+
|
|
16
|
+
async execute(): Promise<number> {
|
|
17
|
+
const { homePort } = await import('../home/home-paths.ts')
|
|
18
|
+
const { syncNeedThreads } = await import('../review/need-threads.ts')
|
|
19
|
+
const { NEED_KINDS } = await import('../review/need-address.ts')
|
|
20
|
+
const { readAll, storeDir } = await import('../review/store.ts')
|
|
21
|
+
const { orderedThreads, turnOf } = await import('../review/threads.ts')
|
|
22
|
+
const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
23
|
+
const home = `http://127.0.0.1:${homePort()}`
|
|
24
|
+
const get = async <T>(path: string): Promise<T> => {
|
|
25
|
+
const r = await fetch(`${home}${path}`, { signal: AbortSignal.timeout(60_000) })
|
|
26
|
+
if (!r.ok) throw new Error(`${path}: ${r.status} ${(await r.text()).slice(0, 120)}`)
|
|
27
|
+
return (await r.json()) as T
|
|
28
|
+
}
|
|
29
|
+
let repos: string[]
|
|
30
|
+
try {
|
|
31
|
+
repos = (await get<{ repos: string[] }>('/api/home/repos.json')).repos
|
|
32
|
+
} catch (e) {
|
|
33
|
+
this.context.stderr.write(`FAIL: the home does not answer at ${home} (${(e as Error).message}): sk pm status\n`)
|
|
34
|
+
return 1
|
|
35
|
+
}
|
|
36
|
+
if (this.repo.length > 0) repos = repos.filter((r) => this.repo.includes(r))
|
|
37
|
+
const kinds = Object.values(NEED_KINDS).map((k) => `${k}:`)
|
|
38
|
+
const turns = (root: string): string => {
|
|
39
|
+
const by: Record<string, number> = {}
|
|
40
|
+
for (const t of orderedThreads(readAll(storeDir(root)).items)) if (kinds.some((k) => t.head.item.on?.startsWith(k))) by[turnOf(t)] = (by[turnOf(t)] ?? 0) + 1
|
|
41
|
+
return Object.entries(by).map(([k, n]) => `${n} ${k}`).join(', ') || 'none'
|
|
42
|
+
}
|
|
43
|
+
let failed = 0
|
|
44
|
+
const total = { opened: 0, broken: 0, fixed: 0, same: 0 }
|
|
45
|
+
for (const repo of repos) {
|
|
46
|
+
const base = `/r/${encodeURIComponent(repo)}`
|
|
47
|
+
try {
|
|
48
|
+
const { root } = await get<{ root: string }>(`${base}/hub.json`)
|
|
49
|
+
const { needs } = await get<{ needs: Parameters<typeof syncNeedThreads>[2] }>(`${base}/api/needs.json`)
|
|
50
|
+
const before = turns(root)
|
|
51
|
+
const s = await syncNeedThreads(root, repo, needs)
|
|
52
|
+
for (const k of Object.keys(total) as (keyof typeof total)[]) total[k] += s[k]
|
|
53
|
+
out(`ok: ${repo}: ${s.opened} opened, ${s.broken} broken again, ${s.fixed} fixed, ${s.same} as they were; threads before: ${before}; after: ${turns(root)}`)
|
|
54
|
+
} catch (e) {
|
|
55
|
+
failed++
|
|
56
|
+
out(`WARN ${repo}: not synced: ${(e as Error).message}`)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
out(`${failed === 0 ? 'ok' : 'WARN'}: ${repos.length - failed} of ${repos.length} repos: ${total.opened} opened, ${total.broken} broken again, ${total.fixed} fixed, ${total.same} as they were`)
|
|
60
|
+
return failed === 0 ? 0 : 1
|
|
61
|
+
}
|
|
62
|
+
}
|
package/src/cli/cmd_Time.ts
CHANGED
|
@@ -15,10 +15,11 @@ export class TimeCommand extends Command {
|
|
|
15
15
|
category: 'Health',
|
|
16
16
|
description: 'where agent time went in a repo, every account: waits, slow and failing commands, feedback',
|
|
17
17
|
details: [
|
|
18
|
-
'Reads every Claude Code transcript under every config root (~/.claude, ~/.claude-<name>), sub-agent runs included, through an index
|
|
18
|
+
'Reads every Claude Code transcript under every config root (~/.claude, ~/.claude-<name>), sub-agent runs included, through an index, the time_ tables of the machine db (sk db).',
|
|
19
19
|
'The first run builds the index (niced, resumable, progress on stderr); later runs read only what changed. The index keeps sessions Claude Code has pruned.',
|
|
20
|
-
'
|
|
21
|
-
'
|
|
20
|
+
'A report is kept 5 minutes per set of repos and window, so asking again answers at once and says the time it was made; --fresh reads again, and any change of the tool drops every kept report.',
|
|
21
|
+
'Views: summary (default), days, commands, tools, families, refused, limits, slow, fails, feedback, sessions, turns, hooks. A Bash command is grouped by its shape (`git commit`, `bun test <file>`, `sk ci --only lint`).',
|
|
22
|
+
'Hooks: each hook command with its event, the runs the harness timed (median, p90, worst, total) and the calls its matcher applies to. The harness times every hook of a turn end (Stop). It times a hook on a tool call or a prompt only when the hook prints something, so a silent one is missing there.',
|
|
22
23
|
'Turns: every call costs a model turn before it, so the summary gives the model time before each call, the share of single read calls and the share sent in parallel, for the main sessions and the sub-agents; `turns` lists the runs and the read shapes by the model time they cost.',
|
|
23
24
|
'Wall time is cut once per moment, and the buckets add up to the wall: tools in flight, a sub-agent in flight, waiting on you (an idle gap past 30 minutes is left out), stopped until a task notification woke it (background wait), stopped with nothing recorded that woke it (unknown), else the agent was in its turn (model).',
|
|
24
25
|
'A background command (run_in_background, or moved there at its timeout) is timed from its start to its task notification, its row marked (bg); a run with no notification is counted as having no end, never as zero.',
|
|
@@ -32,7 +33,11 @@ export class TimeCommand extends Command {
|
|
|
32
33
|
['what the hooks cost, 30 days', 'sk time hooks --since 30d'],
|
|
33
34
|
['two repos, every recorded session', 'sk time ~/dev/game ~/dev/site --since all'],
|
|
34
35
|
['every repo on the machine', 'sk time --all'],
|
|
36
|
+
['the calls a hook, the classifier or a rule refused, and why', 'sk time refused'],
|
|
37
|
+
['the wall of each day', 'sk time days --since 30d'],
|
|
38
|
+
['the commands that reached their time limit', 'sk time limits'],
|
|
35
39
|
['for a script', 'sk time --json'],
|
|
40
|
+
['the figures of this second, not a kept answer', 'sk time --fresh'],
|
|
36
41
|
],
|
|
37
42
|
})
|
|
38
43
|
|
|
@@ -41,6 +46,7 @@ export class TimeCommand extends Command {
|
|
|
41
46
|
since = Option.String('--since', '7d', { description: '30m, 2h, 7d, a date, or all' })
|
|
42
47
|
top = Option.String('--top', '20', { description: 'rows per list in a sub view' })
|
|
43
48
|
json = Option.Boolean('--json', false, { description: 'the whole report as json' })
|
|
49
|
+
fresh = Option.Boolean('--fresh', false, { description: 'read the index again now: an answer is kept 5 minutes' })
|
|
44
50
|
|
|
45
51
|
async execute(): Promise<number> {
|
|
46
52
|
const { VIEWS, render } = await import('../agent-time/render.ts')
|
|
@@ -67,7 +73,7 @@ export class TimeCommand extends Command {
|
|
|
67
73
|
return 2
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
const { indexTranscripts, listTranscripts, loadWindow, markGone, openIndex, repoOfProject, agentTimeDbPath } = await import('../agent-time/store.ts')
|
|
76
|
+
const { indexTranscripts, listTranscripts, loadWindow, markGone, openIndex, repoOfProject, agentTimeDbPath, timeReportsDir } = await import('../agent-time/store.ts')
|
|
71
77
|
const { discoverConfigRoots, projectSlug } = await import('../reflect/prompt-corpus.ts')
|
|
72
78
|
const { buildReport } = await import('../agent-time/report.ts')
|
|
73
79
|
const { loadMasker } = await import('../agent-time/mask.ts')
|
|
@@ -78,8 +84,27 @@ export class TimeCommand extends Command {
|
|
|
78
84
|
const repos = repoArgs.length > 0 ? repoArgs.map((r) => resolve(r)) : [here == null ? process.cwd() : dirname(here.commonDir)]
|
|
79
85
|
const slugs = repos.map(projectSlug)
|
|
80
86
|
const keep = this.all ? () => true : (p: string) => slugs.some((s) => p === s || p.startsWith(`${s}--claude-worktrees-`))
|
|
87
|
+
// an answer made by this same code in the last minutes is the answer: the query and the sums take a second or more
|
|
88
|
+
const { readKept, reportKey, writeKept } = await import('../agent-time/report-cache.ts')
|
|
89
|
+
const cacheDir = timeReportsDir()
|
|
90
|
+
const key = reportKey({ all: this.all, repos, since: this.since })
|
|
91
|
+
const kept = this.fresh ? null : readKept(cacheDir, key, now)
|
|
92
|
+
if (kept != null) {
|
|
93
|
+
if (this.json) this.context.stdout.write(`${JSON.stringify(kept.report)}\n`)
|
|
94
|
+
else this.context.stdout.write(`${render(kept.report, view, top)}\nas of ${new Date(kept.at).toTimeString().slice(0, 5)}: an answer is kept 5 minutes, --fresh reads again\n`)
|
|
95
|
+
return 0
|
|
96
|
+
}
|
|
81
97
|
const roots = discoverConfigRoots()
|
|
82
|
-
|
|
98
|
+
let db: ReturnType<typeof openIndex>
|
|
99
|
+
try {
|
|
100
|
+
db = openIndex()
|
|
101
|
+
} catch (e) {
|
|
102
|
+
// a fold, a way back or a repair at work ends by itself: one line and the exit code of a wait, no stack
|
|
103
|
+
const { StoreRefused, WAIT_EXIT } = await import('../core/machine-db.ts')
|
|
104
|
+
if (!(e instanceof StoreRefused)) throw e
|
|
105
|
+
this.context.stderr.write(`FAIL: ${e.message}\n`)
|
|
106
|
+
return e.wait ? WAIT_EXIT : 1
|
|
107
|
+
}
|
|
83
108
|
try {
|
|
84
109
|
const files = listTranscripts(roots, keep)
|
|
85
110
|
const pending = files.length
|
|
@@ -115,6 +140,7 @@ export class TimeCommand extends Command {
|
|
|
115
140
|
// the matcher each hook declares today: the calls it applies to
|
|
116
141
|
const hookMatchers = new Map([...userHooks(), ...repos.flatMap((r) => repoHooks(r).hooks)].map((h) => [hookMatcherKey(h.event, h.command), h.matcher]))
|
|
117
142
|
const report = buildReport(loaded, { repos: labels, from, to: now, repoOf: (p) => repoOfProject(p), hookMatchers }, loadMasker(repos[0] ?? null))
|
|
143
|
+
writeKept(cacheDir, key, report, now)
|
|
118
144
|
if (this.json) this.context.stdout.write(`${JSON.stringify(report)}\n`)
|
|
119
145
|
else this.context.stdout.write(render(report, view, top))
|
|
120
146
|
if (!tty) err.write(indexed)
|
|
@@ -124,3 +150,48 @@ export class TimeCommand extends Command {
|
|
|
124
150
|
}
|
|
125
151
|
}
|
|
126
152
|
}
|
|
153
|
+
|
|
154
|
+
export class TimeDietCommand extends Command {
|
|
155
|
+
static override paths = [['time', 'diet']]
|
|
156
|
+
|
|
157
|
+
static override usage = Command.Usage({
|
|
158
|
+
category: 'Health',
|
|
159
|
+
description: "the agent time index's diet on this machine: on, off, or where it stands with what it would drop",
|
|
160
|
+
details: "Its switch `time-diet` (off by default, never set from afar). On, the agent time job drops the command text of an ordinary call older than 7 days, in steps, and keeps every text `sk time` shows (a failed, refused, slow, open or script call). A dropped text never comes back: Claude Code prunes the transcripts.",
|
|
161
|
+
examples: [['what it would drop', 'sk time diet'], ['turn it on', 'sk time diet on']],
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
state = Option.String({ required: false })
|
|
165
|
+
|
|
166
|
+
async execute(): Promise<number> {
|
|
167
|
+
const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
168
|
+
const v = this.state
|
|
169
|
+
if (v !== undefined && v !== 'on' && v !== 'off') {
|
|
170
|
+
this.context.stderr.write(`FAIL: on or off, not ${v}\n`)
|
|
171
|
+
return 1
|
|
172
|
+
}
|
|
173
|
+
const { dietCalls, dietOn, setDietOn } = await import('../agent-time/diet.ts')
|
|
174
|
+
if (v !== undefined) {
|
|
175
|
+
if (!setDietOn(v === 'on')) {
|
|
176
|
+
this.context.stderr.write('FAIL: the machine db does not open: the switch is not set\n')
|
|
177
|
+
return 1
|
|
178
|
+
}
|
|
179
|
+
out(v === 'on' ? 'ok: the switch time-diet is on: the next agent time job drops the old texts, in steps' : 'ok: the switch time-diet is off: no text is dropped')
|
|
180
|
+
return 0
|
|
181
|
+
}
|
|
182
|
+
out(`the switch time-diet is ${dietOn() ? 'on' : 'off'}`)
|
|
183
|
+
const { openIndex } = await import('../agent-time/store.ts')
|
|
184
|
+
try {
|
|
185
|
+
const db = openIndex()
|
|
186
|
+
try {
|
|
187
|
+
const d = dietCalls(db, { now: Date.now(), dry: true })
|
|
188
|
+
out(`older than 7 days and ordinary: ${d.calls} calls, ${(d.bytes / 1e6).toFixed(1)} MB of text${dietOn() ? '' : ' (sk time diet on drops them)'}`)
|
|
189
|
+
} finally {
|
|
190
|
+
db.close()
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
out(`the agent time index does not open: ${(e as Error).message}`)
|
|
194
|
+
}
|
|
195
|
+
return 0
|
|
196
|
+
}
|
|
197
|
+
}
|
package/src/cli/cmd_Tmp.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// now, and the daemon's switch. Every module loads inside execute: the cli registers this file on every `sk` call
|
|
3
3
|
import { Command, Option } from 'clipanion'
|
|
4
4
|
|
|
5
|
-
const DETAILS = `agents and test runs write into
|
|
5
|
+
const DETAILS = `agents and test runs write into temp roots nothing else trims: claude code's session scratch (/tmp/claude-<uid>/<project>/<session>/), the user's temp dir, /tmp, and each house repo's .shipkit/tmp. One pass deletes each unit nothing wrote for 24 h that no live process holds open, has as its working folder or names on its command line or in its environment, and that holds no git work a remote lacks; while the disk is under 40 GB free, units idle 6 h go too, the largest first, until it is back over. A unit is a child of a root, and inside a claude session each piece of its scratchpad, so a session that runs for days loses its old pieces too. In a repo's .shipkit/tmp a link, the gate's and the jobs' own folders, a folder the repo's annex config declares, an annex record's folder and a file the media store indexes are never taken, the day holds whatever the free space, and a unit of 100 MB or more moves to the annex when one has room (a link left in its place, sk annex back undoes it); the repo roots only count what would go until their start date (--repos-from). Nothing is deleted before the owner turns the switch on (--auto on); then the daemon runs the pass hourly, one process at a time on the machine. What a pass measured is kept, so this command answers at once, where a du over a temp root walks every file again. Page: wiki tools/shipkit/machine-temp.md`
|
|
6
6
|
|
|
7
7
|
type Ctx = { stdout: NodeJS.WritableStream; stderr: NodeJS.WritableStream }
|
|
8
8
|
const io = (c: Ctx): { out: (l: string) => void; err: (l: string) => void } => ({ out: (l) => void c.stdout.write(`${l}\n`), err: (l) => void c.stderr.write(`${l}\n`) })
|
|
@@ -16,10 +16,12 @@ export class TmpCommand extends Command {
|
|
|
16
16
|
examples: [
|
|
17
17
|
['where the temp folders stand', 'sk tmp'],
|
|
18
18
|
['the daemon sweeps them hourly from now on', 'sk tmp --auto on'],
|
|
19
|
+
['the repos\' .shipkit/tmp are deleted from this day, only counted before', 'sk tmp --repos-from 2026-11-25'],
|
|
19
20
|
],
|
|
20
21
|
})
|
|
21
22
|
auto = Option.String('--auto', { description: 'on: the daemon\'s hourly retention sweep and sk tmp sweep delete idle temp units; off: nothing deletes (off until the owner turns it on)' })
|
|
22
23
|
top = Option.String('--top', '12', { description: 'how many of the largest kept units to name' })
|
|
24
|
+
reposFrom = Option.String('--repos-from', { description: 'YYYY-MM-DD, 3 days ahead at least: the day the repos\' .shipkit/tmp start to be swept' })
|
|
23
25
|
|
|
24
26
|
async execute(): Promise<number> {
|
|
25
27
|
const { out, err } = io(this.context)
|
|
@@ -28,18 +30,31 @@ export class TmpCommand extends Command {
|
|
|
28
30
|
if (this.auto !== 'on' && this.auto !== 'off') { err(`FAIL: --auto takes on or off, not ${this.auto}`); return 1 }
|
|
29
31
|
if (!t.setTempAuto(this.auto === 'on')) { err('FAIL: the machine db does not open: the switch is not set'); return 1 }
|
|
30
32
|
}
|
|
33
|
+
if (this.reposFrom !== undefined) {
|
|
34
|
+
const why = t.setReposFrom(this.reposFrom === 'off' ? null : this.reposFrom)
|
|
35
|
+
if (why != null) { err(`FAIL: --repos-from: ${why}`); return 1 }
|
|
36
|
+
}
|
|
31
37
|
const { statfsSync } = await import('node:fs')
|
|
32
38
|
const { tmpdir } = await import('node:os')
|
|
33
39
|
const s = statfsSync(tmpdir())
|
|
34
40
|
const free = s.bavail * s.bsize
|
|
35
41
|
const hours = (ms: number): number => ms / 3_600_000
|
|
36
|
-
out(`disk ${t.gb(free)} free${free < t.TEMP_FLOOR_BYTES ? ` (under the ${t.TEMP_FLOOR_BYTES / 1e9} GB floor: units idle ${hours(t.TEMP_GUARD_LOW_MS)} h go too, the largest first, until it is back over)` : ` (a unit idle ${hours(t.TEMP_GUARD_MS)} h goes)`}`)
|
|
42
|
+
out(`disk ${t.gb(free)} free${free < t.TEMP_FLOOR_BYTES ? ` (under the ${t.TEMP_FLOOR_BYTES / 1e9} GB floor: units of the temp folders idle ${hours(t.TEMP_GUARD_LOW_MS)} h go too, the largest first, until it is back over; a repo's .shipkit/tmp keeps its ${hours(t.TEMP_GUARD_MS)} h)` : ` (a unit idle ${hours(t.TEMP_GUARD_MS)} h goes)`}`)
|
|
37
43
|
out(`the daemon's temp sweep ${t.tempAuto() ? 'on, hourly' : 'off (sk tmp --auto on turns it on)'}`)
|
|
44
|
+
const from = t.reposFrom()
|
|
45
|
+
out(`the repos' .shipkit/tmp ${t.reposDelete(Date.now()) ? `deleted since ${t.dayOf(from!)}` : `only counted, nothing deleted: start date ${t.fromWords(from)}`}`)
|
|
38
46
|
const use = t.tempUse()
|
|
39
47
|
if (use == null) { out(t.tempAuto() ? 'not measured yet: the daemon\'s next hourly sweep measures' : 'not measured yet: a pass measures once the switch is on'); return 0 }
|
|
40
48
|
const mins = Math.round((Date.now() - use.at) / 60_000)
|
|
41
49
|
out(`last pass ${new Date(use.at).toISOString().slice(0, 16)}Z, ${mins} min ago, took ${(use.tookMs / 1000).toFixed(1)} s`)
|
|
42
|
-
for (const p of use.passes)
|
|
50
|
+
for (const p of use.passes) {
|
|
51
|
+
if (p.notice === true) {
|
|
52
|
+
out(`${p.id} ${p.root} kept ${t.gb(p.keptBytes)} in ${p.kept} units would go ${t.fromWords(from)}: ${t.gb(p.freed)} in ${p.dropped}`)
|
|
53
|
+
for (const u of (p.going ?? []).slice(0, 3)) out(` would go ${t.gb(u.bytes)} ${u.path}`)
|
|
54
|
+
} else out(`${p.id} ${p.root} kept ${t.gb(p.keptBytes)} in ${p.kept} units freed ${t.gb(p.freed)} in ${p.dropped}${p.moved ? ` (${p.moved} moved to the annex, ${t.gb(p.movedBytes ?? 0)})` : ''}${p.failed > 0 ? ` ${p.failed} not deleted` : ''}`)
|
|
55
|
+
if (p.live) out(` stays for a database or a lock: ${p.live.units} units, ${t.gb(p.live.bytes)}, the oldest idle ${Math.floor((Date.now() - p.live.oldest) / 86_400_000)} d`)
|
|
56
|
+
for (const u of p.waiting ?? []) out(` waits for the annex ${t.gb(u.bytes)} ${u.path} (deleted from ${t.dayOf(u.at + t.BIG_WAIT_MS)} unless an annex takes it)`)
|
|
57
|
+
}
|
|
43
58
|
const top = use.passes.flatMap((p) => p.top).sort((a, b) => b.bytes - a.bytes).slice(0, Math.max(0, Number(this.top) || 0))
|
|
44
59
|
if (top.length > 0) out('the largest kept:')
|
|
45
60
|
for (const u of top) out(` ${u.floor === true ? 'at least ' : ''}${t.gb(u.bytes)} ${u.why} ${u.path}`)
|
|
@@ -58,20 +73,29 @@ export class TmpSweepCommand extends Command {
|
|
|
58
73
|
['what a pass would delete, nothing deleted', 'sk tmp sweep --dry'],
|
|
59
74
|
['a pass now', 'sk tmp sweep'],
|
|
60
75
|
['one pass the owner asked for, the switch still off', 'sk tmp sweep --once'],
|
|
76
|
+
['every unit the house repos\' .shipkit/tmp would lose, by name, nothing deleted', 'sk tmp sweep --dry --repos --list'],
|
|
61
77
|
],
|
|
62
78
|
})
|
|
63
79
|
dry = Option.Boolean('--dry', false, { description: 'name each unit the pass would delete (idle age, size) and the totals, delete nothing' })
|
|
64
80
|
once = Option.Boolean('--once', false, { description: 'one pass by hand though the switch is off: only when the owner asked for this run' })
|
|
81
|
+
repos = Option.Boolean('--repos', false, { description: 'the house repos\' .shipkit/tmp only, not the machine\'s temp folders: seconds, not minutes' })
|
|
82
|
+
list = Option.Boolean('--list', false, { description: 'with --dry, name every unit: what would go and what stays, with why' })
|
|
65
83
|
|
|
66
84
|
async execute(): Promise<number> {
|
|
67
85
|
const { out, err } = io(this.context)
|
|
68
86
|
const { sweepTemp, tempAuto } = await import('../home/machine-temp.ts')
|
|
87
|
+
const { houseRoot } = await import('../home/home-start.ts')
|
|
88
|
+
const { houseRepos } = await import('../serve/project-gutter.ts')
|
|
89
|
+
const { homedir } = await import('node:os')
|
|
69
90
|
if (!this.dry && !this.once && !tempAuto()) {
|
|
70
91
|
err('FAIL: the owner\'s switch is off, so nothing is deleted: `sk tmp --auto on` is the owner\'s to turn on, `sk tmp sweep --dry` names what a pass would delete, and `--once` runs one pass when the owner asked for it')
|
|
71
92
|
return 1
|
|
72
93
|
}
|
|
73
94
|
try {
|
|
74
|
-
|
|
95
|
+
const house = houseRoot(process.cwd())
|
|
96
|
+
const repos = house == null ? [] : houseRepos(house, homedir()).repos.map((r) => r.path)
|
|
97
|
+
if (house == null) err('WARN: no house found from here: the repos\' .shipkit/tmp are not swept')
|
|
98
|
+
return (await sweepTemp({ dry: this.dry, repos, ...(this.repos ? { roots: [] } : {}), list: this.list, print: out, printErr: err })) == null ? 1 : 0
|
|
75
99
|
} catch (e) {
|
|
76
100
|
err(`FAIL: tmp sweep: ${e instanceof Error ? e.message : String(e)}`)
|
|
77
101
|
return 1
|
package/src/cli/cmd_Trailer.ts
CHANGED
|
@@ -37,6 +37,7 @@ export class TrailerCommand extends Command {
|
|
|
37
37
|
['encoded by x264 for a release', 'sk trailer --final'],
|
|
38
38
|
['the music variant b on the same picture', 'sk trailer --variant b'],
|
|
39
39
|
['a quick draft to judge the beats', 'sk trailer --draft'],
|
|
40
|
+
['the cut before its shots exist, to judge the story and the words', 'sk trailer --mock'],
|
|
40
41
|
['where the build spends its time', 'sk trailer --profile'],
|
|
41
42
|
],
|
|
42
43
|
})
|
|
@@ -47,6 +48,7 @@ export class TrailerCommand extends Command {
|
|
|
47
48
|
variant = Option.String('--variant', { description: 'a music variant the cut names (music … variant <name>): out/<name>-<variant>.mp4' })
|
|
48
49
|
draft = Option.Boolean('--draft', false, { description: 'a quick draft at half the size: out/<name>-draft.mp4, the cut\'s takes read as they are, a missing one filmed small, no strip' })
|
|
49
50
|
strip = Option.Boolean('--strip', false, { description: 'with --draft: its strip too' })
|
|
51
|
+
mock = Option.Boolean('--mock', false, { description: 'the whole cut before its shots exist: a take it has is read, a missing one is a drawn placeholder (the shot, its film row, its voice lines), nothing is filmed and no sound is made; a cut with no thumbnail word yet builds, warned, where every other build refuses it' })
|
|
50
52
|
profile = Option.Boolean('--profile', false, { description: 'print every phase of the build with its start, seconds and share' })
|
|
51
53
|
|
|
52
54
|
async execute(): Promise<number> {
|
|
@@ -54,11 +56,11 @@ export class TrailerCommand extends Command {
|
|
|
54
56
|
const { span, timed, profileLines } = await import('../trailer/profile.ts')
|
|
55
57
|
span('start: bun, sk, the cli', 0, performance.now())
|
|
56
58
|
const b = await timed('load: build modules', () => import('../trailer/build.ts'))
|
|
57
|
-
const l = await timed('load: parse and check', () => b.load(b.trailerFile(this.file, root, cwd), root, this.variant !== undefined ? { variant: this.variant } : {}))
|
|
59
|
+
const l = await timed('load: parse and check', () => b.load(b.trailerFile(this.file, root, cwd), root, { ...(this.variant !== undefined ? { variant: this.variant } : {}), ...(this.mock ? { missing: 'warn' as const } : {}) }))
|
|
58
60
|
if (!b.sayErrors(l, say, cwd)) return 1
|
|
59
61
|
try {
|
|
60
62
|
const draft = this.draft ? { draft: (await import('../trailer/draft.ts')).DRAFT, strip: this.strip } : {}
|
|
61
|
-
await b.build(l, { refilm: refilmOf(this.refilm), final: this.final, say, cwd, ...draft })
|
|
63
|
+
await b.build(l, { refilm: refilmOf(this.refilm), final: this.final, say, cwd, ...draft, ...(this.mock ? { mock: true } : {}) })
|
|
62
64
|
} finally {
|
|
63
65
|
if (this.profile) for (const line of profileLines()) say(line)
|
|
64
66
|
}
|
|
@@ -147,7 +149,7 @@ export class TrailerPlanCommand extends Command {
|
|
|
147
149
|
const known = new Set([...l.t.shots, ...l.t.footage].map((s) => s.name))
|
|
148
150
|
const unknown = shots.filter((s) => !known.has(s))
|
|
149
151
|
if (unknown.length > 0) throw new b.Refused(`${basename(file)} has no shot ${unknown.join(', ')}; its shots: ${[...known].join(', ')}`)
|
|
150
|
-
if (this.waiting !== undefined && !ID_RE.test(this.waiting)) throw new b.Refused(`--waiting takes a review card's id (YYYYMMDD-HHMMSS-slug, as sk
|
|
152
|
+
if (this.waiting !== undefined && !ID_RE.test(this.waiting)) throw new b.Refused(`--waiting takes a review card's id (YYYYMMDD-HHMMSS-slug, as sk thread add prints it), got ${this.waiting}`)
|
|
151
153
|
const by = this.by ?? process.env.SK_AGENT
|
|
152
154
|
if (marks[0] !== 'clear' && !by) throw new b.Refused('--by <lane>: the owner reads who plans each shot (or set SK_AGENT)')
|
|
153
155
|
const { trailer, cut } = cutIdOf(file)
|
|
@@ -181,7 +183,7 @@ export class TrailerScoreCommand extends Command {
|
|
|
181
183
|
async execute(): Promise<number> {
|
|
182
184
|
return run(this.context, async (say, root, cwd) => {
|
|
183
185
|
const b = await import('../trailer/build.ts')
|
|
184
|
-
const l = await b.load(b.trailerFile(this.file, root, cwd), root)
|
|
186
|
+
const l = await b.load(b.trailerFile(this.file, root, cwd), root, { missing: 'skip' })
|
|
185
187
|
if (!b.sayErrors(l, say, cwd)) return 1
|
|
186
188
|
await b.auditionScore(l, { refilm: null, final: false, say, cwd })
|
|
187
189
|
return 0
|
|
@@ -209,7 +211,7 @@ export class TrailerShotCommand extends Command {
|
|
|
209
211
|
async execute(): Promise<number> {
|
|
210
212
|
return run(this.context, async (say, root, cwd) => {
|
|
211
213
|
const b = await import('../trailer/build.ts')
|
|
212
|
-
const l = await b.load(b.trailerFile(this.file, root, cwd), root)
|
|
214
|
+
const l = await b.load(b.trailerFile(this.file, root, cwd), root, { missing: 'warn' })
|
|
213
215
|
if (!b.sayErrors(l, say, cwd)) return 1
|
|
214
216
|
await b.previewShot(l, this.name, { refilm: refilmOf(this.refilm), final: false, say, cwd })
|
|
215
217
|
return 0
|
|
@@ -217,10 +219,11 @@ export class TrailerShotCommand extends Command {
|
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
|
|
220
|
-
/** a cut loaded and checked, its errors said; null when it has one
|
|
221
|
-
|
|
222
|
+
/** a cut loaded and checked, its errors said; null when it has one. `preview`: it never ships, so a cut with no start
|
|
223
|
+
* or end image yet previews, warned, and its frames can make them */
|
|
224
|
+
async function loaded(file: string | undefined, say: (l: string) => void, root: string, cwd: string, preview = false) {
|
|
222
225
|
const b = await import('../trailer/build.ts')
|
|
223
|
-
const l = await b.load(b.trailerFile(file, root, cwd), root)
|
|
226
|
+
const l = await b.load(b.trailerFile(file, root, cwd), root, preview ? { missing: 'warn' } : {})
|
|
224
227
|
return b.sayErrors(l, say, cwd) ? l : null
|
|
225
228
|
}
|
|
226
229
|
|
|
@@ -240,7 +243,7 @@ export class TrailerSectionCommand extends Command {
|
|
|
240
243
|
|
|
241
244
|
async execute(): Promise<number> {
|
|
242
245
|
return run(this.context, async (say, root, cwd) => {
|
|
243
|
-
const l = await loaded(this.file, say, root, cwd)
|
|
246
|
+
const l = await loaded(this.file, say, root, cwd, true)
|
|
244
247
|
if (!l) return 1
|
|
245
248
|
await (await import('../trailer/build.ts')).previewSection(l, this.name, { refilm: null, final: this.final, say, cwd })
|
|
246
249
|
return 0
|
|
@@ -331,7 +334,8 @@ export class TrailerKeepCommand extends Command {
|
|
|
331
334
|
const { join } = await import('node:path')
|
|
332
335
|
const lost = await (await import('../review/trailer-shots.ts')).shotsBack(l.root, join(l.dir, 'out', `${l.t.name}-shots`))
|
|
333
336
|
if (lost.length > 0) say(`WARN ${lost.length} shots not fetched back, kept by their facts only: ${lost.join(', ')}`)
|
|
334
|
-
|
|
337
|
+
const p = await import('../trailer/passage.ts')
|
|
338
|
+
await p.thumbnailKept(l, p.keep(l, this.version, say, cwd), say, cwd)
|
|
335
339
|
return 0
|
|
336
340
|
})
|
|
337
341
|
}
|