rvlib-shipkit 2.26.0 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -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 +6 -4
- package/src/agent-time/limits.ts +44 -0
- package/src/agent-time/live.ts +1 -3
- package/src/agent-time/mask.ts +96 -18
- package/src/agent-time/refused.ts +45 -0
- package/src/agent-time/render.ts +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 +320 -99
- package/src/agent-time/timeline.ts +140 -21
- package/src/agent-time/turns.ts +18 -8
- package/src/annex/offload.ts +17 -6
- package/src/annex/tidy.ts +70 -10
- package/src/asks/ask-after.ts +40 -0
- package/src/asks/asks-queue.ts +205 -47
- package/src/assets/kit-config.ts +7 -3
- package/src/assets/kits/identity-kit.ts +289 -10
- package/src/check.ts +3 -1
- package/src/checks/SK004-gitignore-policy.check.ts +12 -5
- package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
- package/src/checks/SK026-asks-autoclose.check.ts +5 -5
- package/src/checks/SK028-readme.check.ts +7 -66
- package/src/checks/SK030-cache-audit.check.ts +6 -1
- package/src/checks/SK031-trace-audit.check.ts +2 -0
- package/src/checks/SK033-global-contribution.check.ts +3 -1
- package/src/checks/SK035-public-clean.check.ts +2 -2
- package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
- package/src/checks/SK047-login-in-description.check.ts +36 -0
- package/src/checks/SK048-one-local-file.check.ts +36 -0
- package/src/cli/cmd_Asks.ts +71 -5
- package/src/cli/cmd_Backup.ts +2 -2
- package/src/cli/cmd_Capacity.ts +2 -2
- package/src/cli/cmd_CrossRepoActivity.ts +5 -4
- package/src/cli/cmd_Db.ts +253 -0
- package/src/cli/cmd_History.ts +212 -0
- package/src/cli/cmd_Home.ts +31 -3
- package/src/cli/cmd_Hq.ts +516 -0
- package/src/cli/cmd_Machines.ts +36 -0
- package/src/cli/cmd_Media.ts +38 -6
- package/src/cli/cmd_Reflect.ts +23 -2
- package/src/cli/cmd_Review.ts +548 -116
- package/src/cli/cmd_Secret.ts +62 -12
- package/src/cli/cmd_Social.ts +83 -1
- package/src/cli/cmd_Space.ts +324 -0
- package/src/cli/cmd_Time.ts +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/family-help.ts +4 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/registry.ts +24 -3
- package/src/collections/actions.ts +63 -13
- package/src/collections/collection-types.ts +23 -1
- package/src/collections/providers.ts +117 -23
- package/src/collections/review.ts +4 -4
- package/src/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/layout.ts +3 -0
- package/src/core/machine-busy.ts +127 -0
- package/src/core/machine-commit.ts +6 -1
- package/src/core/machine-db.ts +368 -20
- package/src/core/machine-layout.ts +137 -0
- package/src/core/machine-read.ts +81 -0
- package/src/core/migrate-layout.ts +1 -1
- package/src/core/one-way-in-policy.ts +64 -7
- package/src/core/polling-policy.ts +27 -0
- package/src/core/retention.ts +16 -2
- package/src/core/scope.ts +107 -14
- package/src/core/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 +66 -3
- package/src/home/app-sign.ts +15 -4
- package/src/home/daemon-jobs.ts +149 -7
- package/src/home/database-projects.ts +111 -0
- package/src/home/database-words.ts +203 -0
- package/src/home/databases.ts +460 -0
- package/src/home/global-units.ts +6 -0
- package/src/home/gui-app/ShipkitGui.swift +122 -1
- package/src/home/gui-app.ts +6 -3
- package/src/home/home-move.ts +514 -0
- package/src/home/home-paths.ts +12 -3
- package/src/home/home-routes.ts +68 -0
- package/src/home/inbox-shape.ts +24 -14
- package/src/home/machine-fold.ts +820 -0
- package/src/home/machine-host.ts +20 -5
- package/src/home/machine-repair.ts +503 -0
- package/src/home/machine-stores.ts +66 -15
- package/src/home/machine-temp.ts +547 -86
- package/src/home/resume.ts +79 -0
- package/src/home/run-daemon.ts +25 -4
- package/src/home/run-pm.ts +18 -5
- package/src/home/serve-daemon.ts +18 -3
- package/src/home/serve-web.ts +175 -7
- package/src/home/space-job.ts +115 -0
- package/src/home/space-page.ts +257 -0
- package/src/home/space-route.ts +167 -0
- package/src/home/space-words.ts +103 -0
- package/src/home/time-page-shape.ts +202 -0
- package/src/home/time-page.ts +64 -0
- package/src/home/vault-page.ts +482 -0
- package/src/home/vault-words.ts +132 -0
- package/src/hooks/leak-guard.ts +40 -13
- package/src/hooks/one-way-in-guard.ts +17 -4
- package/src/hq/cards.ts +581 -0
- package/src/hq/door-route.ts +43 -0
- package/src/hq/door.ts +163 -0
- package/src/hq/files-send.ts +348 -0
- package/src/hq/forgotten-log.ts +35 -0
- package/src/hq/history-check.ts +255 -0
- package/src/hq/history-place.ts +146 -0
- package/src/hq/history-send.ts +487 -0
- package/src/hq/hq-db.ts +99 -0
- package/src/hq/hq-local.ts +469 -0
- package/src/hq/hq-routes.ts +196 -0
- package/src/hq/hq-store.ts +599 -0
- package/src/hq/kinds/ask.ts +147 -0
- package/src/hq/kinds/card-gone.ts +83 -0
- package/src/hq/kinds/card-msg.ts +66 -0
- package/src/hq/kinds/card.ts +99 -0
- package/src/hq/kinds/index.ts +21 -0
- package/src/hq/kinds/kind.ts +126 -0
- package/src/hq/kinds/media.ts +125 -0
- package/src/hq/kinds/prompt.ts +219 -0
- package/src/hq/kinds/reflection.ts +128 -0
- package/src/hq/kinds/report.ts +55 -0
- package/src/hq/kinds/time-day.ts +236 -0
- package/src/hq/ledger.ts +473 -0
- package/src/hq/machine-key.ts +44 -0
- package/src/hq/machine-notes.ts +131 -0
- package/src/hq/outbox.ts +372 -0
- package/src/hq/replica.ts +168 -0
- package/src/hq/repo-id.ts +4 -0
- package/src/hq/report-facts.ts +117 -0
- package/src/hq/report.ts +274 -0
- package/src/hq/switch.ts +151 -0
- package/src/hq/vault-grant.ts +92 -0
- package/src/identities/identities.ts +15 -3
- package/src/identities/steps.ts +31 -0
- package/src/ledger/db.ts +73 -26
- package/src/ledger/gate-checks.ts +6 -2
- package/src/ledger/run-log.ts +11 -3
- package/src/ledger/store.ts +26 -4
- package/src/media-store/backup/daemon.ts +25 -17
- package/src/media-store/backup/kept.ts +241 -0
- package/src/media-store/backup/restore.ts +14 -4
- package/src/media-store/backup/run.ts +11 -11
- package/src/media-store/backup/secret.ts +6 -4
- package/src/media-store/backup/snapshot.ts +4 -2
- package/src/media-store/backup/sources.ts +67 -16
- package/src/media-store/copy/config.ts +77 -0
- package/src/media-store/copy/copy.ts +194 -0
- package/src/media-store/copy/lifecycle.ts +43 -0
- package/src/media-store/copy/night.ts +90 -0
- package/src/media-store/copy/proof.ts +151 -0
- package/src/media-store/copy/snapshot.ts +152 -0
- package/src/media-store/copy/store.ts +62 -0
- package/src/media-store/copy/stream.ts +176 -0
- package/src/media-store/daemon.ts +66 -16
- package/src/media-store/db.ts +22 -11
- package/src/media-store/forget.ts +23 -3
- package/src/media-store/hand.ts +4 -3
- package/src/media-store/hq-find.ts +75 -0
- package/src/media-store/hq-send.ts +277 -0
- package/src/media-store/kind.ts +2 -0
- package/src/media-store/purge.ts +18 -15
- package/src/media-store/put.ts +24 -8
- package/src/media-store/remote.ts +16 -7
- package/src/media-store/space-listing.ts +240 -0
- package/src/media-store/space.ts +40 -21
- package/src/media-store/sync.ts +5 -5
- package/src/media-store/tidy.ts +98 -0
- package/src/media-store/upload.ts +3 -3
- package/src/media-store/webp.ts +66 -0
- package/src/messages/model.ts +16 -7
- package/src/messages/routes.ts +14 -4
- package/src/messages/score.ts +2 -2
- package/src/messages/suggest.ts +96 -0
- package/src/pages/frame-client.ts +10 -0
- package/src/plan/planner.ts +28 -17
- package/src/recordings/media-kind.ts +1 -0
- package/src/recordings/model.ts +1 -1
- package/src/recordings/recorder-app/Capture.swift +9 -7
- package/src/reflect/hq-corpus.ts +56 -0
- package/src/reflect/prompt-corpus.ts +3 -1
- package/src/reflect/transcript.ts +129 -37
- package/src/release/machine-words.ts +67 -0
- package/src/release/public-clean.ts +8 -3
- package/src/releases/from-card.ts +1 -1
- package/src/releases/routes.ts +10 -5
- package/src/releases/store.ts +10 -1
- package/src/repo-config.ts +32 -2
- package/src/review/anim.ts +2 -2
- package/src/review/auto.ts +2 -2
- package/src/review/card-db.ts +244 -0
- package/src/review/card-rows.ts +266 -0
- package/src/review/cells.ts +76 -5
- package/src/review/draft-card.ts +41 -0
- package/src/review/draft-model.ts +78 -0
- package/src/review/format.ts +29 -10
- package/src/review/gone.ts +98 -0
- package/src/review/inbox-hook.ts +4 -4
- 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 +202 -39
- package/src/review/move.ts +491 -0
- package/src/review/notes.ts +12 -20
- package/src/review/previews.ts +15 -19
- package/src/review/project.ts +1 -1
- package/src/review/rev.ts +8 -0
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +64 -13
- package/src/review/stage-card.ts +8 -4
- package/src/review/stage-routes.ts +1 -1
- package/src/review/store.ts +529 -83
- package/src/review/thread-fold.ts +51 -0
- package/src/review/threads.ts +147 -9
- package/src/review/trailer-auto-mock.ts +63 -0
- package/src/review/trailer-card.ts +4 -4
- package/src/review/trailer-desk.ts +41 -7
- package/src/review/trailer-media.ts +1 -0
- package/src/review/trailer-model.ts +8 -0
- package/src/review/trailer-notes.ts +1 -1
- package/src/review/trailer-routes.ts +9 -1
- package/src/review/unit.ts +6 -6
- package/src/review/watchers.ts +1 -1
- package/src/rules/untrack-generated.ts +92 -8
- package/src/secrets/held.ts +16 -0
- package/src/secrets/keychain.ts +113 -0
- package/src/secrets/list.ts +16 -6
- package/src/secrets/manager.ts +24 -10
- package/src/secrets/read.ts +257 -0
- package/src/secrets/who-reads.ts +49 -0
- package/src/serve/door-forward.ts +268 -0
- package/src/serve/door-names.ts +47 -0
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/activity-view.tsx +56 -32
- package/src/serve/hub-app/activity.css +7 -1
- package/src/serve/hub-app/asks-page.tsx +48 -0
- package/src/serve/hub-app/asks-st.ts +25 -0
- package/src/serve/hub-app/clock-svc.ts +1 -2
- package/src/serve/hub-app/col-card.tsx +64 -13
- package/src/serve/hub-app/col-list-page.tsx +122 -0
- package/src/serve/hub-app/col-list-st.ts +103 -0
- package/src/serve/hub-app/col-tables-view.tsx +10 -41
- package/src/serve/hub-app/col-tables.ts +76 -8
- package/src/serve/hub-app/cols-svc.ts +70 -16
- package/src/serve/hub-app/database-st.ts +260 -0
- package/src/serve/hub-app/database-view.tsx +289 -0
- package/src/serve/hub-app/database.css +32 -0
- package/src/serve/hub-app/entry-bar.css +14 -0
- package/src/serve/hub-app/entry-bar.tsx +33 -0
- package/src/serve/hub-app/entry-pick.ts +31 -0
- package/src/serve/hub-app/floating.tsx +1 -0
- package/src/serve/hub-app/hash-route.ts +11 -1
- package/src/serve/hub-app/header-bar.tsx +14 -18
- package/src/serve/hub-app/home-st.ts +89 -9
- package/src/serve/hub-app/home-strip.css +5 -19
- package/src/serve/hub-app/home-strip.tsx +58 -92
- package/src/serve/hub-app/home.html +7 -0
- package/src/serve/hub-app/hub-app.tsx +31 -142
- package/src/serve/hub-app/hub-types.ts +3 -1
- package/src/serve/hub-app/hub.css +109 -23
- package/src/serve/hub-app/icons.tsx +18 -1
- package/src/serve/hub-app/identities-st.ts +56 -6
- package/src/serve/hub-app/identities-view.tsx +100 -58
- package/src/serve/hub-app/identities.css +17 -15
- package/src/serve/hub-app/identity-address.ts +5 -0
- package/src/serve/hub-app/inbox-st.ts +41 -24
- package/src/serve/hub-app/inbox-view.tsx +37 -41
- package/src/serve/hub-app/inbox.css +2 -5
- package/src/serve/hub-app/index.html +7 -0
- package/src/serve/hub-app/kept-cols.tsx +7 -0
- package/src/serve/hub-app/keys.ts +28 -15
- package/src/serve/hub-app/later.tsx +26 -0
- package/src/serve/hub-app/list-filter.tsx +14 -0
- package/src/serve/hub-app/list-walk.ts +72 -3
- package/src/serve/hub-app/machines-st.ts +251 -0
- package/src/serve/hub-app/machines-view.tsx +224 -0
- package/src/serve/hub-app/machines.css +76 -0
- package/src/serve/hub-app/md-copy.tsx +79 -0
- package/src/serve/hub-app/media-view.tsx +2 -0
- package/src/serve/hub-app/messages/messages-page.tsx +79 -7
- package/src/serve/hub-app/messages/messages-st.ts +99 -3
- package/src/serve/hub-app/messages.css +14 -0
- package/src/serve/hub-app/page-keys.ts +175 -0
- package/src/serve/hub-app/pages-frames.tsx +11 -3
- package/src/serve/hub-app/palette-st.ts +58 -11
- package/src/serve/hub-app/palette-view.tsx +3 -1
- package/src/serve/hub-app/project-list.css +54 -8
- package/src/serve/hub-app/project-list.tsx +128 -59
- package/src/serve/hub-app/projects-svc.ts +78 -7
- package/src/serve/hub-app/reader-chips.tsx +13 -0
- package/src/serve/hub-app/readme-view.tsx +2 -3
- package/src/serve/hub-app/readme.css +27 -5
- package/src/serve/hub-app/reflections-page.tsx +42 -0
- package/src/serve/hub-app/reflections-st.ts +17 -0
- package/src/serve/hub-app/releases/releases-page.tsx +25 -2
- package/src/serve/hub-app/releases/releases-st.ts +1 -1
- package/src/serve/hub-app/repo-sections.ts +9 -5
- package/src/serve/hub-app/repo-st.ts +35 -8
- package/src/serve/hub-app/review/draft-card.tsx +163 -0
- package/src/serve/hub-app/review/kit.tsx +50 -7
- package/src/serve/hub-app/review/note-place.ts +1 -1
- package/src/serve/hub-app/review/review-board.tsx +2 -2
- package/src/serve/hub-app/review/review-cells.tsx +145 -65
- package/src/serve/hub-app/review/review-kit.ts +27 -1
- package/src/serve/hub-app/review/review-list.tsx +68 -30
- package/src/serve/hub-app/review/review-page.tsx +7 -8
- package/src/serve/hub-app/review/review-st.ts +111 -24
- package/src/serve/hub-app/review/review-thread.tsx +49 -19
- package/src/serve/hub-app/review/review-views.tsx +475 -144
- package/src/serve/hub-app/review/thread-control-st.ts +115 -0
- package/src/serve/hub-app/review/thread-control.tsx +74 -0
- package/src/serve/hub-app/review/thread-st.ts +73 -26
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-page.tsx +37 -16
- package/src/serve/hub-app/review/trailer-st.ts +41 -7
- package/src/serve/hub-app/review.css +267 -61
- package/src/serve/hub-app/side-lists.ts +72 -0
- package/src/serve/hub-app/sidebar.tsx +6 -3
- package/src/serve/hub-app/site/site-part.tsx +2 -8
- package/src/serve/hub-app/site/site-st.ts +4 -4
- package/src/serve/hub-app/social/comms-page.tsx +20 -5
- package/src/serve/hub-app/social/kit.tsx +30 -4
- package/src/serve/hub-app/social/post-card.tsx +139 -49
- package/src/serve/hub-app/social/serial-writes.ts +13 -0
- package/src/serve/hub-app/social/social-model.ts +11 -0
- package/src/serve/hub-app/social/social-page.tsx +94 -35
- package/src/serve/hub-app/social/social-st.ts +120 -36
- package/src/serve/hub-app/social/stage-popup.tsx +1 -1
- package/src/serve/hub-app/social/stage-st.ts +1 -1
- package/src/serve/hub-app/social/step-layout.ts +1 -1
- package/src/serve/hub-app/social.css +3 -0
- package/src/serve/hub-app/space-st.ts +209 -0
- package/src/serve/hub-app/space-view.tsx +196 -0
- package/src/serve/hub-app/space.css +27 -0
- package/src/serve/hub-app/stores/stores-page.tsx +91 -23
- package/src/serve/hub-app/stores/stores-st.ts +44 -19
- package/src/serve/hub-app/stores.css +6 -1
- package/src/serve/hub-app/theme-st.ts +22 -9
- package/src/serve/hub-app/time-charts.tsx +291 -0
- package/src/serve/hub-app/time-pages.tsx +749 -0
- package/src/serve/hub-app/time-st.ts +162 -0
- package/src/serve/hub-app/time-view.tsx +76 -0
- package/src/serve/hub-app/time.css +138 -0
- package/src/serve/hub-app/tree-build.ts +52 -42
- package/src/serve/hub-app/tree-row.tsx +4 -4
- package/src/serve/hub-app/tree-svc.ts +18 -9
- package/src/serve/hub-app/urls-svc.ts +154 -0
- package/src/serve/hub-app/urls-view.tsx +117 -0
- package/src/serve/hub-app/urls.css +30 -0
- package/src/serve/hub-app/vault-st.ts +127 -0
- package/src/serve/hub-app/vault-view.tsx +154 -0
- package/src/serve/hub-app/vault.css +38 -0
- package/src/serve/hub-app/veille/veille-st.ts +12 -10
- package/src/serve/hub-app/waiting-svc.ts +29 -0
- package/src/serve/hub-app/wikis-view.tsx +2 -2
- package/src/serve/hub-runtime.ts +15 -2
- package/src/serve/project-gutter-route.ts +27 -14
- package/src/serve/project-gutter.ts +25 -12
- package/src/serve/same-origin.ts +10 -0
- package/src/serve/serve-hub.ts +13 -4
- package/src/shipkit-files.ts +16 -2
- package/src/shipkit.ts +1 -1
- package/src/shot/shooter.ts +616 -420
- package/src/shot/shot-ask.ts +246 -155
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -2
- package/src/social/cover.ts +202 -0
- package/src/social/discord-layout.ts +37 -13
- package/src/social/drafts.ts +3 -0
- package/src/social/load.ts +23 -2
- package/src/social/media-kind.ts +2 -1
- package/src/social/publish/discord.ts +5 -2
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +28 -13
- package/src/social/routes.ts +26 -1
- package/src/social/stage.ts +1 -1
- package/src/social/stats.ts +12 -9
- package/src/social/strip.ts +4 -1
- package/src/social/thumbnail.ts +255 -0
- package/src/stores/collection.ts +15 -11
- package/src/stores/desk.ts +236 -42
- package/src/stores/model.ts +72 -6
- package/src/stores/routes.ts +37 -12
- package/src/stores/unit.ts +14 -8
- package/src/suite/judge-suites.ts +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/run.ts +16 -6
- package/src/trailer/stitch.ts +26 -5
- package/src/trailer/titles.ts +82 -19
- package/src/trailer/versions.ts +1 -3
- package/src/trailer/vertical.ts +3 -1
- package/src/urls/frame.ts +195 -0
- package/src/urls/routes.ts +43 -0
- package/src/urls/rows.ts +171 -0
- package/src/urls/unit.ts +73 -0
- package/src/vault/house-keys.ts +42 -0
- package/src/vault/layout.ts +50 -0
- package/src/vault/policy.ts +165 -0
- package/src/vault/vault-audit.ts +276 -0
- package/src/vault/vault-client.ts +40 -0
- package/src/vault/vault-config.ts +159 -0
- package/src/vault/vault-destroy.ts +78 -0
- package/src/vault/vault-handover.ts +305 -0
- package/src/vault/vault-http.ts +352 -0
- package/src/vault/vault-import.ts +208 -0
- package/src/vault/vault-init.ts +328 -0
- package/src/vault/vault-minter.ts +271 -0
- package/src/vault/vault-restore.ts +333 -0
- package/src/vault/vault-serve.ts +342 -0
- package/src/vault/vault-snapshot.ts +281 -0
- package/src/veille/asks.ts +1 -1
- package/src/veille/desk.ts +2 -2
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
// on the Mac's own disk, links not followed, stay under the cap (`annex.capGb`, else the house's `serve.annexScratch`,
|
|
3
3
|
// else 20 GB). A folder born on the annex or moved there is a link and counts nothing; a spill counts whole. It warns,
|
|
4
4
|
// never fails: the daemon's annex job moves stale scratch by itself in a repo that declared `annex`, and this row says
|
|
5
|
-
// when it could not, with the one command that runs the pass now; in a repo that declared none, it names the opt in
|
|
5
|
+
// when it could not, with the one command that runs the pass now; in a repo that declared none, it names the opt in.
|
|
6
|
+
// It also tells the repo what the machine's temp sweep takes from its `.shipkit/tmp` (home/machine-temp.ts): each
|
|
7
|
+
// folder its annex config declares there, which belongs in `.shipkit/cache/`, and before the sweep's start date what
|
|
8
|
+
// would go and from when
|
|
9
|
+
import { realpathSync } from 'node:fs'
|
|
10
|
+
import { join } from 'node:path'
|
|
6
11
|
import { check } from '../check.ts'
|
|
12
|
+
import { LAYOUT } from '../core/layout.ts'
|
|
13
|
+
import { BIG_WAIT_MS, dayOf, LIVE_NAME_MS, type TempUse } from '../home/machine-temp.ts'
|
|
7
14
|
|
|
8
15
|
const GB = 1e9
|
|
9
16
|
|
|
@@ -15,11 +22,53 @@ export function scratchProblem(bytes: number, capGb: number, opted = true): stri
|
|
|
15
22
|
return `${(bytes / GB).toFixed(1)} GB of .shipkit/tmp and .shipkit/cache on the Mac, over its ${capGb} GB cap: sk annex tidy moves stale scratch to the annex now (sk annex tidy --dry lists it first); a folder that must live there from its first byte goes in annex.born of repo.config.ts`
|
|
16
23
|
}
|
|
17
24
|
|
|
25
|
+
/** a warning for each folder the annex config declares under `.shipkit/tmp`: the machine's sweep empties it every day,
|
|
26
|
+
* so what is kept or lives on the annex belongs in `.shipkit/cache/` */
|
|
27
|
+
export function declaredInTmp(declared: readonly string[]): string[] {
|
|
28
|
+
return declared.filter((d) => d.startsWith(`${LAYOUT.tmp}/`)).map((d) => `${d} is declared in the annex config, yet .shipkit/tmp is emptied every day: move it to ${d.replace(LAYOUT.tmp, '.shipkit/cache')} (the folder and its line in repo.config.ts); the sweep never takes it while it is declared`)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** what the machine's temp sweep would delete in the repo's `.shipkit/tmp`, and from when, while its start date has not
|
|
32
|
+
* come: null once it deletes, with no date set, or with nothing to go */
|
|
33
|
+
export function tmpNotice(root: string, use: TempUse | null, from: number | null, now: number): string | null {
|
|
34
|
+
if (from == null || now >= from || use == null) return null
|
|
35
|
+
let real = join(root, LAYOUT.tmp)
|
|
36
|
+
try { real = realpathSync(real) } catch { return null }
|
|
37
|
+
const p = use.passes.find((x) => x.root === real && x.notice === true)
|
|
38
|
+
if (p == null || p.dropped === 0) return null
|
|
39
|
+
const names = (p.going ?? []).slice(0, 3).map((u) => `${u.path.slice(real.length + 1)} (${(u.bytes / GB).toFixed(2)} GB)`).join(', ')
|
|
40
|
+
return `from ${dayOf(from)} the machine's temp sweep deletes what nothing wrote for a day in .shipkit/tmp: ${p.dropped} units, ${(p.freed / GB).toFixed(2)} GB would go now (${names}); what must still exist tomorrow goes in .shipkit/cache/ or the Space (sk media put)`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** the big units of the repo's `.shipkit/tmp` the last pass kept because no annex took them, and from when each goes:
|
|
44
|
+
* null with none */
|
|
45
|
+
export function waitingNotice(root: string, use: TempUse | null): string | null {
|
|
46
|
+
if (use == null) return null
|
|
47
|
+
let real = join(root, LAYOUT.tmp)
|
|
48
|
+
try { real = realpathSync(real) } catch { return null }
|
|
49
|
+
const w = use.passes.find((x) => x.root === real)?.waiting ?? []
|
|
50
|
+
if (w.length === 0) return null
|
|
51
|
+
const names = w.slice(0, 3).map((u) => `${u.path.slice(real.length + 1)} (${(u.bytes / GB).toFixed(2)} GB, goes ${dayOf(u.at + BIG_WAIT_MS)})`).join(', ')
|
|
52
|
+
return `${w.length} big units of .shipkit/tmp wait for the annex: plug it in and they move there, else each is deleted once idle ${BIG_WAIT_MS / 86_400_000} days: ${names}`
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** the units of the repo's `.shipkit/tmp` kept for a database or a lock and idle LIVE_NAME_MS at `now`: no pass takes
|
|
56
|
+
* them, so a person or the repo's agent decides; null with none */
|
|
57
|
+
export function liveStateNotice(root: string, use: TempUse | null, now: number): string | null {
|
|
58
|
+
if (use == null) return null
|
|
59
|
+
let real = join(root, LAYOUT.tmp)
|
|
60
|
+
try { real = realpathSync(real) } catch { return null }
|
|
61
|
+
const old = (use.passes.find((x) => x.root === real)?.live?.old ?? []).filter((u) => now - u.at >= LIVE_NAME_MS)
|
|
62
|
+
if (old.length === 0) return null
|
|
63
|
+
const names = old.slice(0, 5).map((u) => `${u.path.slice(real.length + 1)} (idle ${Math.floor((now - u.at) / 86_400_000)} d)`).join(', ')
|
|
64
|
+
return `${old.length} units of .shipkit/tmp hold a database or a lock, idle ${LIVE_NAME_MS / 86_400_000} days or more, and no sweep takes them: ${names}; move what is kept to .shipkit/cache/, delete the rest`
|
|
65
|
+
}
|
|
66
|
+
|
|
18
67
|
export const scratchOnTheMac = check({
|
|
19
68
|
id: 'SK043',
|
|
20
69
|
blocking: false,
|
|
21
70
|
title: 'scratch on the Mac',
|
|
22
|
-
description: "
|
|
71
|
+
description: "scratch on the Mac stays under its cap, and nothing kept is declared in .shipkit/tmp",
|
|
23
72
|
owner: 'tools/shipkit/annex.md',
|
|
24
73
|
runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: false, onHealth: true, onSave: false, onClock: false },
|
|
25
74
|
cache: { by: 'never', why: 'it measures scratch outside git, one du of about half a second' },
|
|
@@ -34,11 +83,17 @@ export const scratchOnTheMac = check({
|
|
|
34
83
|
const p = policyOf(houseScratch, c.config.annex ?? {})
|
|
35
84
|
const { offloads } = await import('../annex/offload.ts')
|
|
36
85
|
const { held, heldWords, localSnapshots } = await import('../annex/snapshots.ts')
|
|
86
|
+
const { reposFrom, tempUse } = await import('../home/machine-temp.ts')
|
|
37
87
|
const bytes = scratchOnMac(c.root)
|
|
38
88
|
const why = scratchProblem(bytes, p.capGb, c.config.annex !== undefined)
|
|
39
89
|
const words = heldWords(held(offloads().filter((x) => x.repo === c.root), localSnapshots()))
|
|
40
|
-
|
|
41
|
-
|
|
90
|
+
const use = tempUse()
|
|
91
|
+
const notice = tmpNotice(c.root, use, reposFrom(), Date.now())
|
|
92
|
+
const waiting = waitingNotice(c.root, use)
|
|
93
|
+
const live = liveStateNotice(c.root, use, Date.now())
|
|
94
|
+
const warns = [...(why ? [words ? `${why}; ${words}` : why] : []), ...declaredInTmp([...p.born, ...p.keep]), ...[notice, waiting, live].filter((w): w is string => w != null)]
|
|
95
|
+
for (const w of warns) c.warn(w)
|
|
96
|
+
if (warns.length === 0) c.ok(`${(bytes / GB).toFixed(1)} GB of scratch on the Mac, cap ${p.capGb} GB${words ? `; ${words}` : ''}`)
|
|
42
97
|
},
|
|
43
98
|
})
|
|
44
99
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SK047 login in a description: no global process of the repo writes a password in its `description`. A description
|
|
2
|
+
// shows on the home page, in `sk gp` and in pm's status, and a unit that reads the keychain when its file loads to
|
|
3
|
+
// build one spawns a read in every process that loads units. A login is declared in `logins` (tools/shipkit/urls.md):
|
|
4
|
+
// named by where its value lives, copied by one click on the repo's urls page. It reads the unit files as text, never
|
|
5
|
+
// imports one, and it warns: the description still works.
|
|
6
|
+
import { readFileSync } from 'fs'
|
|
7
|
+
import { relative } from 'path'
|
|
8
|
+
import { check } from '../check.ts'
|
|
9
|
+
import { unitFilesDeclaring } from '../core/unit-files.ts'
|
|
10
|
+
|
|
11
|
+
/** a `description:` value of a unit file: a template, a single or a double quoted text */
|
|
12
|
+
const DESCRIPTION = /\bdescription\s*:\s*(`(?:\\[^]|[^`\\])*`|'(?:\\.|[^'\\\n])*'|"(?:\\.|[^"\\\n])*")/g
|
|
13
|
+
/** the word a login line starts with, then its colon or equals sign */
|
|
14
|
+
const PASSWORD = /\b(pass(?:word)?|passwd|pwd|mot de passe)\b[`*_\s]*[:=]/i
|
|
15
|
+
|
|
16
|
+
/** how many descriptions of a unit file's text write a password line */
|
|
17
|
+
export const passwordDescriptions = (text: string): number => [...text.matchAll(DESCRIPTION)].filter((m) => PASSWORD.test(m[1]!)).length
|
|
18
|
+
|
|
19
|
+
export const loginInDescription = check({
|
|
20
|
+
id: 'SK047',
|
|
21
|
+
blocking: false,
|
|
22
|
+
title: 'login in a description',
|
|
23
|
+
description: 'no global process writes a password in its description: its logins declare it',
|
|
24
|
+
owner: 'tools/shipkit/urls.md',
|
|
25
|
+
runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
|
|
26
|
+
cache: { by: 'files', inputs: ['.'], key: null },
|
|
27
|
+
fix: 'none',
|
|
28
|
+
applies: (env) => (unitFilesDeclaring(env.root, 'globalProcess').length === 0 ? 'this repo declares no global process' : null),
|
|
29
|
+
run: (c) => {
|
|
30
|
+
const hits = unitFilesDeclaring(c.root, 'globalProcess').filter((f) => passwordDescriptions(readFileSync(f, 'utf8')) > 0).map((f) => relative(c.root, f))
|
|
31
|
+
if (hits.length === 0) return c.ok('no global process writes a password in its description')
|
|
32
|
+
for (const f of hits) c.warn(`${f}: a description writes a password. Declare the login in \`logins\` beside the url, { account, secret } or { file, account, password }, and drop it from the description: the repo's urls page copies it in one click (wiki tools/shipkit/urls.md)`)
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export default loginInDescription
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SK048 the one local file (tools/shipkit/home.md): where this machine's fold of the media index, the agent time index
|
|
2
|
+
// and the daemon's file into the machine db stands (home/machine-fold.ts), said in the house repo only, since it is the machine's and
|
|
3
|
+
// not a repo's. It warns, never fails: a walk stopped half way, a store refused as damaged, a file this code does not
|
|
4
|
+
// read. The fold off is a state the owner may keep, said in its ok line, as the day, the rows and the copies once folded
|
|
5
|
+
import { check } from '../check.ts'
|
|
6
|
+
|
|
7
|
+
export const oneLocalFile = check({
|
|
8
|
+
id: 'SK048',
|
|
9
|
+
blocking: false,
|
|
10
|
+
title: 'the one local file',
|
|
11
|
+
description: "the media index, the agent time index and the daemon's file are tables of the machine db",
|
|
12
|
+
owner: 'tools/shipkit/home.md',
|
|
13
|
+
runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: false, onHealth: true, onSave: false, onClock: false },
|
|
14
|
+
cache: { by: 'never', why: 'it reads the machine db and two lstats, a few ms, and the machine moves outside git' },
|
|
15
|
+
fix: 'none',
|
|
16
|
+
applies: (env) => {
|
|
17
|
+
// a require at the call: the module reads the house index, never at the load of the checks
|
|
18
|
+
const { houseRootOf } = require('../home/home-start.ts') as typeof import('../home/home-start.ts')
|
|
19
|
+
return houseRootOf(env.root) === env.root ? null : "the machine's fold is said in the house repo"
|
|
20
|
+
},
|
|
21
|
+
run: async (c) => {
|
|
22
|
+
const { foldWords } = await import('../home/machine-fold.ts')
|
|
23
|
+
let words: string[]
|
|
24
|
+
try {
|
|
25
|
+
words = foldWords()
|
|
26
|
+
} catch (e) {
|
|
27
|
+
return c.warn(`the machine db does not read, the fold's state is unknown: ${(e as Error).message}`)
|
|
28
|
+
}
|
|
29
|
+
// off is a state the owner may keep; a walk half way, a damaged file or a file this code does not read is not
|
|
30
|
+
const stuck = words.some((w) => /half way|is damaged|shape of before the fold/.test(w))
|
|
31
|
+
if (stuck) for (const w of words) c.warn(w)
|
|
32
|
+
else c.ok(words.join('; '))
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export default oneLocalFile
|
package/src/cli/cmd_Asks.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// shipkit asks — the per-repo human queue: `asks` lists, `asks check`
|
|
2
|
-
// probes + archives, `ask "<title>"` creates
|
|
3
|
-
// asks/asks-queue.ts (the plain module owns all logic).
|
|
2
|
+
// probes + archives, `ask "<title>"` creates, `asks decline` is the owner's no.
|
|
3
|
+
// Thin commands over asks/asks-queue.ts (the plain module owns all logic).
|
|
4
4
|
import { join } from 'path'
|
|
5
5
|
import { Command, Option } from 'clipanion'
|
|
6
|
-
import {
|
|
6
|
+
import { afterValue } from '../asks/ask-after.ts'
|
|
7
|
+
import { checkAsks, createAsk, declineAsk, openAsks, renderAsksTable } from '../asks/asks-queue.ts'
|
|
7
8
|
import { loadRepoConfig } from '../repo-config.ts'
|
|
8
9
|
import { LAYOUT } from '../core/layout.ts'
|
|
9
10
|
|
|
@@ -16,10 +17,24 @@ export class AsksCommand extends Command {
|
|
|
16
17
|
static override usage = Command.Usage({
|
|
17
18
|
category: 'Asks',
|
|
18
19
|
description: 'list open asks — the per-repo human action queue',
|
|
19
|
-
|
|
20
|
+
details: '--all lists the open asks of every machine and repo, read from the hq: one row an ask, whichever machines hold it through git (an ask is named by its repo\'s remote and its file\'s name), done on one machine wins. The files stay in their repos: the hq is their index.',
|
|
21
|
+
examples: [['list open asks', 'sk asks'], ['every machine\'s open asks, from the hq', 'sk asks --all']],
|
|
20
22
|
})
|
|
21
23
|
|
|
24
|
+
all = Option.Boolean('--all', false, { description: 'the open asks of every machine and repo, from the hq' })
|
|
25
|
+
json = Option.Boolean('--json', false, { description: 'with --all: every ask the hq holds, as json' })
|
|
26
|
+
|
|
22
27
|
async execute(): Promise<number> {
|
|
28
|
+
if (this.all) {
|
|
29
|
+
const { asksLines, hqAsks } = await import('../hq/files-send.ts')
|
|
30
|
+
const r = await hqAsks()
|
|
31
|
+
if ('refused' in r) {
|
|
32
|
+
this.context.stderr.write(`FAIL: ${r.refused}\n`)
|
|
33
|
+
return 1
|
|
34
|
+
}
|
|
35
|
+
this.context.stdout.write(`${this.json ? JSON.stringify(r.asks) : asksLines(r.asks).join('\n')}\n`)
|
|
36
|
+
return 0
|
|
37
|
+
}
|
|
23
38
|
try {
|
|
24
39
|
const root = process.cwd()
|
|
25
40
|
const c = await loadRepoConfig(root)
|
|
@@ -53,6 +68,43 @@ export class AsksCheckCommand extends Command {
|
|
|
53
68
|
}
|
|
54
69
|
}
|
|
55
70
|
|
|
71
|
+
/** an open ask by its file, its name without `.md`, or its number */
|
|
72
|
+
export function openAskFile(dir: string, arg: string): string {
|
|
73
|
+
const open = openAsks(dir).map((a) => a.file)
|
|
74
|
+
const n = /^\d+$/.test(arg) ? Number(arg) : null
|
|
75
|
+
const hit = open.filter((f) => f === arg || f === `${arg}.md` || (n != null && parseInt(f, 10) === n))
|
|
76
|
+
if (hit.length === 1) return hit[0]!
|
|
77
|
+
throw new Error(hit.length === 0 ? `no open ask ${arg} in ${dir} (sk asks lists them)` : `${arg} names ${hit.length} asks: ${hit.join(', ')}`)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export class AsksDeclineCommand extends Command {
|
|
81
|
+
static override paths = [['asks', 'decline']]
|
|
82
|
+
static essential = { args: '<ask>' }
|
|
83
|
+
|
|
84
|
+
static override usage = Command.Usage({
|
|
85
|
+
category: 'Asks',
|
|
86
|
+
description: "the owner's « I will not do this »: the ask closes as declined and stays declined",
|
|
87
|
+
details: "The owner's word, never an agent's: an agent that thinks an ask is moot says so in a remark or a report, and the owner decides. The file gets status: declined, the day and the reason, and moves to declined/. To undo, set its status back to open: the next `sk asks check` brings it back. `sk ask` then refuses the same title or secret until a fact changed after the owner's no and it is asked again on purpose with --again --why.",
|
|
88
|
+
examples: [['decline ask 19, with a reason', 'sk asks decline 19 --why "not worth a paid key"'], ['by its file', 'sk asks decline 019-mint-a-key.md']],
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
ask = Option.String({ required: true })
|
|
92
|
+
why = Option.String('--why', { required: false, description: 'the reason, one line, kept in the file for every agent that reads it' })
|
|
93
|
+
|
|
94
|
+
async execute(): Promise<number> {
|
|
95
|
+
try {
|
|
96
|
+
const dir = await asksDir(process.cwd())
|
|
97
|
+
const file = openAskFile(dir, this.ask)
|
|
98
|
+
declineAsk(dir, file, this.why)
|
|
99
|
+
this.context.stdout.write(`declined ${dir}/declined/${file}\nundo: set its status back to open, then sk asks check\n`)
|
|
100
|
+
return 0
|
|
101
|
+
} catch (e) {
|
|
102
|
+
this.context.stderr.write(`FAIL: ${e instanceof Error ? e.message : String(e)}\n`)
|
|
103
|
+
return 1
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
56
108
|
export class AskNewCommand extends Command {
|
|
57
109
|
static override paths = [['ask'], ['asks', 'new']]
|
|
58
110
|
static essential = { args: '<title>' }
|
|
@@ -65,6 +117,9 @@ export class AskNewCommand extends Command {
|
|
|
65
117
|
['with a reason', 'sk ask "buy the domain" --why "landing page is blocked on it"'],
|
|
66
118
|
['with metadata', 'sk ask "buy the domain" --kind action --blocks deploy --check "dig +short example.com"'],
|
|
67
119
|
['a token he pastes in the hub', 'sk ask "mint the npm token" --secret rv/npm/token'],
|
|
120
|
+
['a login: its account and its password, both typed in the hub', 'sk ask "the shop admin login" --login rv/shop/admin'],
|
|
121
|
+
['out of the way until a day', 'sk ask "delete the old copies" --after 2d'],
|
|
122
|
+
['an ask he declined, again with what changed', 'sk ask "mint the npm token" --again --why "the free tier ended"'],
|
|
68
123
|
],
|
|
69
124
|
})
|
|
70
125
|
|
|
@@ -74,11 +129,22 @@ export class AskNewCommand extends Command {
|
|
|
74
129
|
check = Option.String('--check', { required: false, description: 'shell probe that exits 0 once the ask is done (enables auto-close)' })
|
|
75
130
|
why = Option.String('--why', { required: false, description: 'one line of context: why this is worth a human interrupt' })
|
|
76
131
|
secret = Option.Array('--secret', { required: false, description: 'a secret name the human stores (repeat for more): a credential ask whose page takes the pasted value' })
|
|
132
|
+
after = Option.String('--after', { required: false, description: 'the day it waits for (YYYY-MM-DD, YYYY-MM-DDTHH:MM, 2d, 1w): later until then, not counted, not pinged' })
|
|
133
|
+
login = Option.Array('--login', { required: false, description: 'a secret that is a login (repeat for more): the hub takes its account (email or user name) beside its password, stored together' })
|
|
134
|
+
again = Option.Boolean('--again', false, { description: 'ask again what the owner declined (same title or secret), on purpose: --why says what changed' })
|
|
77
135
|
|
|
78
136
|
async execute(): Promise<number> {
|
|
79
137
|
try {
|
|
138
|
+
const after = this.after == null ? undefined : afterValue(this.after, new Date())
|
|
80
139
|
const dir = await asksDir(process.cwd())
|
|
81
|
-
const
|
|
140
|
+
const logins = this.login ?? []
|
|
141
|
+
const secrets = [...new Set([...(this.secret ?? []), ...logins])]
|
|
142
|
+
const who = secrets.length === 0 ? {} : await (await import('../secrets/who-reads.ts')).whoReads(secrets, process.cwd())
|
|
143
|
+
// the vault files a secret by its registry row: a name with none is refused when he stores it, so the ask is refused first
|
|
144
|
+
const stray = Object.values(who).filter((w) => !w.registered).map((w) => w.name)
|
|
145
|
+
if (stray.length > 0) throw new Error(`--secret ${stray.join(', ')}: no row in the secret registry, so the vault would refuse the value he pastes. Add ${stray.length > 1 ? 'their rows' : 'its row'} first (the name, what it is for, its scope), then run this again`)
|
|
146
|
+
const readers = secrets.length === 0 ? undefined : Object.fromEntries(Object.entries(who).map(([n, w]) => [n, w.words]))
|
|
147
|
+
const file = createAsk(dir, this.title, { kind: this.kind, blocks: this.blocks, check: this.check, why: this.why, secrets, logins, after, again: this.again, readers })
|
|
82
148
|
this.context.stdout.write(`created ${dir}/${file}\nfill every {{placeholder}} in it: the hub shows the body as written\n`)
|
|
83
149
|
return 0
|
|
84
150
|
} catch (e) {
|
package/src/cli/cmd_Backup.ts
CHANGED
|
@@ -110,12 +110,12 @@ export class BackupRestoreCommand extends Command {
|
|
|
110
110
|
category: 'Media',
|
|
111
111
|
description: 'a backup run written back, every sha checked: to an empty folder, or in place',
|
|
112
112
|
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 .
|
|
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 .shipkit/home/veille']],
|
|
114
114
|
})
|
|
115
115
|
to = Option.String('--to', { description: 'an empty or new folder the files land under' })
|
|
116
116
|
inPlace = Option.Boolean('--in-place', false, { description: 'over the live files, each one replaced copied aside first' })
|
|
117
117
|
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' })
|
|
118
|
+
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
119
|
host = Option.String('--host', { description: "another Mac's runs, by the name `sk backup runs` prints: this Mac's when absent" })
|
|
120
120
|
async execute(): Promise<number> {
|
|
121
121
|
return run(this.context, async (h) => {
|
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'],
|
|
@@ -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}`)
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// sk db: every database of this machine, its size on disk, its cap, its copies, and each table's rows and bytes, the
|
|
2
|
+
// words of the home's database page. Report only: every file is opened read only, never a row's content
|
|
3
|
+
import { Command, Option } from 'clipanion'
|
|
4
|
+
import { StoreRefused, WAIT_EXIT } from '../core/machine-db.ts'
|
|
5
|
+
|
|
6
|
+
export class DbCommand extends Command {
|
|
7
|
+
static override paths = [['db']]
|
|
8
|
+
|
|
9
|
+
static override usage = Command.Usage({
|
|
10
|
+
category: 'Health',
|
|
11
|
+
description: 'every database of this machine: its size on disk, its cap, each table with its rows and bytes',
|
|
12
|
+
details: "The total first, how much of it is the truth, caches that build again and this machine's own state, then each house repo's share of every database (by project; a project's bytes in a shared table are an estimate, and what names no repo is said apart). Then the hq, with its versions, its feed, its replica, its last restore drill and each node's rows of each kind against its share, then the daemon's database, the machine db (its own state, and the media index and the agent time index as its media_ and time_ tables, each part with its tables) and each house repo's run record, the biggest first. A store still in its own file (before `sk db fold`) is listed apart. Sizes and pages are read at each call; the rows and bytes of each table are those the daemon's job `db census` counted, with their age, since a count of the big files takes seconds. `--fresh` counts every file now, in this process. Every file is opened read only and none is made.",
|
|
13
|
+
examples: [
|
|
14
|
+
['every database', 'sk db'],
|
|
15
|
+
['the hq alone', 'sk db hq'],
|
|
16
|
+
['how much one project takes in every database', 'sk db <repo id>'],
|
|
17
|
+
['count every table now', 'sk db --fresh'],
|
|
18
|
+
['machine readable', 'sk db --json'],
|
|
19
|
+
],
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
name = Option.String({ required: false, name: 'name' })
|
|
23
|
+
fresh = Option.Boolean('--fresh', false, { description: 'count every table of every file now, in this process: seconds on a big file' })
|
|
24
|
+
json = Option.Boolean('--json', false, { description: 'the answer of the page as json' })
|
|
25
|
+
|
|
26
|
+
async execute(): Promise<number> {
|
|
27
|
+
const { homedir } = await import('node:os')
|
|
28
|
+
const { houseRoot } = await import('../home/home-start.ts')
|
|
29
|
+
const { houseRepos } = await import('../serve/project-gutter.ts')
|
|
30
|
+
const { censusTick, databasesPage, houseProjects } = await import('../home/databases.ts')
|
|
31
|
+
const { databaseLines, ESTIMATE_HOW, partWords, projectWords } = await import('../home/database-words.ts')
|
|
32
|
+
const house = houseRoot(process.cwd())
|
|
33
|
+
const repos = house == null ? [] : houseRepos(house, homedir()).repos.map((r) => ({ name: r.name, path: r.path }))
|
|
34
|
+
if (house == null) this.context.stderr.write('WARN: no house found from here: no run record is listed\n')
|
|
35
|
+
if (this.fresh) censusTick({ repos, projects: await houseProjects(repos), all: true, print: (l) => void this.context.stderr.write(`${l}\n`) })
|
|
36
|
+
const now = Date.now()
|
|
37
|
+
const page = await databasesPage({ repos, now })
|
|
38
|
+
const want = this.name?.toLowerCase()
|
|
39
|
+
const shown = want == null ? page : { ...page, dbs: page.dbs.filter((d) => d.id.toLowerCase().startsWith(want) || d.name.toLowerCase() === want) }
|
|
40
|
+
// a project's id wins over its run record's name: its share of every database, one line a part
|
|
41
|
+
const project = want == null ? undefined : page.projects.find((p) => p.id.toLowerCase() === want)
|
|
42
|
+
if (project != null) {
|
|
43
|
+
if (this.json) {
|
|
44
|
+
this.context.stdout.write(`${JSON.stringify(project)}\n`)
|
|
45
|
+
return 0
|
|
46
|
+
}
|
|
47
|
+
const names = new Map(page.dbs.map((d) => [d.id, d.kind === 'record' ? 'run record' : d.name]))
|
|
48
|
+
const parts = project.parts.filter((x) => x.rows > 0).map((x) => ` ${names.get(x.db) ?? x.db}: ${partWords(x)}`)
|
|
49
|
+
this.context.stdout.write(`${[projectWords(project, names), ...parts, `(${ESTIMATE_HOW})`].join('\n')}\n`)
|
|
50
|
+
return 0
|
|
51
|
+
}
|
|
52
|
+
if (shown.dbs.length === 0) {
|
|
53
|
+
this.context.stderr.write(`FAIL: no database or project named ${JSON.stringify(this.name)}: ${[...page.dbs.map((d) => d.id), ...page.projects.map((p) => p.id)].join(', ')}\n`)
|
|
54
|
+
return 1
|
|
55
|
+
}
|
|
56
|
+
if (this.json) {
|
|
57
|
+
this.context.stdout.write(`${JSON.stringify(shown)}\n`)
|
|
58
|
+
return 0
|
|
59
|
+
}
|
|
60
|
+
this.context.stdout.write(`${databaseLines(shown, now).join('\n')}\n`)
|
|
61
|
+
if (want == null) {
|
|
62
|
+
const { foldWords } = await import('../home/machine-fold.ts')
|
|
63
|
+
try {
|
|
64
|
+
this.context.stdout.write(`${foldWords().join('\n')}\n`)
|
|
65
|
+
} catch (e) {
|
|
66
|
+
this.context.stdout.write(`WARN the fold's state does not read: ${(e as Error).message}\n`)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return 0
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** sk db fold: the media index, the agent time index and the daemon's file into the machine db, the machine's one
|
|
74
|
+
* local file */
|
|
75
|
+
export class DbFoldCommand extends Command {
|
|
76
|
+
static override paths = [['db', 'fold']]
|
|
77
|
+
|
|
78
|
+
static override usage = Command.Usage({
|
|
79
|
+
category: 'Health',
|
|
80
|
+
description: "the media and agent time indexes and the daemon's file into the machine db (dry run first)",
|
|
81
|
+
details: "Says what it would do: each store still in a file of its own, its size, where its whole copy goes (`<file>.before-fold`, the way back) and the room it needs. With `--go`, per store: the copy, its rows copied into the machine db's `media_` or `time_` tables (the daemon's file: its tables under their own names) in steps of a few ms, every table counted on both sides (a difference drops the new tables and keeps the file), then the old file replaced by a text tombstone that code before the fold refuses to open. A fold by hand turns the daemon's fold on (the switch db-fold-auto). `--back --go` (with the home down: `sk pm uninstall`) writes every row of the tables, those added since the fold too, into a file of the old shape that replaces each tombstone, then drops the tables and turns the daemon's fold off: each store is then read and written in its own file, for as long as the owner wants, with no other code. On a machine never folded it gives each file the tables this code reads. A fold or a way back killed at any step is ended by the next run of either.",
|
|
82
|
+
examples: [
|
|
83
|
+
['what the fold would do', 'sk db fold'],
|
|
84
|
+
['fold', 'sk db fold --go'],
|
|
85
|
+
['the way back', 'sk db fold --back --go'],
|
|
86
|
+
['the copies kept for the way back, deleted once sure', 'sk db fold --rm-copies --go'],
|
|
87
|
+
],
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
go = Option.Boolean('--go', false, { description: 'do it; without it, say what it would do' })
|
|
91
|
+
back = Option.Boolean('--back', false, { description: 'put each store back in its own file from its copy' })
|
|
92
|
+
noticeDone = Option.String('--notice-done', { required: false, description: "the check of the fold's notice: exits 0 on the machine of that key once its copies are gone" })
|
|
93
|
+
rmCopies = Option.Boolean('--rm-copies', false, { description: 'the copies a fold kept for the way back: says which, --go deletes them' })
|
|
94
|
+
|
|
95
|
+
async execute(): Promise<number> {
|
|
96
|
+
const { fold, foldPlan, foldWords, rmCopies, unfold } = await import('../home/machine-fold.ts')
|
|
97
|
+
if (this.noticeDone != null) {
|
|
98
|
+
const { noticeDone, shortKey } = await import('../home/machine-fold.ts')
|
|
99
|
+
if (noticeDone(this.noticeDone)) return 0
|
|
100
|
+
this.context.stderr.write(this.noticeDone === shortKey() ? 'the copies of the old files are still here: sk db fold --rm-copies\n' : `this is machine ${shortKey()}, the notice is machine ${this.noticeDone}'s: its check runs there\n`)
|
|
101
|
+
return 1
|
|
102
|
+
}
|
|
103
|
+
if (this.rmCopies) {
|
|
104
|
+
rmCopies({ go: this.go, print: (l) => void this.context.stdout.write(`${l}\n`) })
|
|
105
|
+
return 0
|
|
106
|
+
}
|
|
107
|
+
const { machineDbPath } = await import('../core/machine-db.ts')
|
|
108
|
+
const print = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
109
|
+
const mb = (b: number): string => `${Math.round(b / 1e6)} MB`
|
|
110
|
+
const plan = foldPlan()
|
|
111
|
+
const { oldDamage } = await import('../home/machine-fold.ts')
|
|
112
|
+
print(`this machine's key: ${(await import('../home/machine-fold.ts')).shortKey()}`)
|
|
113
|
+
for (const s of plan.states) {
|
|
114
|
+
const hurt = !this.back && s.state === 'own file' ? oldDamage(s.old) : null
|
|
115
|
+
print(`${s.store}: ${s.state === 'own file' ? `its own file ${s.old}, ${mb(s.bytes)}${hurt == null ? '' : `, DAMAGED (${hurt}): the fold leaves it as it is`}` : s.state === 'folded' ? `folded into ${machineDbPath()}${s.copy == null ? '' : `, its copy ${s.copy.path} ${mb(s.copy.bytes)}`}` : s.state === 'half' ? `a ${s.mark?.way === 'back' ? 'way back' : 'fold'} stopped half way: sk db fold ${s.mark?.way === 'back' ? '--back ' : ''}--go ends it` : 'no file'}`)
|
|
116
|
+
}
|
|
117
|
+
if (!this.go) {
|
|
118
|
+
for (const l of foldWords().slice(0, 1)) print(l)
|
|
119
|
+
if (this.back) print(`dry run: --back --go puts back ${plan.states.filter((s) => s.state === 'folded' && s.copy != null).map((s) => s.store).join(' and ') || 'nothing'}`)
|
|
120
|
+
else print(`dry run: --go folds ${plan.states.filter((s) => s.state === 'own file' || s.state === 'half').map((s) => s.store).join(' and ') || 'nothing'} into ${machineDbPath()}; it needs ${mb(plan.need)}, the disk has ${mb(plan.free)} free`)
|
|
121
|
+
return 0
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
// the daemon keeps the media index open: a write it makes to the tables after their rows went back is lost
|
|
125
|
+
if (this.back && (await (await import('../home/home-paths.ts')).pmUp())) {
|
|
126
|
+
this.context.stderr.write('FAIL: the way back needs the home down, its daemon holds the media index and its own file open: sk pm uninstall, then sk db fold --back --go, then sk pm install\n')
|
|
127
|
+
return 1
|
|
128
|
+
}
|
|
129
|
+
if (this.back) await unfold({ print })
|
|
130
|
+
else {
|
|
131
|
+
const done = await fold({ print, byHand: true })
|
|
132
|
+
for (const d of done) print(`${d.store}: ${d.done ? `folded in ${(d.ms / 1000).toFixed(1)} s, the longest step ${d.heldMs} ms` : d.why}`)
|
|
133
|
+
if (done.some((d) => d.why.startsWith('damaged'))) return 1
|
|
134
|
+
}
|
|
135
|
+
return 0
|
|
136
|
+
} catch (e) {
|
|
137
|
+
this.context.stderr.write(`FAIL: ${(e as Error).message}\n`)
|
|
138
|
+
return e instanceof StoreRefused && e.wait ? WAIT_EXIT : 1
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** sk db drop: a cache part of the machine db dropped and made again empty */
|
|
144
|
+
export class DbDropCommand extends Command {
|
|
145
|
+
static override paths = [['db', 'drop']]
|
|
146
|
+
|
|
147
|
+
static override usage = Command.Usage({
|
|
148
|
+
category: 'Health',
|
|
149
|
+
description: 'a cache part of the machine db dropped and made again empty',
|
|
150
|
+
details: "The part is `media` (the media index: it builds again from the files and the Space). The agent time index is never dropped: it alone holds what Claude Code pruned, and `sk db repair time` repairs a damaged table of it. Says what it would do; `--go` empties its tables in steps and makes them again. The machine's own tables are never a part.",
|
|
151
|
+
examples: [
|
|
152
|
+
['what it would drop', 'sk db drop media'],
|
|
153
|
+
['drop the media index, it builds again', 'sk db drop media --go'],
|
|
154
|
+
],
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
part = Option.String({ required: true, name: 'part' })
|
|
158
|
+
go = Option.Boolean('--go', false, { description: 'do it; without it, say what it would do' })
|
|
159
|
+
|
|
160
|
+
async execute(): Promise<number> {
|
|
161
|
+
const { dropPart, partNamed } = await import('../home/machine-repair.ts')
|
|
162
|
+
const store = partNamed(this.part)
|
|
163
|
+
if (store == null) {
|
|
164
|
+
this.context.stderr.write(`FAIL: no part ${JSON.stringify(this.part)}: media or time\n`)
|
|
165
|
+
return 1
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const r = await dropPart(store, { go: this.go, print: (l) => void this.context.stdout.write(`${l}\n`) })
|
|
169
|
+
for (const t of r.tables) this.context.stdout.write(` ${t.table} ${t.rows == null ? 'rows unread' : `${t.rows.toLocaleString('en-US')} rows`}\n`)
|
|
170
|
+
if (!r.done) this.context.stdout.write(`${r.why}\n`)
|
|
171
|
+
return r.done || !this.go ? 0 : 1
|
|
172
|
+
} catch (e) {
|
|
173
|
+
this.context.stderr.write(`FAIL: ${(e as Error).message}\n`)
|
|
174
|
+
return 1
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** sk db repair: the damaged tables of a part of the machine db repaired, every row that reads kept */
|
|
180
|
+
export class DbRepairCommand extends Command {
|
|
181
|
+
static override paths = [['db', 'repair']]
|
|
182
|
+
|
|
183
|
+
static override usage = Command.Usage({
|
|
184
|
+
category: 'Health',
|
|
185
|
+
description: 'the damaged tables of a part of the machine db repaired: every row that reads is kept',
|
|
186
|
+
details: "The part is `media`, `time` or `daemon`. It takes the tables sqlite's check finds damaged, a table or one of its indexes, and says first, for each, how many rows read and how many are lost (counted through an index that reads). `--go` saves every row that reads aside in steps (by rowid ranges, read around a damaged page), cuts the table out of the schema with the system's sqlite shell (a DROP stops at the damaged page, and bun's sqlite refuses to edit a schema), makes it again with its indexes and fills it again in steps. A damaged index alone loses no row. Killed at any step, it is ended by the next `--go`. The pages of the cut table stay unused until `sk db rebuild --go`. A store still in a file of its own (not folded) that sqlite finds damaged is written again by sqlite's recovery (`.recover`) into a new file in its place, the damaged one kept as `<file>.damaged`. For `daemon`, the cards it lost then come back from the hq: the feed is read again from its start, every head and message the hq holds that the store lacks lands, and the last line says how many came back and how many the hq did not hold.",
|
|
187
|
+
examples: [
|
|
188
|
+
['what a repair would keep and lose', 'sk db repair time'],
|
|
189
|
+
['repair', 'sk db repair time --go'],
|
|
190
|
+
],
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
part = Option.String({ required: true, name: 'part' })
|
|
194
|
+
go = Option.Boolean('--go', false, { description: 'do it; without it, say what it would keep and lose' })
|
|
195
|
+
|
|
196
|
+
async execute(): Promise<number> {
|
|
197
|
+
const { partNamed, repairPart } = await import('../home/machine-repair.ts')
|
|
198
|
+
const store = partNamed(this.part)
|
|
199
|
+
if (store == null) {
|
|
200
|
+
this.context.stderr.write(`FAIL: no part ${JSON.stringify(this.part)}: media, time or daemon\n`)
|
|
201
|
+
return 1
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
const { pmUp } = await import('../home/home-paths.ts')
|
|
205
|
+
const r = await repairPart(store, { go: this.go, print: (l) => void this.context.stdout.write(`${l}\n`), pmUp: this.go && (await pmUp()) })
|
|
206
|
+
if (!r.done) this.context.stdout.write(`${r.why}\n`)
|
|
207
|
+
// the cards a repair lost come back from the hq, which holds every row this machine sent or landed
|
|
208
|
+
if (r.done && store === 'daemon file') {
|
|
209
|
+
const cards = r.tables.filter((t) => t.table === 'review_cards' || t.table === 'review_msgs')
|
|
210
|
+
const lost = cards.some((t) => t.lost == null) ? null : cards.reduce((n, t) => n + (t.lost ?? 0), 0)
|
|
211
|
+
const { outboxLossLine } = await import('../hq/outbox.ts')
|
|
212
|
+
const { giveBackHere } = await import('../hq/cards.ts')
|
|
213
|
+
this.context.stdout.write(`ok: the daemon file: ${await giveBackHere(lost)}\n`)
|
|
214
|
+
const out = await outboxLossLine()
|
|
215
|
+
if (out != null) this.context.stdout.write(`${out}\n`)
|
|
216
|
+
}
|
|
217
|
+
return 0
|
|
218
|
+
} catch (e) {
|
|
219
|
+
this.context.stderr.write(`FAIL: ${(e as Error).message}\n`)
|
|
220
|
+
return 1
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** sk db rebuild: the machine db written again whole, its unused pages gone, every table checked */
|
|
226
|
+
export class DbRebuildCommand extends Command {
|
|
227
|
+
static override paths = [['db', 'rebuild']]
|
|
228
|
+
|
|
229
|
+
static override usage = Command.Usage({
|
|
230
|
+
category: 'Health',
|
|
231
|
+
description: 'the machine db written again whole into a new file, every table checked against the old one',
|
|
232
|
+
details: "Says what it would do and the room it needs. `--go` (with the home down: `sk pm uninstall`) writes the machine db again into a new file (VACUUM INTO: the pages a repair left unused are gone, every page read), counts and hashes every table of both, and renames the new file into place under the write lock, the old one kept as `<file>.before-rebuild`. A table that differs, a write by another process meanwhile, or a process that holds the file open renames nothing and says so. A page that does not read: `sk db repair` first.",
|
|
233
|
+
examples: [
|
|
234
|
+
['what it would do', 'sk db rebuild'],
|
|
235
|
+
['rebuild', 'sk db rebuild --go'],
|
|
236
|
+
],
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
go = Option.Boolean('--go', false, { description: 'do it; without it, say what it would do' })
|
|
240
|
+
|
|
241
|
+
async execute(): Promise<number> {
|
|
242
|
+
const { rebuild } = await import('../home/machine-repair.ts')
|
|
243
|
+
const { pmUp } = await import('../home/home-paths.ts')
|
|
244
|
+
try {
|
|
245
|
+
const r = await rebuild({ go: this.go, print: (l) => void this.context.stdout.write(`${l}\n`), pmUp: this.go && (await pmUp()) })
|
|
246
|
+
if (!r.done) this.context.stdout.write(`${r.why}\n`)
|
|
247
|
+
return r.done || !this.go ? 0 : 1
|
|
248
|
+
} catch (e) {
|
|
249
|
+
this.context.stderr.write(`FAIL: ${(e as Error).message}\n`)
|
|
250
|
+
return 1
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|