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
|
@@ -20,8 +20,16 @@
|
|
|
20
20
|
.rv-still.cover img{object-fit:cover}
|
|
21
21
|
.rv-stillopen{position:absolute;right:var(--s2);bottom:var(--s2);padding:2px var(--s2);border-radius:6px;font-size:12px;font-weight:600;color:var(--bg);background:color-mix(in srgb,var(--ink) 70%,transparent);pointer-events:none}
|
|
22
22
|
.rv-still:hover .rv-stillopen{background:var(--accent)}
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/* a live page's tile (live-view.tsx LiveTile): its shot in a border of its own colour, IFRAME on it, its ways to open
|
|
24
|
+
it in a column down its right side */
|
|
25
|
+
.rv-livetile{position:relative;display:flex;aspect-ratio:16/10;border:2px solid var(--iframe);border-radius:8px;overflow:hidden;background:var(--panel2)}
|
|
26
|
+
.rv-view.s-tile .rv-viewmedia > .rv-livetile,.rv-view.s-thumb .rv-viewmedia > .rv-livetile{position:absolute;inset:0;aspect-ratio:auto}
|
|
27
|
+
.rv-livetile > .rv-still{flex:1;min-width:0;height:100%}
|
|
28
|
+
.rv-iframetag{position:absolute;left:var(--s2);top:var(--s2);padding:var(--s0) var(--s2);border-radius:4px;font:700 11px/16px ui-monospace,Menlo,monospace;letter-spacing:.08em;color:var(--bg);background:var(--iframe);pointer-events:none}
|
|
29
|
+
.rv-iframerail{flex:none;display:flex;flex-direction:column;gap:var(--s1);padding:var(--s1);overflow:hidden;border-left:2px solid var(--iframe);background:color-mix(in srgb,var(--iframe) 14%,var(--panel))}
|
|
30
|
+
.rv-iframerail > :is(a,button){display:grid;place-items:center;flex:none;width:28px;height:28px;padding:0;border:1px solid color-mix(in srgb,var(--iframe) 45%,transparent);border-radius:6px;color:var(--iframe);background:var(--panel);cursor:pointer}
|
|
31
|
+
.rv-iframerail > :is(a,button):hover,.rv-iframerail > :is(a,button):focus-visible{color:var(--bg);background:var(--iframe)}
|
|
32
|
+
.rv-view.f-live .rv-viewtools{right:44px}
|
|
25
33
|
.rv-stillplay{position:absolute;left:50%;top:50%;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;transform:translate(-50%,-50%);font-size:17px;color:var(--bg);background:color-mix(in srgb,var(--ink) 60%,transparent);pointer-events:none}
|
|
26
34
|
|
|
27
35
|
/* a pair: its after; the pointer on it cross fades to its before (PEEK_MS), a tap toggles it on touch */
|
|
@@ -64,8 +72,10 @@
|
|
|
64
72
|
/* a gallery: equal tiles filling the row, --gmin the least width (its size control) */
|
|
65
73
|
.rv-gtiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--gmin,208px)),1fr));gap:var(--s3) var(--s2)}
|
|
66
74
|
.rv-gallerywrap.large .rv-gtiles{gap:var(--s2) var(--s1)}
|
|
75
|
+
/* a tile's picture: its size is its width and its ratio alone, so each is its own layout root, and one out of view is
|
|
76
|
+
not laid out at all */
|
|
67
77
|
.rv-gtile{display:flex;flex-direction:column;gap:var(--s1);min-width:0;padding:0;border:0;background:none;color:inherit;text-align:left;cursor:zoom-in}
|
|
68
|
-
.rv-gtileimg{position:relative;display:block;aspect-ratio:16/10;border-radius:8px;overflow:hidden;background:repeating-conic-gradient(var(--chk1) 0 25%,var(--chk2) 0 50%) 0 0/12px 12px;box-shadow:0 0 0 1px var(--line);transition:box-shadow .12s}
|
|
78
|
+
.rv-gtileimg{position:relative;display:block;aspect-ratio:16/10;border-radius:8px;overflow:hidden;background:repeating-conic-gradient(var(--chk1) 0 25%,var(--chk2) 0 50%) 0 0/12px 12px;box-shadow:0 0 0 1px var(--line);transition:box-shadow .12s;contain:strict;content-visibility:auto}
|
|
69
79
|
.rv-gtileimg img{display:block;width:100%;height:100%;object-fit:contain}
|
|
70
80
|
.rv-gtile:hover .rv-gtileimg,.rv-gtile:focus-visible .rv-gtileimg{box-shadow:0 0 0 2px var(--accent)}
|
|
71
81
|
.rv-gtile[class*=' re-'] .rv-gtileimg{box-shadow:0 0 0 2px var(--tone)}
|
|
@@ -75,6 +75,7 @@ export const WikisView = observer(({ app, id, label }: { app: RepoSt; id: string
|
|
|
75
75
|
const WikiBody = observer(({ app, w, href, title }: { app: RepoSt; w: WikiSt; href: string; title: string }) => {
|
|
76
76
|
const el = useRef<HTMLDivElement | null>(null)
|
|
77
77
|
const frame = useRef<HTMLIFrameElement | null>(null)
|
|
78
|
+
const [loaded, setLoaded] = useState(false)
|
|
78
79
|
const theme = app.home.theme.scheme
|
|
79
80
|
// the theme the graph first paints in rides its url; a later change is a message, never a reload
|
|
80
81
|
const first = useRef(theme)
|
|
@@ -90,10 +91,12 @@ const WikiBody = observer(({ app, w, href, title }: { app: RepoSt; w: WikiSt; hr
|
|
|
90
91
|
const below = w.place === 'bottom'
|
|
91
92
|
const graph = (
|
|
92
93
|
<Panel key="graph" id="wiki-graph" minSize={below ? 160 : 280} style={PANEL}>
|
|
93
|
-
{/* the spinner sits under the frame
|
|
94
|
-
|
|
94
|
+
{/* the spinner sits under the frame until the graph page loaded, never longer: covered, it would still turn (a frame
|
|
95
|
+
of the compositor each refresh) for as long as the page stays open */}
|
|
96
|
+
<div className="gvframe">{loaded ? null : <span className="gvwait"><span className="spin" />reading the wiki…</span>}
|
|
95
97
|
<iframe ref={(f) => { frame.current = f; w.setFrame(f?.contentWindow ?? null) }} src={`${app.url(href)}${sep}theme=${first.current}`} title={title}
|
|
96
98
|
onLoad={() => {
|
|
99
|
+
setLoaded(true)
|
|
97
100
|
w.setFrame(frame.current?.contentWindow ?? null)
|
|
98
101
|
w.send({ type: 'wiki-graph:theme', theme: app.home.theme.scheme })
|
|
99
102
|
if (w.page != null) w.send({ type: 'wiki-graph:focus', id: w.page.id })
|
package/src/serve/hub-runtime.ts
CHANGED
|
@@ -26,10 +26,10 @@ import { pingTick } from '../collections/pings.ts'
|
|
|
26
26
|
import { baseWikiRoot, configStamp, graphMounts, hubCollections } from './hub-collections.ts'
|
|
27
27
|
import type { ReadThread } from './read-thread.ts'
|
|
28
28
|
import { loadRepoConfig, type RepoConfig } from '../repo-config.ts'
|
|
29
|
-
import { allTasks
|
|
29
|
+
import { allTasks } from '../gate/gate-checks.ts'
|
|
30
30
|
import { runCheck, type CheckEvent } from '../gate/run-check.ts'
|
|
31
31
|
import { runCi, type CiOpts } from '../gate/run-ci.ts'
|
|
32
|
-
import { readInvocations, readLive,
|
|
32
|
+
import { readInvocations, readLive, readRunsSince, runsPath, sweepLive } from '../ledger/run-log.ts'
|
|
33
33
|
import { LIVE_HISTORY_MS, shapeLive, type LiveView } from '../ledger/live-timeline.ts'
|
|
34
34
|
import { parallelCap } from '../core/parallel.ts'
|
|
35
35
|
import { autoGatePool, takeSlot } from '../core/slots.ts'
|
|
@@ -41,12 +41,8 @@ import { OtherRepos } from './other-repos.ts'
|
|
|
41
41
|
import { HouseRuns } from './house-runs.ts'
|
|
42
42
|
import { runsPushStamp } from './runs-stamp.ts'
|
|
43
43
|
import { recordStamp } from '../house/project-gutter.ts'
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import { shapeTestCheck, shapeTestsRoot } from '../collections/test-time.ts'
|
|
47
|
-
import type { NeedItem, TestFacts } from '../collections/collection-types.ts'
|
|
48
|
-
import { declaredSlowFiles } from '../suite/test-units.ts'
|
|
49
|
-
import { BUILD_TIMEOUT_MS, CHECK_TIMEOUT_MS } from '../collections/checks.ts'
|
|
44
|
+
import { recordTests, recordTimeline } from './record-pages.ts'
|
|
45
|
+
import type { NeedItem } from '../collections/collection-types.ts'
|
|
50
46
|
import { watchTracked } from './tracked-watch.ts'
|
|
51
47
|
import { repoSource } from '../plan/repo-source.ts'
|
|
52
48
|
import type { PlanSource, Planner } from '../plan/planner.ts'
|
|
@@ -323,35 +319,9 @@ export async function resolveHubDeps(root: string, boot: RepoConfig, io: ServeIo
|
|
|
323
319
|
// house repo, built on the first ask (a hub the daemon loads is never
|
|
324
320
|
// asked, the daemon answers for the house)
|
|
325
321
|
house: () => (house ??= houseOf(root, c.name)).view(),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const inventory = await gateInventory(root, c)
|
|
330
|
-
for (const row of inventory) {
|
|
331
|
-
ceilings[row.decl.id] = row.timeoutMs ?? (row.build ? BUILD_TIMEOUT_MS : CHECK_TIMEOUT_MS)
|
|
332
|
-
budgets[row.decl.id] = row.budgetMs
|
|
333
|
-
}
|
|
334
|
-
await warmRuns(record)
|
|
335
|
-
await warmSuites(record)
|
|
336
|
-
return shapeTimeline({
|
|
337
|
-
runs: readRuns(record),
|
|
338
|
-
invocations: readInvocations(record),
|
|
339
|
-
suites: readSuites(record),
|
|
340
|
-
ceilings,
|
|
341
|
-
budgets,
|
|
342
|
-
inventory: inventory.map((row) => row.decl.id),
|
|
343
|
-
declaredSlow: declaredSlowFiles(c),
|
|
344
|
-
cap: parallelCap(),
|
|
345
|
-
})
|
|
346
|
-
},
|
|
347
|
-
tests: async (check) => {
|
|
348
|
-
// the SAME test files the tree lists, from the same provider
|
|
349
|
-
const col = allCollections().find((x) => x.id === 'tests')
|
|
350
|
-
const facts = col == null ? [] : (await col.list()).flatMap((i): TestFacts[] => (i.test == null ? [] : [i.test]))
|
|
351
|
-
await warmRuns(record)
|
|
352
|
-
const input = { facts, runs: readRuns(record), suiteRuns: readSuiteRuns(record) }
|
|
353
|
-
return check == null || check === '' ? shapeTestsRoot(input) : shapeTestCheck(check, input)
|
|
354
|
-
},
|
|
322
|
+
// the whole record read in the read thread, which holds it for the rows already (record-pages.ts)
|
|
323
|
+
timeline: () => (readThread == null ? recordTimeline(root, c, record) : readThread.timeline(root)),
|
|
324
|
+
tests: (check) => (readThread == null ? recordTests(allCollections(), record, check) : readThread.tests(root, check)),
|
|
355
325
|
needs: () => projectNeeds(allCollections(), hubProblems.collector),
|
|
356
326
|
hubProblems,
|
|
357
327
|
// a job outlives this image, so only an in process run holds a reload back
|
|
@@ -32,7 +32,7 @@ import { storeDir, warmStore } from '../review/store.ts'
|
|
|
32
32
|
import { writeArchived } from '../core/archived.ts'
|
|
33
33
|
import { machinePath } from '../core/machine-layout.ts'
|
|
34
34
|
import { identitiesDir, pictureVersion } from '../identities/identities.ts'
|
|
35
|
-
import { identityCache, markFile, railOf, speakerIdOf, type RailIdentity } from '../identities/machine.ts'
|
|
35
|
+
import { identityCache, markFile, markPng, railOf, speakerIdOf, type RailIdentity } from '../identities/machine.ts'
|
|
36
36
|
import { speaksAsOfText } from '../social/house.ts'
|
|
37
37
|
import { isStoreRefused } from '../core/machine-db.ts'
|
|
38
38
|
import { atomicWrite } from '../core/atomic-write.ts'
|
|
@@ -523,7 +523,11 @@ export function projectGutter(d: GutterDeps) {
|
|
|
523
523
|
if (file == null || !existsSync(file)) return new Response(`no mark for the identity ${JSON.stringify(id)}`, { status: 404 })
|
|
524
524
|
// the url names the file's version (markUrl): kept for good while it is the current one, else asked again
|
|
525
525
|
const v = new URL(req.url).searchParams.get('v')
|
|
526
|
-
|
|
526
|
+
const now = pictureVersion(file)
|
|
527
|
+
const cache = { 'cache-control': v != null && v !== '' && v === now ? 'public, max-age=31536000, immutable' : 'no-cache' }
|
|
528
|
+
// the mark at the size the hub draws it (markPng), the file itself only when it does not decode
|
|
529
|
+
const png = await markPng(file, now)
|
|
530
|
+
return png == null ? new Response(Bun.file(file), { headers: cache }) : new Response(png, { headers: { ...cache, 'content-type': 'image/png' } })
|
|
527
531
|
}
|
|
528
532
|
if (path.startsWith('/api/projects/app-icon/')) {
|
|
529
533
|
if (repos.length === 0) await answer()
|
package/src/serve/read-thread.ts
CHANGED
|
@@ -7,8 +7,16 @@
|
|
|
7
7
|
// new one; the warm cell and the parties' few seconds keep their last answer meanwhile
|
|
8
8
|
import type { StoreParties } from '../review/store-parties.ts'
|
|
9
9
|
import type { RowsAnswer } from './hub-collections.ts'
|
|
10
|
+
import type { Timeline } from '../ledger/run-timeline.ts'
|
|
11
|
+
import type { TestCheckView, TestsRootView } from '../collections/test-time.ts'
|
|
10
12
|
|
|
11
|
-
export type ReadAsk = { id: number } & (
|
|
13
|
+
export type ReadAsk = { id: number } & (
|
|
14
|
+
| { kind: 'rows'; root: string; reset: boolean }
|
|
15
|
+
| { kind: 'timeline'; root: string }
|
|
16
|
+
| { kind: 'tests'; root: string; check: string | null }
|
|
17
|
+
| { kind: 'parties'; dir: string }
|
|
18
|
+
| { kind: 'snapshot'; file: string }
|
|
19
|
+
)
|
|
12
20
|
export type ReadReply = { id: number; answer: unknown } | { id: number; error: string }
|
|
13
21
|
|
|
14
22
|
const ENTRY = new URL('./read-worker.ts', import.meta.url).href
|
|
@@ -17,7 +25,7 @@ const ENTRY = new URL('./read-worker.ts', import.meta.url).href
|
|
|
17
25
|
type Ask = ReadAsk extends infer A ? (A extends { id: number } ? Omit<A, 'id'> : never) : never
|
|
18
26
|
|
|
19
27
|
/** one worker thread that answers numbered asks (`{ id, answer }` or `{ id, error }`), started at the first ask and
|
|
20
|
-
* again at the next one once it died: the read thread here
|
|
28
|
+
* again at the next one once it died: the read thread here */
|
|
21
29
|
export class WorkerThread<A extends object> {
|
|
22
30
|
private w: Worker | null = null
|
|
23
31
|
private next = 0
|
|
@@ -82,6 +90,16 @@ export class ReadThread extends WorkerThread<Ask> {
|
|
|
82
90
|
return this.ask({ kind: 'rows', root, reset })
|
|
83
91
|
}
|
|
84
92
|
|
|
93
|
+
/** the timeline page of the repo at `root`, from its whole run record (record-pages.ts) */
|
|
94
|
+
timeline(root: string): Promise<Timeline> {
|
|
95
|
+
return this.ask({ kind: 'timeline', root })
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** the tests page of the repo at `root`, of one check or of them all */
|
|
99
|
+
tests(root: string, check: string | null): Promise<TestsRootView | TestCheckView> {
|
|
100
|
+
return this.ask({ kind: 'tests', root, check })
|
|
101
|
+
}
|
|
102
|
+
|
|
85
103
|
/** the parties of the store at `dir` */
|
|
86
104
|
parties(dir: string): Promise<StoreParties> {
|
|
87
105
|
return this.ask({ kind: 'parties', dir })
|
package/src/serve/read-worker.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// the daemon's read thread (read-thread.ts): every repo's rows
|
|
1
|
+
// the daemon's read thread (read-thread.ts): every repo's rows, its two pages of the whole run record and every
|
|
2
|
+
// store's parties read here, off the loop every
|
|
2
3
|
// page waits on. Each repo keeps its config, kit and comfy mark between two computes of its rows, read again when its
|
|
3
4
|
// config file moves, and from scratch when its hub loads again (`reset`).
|
|
4
5
|
import { existsSync } from 'fs'
|
|
@@ -10,6 +11,8 @@ import { computeRows, configStamp, graphMounts, hubCollections } from './hub-col
|
|
|
10
11
|
import { hubParties } from '../orchestrator/places.ts'
|
|
11
12
|
import { installOneLib } from '../core/one-lib.ts'
|
|
12
13
|
import { keepTranscriptListing } from '../agent-time/store.ts'
|
|
14
|
+
import { recordTests, recordTimeline } from './record-pages.ts'
|
|
15
|
+
import { runsPath } from '../ledger/run-log.ts'
|
|
13
16
|
import type { ReadAsk, ReadReply } from './read-thread.ts'
|
|
14
17
|
|
|
15
18
|
declare const self: Worker
|
|
@@ -53,6 +56,11 @@ async function answer(a: ReadAsk): Promise<ReadReply> {
|
|
|
53
56
|
await Bun.write(a.file, Bun.generateHeapSnapshot('v8', 'arraybuffer'), { createPath: true })
|
|
54
57
|
return { id: a.id, answer: process.memoryUsage().heapUsed }
|
|
55
58
|
}
|
|
59
|
+
if (a.kind === 'timeline') return { id: a.id, answer: await recordTimeline(a.root, (await repoAt(a.root, false)).c, runsPath(a.root)) }
|
|
60
|
+
if (a.kind === 'tests') {
|
|
61
|
+
const t = await repoAt(a.root, false)
|
|
62
|
+
return { id: a.id, answer: await recordTests(hubCollections(a.root, t.c, t.kit, graphMounts(a.root, t.c), t.comfy), runsPath(a.root), a.check) }
|
|
63
|
+
}
|
|
56
64
|
const r = await repoAt(a.root, a.reset)
|
|
57
65
|
return { id: a.id, answer: await computeRows(hubCollections(a.root, r.c, r.kit, graphMounts(a.root, r.c), r.comfy)) }
|
|
58
66
|
} catch (e) {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// the two pages shaped from a repo's run record: the timeline and the tests. Each reads the recent runs and suite rows
|
|
2
|
+
// of every check and test file, which record-kept.ts holds in memory for the thread that read them, bounded per key.
|
|
3
|
+
// The daemon asks both of its read thread (read-worker.ts), which holds that record for the rows already, so its loop's
|
|
4
|
+
// thread never holds a second copy; a hub serving alone computes them in process, through the same functions
|
|
5
|
+
import type { RepoConfig } from '../repo-config.ts'
|
|
6
|
+
import type { Collection, TestFacts } from '../collections/collection-types.ts'
|
|
7
|
+
import { gateInventory } from '../gate/gate-checks.ts'
|
|
8
|
+
import { readInvocations, readRuns, warmRuns } from '../ledger/run-log.ts'
|
|
9
|
+
import { readSuiteRuns, readSuites, warmSuites } from '../ledger/suite-log.ts'
|
|
10
|
+
import { shapeTimeline, type Timeline } from '../ledger/run-timeline.ts'
|
|
11
|
+
import { shapeTestCheck, shapeTestsRoot, type TestCheckView, type TestsRootView } from '../collections/test-time.ts'
|
|
12
|
+
import { declaredSlowFiles } from '../suite/test-units.ts'
|
|
13
|
+
import { parallelCap } from '../core/parallel.ts'
|
|
14
|
+
import { BUILD_TIMEOUT_MS, CHECK_TIMEOUT_MS } from '../collections/checks.ts'
|
|
15
|
+
|
|
16
|
+
/** every run on record, shaped for the timeline page */
|
|
17
|
+
export async function recordTimeline(root: string, c: RepoConfig, record: string): Promise<Timeline> {
|
|
18
|
+
const ceilings: Record<string, number> = {}
|
|
19
|
+
const budgets: Record<string, number> = {}
|
|
20
|
+
const inventory = await gateInventory(root, c)
|
|
21
|
+
for (const row of inventory) {
|
|
22
|
+
ceilings[row.decl.id] = row.timeoutMs ?? (row.build ? BUILD_TIMEOUT_MS : CHECK_TIMEOUT_MS)
|
|
23
|
+
budgets[row.decl.id] = row.budgetMs
|
|
24
|
+
}
|
|
25
|
+
await warmRuns(record)
|
|
26
|
+
await warmSuites(record)
|
|
27
|
+
return shapeTimeline({
|
|
28
|
+
runs: readRuns(record),
|
|
29
|
+
invocations: readInvocations(record),
|
|
30
|
+
suites: readSuites(record),
|
|
31
|
+
ceilings,
|
|
32
|
+
budgets,
|
|
33
|
+
inventory: inventory.map((row) => row.decl.id),
|
|
34
|
+
declaredSlow: declaredSlowFiles(c),
|
|
35
|
+
cap: parallelCap(),
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** the tests page, of one check or of them all: the SAME test files the tree lists, from the same provider */
|
|
40
|
+
export async function recordTests(collections: Collection[], record: string, check: string | null): Promise<TestsRootView | TestCheckView> {
|
|
41
|
+
const col = collections.find((x) => x.id === 'tests')
|
|
42
|
+
const facts = col == null ? [] : (await col.list()).flatMap((i): TestFacts[] => (i.test == null ? [] : [i.test]))
|
|
43
|
+
await warmRuns(record)
|
|
44
|
+
const input = { facts, runs: readRuns(record), suiteRuns: readSuiteRuns(record) }
|
|
45
|
+
return check == null || check === '' ? shapeTestsRoot(input) : shapeTestCheck(check, input)
|
|
46
|
+
}
|
package/src/serve/serve-hub.ts
CHANGED
|
@@ -380,12 +380,12 @@ export function hubHandler(d: HubDeps, o: { base?: string; projects?: Gutter } =
|
|
|
380
380
|
}
|
|
381
381
|
if (path.startsWith('/api/act/') && req.method === 'POST') {
|
|
382
382
|
// act-in-place verbs: an ask's act lands in its thread, an asset note in its file; errors surface as
|
|
383
|
-
// 400 text the card shows verbatim. An ask is named by its id (`ask`)
|
|
383
|
+
// 400 text the card shows verbatim. An ask is named by its id (`ask`).
|
|
384
384
|
// A secret value has no verb here: it goes to its thread's secret route alone (review/secret-route.ts)
|
|
385
385
|
// a parse error quotes the body, which can carry a pasted secret
|
|
386
386
|
const b = (await req.json().catch(() => null)) as Record<string, string> | null
|
|
387
387
|
if (b == null || typeof b !== 'object') return new Response('the body is not a json object', { status: 400 })
|
|
388
|
-
const ask = b.ask ??
|
|
388
|
+
const ask = b.ask ?? ''
|
|
389
389
|
try {
|
|
390
390
|
if (path === '/api/act/ask-done') askDone(d.root, ask)
|
|
391
391
|
else if (path === '/api/act/ask-decline') askDecline(d.root, ask, typeof b.why === 'string' ? b.why : undefined)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'
|
|
13
13
|
import { dirname, join } from 'path'
|
|
14
14
|
import { homeDir } from '../home/home-paths.ts'
|
|
15
|
-
import { AGENT_ENV } from '../
|
|
15
|
+
import { AGENT_ENV } from '../core/agent-env.ts'
|
|
16
16
|
import { KEPT_ID, type KeptTerminal, type TerminalRecord } from './terminal-record.ts'
|
|
17
17
|
|
|
18
18
|
/** one terminal as tmux has it */
|
|
@@ -378,13 +378,11 @@ export function terminalRoutes(d: TerminalDeps) {
|
|
|
378
378
|
const why = hop ? terminalHopRefusal(req, d.hop) : terminalRefusal(req, srv.requestIP(req)?.address ?? null)
|
|
379
379
|
if (why != null) return new Response(why, { status: 403, headers: NO_STORE })
|
|
380
380
|
const scope = hop ? d.name : null
|
|
381
|
-
const b = (await req.json().catch(() => null)) as { page?: unknown; key?: unknown; id?: unknown; cols?: unknown; rows?: unknown; lines?: unknown;
|
|
381
|
+
const b = (await req.json().catch(() => null)) as { page?: unknown; key?: unknown; id?: unknown; cols?: unknown; rows?: unknown; lines?: unknown; act?: unknown; window?: unknown; name?: unknown; account?: unknown; type?: unknown; data?: unknown } | null
|
|
382
382
|
if (b == null || typeof b !== 'object') return new Response('the body is no json object', { status: 400, headers: NO_STORE })
|
|
383
383
|
if (path === '/api/terminal/close') return closePart(b, scope)
|
|
384
384
|
if (path === '/api/terminal/watch') return watch(b, scope)
|
|
385
385
|
if (path === '/api/terminal/open') {
|
|
386
|
-
// a session of another server is never attached by its name: every terminal the hub shows is the host's
|
|
387
|
-
if (b.attach != null) return new Response('a session is no longer shown by its name: the orchestrator is a terminal of the project, in the main panel', { status: 404, headers: NO_STORE })
|
|
388
386
|
return open(b, scope, size(b.cols, 2, 500, 80), size(b.rows, 2, 200, 24), typeof b.window === 'string' && /^@\d+$/.test(b.window) ? b.window : null)
|
|
389
387
|
}
|
|
390
388
|
// a part of a hop is acted on by that hop alone, a part of a page of this machine by such a page alone
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
// problems pane until the next save, never a green.
|
|
5
5
|
import { statSync } from 'fs'
|
|
6
6
|
import { join } from 'path'
|
|
7
|
-
import { GENERATED_IGNORE_LINES } from '../rules/untrack-generated.ts'
|
|
8
7
|
import { gitBin } from '../core/git-bin.ts'
|
|
9
8
|
import { LAYOUT } from '../core/layout.ts'
|
|
10
9
|
import { followTree, treeMoved } from '../core/tree-rev.ts'
|
|
@@ -12,11 +11,10 @@ import { yieldLoop } from '../core/loop-watch.ts'
|
|
|
12
11
|
import { watchTree } from '../core/tree-watch.ts'
|
|
13
12
|
|
|
14
13
|
/** every path a run of the gate or the hub itself writes, whatever the repo
|
|
15
|
-
* ignores: the
|
|
14
|
+
* ignores: the per run logs under the scratch dir, an atomic write's
|
|
16
15
|
* temp file, the comfy state the hub writes at boot. A save there is the
|
|
17
16
|
* machine's own, and triggering on it would schedule the next run forever */
|
|
18
17
|
export const GATE_WRITES: readonly string[] = [
|
|
19
|
-
...GENERATED_IGNORE_LINES.filter((l) => !l.startsWith('#')),
|
|
20
18
|
`${LAYOUT.tmp}/`,
|
|
21
19
|
'.*.tmp-*',
|
|
22
20
|
'.comfy-ts/',
|
package/src/setup-house.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { CONTEXT_FILE, CONTEXT_INCLUDE } from './context/context-view.ts'
|
|
|
13
13
|
import { LIB_VERSION } from './core/lib-version.ts'
|
|
14
14
|
import { consumerOf } from './core/machine-link.ts'
|
|
15
15
|
import { runner, type Run } from './git-bootstrap.ts'
|
|
16
|
-
import { installedHouseRoot,
|
|
16
|
+
import { installedHouseRoot, plistPath } from './home/home-launchd.ts'
|
|
17
17
|
import { daemonUp, homeUp, pmUp } from './home/home-paths.ts'
|
|
18
18
|
import { includeTargets } from './house/project-gutter.ts'
|
|
19
19
|
import { initRepo } from './init-repo.ts'
|
|
@@ -116,7 +116,7 @@ export async function refusals(o: { repo: string; house: string; home: string; s
|
|
|
116
116
|
const runs = installedHouseRoot(plistPath(o.home))
|
|
117
117
|
const ours = runs != null && real(runs) === real(o.house)
|
|
118
118
|
if (!ours) {
|
|
119
|
-
const marks = [plistPath(o.home),
|
|
119
|
+
const marks = [plistPath(o.home), join(o.home, '.shipkit', 'home', 'pm.log')]
|
|
120
120
|
for (const m of marks) if (existsSync(m)) out.push(`this machine already runs a shipkit house (${m} exists): sk setup makes the first one only. Wire a repo into the house you have with \`sk start <name>\` or \`sk init\``)
|
|
121
121
|
if (!o.scratch) for (const role of await o.portsUp()) out.push(`a shipkit ${role} answers on this machine: a house already runs here, so sk setup stops. To rehearse beside it, give the run a scratch home (--home) and its own ports (SHIPKIT_PM_PORT, SHIPKIT_DAEMON_PORT, SHIPKIT_HOME_PORT)`)
|
|
122
122
|
}
|
package/src/shipkit-files.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// trailer({...}) what `sk trailer` cannot read from a file: the
|
|
10
10
|
// sounds the repo resolves by id (trailer/adapter.ts)
|
|
11
11
|
// review({...}) the repo's parts of the review store: its subject
|
|
12
|
-
// kinds, topics, sources, auto rules,
|
|
12
|
+
// kinds, topics, sources, auto rules, its verbs
|
|
13
13
|
// (review/unit.ts)
|
|
14
14
|
// social({...}) the repo's parts of the social desks: its topics,
|
|
15
15
|
// its articles and their preview (social/unit.ts)
|
package/src/shipkit.ts
CHANGED
|
@@ -28,8 +28,6 @@ export { deriveRemote, dirtyPaths, remoteTags, strandedTags, tagExistsLocally }
|
|
|
28
28
|
export { collectReports, renderReports, attentionLines } from './release/run-releases.ts'
|
|
29
29
|
export { extractChangelogSection, promoteUnreleased, hasUnreleasedNotes, hasVersionSection } from './release/changelog.ts'
|
|
30
30
|
export type { UnitReport } from './release/run-releases.ts'
|
|
31
|
-
export { discoverLegacyChecks } from './gate/discover-legacy-checks.ts'
|
|
32
|
-
export type { LegacyCheck } from './gate/discover-legacy-checks.ts'
|
|
33
31
|
// THE runner: one DAG over every check, whatever declared it
|
|
34
32
|
export { runChecks, selectChecks } from './gate/check-runner.ts'
|
|
35
33
|
export type { RunnableCheck, CheckResult, CheckEvent, RunChecksOpts, RunChecksSummary } from './gate/check-runner.ts'
|
|
@@ -44,10 +42,7 @@ export { writeStatus } from './core/write-status.ts'
|
|
|
44
42
|
export type { StatusInput, StatusOutcome } from './core/write-status.ts'
|
|
45
43
|
export { formatLine, parseDuration, fmtStamp, parseWireOutput } from './core/wire.ts'
|
|
46
44
|
export type { Line } from './core/wire.ts'
|
|
47
|
-
|
|
48
|
-
// consumers (e.g. a wiki lint verifying mentioned ids exist) read RULES
|
|
49
|
-
export { tagRuleLines } from './rules/rule.ts'
|
|
50
|
-
export type { Rule, RuleEnv, FixResult } from './rules/rule.ts'
|
|
45
|
+
export type { FixResult } from './check.ts'
|
|
51
46
|
export { evaluateContracts, pngDims } from './contracts/contracts-engine.ts'
|
|
52
47
|
export type { ContractsConfig, ContractsResult, ContractOutcome } from './contracts/contracts-engine.ts'
|
|
53
48
|
export { defineContract, validateManifest, file, png, glob, md, dir, custom, script, fileContains, dirExists } from './contracts/contract-types.ts'
|
package/src/shot/client.ts
CHANGED
|
@@ -16,7 +16,8 @@ export const SHOT_PROCESS = 'shot'
|
|
|
16
16
|
* (shot-theme.ts), and with none the browser's own */
|
|
17
17
|
export type ShotInput = { url: string; out: string; viewport?: Viewport; dpr?: number; reload?: boolean; waitMs?: number; step?: string; at?: number; full?: boolean; root?: string; theme?: Theme }
|
|
18
18
|
export type ClipInput = ShotInput & { seconds: number; fps?: number; dom?: boolean }
|
|
19
|
-
|
|
19
|
+
/** `on`: the place of the house it was shot on (on-place.ts), absent when here */
|
|
20
|
+
export type ShotResult = ShotDone & { via: 'warm' | 'started' | 'local' | 'box'; on?: string }
|
|
20
21
|
|
|
21
22
|
const shotAsk = async (i: ShotInput): Promise<ShotAsk> => {
|
|
22
23
|
const { houseShotLook } = await import('./shot-theme.ts')
|
package/src/shot/film-box.ts
CHANGED
|
@@ -39,10 +39,6 @@ const DEAF_SWEEPS = 6
|
|
|
39
39
|
const DIR = join(homedir(), 'dev', 'shipkit-film')
|
|
40
40
|
const SLOTS = join(DIR, 'slots')
|
|
41
41
|
const LOG = join(DIR, 'film-box.log')
|
|
42
|
-
/** the one browser of older versions, ended once it drives no page */
|
|
43
|
-
const LEGACY_PID = join(DIR, 'browser.pid')
|
|
44
|
-
const LEGACY_USED = join(DIR, 'used')
|
|
45
|
-
const LEGACY_QUIET_MS = 2 * 60_000
|
|
46
42
|
const say = (s: string) => console.error(`box: ${s}`)
|
|
47
43
|
|
|
48
44
|
/** this script's version: a slot's browser another version started is replaced */
|
|
@@ -290,7 +286,6 @@ async function start(version: string, key: string, t: number): Promise<void> {
|
|
|
290
286
|
let b: SlotBrowser
|
|
291
287
|
let luid: string | null
|
|
292
288
|
try {
|
|
293
|
-
await endLegacy()
|
|
294
289
|
const exe = chromium(version)
|
|
295
290
|
luid = await discreteLuid(exe.full)
|
|
296
291
|
if (luid == null) say('no discrete GPU named in chrome://gpu: the browser draws on the default adapter')
|
|
@@ -313,21 +308,6 @@ async function start(version: string, key: string, t: number): Promise<void> {
|
|
|
313
308
|
console.log(`up started ${Math.round(performance.now() - t)} port ${b.port} pid ${b.pid}${luid ? ` luid ${luid}` : ''}`)
|
|
314
309
|
}
|
|
315
310
|
|
|
316
|
-
/** the one browser older versions shared between every film, ended once no film drives a page in it and none asked
|
|
317
|
-
* for it in LEGACY_QUIET_MS (a process still running older code connects between its up and its first page) */
|
|
318
|
-
async function endLegacy(): Promise<void> {
|
|
319
|
-
if (!existsSync(LEGACY_PID)) return
|
|
320
|
-
if (Date.now() - (statSync(LEGACY_USED, { throwIfNoEntry: false })?.mtimeMs ?? 0) < LEGACY_QUIET_MS) return
|
|
321
|
-
const [pid, , port] = readFileSync(LEGACY_PID, 'utf8').trim().split(' ')
|
|
322
|
-
const busy = await pages(Number(port) || CDP_PORT).then(
|
|
323
|
-
(p) => p.some((t) => t.attached),
|
|
324
|
-
() => false,
|
|
325
|
-
)
|
|
326
|
-
if (busy) return
|
|
327
|
-
await end(Number(pid), 'the shared browser of an older film-box version')
|
|
328
|
-
rmSync(LEGACY_PID, { force: true })
|
|
329
|
-
}
|
|
330
|
-
|
|
331
311
|
async function watch(key: string, pid: number, port: number): Promise<void> {
|
|
332
312
|
let orphans = new Set<string>()
|
|
333
313
|
let deaf = 0
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// sk shot --on <place>: a still or a clip shot on another place of the house, in that machine's own warm browser, the
|
|
2
|
+
// file brought back here. The place runs its own plain `sk shot` over ssh from its house checkout (core/peer-sk.ts,
|
|
3
|
+
// the reach `sk secret copy` uses), writing under its /tmp; each file comes back on ssh's stdout and leaves there.
|
|
4
|
+
// The one constraint a reader breaks first: the url is the place's own, so its localhost is that machine's, and a path
|
|
5
|
+
// of this machine is no url there
|
|
6
|
+
import { randomBytes } from 'crypto'
|
|
7
|
+
import { mkdirSync, writeFileSync } from 'fs'
|
|
8
|
+
import { dirname } from 'path'
|
|
9
|
+
import { peerSk, shq } from '../core/peer-sk.ts'
|
|
10
|
+
import { DEFAULT_FPS, DEFAULT_VIEWPORT, DEFAULT_WAIT_MS, MAX_CLIP_SECONDS, isClip, type ClipAsk, type ShotAsk } from './shot-ask.ts'
|
|
11
|
+
import type { ShotResult } from './client.ts'
|
|
12
|
+
import { assertStills, tileOut } from './still-file.ts'
|
|
13
|
+
|
|
14
|
+
/** a place as the hq last heard it: its name, its live daemon's user, tailnet name, shipkit, its global processes */
|
|
15
|
+
export type PlaceFacts = { name: string; nodes: { osUser: string; ended: number | null; seen: number; report: { at: number; body: { version: string; tailnet: { name: string | null }; processes?: { id: string; state: string }[] } } | null }[] }
|
|
16
|
+
|
|
17
|
+
/** where the shot runs: `host` is what ssh reaches, `seen` the time of its last report */
|
|
18
|
+
export type Place = { name: string; host: string; version: string; seen: number }
|
|
19
|
+
|
|
20
|
+
export type PlaceLook = { here: string; machines: readonly PlaceFacts[] | { refused: string }; sshAlias: (name: string) => boolean; now: number }
|
|
21
|
+
|
|
22
|
+
const ago = (ms: number): string => (ms < 90_000 ? `${Math.round(ms / 1000)} s` : ms < 5_400_000 ? `${Math.round(ms / 60_000)} min` : `${Math.round(ms / 3_600_000)} h`)
|
|
23
|
+
|
|
24
|
+
/** the place `name` names: 'here' for this machine, else the place or the one line that refuses it */
|
|
25
|
+
export function placeOf(name: string, l: PlaceLook): Place | 'here' | { refused: string } {
|
|
26
|
+
const same = (a: string): boolean => a.toLowerCase() === name.toLowerCase()
|
|
27
|
+
if (same(l.here)) return 'here'
|
|
28
|
+
if ('refused' in l.machines) return { refused: `FAIL shot --on ${name}: the hq does not answer (${l.machines.refused}), so no place is known: sk machines` }
|
|
29
|
+
const m = l.machines.find((x) => same(x.name))
|
|
30
|
+
if (m == null) {
|
|
31
|
+
if (l.sshAlias(name))
|
|
32
|
+
return { refused: `FAIL shot --on ${name}: ${name} is reached by ssh but is no place of the house (no shipkit daemon there reports to the hq), so no shot service runs on it. A repo whose repo.config.ts names it in browsers.box already films there with a plain sk shot` }
|
|
33
|
+
return { refused: `FAIL shot --on ${name}: no place of that name; the places the hq knows: ${l.machines.map((x) => x.name).join(', ') || 'none'} (sk machines)` }
|
|
34
|
+
}
|
|
35
|
+
const n = m.nodes.filter((x) => x.ended == null && x.report != null).sort((a, b) => b.seen - a.seen)[0]
|
|
36
|
+
if (n == null || n.report == null) return { refused: `FAIL shot --on ${m.name}: no daemon of ${m.name} reports to the hq any more: sk machines` }
|
|
37
|
+
const procs = n.report.body.processes
|
|
38
|
+
if (procs != null && !procs.some((p) => p.id === 'shot')) return { refused: `FAIL shot --on ${m.name}: pm on ${m.name} knows no shot service (shipkit ${n.report.body.version}): sk fleet update --place ${m.name}` }
|
|
39
|
+
const host = `${n.osUser}@${l.sshAlias(m.name) ? m.name : (n.report.body.tailnet.name ?? m.name)}`
|
|
40
|
+
return { name: m.name, host, version: n.report.body.version, seen: n.report.at }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** the place's own `sk shot` words for the ask, its file at `out` there; a default left out, so an older shipkit
|
|
44
|
+
* takes every ask it can */
|
|
45
|
+
export function placeArgs(a: ShotAsk | ClipAsk, out: string): string[] {
|
|
46
|
+
const w = ['shot', a.url]
|
|
47
|
+
if (a.viewport.width !== DEFAULT_VIEWPORT.width || a.viewport.height !== DEFAULT_VIEWPORT.height) w.push('--viewport', `${a.viewport.width},${a.viewport.height}`)
|
|
48
|
+
if (a.dpr !== 1) w.push('--dpr', String(a.dpr))
|
|
49
|
+
if (a.waitMs !== DEFAULT_WAIT_MS) w.push('--wait', String(a.waitMs))
|
|
50
|
+
if (a.reload) w.push('--reload')
|
|
51
|
+
if (a.theme != null) w.push('--theme', a.theme)
|
|
52
|
+
if (a.step != null) w.push('--step', a.step)
|
|
53
|
+
if (isClip(a)) {
|
|
54
|
+
w.push('--video', String(a.seconds))
|
|
55
|
+
if (a.seconds > MAX_CLIP_SECONDS) w.push('--long')
|
|
56
|
+
if (a.fps !== DEFAULT_FPS) w.push('--fps', String(a.fps))
|
|
57
|
+
if (a.dom) w.push('--dom')
|
|
58
|
+
} else {
|
|
59
|
+
if (a.at != null && a.step != null) w.push('--at', String(a.at))
|
|
60
|
+
if (a.full === true) w.push('--full')
|
|
61
|
+
}
|
|
62
|
+
w.push('--out', out, '--json')
|
|
63
|
+
return w
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type Ran = { code: number; out: Uint8Array; err: string }
|
|
67
|
+
/** one command on the place; a test passes a fake place */
|
|
68
|
+
export type Ssh = (host: string, command: string) => Promise<Ran>
|
|
69
|
+
|
|
70
|
+
const lastLine = (s: string): string => s.trim().split('\n').filter(Boolean).at(-1) ?? ''
|
|
71
|
+
|
|
72
|
+
/** the one line a failed run on the place says, with the fix */
|
|
73
|
+
export function placeRefusal(p: Place, r: { code: number; out: string; err: string }, houseRel: string, now: number): string {
|
|
74
|
+
const said = lastLine(r.err) || lastLine(r.out) || `exit ${r.code}`
|
|
75
|
+
const at = `FAIL shot --on ${p.name}`
|
|
76
|
+
if (r.code === 255) return `${at}: ${p.name} does not answer ssh at ${p.host} (${said}); its daemon last reported ${ago(now - p.seen)} ago: is it on and on the tailnet? sk machines`
|
|
77
|
+
if (r.code === 127 || /sk: (command )?not found/.test(r.err)) return `${at}: ${p.name} has no sk on the PATH of an ssh shell ($HOME/.local/bin, $HOME/.bun/bin): run bun run relink in its house checkout`
|
|
78
|
+
if (/cd: .*(No such file|not a directory|can't cd)/i.test(r.err)) return `${at}: ${p.name} has no house checkout at ~/${houseRel}, where this machine has its own`
|
|
79
|
+
if (/Unknown Syntax Error|Unsupported option|Command not found/i.test(`${r.err}\n${r.out}`))
|
|
80
|
+
return `${at}: ${p.name} runs shipkit ${p.version}, whose sk shot does not take this ask (${said}): sk fleet update --place ${p.name}`
|
|
81
|
+
return `${at}: ${said.replace(/^FAIL (shot: )?/, '')}`
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** the ask shot on the place, each file it wrote brought back to `a.out` (its tiles beside it), and removed there */
|
|
85
|
+
export async function shotOnPlace(p: Place, a: ShotAsk | ClipAsk, o: { ssh: Ssh; houseRel: string; say?: (l: string) => void; now?: () => number }): Promise<ShotResult & { on: string }> {
|
|
86
|
+
const ext = /\.[^./]+$/.exec(a.out)?.[0] ?? (isClip(a) ? '.mp4' : '.webp')
|
|
87
|
+
const there = `/tmp/sk-shot-on-${randomBytes(6).toString('hex')}${ext}`
|
|
88
|
+
const text = (b: Uint8Array): string => new TextDecoder().decode(b)
|
|
89
|
+
const r = await o.ssh(p.host, peerSk(o.houseRel, placeArgs(a, there).map(shq).join(' ')))
|
|
90
|
+
const out = text(r.out)
|
|
91
|
+
if (r.code !== 0) throw new Error(placeRefusal(p, { code: r.code, out, err: r.err }, o.houseRel, (o.now ?? Date.now)()))
|
|
92
|
+
for (const l of r.err.split('\n').filter(Boolean)) o.say?.(`${p.name}: ${l}`)
|
|
93
|
+
let done: ShotResult
|
|
94
|
+
try {
|
|
95
|
+
done = JSON.parse(lastLine(out)) as ShotResult
|
|
96
|
+
} catch {
|
|
97
|
+
throw new Error(`FAIL shot --on ${p.name}: its sk shot answered no json (${lastLine(out) || 'nothing'}): shipkit ${p.version} there, sk fleet update --place ${p.name}`)
|
|
98
|
+
}
|
|
99
|
+
const files = done.tiles ?? [done.out]
|
|
100
|
+
const here = (f: string): string => {
|
|
101
|
+
if (f === there) return a.out
|
|
102
|
+
for (let n = 1; n <= files.length; n++) if (f === tileOut(there, n)) return tileOut(a.out, n)
|
|
103
|
+
throw new Error(`FAIL shot --on ${p.name}: it wrote ${f}, not the file it was asked for (${there})`)
|
|
104
|
+
}
|
|
105
|
+
const brought: string[] = []
|
|
106
|
+
for (const f of files) {
|
|
107
|
+
const to = here(f)
|
|
108
|
+
const got = await o.ssh(p.host, `cat ${shq(f)} && rm -f ${shq(f)}`)
|
|
109
|
+
if (got.code !== 0) throw new Error(`FAIL shot --on ${p.name}: its file ${f} did not come back (${lastLine(got.err) || `exit ${got.code}`})`)
|
|
110
|
+
mkdirSync(dirname(to), { recursive: true })
|
|
111
|
+
writeFileSync(to, got.out)
|
|
112
|
+
brought.push(to)
|
|
113
|
+
}
|
|
114
|
+
if (!isClip(a)) assertStills(brought)
|
|
115
|
+
return { ...done, out: brought[0] ?? a.out, ...(done.tiles != null ? { tiles: brought } : {}), on: p.name }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** the place this machine sees under `name`, from the hq's machines and ssh's own config; 'here' for this machine */
|
|
119
|
+
export async function lookPlace(name: string): Promise<Place | 'here' | { refused: string }> {
|
|
120
|
+
const { machineName } = await import('../core/machine-name.ts')
|
|
121
|
+
const { machinesPage } = await import('../hq/hq-local.ts')
|
|
122
|
+
const page = await machinesPage(1)
|
|
123
|
+
// a Host block names it when ssh's resolved config for it differs from a name no block matches (its own names apart)
|
|
124
|
+
const resolved = (n: string): string | null => {
|
|
125
|
+
const g = Bun.spawnSync(['ssh', '-G', n], { stdout: 'pipe', stderr: 'ignore' })
|
|
126
|
+
return g.exitCode !== 0 ? null : g.stdout.toString().split('\n').filter((l) => !/^host(name)? /.test(l)).join('\n')
|
|
127
|
+
}
|
|
128
|
+
const plain = resolved('sk-no-such-host.invalid')
|
|
129
|
+
const sshAlias = (n: string): boolean => {
|
|
130
|
+
const g = Bun.spawnSync(['ssh', '-G', n], { stdout: 'pipe', stderr: 'ignore' })
|
|
131
|
+
const host = /^hostname (.+)$/m.exec(g.stdout.toString())?.[1]?.trim()
|
|
132
|
+
return g.exitCode === 0 && ((host != null && host.toLowerCase() !== n.toLowerCase()) || (plain != null && resolved(n) !== plain))
|
|
133
|
+
}
|
|
134
|
+
return placeOf(name, { here: machineName(), machines: 'refused' in page ? page : page.machines, sshAlias, now: Date.now() })
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** the ssh every place is reached by: one connection kept a while, so bringing the file back pays no second handshake */
|
|
138
|
+
export const placeSsh: Ssh = async (host, command) => {
|
|
139
|
+
const { houseSsh } = await import('../media-store/backup/ssh-target.ts')
|
|
140
|
+
return houseSsh(host, command)
|
|
141
|
+
}
|
package/src/social/drafts.ts
CHANGED
|
@@ -145,7 +145,7 @@ export function mediaNames(d: ParsedDraft): string[] {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/** where a media name points: `/…` or `~/…` anywhere on the disk, else the draft's folder, else the repo's root; null
|
|
148
|
-
* when none holds it */
|
|
148
|
+
* when none holds it (a house repo's own scripts read it) */
|
|
149
149
|
export function resolveMedia(name: string, dir: string, repo: string): string | null {
|
|
150
150
|
if (name.startsWith('~/')) return existsSync(join(homedir(), name.slice(2))) ? join(homedir(), name.slice(2)) : null
|
|
151
151
|
if (isAbsolute(name)) return existsSync(name) ? name : null
|