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/review/traces.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// pick, a tick, an apply, a bare verdict, a close, a set aside) or an agent's (a read, on it, a take, a superseded
|
|
3
3
|
// object, a state change), never a bubble that repeats the object's words; and where his newest word stands, read or
|
|
4
4
|
// on it (wiki tools/shipkit/threads-how-it-fits.md, Read and on it). Pure and browser safe
|
|
5
|
-
import { kindOfAsk, linesOf } from './answer-kinds.ts'
|
|
5
|
+
import { kindOfAsk, linesOf, noneAnswered, remarkOf } from './answer-kinds.ts'
|
|
6
6
|
import { partyOf, WORKING_FRESH_MS, type AskState, type Message, type Op, type ReviewItem, type ReviewStatus } from './model.ts'
|
|
7
|
-
import { membersOf,
|
|
8
|
-
import { wakeOf } from './
|
|
7
|
+
import { membersOf, type Thread } from './threads.ts'
|
|
8
|
+
import { wakeOf, openingOf } from './thread-events.ts'
|
|
9
9
|
|
|
10
10
|
/** an ask's close or reopen as its trace line says it, who before it and its why after */
|
|
11
11
|
const ASK_STATE_DID: Record<AskState, string> = {
|
|
@@ -41,6 +41,7 @@ export const TRACE_ACTS = {
|
|
|
41
41
|
read: 'read',
|
|
42
42
|
working: 'is on it',
|
|
43
43
|
pick: 'picked',
|
|
44
|
+
none: 'answered none of these',
|
|
44
45
|
tick: 'ticked',
|
|
45
46
|
untick: 'unticked',
|
|
46
47
|
confirm: 'confirmed',
|
|
@@ -61,9 +62,58 @@ export const TRACE_ACTS = {
|
|
|
61
62
|
share: 'shared it',
|
|
62
63
|
mention: 'mentioned in',
|
|
63
64
|
rename: 'renamed the thread',
|
|
65
|
+
move: 'moved the thread',
|
|
66
|
+
close: 'closed the thread',
|
|
64
67
|
} as const satisfies Record<string, string>
|
|
65
68
|
export type TraceAct = keyof typeof TRACE_ACTS
|
|
66
69
|
|
|
70
|
+
/** how loud each act's line reads (wiki tools/shipkit/threads-page.md, Traces): `quiet` for the bookkeeping that changes
|
|
71
|
+
* nothing he decides on (who read, who holds, where the thread is filed, who sees it), `normal` for what changes the
|
|
72
|
+
* outcome or waits on him (his answer, a verdict, a close, a reopen, a fix, a question) */
|
|
73
|
+
export const TRACE_WEIGHT = {
|
|
74
|
+
dispatch: 'quiet',
|
|
75
|
+
ask: 'normal',
|
|
76
|
+
answer: 'normal',
|
|
77
|
+
reassign: 'quiet',
|
|
78
|
+
claim: 'quiet',
|
|
79
|
+
release: 'quiet',
|
|
80
|
+
blocked: 'normal',
|
|
81
|
+
fixed: 'normal',
|
|
82
|
+
done: 'normal',
|
|
83
|
+
wontfix: 'normal',
|
|
84
|
+
drop: 'normal',
|
|
85
|
+
withdraw: 'normal',
|
|
86
|
+
reopen: 'normal',
|
|
87
|
+
ready: 'quiet',
|
|
88
|
+
take: 'quiet',
|
|
89
|
+
read: 'quiet',
|
|
90
|
+
working: 'quiet',
|
|
91
|
+
pick: 'normal',
|
|
92
|
+
none: 'normal',
|
|
93
|
+
tick: 'normal',
|
|
94
|
+
untick: 'normal',
|
|
95
|
+
confirm: 'normal',
|
|
96
|
+
value: 'normal',
|
|
97
|
+
file: 'normal',
|
|
98
|
+
apply: 'normal',
|
|
99
|
+
store: 'normal',
|
|
100
|
+
verdict: 'normal',
|
|
101
|
+
aside: 'quiet',
|
|
102
|
+
back: 'quiet',
|
|
103
|
+
'ask-state': 'normal',
|
|
104
|
+
action: 'normal',
|
|
105
|
+
act: 'normal',
|
|
106
|
+
supersede: 'quiet',
|
|
107
|
+
hold: 'normal',
|
|
108
|
+
unhold: 'normal',
|
|
109
|
+
lane: 'normal',
|
|
110
|
+
share: 'quiet',
|
|
111
|
+
mention: 'quiet',
|
|
112
|
+
rename: 'quiet',
|
|
113
|
+
move: 'quiet',
|
|
114
|
+
close: 'normal',
|
|
115
|
+
} as const satisfies Record<TraceAct, 'quiet' | 'normal'>
|
|
116
|
+
|
|
67
117
|
/** one act as its line says it: who is the cell's, then `did`, then the object as a link to its cell, then when */
|
|
68
118
|
export interface Trace {
|
|
69
119
|
act: TraceAct
|
|
@@ -73,6 +123,34 @@ export interface Trace {
|
|
|
73
123
|
until?: string
|
|
74
124
|
/** `action`: the kind's action by name, its label read from the kind */
|
|
75
125
|
action?: string
|
|
126
|
+
/** an act still running (a `working` no act ended, a share he can still end): it reads normal whatever its act */
|
|
127
|
+
live?: true
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** a trace line that steps back: a quiet act that no longer runs */
|
|
131
|
+
export const quietOf = (t: Trace): boolean => TRACE_WEIGHT[t.act] === 'quiet' && t.live !== true
|
|
132
|
+
|
|
133
|
+
/** a line of a run of traces, or two or more quiet lines in a row as one fold; a lone quiet line stays a line, a fold of
|
|
134
|
+
* one would hide nothing */
|
|
135
|
+
export type QuietPiece<T> = { one: T } | { fold: T[] }
|
|
136
|
+
|
|
137
|
+
export function foldQuiet<T>(xs: readonly T[], quiet: (x: T) => boolean): QuietPiece<T>[] {
|
|
138
|
+
const out: QuietPiece<T>[] = []
|
|
139
|
+
let run: T[] = []
|
|
140
|
+
const flush = (): void => {
|
|
141
|
+
if (run.length > 1) out.push({ fold: run })
|
|
142
|
+
else if (run.length === 1) out.push({ one: run[0]! })
|
|
143
|
+
run = []
|
|
144
|
+
}
|
|
145
|
+
for (const x of xs) {
|
|
146
|
+
if (quiet(x)) run.push(x)
|
|
147
|
+
else {
|
|
148
|
+
flush()
|
|
149
|
+
out.push({ one: x })
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
flush()
|
|
153
|
+
return out
|
|
76
154
|
}
|
|
77
155
|
|
|
78
156
|
/** what a trace needs beyond its item: the workings that ended, and any message's cell and title by its id */
|
|
@@ -82,7 +160,7 @@ export interface TraceCtx {
|
|
|
82
160
|
title: (id: string) => string | null
|
|
83
161
|
}
|
|
84
162
|
|
|
85
|
-
const VERDICT_DID: Record<ReviewStatus, string> = { approved: 'approved', 'approved-with-fix': 'said ok with a fix to',
|
|
163
|
+
const VERDICT_DID: Record<ReviewStatus, string> = { approved: 'approved', 'approved-with-fix': 'said ok with a fix to', rework: 'asked a rework of', 'wrong-direction': 'said wrong direction to', 'your-call': 'left to the agent', 'no-answer': 'left it unanswered', archived: 'archived' }
|
|
86
164
|
|
|
87
165
|
const firstLine = (s: string | undefined, max = 80): string => {
|
|
88
166
|
const l = (s ?? '').trim().split('\n')[0]?.trim() ?? ''
|
|
@@ -116,7 +194,12 @@ export function traceOf(x: ReviewItem, m: Message, n: number, ctx: TraceCtx): Tr
|
|
|
116
194
|
}
|
|
117
195
|
// an act of the version's kind on a spot (review/settle.ts): its line says what went where
|
|
118
196
|
if (m.act !== undefined) return { act: 'act', did: firstLine(m.note, 200) || m.act.name }
|
|
119
|
-
if (m.op === 'working') return m.note ?{ act: 'working', did:
|
|
197
|
+
if (m.op === 'working') return m.note ? (ctx.ended.has(m.id) ? { act: 'working', did: `was on it: ${firstLine(m.note)}` } : { act: 'working', did: `is on it: ${firstLine(m.note)}`, live: true }) : null
|
|
198
|
+
if (m.rename !== undefined) return { act: 'rename', did: `renamed the thread: « ${m.rename.from} » → « ${m.rename.to} »` }
|
|
199
|
+
if (m.moved !== undefined) return { act: 'move', did: `moved the thread from ${m.moved.from} to ${m.moved.to}` }
|
|
200
|
+
// an agent's close of the thread it finished: one line on its head; a version it closed says « no verdict needed »
|
|
201
|
+
if (m.closes === 'thread') return { act: 'close', did: `closed the thread: ${firstLine(m.note, 200)}` }
|
|
202
|
+
if (m.closes === 'version') return null
|
|
120
203
|
// an attached object's hold flipped, the machine's check; his close that released the holds (review/holds.ts)
|
|
121
204
|
if (m.hold !== undefined) return { act: 'hold', did: `checked: ${firstLine(m.text, 200)}` }
|
|
122
205
|
if (owner && m.unhold !== undefined) return { act: 'unhold', did: `closed it while ${m.unhold.join(', ')} held it open` }
|
|
@@ -126,6 +209,8 @@ export function traceOf(x: ReviewItem, m: Message, n: number, ctx: TraceCtx): Tr
|
|
|
126
209
|
const did = ASK_STATE_DID[s.state] + (s.state === 'merged' && s.into ? ` ask:${s.into}` : '')
|
|
127
210
|
return { act: 'ask-state', did: `${did}${s.why ? `: ${firstLine(s.why)}` : ''}` }
|
|
128
211
|
}
|
|
212
|
+
// his « no answer » on a version, a message or a question: one line, nobody owes anything
|
|
213
|
+
if (owner && m.verdict === 'no-answer') return { act: 'verdict', did: VERDICT_DID['no-answer'] }
|
|
129
214
|
if (owner && m.answer !== undefined && m.re !== undefined) {
|
|
130
215
|
const q = x.thread.find((y) => y.id === m.re)
|
|
131
216
|
const a = m.answer
|
|
@@ -134,10 +219,22 @@ export function traceOf(x: ReviewItem, m: Message, n: number, ctx: TraceCtx): Tr
|
|
|
134
219
|
if (a.stored !== undefined) return { act: 'store', did: `stored the secret as ${a.stored} for`, object: on }
|
|
135
220
|
if (a.tick !== undefined && q !== undefined && kindOfAsk(q) === 'confirm') return { act: a.tick ? 'confirm' : 'untick', did: a.tick ? 'confirmed' : 'took back the confirm of', object: on }
|
|
136
221
|
if (a.tick !== undefined) return { act: a.tick ? 'tick' : 'untick', did: `${a.tick ? 'ticked' : 'unticked'} « ${firstLine(q ? linesOf(q)[a.option ?? 0] : m.text)} » on`, object: on }
|
|
137
|
-
if (a.option !== undefined)
|
|
222
|
+
if (a.option !== undefined) {
|
|
223
|
+
const label = q?.ask?.options[a.option]
|
|
224
|
+
// his remark draws in the question's widget, under the option: the line says there is one, never its words
|
|
225
|
+
const remark = label !== undefined && remarkOf(label, m.text) !== '' ? ' with a remark' : ''
|
|
226
|
+
if (m.verdict === 'your-call') return { act: 'pick', did: `left it to the agent, its pick ${a.option + 1} « ${firstLine(label ?? m.text)} » if it still holds, on`, object: on }
|
|
227
|
+
return { act: 'pick', did: `picked ${a.option + 1} « ${firstLine(label ?? m.text)} »${remark} on`, object: on }
|
|
228
|
+
}
|
|
138
229
|
if (a.view !== undefined) return { act: 'file', did: 'added a file to', object: on }
|
|
139
230
|
return { act: 'value', did: a.value !== undefined ? `answered « ${firstLine(a.value)} » to` : 'answered', object: on }
|
|
140
231
|
}
|
|
232
|
+
// the owner's words alone that answer a question draw in its control (a choice's « none of these »): here one line, never a
|
|
233
|
+
// bubble repeating them
|
|
234
|
+
const none = owner ? noneAnswered(x.thread, m) : undefined
|
|
235
|
+
// his tone with them (store.ts answerAsk `tone`): a wrong direction, or « your call » with no pick to take
|
|
236
|
+
const toned = m.verdict === 'wrong-direction' ? 'said wrong direction on' : m.verdict === 'your-call' ? 'left it to the agent on' : null
|
|
237
|
+
if (none !== undefined) return { act: 'none', did: toned ?? (kindOfAsk(none) === 'choice' ? 'answered none of these on' : 'answered in words on'), object: { cell: own(none.id), label: 'the question' } }
|
|
141
238
|
const words = m.text !== undefined && m.text.trim() !== ''
|
|
142
239
|
if (owner && m.verdict !== undefined) {
|
|
143
240
|
if (words || (m.rects?.length ?? 0) > 0 || (m.reactions?.length ?? 0) > 0 || m.pick !== undefined) return null
|
|
@@ -192,7 +289,7 @@ export function workingsOf(t: Thread, now = new Date()): { ended: Set<string>; o
|
|
|
192
289
|
return { ended, open, last }
|
|
193
290
|
}
|
|
194
291
|
|
|
195
|
-
/** where his newest word stands (a tick inside an unfinished list is no word: review/
|
|
292
|
+
/** where his newest word stands (a tick inside an unfinished list is no word: review/thread-events.ts): an agent on it (a
|
|
196
293
|
* `working` begun after it), else read by an agent, else null */
|
|
197
294
|
export interface Cursor {
|
|
198
295
|
who: string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// a trailer item as `sk thread
|
|
1
|
+
// a trailer item as `sk thread post --trailer` makes it (wiki tools/shipkit/threads.md, A trailer): the cut a .trailer file
|
|
2
2
|
// names, a kept version of it, the render it is compared with, each render pinned by its mtime, the shots the change
|
|
3
3
|
// touched. No video is made: the hub plays the pinned renders in the trailer entry's player
|
|
4
4
|
import { existsSync, readFileSync } from 'node:fs'
|
package/src/review/unit.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// a repo's parts of the one store (wiki tools/shipkit/threads.md, A project's parts): its subject kinds, topics, sources,
|
|
2
|
-
// auto rules and
|
|
2
|
+
// auto rules and its verbs, declared once in a `review({...})` unit of any `<name>.shipkit.ts`. Every unit
|
|
3
3
|
// file imports this module, so it stays light: the store reads the pure part through specOf(dir), project.ts finds,
|
|
4
4
|
// imports and serves the rest
|
|
5
5
|
import { isKindColor, KIND_COLORS } from './glyphs.ts'
|
|
@@ -74,7 +74,7 @@ export interface KindDef<S extends Subject = Subject> extends SpecKind {
|
|
|
74
74
|
text?(x: ReviewItem): ViewText | null
|
|
75
75
|
/** the subject in parts, each a frame: a post's messages, with their logo, media and change */
|
|
76
76
|
parts?(x: ReviewItem): ViewPart[]
|
|
77
|
-
/** the `sk thread
|
|
77
|
+
/** the `sk thread post` flags this kind reads, each with its help line: `--where <zone>:<x>,<y>` */
|
|
78
78
|
flags?: Record<string, string>
|
|
79
79
|
/** the subject (and its topic) an item of this kind gets from those flags, every flag as the list of its values;
|
|
80
80
|
* throws with the reason a flag is wrong */
|
|
@@ -184,19 +184,18 @@ export interface ReviewSource {
|
|
|
184
184
|
export interface ReviewDef {
|
|
185
185
|
kinds?: Record<string, KindDef>
|
|
186
186
|
topics?: Record<string, SpecTopic>
|
|
187
|
-
dispatcher?: boolean
|
|
188
187
|
sources?: readonly ReviewSource[]
|
|
189
188
|
auto?: readonly AutoRule[]
|
|
190
189
|
/** a repo relative font file the animation's labels are drawn in */
|
|
191
190
|
anim?: { font?: string }
|
|
192
|
-
/** the `sk thread
|
|
191
|
+
/** the `sk thread post` and `add-view` flags of any kind (a ring over the subject), each with its help line */
|
|
193
192
|
flags?: Record<string, string>
|
|
194
193
|
/** what the repo checks and fills on a version before it is written (marks read from its own shots, the review light,
|
|
195
194
|
* a lane from a commit, a refused contact sheet); throws to refuse it */
|
|
196
195
|
add?(input: AddInput, flags: Record<string, string[]>): AddInput | Promise<AddInput>
|
|
197
196
|
/** the same on a view added to an open version */
|
|
198
197
|
addView?(view: ViewInput, flags: Record<string, string[]>): ViewExtra | Promise<ViewExtra>
|
|
199
|
-
/** a draft version's live shots: `sk thread
|
|
198
|
+
/** a draft version's live shots: `sk thread post --wip --live <name>`, `ready` stops the shot */
|
|
200
199
|
live?: LiveShots
|
|
201
200
|
/** the repo's own verbs under `sk thread <verb>`: a report replayed in the game, the town composer */
|
|
202
201
|
verbs?: Record<string, { description: string; usage?: string; run(args: string[], ctx: VerbCtx): number | Promise<number> }>
|
|
@@ -228,7 +227,7 @@ export function reviewProblem(d: ReviewDef): string | null {
|
|
|
228
227
|
if (!/^\d+(\.\d+)?m$/.test(r.every ?? '')) return `review: auto rule '${r.id}' runs every '<minutes>m', like '10m'`
|
|
229
228
|
if (typeof r.when !== 'function') return `review: auto rule '${r.id}'.when is a function`
|
|
230
229
|
}
|
|
231
|
-
const core = new Set(['ls', '
|
|
230
|
+
const core = new Set(['ls', 'post', 'add-view', 'show', 'inbox', 'seen', 'reply', 'withdraw', 'reopen', 'fixed', 'wontfix', 'claim', 'release', 'done', 'ask', 'next', 'topics', 'board', 'ready', 'delete', 'marks', 'anim', 'auto', 'watch', 'take', 'assign', 'working'])
|
|
232
231
|
for (const [v, def] of Object.entries(d.verbs ?? {})) {
|
|
233
232
|
if (!WORD.test(v)) return `review: verb '${v}' is a lowercase word`
|
|
234
233
|
if (core.has(v)) return `review: verb '${v}' is one of sk thread's own`
|
|
@@ -288,8 +287,8 @@ export function review(d: ReviewDef): ReviewUnit {
|
|
|
288
287
|
return { ...d, kind: 'review' }
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
/** the model's part of a unit: its kinds
|
|
292
|
-
export const specOfUnit = (u: ReviewDef | null): Spec => ({ kinds: u?.kinds ?? {}, topics: u?.topics ?? {}
|
|
290
|
+
/** the model's part of a unit: its kinds and topics */
|
|
291
|
+
export const specOfUnit = (u: ReviewDef | null): Spec => ({ kinds: u?.kinds ?? {}, topics: u?.topics ?? {} })
|
|
293
292
|
|
|
294
293
|
/** a kind's declared data, as the browser reads it: no function crosses */
|
|
295
294
|
export const kindData = (v: SpecKind): SpecKind => ({
|
|
@@ -307,5 +306,4 @@ export const kindData = (v: SpecKind): SpecKind => ({
|
|
|
307
306
|
export const specData = (spec: Spec): Spec => ({
|
|
308
307
|
kinds: Object.fromEntries(Object.entries(spec.kinds).map(([k, v]) => [k, kindData(v)])),
|
|
309
308
|
topics: spec.topics,
|
|
310
|
-
dispatcher: spec.dispatcher,
|
|
311
309
|
})
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
//
|
|
6
6
|
// the one constraint a reader breaks first: a verdict message that names `re` answers that message, never the version,
|
|
7
7
|
// so model.ts verdictOf skips it
|
|
8
|
-
import { partyOf,
|
|
8
|
+
import { partyOf, statusRead, toneAskTail, type Message, type ReviewItem, type ReviewStatus } from './model.ts'
|
|
9
9
|
|
|
10
|
-
/** the
|
|
11
|
-
export const ITEM_VERDICTS = ['approved', 'approved-with-fix', '
|
|
10
|
+
/** the five tones, or no answer, an item that asks takes (model.ts STATUSES): « later » is the thread's « set aside », never an item's answer */
|
|
11
|
+
export const ITEM_VERDICTS = ['approved', 'approved-with-fix', 'rework', 'wrong-direction', 'your-call', 'no-answer'] as const satisfies readonly ReviewStatus[]
|
|
12
12
|
export type ItemVerdict = (typeof ITEM_VERDICTS)[number]
|
|
13
13
|
export const isItemVerdict = (s: string): s is ItemVerdict => (ITEM_VERDICTS as readonly string[]).includes(s)
|
|
14
14
|
|
|
@@ -32,8 +32,8 @@ export function verdictOnMessage(thread: readonly Message[], m: Pick<Message, 'i
|
|
|
32
32
|
return null
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/** the message asks the owner's verdict and has none yet
|
|
36
|
-
export const verdictOpen = (thread: readonly Message[], m: Message): boolean => asksVerdict(m) && verdictOnMessage(thread, m) === null
|
|
35
|
+
/** the message asks the owner's verdict and has none yet: only the owner's verdict on it answers it, never a plain reply after it */
|
|
36
|
+
export const verdictOpen = (thread: readonly Message[], m: Message): boolean => asksVerdict(m) && verdictOnMessage(thread, m) === null
|
|
37
37
|
|
|
38
38
|
/** each message of the items that asks the owner's verdict and has none, oldest first; `gone`: the ids a newer object
|
|
39
39
|
* supersedes (review/supersede.ts), which ask nothing more */
|
|
@@ -47,7 +47,7 @@ export function openVerdictAsks(members: readonly ReviewItem[], gone: ReadonlySe
|
|
|
47
47
|
export function judgeOf(thread: readonly Message[], m: Message, superseded = false): { judge?: { open: boolean; verdict?: MessageVerdict } } {
|
|
48
48
|
if (!asksVerdict(m)) return {}
|
|
49
49
|
const v = verdictOnMessage(thread, m)
|
|
50
|
-
return { judge: { open: v === null && !superseded
|
|
50
|
+
return { judge: { open: v === null && !superseded, ...(v ? { verdict: v } : {}) } }
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/** the owner's verdict on a message, as the store takes it: the message it answers, the status, the owner's words if any */
|
|
@@ -58,9 +58,10 @@ export function itemVerdictBody(body: unknown, thread: readonly Message[]): { ok
|
|
|
58
58
|
const m = thread.find((x) => x.id === b.re)
|
|
59
59
|
if (!m) return { ok: false, error: `re: ${b.re} is no message of this item` }
|
|
60
60
|
if (!asksVerdict(m)) return { ok: false, error: `re: ${b.re} asks no verdict: a word on it goes in a reply` }
|
|
61
|
-
|
|
61
|
+
const status = statusRead(b.status)
|
|
62
|
+
if (!(ITEM_VERDICTS as readonly unknown[]).includes(status)) return { ok: false, error: `status: one of ${ITEM_VERDICTS.join(', ')}` }
|
|
62
63
|
const text = typeof b.text === 'string' ? b.text.trim() : ''
|
|
63
|
-
return { ok: true, re: b.re, status:
|
|
64
|
+
return { ok: true, re: b.re, status: status as ItemVerdict, ...(text !== '' ? { text } : {}) }
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
const first = (t: string | undefined): string => (t ?? '').split('\n').find((l) => l.trim() !== '')?.trim() ?? ''
|
|
@@ -68,6 +69,7 @@ const first = (t: string | undefined): string => (t ?? '').split('\n').find((l)
|
|
|
68
69
|
/** the watch's line of the owner's verdict on a message: what he judged, the owner's verdict, the owner's words */
|
|
69
70
|
export function itemVerdictLine(x: ReviewItem, v: Message): string | null {
|
|
70
71
|
const asked = v.re === undefined ? undefined : x.thread.find((m) => m.id === v.re)
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
// a tone on a question is his answer to it: the answer's own line says it (format.ts answerLine, noneLine)
|
|
73
|
+
if (v.verdict === undefined || asked === undefined || asked.ask !== undefined) return null
|
|
74
|
+
return `${x.item.id} verdict ${v.verdict} "${x.item.title}" on ${asked.id} « ${first(asked.text).slice(0, 80)} »${v.text ? `: ${v.text.replace(/\s+/g, ' ')}` : ''}${toneAskTail(v.verdict, x.item.id)}`
|
|
73
75
|
}
|
|
@@ -31,6 +31,30 @@ export const TILE_ASPECT = 16 / 10
|
|
|
31
31
|
/** px: the widest least width of a gallery tile its tiny preview serves (review/previews.ts PREVIEW_W.tile). A tile of
|
|
32
32
|
* the grid is under twice its least width, its frame TILE_ASPECT, drawn at 2x */
|
|
33
33
|
export const TINY_TILE = 130
|
|
34
|
+
|
|
35
|
+
/** px: the box each preview of an image fits inside, never past the file's own pixels (review/previews.ts makes them):
|
|
36
|
+
* `tile` a small gallery tile's frame at 2x, `thumb` a larger tile, `fit` a view in the thread column */
|
|
37
|
+
export const PREVIEW_BOX = { tile: { w: TINY_TILE * 4, h: Math.round((TINY_TILE * 4) / TILE_ASPECT) }, thumb: { w: 480, h: Infinity }, fit: { w: 1600, h: Infinity } } as const
|
|
38
|
+
export type PreviewSize = keyof typeof PREVIEW_BOX
|
|
39
|
+
|
|
40
|
+
/** an image of unknown size counts as a large one of the frame's own shape */
|
|
41
|
+
const UNKNOWN = { w: 1600, h: 1000 }
|
|
42
|
+
|
|
43
|
+
/** the least preview that draws an image sharp at 2x in a gallery tile `boxW` css px wide (its frame TILE_ASPECT, the
|
|
44
|
+
* image contained): a 832 × 1152 picture in a 140 px tile is the tile preview, never the 1600 px one. Each preview a
|
|
45
|
+
* tile loads is decoded whole, so the pick bounds a gallery's memory */
|
|
46
|
+
export function tilePreviewOf(boxW: number, size?: { w: number; h: number }): PreviewSize {
|
|
47
|
+
const { w, h } = size !== undefined && size.w > 0 && size.h > 0 ? size : UNKNOWN
|
|
48
|
+
const s = Math.min(boxW / w, boxW / TILE_ASPECT / h)
|
|
49
|
+
const need = w * s * 2
|
|
50
|
+
for (const k of ['tile', 'thumb'] as const) {
|
|
51
|
+
const b = PREVIEW_BOX[k]
|
|
52
|
+
const p = Math.min(1, b.w / w, b.h / h)
|
|
53
|
+
// a few percent short is not seen; a preview that is the file whole is as sharp as it gets
|
|
54
|
+
if (p === 1 || w * p >= need * 0.95) return k
|
|
55
|
+
}
|
|
56
|
+
return 'fit'
|
|
57
|
+
}
|
|
34
58
|
/** the cap of a view that fills the column, as a share of the window's height */
|
|
35
59
|
export const FILL_VH = 70
|
|
36
60
|
|
|
@@ -53,7 +77,7 @@ export const LAYOUT: Readonly<Record<ViewForm, FormLayout>> = {
|
|
|
53
77
|
pano: { shows: 'its still, « 360° · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
|
|
54
78
|
splat: { shows: 'its poster, « splat · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
|
|
55
79
|
mesh: { shows: 'its poster, « 3D mesh · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
|
|
56
|
-
live: { shows: 'its shot, «
|
|
80
|
+
live: { shows: 'its shot in a border of its own colour, « IFRAME » on it, a column of its ways to open it down its right side (here, beside the page, a tab, the hub\'s tab, copy its address); framed live in the lightbox',alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
|
|
57
81
|
'kind-page': { shows: 'its still, a tile a side, « open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'its actions under it' },
|
|
58
82
|
html: { shows: 'the html page shrunk into a tile, « html · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'copy html, changes since vN, under it' },
|
|
59
83
|
md: { shows: 'its text whole', alone: 'row', among: 'row', opens: null, controls: 'copy markdown, changes since vN, under it' },
|
package/src/review/watch-feed.ts
CHANGED
|
@@ -146,8 +146,7 @@ export class WatchFeed {
|
|
|
146
146
|
this.lastBeat = this.now()
|
|
147
147
|
if (event === 'hello') {
|
|
148
148
|
const repos = data.repos
|
|
149
|
-
|
|
150
|
-
if (!Array.isArray(repos)) return this.down('the daemon is older than this watch')
|
|
149
|
+
if (!Array.isArray(repos)) return this.down("the daemon's hello names no stores")
|
|
151
150
|
this.served = new Map((repos as { name: string; dir: string }[]).map((r) => [canonDir(r.dir), r.name]))
|
|
152
151
|
if (typeof data.beatMs === 'number') this.beatMs = data.beatMs
|
|
153
152
|
if (this.dog != null) clearInterval(this.dog)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// what `sk thread working` refuses (wiki tools/shipkit/threads-how-it-fits.md, Read and on it): a line that only
|
|
2
2
|
// acknowledges his answer to a question or a pick. A working line is no answer, so his answer would stay owed with
|
|
3
3
|
// nothing planned to pay it. Pure and narrow: a false refusal of real work costs more than a missed acknowledgement
|
|
4
|
-
import { moveOf } from './band.ts'
|
|
5
4
|
import { partyOf, type Message } from './model.ts'
|
|
6
5
|
import { membersOf, type Thread } from './threads.ts'
|
|
7
|
-
import { wakeOf } from './
|
|
6
|
+
import { wakeOf, messageMove } from './thread-events.ts'
|
|
8
7
|
|
|
9
8
|
/** the words a line opens with when it only says it read: « noted », « seen », « ok », « I collect … » */
|
|
10
9
|
const ACK = /^(?:ok(?:ay)?|noted|seen|got it|thanks|thank you|acknowledged|understood|received|sure|i(?:'ll| will)? collect(?:ed|ing)?|collect(?:ed|ing))\b/i
|
|
@@ -34,6 +33,6 @@ function newestWord(t: Thread): { x: Thread['head']; m: Message } | null {
|
|
|
34
33
|
* and the line only acknowledges it */
|
|
35
34
|
export function workingRefusal(t: Thread, line: string, ref: string, bin = 'sk'): string | null {
|
|
36
35
|
const w = newestWord(t)
|
|
37
|
-
if (w === null ||
|
|
36
|
+
if (w === null || messageMove(w.x, w.m) !== 'his-answer' || !ackOnly(line)) return null
|
|
38
37
|
return `« ${line.trim()} » acknowledges his answer, and a working line answers nothing: his answer would stay owed. Answer it: ${bin} thread reply ${ref} "<what you take from it, what you do>"; say working only for work you start now`
|
|
39
38
|
}
|
|
@@ -25,21 +25,7 @@ import { existsSync, lstatSync } from 'fs'
|
|
|
25
25
|
import { join } from 'path'
|
|
26
26
|
import { realGit, type GitIo } from '../core/git.ts'
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* layout wrote them (`.shipkit/*` covers the current ones): a bare name would
|
|
30
|
-
* also hide a repo's own `apps/<app>/status.md`, since a case blind disk reads
|
|
31
|
-
* it as `STATUS.md`. A glob is fine HERE: ignoring is not destructive. */
|
|
32
|
-
export const GENERATED_IGNORE_LINES = [
|
|
33
|
-
'# shipkit writes these on every run — ignored AND untracked (untrack-generated.ts)',
|
|
34
|
-
'/STATUS.md',
|
|
35
|
-
'/STATUS.md.lock',
|
|
36
|
-
'/.STATUS.md.tmp-*',
|
|
37
|
-
'/STATUS.full.md',
|
|
38
|
-
'/STATUS.full.md.lock',
|
|
39
|
-
'/.STATUS.full.md.tmp-*',
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
/** the LITERAL subset an autofix may remove from the index. Never a glob and
|
|
28
|
+
/** the paths an autofix may remove from the index, ignored by the SK004 block's `.shipkit/*`. Never a glob and
|
|
43
29
|
* never derived from a pattern: `git rm --cached` driven by a wildcard is how
|
|
44
30
|
* a fixer eats source it was never pointed at. A future entry is added HERE,
|
|
45
31
|
* by hand, spelled out. */
|
package/src/secrets/copy.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// secrets copied to another Mac over ssh: each read through the lib's one read and written by the peer's own
|
|
2
2
|
// `sk secret set`, from the house checkout at the same place under its home. A value only ever travels on ssh's
|
|
3
3
|
// stdin: never an argv, a file or a printed line. A secret the peer already answers is left as it is.
|
|
4
|
+
import { peerSk, shq } from '../core/peer-sk.ts'
|
|
4
5
|
|
|
5
6
|
export type Copied = { name: string; did: 'copied' | 'there' | 'not here' | 'failed'; why?: string }
|
|
6
7
|
|
|
@@ -18,11 +19,10 @@ const spawnRun: Run = async (argv, stdin) => {
|
|
|
18
19
|
return { code: await p.exited, out, err }
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
const q = (s: string): string => `'${s.replaceAll("'", `'\\''`)}'`
|
|
22
|
+
const q = shq
|
|
23
23
|
|
|
24
|
-
/** the line the peer's shell runs
|
|
25
|
-
export const peerLine = (houseRel: string, args: string): string =>
|
|
24
|
+
/** the line the peer's shell runs for `sk secret <args>` */
|
|
25
|
+
export const peerLine = (houseRel: string, args: string): string => peerSk(houseRel, `secret ${args}`)
|
|
26
26
|
|
|
27
27
|
/** the unlock a locked peer needs, said once */
|
|
28
28
|
export const unlockHint = (to: string): string => `the login keychain of ${to} is locked to ssh, and an unlock holds for its own ssh session only: run \`sk secret copy --to ${to} --unlock\` from your terminal (it asks for that Mac's login password once)`
|
package/src/secrets/lapse.ts
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
import { basename } from 'path'
|
|
7
7
|
import { askAddress, createAsk, listAsks, reopenAsk } from '../asks/ask-store.ts'
|
|
8
8
|
import { readAll, storeDir } from '../review/store.ts'
|
|
9
|
-
import { membersOf
|
|
9
|
+
import { membersOf } from '../review/threads.ts'
|
|
10
10
|
import { lapsesOf, neededLine, type Lapses } from './lapse-mark.ts'
|
|
11
11
|
import { houseRowOf, type SecretsWhere } from './manager.ts'
|
|
12
|
+
import { orderedThreads } from '../review/thread-state.ts'
|
|
12
13
|
|
|
13
14
|
/** the house registry's lapse mark of a name, or null */
|
|
14
15
|
export const lapsesIn = (w: Pick<SecretsWhere, 'house'>, name: string): Lapses | null => houseRowOf(w, name)?.lapses ?? null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// the advisors
|
|
2
|
-
// list and thread components, over the
|
|
3
|
-
//
|
|
1
|
+
// the advisors page's app (wiki tools/shipkit/advisors.md, The advisor's app): the owner's own review page, the same
|
|
2
|
+
// list and thread components, over the few review api paths the users' port serves. Built by advisors/app.ts, served
|
|
3
|
+
// by the users' port
|
|
4
4
|
// the one constraint a reader breaks first: it imports the review page and its host only (tests/advisor-app.test.ts)
|
|
5
5
|
import { autorun, observable, reaction, runInAction } from 'mobx'
|
|
6
6
|
import { observer } from 'mobx-react-lite'
|
|
@@ -33,7 +33,7 @@ document.addEventListener('visibilitychange', () => {
|
|
|
33
33
|
}
|
|
34
34
|
})
|
|
35
35
|
window.addEventListener('pagehide', () => here.hide())
|
|
36
|
-
// a newer page
|
|
36
|
+
// a newer page on the users' port: reloaded at once when nothing is typed, else the line over the list says « reload »
|
|
37
37
|
const typed = (): boolean => [...document.querySelectorAll<HTMLTextAreaElement | HTMLInputElement>('textarea, input:not([type]), input[type="text"]')].some((e) => e.value.trim() !== '')
|
|
38
38
|
reaction(() => host.stale, (on) => on && !typed() && location.reload())
|
|
39
39
|
window.addEventListener('pageshow', () => document.visibilityState === 'visible' && here.show())
|
|
@@ -16,11 +16,17 @@ export const OWNER_HUE = 322
|
|
|
16
16
|
/** how near the owner's hue a person's may fall before it turns away from it */
|
|
17
17
|
const OWNER_NEAR = 50
|
|
18
18
|
|
|
19
|
-
/**
|
|
19
|
+
/** the agents' hue: their mark's (hub.css `--agent`), the same for every lane */
|
|
20
|
+
export const AGENT_HUE = 14
|
|
21
|
+
|
|
22
|
+
/** how far a hue lies from another on the wheel, 0 to 180 */
|
|
23
|
+
const apart = (a: number, b: number): number => Math.abs(((a - b + 540) % 360) - 180)
|
|
24
|
+
|
|
25
|
+
/** a person's hue: from their name, one name always one hue, turned off the owner's and the agents' so a person never
|
|
26
|
+
* reads as either */
|
|
20
27
|
export function faceHue(name: string): number {
|
|
21
28
|
const h = laneHue(name.trim().toLowerCase())
|
|
22
|
-
|
|
23
|
-
return d < OWNER_NEAR ? (h + 150) % 360 : h
|
|
29
|
+
return apart(h, OWNER_HUE) < OWNER_NEAR || apart(h, AGENT_HUE) < OWNER_NEAR ? (h + 180) % 360 : h
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
/** the disc's colour, and their words' in a thread: the person's own, never the owner's */
|