rvlib-shipkit 2.26.0 → 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/package.json +1 -1
- package/src/agent-time/diet.ts +77 -0
- package/src/agent-time/family.ts +72 -0
- package/src/agent-time/hooks.ts +16 -7
- package/src/agent-time/limits.ts +44 -0
- package/src/agent-time/live.ts +12 -8
- package/src/agent-time/mask.ts +96 -18
- package/src/agent-time/refused.ts +45 -0
- package/src/agent-time/registry.ts +289 -0
- package/src/agent-time/render.ts +122 -21
- package/src/agent-time/report-cache.ts +57 -0
- package/src/agent-time/report.ts +314 -40
- package/src/agent-time/shape.ts +50 -3
- package/src/agent-time/store.ts +322 -101
- package/src/agent-time/timeline.ts +140 -21
- package/src/agent-time/turns.ts +18 -8
- package/src/annex/born.ts +2 -2
- package/src/annex/offload.ts +29 -17
- package/src/annex/tidy.ts +70 -10
- package/src/asks/ask-after.ts +44 -0
- package/src/asks/ask-bar-fold.ts +57 -0
- package/src/asks/ask-migrate.ts +280 -0
- package/src/asks/ask-steps-fold.ts +166 -0
- package/src/asks/ask-store.ts +586 -0
- package/src/assets/kit-config.ts +7 -3
- package/src/assets/kits/identity-kit.ts +361 -14
- package/src/assets/kits/poster-thumbnail.ts +282 -0
- package/src/check.ts +3 -1
- package/src/checks/SK003-claude-md-shape.check.ts +92 -25
- package/src/checks/SK004-gitignore-policy.check.ts +20 -9
- package/src/checks/SK013-one-way-in-policy.check.ts +18 -3
- package/src/checks/SK026-asks-autoclose.check.ts +9 -23
- package/src/checks/SK028-readme.check.ts +7 -66
- package/src/checks/SK030-cache-audit.check.ts +6 -1
- package/src/checks/SK031-trace-audit.check.ts +2 -0
- package/src/checks/SK033-global-contribution.check.ts +3 -1
- package/src/checks/SK035-public-clean.check.ts +2 -2
- package/src/checks/SK038-speaks-as.check.ts +3 -3
- package/src/checks/SK042-post-kinds.check.ts +26 -24
- package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
- package/src/checks/SK047-login-in-description.check.ts +36 -0
- package/src/checks/SK048-one-local-file.check.ts +36 -0
- package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
- package/src/checks/SK050-retired-commands.check.ts +127 -0
- package/src/cli/cmd_Asks.ts +244 -27
- package/src/cli/cmd_Backup.ts +153 -10
- package/src/cli/cmd_Calls.ts +1 -0
- package/src/cli/cmd_Capacity.ts +2 -2
- package/src/cli/cmd_Commands.ts +140 -34
- package/src/cli/cmd_Contracts.ts +1 -0
- package/src/cli/cmd_CrossRepoActivity.ts +5 -4
- package/src/cli/cmd_Db.ts +253 -0
- package/src/cli/cmd_History.ts +212 -0
- package/src/cli/cmd_Home.ts +31 -3
- package/src/cli/cmd_Hq.ts +516 -0
- package/src/cli/cmd_Keys.ts +1 -0
- package/src/cli/cmd_Lanes.ts +15 -4
- package/src/cli/cmd_Machines.ts +36 -0
- package/src/cli/cmd_Media.ts +38 -6
- package/src/cli/cmd_Messages.ts +152 -1
- package/src/cli/cmd_Needs.ts +1 -0
- package/src/cli/cmd_Reflect.ts +23 -2
- package/src/cli/cmd_Review.ts +1357 -223
- package/src/cli/cmd_Secret.ts +295 -24
- package/src/cli/cmd_Social.ts +113 -28
- package/src/cli/cmd_SocialDrafts.ts +235 -0
- package/src/cli/cmd_Sound.ts +22 -1
- package/src/cli/cmd_Space.ts +324 -0
- package/src/cli/cmd_Start.ts +3 -2
- package/src/cli/cmd_ThreadHolds.ts +34 -0
- package/src/cli/cmd_ThreadKinds.ts +146 -0
- package/src/cli/cmd_ThreadReflect.ts +83 -0
- package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
- package/src/cli/cmd_Time.ts +76 -5
- package/src/cli/cmd_Tmp.ts +28 -4
- package/src/cli/cmd_Trailer.ts +14 -10
- package/src/cli/cmd_Urls.ts +56 -0
- package/src/cli/cmd_Vault.ts +583 -0
- package/src/cli/cmd_When.ts +1 -0
- package/src/cli/family-help.ts +5 -3
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/kit/builtins.ts +1 -0
- package/src/cli/kit/verb.ts +6 -2
- package/src/cli/registry.ts +44 -4
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +42 -41
- package/src/collections/collection-types.ts +30 -4
- package/src/collections/md-body.ts +5 -3
- package/src/collections/pings.ts +13 -6
- package/src/collections/providers.ts +147 -61
- package/src/collections/reflections.ts +9 -4
- package/src/collections/review.ts +4 -4
- package/src/contracts/contract-manifests.ts +6 -5
- package/src/contracts/contract-types.ts +6 -4
- package/src/contracts/contracts-engine.ts +11 -0
- package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
- package/src/core/budget.ts +12 -17
- package/src/core/capacity.ts +27 -18
- package/src/core/check-runner.ts +7 -4
- package/src/core/discover-checks.ts +18 -3
- package/src/core/git.ts +31 -0
- package/src/core/house-layout.ts +17 -0
- package/src/core/layout.ts +13 -5
- package/src/core/locked-write.ts +4 -1
- package/src/core/machine-busy.ts +127 -0
- package/src/core/machine-commit.ts +6 -1
- package/src/core/machine-db.ts +370 -20
- package/src/core/machine-layout.ts +137 -0
- package/src/core/machine-read.ts +81 -0
- package/src/core/migrate-layout.ts +9 -11
- package/src/core/one-way-in-policy.ts +64 -7
- package/src/core/polling-policy.ts +27 -0
- package/src/core/retention.ts +16 -2
- package/src/core/scope.ts +107 -14
- package/src/core/slots.ts +5 -4
- package/src/drill/clean.ts +25 -1
- package/src/drill/run.ts +1 -1
- package/src/drill/seal.ts +27 -4
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +59 -3
- package/src/home/app-sign.ts +15 -4
- package/src/home/daemon-jobs.ts +161 -7
- package/src/home/database-projects.ts +111 -0
- package/src/home/database-words.ts +203 -0
- package/src/home/databases.ts +460 -0
- package/src/home/global-units.ts +6 -0
- package/src/home/gui-app/ShipkitGui.swift +122 -1
- package/src/home/gui-app.ts +6 -3
- package/src/home/home-move.ts +514 -0
- package/src/home/home-paths.ts +18 -6
- package/src/home/home-routes.ts +76 -0
- package/src/home/inbox-shape.ts +234 -91
- package/src/home/inbox.ts +26 -71
- package/src/home/machine-fold.ts +815 -0
- package/src/home/machine-host.ts +38 -5
- package/src/home/machine-repair.ts +503 -0
- package/src/home/machine-stores.ts +66 -15
- package/src/home/machine-temp.ts +547 -86
- package/src/home/other-macs.ts +2 -2
- package/src/home/resume.ts +79 -0
- package/src/home/run-daemon.ts +25 -4
- package/src/home/run-pm.ts +18 -5
- package/src/home/serve-daemon.ts +18 -3
- package/src/home/serve-web.ts +179 -10
- package/src/home/space-job.ts +115 -0
- package/src/home/space-page.ts +257 -0
- package/src/home/space-route.ts +167 -0
- package/src/home/space-words.ts +103 -0
- package/src/home/time-page-shape.ts +202 -0
- package/src/home/time-page.ts +64 -0
- package/src/home/vault-page.ts +516 -0
- package/src/home/vault-words.ts +132 -0
- package/src/hooks/leak-guard.ts +40 -13
- package/src/hooks/one-way-in-guard.ts +41 -6
- package/src/hq/cards.ts +581 -0
- package/src/hq/door-route.ts +43 -0
- package/src/hq/door.ts +163 -0
- package/src/hq/files-send.ts +347 -0
- package/src/hq/forgotten-log.ts +35 -0
- package/src/hq/history-check.ts +255 -0
- package/src/hq/history-place.ts +146 -0
- package/src/hq/history-send.ts +487 -0
- package/src/hq/hq-db.ts +102 -0
- package/src/hq/hq-local.ts +502 -0
- package/src/hq/hq-routes.ts +204 -0
- package/src/hq/hq-store.ts +603 -0
- package/src/hq/kinds/ask.ts +147 -0
- package/src/hq/kinds/card-gone.ts +83 -0
- package/src/hq/kinds/card-msg.ts +66 -0
- package/src/hq/kinds/card.ts +99 -0
- package/src/hq/kinds/index.ts +21 -0
- package/src/hq/kinds/kind.ts +126 -0
- package/src/hq/kinds/media.ts +125 -0
- package/src/hq/kinds/prompt.ts +219 -0
- package/src/hq/kinds/reflection.ts +128 -0
- package/src/hq/kinds/report.ts +55 -0
- package/src/hq/kinds/time-day.ts +236 -0
- package/src/hq/ledger.ts +473 -0
- package/src/hq/machine-key.ts +44 -0
- package/src/hq/machine-notes.ts +131 -0
- package/src/hq/outbox.ts +374 -0
- package/src/hq/replica.ts +167 -0
- package/src/hq/repo-id.ts +4 -0
- package/src/hq/report-facts.ts +117 -0
- package/src/hq/report.ts +274 -0
- package/src/hq/switch.ts +151 -0
- package/src/hq/vault-grant.ts +92 -0
- package/src/hq/vault-route.ts +112 -0
- package/src/identities/collection.ts +2 -2
- package/src/identities/identities.ts +24 -11
- package/src/identities/machine-route.ts +8 -3
- package/src/identities/steps.ts +31 -0
- package/src/ledger/db.ts +81 -27
- package/src/ledger/gate-checks.ts +6 -2
- package/src/ledger/run-log.ts +11 -3
- package/src/ledger/store.ts +26 -4
- package/src/media-store/backup/daemon.ts +73 -25
- package/src/media-store/backup/kept.ts +241 -0
- package/src/media-store/backup/keys.ts +1 -1
- package/src/media-store/backup/manifest.ts +20 -2
- package/src/media-store/backup/prune.ts +365 -0
- package/src/media-store/backup/restore.ts +14 -4
- package/src/media-store/backup/retention.ts +122 -0
- package/src/media-store/backup/run.ts +25 -19
- package/src/media-store/backup/secret.ts +6 -4
- package/src/media-store/backup/snapshot.ts +4 -2
- package/src/media-store/backup/sources.ts +83 -31
- package/src/media-store/backup/thread-copy.ts +340 -0
- package/src/media-store/copy/config.ts +76 -0
- package/src/media-store/copy/copy.ts +194 -0
- package/src/media-store/copy/lifecycle.ts +43 -0
- package/src/media-store/copy/night.ts +90 -0
- package/src/media-store/copy/proof.ts +151 -0
- package/src/media-store/copy/snapshot.ts +152 -0
- package/src/media-store/copy/store.ts +62 -0
- package/src/media-store/copy/stream.ts +176 -0
- package/src/media-store/daemon.ts +66 -16
- package/src/media-store/db.ts +24 -13
- package/src/media-store/forget.ts +141 -3
- package/src/media-store/hand.ts +4 -3
- package/src/media-store/hq-find.ts +75 -0
- package/src/media-store/hq-send.ts +277 -0
- package/src/media-store/kind.ts +2 -0
- package/src/media-store/purge.ts +21 -17
- package/src/media-store/put.ts +24 -8
- package/src/media-store/remote.ts +16 -7
- package/src/media-store/space-listing.ts +256 -0
- package/src/media-store/space.ts +46 -26
- package/src/media-store/sync.ts +5 -5
- package/src/media-store/tidy.ts +98 -0
- package/src/media-store/upload.ts +3 -3
- package/src/media-store/webp.ts +66 -0
- package/src/messages/guard.ts +49 -0
- package/src/messages/model.ts +16 -7
- package/src/messages/objects.ts +201 -0
- package/src/messages/routes.ts +14 -4
- package/src/messages/score.ts +3 -3
- package/src/messages/write.ts +285 -0
- package/src/pages/frame-client.ts +191 -4
- package/src/plan/planner.ts +28 -17
- package/src/recordings/media-kind.ts +1 -0
- package/src/recordings/model.ts +1 -1
- package/src/recordings/recorder-app/Capture.swift +9 -7
- package/src/reflect/hq-corpus.ts +56 -0
- package/src/reflect/prompt-corpus.ts +3 -1
- package/src/reflect/transcript.ts +129 -37
- package/src/reflections/reflections-queue.ts +1 -1
- package/src/release/gate-checkout.ts +2 -1
- package/src/release/git-facts.ts +3 -2
- package/src/release/machine-words.ts +67 -0
- package/src/release/public-clean.ts +11 -5
- package/src/releases/from-card.ts +1 -1
- package/src/releases/routes.ts +10 -5
- package/src/releases/store.ts +10 -1
- package/src/repo-config.ts +71 -19
- package/src/review/anim.ts +3 -3
- package/src/review/answer-kinds.ts +131 -0
- package/src/review/auto.ts +2 -2
- package/src/review/band.ts +53 -0
- package/src/review/branch-hold.ts +84 -0
- package/src/review/card-db.ts +254 -0
- package/src/review/card-rows.ts +267 -0
- package/src/review/cells.ts +360 -57
- package/src/review/close.ts +92 -0
- package/src/review/draft-card.ts +33 -0
- package/src/review/draft-model.ts +78 -0
- package/src/review/events.ts +171 -0
- package/src/review/format.ts +152 -19
- package/src/review/glyphs.ts +63 -0
- package/src/review/gone.ts +98 -0
- package/src/review/holds-sync.ts +62 -0
- package/src/review/holds.ts +85 -0
- package/src/review/house-kind-defs.ts +41 -0
- package/src/review/inbox-hook.ts +23 -10
- package/src/review/inbox-read.ts +201 -0
- package/src/review/instructions.ts +199 -0
- package/src/review/kind-apply.ts +61 -0
- package/src/review/kind-catalog.ts +96 -0
- package/src/review/kinds.ts +278 -0
- package/src/review/lane-ask.ts +109 -0
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +7 -5
- package/src/review/media-read.ts +9 -7
- package/src/review/media.ts +32 -5
- package/src/review/model.ts +582 -109
- package/src/review/move.ts +491 -0
- package/src/review/need-address.ts +15 -0
- package/src/review/need-threads.ts +93 -0
- package/src/review/notes.ts +12 -20
- package/src/review/object-card.ts +48 -0
- package/src/review/object-read.ts +31 -0
- package/src/review/owner-verdict.ts +36 -0
- package/src/review/parties.ts +182 -0
- package/src/review/previews.ts +18 -20
- package/src/review/project.ts +1 -1
- package/src/review/projections.ts +235 -0
- package/src/review/referring.ts +54 -0
- package/src/review/reflection-object.ts +195 -0
- package/src/review/rev.ts +8 -0
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +194 -38
- package/src/review/secret-route.ts +80 -0
- package/src/review/snooze.ts +38 -0
- package/src/review/stage-card.ts +12 -8
- package/src/review/stage-routes.ts +1 -1
- package/src/review/store.ts +851 -124
- package/src/review/supersede.ts +116 -0
- package/src/review/take-back.ts +52 -0
- package/src/review/thread-fold.ts +64 -0
- package/src/review/threads.ts +349 -14
- package/src/review/traces.ts +218 -0
- package/src/review/trailer-auto-mock.ts +63 -0
- package/src/review/trailer-card.ts +6 -6
- package/src/review/trailer-desk.ts +41 -7
- package/src/review/trailer-media.ts +1 -0
- package/src/review/trailer-model.ts +8 -0
- package/src/review/trailer-notes.ts +1 -1
- package/src/review/trailer-routes.ts +9 -1
- package/src/review/unit.ts +77 -11
- package/src/review/verdict-items.ts +73 -0
- package/src/review/verdict-write.ts +15 -0
- package/src/review/wait.ts +85 -0
- package/src/review/watchers.ts +23 -10
- package/src/rules/untrack-generated.ts +92 -8
- package/src/scaffold/files/claude-settings-local.json +2 -0
- package/src/secrets/archive-mark.ts +52 -0
- package/src/secrets/archive.ts +83 -0
- package/src/secrets/copy.ts +14 -14
- package/src/secrets/held.ts +16 -0
- package/src/secrets/keychain-write.ts +48 -0
- package/src/secrets/keychain.ts +116 -0
- package/src/secrets/lapse-mark.ts +33 -0
- package/src/secrets/lapse.ts +60 -0
- package/src/secrets/list.ts +21 -17
- package/src/secrets/manager.ts +55 -26
- package/src/secrets/read.ts +385 -0
- package/src/secrets/tail.ts +31 -0
- package/src/secrets/who-reads.ts +49 -0
- package/src/serve/door-forward.ts +268 -0
- package/src/serve/door-names.ts +47 -0
- package/src/serve/embed.ts +1 -1
- package/src/serve/hub-app/activity-view.tsx +56 -32
- package/src/serve/hub-app/activity.css +7 -1
- package/src/serve/hub-app/asks-page.tsx +49 -0
- package/src/serve/hub-app/asks-st.ts +25 -0
- package/src/serve/hub-app/auto-text.tsx +14 -6
- package/src/serve/hub-app/benign-errors.ts +15 -1
- package/src/serve/hub-app/card-head.tsx +49 -0
- package/src/serve/hub-app/check-view.tsx +3 -2
- package/src/serve/hub-app/clock-svc.ts +1 -2
- package/src/serve/hub-app/code-copy.ts +35 -0
- package/src/serve/hub-app/col-card.tsx +72 -30
- package/src/serve/hub-app/col-list-page.tsx +125 -0
- package/src/serve/hub-app/col-list-st.ts +103 -0
- package/src/serve/hub-app/col-tables-view.tsx +17 -45
- package/src/serve/hub-app/col-tables.ts +76 -8
- package/src/serve/hub-app/cols-svc.ts +18 -39
- package/src/serve/hub-app/commands/commands-page.tsx +2 -1
- package/src/serve/hub-app/controls.css +83 -0
- package/src/serve/hub-app/database-st.ts +260 -0
- package/src/serve/hub-app/database-view.tsx +289 -0
- package/src/serve/hub-app/database.css +32 -0
- package/src/serve/hub-app/entry-bar.css +14 -0
- package/src/serve/hub-app/entry-bar.tsx +33 -0
- package/src/serve/hub-app/entry-pick.ts +31 -0
- package/src/serve/hub-app/floating.tsx +1 -0
- package/src/serve/hub-app/frames-st.ts +17 -1
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/hash-route.ts +11 -1
- package/src/serve/hub-app/header-bar.tsx +14 -18
- package/src/serve/hub-app/home-st.ts +142 -11
- package/src/serve/hub-app/home-strip.css +6 -25
- package/src/serve/hub-app/home-strip.tsx +60 -93
- package/src/serve/hub-app/home.html +10 -0
- package/src/serve/hub-app/house-wiki-view.tsx +20 -0
- package/src/serve/hub-app/hub-app.tsx +71 -166
- package/src/serve/hub-app/hub-types.ts +5 -1
- package/src/serve/hub-app/hub.css +146 -71
- package/src/serve/hub-app/icons.tsx +32 -5
- package/src/serve/hub-app/identities-st.ts +56 -6
- package/src/serve/hub-app/identities-view.tsx +104 -61
- package/src/serve/hub-app/identities.css +17 -15
- package/src/serve/hub-app/identity-address.ts +5 -0
- package/src/serve/hub-app/inbox-st.ts +227 -49
- package/src/serve/hub-app/inbox-view.tsx +204 -120
- package/src/serve/hub-app/inbox.css +47 -47
- package/src/serve/hub-app/index.html +10 -0
- package/src/serve/hub-app/instructions.css +30 -0
- package/src/serve/hub-app/kept-cols.tsx +7 -0
- package/src/serve/hub-app/keys.ts +32 -17
- package/src/serve/hub-app/later.tsx +26 -0
- package/src/serve/hub-app/list-filter.tsx +14 -0
- package/src/serve/hub-app/list-walk.ts +72 -3
- package/src/serve/hub-app/machine-st.ts +2 -2
- package/src/serve/hub-app/machines-st.ts +251 -0
- package/src/serve/hub-app/machines-view.tsx +217 -0
- package/src/serve/hub-app/machines.css +67 -0
- package/src/serve/hub-app/markdown.css +51 -0
- package/src/serve/hub-app/md-copy.tsx +57 -0
- package/src/serve/hub-app/md.ts +25 -9
- package/src/serve/hub-app/media-view.tsx +4 -2
- package/src/serve/hub-app/messages/messages-page.tsx +81 -8
- package/src/serve/hub-app/messages/messages-st.ts +99 -3
- package/src/serve/hub-app/messages.css +14 -1
- package/src/serve/hub-app/objects.css +51 -0
- package/src/serve/hub-app/page-keys.ts +175 -0
- package/src/serve/hub-app/pages-frames.tsx +21 -3
- package/src/serve/hub-app/palette-st.ts +58 -11
- package/src/serve/hub-app/palette-view.tsx +3 -1
- package/src/serve/hub-app/pane-boundary.tsx +72 -0
- package/src/serve/hub-app/pane-errors.ts +54 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/planned-view.tsx +3 -3
- package/src/serve/hub-app/planned.css +0 -4
- package/src/serve/hub-app/processes-view.tsx +3 -2
- package/src/serve/hub-app/project-list.css +46 -8
- package/src/serve/hub-app/project-list.tsx +125 -59
- package/src/serve/hub-app/projects-svc.ts +83 -8
- package/src/serve/hub-app/reader-chips.tsx +13 -0
- package/src/serve/hub-app/readme-view.tsx +2 -3
- package/src/serve/hub-app/readme.css +22 -6
- package/src/serve/hub-app/reflections-page.tsx +95 -0
- package/src/serve/hub-app/reflections-st.ts +17 -0
- package/src/serve/hub-app/releases/releases-page.tsx +28 -4
- package/src/serve/hub-app/releases/releases-st.ts +1 -1
- package/src/serve/hub-app/releases.css +0 -1
- package/src/serve/hub-app/repo-sections.ts +9 -5
- package/src/serve/hub-app/repo-st.ts +35 -8
- package/src/serve/hub-app/review/code-colors.ts +30 -0
- package/src/serve/hub-app/review/diff-view.tsx +75 -0
- package/src/serve/hub-app/review/dock.tsx +104 -0
- package/src/serve/hub-app/review/draft-card.tsx +163 -0
- package/src/serve/hub-app/review/group-block.tsx +209 -0
- package/src/serve/hub-app/review/instructions-view.tsx +116 -0
- package/src/serve/hub-app/review/item-verdict.tsx +38 -0
- package/src/serve/hub-app/review/kind-states.tsx +193 -0
- package/src/serve/hub-app/review/kind-view.tsx +1 -37
- package/src/serve/hub-app/review/kit.tsx +75 -29
- package/src/serve/hub-app/review/lane-bar.tsx +64 -0
- package/src/serve/hub-app/review/note-place.ts +1 -1
- package/src/serve/hub-app/review/object-card.tsx +62 -0
- package/src/serve/hub-app/review/object-panel.tsx +179 -0
- package/src/serve/hub-app/review/question-views.tsx +385 -0
- package/src/serve/hub-app/review/review-board.tsx +2 -2
- package/src/serve/hub-app/review/review-cells.tsx +148 -87
- package/src/serve/hub-app/review/review-kit.ts +27 -1
- package/src/serve/hub-app/review/review-list.tsx +160 -65
- package/src/serve/hub-app/review/review-page.tsx +12 -12
- package/src/serve/hub-app/review/review-st.ts +174 -47
- package/src/serve/hub-app/review/review-thread.tsx +214 -53
- package/src/serve/hub-app/review/review-views.tsx +494 -159
- package/src/serve/hub-app/review/thread-close.tsx +124 -0
- package/src/serve/hub-app/review/thread-control-st.ts +115 -0
- package/src/serve/hub-app/review/thread-control.tsx +74 -0
- package/src/serve/hub-app/review/thread-st.ts +288 -41
- package/src/serve/hub-app/review/trailer-card.tsx +2 -2
- package/src/serve/hub-app/review/trailer-page.tsx +37 -16
- package/src/serve/hub-app/review/trailer-st.ts +41 -7
- package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
- package/src/serve/hub-app/review.css +462 -97
- package/src/serve/hub-app/section-head.tsx +51 -0
- package/src/serve/hub-app/side-lists.ts +72 -0
- package/src/serve/hub-app/sidebar.tsx +6 -3
- package/src/serve/hub-app/site/site-part.tsx +2 -8
- package/src/serve/hub-app/site/site-st.ts +4 -4
- package/src/serve/hub-app/social/calendar.tsx +5 -11
- package/src/serve/hub-app/social/comms-page.tsx +43 -15
- package/src/serve/hub-app/social/kit.tsx +32 -13
- package/src/serve/hub-app/social/next-release.tsx +3 -5
- package/src/serve/hub-app/social/post-card.tsx +142 -49
- package/src/serve/hub-app/social/post-page.tsx +80 -0
- package/src/serve/hub-app/social/problems.tsx +5 -9
- package/src/serve/hub-app/social/serial-writes.ts +13 -0
- package/src/serve/hub-app/social/social-model.ts +24 -5
- package/src/serve/hub-app/social/social-page.tsx +95 -36
- package/src/serve/hub-app/social/social-st.ts +162 -41
- package/src/serve/hub-app/social/stage-popup.tsx +1 -1
- package/src/serve/hub-app/social/stage-st.ts +1 -1
- package/src/serve/hub-app/social/step-layout.ts +1 -1
- package/src/serve/hub-app/social.css +10 -17
- package/src/serve/hub-app/space-st.ts +209 -0
- package/src/serve/hub-app/space-view.tsx +196 -0
- package/src/serve/hub-app/space.css +27 -0
- package/src/serve/hub-app/stores/stores-page.tsx +97 -25
- package/src/serve/hub-app/stores/stores-st.ts +44 -19
- package/src/serve/hub-app/stores.css +6 -1
- package/src/serve/hub-app/theme-st.ts +22 -9
- package/src/serve/hub-app/thread-row.tsx +101 -0
- package/src/serve/hub-app/time-ago.tsx +3 -2
- package/src/serve/hub-app/time-charts.tsx +291 -0
- package/src/serve/hub-app/time-pages.tsx +749 -0
- package/src/serve/hub-app/time-st.ts +162 -0
- package/src/serve/hub-app/time-view.tsx +77 -0
- package/src/serve/hub-app/time.css +135 -0
- package/src/serve/hub-app/tree-build.ts +52 -42
- package/src/serve/hub-app/tree-row.tsx +3 -11
- package/src/serve/hub-app/tree-svc.ts +18 -9
- package/src/serve/hub-app/urls-svc.ts +154 -0
- package/src/serve/hub-app/urls-view.tsx +117 -0
- package/src/serve/hub-app/urls.css +30 -0
- package/src/serve/hub-app/vault-st.ts +127 -0
- package/src/serve/hub-app/vault-view.tsx +154 -0
- package/src/serve/hub-app/vault.css +38 -0
- package/src/serve/hub-app/veille/veille-page.tsx +2 -11
- package/src/serve/hub-app/veille/veille-st.ts +12 -10
- package/src/serve/hub-app/veille.css +0 -1
- package/src/serve/hub-app/waiting-svc.ts +29 -0
- package/src/serve/hub-app/when-view.tsx +6 -3
- package/src/serve/hub-app/wiki-st.ts +30 -4
- package/src/serve/hub-app/wikis-view.tsx +6 -5
- package/src/serve/hub-runtime.ts +35 -8
- package/src/serve/project-gutter-route.ts +42 -19
- package/src/serve/project-gutter.ts +16 -50
- package/src/serve/same-origin.ts +13 -0
- package/src/serve/secret-gate.ts +21 -0
- package/src/serve/serve-hub.ts +38 -20
- package/src/serve/tailnet-caller.ts +117 -0
- package/src/shipkit-files.ts +16 -2
- package/src/shipkit.ts +3 -3
- package/src/shot/shooter.ts +616 -420
- package/src/shot/shot-ask.ts +246 -155
- package/src/site/desk.ts +4 -4
- package/src/smoke/run-smoke.ts +6 -6
- package/src/social/brands.ts +4 -0
- package/src/social/card-drafts.ts +11 -19
- package/src/social/cover.ts +202 -0
- package/src/social/desk-index.ts +34 -13
- package/src/social/discord-layout.ts +37 -13
- package/src/social/drafts.ts +7 -4
- package/src/social/import-drafts.ts +244 -0
- package/src/social/kind-pages.ts +3 -3
- package/src/social/kinds.ts +1 -1
- package/src/social/load.ts +111 -65
- package/src/social/media-kind.ts +68 -160
- package/src/social/media-of.ts +5 -4
- package/src/social/open.ts +3 -2
- package/src/social/post-object.ts +120 -0
- package/src/social/post-sources.ts +136 -0
- package/src/social/post-text.ts +103 -0
- package/src/social/posts.ts +378 -0
- package/src/social/presence.ts +7 -5
- package/src/social/publish/discord.ts +5 -2
- package/src/social/publish/index.ts +17 -5
- package/src/social/publish/secret.ts +4 -4
- package/src/social/release-stage.ts +79 -63
- package/src/social/routes.ts +89 -24
- package/src/social/stage.ts +43 -58
- package/src/social/stats.ts +12 -9
- package/src/social/strip.ts +4 -1
- package/src/social/text.ts +4 -3
- package/src/social/thumbnail.ts +347 -0
- package/src/social/tracker.ts +1 -1
- package/src/social/writes.ts +12 -29
- package/src/stores/collection.ts +15 -11
- package/src/stores/desk.ts +246 -47
- package/src/stores/model.ts +72 -6
- package/src/stores/routes.ts +37 -12
- package/src/stores/unit.ts +16 -10
- package/src/suite/judge-suites.ts +41 -11
- package/src/suite/select.ts +45 -3
- package/src/suite/suite-cli.ts +16 -10
- package/src/trailer/bed.ts +1 -1
- package/src/trailer/build.ts +134 -21
- package/src/trailer/ffmpeg.ts +7 -0
- package/src/trailer/fonts.ts +3 -2
- package/src/trailer/grammar.ts +201 -2
- package/src/trailer/graph.ts +42 -5
- package/src/trailer/look.ts +21 -0
- package/src/trailer/mock.ts +154 -0
- package/src/trailer/passage.ts +65 -26
- package/src/trailer/score/heard.ts +89 -0
- package/src/trailer/score/sound.ts +14 -8
- package/src/trailer/sound/eleven.ts +33 -3
- package/src/trailer/sound/run.ts +16 -6
- package/src/trailer/stitch.ts +26 -5
- package/src/trailer/titles.ts +82 -19
- package/src/trailer/versions.ts +1 -3
- package/src/trailer/vertical.ts +3 -1
- package/src/urls/frame.ts +195 -0
- package/src/urls/routes.ts +43 -0
- package/src/urls/rows.ts +171 -0
- package/src/urls/unit.ts +73 -0
- package/src/vault/house-keys.ts +42 -0
- package/src/vault/layout.ts +50 -0
- package/src/vault/policy.ts +165 -0
- package/src/vault/vault-audit.ts +276 -0
- package/src/vault/vault-client.ts +40 -0
- package/src/vault/vault-config.ts +159 -0
- package/src/vault/vault-destroy.ts +78 -0
- package/src/vault/vault-handover.ts +305 -0
- package/src/vault/vault-http.ts +360 -0
- package/src/vault/vault-import.ts +213 -0
- package/src/vault/vault-init.ts +328 -0
- package/src/vault/vault-minter.ts +271 -0
- package/src/vault/vault-restore.ts +333 -0
- package/src/vault/vault-serve.ts +342 -0
- package/src/vault/vault-snapshot.ts +281 -0
- package/src/veille/asks.ts +1 -1
- package/src/veille/desk.ts +2 -2
- package/src/veille/identity.ts +2 -2
- package/src/wiki/graph-pages.ts +13 -1
- package/src/wiki/scan-md.ts +1 -1
- package/src/asks/asks-queue.ts +0 -266
- package/src/social/migrate.ts +0 -123
package/src/cli/cmd_Secret.ts
CHANGED
|
@@ -1,14 +1,44 @@
|
|
|
1
|
-
// shipkit secret — the secrets of the repo you stand in, and the
|
|
2
|
-
//
|
|
3
|
-
// Logic in secrets/list.ts and
|
|
4
|
-
// and only for a repo in the name's scope.
|
|
1
|
+
// shipkit secret — the secrets of the repo you stand in, and every read, write and removal of the house store (the
|
|
2
|
+
// vault, else the login keychain; a repo's declared manager, `credsReadCommand` and `credsCommand`, where it has one).
|
|
3
|
+
// Logic in secrets/read.ts, list.ts and manager.ts. A value only ever goes to stdout of `get`, `account` and `env`,
|
|
4
|
+
// and only for a repo in the name's scope. Exits of a read: 3 refused, 44 missing, 36 a keychain locked to the session
|
|
5
5
|
import { Command, Option } from 'clipanion'
|
|
6
|
-
import { homedir } from 'os'
|
|
6
|
+
import { homedir, userInfo } from 'os'
|
|
7
|
+
import { createInterface } from 'readline'
|
|
7
8
|
import { relative } from 'path'
|
|
8
9
|
import { houseRootOf } from '../home/home-start.ts'
|
|
9
10
|
import { presence, secretsFor } from '../secrets/list.ts'
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { scopeHouse } from '../secrets/who-reads.ts'
|
|
12
|
+
import { managerTemplate as template, NoManager, REFUSED_EXIT, secretsWhere as where, storeArgv, type SecretsWhere } from '../secrets/manager.ts'
|
|
13
|
+
import { archivedLine } from '../secrets/archive-mark.ts'
|
|
14
|
+
import { archivedIn, envVarOf, masterOnly, readSecretHere, storeSecretHere, type Read } from '../secrets/read.ts'
|
|
15
|
+
import { HOUSE_LAYOUT } from '../core/house-layout.ts'
|
|
16
|
+
|
|
17
|
+
/** a read that gave no value as its exit: 3 refused, 36 a keychain locked to this session, 44 missing */
|
|
18
|
+
const MISSING_EXIT = 44
|
|
19
|
+
const LOCKED_EXIT = 36
|
|
20
|
+
const exitOf = (r: Exclude<Read, { value: string }>): number => ('refused' in r ? REFUSED_EXIT : r.locked === true ? LOCKED_EXIT : MISSING_EXIT)
|
|
21
|
+
const whyOf = (r: Exclude<Read, { value: string }>): string => ('refused' in r ? r.refused : `FAIL ${r.missing}`)
|
|
22
|
+
|
|
23
|
+
/** every `rv/` name this Mac holds: its keychain's, and each registry name the one read answers (the vault's) */
|
|
24
|
+
async function heldNames(w: SecretsWhere): Promise<string[]> {
|
|
25
|
+
const names = new Set<string>()
|
|
26
|
+
try {
|
|
27
|
+
const { keychainReader } = await import('../secrets/keychain.ts')
|
|
28
|
+
for (const n of keychainReader().names()) names.add(n)
|
|
29
|
+
} catch {
|
|
30
|
+
// a Mac with no keychain, or a scratch home: the vault's names alone
|
|
31
|
+
}
|
|
32
|
+
const creds = [...(w.house?.creds ?? []), ...(w.own?.creds ?? [])].filter((c) => !c.name.includes('<') && c.archived == null)
|
|
33
|
+
await Promise.all(creds.map(async (c) => {
|
|
34
|
+
if ('value' in (await readSecretHere({ name: c.name, cwd: process.cwd(), w, say: () => {} }))) names.add(c.name)
|
|
35
|
+
}))
|
|
36
|
+
return [...names].sort()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** a registry name matches a held one: `<x>` in a row stands for any one segment */
|
|
40
|
+
const matchesRow = (row: string, name: string): boolean =>
|
|
41
|
+
new RegExp(`^${row.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/<[^>]*>/g, '[^/]+')}$`).test(name)
|
|
12
42
|
|
|
13
43
|
/** runs a verb, printing a refusal as its one line */
|
|
14
44
|
async function refusing(stderr: NodeJS.WritableStream, run: () => Promise<number>): Promise<number> {
|
|
@@ -36,6 +66,10 @@ export class SecretListCommand extends Command {
|
|
|
36
66
|
|
|
37
67
|
all = Option.Boolean('--all', false, { description: 'every registry row, the ones out of scope marked' })
|
|
38
68
|
json = Option.Boolean('--json', false, { description: 'one json array, no presence read' })
|
|
69
|
+
archived = Option.Boolean('--archived', false, { description: 'the archived names alone, each with its day and why (sk secret archive)' })
|
|
70
|
+
tail = Option.Boolean('--tail', false, { description: "a column with the end a provider's dashboard shows (••••c23e), never the value (sk secret tail)" })
|
|
71
|
+
held = Option.Boolean('--held', false, { description: 'every rv/ name this Mac holds, one a line: its keychain and the vault, never a value' })
|
|
72
|
+
check = Option.Boolean('--check', false, { description: 'exit 1 when a secret in scope is MISS, or a name this Mac holds has no registry row (UNREGISTERED)' })
|
|
39
73
|
|
|
40
74
|
async execute(): Promise<number> {
|
|
41
75
|
return refusing(this.context.stderr, () => this.list())
|
|
@@ -43,26 +77,54 @@ export class SecretListCommand extends Command {
|
|
|
43
77
|
|
|
44
78
|
private async list(): Promise<number> {
|
|
45
79
|
const w = await where(process.cwd())
|
|
80
|
+
if (this.held) {
|
|
81
|
+
this.context.stdout.write((await heldNames(w)).map((n) => `${n}\n`).join(''))
|
|
82
|
+
return 0
|
|
83
|
+
}
|
|
46
84
|
// in the house repo its own creds ARE the registry, each row with the scope it declares
|
|
47
85
|
const inHouse = w.house != null && w.house === w.own
|
|
48
|
-
const
|
|
86
|
+
const scopes = this.json ? undefined : await scopeHouse(process.cwd(), { keys: (w.house?.creds ?? []).some((c) => (c.for?.repos ?? []).some((r) => r.includes('/'))) }).catch(() => undefined)
|
|
87
|
+
const rows = secretsFor({ asker: w, own: inHouse ? [] : (w.own?.creds ?? []), house: w.house?.creds ?? [], all: this.all, archived: this.archived, scopes })
|
|
49
88
|
if (this.json) {
|
|
50
89
|
this.context.stdout.write(`${JSON.stringify(rows)}\n`)
|
|
51
90
|
return 0
|
|
52
91
|
}
|
|
53
|
-
|
|
92
|
+
if (this.archived) {
|
|
93
|
+
this.context.stdout.write(rows.length === 0 ? 'no archived secret in scope\n' : rows.map((r) => `${r.name} archived ${r.archived!.at}: ${r.archived!.why} (sk secret unarchive ${r.name})\n`).join(''))
|
|
94
|
+
return 0
|
|
95
|
+
}
|
|
96
|
+
const has = await presence(rows.filter((r) => r.inScope).map((r) => r.name))
|
|
97
|
+
const masks = new Map<string, string>()
|
|
98
|
+
if (this.tail) {
|
|
99
|
+
const { maskOf, maskText } = await import('../secrets/tail.ts')
|
|
100
|
+
await Promise.all(rows.filter((r) => has.get(r.name) === 'ok').map(async (r) => {
|
|
101
|
+
const got = await readSecretHere({ name: r.name, cwd: process.cwd(), w, say: () => {} })
|
|
102
|
+
if ('value' in got) masks.set(r.name, maskText(maskOf(got.value)))
|
|
103
|
+
}))
|
|
104
|
+
}
|
|
54
105
|
const say = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
55
106
|
const mine = rows.filter((r) => r.mine).length
|
|
56
107
|
say(`${w.repos[0]} speaks as ${w.identity ?? 'no identity'}: ${rows.filter((r) => r.inScope).length} secrets, ${mine} for this repo or identity`)
|
|
57
|
-
const pad = (k: 'name' | '
|
|
108
|
+
const pad = (k: 'name' | 'service'): number => Math.max(k.length, ...rows.map((r) => (r[k] ?? '').slice(0, 40).length))
|
|
58
109
|
if ([...has.values()].includes('locked')) say(`LOCK: there, in a keychain locked to this session (an ssh session sees it so): \`security unlock-keychain\` in it to read them`)
|
|
110
|
+
const line = (mark: string, name: string, level: string, service: string, who: string): string =>
|
|
111
|
+
`${mark} ${name.padEnd(pad('name'))} ${level.padEnd(5)} ${service.slice(0, 40).padEnd(pad('service'))} ${who}`
|
|
112
|
+
if (rows.length > 0) say(line(' ', 'name', 'level', 'service', 'who can read it'))
|
|
59
113
|
for (const r of rows) {
|
|
60
114
|
const p = has.get(r.name)
|
|
61
115
|
const mark = !r.inScope ? 'out ' : p === 'ok' ? 'ok ' : p === 'locked' ? 'LOCK' : 'MISS'
|
|
62
116
|
const fix = p === 'missing' ? ` → sk secret set ${r.name}` : ''
|
|
63
|
-
|
|
117
|
+
const tail = masks.has(r.name) ? ` ${masks.get(r.name)}` : ''
|
|
118
|
+
say(`${line(mark, r.name, r.level, r.service ?? '', r.who)}${tail}${fix}`)
|
|
64
119
|
}
|
|
65
|
-
|
|
120
|
+
if (rows.some((r) => /\?(,|$)/.test(r.who))) say('a repo with ? is one this machine does not have; --json gives each scope in a sentence')
|
|
121
|
+
if (!this.check) return 0
|
|
122
|
+
const missing = rows.filter((r) => r.inScope && !r.name.includes('<') && has.get(r.name) === 'missing').length
|
|
123
|
+
const known = [...(w.house?.creds ?? []), ...(w.own?.creds ?? [])].map((c) => c.name)
|
|
124
|
+
const strays = (await heldNames(w)).filter((n) => !known.some((k) => matchesRow(k, n)))
|
|
125
|
+
for (const n of strays) say(`UNREGISTERED ${n} → add its row to ${HOUSE_LAYOUT.secretRegistry}`)
|
|
126
|
+
say(`${missing} missing, ${strays.length} unregistered`)
|
|
127
|
+
return missing + strays.length > 0 ? 1 : 0
|
|
66
128
|
}
|
|
67
129
|
}
|
|
68
130
|
|
|
@@ -82,23 +144,67 @@ export class SecretReadCommand extends Command {
|
|
|
82
144
|
const field = this.path[1] === 'account' ? 'account' : 'get'
|
|
83
145
|
return refusing(this.context.stderr, async () => {
|
|
84
146
|
const w = await where(process.cwd())
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
147
|
+
// the one read gates after the env override, as every reader of the lib does
|
|
148
|
+
const r = await readSecretHere({ name: this.name, field, cwd: process.cwd(), w, say: (l) => void this.context.stderr.write(`${l}\n`) })
|
|
149
|
+
if ('value' in r) {
|
|
150
|
+
this.context.stdout.write(`${r.value}\n`)
|
|
151
|
+
return 0
|
|
89
152
|
}
|
|
90
|
-
|
|
91
|
-
return
|
|
153
|
+
this.context.stderr.write(`${whyOf(r)}\n`)
|
|
154
|
+
return exitOf(r)
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export class SecretTailCommand extends Command {
|
|
160
|
+
static override paths = [['secret', 'tail']]
|
|
161
|
+
static essential = { args: '<name…>' }
|
|
162
|
+
|
|
163
|
+
static override usage = Command.Usage({
|
|
164
|
+
category: 'Secrets',
|
|
165
|
+
description: "the end of a secret a dashboard shows (••••c23e), never the value: match a key with its dashboard",
|
|
166
|
+
details: 'Each value is read in this process, through the scope and archive gates, and only its last 4 characters and its length leave it. A value under 20 characters prints its length alone.',
|
|
167
|
+
examples: [['which ElevenLabs key the house holds', 'sk secret tail rv/elevenlabs/api-key'], ["this Mac's keychain copy, to compare with the vault's", 'sk secret tail rv/npm/token --keychain']],
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
names = Option.Rest({ required: 1 })
|
|
171
|
+
keychain = Option.Boolean('--keychain', false, { description: "read this Mac's keychain copy, not the vault's" })
|
|
172
|
+
|
|
173
|
+
async execute(): Promise<number> {
|
|
174
|
+
return refusing(this.context.stderr, async () => {
|
|
175
|
+
const w = await where(process.cwd())
|
|
176
|
+
const { tailLines } = await import('../secrets/tail.ts')
|
|
177
|
+
const store = this.keychain ? ('keychain' as const) : undefined
|
|
178
|
+
const r = await tailLines({ names: this.names, read: (name) => readSecretHere({ name, cwd: process.cwd(), w, say: () => {}, ...(store != null ? { store } : {}) }) })
|
|
179
|
+
this.context.stdout.write(r.lines.map((l) => `${l}\n`).join(''))
|
|
180
|
+
return r.code
|
|
92
181
|
})
|
|
93
182
|
}
|
|
94
183
|
}
|
|
95
184
|
|
|
185
|
+
/** the value, typed with no echo at a terminal, else stdin whole, its last line breaks dropped */
|
|
186
|
+
async function readValue(name: string): Promise<string> {
|
|
187
|
+
if (process.stdin.isTTY !== true) return (await Bun.stdin.text()).replace(/\n+$/, '')
|
|
188
|
+
process.stderr.write(`value for ${name}: `)
|
|
189
|
+
Bun.spawnSync(['stty', '-echo'], { stdin: 'inherit' })
|
|
190
|
+
try {
|
|
191
|
+
const rl = createInterface({ input: process.stdin, terminal: false })
|
|
192
|
+
const line = await new Promise<string>((ok) => rl.once('line', ok))
|
|
193
|
+
rl.close()
|
|
194
|
+
return line
|
|
195
|
+
} finally {
|
|
196
|
+
Bun.spawnSync(['stty', 'echo'], { stdin: 'inherit' })
|
|
197
|
+
process.stderr.write('\n')
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
96
201
|
export class SecretSetCommand extends Command {
|
|
97
202
|
static override paths = [['secret', 'set']]
|
|
98
203
|
|
|
99
204
|
static override usage = Command.Usage({
|
|
100
205
|
category: 'Secrets',
|
|
101
|
-
description: 'store a secret and its account
|
|
206
|
+
description: 'store a secret and its account, in the vault where this machine runs one; prompts, or reads stdin',
|
|
207
|
+
details: 'On the machine that runs the vault, the value goes into the vault and is read back; the keychain is never written, and a vault that is down or sealed fails the command. On a Mac that reads the vault from afar it is refused, naming the Mac that runs it. On a Mac with no vault it goes into the login keychain: the items of the name under another account are removed, and the value is read back. A repo that declares its own `credsCommand` stores through it. The value is asked at a prompt with no echo, or read whole from stdin, its trailing line breaks dropped; an empty one is refused.',
|
|
102
208
|
examples: [['store a token', 'sk secret set rv/npm/token'], ['with its login', 'sk secret set rv/pockethost/account me@example.com']],
|
|
103
209
|
})
|
|
104
210
|
|
|
@@ -107,20 +213,181 @@ export class SecretSetCommand extends Command {
|
|
|
107
213
|
|
|
108
214
|
async execute(): Promise<number> {
|
|
109
215
|
return refusing(this.context.stderr, async () => {
|
|
110
|
-
const
|
|
111
|
-
|
|
216
|
+
const w = await where(process.cwd())
|
|
217
|
+
const archived = archivedIn(w, this.name)
|
|
218
|
+
if (archived != null) {
|
|
219
|
+
this.context.stderr.write(`FAIL: nothing was stored: ${archivedLine(this.name, archived)}, then set it\n`)
|
|
220
|
+
return 1
|
|
221
|
+
}
|
|
222
|
+
const master = await masterOnly()
|
|
223
|
+
if (master != null) {
|
|
224
|
+
this.context.stderr.write(`FAIL: nothing was stored: ${master}\n`)
|
|
225
|
+
return 1
|
|
226
|
+
}
|
|
227
|
+
const declared = template(w, 'credsCommand')
|
|
228
|
+
if (declared != null) return Bun.spawnSync(storeArgv(declared, this.name, this.account), { stdin: 'inherit', stdout: 'inherit', stderr: 'inherit' }).exitCode ?? 1
|
|
229
|
+
const value = await readValue(this.name)
|
|
230
|
+
if (value === '') {
|
|
231
|
+
this.context.stderr.write('refusing to store empty value\n')
|
|
232
|
+
return 1
|
|
233
|
+
}
|
|
234
|
+
const r = await storeSecretHere({ name: this.name, account: this.account ?? userInfo().username, value, cwd: process.cwd(), w })
|
|
235
|
+
if ('refused' in r) {
|
|
236
|
+
this.context.stderr.write(`FAIL: nothing was stored: ${r.refused}\n`)
|
|
237
|
+
return 1
|
|
238
|
+
}
|
|
239
|
+
this.context.stderr.write(r.lines.map((l) => `${l}\n`).join(''))
|
|
240
|
+
return 0
|
|
112
241
|
})
|
|
113
242
|
}
|
|
114
243
|
}
|
|
115
244
|
|
|
245
|
+
export class SecretRmCommand extends Command {
|
|
246
|
+
static override paths = [['secret', 'rm']]
|
|
247
|
+
|
|
248
|
+
static override usage = Command.Usage({
|
|
249
|
+
category: 'Secrets',
|
|
250
|
+
description: "remove a secret from one store: --keychain (this Mac's copies) or --vault (its current version)",
|
|
251
|
+
details: "`--keychain` deletes every item of the name in this Mac's login keychain, the vault untouched. `--vault` soft deletes the vault's current version on the Mac that runs it (exit 4 when the vault does not hold it), the keychain untouched; older versions stay readable by version. A bare `rm` removes the keychain's items on a Mac that reads no vault, and nothing on one that does (exit 2): a keychain copy there is the owner's to delete.",
|
|
252
|
+
examples: [["this Mac's keychain copies, on the owner's yes", 'sk secret rm --keychain rv/old/thing'], ["the vault's current version", 'sk secret rm --vault rv/old/thing']],
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
keychain = Option.Boolean('--keychain', false, { description: "this Mac's keychain items of the name, never the vault's" })
|
|
256
|
+
vault = Option.Boolean('--vault', false, { description: "the vault's current version, soft deleted, never the keychain" })
|
|
257
|
+
name = Option.String()
|
|
258
|
+
|
|
259
|
+
async execute(): Promise<number> {
|
|
260
|
+
const say = (l: string): void => void this.context.stderr.write(`${l}\n`)
|
|
261
|
+
if (this.keychain && this.vault) {
|
|
262
|
+
say('FAIL: nothing removed: rm names one store, --keychain or --vault')
|
|
263
|
+
return 2
|
|
264
|
+
}
|
|
265
|
+
const { vaultHere, vaultReach, removeSecretHere } = await import('../secrets/read.ts')
|
|
266
|
+
const readsVault = (await vaultReach()) != null
|
|
267
|
+
if (!this.keychain && !this.vault && readsVault) {
|
|
268
|
+
say('FAIL: nothing removed: on a Mac that reads the vault, rm names its store: --keychain (this Mac\'s keychain copies, the vault untouched) or --vault (the vault\'s current version, soft deleted, the keychain untouched)')
|
|
269
|
+
return 2
|
|
270
|
+
}
|
|
271
|
+
if (this.vault) {
|
|
272
|
+
if (!vaultHere()) {
|
|
273
|
+
say('FAIL: nothing removed: this Mac runs no vault; --vault runs on the Mac that runs it')
|
|
274
|
+
return 1
|
|
275
|
+
}
|
|
276
|
+
const r = await removeSecretHere({ name: this.name, cwd: process.cwd(), w: await where(process.cwd()) }).catch((e: Error) => ({ refused: e.message }))
|
|
277
|
+
if (r == null || 'refused' in r) {
|
|
278
|
+
say(`FAIL: the vault's copy was not removed: ${r == null ? 'no vault on this machine' : r.refused}`)
|
|
279
|
+
return 1
|
|
280
|
+
}
|
|
281
|
+
say(r.removed ? `removed ${this.name} from the vault (its newest version, soft deleted: bao kv undelete brings it back)` : `the vault does not hold ${this.name}`)
|
|
282
|
+
if (r.older > 0) {
|
|
283
|
+
const { ROOT_ROAD } = await import('../vault/vault-config.ts')
|
|
284
|
+
say(`note: ${r.older} older version${r.older === 1 ? '' : 's'} of ${this.name} stay${r.older === 1 ? 's' : ''} in the vault and in its snapshots, readable by version: a node token never destroys. A compromised value is revoked where it was issued; destroying it needs ${ROOT_ROAD}`)
|
|
285
|
+
}
|
|
286
|
+
say(`this Mac's keychain copy is untouched (sk secret rm --keychain ${this.name} removes it)`)
|
|
287
|
+
return r.removed ? 0 : 4
|
|
288
|
+
}
|
|
289
|
+
const { keychainWriter } = await import('../secrets/keychain-write.ts')
|
|
290
|
+
let n: number
|
|
291
|
+
try {
|
|
292
|
+
n = keychainWriter().remove(this.name)
|
|
293
|
+
} catch (e) {
|
|
294
|
+
say(`FAIL: nothing removed: ${(e as Error).message}`)
|
|
295
|
+
return 1
|
|
296
|
+
}
|
|
297
|
+
if (n === 0) {
|
|
298
|
+
say(`no such secret in this Mac's keychain: ${this.name}`)
|
|
299
|
+
return 1
|
|
300
|
+
}
|
|
301
|
+
say(`deleted ${this.name} from this Mac's keychain (${n} entr${n === 1 ? 'y' : 'ies'})${readsVault ? "; the vault's copy is untouched" : ''}`)
|
|
302
|
+
return 0
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export class SecretEnvCommand extends Command {
|
|
307
|
+
static override paths = [['secret', 'env']]
|
|
308
|
+
static essential = { args: '<name…>' }
|
|
309
|
+
|
|
310
|
+
static override usage = Command.Usage({
|
|
311
|
+
category: 'Secrets',
|
|
312
|
+
description: "export lines for an eval: `export RV_SECRET_<NAME>='<value>'`, all of them or none",
|
|
313
|
+
details: 'Every name is read before a line prints: a refused or missing name prints no export at all (exit 3, 44 or 36), never the half an eval would take quietly.',
|
|
314
|
+
examples: [['two secrets into this shell', 'eval "$(sk secret env rv/cloudflare/api-token rv/npm/token)"']],
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
names = Option.Rest({ required: 1 })
|
|
318
|
+
|
|
319
|
+
async execute(): Promise<number> {
|
|
320
|
+
return refusing(this.context.stderr, async () => {
|
|
321
|
+
const w = await where(process.cwd())
|
|
322
|
+
const lines: string[] = []
|
|
323
|
+
for (const name of this.names) {
|
|
324
|
+
const r = await readSecretHere({ name, cwd: process.cwd(), w, say: (l) => void this.context.stderr.write(`${l}\n`) })
|
|
325
|
+
if (!('value' in r)) {
|
|
326
|
+
this.context.stderr.write(`${whyOf(r)}\n`)
|
|
327
|
+
return exitOf(r)
|
|
328
|
+
}
|
|
329
|
+
lines.push(`export ${envVarOf(name)}='${r.value.replaceAll("'", "'\\''")}'\n`)
|
|
330
|
+
}
|
|
331
|
+
this.context.stdout.write(lines.join(''))
|
|
332
|
+
return 0
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** an archive act's lines on stdout, or its refusal on stderr */
|
|
338
|
+
async function acted(c: Command['context'], run: () => Promise<{ lines: string[] } | { refused: string }>): Promise<number> {
|
|
339
|
+
const r = await run()
|
|
340
|
+
if ('refused' in r) {
|
|
341
|
+
c.stderr.write(`FAIL ${r.refused}: nothing changed\n`)
|
|
342
|
+
return 1
|
|
343
|
+
}
|
|
344
|
+
c.stdout.write(r.lines.map((l) => `${l}\n`).join(''))
|
|
345
|
+
return 0
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export class SecretArchiveCommand extends Command {
|
|
349
|
+
static override paths = [['secret', 'archive']]
|
|
350
|
+
|
|
351
|
+
static override usage = Command.Usage({
|
|
352
|
+
category: 'Secrets',
|
|
353
|
+
description: "keep a secret out of use, undone with unarchive: the vault's soft delete, its registry row marked",
|
|
354
|
+
details: "On the Mac that runs the vault. Never a destroy. Every read of the name then fails with the way back, `sk secret list` leaves it out, and this Mac's keychain copy from before the vault is left and named. Run `sk vault snapshot` after it.",
|
|
355
|
+
examples: [['a key nobody can identify', 'sk secret archive rv/old/key --why "no known consumer"']],
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
name = Option.String()
|
|
359
|
+
why = Option.String('--why', { required: true, description: "why it is archived: kept in the registry row's mark" })
|
|
360
|
+
|
|
361
|
+
async execute(): Promise<number> {
|
|
362
|
+
return refusing(this.context.stderr, async () => acted(this.context, async () => (await import('../secrets/archive.ts')).archiveSecret({ name: this.name, why: this.why, cwd: process.cwd() })))
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export class SecretUnarchiveCommand extends Command {
|
|
367
|
+
static override paths = [['secret', 'unarchive']]
|
|
368
|
+
|
|
369
|
+
static override usage = Command.Usage({
|
|
370
|
+
category: 'Secrets',
|
|
371
|
+
description: "an archived secret back: the vault's undelete of its current version, read back, its mark removed",
|
|
372
|
+
examples: [['an archived key back in use', 'sk secret unarchive rv/old/key']],
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
name = Option.String()
|
|
376
|
+
|
|
377
|
+
async execute(): Promise<number> {
|
|
378
|
+
return refusing(this.context.stderr, async () => acted(this.context, async () => (await import('../secrets/archive.ts')).unarchiveSecret({ name: this.name, cwd: process.cwd() })))
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
116
382
|
export class SecretCopyCommand extends Command {
|
|
117
383
|
static override paths = [['secret', 'copy']]
|
|
384
|
+
static gloss = "to another Mac's keychain, over ssh"
|
|
118
385
|
|
|
119
386
|
static override usage = Command.Usage({
|
|
120
387
|
category: 'Secrets',
|
|
121
388
|
description: "this Mac's secrets into another Mac's keychain over ssh, each on ssh's stdin; what it holds stays",
|
|
122
389
|
details: "With no name: every secret of this repo's list that this Mac holds. The other Mac runs its own `sk secret set` from the house checkout at the same place under its home. A secret it already answers is left as it is. A keychain locked to ssh stops the copy and says how to unlock it.",
|
|
123
|
-
examples: [['every secret
|
|
390
|
+
examples: [['every secret the other Mac lacks', 'sk secret copy --to other-mac'], ['one secret', 'sk secret copy rv/shipkit/spaces --to other-mac'], ['a Mac whose keychain ssh sees locked, from your terminal', 'sk secret copy --to other-mac --unlock']],
|
|
124
391
|
})
|
|
125
392
|
|
|
126
393
|
names = Option.Rest()
|
|
@@ -136,8 +403,12 @@ export class SecretCopyCommand extends Command {
|
|
|
136
403
|
const rows = secretsFor({ asker: w, own: inHouse ? [] : (w.own?.creds ?? []), house: w.house?.creds ?? [] }).filter((r) => r.inScope)
|
|
137
404
|
const names = this.names.length > 0 ? this.names : rows.map((r) => r.name)
|
|
138
405
|
const { copySecrets, copyWithUnlock } = await import('../secrets/copy.ts')
|
|
139
|
-
|
|
140
|
-
|
|
406
|
+
const read = async (name: string, field: 'get' | 'account'): Promise<string | null> => {
|
|
407
|
+
const r = await readSecretHere({ name, field, cwd: process.cwd(), w, say: () => {} })
|
|
408
|
+
return 'value' in r ? r.value : null
|
|
409
|
+
}
|
|
410
|
+
if (this.unlock) return copyWithUnlock({ names, to: this.to, read, houseRel: relative(homedir(), houseRoot), say: (l) => void this.context.stdout.write(`${l}\n`) })
|
|
411
|
+
const r = await copySecrets({ names, to: this.to, read, houseRel: relative(homedir(), houseRoot) })
|
|
141
412
|
for (const c of r.copied) this.context.stdout.write(`${c.did === 'failed' ? 'FAIL' : c.did === 'copied' ? 'ok ' : 'skip'} ${c.name} ${c.did}${c.why ? `: ${c.why}` : ''}\n`)
|
|
142
413
|
const n = (d: string): number => r.copied.filter((c) => c.did === d).length
|
|
143
414
|
this.context.stdout.write(`${n('copied')} copied, ${n('there')} already on ${this.to}, ${n('not here')} not on this Mac, ${n('failed')} failed${r.locked ? ' (stopped: locked)' : ''}\n`)
|
package/src/cli/cmd_Social.ts
CHANGED
|
@@ -106,11 +106,10 @@ class SocialPostCommand extends Command {
|
|
|
106
106
|
category: 'Social',
|
|
107
107
|
description: 'one draft across every account of its headings: posted with its date and link, or waiting',
|
|
108
108
|
details:
|
|
109
|
-
"The draft by its
|
|
109
|
+
"The draft by its slug or its topic. --publish posts the waiting posts of its accounts whose automation is live (Discord, Bluesky), each link recorded as the post's state; a posted one stays « already posted ». --edit sends a posted message's text again at its link where the venue edits in place (Discord), and names why where it cannot: never a second copy. --only <key> keeps one message, its heading's key (`discord`, `discord/nsfw`), else an account's every message. A message the repo's guard or a place refuses never posts. Every other account waits for his paste: nothing posts without an order. Page: wiki tools/shipkit/social.md, `sk social`",
|
|
110
110
|
examples: [
|
|
111
111
|
['by its topic', 'sk social post arena-face-lift'],
|
|
112
112
|
['by its whole name', 'sk social post 20261025-131139-arena-face-lift'],
|
|
113
|
-
['by its path', 'sk social post .shipkit/social/drafts/20261025-131139-arena-face-lift/'],
|
|
114
113
|
['a pinned #welcome whose text changed, edited at its link', 'sk social post welcome --only discord --publish --edit'],
|
|
115
114
|
["a release's #announcements line, at release", 'sk social post 20261108-120000-app-1-2-0 --only discord --publish'],
|
|
116
115
|
],
|
|
@@ -129,9 +128,12 @@ class SocialPostCommand extends Command {
|
|
|
129
128
|
if (only != null && !d.posts.some((p) => p.platform === only || p.key === only)) throw new Error(`${d.slug} has no message to ${only} (${[...new Set(d.posts.map((p) => p.key))].join(', ') || 'none'})`)
|
|
130
129
|
if (this.publish) {
|
|
131
130
|
const { publishDraft } = await import('../social/publish/index.ts')
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
131
|
+
// its files on the disk first, then the desk loaded again: the guard and the cover read the bytes it sends
|
|
132
|
+
const { draftMediaHere } = await import('../social/media-kind.ts')
|
|
133
|
+
const { onlyOf } = await import('../social/publish/index.ts')
|
|
134
|
+
await draftMediaHere(desk, d.slug, onlyOf(d.posts, only ?? undefined).map((p) => p.key))
|
|
135
|
+
const fresh = (await model(undefined)).desk
|
|
136
|
+
for (const r of await publishDraft(fresh, d.slug, { ...(only != null ? { only } : {}), edit: this.edit })) say(this.context)(`${r.key}: ${r.line}`)
|
|
135
137
|
return 0
|
|
136
138
|
}
|
|
137
139
|
const { socialModel, postText } = await import('../social/text.ts')
|
|
@@ -243,6 +245,109 @@ class SocialReleaseCardCommand extends Command {
|
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
|
|
248
|
+
class SocialThumbnailCommand extends Command {
|
|
249
|
+
static override paths = [['social', 'thumbnail']]
|
|
250
|
+
static override usage = Command.Usage({
|
|
251
|
+
category: 'Social',
|
|
252
|
+
description: "a video's thumbnail, 1280x720: a frame beside the brand's name and line, or a game's poster",
|
|
253
|
+
details:
|
|
254
|
+
"The identity kit draws it from .shipkit/identity/brand.ts (its ground, accent, ink, mark and the trailer's face, else Inter 800): the mark, the name huge, one line in the accent, an optional mono chip on the left; the frame as a tilted card on the right; an optional ribbon. A jpg under YouTube's 2 MB, written beside the video as <video>-thumbnail.jpg unless --out. The frame: --at seconds into the video (default its first lit frame past 1 s), or --frame <still>; --crop x,y,w,h keeps the product's interesting part, in pixels or as shares of the frame. --title is the brand's name, --line its tagline unless given; a text too long to read at YouTube's small size is refused, never cut. With --draft <draft>, the video defaults to the draft's own, the jpg lands in its media as <its video>-thumbnail.jpg after that video, its recipe is kept as the draft's thumbnail: line, and the files are committed; --draft alone makes it again from that line after a re-cut. The cover: Reddit and X take no uploaded picture, only a frame of the video, frame 0 first; so with --draft each of the draft's videos opens on the thumbnail, held 3 frames (0.1 s at 30 fps) with the sound delayed as long, encoded again at its own bitrates in place; a video that already opens on it is left as it is, an older cover is replaced. --no-cover leaves the videos as they are, kept in the recipe; --cover without --draft writes <video>-covered.mp4 beside the video. --plain writes the frame as it is, nothing drawn and no brand read, a jpg or a png by --out: an upright trailer's start image, a trailer's end image (wiki tools/trailer/index.md). --layout poster is a game's or a studio's look: the frame fills the picture, a soft shade on the side the words take (--place left, right or center), the name huge on one or two lines or the game's own lettering (--wordmark <png>), the line in spaced capitals, labels as pills (--tag, repeated), up to three cut outs on the other side with a warm rim of light (--figure <png>[:flip], repeated), the studio's mark in a free bottom corner (--studio <png>). A brand keeps its recipe as thumbnail: { layout, place, wordmark, figures, studio, tags, line, badge } in brand.ts, paths from the repo's root, so every video of the repo wears it; a flag wins over its field. Page: wiki tools/shipkit/social.md, A video's thumbnail",
|
|
255
|
+
examples: [
|
|
256
|
+
['a frame and the words', 'sk social thumbnail trailer/app/versions/v3/app-v3.mp4 --at 12.5 --crop 515,272,705,432 --line "Your app, typed." --chip "bun add app"'],
|
|
257
|
+
["a trailer post's, its recipe kept in the draft", 'sk social thumbnail --draft 20261119-174922-trailer --at 70 --crop 0.4,0.38,0.55,0.6'],
|
|
258
|
+
['made again from the draft after a re-cut', 'sk social thumbnail --draft 20261119-174922-trailer'],
|
|
259
|
+
['a covered copy of a video, frame 0 the thumbnail', 'sk social thumbnail trailer/app/versions/v3/app-v3.mp4 --at 12.5 --cover'],
|
|
260
|
+
['a still, with a ribbon', 'sk social thumbnail --frame shots/town.png --badge pre-alpha --out media/town-thumbnail.jpg'],
|
|
261
|
+
["a trailer's end image, the frame as it is", 'sk social thumbnail trailer/app/out/app.mp4 --at 61.9 --plain --out trailer/app/endcard.png'],
|
|
262
|
+
["a game's poster: its lettering, two heroes facing off, the studio's mark", 'sk social thumbnail --frame shots/lagoon.png --layout poster --wordmark art/title.png --figure art/knight.png --figure art/ogre.png:flip --tag "launch trailer" --studio art/studio.png --out trailer/launch/main-thumbnail.jpg'],
|
|
263
|
+
],
|
|
264
|
+
})
|
|
265
|
+
video = Option.String({ required: false })
|
|
266
|
+
at = Option.String('--at', { description: 'seconds into the video (default: its first lit frame past 1 s)' })
|
|
267
|
+
frame = Option.String('--frame', { description: 'a still instead of a frame of the video' })
|
|
268
|
+
crop = Option.String('--crop', { description: 'x,y,w,h of the frame to show, in pixels or shares of it (default: the whole frame)' })
|
|
269
|
+
title = Option.String('--title', { description: "the name, huge (default: the brand's name)" })
|
|
270
|
+
line = Option.String('--line', { description: "one short line in the accent (default: the brand's tagline)" })
|
|
271
|
+
chip = Option.String('--chip', { description: 'a short command in a mono chip, an install line (default: none)' })
|
|
272
|
+
badge = Option.String('--badge', { description: 'a ribbon word across the top right corner, like pre-alpha (default: none)' })
|
|
273
|
+
out = Option.String('--out', { description: 'the jpg (default: <video>-thumbnail.jpg beside the video); with --plain a .png gives a png' })
|
|
274
|
+
plain = Option.Boolean('--plain', false, { description: 'the frame as it is, nothing drawn on it (a trailer start image of an upright cut, an end image)' })
|
|
275
|
+
draft = Option.String('--draft', { description: "a draft: its video, its media, its thumbnail: recipe kept" })
|
|
276
|
+
cover = Option.Boolean('--cover', { description: 'the video opens on the thumbnail, its first 3 frames (default: on with --draft, its videos in place; off without, else <video>-covered.mp4)' })
|
|
277
|
+
layout = Option.String('--layout', { description: "card (the frame as a tilted card beside the words) or poster (the frame fills the picture, a game's look) (default: the brand's thumbnail.layout, else card)" })
|
|
278
|
+
place = Option.String('--place', { description: 'a poster: where the words sit, left, right or center; the figures stand on the other side (default: left)' })
|
|
279
|
+
wordmark = Option.String('--wordmark', { description: "a poster: the name as a picture, the game's own lettering, drawn in place of the name's words" })
|
|
280
|
+
figure = Option.Array('--figure', { description: 'a poster: a cut out on the free side, <png>[:flip], repeated, three at most' })
|
|
281
|
+
tag = Option.Array('--tag', { description: 'a poster: a label under the line, a pill, repeated' })
|
|
282
|
+
studio = Option.String('--studio', { description: "a poster: the studio's mark in a free bottom corner" })
|
|
283
|
+
override async execute(): Promise<number> {
|
|
284
|
+
return guarded(this.context, async () => {
|
|
285
|
+
const { relative, resolve } = await import('node:path')
|
|
286
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
287
|
+
const { loadSocialUnit } = await import('../social/unit.ts')
|
|
288
|
+
const t = await import('../social/thumbnail.ts')
|
|
289
|
+
const cwd = process.cwd()
|
|
290
|
+
const root = findRepoRoot(cwd)
|
|
291
|
+
const unit = await loadSocialUnit(root)
|
|
292
|
+
const at = this.at === undefined ? undefined : Number(this.at)
|
|
293
|
+
if (at !== undefined && !(at >= 0)) throw new Error(`--at ${this.at}: seconds into the video`)
|
|
294
|
+
const words = {
|
|
295
|
+
...(this.plain ? { plain: true } : {}),
|
|
296
|
+
...(this.crop ? { crop: this.crop } : {}),
|
|
297
|
+
...(this.title ? { title: this.title } : {}),
|
|
298
|
+
...(this.line ? { line: this.line } : {}),
|
|
299
|
+
...(this.chip ? { chip: this.chip } : {}),
|
|
300
|
+
...(this.badge ? { badge: this.badge } : {}),
|
|
301
|
+
...(this.layout ? { layout: t.layoutOf(this.layout) } : {}),
|
|
302
|
+
...(this.place ? { place: t.placeOf(this.place) } : {}),
|
|
303
|
+
...(this.tag?.length ? { tag: this.tag } : {}),
|
|
304
|
+
}
|
|
305
|
+
const pictures = (at: (p: string) => string) => ({
|
|
306
|
+
...(this.wordmark ? { wordmark: at(this.wordmark) } : {}),
|
|
307
|
+
...(this.studio ? { studio: at(this.studio) } : {}),
|
|
308
|
+
...(this.figure?.length ? { figure: this.figure.map(at) } : {}),
|
|
309
|
+
})
|
|
310
|
+
const kb = (n: number): string => `${Math.round(n / 1000)} KB`
|
|
311
|
+
if (this.draft) {
|
|
312
|
+
if (this.out) throw new Error('--out and --draft: a draft names its thumbnail after its video')
|
|
313
|
+
const { desk } = await model(undefined)
|
|
314
|
+
const { findDraft } = await import('../social/load.ts')
|
|
315
|
+
const d = findDraft(desk, this.draft, cwd)
|
|
316
|
+
// a path the agent typed is kept from the repo's root, so the recipe reads the same from any folder
|
|
317
|
+
const rooted = (p: string | undefined): string | undefined => (p === undefined ? undefined : relative(root, resolve(cwd, p)))
|
|
318
|
+
const r = await t.thumbnailDraft(root, d.slug, { ...words, ...pictures((p) => relative(root, resolve(cwd, p))), ...(this.video ? { video: rooted(this.video) } : {}), ...(this.frame ? { frame: rooted(this.frame) } : {}), ...(at !== undefined ? { at } : {}), ...(this.cover !== undefined ? { cover: this.cover } : {}) }, { unit })
|
|
319
|
+
say(this.context)(`ok: ${d.slug} ${r.media} (${kb(r.bytes)}${r.at != null ? `, the frame at ${r.at} s` : ''}), its recipe kept as thumbnail: ${t.recipeLine(r.recipe)}`)
|
|
320
|
+
for (const c of r.covers)
|
|
321
|
+
say(this.context)(
|
|
322
|
+
c.did === 'skipped'
|
|
323
|
+
? `note: ${c.media} not covered: ${c.why}`
|
|
324
|
+
: `ok: ${c.media} ${c.did === 'kept' ? 'already opens on it, left as it is' : `${c.did === 'replaced' ? 'its older cover replaced' : 'covered'}: its first 3 frames the thumbnail, the sound as much later (${c.seconds.toFixed(1)} s)`}`,
|
|
325
|
+
)
|
|
326
|
+
for (const n of r.notes) say(this.context)(`note: ${n}`)
|
|
327
|
+
return 0
|
|
328
|
+
}
|
|
329
|
+
const r = await t.makeThumbnail(root, { ...words, ...pictures((p) => p), ...(this.video ? { video: this.video } : {}), ...(this.frame ? { frame: this.frame } : {}), ...(at !== undefined ? { at } : {}), ...(this.out ? { out: this.out } : {}) }, cwd, unit)
|
|
330
|
+
say(this.context)(`ok: ${relative(cwd, r.file)} (${kb(r.bytes)}${r.at != null ? `, the frame at ${r.at} s` : ''})`)
|
|
331
|
+
say(this.context)(`its recipe: sk social thumbnail ${t.recipeLine(r.recipe)}`)
|
|
332
|
+
if (this.cover) {
|
|
333
|
+
if (!this.video) throw new Error('--cover covers a video: name it')
|
|
334
|
+
const c = await import('../social/cover.ts')
|
|
335
|
+
const { join } = await import('node:path')
|
|
336
|
+
const { LAYOUT } = await import('../core/layout.ts')
|
|
337
|
+
const video = resolve(cwd, this.video)
|
|
338
|
+
const out = c.coveredOfVideo(video)
|
|
339
|
+
if (c.coverCount(video, r.file) > 0) say(this.context)(`note: ${this.video} already opens on it: no covered copy`)
|
|
340
|
+
else {
|
|
341
|
+
await c.writeCover(video, r.file, out, join(root, LAYOUT.tmp, 'thumbnails'))
|
|
342
|
+
say(this.context)(`ok: ${relative(cwd, out)}, its first 3 frames the thumbnail, the sound as much later`)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
for (const n of r.notes) say(this.context)(`note: ${n}`)
|
|
346
|
+
return 0
|
|
347
|
+
})
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
246
351
|
class SocialPlanCommand extends Command {
|
|
247
352
|
static override paths = [['social', 'plan']]
|
|
248
353
|
static override usage = Command.Usage({
|
|
@@ -293,27 +398,6 @@ class SocialStateCommand extends Command {
|
|
|
293
398
|
}
|
|
294
399
|
}
|
|
295
400
|
|
|
296
|
-
class SocialMigrateCommand extends Command {
|
|
297
|
-
static override paths = [['social', 'migrate']]
|
|
298
|
-
static override usage = Command.Usage({
|
|
299
|
-
category: 'Social',
|
|
300
|
-
description: "the repo's v2 channel files become drafts, once: one draft a slug, a heading a channel",
|
|
301
|
-
details:
|
|
302
|
-
'Each `.shipkit/social/<channel>/<slug>[.<variant>].md` becomes `.shipkit/social/drafts/<moment>-<slug>/draft.md`: its picked or posted variant (else the first) is the text of `## <channel>`, the other variants are kept word for word under `## Angle`, a posted URL becomes its `## Posted` line. The v2 files are removed once their draft is written. --dry prints the plan and writes nothing.',
|
|
303
|
-
examples: [['the plan', 'sk social migrate --dry'], ['do it', 'sk social migrate']],
|
|
304
|
-
})
|
|
305
|
-
dry = Option.Boolean('--dry', false, { description: 'print the plan, write nothing' })
|
|
306
|
-
override async execute(): Promise<number> {
|
|
307
|
-
return guarded(this.context, async () => {
|
|
308
|
-
const { findRepoRoot } = await import('../ts/config.ts')
|
|
309
|
-
const { migrateV2 } = await import('../social/migrate.ts')
|
|
310
|
-
const r = migrateV2(findRepoRoot(process.cwd()), { dry: this.dry })
|
|
311
|
-
for (const l of r.lines) say(this.context)(l)
|
|
312
|
-
return 0
|
|
313
|
-
})
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
401
|
class SocialDiscordApplyCommand extends Command {
|
|
318
402
|
static override paths = [['social', 'discord', 'apply']]
|
|
319
403
|
static override usage = Command.Usage({
|
|
@@ -351,6 +435,7 @@ class SocialDiscordApplyCommand extends Command {
|
|
|
351
435
|
for (const l of r.changes) say(this.context)(l)
|
|
352
436
|
if (r.changes.length === 0) say(this.context)(`ok: the server of ${id} matches its layout and its pictures`)
|
|
353
437
|
for (const l of r.left) say(this.context)(`left alone: ${l}`)
|
|
438
|
+
for (const l of r.hidden) say(this.context)(`HIDDEN: ${l}`)
|
|
354
439
|
return 0
|
|
355
440
|
})
|
|
356
441
|
}
|
|
@@ -361,7 +446,7 @@ class IdentitiesCommand extends Command {
|
|
|
361
446
|
static override usage = Command.Usage({
|
|
362
447
|
category: 'Social',
|
|
363
448
|
description: 'every identity of the machine: its accounts online over its accounts, and the repos speaking as it',
|
|
364
|
-
details: "One folder an identity in the house repo's
|
|
449
|
+
details: "One folder an identity in the house repo's wiki/identities/ (wiki meta/identity-folder). Every repo names its own with speaksAs in repo.config.ts (SK038 fails one that names none). Each identity lists the repos seen from here that speak as it, archived ones apart; seen from outside a folder of house repos, it lists none and says so. Page: wiki tools/shipkit/social.md",
|
|
365
450
|
examples: [['every identity', 'sk identities'], ['as json', 'sk identities --json']],
|
|
366
451
|
})
|
|
367
452
|
json = Option.Boolean('--json', false, { description: 'one json object' })
|
|
@@ -458,4 +543,4 @@ class IdentitiesPushCommand extends Command {
|
|
|
458
543
|
}
|
|
459
544
|
}
|
|
460
545
|
|
|
461
|
-
export const SOCIAL_COMMANDS = [SocialCommand, SocialTimelineCommand, SocialCoverageCommand, SocialPostCommand, SocialReleaseCommand, SocialReleaseCardCommand, SocialPlanCommand, SocialStateCommand,
|
|
546
|
+
export const SOCIAL_COMMANDS = [SocialCommand, SocialTimelineCommand, SocialCoverageCommand, SocialPostCommand, SocialReleaseCommand, SocialReleaseCardCommand, SocialThumbnailCommand, SocialPlanCommand, SocialStateCommand, SocialDiscordApplyCommand, IdentitiesCommand, IdentitiesPushCommand]
|