rvlib-shipkit 2.31.0 → 2.33.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 +51 -0
- package/package.json +1 -1
- package/src/advisors/acts.ts +16 -15
- package/src/advisors/advice.ts +56 -102
- package/src/advisors/advisor-view.ts +122 -76
- package/src/advisors/app-graph.ts +1 -1
- package/src/advisors/app.ts +3 -11
- package/src/advisors/cf-api.ts +1 -1
- package/src/advisors/dir-bucket.ts +4 -3
- package/src/advisors/edge/api.ts +20 -221
- package/src/advisors/edge/bucket.ts +2 -2
- package/src/advisors/edge/handler.ts +13 -155
- package/src/advisors/edge/here.ts +5 -5
- package/src/advisors/edge/pages.ts +12 -9
- package/src/advisors/edge/shell.ts +6 -5
- package/src/advisors/edge/sign-in.ts +101 -36
- package/src/advisors/edge/status.ts +19 -6
- package/src/advisors/edge/types.ts +36 -60
- package/src/advisors/expose.ts +29 -29
- package/src/advisors/here.ts +12 -12
- package/src/advisors/invite-send.ts +79 -35
- package/src/advisors/invite.ts +31 -8
- package/src/advisors/job.ts +24 -16
- package/src/advisors/login.ts +40 -15
- package/src/advisors/owner-store.ts +46 -22
- package/src/advisors/photos.ts +3 -3
- package/src/advisors/project.ts +27 -25
- package/src/advisors/reach.ts +89 -0
- package/src/advisors/rights.ts +1 -1
- package/src/advisors/routes.ts +55 -74
- package/src/advisors/scan.ts +0 -4
- package/src/advisors/setup-run.ts +14 -14
- package/src/advisors/share-trace.ts +3 -3
- package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
- package/src/advisors/speaks.ts +29 -0
- package/src/advisors/sync.ts +97 -183
- package/src/advisors/tunnel.ts +6 -5
- package/src/advisors/users-listen.ts +92 -0
- package/src/advisors/users-router.ts +261 -87
- package/src/advisors/users-store.ts +81 -0
- package/src/agent-time/blocked-scan.ts +181 -0
- package/src/agent-time/registry.ts +12 -5
- package/src/agent-time/store.ts +9 -109
- package/src/asks/ask-bar-fold.ts +2 -1
- package/src/asks/ask-close.ts +2 -1
- package/src/asks/ask-doc.ts +2 -1
- package/src/asks/ask-migrate.ts +3 -2
- package/src/asks/ask-steps-fold.ts +2 -1
- package/src/asks/ask-store.ts +4 -3
- package/src/check.ts +3 -43
- package/src/checks/SK001-package-json-shape.check.ts +4 -55
- package/src/checks/SK004-gitignore-policy.check.ts +24 -69
- package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
- package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
- package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
- package/src/checks/SK020-self-spawning-check.check.ts +5 -7
- package/src/checks/SK035-public-clean.check.ts +1 -1
- package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
- package/src/checks/SK042-post-kinds.check.ts +5 -14
- package/src/checks/SK054-agent-allow-list.check.ts +5 -74
- package/src/checks/SK055-retired-config-keys.check.ts +45 -0
- package/src/cli/cmd_Advisors.ts +11 -45
- package/src/cli/cmd_Asks.ts +3 -10
- package/src/cli/cmd_Backup.ts +25 -127
- package/src/cli/cmd_BackupTargets.ts +1 -1
- package/src/cli/cmd_Capacity.ts +6 -2
- package/src/cli/cmd_Checks.ts +0 -14
- package/src/cli/cmd_Ci.ts +2 -1
- package/src/cli/cmd_Db.ts +3 -82
- package/src/cli/cmd_Home.ts +4 -32
- package/src/cli/cmd_Hq.ts +0 -17
- package/src/cli/cmd_Releases.ts +57 -4
- package/src/cli/cmd_Review.ts +333 -354
- package/src/cli/cmd_Shot.ts +26 -4
- package/src/cli/cmd_SocialDrafts.ts +6 -13
- package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_Trailer.ts +1 -1
- package/src/cli/inbox-hook-run.ts +5 -23
- package/src/cli/registry-heads.ts +5 -55
- package/src/cli/registry.ts +1 -5
- package/src/cli/review-here.ts +1 -1
- package/src/cli.ts +15 -4
- package/src/collections/collection-types.ts +1 -1
- package/src/collections/review.ts +5 -4
- package/src/core/admission.ts +268 -0
- package/src/core/agent-allow-policy.ts +32 -2
- package/src/core/agent-env.ts +8 -0
- package/src/core/allow-rows.ts +74 -0
- package/src/core/check-file-names.ts +19 -106
- package/src/core/code-lines.ts +36 -21
- package/src/core/footprint.ts +17 -13
- package/src/core/identities-root.ts +1 -4
- package/src/core/layout.ts +1 -2
- package/src/core/machine-db.ts +33 -208
- package/src/core/machine-layout.ts +14 -127
- package/src/core/machine-read.ts +5 -2
- package/src/core/mask-source.ts +60 -0
- package/src/core/memory-watch.ts +17 -14
- package/src/core/motherhome.ts +8 -35
- package/src/core/one-way-in-policy.ts +0 -3
- package/src/core/peer-sk.ts +8 -0
- package/src/core/repo-walk.ts +0 -9
- package/src/core/retention.ts +1 -9
- package/src/core/retired-checks.ts +2 -0
- package/src/core/tmux-policy.ts +1 -1
- package/src/core/tree-watch.ts +2 -2
- package/src/core/when.ts +7 -45
- package/src/gate/admit-heavy.ts +150 -0
- package/src/gate/check-runner.ts +6 -0
- package/src/gate/discover-checks.ts +42 -32
- package/src/gate/gate-checks.ts +21 -131
- package/src/gate/head-gate.ts +1 -1
- package/src/gate/job-run.ts +2 -1
- package/src/gate/pre-commit-discovery.ts +22 -28
- package/src/gate/run-check.ts +3 -4
- package/src/gate/run-ci.ts +4 -0
- package/src/gate/run-fix.ts +5 -17
- package/src/gate/run-fixers.ts +6 -42
- package/src/home/app-sign.ts +2 -2
- package/src/home/backup-status.ts +52 -92
- package/src/home/backup-verdict.ts +2 -2
- package/src/home/daemon-jobs.ts +51 -95
- package/src/home/database-words.ts +1 -2
- package/src/home/databases.ts +9 -25
- package/src/home/home-launchd.ts +0 -6
- package/src/home/home-paths.ts +8 -4
- package/src/home/home-routes.ts +3 -10
- package/src/home/home-state.ts +2 -14
- package/src/home/inbox-shape.ts +14 -15
- package/src/home/inbox.ts +1 -1
- package/src/home/machine-repair.ts +102 -103
- package/src/home/resume.ts +1 -15
- package/src/home/run-daemon.ts +7 -12
- package/src/home/space-page.ts +3 -2
- package/src/home/supervise.ts +3 -7
- package/src/hooks/commit-msg-run.ts +61 -0
- package/src/hooks/commit-run.ts +16 -166
- package/src/hooks/gate-outcome.ts +108 -0
- package/src/hooks/git-hook.ts +9 -9
- package/src/hooks/hook-config.ts +8 -8
- package/src/hooks/leak-guard.ts +1 -1
- package/src/hooks/pre-commit-checks.ts +1 -1
- package/src/hooks/run-hooks.ts +2 -6
- package/src/hooks/shared-file.ts +3 -2
- package/src/hq/daemon-db.ts +8 -8
- package/src/hq/door.ts +3 -16
- package/src/hq/hq-db.ts +4 -3
- package/src/hq/hq-local.ts +1 -2
- package/src/hq/hq-store.ts +0 -15
- package/src/hq/item-direct.ts +8 -10
- package/src/hq/item-fill.ts +37 -0
- package/src/hq/kinds/item-gone.ts +7 -10
- package/src/hq/kinds/item-msg.ts +12 -18
- package/src/hq/kinds/item.ts +13 -19
- package/src/hq/kinds/report.ts +3 -4
- package/src/hq/owner-switch.ts +3 -3
- package/src/hq/report.ts +5 -9
- package/src/hq/switch.ts +2 -11
- package/src/hq/thread-sync.ts +5 -17
- package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
- package/src/http/owner-word.ts +1 -1
- package/src/identities/machine.ts +16 -0
- package/src/init-repo.ts +0 -1
- package/src/ledger/check-stats.ts +6 -5
- package/src/ledger/db.ts +2 -4
- package/src/ledger/record-kept.ts +117 -48
- package/src/ledger/run-log.ts +21 -2
- package/src/ledger/slow-tests.ts +96 -0
- package/src/ledger/store.ts +3 -86
- package/src/ledger/suite-log.ts +8 -2
- package/src/media-store/backup/facts.ts +3 -37
- package/src/media-store/backup/keys.ts +1 -8
- package/src/media-store/backup/manifest.ts +6 -67
- package/src/media-store/backup/restore.ts +4 -13
- package/src/media-store/backup/retention.ts +13 -1
- package/src/media-store/backup/run.ts +6 -267
- package/src/media-store/backup/snapshot.ts +2 -38
- package/src/media-store/backup/sources.ts +3 -113
- package/src/media-store/backup/target-send.ts +5 -29
- package/src/media-store/db.ts +8 -7
- package/src/media-store/forget-one.ts +1 -1
- package/src/media-store/forget.ts +1 -80
- package/src/orchestrator/guards.ts +0 -1
- package/src/orchestrator/presence.ts +2 -2
- package/src/orchestrator/routes.ts +1 -1
- package/src/orchestrator/started.ts +0 -9
- package/src/orchestrator/talk-key.ts +3 -4
- package/src/orchestrator/unheard.ts +1 -1
- package/src/plan/planner.ts +3 -2
- package/src/recordings/edit.ts +3 -3
- package/src/recordings/marks-draw.ts +17 -6
- package/src/recordings/marks.ts +120 -9
- package/src/reflections/reflections-queue.ts +3 -10
- package/src/release/notes.ts +1 -1
- package/src/release/public-clean.ts +66 -6
- package/src/release/run-bump.ts +11 -0
- package/src/release/run-release.ts +4 -0
- package/src/releases/from-thread.ts +3 -3
- package/src/releases/model.ts +186 -36
- package/src/releases/store.ts +13 -3
- package/src/releases/validate.ts +83 -0
- package/src/repo-config.ts +36 -64
- package/src/review/answer-kinds.ts +63 -4
- package/src/review/blocked-guard.ts +11 -0
- package/src/review/blocked-object.ts +298 -0
- package/src/review/cells.ts +144 -230
- package/src/review/close.ts +39 -1
- package/src/review/doc-save.ts +3 -2
- package/src/review/draft-item.ts +1 -1
- package/src/review/events.ts +3 -7
- package/src/review/expect.ts +23 -39
- package/src/review/format.ts +79 -46
- package/src/review/glyphs.ts +1 -0
- package/src/review/hand-over.ts +3 -3
- package/src/review/heard.ts +1 -1
- package/src/review/holds-sync.ts +2 -1
- package/src/review/inbox-hook.ts +2 -2
- package/src/review/inbox-read.ts +39 -33
- package/src/review/instruction-guards.ts +12 -0
- package/src/review/instructions.ts +0 -1
- package/src/review/item-db.ts +13 -43
- package/src/review/item-hq.ts +2 -2
- package/src/review/item-rows.ts +3 -14
- package/src/review/kind-catalog.ts +3 -1
- package/src/review/kinds.ts +18 -8
- package/src/review/live-view.ts +3 -0
- package/src/review/media-kind.ts +1 -1
- package/src/review/mentions.ts +1 -2
- package/src/review/model.ts +158 -114
- package/src/review/move.ts +149 -0
- package/src/review/need-threads.ts +3 -2
- package/src/review/object-card.ts +11 -0
- package/src/review/object-read.ts +6 -1
- package/src/review/one-block.ts +1 -1
- package/src/review/owner-read.ts +1 -1
- package/src/review/phone-push.ts +10 -9
- package/src/review/previews.ts +32 -4
- package/src/review/push.ts +2 -2
- package/src/review/recap.ts +129 -0
- package/src/review/referring.ts +6 -3
- package/src/review/reflection-object.ts +4 -3
- package/src/review/routes.ts +51 -47
- package/src/review/secret-route.ts +3 -2
- package/src/review/settle.ts +0 -6
- package/src/review/snooze.ts +5 -3
- package/src/review/speaker.ts +68 -0
- package/src/review/start-title.ts +19 -0
- package/src/review/store-parties.ts +28 -0
- package/src/review/store.ts +94 -59
- package/src/review/{wakes.ts → thread-events.ts} +92 -7
- package/src/review/thread-md.ts +35 -14
- package/src/review/thread-state.ts +804 -0
- package/src/review/threads.ts +29 -347
- package/src/review/traces.ts +104 -7
- package/src/review/trailer-item.ts +1 -1
- package/src/review/unit.ts +7 -9
- package/src/review/verdict-items.ts +12 -10
- package/src/review/view-layout.ts +25 -1
- package/src/review/watch-feed.ts +1 -2
- package/src/review/working-guards.ts +2 -3
- package/src/rules/untrack-generated.ts +1 -15
- package/src/secrets/copy.ts +4 -4
- package/src/secrets/lapse.ts +2 -1
- package/src/serve/hub-app/advisor-app.tsx +4 -4
- package/src/serve/hub-app/advisor-face.tsx +9 -3
- package/src/serve/hub-app/advisor-host.ts +27 -27
- package/src/serve/hub-app/advisors-model.ts +17 -8
- package/src/serve/hub-app/advisors-rights.tsx +1 -1
- package/src/serve/hub-app/advisors-st.ts +15 -14
- package/src/serve/hub-app/advisors-view.tsx +13 -11
- package/src/serve/hub-app/app-bridge.ts +23 -3
- package/src/serve/hub-app/asks-page.tsx +1 -1
- package/src/serve/hub-app/auto-text.tsx +71 -16
- package/src/serve/hub-app/check-view.tsx +0 -8
- package/src/serve/hub-app/controls.css +14 -3
- package/src/serve/hub-app/database-view.tsx +1 -2
- package/src/serve/hub-app/dock-st.ts +1 -1
- package/src/serve/hub-app/git-view.tsx +3 -1
- package/src/serve/hub-app/hub.css +12 -5
- package/src/serve/hub-app/icons.tsx +1 -1
- package/src/serve/hub-app/inbox-view.tsx +1 -2
- package/src/serve/hub-app/live-sources.ts +2 -2
- package/src/serve/hub-app/main-panel.tsx +2 -1
- package/src/serve/hub-app/panel-repo.ts +0 -9
- package/src/serve/hub-app/pic.tsx +29 -12
- package/src/serve/hub-app/polled.ts +16 -2
- package/src/serve/hub-app/recordings-st.ts +23 -2
- package/src/serve/hub-app/recordings-view.tsx +68 -10
- package/src/serve/hub-app/ref-pill.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +1 -2
- package/src/serve/hub-app/review/advisor-add.tsx +1 -1
- package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
- package/src/serve/hub-app/review/draft-body.tsx +2 -2
- package/src/serve/hub-app/review/heard-line.tsx +1 -1
- package/src/serve/hub-app/review/instructions-view.tsx +1 -8
- package/src/serve/hub-app/review/kind-states.tsx +14 -9
- package/src/serve/hub-app/review/kit.tsx +4 -11
- package/src/serve/hub-app/review/lane-bar.tsx +3 -3
- package/src/serve/hub-app/review/lightbox.tsx +15 -11
- package/src/serve/hub-app/review/line-window.ts +4 -1
- package/src/serve/hub-app/review/live-bar-st.ts +2 -2
- package/src/serve/hub-app/review/live-view.tsx +57 -1
- package/src/serve/hub-app/review/object-panel.tsx +20 -8
- package/src/serve/hub-app/review/question-views.tsx +191 -53
- package/src/serve/hub-app/review/recap-bar.tsx +40 -0
- package/src/serve/hub-app/review/request-cell.tsx +48 -0
- package/src/serve/hub-app/review/review-cells.tsx +154 -96
- package/src/serve/hub-app/review/review-host.ts +8 -4
- package/src/serve/hub-app/review/review-kit.ts +17 -11
- package/src/serve/hub-app/review/review-list.tsx +30 -35
- package/src/serve/hub-app/review/review-st.ts +32 -42
- package/src/serve/hub-app/review/review-thread.tsx +139 -85
- package/src/serve/hub-app/review/review-views.tsx +127 -68
- package/src/serve/hub-app/review/share-lines.tsx +4 -4
- package/src/serve/hub-app/review/start-st.ts +2 -5
- package/src/serve/hub-app/review/superseded-runs.ts +4 -3
- package/src/serve/hub-app/review/thread-close.tsx +10 -7
- package/src/serve/hub-app/review/thread-st.ts +381 -202
- package/src/serve/hub-app/review/tone-bar.tsx +129 -0
- package/src/serve/hub-app/review/tones.ts +53 -0
- package/src/serve/hub-app/review/trailer-body.tsx +2 -2
- package/src/serve/hub-app/review/trailer-st.ts +3 -2
- package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
- package/src/serve/hub-app/review.css +189 -106
- package/src/serve/hub-app/search-view.tsx +1 -1
- package/src/serve/hub-app/social/social-model.ts +0 -4
- package/src/serve/hub-app/source-acts.ts +2 -1
- package/src/serve/hub-app/stores/stores-page.tsx +2 -2
- package/src/serve/hub-app/terminal-sources.tsx +2 -1
- package/src/serve/hub-app/thread-row.tsx +3 -4
- package/src/serve/hub-app/tree-build.ts +0 -4
- package/src/serve/hub-app/urls-view.tsx +2 -1
- package/src/serve/hub-app/view-layout.css +13 -3
- package/src/serve/hub-app/wikis-view.tsx +5 -2
- package/src/serve/hub-runtime.ts +7 -37
- package/src/serve/project-gutter-route.ts +6 -2
- package/src/serve/read-thread.ts +20 -2
- package/src/serve/read-worker.ts +9 -1
- package/src/serve/record-pages.ts +46 -0
- package/src/serve/serve-hub.ts +2 -2
- package/src/serve/terminal-host.ts +1 -1
- package/src/serve/terminal-route.ts +1 -3
- package/src/serve/tracked-watch.ts +1 -3
- package/src/setup-house.ts +2 -2
- package/src/shipkit-files.ts +1 -1
- package/src/shipkit.ts +1 -6
- package/src/shot/client.ts +2 -1
- package/src/shot/film-box.ts +0 -20
- package/src/shot/on-place.ts +141 -0
- package/src/social/drafts.ts +1 -1
- package/src/social/kinds.ts +6 -29
- package/src/social/load.ts +2 -2
- package/src/social/post-object.ts +3 -2
- package/src/social/release-stage.ts +1 -1
- package/src/social/stage.ts +2 -2
- package/src/stores/model.ts +4 -0
- package/src/stores/routes.ts +11 -3
- package/src/suite/judge-suites.ts +58 -0
- package/src/suite/red-alone.ts +54 -18
- package/src/suite/runner-shapes.ts +2 -2
- package/src/suite/suite-cli.ts +67 -14
- package/src/suite/test-units.ts +2 -1
- package/src/urls/fill.ts +1 -1
- package/src/urls/places.ts +1 -2
- package/src/vault/vault-config.ts +2 -2
- package/src/vault/vault-init.ts +1 -5
- package/src/wiki/graph-page.ts +14 -2
- package/src/advisors/copy-truth.ts +0 -49
- package/src/advisors/door-child.ts +0 -112
- package/src/advisors/door-serve.ts +0 -52
- package/src/advisors/door.ts +0 -118
- package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
- package/src/checks/SK029-explicit-check-files.check.ts +0 -112
- package/src/checks/SK048-one-local-file.check.ts +0 -36
- package/src/core/config-rewrite.ts +0 -111
- package/src/core/daemon-port.ts +0 -10
- package/src/core/legacy-shapes.ts +0 -263
- package/src/core/migrate-layout.ts +0 -638
- package/src/core/port-check-cli.ts +0 -52
- package/src/core/port-check-file.ts +0 -295
- package/src/core/port-check-files.ts +0 -31
- package/src/gate/discover-legacy-checks.ts +0 -26
- package/src/home/home-move.ts +0 -527
- package/src/home/machine-fold.ts +0 -810
- package/src/hq/item-shapes.ts +0 -54
- package/src/hq/kinds/items-read.ts +0 -4
- package/src/media-store/backup/daemon.ts +0 -220
- package/src/media-store/backup/kept.ts +0 -241
- package/src/media-store/backup/prune.ts +0 -359
- package/src/media-store/backup/secret.ts +0 -88
- package/src/media-store/backup/ssh-space.ts +0 -202
- package/src/media-store/backup/watch.ts +0 -117
- package/src/review/band.ts +0 -182
- package/src/review/folders.ts +0 -216
- package/src/review/hook-ask.ts +0 -58
- package/src/review/role.ts +0 -48
- package/src/review/thread-fold.ts +0 -64
- package/src/review/wait.ts +0 -91
- package/src/rules/rule.ts +0 -43
- package/src/serve/hook-thread.ts +0 -37
- package/src/serve/hook-work.ts +0 -92
- package/src/serve/hook-worker.ts +0 -57
- package/src/serve/hub-app/review/dock.tsx +0 -147
- package/src/serve/hub-app/review/faces.tsx +0 -18
- package/src/serve/hub-app/review/item-verdict.tsx +0 -112
- package/src/serve/hub-app/review/review-board.tsx +0 -48
- /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
package/src/cli/cmd_Db.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// sk db: every database of this machine, its size on disk, its cap, its copies, and each table's rows and bytes, the
|
|
2
2
|
// words of the home's database page. Report only: every file is opened read only, never a row's content
|
|
3
3
|
import { Command, Option } from './clip.ts'
|
|
4
|
-
import { StoreRefused, WAIT_EXIT } from '../core/machine-db.ts'
|
|
5
|
-
import { bytesWords } from '../core/words.ts'
|
|
6
4
|
|
|
7
5
|
export class DbCommand extends Command {
|
|
8
6
|
static override paths = [['db']]
|
|
@@ -10,7 +8,7 @@ export class DbCommand extends Command {
|
|
|
10
8
|
static override usage = Command.Usage({
|
|
11
9
|
category: 'Health',
|
|
12
10
|
description: 'every database of this machine: its size on disk, its cap, each table with its rows and bytes',
|
|
13
|
-
details: "The total first, how much of it is the truth, caches that build again and this machine's own state, then each house repo's share of every database (by project; a project's bytes in a shared table are an estimate, and what names no repo is said apart). Then the hq, with its versions, its feed, its replica, its last restore drill and each node's rows of each kind against its share, then the daemon's database, the machine db (its own state, and the media index and the agent time index as its media_ and time_ tables, each part with its tables) and each house repo's run record, the biggest first.
|
|
11
|
+
details: "The total first, how much of it is the truth, caches that build again and this machine's own state, then each house repo's share of every database (by project; a project's bytes in a shared table are an estimate, and what names no repo is said apart). Then the hq, with its versions, its feed, its replica, its last restore drill and each node's rows of each kind against its share, then the daemon's database, the machine db (its own state, and the media index and the agent time index as its media_ and time_ tables, each part with its tables) and each house repo's run record, the biggest first. Sizes and pages are read at each call; the rows and bytes of each table are those the daemon's job `db census` counted, with their age, since a count of the big files takes seconds. `--fresh` counts every file now, in this process. Every file is opened read only and none is made.",
|
|
14
12
|
examples: [
|
|
15
13
|
['every database', 'sk db'],
|
|
16
14
|
['the hq alone', 'sk db hq'],
|
|
@@ -61,14 +59,6 @@ export class DbCommand extends Command {
|
|
|
61
59
|
return 0
|
|
62
60
|
}
|
|
63
61
|
this.context.stdout.write(`${databaseLines(shown, now).join('\n')}\n`)
|
|
64
|
-
if (want == null) {
|
|
65
|
-
const { foldWords } = await import('../home/machine-fold.ts')
|
|
66
|
-
try {
|
|
67
|
-
this.context.stdout.write(`${foldWords().join('\n')}\n`)
|
|
68
|
-
} catch (e) {
|
|
69
|
-
this.context.stdout.write(`WARN the fold's state does not read: ${(e as Error).message}\n`)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
62
|
return 0
|
|
73
63
|
}
|
|
74
64
|
}
|
|
@@ -92,7 +82,7 @@ export class DbThreadsCommand extends Command {
|
|
|
92
82
|
|
|
93
83
|
async execute(): Promise<number> {
|
|
94
84
|
const { HQ_THREADS, threadsWhere } = await import('../review/item-hq.ts')
|
|
95
|
-
const { threadsLine } = await import('../hq/
|
|
85
|
+
const { threadsLine } = await import('../hq/threads-words.ts')
|
|
96
86
|
if (this.to != null) {
|
|
97
87
|
if (this.to !== 'on' && this.to !== 'off') {
|
|
98
88
|
this.context.stderr.write(`FAIL: on or off, not ${JSON.stringify(this.to).slice(0, 40)}\n`)
|
|
@@ -115,75 +105,6 @@ export class DbThreadsCommand extends Command {
|
|
|
115
105
|
}
|
|
116
106
|
}
|
|
117
107
|
|
|
118
|
-
/** sk db fold: the media index, the agent time index and the daemon's file into the machine db, the machine's one
|
|
119
|
-
* local file */
|
|
120
|
-
export class DbFoldCommand extends Command {
|
|
121
|
-
static override paths = [['db', 'fold']]
|
|
122
|
-
|
|
123
|
-
static override usage = Command.Usage({
|
|
124
|
-
category: 'Health',
|
|
125
|
-
description: "the media and agent time indexes and the daemon's file into the machine db (dry run first)",
|
|
126
|
-
details: "Says what it would do: each store still in a file of its own, its size, where its whole copy goes (`<file>.before-fold`, the way back) and the room it needs. With `--go`, per store: the copy, its rows copied into the machine db's `media_` or `time_` tables (the daemon's file: its tables under their own names) in steps of a few ms, every table counted on both sides (a difference drops the new tables and keeps the file), then the old file replaced by a text tombstone that code before the fold refuses to open. A fold by hand turns the daemon's fold on (the switch db-fold-auto). `--back --go` (with the home down: `sk pm uninstall`) writes every row of the tables, those added since the fold too, into a file of the old shape that replaces each tombstone, then drops the tables and turns the daemon's fold off: each store is then read and written in its own file, for as long as the owner wants, with no other code. On a machine never folded it gives each file the tables this code reads. A fold or a way back killed at any step is ended by the next run of either.",
|
|
127
|
-
examples: [
|
|
128
|
-
['what the fold would do', 'sk db fold'],
|
|
129
|
-
['fold', 'sk db fold --go'],
|
|
130
|
-
['the way back', 'sk db fold --back --go'],
|
|
131
|
-
['the copies kept for the way back, deleted once sure', 'sk db fold --rm-copies --go'],
|
|
132
|
-
],
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
go = Option.Boolean('--go', false, { description: 'do it; without it, say what it would do' })
|
|
136
|
-
back = Option.Boolean('--back', false, { description: 'put each store back in its own file from its copy' })
|
|
137
|
-
noticeDone = Option.String('--notice-done', { required: false, description: "the check of the fold's notice: exits 0 on the machine of that key once its copies are gone" })
|
|
138
|
-
rmCopies = Option.Boolean('--rm-copies', false, { description: 'the copies a fold kept for the way back: says which, --go deletes them' })
|
|
139
|
-
|
|
140
|
-
async execute(): Promise<number> {
|
|
141
|
-
const { fold, foldPlan, foldWords, rmCopies, unfold } = await import('../home/machine-fold.ts')
|
|
142
|
-
if (this.noticeDone != null) {
|
|
143
|
-
const { noticeDone, shortKey } = await import('../home/machine-fold.ts')
|
|
144
|
-
if (noticeDone(this.noticeDone)) return 0
|
|
145
|
-
this.context.stderr.write(this.noticeDone === shortKey() ? 'the copies of the old files are still here: sk db fold --rm-copies\n' : `this is machine ${shortKey()}, the notice is machine ${this.noticeDone}'s: its check runs there\n`)
|
|
146
|
-
return 1
|
|
147
|
-
}
|
|
148
|
-
if (this.rmCopies) {
|
|
149
|
-
rmCopies({ go: this.go, print: (l) => void this.context.stdout.write(`${l}\n`) })
|
|
150
|
-
return 0
|
|
151
|
-
}
|
|
152
|
-
const { machineDbPath } = await import('../core/machine-db.ts')
|
|
153
|
-
const print = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
154
|
-
const plan = foldPlan()
|
|
155
|
-
const { oldDamage } = await import('../home/machine-fold.ts')
|
|
156
|
-
print(`this machine's key: ${(await import('../home/machine-fold.ts')).shortKey()}`)
|
|
157
|
-
for (const s of plan.states) {
|
|
158
|
-
const hurt = !this.back && s.state === 'own file' ? oldDamage(s.old) : null
|
|
159
|
-
print(`${s.store}: ${s.state === 'own file' ? `its own file ${s.old}, ${bytesWords(s.bytes)}${hurt == null ? '' : `, DAMAGED (${hurt}): the fold leaves it as it is`}` : s.state === 'folded' ? `folded into ${machineDbPath()}${s.copy == null ? '' : `, its copy ${s.copy.path} ${bytesWords(s.copy.bytes)}`}` : s.state === 'half' ? `a ${s.mark?.way === 'back' ? 'way back' : 'fold'} stopped half way: sk db fold ${s.mark?.way === 'back' ? '--back ' : ''}--go ends it` : 'no file'}`)
|
|
160
|
-
}
|
|
161
|
-
if (!this.go) {
|
|
162
|
-
for (const l of foldWords().slice(0, 1)) print(l)
|
|
163
|
-
if (this.back) print(`dry run: --back --go puts back ${plan.states.filter((s) => s.state === 'folded' && s.copy != null).map((s) => s.store).join(' and ') || 'nothing'}`)
|
|
164
|
-
else print(`dry run: --go folds ${plan.states.filter((s) => s.state === 'own file' || s.state === 'half').map((s) => s.store).join(' and ') || 'nothing'} into ${machineDbPath()}; it needs ${bytesWords(plan.need)}, the disk has ${bytesWords(plan.free)} free`)
|
|
165
|
-
return 0
|
|
166
|
-
}
|
|
167
|
-
try {
|
|
168
|
-
// the daemon keeps the media index open: a write it makes to the tables after their rows went back is lost
|
|
169
|
-
if (this.back && (await (await import('../home/home-paths.ts')).pmUp())) {
|
|
170
|
-
this.context.stderr.write('FAIL: the way back needs the home down, its daemon holds the media index and its own file open: sk pm uninstall, then sk db fold --back --go, then sk pm install\n')
|
|
171
|
-
return 1
|
|
172
|
-
}
|
|
173
|
-
if (this.back) await unfold({ print })
|
|
174
|
-
else {
|
|
175
|
-
const done = await fold({ print, byHand: true })
|
|
176
|
-
for (const d of done) print(`${d.store}: ${d.done ? `folded in ${(d.ms / 1000).toFixed(1)} s, the longest step ${d.heldMs} ms` : d.why}`)
|
|
177
|
-
if (done.some((d) => d.why.startsWith('damaged'))) return 1
|
|
178
|
-
}
|
|
179
|
-
return 0
|
|
180
|
-
} catch (e) {
|
|
181
|
-
this.context.stderr.write(`FAIL: ${(e as Error).message}\n`)
|
|
182
|
-
return e instanceof StoreRefused && e.wait ? WAIT_EXIT : 1
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
108
|
/** sk db drop: a cache part of the machine db dropped and made again empty */
|
|
188
109
|
export class DbDropCommand extends Command {
|
|
189
110
|
static override paths = [['db', 'drop']]
|
|
@@ -227,7 +148,7 @@ export class DbRepairCommand extends Command {
|
|
|
227
148
|
static override usage = Command.Usage({
|
|
228
149
|
category: 'Health',
|
|
229
150
|
description: 'the damaged tables of a part of the machine db repaired: every row that reads is kept',
|
|
230
|
-
details: "The part is `media`, `time` or `daemon`. It takes the tables sqlite's check finds damaged, a table or one of its indexes, and says first, for each, how many rows read and how many are lost (counted through an index that reads). `--go` saves every row that reads aside in steps (by rowid ranges, read around a damaged page), cuts the table out of the schema with the system's sqlite shell (a DROP stops at the damaged page, and bun's sqlite refuses to edit a schema), makes it again with its indexes and fills it again in steps. A damaged index alone loses no row. Killed at any step, it is ended by the next `--go`. The pages of the cut table stay unused until `sk db rebuild --go`.
|
|
151
|
+
details: "The part is `media`, `time` or `daemon`. It takes the tables sqlite's check finds damaged, a table or one of its indexes, and says first, for each, how many rows read and how many are lost (counted through an index that reads). `--go` saves every row that reads aside in steps (by rowid ranges, read around a damaged page), cuts the table out of the schema with the system's sqlite shell (a DROP stops at the damaged page, and bun's sqlite refuses to edit a schema), makes it again with its indexes and fills it again in steps. A damaged index alone loses no row. Killed at any step, it is ended by the next `--go`. The pages of the cut table stay unused until `sk db rebuild --go`. For `daemon`, the items it lost then come back from the hq: the feed is read again from its start, every head and message the hq holds that the store lacks lands, and the last line says how many came back and how many the hq did not hold.",
|
|
231
152
|
examples: [
|
|
232
153
|
['what a repair would keep and lose', 'sk db repair time'],
|
|
233
154
|
['repair', 'sk db repair time --go'],
|
package/src/cli/cmd_Home.ts
CHANGED
|
@@ -4,8 +4,7 @@ import { LIB_VERSION } from '../core/lib-version.ts'
|
|
|
4
4
|
import { stampConsole, stampedIo } from '../core/log-stamp.ts'
|
|
5
5
|
import { fileURLToPath } from 'url'
|
|
6
6
|
import { markAutostart } from '../home/autostart.ts'
|
|
7
|
-
import {
|
|
8
|
-
import { homeMove, whoRuns } from '../home/home-move.ts'
|
|
7
|
+
import { installHome, uninstallHome } from '../home/home-launchd.ts'
|
|
9
8
|
import { homeInstalled, houseCli, houseRoot, houseRootOf, openProjectApp, openWindow, startHome } from '../home/home-start.ts'
|
|
10
9
|
import { ROLES } from '../home/pm.ts'
|
|
11
10
|
import { pmSwitchDeps, switchProcess } from '../home/pm-switch.ts'
|
|
@@ -102,9 +101,9 @@ export class DaemonJobCommand extends Command {
|
|
|
102
101
|
|
|
103
102
|
id = Option.String({ required: true, name: 'id' })
|
|
104
103
|
async execute(): Promise<number> {
|
|
105
|
-
const {
|
|
106
|
-
const id =
|
|
107
|
-
if (id
|
|
104
|
+
const { isJobId, DAEMON_JOBS, runJobBody } = await import('../home/daemon-jobs.ts')
|
|
105
|
+
const id = this.id
|
|
106
|
+
if (!isJobId(id)) {
|
|
108
107
|
this.context.stderr.write(`FAIL: no daemon job ${JSON.stringify(this.id)}: ${DAEMON_JOBS.map((j) => j.id).join(', ')}\n`)
|
|
109
108
|
return 1
|
|
110
109
|
}
|
|
@@ -214,33 +213,6 @@ export class PmUninstallCommand extends Command {
|
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
|
|
217
|
-
export class HomeMoveCommand extends Command {
|
|
218
|
-
static override paths = [['home', 'move']]
|
|
219
|
-
|
|
220
|
-
static override usage = Command.Usage({
|
|
221
|
-
category: 'Serve',
|
|
222
|
-
description: "move the machine's state from ~/.config/shipkit to its one root ~/.shipkit (dry unless --go)",
|
|
223
|
-
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",
|
|
224
|
-
examples: [
|
|
225
|
-
['what it would do', 'sk home move'],
|
|
226
|
-
['do it, once pm, the vault and the replica are stopped', 'sk home move --go'],
|
|
227
|
-
['undo it', 'sk home move --back --go'],
|
|
228
|
-
],
|
|
229
|
-
})
|
|
230
|
-
|
|
231
|
-
go = Option.Boolean('--go', false, { description: 'do it (else a dry run)' })
|
|
232
|
-
back = Option.Boolean('--back', false, { description: 'move the state back to ~/.config/shipkit, from the record of the move' })
|
|
233
|
-
|
|
234
|
-
async execute(): Promise<number> {
|
|
235
|
-
const home = homedir()
|
|
236
|
-
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`)
|
|
237
|
-
const root = houseRoot(process.cwd(), { home })
|
|
238
|
-
const repos = root == null ? [] : [root, ...houseRepos(root, home).repos.map((r) => r.path)]
|
|
239
|
-
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 !== '')
|
|
240
|
-
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 })
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
216
|
export class GuiCommand extends Command {
|
|
245
217
|
static override paths = [['gui']]
|
|
246
218
|
|
package/src/cli/cmd_Hq.ts
CHANGED
|
@@ -414,16 +414,6 @@ export class HqThreadsCommand extends Command {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
export class HqCardsAliasCommand extends HqThreadsCommand {
|
|
418
|
-
static override paths = [['hq', 'cards']]
|
|
419
|
-
static override usage = undefined
|
|
420
|
-
|
|
421
|
-
override async execute(): Promise<number> {
|
|
422
|
-
this.context.stderr.write('WARN sk hq cards is now sk hq threads, the old name goes at the next release\n')
|
|
423
|
-
return await super.execute()
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
417
|
/** on or off from the console, null with no word; a word of another kind is said and refused */
|
|
428
418
|
const onOff = (v: string | undefined, err: (l: string) => void): boolean | null | undefined => {
|
|
429
419
|
if (v === undefined) return null
|
|
@@ -504,13 +494,6 @@ export class HqUrlsCommand extends Command {
|
|
|
504
494
|
}
|
|
505
495
|
}
|
|
506
496
|
|
|
507
|
-
/** `sk hq urls` under the name it had before: agents and scripts still call it, so it runs as is and says nothing more.
|
|
508
|
-
* No usage: in no help and no list */
|
|
509
|
-
export class HqDoorCommand extends HqUrlsCommand {
|
|
510
|
-
static override paths = [['hq', 'door']]
|
|
511
|
-
static override usage = undefined
|
|
512
|
-
}
|
|
513
|
-
|
|
514
497
|
export class HqTerminalsCommand extends Command {
|
|
515
498
|
static override paths = [['hq', 'terminals']]
|
|
516
499
|
|
package/src/cli/cmd_Releases.ts
CHANGED
|
@@ -60,8 +60,6 @@ export class ReleasesAddCommand extends Command {
|
|
|
60
60
|
category = Option.String({ required: false })
|
|
61
61
|
title = Option.String({ required: false })
|
|
62
62
|
thread = Option.String('--thread', { description: 'the thread it comes from: its changelog line and media' })
|
|
63
|
-
/** its name before, read for one release */
|
|
64
|
-
card = Option.String('--card', { hidden: true })
|
|
65
63
|
// the flags that wrote next.md by hand, hidden for one release: each says to edit the file
|
|
66
64
|
text = Option.String('--text', { hidden: true })
|
|
67
65
|
bullet = Option.Array('--bullet', { hidden: true })
|
|
@@ -74,8 +72,7 @@ export class ReleasesAddCommand extends Command {
|
|
|
74
72
|
weight = Option.String('--weight', { hidden: true })
|
|
75
73
|
|
|
76
74
|
async execute(): Promise<number> {
|
|
77
|
-
|
|
78
|
-
const thread = this.thread ?? this.card
|
|
75
|
+
const thread = this.thread
|
|
79
76
|
const given: [string, unknown][] = [['--text', this.text], ['--bullet', this.bullet], ['--image', this.image], ['--before', this.before], ['--rating', this.rating], ['--commit', this.commit], ['--kind', this.kind], ['--release-title', this.heading], ['--weight', this.weight]]
|
|
80
77
|
const flag = given.find(([, v]) => v !== undefined)?.[0]
|
|
81
78
|
if (flag !== undefined || thread === undefined) {
|
|
@@ -100,6 +97,62 @@ export class ReleasesAddCommand extends Command {
|
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
|
|
100
|
+
export class ReleasesCheckCommand extends Command {
|
|
101
|
+
static override paths = [['releases', 'check']]
|
|
102
|
+
static essential = {}
|
|
103
|
+
|
|
104
|
+
static override usage = Command.Usage({
|
|
105
|
+
category: 'Gate',
|
|
106
|
+
description: 'every problem of releases/next.md at once, each its line and the line it wants, as sk bump reads it',
|
|
107
|
+
details:
|
|
108
|
+
"reads next.md as `sk bump` does before anything else, and names every problem in one run: the file missing (a template printed), not committed, a line out of its shape (the heading, a note of the front matter, a weight word, a picture), no kind said by the heading or given, no change, a word left of the template. Each problem says its line, what it read and the exact line it wants. The disk and one git status, no network. Exits 1 on any problem. --write-template writes the template when there is no next.md, for a hand to fill and commit",
|
|
109
|
+
examples: [
|
|
110
|
+
['what a patch bump would refuse in next.md', 'sk releases check patch'],
|
|
111
|
+
['the kind its heading says', 'sk releases check'],
|
|
112
|
+
['no next.md yet: the template to fill', 'sk releases check patch --write-template'],
|
|
113
|
+
],
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
kind = Option.String({ required: false, name: 'major|minor|patch' })
|
|
117
|
+
writeTemplate = Option.Boolean('--write-template', false, { description: 'write the template as next.md when there is none' })
|
|
118
|
+
|
|
119
|
+
async execute(): Promise<number> {
|
|
120
|
+
const root = process.cwd()
|
|
121
|
+
const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
|
|
122
|
+
try {
|
|
123
|
+
if (this.kind !== undefined && !['major', 'minor', 'patch'].includes(this.kind)) throw new Error(`${this.kind}: a kind is major, minor or patch`)
|
|
124
|
+
const kind = (this.kind ?? null) as 'major' | 'minor' | 'patch' | null
|
|
125
|
+
const { undeclaredReleases } = await import('../releases/store.ts')
|
|
126
|
+
const why = await undeclaredReleases(root)
|
|
127
|
+
if (why) throw new Error(why)
|
|
128
|
+
const { NEXT_REL, nextTemplate, problemLines, validateNext } = await import('../releases/validate.ts')
|
|
129
|
+
if (this.writeTemplate) {
|
|
130
|
+
const { existsSync, mkdirSync, writeFileSync } = await import('node:fs')
|
|
131
|
+
const { dirname, join } = await import('node:path')
|
|
132
|
+
const file = join(root, NEXT_REL)
|
|
133
|
+
if (existsSync(file)) throw new Error(`${NEXT_REL} exists already: edit it, the template goes only where there is none`)
|
|
134
|
+
mkdirSync(dirname(file), { recursive: true })
|
|
135
|
+
writeFileSync(file, nextTemplate(kind))
|
|
136
|
+
out(`ok: ${NEXT_REL} written from the template: replace each <…> with the release's own words, then commit it`)
|
|
137
|
+
}
|
|
138
|
+
const problems = validateNext(root, kind)
|
|
139
|
+
if (problems.length === 0) {
|
|
140
|
+
const { readRelease } = await import('../releases/store.ts')
|
|
141
|
+
const { changesOf, NEXT } = await import('../releases/model.ts')
|
|
142
|
+
const r = readRelease(root, NEXT)!
|
|
143
|
+
out(`ok: ${NEXT_REL} reads: ${changesOf(r).length} change${changesOf(r).length === 1 ? '' : 's'}, a ${kind ?? r.kind} release`)
|
|
144
|
+
return 0
|
|
145
|
+
}
|
|
146
|
+
for (const l of problemLines(problems)) out(l)
|
|
147
|
+
out(` ${problems.length === 1 ? 'one problem' : `${problems.length} problems`}: edit ${NEXT_REL} at each line named, then sk releases check${kind ? ` ${kind}` : ''} again`)
|
|
148
|
+
return 1
|
|
149
|
+
} catch (e) {
|
|
150
|
+
this.context.stderr.write(`FAIL: ${e instanceof Error ? e.message : String(e)}\n`)
|
|
151
|
+
return 1
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
103
156
|
export class ReleasesRemoveCommand extends Command {
|
|
104
157
|
static override paths = [['releases', 'remove']]
|
|
105
158
|
|