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
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// sk history: the owner's prompts and the day rows of `sk time` kept in the hq (wiki tools/shipkit/hq.md). `send`
|
|
2
|
+
// looks, sets the switch, or sends everything again; `check` proves the hq holds them; `forget` takes one prompt
|
|
3
|
+
// out of the hq for good. Every line counts or names ids, never a prompt's text
|
|
4
|
+
import { Command, Option } from 'clipanion'
|
|
5
|
+
|
|
6
|
+
const writer = (c: Command) => ({ out: (l: string) => c.context.stdout.write(`${l}\n`), err: (l: string) => c.context.stderr.write(`${l}\n`) })
|
|
7
|
+
|
|
8
|
+
async function house(): Promise<{ root: string; home: string }> {
|
|
9
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
10
|
+
const { homedir } = await import('node:os')
|
|
11
|
+
return { root: findRepoRoot(process.cwd()), home: homedir() }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class HistorySendCommand extends Command {
|
|
15
|
+
static override paths = [['history', 'send']]
|
|
16
|
+
|
|
17
|
+
static override usage = Command.Usage({
|
|
18
|
+
category: 'Home',
|
|
19
|
+
description: "the owner's prompts and the day rows of sk time to the hq: --dry looks, --auto on|off sets it",
|
|
20
|
+
details: "The job `agent time` sends to the hq the prompts typed or queued in a Claude Code session of a house repo, of its worktrees, and of a folder the house config's `history.also` names (secret shapes masked), and once an hour the day rows of `sk time`, while the machine db switch `hq-history` is on, its default off. What `history.skip` names never leaves, and every other folder stays on this machine. `--dry` counts what a look would send and lists every folder by where it goes: sent, skipped by name, left here; it changes nothing. `--again` sends every prompt and day row again (`--days <n>`: of the last n days), whatever this machine saw the hq take: what `sk history check` asks for when it fails.",
|
|
21
|
+
examples: [['what a look would send, and every folder by where it goes', 'sk history send --dry'], ['the daemon sends them from now on', 'sk history send --auto on'], ['send the last 30 days again', 'sk history send --again --days 30']],
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
dry = Option.Boolean('--dry', false, { description: 'count what a look would send and list every folder by where it goes, change nothing' })
|
|
25
|
+
auto = Option.String('--auto', { description: 'on: the agent time job sends them to the hq; off: nothing of it runs (the default)' })
|
|
26
|
+
again = Option.Boolean('--again', false, { description: 'send every prompt and day row again, whatever the hq took' })
|
|
27
|
+
days = Option.String('--days', { description: 'with --again: only the last n days' })
|
|
28
|
+
|
|
29
|
+
async execute(): Promise<number> {
|
|
30
|
+
const w = writer(this)
|
|
31
|
+
if (this.auto !== undefined) {
|
|
32
|
+
if (this.auto !== 'on' && this.auto !== 'off') {
|
|
33
|
+
w.err(`FAIL: --auto takes on or off, not ${this.auto}`)
|
|
34
|
+
return 1
|
|
35
|
+
}
|
|
36
|
+
const { setHistoryOn } = await import('../hq/switch.ts')
|
|
37
|
+
if (!setHistoryOn(this.auto === 'on')) {
|
|
38
|
+
w.err('FAIL: the machine db does not open: the switch is not set')
|
|
39
|
+
return 1
|
|
40
|
+
}
|
|
41
|
+
w.out(`ok: the switch hq-history is ${this.auto}${this.auto === 'on' ? ': the daemon job agent time sends them at its next look (sk daemon job "agent time" runs one now)' : ''}`)
|
|
42
|
+
return 0
|
|
43
|
+
}
|
|
44
|
+
const days = daysOf(this.days, w)
|
|
45
|
+
if (days === false) return 1
|
|
46
|
+
if (days != null && !this.again) {
|
|
47
|
+
w.err('FAIL: --days narrows --again: sk history send --again --days <n>')
|
|
48
|
+
return 1
|
|
49
|
+
}
|
|
50
|
+
if (!this.dry && !this.again) {
|
|
51
|
+
w.err('FAIL: sk history send --dry looks, --auto on|off sets the switch, --again sends everything again. The job runs in the daemon while the switch is on')
|
|
52
|
+
return 1
|
|
53
|
+
}
|
|
54
|
+
const { historyOn } = await import('../hq/switch.ts')
|
|
55
|
+
if (!this.dry && !historyOn()) {
|
|
56
|
+
w.err('FAIL: the switch hq-history is off: nothing is sent (sk history send --auto on)')
|
|
57
|
+
return 1
|
|
58
|
+
}
|
|
59
|
+
const { agentTimeDbPath, openIndex } = await import('../agent-time/store.ts')
|
|
60
|
+
const { historySendTick } = await import('../hq/history-send.ts')
|
|
61
|
+
const { Database } = await import('bun:sqlite')
|
|
62
|
+
const h = await house()
|
|
63
|
+
// a look reads the index as it is: no table of it is made or moved
|
|
64
|
+
const index = this.dry ? new Database(agentTimeDbPath(h.home), { readonly: true }) : openIndex(agentTimeDbPath(h.home))
|
|
65
|
+
try {
|
|
66
|
+
if (this.dry) w.out(`the switch hq-history is ${historyOn() ? 'on' : 'off'}: a look of the job would send this`)
|
|
67
|
+
return await historySendTick({ ...h, index, print: w.out, printErr: w.err, dry: this.dry, ...(this.again ? { again: { since: days == null ? 0 : Date.now() - days * 24 * 3600_000 } } : {}) })
|
|
68
|
+
} finally {
|
|
69
|
+
index.close()
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** a number of days of a flag: undefined when absent, false (said) when it is none */
|
|
75
|
+
function daysOf(v: string | undefined, w: { err: (l: string) => void }): number | undefined | false {
|
|
76
|
+
if (v === undefined) return undefined
|
|
77
|
+
const d = Number(v)
|
|
78
|
+
if (Number.isInteger(d) && d > 0 && d <= 4000) return d
|
|
79
|
+
w.err(`FAIL: --days ${v}: a whole number of days`)
|
|
80
|
+
return false
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** the machine db row of the last green check of the whole index: how many prompts the hq held of this node then,
|
|
84
|
+
* its forgotten rows counted */
|
|
85
|
+
const CHECKED = 'hq-history-checked'
|
|
86
|
+
|
|
87
|
+
export class HistoryCheckCommand extends Command {
|
|
88
|
+
static override paths = [['history', 'check']]
|
|
89
|
+
|
|
90
|
+
static override usage = Command.Usage({
|
|
91
|
+
category: 'Home',
|
|
92
|
+
description: "does the hq hold the owner's prompts and day rows as the index says: every one",
|
|
93
|
+
details: "The index first reads every transcript on disk. Then every prompt of the whole index that is to be sent (`--days <n>`: of the last n days) is asked of the hq by its id and the sha of its masked text, one line per account: missing or with another text is red, and `sk history send --again` sends them again; held from another node (a copied session) counts as held. A prompt of a folder skipped by name since it went is red: `sk history forget --skipped` takes those out. What the hq holds of this node beyond the index (prompts the index lost, an earlier reading of a queued prompt) is counted and kept: the hq is their copy. Of the whole index, the hq must hold no fewer prompts of this node, forgotten ones counted, than at the last green check (kept in the machine db; `--recount` accepts a loss). Each closed day (not today, not yesterday) is built again and compared with this node's day row by its sha. Exit 0 only when every line is ok: the proof asked before Claude Code may delete transcripts sooner. It prints counts and ids, never a prompt's text.",
|
|
94
|
+
examples: [['the whole index', 'sk history check'], ['the last week', 'sk history check --days 7']],
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
days = Option.String('--days', { description: 'only the last n days' })
|
|
98
|
+
recount = Option.Boolean('--recount', false, { description: 'forget the count of the last green check first: a loss taken as lost' })
|
|
99
|
+
|
|
100
|
+
async execute(): Promise<number> {
|
|
101
|
+
const w = writer(this)
|
|
102
|
+
const days = daysOf(this.days, w)
|
|
103
|
+
if (days === false) return 1
|
|
104
|
+
const { agentTimeDbPath, freshness, indexTranscripts, listTranscripts, openIndex } = await import('../agent-time/store.ts')
|
|
105
|
+
const { discoverConfigRoots } = await import('../reflect/prompt-corpus.ts')
|
|
106
|
+
const { houseScope } = await import('../hq/history-send.ts')
|
|
107
|
+
const { historyCheck } = await import('../hq/history-check.ts')
|
|
108
|
+
const { myHq } = await import('../hq/hq-local.ts')
|
|
109
|
+
const { machineDelete, machineGet, machineSet } = await import('../core/machine-db.ts')
|
|
110
|
+
const h = await house()
|
|
111
|
+
const hq = myHq()
|
|
112
|
+
if ('refused' in hq) {
|
|
113
|
+
w.err(`FAIL the hq is not reached: ${hq.refused}`)
|
|
114
|
+
return 1
|
|
115
|
+
}
|
|
116
|
+
if (this.recount) machineDelete(CHECKED)
|
|
117
|
+
const index = openIndex(agentTimeDbPath(h.home))
|
|
118
|
+
try {
|
|
119
|
+
const files = listTranscripts(discoverConfigRoots(h.home))
|
|
120
|
+
indexTranscripts(index, files)
|
|
121
|
+
const held = index.query('select size, mtime, offset, version from time_files where path = ?')
|
|
122
|
+
const unread = files.filter((f) => freshness(held.get(f.path) as Parameters<typeof freshness>[0], f) !== 'skip').length
|
|
123
|
+
const last = machineGet<{ held?: number; at: number }>(CHECKED)?.held ?? null
|
|
124
|
+
const r = await historyCheck({ index, link: hq, scope: await houseScope(h.root, h.home), now: Date.now(), days: days ?? null, unread, last })
|
|
125
|
+
for (const l of r.lines) (l.startsWith('FAIL') ? w.err : w.out)(l)
|
|
126
|
+
if (r.ok && days == null) machineSet(CHECKED, { held: r.held, at: Date.now() })
|
|
127
|
+
return r.ok ? 0 : 1
|
|
128
|
+
} finally {
|
|
129
|
+
index.close()
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export class HistoryForgetCommand extends Command {
|
|
135
|
+
static override paths = [['history', 'forget']]
|
|
136
|
+
|
|
137
|
+
static override usage = Command.Usage({
|
|
138
|
+
category: 'Home',
|
|
139
|
+
description: 'take a prompt out of the hq for good, by its id, or --skipped: no machine sends it back',
|
|
140
|
+
details: "For a prompt that holds a secret no shape caught (a password typed in plain words). Asked on the machine that carries the hq, in its console: the daemon removes the row and keeps its id as forgotten, so a copy from any machine is refused from then on. The replica in the Space keeps its older copies until Litestream compacts them. The rows of it this machine's outbox kept after the hq took them go too; the prompt stays in this machine's own index, in the outbox of another machine that sent it for up to 10 minutes, and in a `.before-vN` copy of the hq's file made since it landed. Its id is what `sk history check` and `sk reflect` name. `--skipped`, on any machine: every prompt this machine sent of a folder `history.skip` names since, counted, then taken out with `--yes`.",
|
|
141
|
+
examples: [['forget one prompt', 'sk history forget 0f2c9e1a-1b2c-4d3e-8f90-123456789abc'], ['the prompts of a folder skipped since they went', 'sk history forget --skipped --yes']],
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
id = Option.String({ required: false })
|
|
145
|
+
skipped = Option.Boolean('--skipped', false, { description: 'every prompt of a folder now skipped by name' })
|
|
146
|
+
yes = Option.Boolean('--yes', false, { description: 'with --skipped: yes, for good' })
|
|
147
|
+
|
|
148
|
+
async execute(): Promise<number> {
|
|
149
|
+
const w = writer(this)
|
|
150
|
+
if (this.skipped) return this.forgetSkipped(w)
|
|
151
|
+
if (this.id == null || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^q[A-Za-z0-9_-]{21}$/.test(this.id)) {
|
|
152
|
+
w.err(`FAIL: ${(this.id ?? '').slice(0, 60)} is no prompt id: a uuid, or q and 21 characters`)
|
|
153
|
+
return 1
|
|
154
|
+
}
|
|
155
|
+
const id = this.id
|
|
156
|
+
const { daemonUrl } = await import('../home/home-paths.ts')
|
|
157
|
+
let r: Record<string, unknown>
|
|
158
|
+
try {
|
|
159
|
+
const res = await fetch(`${daemonUrl()}/api/home/hq/forget`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ kind: 'prompt', name: id }) })
|
|
160
|
+
r = (await res.json()) as Record<string, unknown>
|
|
161
|
+
} catch (e) {
|
|
162
|
+
r = { refused: `the daemon of this machine does not answer (${(e as Error).message}): sk pm starts it` }
|
|
163
|
+
}
|
|
164
|
+
if (typeof r['refused'] === 'string') {
|
|
165
|
+
w.err(`FAIL: ${r['refused']}`)
|
|
166
|
+
return 1
|
|
167
|
+
}
|
|
168
|
+
w.out(r['held'] === true ? `ok: prompt ${id} left the hq, and no machine sends it back` : `ok: the hq held no prompt ${id}; it is refused from now on`)
|
|
169
|
+
// and this machine's outbox: the rows the hq took are kept a while
|
|
170
|
+
const { openDaemonDb } = await import('../hq/outbox.ts')
|
|
171
|
+
const { dropForgotten } = await import('../hq/history-send.ts')
|
|
172
|
+
const db = openDaemonDb()
|
|
173
|
+
if (db != null)
|
|
174
|
+
try {
|
|
175
|
+
const n = dropForgotten(db, id, Date.now())
|
|
176
|
+
if (n > 0) w.out(`ok: ${n} copies of it left this machine's outbox`)
|
|
177
|
+
} finally {
|
|
178
|
+
db.close()
|
|
179
|
+
}
|
|
180
|
+
w.out("it stays in this machine's agent time index, and in the older copies of the hq's replica until Litestream drops them")
|
|
181
|
+
return 0
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private async forgetSkipped(w: ReturnType<typeof writer>): Promise<number> {
|
|
185
|
+
const { agentTimeDbPath, openIndex } = await import('../agent-time/store.ts')
|
|
186
|
+
const { houseScope } = await import('../hq/history-send.ts')
|
|
187
|
+
const { forgetSkipped } = await import('../hq/history-check.ts')
|
|
188
|
+
const { myHq } = await import('../hq/hq-local.ts')
|
|
189
|
+
const { openDaemonDb } = await import('../hq/outbox.ts')
|
|
190
|
+
const hq = myHq()
|
|
191
|
+
if ('refused' in hq) {
|
|
192
|
+
w.err(`FAIL the hq is not reached: ${hq.refused}`)
|
|
193
|
+
return 1
|
|
194
|
+
}
|
|
195
|
+
const h = await house()
|
|
196
|
+
const index = openIndex(agentTimeDbPath(h.home))
|
|
197
|
+
const db = openDaemonDb()
|
|
198
|
+
if (db == null) {
|
|
199
|
+
index.close()
|
|
200
|
+
w.err('FAIL: the daemon db does not open')
|
|
201
|
+
return 1
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
const r = await forgetSkipped({ index, link: hq, scope: await houseScope(h.root, h.home), db, now: Date.now(), yes: this.yes })
|
|
205
|
+
for (const l of r.lines) (l.startsWith('FAIL') ? w.err : w.out)(l)
|
|
206
|
+
return r.ok ? 0 : 1
|
|
207
|
+
} finally {
|
|
208
|
+
index.close()
|
|
209
|
+
db.close()
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
package/src/cli/cmd_Home.ts
CHANGED
|
@@ -5,12 +5,13 @@ import { stampConsole, stampedIo } from '../core/log-stamp.ts'
|
|
|
5
5
|
import { fileURLToPath } from 'url'
|
|
6
6
|
import { basename } from 'path'
|
|
7
7
|
import { markAutostart } from '../home/autostart.ts'
|
|
8
|
-
import { installHome, uninstallHome } from '../home/home-launchd.ts'
|
|
8
|
+
import { agentsDir, installHome, uninstallHome } from '../home/home-launchd.ts'
|
|
9
|
+
import { homeMove, whoRuns } from '../home/home-move.ts'
|
|
9
10
|
import { homeInstalled, houseCli, houseRoot, houseRootOf, openWindow, startHome } from '../home/home-start.ts'
|
|
10
11
|
import { ROLES } from '../home/pm.ts'
|
|
11
12
|
import { pmSwitchDeps, switchProcess } from '../home/pm-switch.ts'
|
|
12
13
|
import { homeUp, homeUrl, hubBase } from '../home/home-paths.ts'
|
|
13
|
-
import { homeRepo, houseIndex } from '../serve/project-gutter.ts'
|
|
14
|
+
import { homeRepo, houseIndex, houseRepos } from '../serve/project-gutter.ts'
|
|
14
15
|
import { homedir } from 'os'
|
|
15
16
|
import { execPm, runPm } from '../home/run-pm.ts'
|
|
16
17
|
import { runWeb } from '../home/run-web.ts'
|
|
@@ -90,7 +91,7 @@ export class DaemonJobCommand extends Command {
|
|
|
90
91
|
|
|
91
92
|
static override usage = Command.Usage({
|
|
92
93
|
category: 'Serve',
|
|
93
|
-
description: 'a daemon job now, in this process: backup,
|
|
94
|
+
description: 'a daemon job now, in this process: backup, annex, media store, hq report; a wrong id lists all',
|
|
94
95
|
details: 'what the daemon runs off its loop: it starts each job as this command in a child process, niced, its lines appended to the daemon\'s log, and never runs a job\'s body itself, so a walk, a VACUUM or a hash pass never holds a page. The backup holds a watch of its sources in the daemon: its child starts only when the watch heard a path that could be a source, a run waits, or every 30 min for a full walk; a look reads only the heard paths again, it runs when they moved and held still, and a run reads only the files whose size or time moved (every byte every 6 h). the retention sweep runs hourly, the media store passes every 30 s while it has work and every 5 min once a pass found none (sooner when a store folder moves), the global context is written and the apps in ~/Applications are built and swept when the stamp of their sources moved. What a job remembers between two runs lives in the machine db. Page: wiki tools/shipkit/home.md, Nothing heavy on the daemon\'s loop',
|
|
95
96
|
examples: [
|
|
96
97
|
['every global process app in ~/Applications built and swept now', 'sk daemon job apps'],
|
|
@@ -214,6 +215,33 @@ export class PmUninstallCommand extends Command {
|
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
217
|
|
|
218
|
+
export class HomeMoveCommand extends Command {
|
|
219
|
+
static override paths = [['home', 'move']]
|
|
220
|
+
|
|
221
|
+
static override usage = Command.Usage({
|
|
222
|
+
category: 'Serve',
|
|
223
|
+
description: "move the machine's state from ~/.config/shipkit to its one root ~/.shipkit (dry unless --go)",
|
|
224
|
+
details: "The machine's state (its db, the rail order, the home dir with the hq, the daemon's db, the media index and the vault) moves from ~/.config/shipkit to ~/.shipkit by rename on the same volume: never a copy, never over a file. A dry run prints each thing it would move with its size, each file that names the old path, and why it would refuse. --go refuses while any other shipkit process of this home runs (by the real process list and the files held open: pm, the daemon, the web, the vault, the replica, a session's review watch, any sk command) or pm's LaunchAgent is loaded, and names how to stop each; while the move runs, every process answers from its record and none makes a store under either root; then each step checks its own state, so a move stopped anywhere finishes when run again. It refuses too while an initialised vault's marker does not record the audit path it was initialised with: bao keeps that path in its own storage and would never turn active from the new place. It rewrites shipkit's own files that name the old path (the pm agent, Litestream's config; never the vault's, which keep the path bao keeps and still resolve through the link), sets aside and names what a process left at the old place, and leaves ~/.config/shipkit an absolute link to ~/.shipkit, so a tool that names the old path still reads. --back undoes it from the record ~/.shipkit/home-move.json, dry too unless --go. Until the move, every command reads the old place: nothing else changes",
|
|
225
|
+
examples: [
|
|
226
|
+
['what it would do', 'sk home move'],
|
|
227
|
+
['do it, once pm, the vault and the replica are stopped', 'sk home move --go'],
|
|
228
|
+
['undo it', 'sk home move --back --go'],
|
|
229
|
+
],
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
go = Option.Boolean('--go', false, { description: 'do it (else a dry run)' })
|
|
233
|
+
back = Option.Boolean('--back', false, { description: 'move the state back to ~/.config/shipkit, from the record of the move' })
|
|
234
|
+
|
|
235
|
+
async execute(): Promise<number> {
|
|
236
|
+
const home = homedir()
|
|
237
|
+
if (process.env.SHIPKIT_HOME_DIR || process.env.SHIPKIT_MACHINE_DB) io(this).print(`note: SHIPKIT_HOME_DIR or SHIPKIT_MACHINE_DB is set: this process reads that place, the move moves ${home}'s roots`)
|
|
238
|
+
const root = houseRoot(process.cwd(), { home })
|
|
239
|
+
const repos = root == null ? [] : [root, ...houseRepos(root, home).repos.map((r) => r.path)]
|
|
240
|
+
const keychains = (): string[] => Bun.spawnSync(['security', 'list-keychains', '-d', 'user'], { stdout: 'pipe', stderr: 'ignore' }).stdout.toString().split('\n').map((l) => l.trim().replace(/^"|"$/g, '')).filter((l) => l !== '')
|
|
241
|
+
return homeMove({ home, go: this.go, back: this.back, print: io(this).print, agents: agentsDir(home), running: () => whoRuns(home, agentsDir(home)), repos: [...new Set(repos)], keychains })
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
217
245
|
export class GuiCommand extends Command {
|
|
218
246
|
static override paths = [['gui']]
|
|
219
247
|
|