rvlib-shipkit 2.12.0 → 2.14.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 +75 -21
- package/README.md +1 -1
- package/package.json +4 -2
- package/src/agent-time/store.ts +2 -2
- package/src/assets/run-assets.ts +2 -2
- package/src/assets/server/studio-server.ts +27 -23
- package/src/check.ts +4 -4
- package/src/checks/SK001-package-json-shape.check.ts +8 -4
- package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
- package/src/checks/SK003-claude-md-shape.check.ts +20 -13
- package/src/checks/SK004-gitignore-policy.check.ts +45 -6
- package/src/checks/SK005-rvlib-versions.check.ts +2 -2
- package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
- package/src/checks/SK007-github-visibility.check.ts +2 -2
- package/src/checks/SK008-reviewer-agent.check.ts +3 -3
- package/src/checks/SK010-undeclared-unit.check.ts +2 -2
- package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
- package/src/checks/SK012-config-barrel-import.check.ts +2 -2
- package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
- package/src/checks/SK015-nested-repo.check.ts +3 -3
- package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
- package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
- package/src/checks/SK018-test-files-run.check.ts +2 -2
- package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
- package/src/checks/SK020-self-spawning-check.check.ts +2 -2
- package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
- package/src/checks/SK024-identity-colors.check.ts +1 -1
- package/src/checks/SK025-release-drift.check.ts +2 -2
- package/src/checks/SK026-asks-autoclose.check.ts +2 -2
- package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
- package/src/checks/SK028-readme.check.ts +2 -2
- package/src/checks/SK029-explicit-check-files.check.ts +3 -3
- package/src/checks/SK030-cache-audit.check.ts +7 -5
- package/src/checks/SK031-trace-audit.check.ts +7 -7
- package/src/checks/SK032-ignored-inputs.check.ts +3 -3
- package/src/checks/SK033-global-contribution.check.ts +11 -4
- package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
- package/src/checks/SK035-public-clean.check.ts +46 -0
- package/src/checks/SK036-draft-media-size.check.ts +28 -0
- package/src/checks/SK037-keyword-additions.check.ts +43 -0
- package/src/cli/cmd_Backup.ts +152 -0
- package/src/cli/cmd_Ci.ts +8 -11
- package/src/cli/cmd_Commands.ts +4 -4
- package/src/cli/cmd_ConfigKeys.ts +2 -2
- package/src/cli/cmd_Drill.ts +145 -0
- package/src/cli/cmd_Home.ts +50 -3
- package/src/cli/cmd_Init.ts +1 -1
- package/src/cli/cmd_Media.ts +10 -8
- package/src/cli/cmd_Mv.ts +14 -7
- package/src/cli/cmd_Review.ts +6 -4
- package/src/cli/cmd_Shot.ts +5 -2
- package/src/cli/cmd_Smoke.ts +5 -2
- package/src/cli/cmd_Social.ts +226 -0
- package/src/cli/cmd_Sound.ts +1 -1
- package/src/cli/cmd_Start.ts +1 -1
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_TraceAudit.ts +6 -6
- package/src/cli/cmd_Trailer.ts +7 -4
- package/src/cli/cmd_Veille.ts +173 -0
- package/src/cli/cmd_When.ts +2 -2
- package/src/cli/family-pages.ts +19 -16
- package/src/cli/registry.ts +13 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +1 -49
- package/src/collections/checks.ts +2 -1
- package/src/collections/collection-types.ts +12 -3
- package/src/collections/providers.ts +4 -4
- package/src/collections/review.ts +3 -2
- package/src/collections/tests.ts +19 -8
- package/src/comfy/comfy-panel.ts +2 -2
- package/src/contracts/apply-contracts.ts +1 -3
- package/src/contracts/contract-manifests.ts +2 -3
- package/src/contracts/contract-types.ts +0 -1
- package/src/contracts/contracts-engine.ts +0 -3
- package/src/contracts/manifests/discord.contract.ts +1 -1
- package/src/contracts/manifests/identity.contract.ts +1 -1
- package/src/contracts/manifests/itch.contract.ts +1 -1
- package/src/contracts/manifests/steam.contract.ts +1 -1
- package/src/core/agent-dir-at.ts +12 -0
- package/src/core/agent-dir.ts +16 -0
- package/src/core/app-icon.ts +9 -3
- package/src/core/budget.ts +1 -1
- package/src/core/bun-builtins.ts +2 -2
- package/src/core/canonical-scripts.ts +2 -2
- package/src/core/discover-checks.ts +38 -6
- package/src/core/fix-scope.ts +4 -2
- package/src/core/floor-resolve.ts +68 -48
- package/src/core/floor.ts +9 -0
- package/src/core/git-root.ts +24 -0
- package/src/core/global-contribution.ts +4 -1
- package/src/core/ignored-block.ts +1 -1
- package/src/core/ignored-inputs.ts +3 -2
- package/src/core/last-good.ts +3 -1
- package/src/core/layout.ts +8 -0
- package/src/core/log-stamp.ts +36 -0
- package/src/core/loop-watch.ts +93 -0
- package/src/core/machine-link.ts +134 -0
- package/src/core/memory-watch.ts +41 -0
- package/src/core/motherhome.ts +2 -2
- package/src/core/one-way-in-policy.ts +34 -26
- package/src/core/run-ci.ts +9 -11
- package/src/core/run-fixers.ts +9 -9
- package/src/core/runs-matrix.ts +1 -1
- package/src/core/slots.ts +30 -0
- package/src/core/trace-audit.ts +50 -9
- package/src/core/tree-rev.ts +60 -0
- package/src/core/unit-files.ts +42 -0
- package/src/drill/render.ts +140 -0
- package/src/drill/run.ts +269 -0
- package/src/fleet/scan-fleet.ts +6 -5
- package/src/home/daemon-jobs.ts +201 -0
- package/src/home/global-context.ts +44 -8
- package/src/home/gui-app/ShipkitGui.swift +91 -2
- package/src/home/home-routes.ts +22 -15
- package/src/home/hubs.ts +10 -3
- package/src/home/inbox-shape.ts +54 -5
- package/src/home/inbox.ts +17 -2
- package/src/home/lib-watch.ts +10 -3
- package/src/home/machine-stores.ts +15 -29
- package/src/home/pm-config.ts +4 -1
- package/src/home/pm-inputs.ts +2 -0
- package/src/home/resources.ts +7 -2
- package/src/home/run-daemon.ts +15 -18
- package/src/home/run-pm.ts +3 -1
- package/src/home/serve-daemon.ts +4 -3
- package/src/home/serve-web.ts +104 -1
- package/src/hooks/commit-message.ts +29 -20
- package/src/hooks/hook-gates.ts +1 -1
- package/src/hooks/leak-guard.ts +69 -9
- package/src/hooks/run-hooks.ts +18 -22
- package/src/identities/identities.ts +334 -0
- package/src/identities/machine-route.ts +126 -0
- package/src/identities/machine.ts +62 -0
- package/src/init-repo.ts +3 -3
- package/src/ledger/check-stats.ts +10 -9
- package/src/ledger/gate-checks.ts +32 -1
- package/src/ledger/record-kept.ts +112 -0
- package/src/ledger/repo-view.ts +10 -0
- package/src/ledger/run-log.ts +17 -12
- package/src/ledger/run-timeline.ts +8 -4
- package/src/ledger/store.ts +7 -0
- package/src/ledger/suite-log.ts +17 -13
- package/src/media-kinds.ts +3 -2
- package/src/media-store/backup/daemon.ts +73 -0
- package/src/media-store/backup/keys.ts +25 -0
- package/src/media-store/backup/manifest.ts +193 -0
- package/src/media-store/backup/restore.ts +192 -0
- package/src/media-store/backup/run.ts +278 -0
- package/src/media-store/backup/secret.ts +86 -0
- package/src/media-store/backup/snapshot.ts +64 -0
- package/src/media-store/backup/sources.ts +199 -0
- package/src/media-store/content.ts +1 -1
- package/src/media-store/daemon.ts +56 -70
- package/src/media-store/db.ts +1 -1
- package/src/media-store/fact.ts +1 -1
- package/src/media-store/hand.ts +1 -1
- package/src/media-store/kind.ts +1 -1
- package/src/media-store/purge.ts +1 -1
- package/src/media-store/put.ts +5 -3
- package/src/media-store/remote.ts +1 -1
- package/src/media-store/space.ts +24 -5
- package/src/mv/mv-md.ts +63 -22
- package/src/pages/forward.ts +35 -0
- package/src/pages/frame-client.ts +118 -0
- package/src/pages/routes.ts +29 -0
- package/src/pages/unit.ts +92 -0
- package/src/plan/planner.ts +12 -0
- package/src/plan/repo-source.ts +19 -5
- package/src/reflect/transcript.ts +35 -10
- package/src/release/public-clean.ts +319 -0
- package/src/release/published-here.ts +22 -0
- package/src/release/run-bump.ts +3 -2
- package/src/release/run-release.ts +7 -4
- package/src/repo-config.ts +71 -13
- package/src/review/anim.ts +1 -1
- package/src/review/auto.ts +1 -1
- package/src/review/cells.ts +15 -1
- package/src/review/format.ts +2 -2
- package/src/review/http.ts +16 -2
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +1 -1
- package/src/review/media-read.ts +1 -1
- package/src/review/model.ts +27 -6
- package/src/review/notes.ts +125 -0
- package/src/review/previews.ts +1 -1
- package/src/review/project.ts +7 -39
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +18 -14
- package/src/review/store.ts +42 -2
- package/src/review/threads.ts +1 -1
- package/src/review/trailer-desk.ts +3 -3
- package/src/review/trailer-media.ts +8 -5
- package/src/review/trailer-model.ts +1 -1
- package/src/review/trailer-routes.ts +1 -1
- package/src/review/trailer-shots.ts +22 -5
- package/src/review/unit.ts +2 -2
- package/src/scaffold/files/agent-handoff.md +3 -0
- package/src/scaffold/files/agent-index.md +4 -12
- package/src/scaffold/files/tsconfig.json +1 -1
- package/src/scaffold/project-scaffold.ts +6 -5
- package/src/serve/embed.ts +2 -2
- package/src/serve/hub-app/check-words.ts +1 -1
- package/src/serve/hub-app/col-card.tsx +3 -17
- package/src/serve/hub-app/col-tables-view.tsx +2 -1
- package/src/serve/hub-app/cols-svc.ts +0 -13
- package/src/serve/hub-app/dock-st.ts +4 -2
- package/src/serve/hub-app/dock-view.tsx +2 -0
- package/src/serve/hub-app/frames-st.ts +35 -0
- package/src/serve/hub-app/hash-route.ts +64 -1
- package/src/serve/hub-app/home-st.ts +32 -8
- package/src/serve/hub-app/home-strip.css +9 -1
- package/src/serve/hub-app/home-strip.tsx +7 -6
- package/src/serve/hub-app/home.html +5 -0
- package/src/serve/hub-app/hub-app.tsx +51 -7
- package/src/serve/hub-app/hub.css +29 -11
- package/src/serve/hub-app/icons.tsx +16 -1
- package/src/serve/hub-app/identities-st.ts +210 -0
- package/src/serve/hub-app/identities-view.tsx +353 -0
- package/src/serve/hub-app/identities.css +48 -0
- package/src/serve/hub-app/identity-address.ts +52 -0
- package/src/serve/hub-app/inbox-st.ts +60 -7
- package/src/serve/hub-app/inbox-view.tsx +49 -7
- package/src/serve/hub-app/inbox.css +12 -1
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/kept-cols.tsx +30 -0
- package/src/serve/hub-app/keys.ts +10 -2
- package/src/serve/hub-app/list-walk.ts +89 -0
- package/src/serve/hub-app/machine-st.ts +12 -0
- package/src/serve/hub-app/media-svc.ts +1 -1
- package/src/serve/hub-app/media-view.tsx +2 -1
- package/src/serve/hub-app/pages-frames.tsx +134 -0
- package/src/serve/hub-app/pages-svc.ts +111 -0
- package/src/serve/hub-app/palette-st.ts +18 -3
- package/src/serve/hub-app/palette-view.tsx +9 -2
- package/src/serve/hub-app/planned-view.tsx +2 -1
- package/src/serve/hub-app/project-list.css +18 -14
- package/src/serve/hub-app/project-list.tsx +88 -49
- package/src/serve/hub-app/projects-svc.ts +33 -3
- package/src/serve/hub-app/repo-sections.ts +19 -2
- package/src/serve/hub-app/repo-st.ts +76 -20
- package/src/serve/hub-app/review/review-board.tsx +1 -1
- package/src/serve/hub-app/review/review-cells.tsx +6 -5
- package/src/serve/hub-app/review/review-kit.ts +30 -7
- package/src/serve/hub-app/review/review-page.tsx +6 -5
- package/src/serve/hub-app/review/review-st.ts +34 -15
- package/src/serve/hub-app/review/review-thread.tsx +63 -14
- package/src/serve/hub-app/review/review-views.tsx +133 -51
- package/src/serve/hub-app/review/thread-st.ts +80 -37
- package/src/serve/hub-app/review/trailer-page.tsx +7 -5
- package/src/serve/hub-app/review/trailer-st.ts +1 -1
- package/src/serve/hub-app/review.css +26 -9
- package/src/serve/hub-app/site/site-part.tsx +173 -0
- package/src/serve/hub-app/site/site-st.ts +157 -0
- package/src/serve/hub-app/site.css +35 -0
- package/src/serve/hub-app/social/calendar.tsx +182 -0
- package/src/serve/hub-app/social/comms-page.tsx +330 -0
- package/src/serve/hub-app/social/kit.tsx +244 -0
- package/src/serve/hub-app/social/post-card.tsx +456 -0
- package/src/serve/hub-app/social/problems.tsx +60 -0
- package/src/serve/hub-app/social/social-model.ts +154 -0
- package/src/serve/hub-app/social/social-page.tsx +681 -0
- package/src/serve/hub-app/social/social-st.ts +1014 -0
- package/src/serve/hub-app/social.css +289 -0
- package/src/serve/hub-app/stores/stores-page.tsx +312 -0
- package/src/serve/hub-app/stores/stores-st.ts +286 -0
- package/src/serve/hub-app/stores.css +54 -0
- package/src/serve/hub-app/timeline-geometry.ts +1 -1
- package/src/serve/hub-app/timeline-view.tsx +3 -2
- package/src/serve/hub-app/tree-build.ts +6 -0
- package/src/serve/hub-app/tree-row.tsx +27 -4
- package/src/serve/hub-app/tree-svc.ts +18 -49
- package/src/serve/hub-app/veille/veille-page.tsx +515 -0
- package/src/serve/hub-app/veille/veille-st.ts +443 -0
- package/src/serve/hub-app/veille.css +84 -0
- package/src/serve/hub-runtime.ts +20 -11
- package/src/serve/project-gutter-route.ts +44 -12
- package/src/serve/run-lanes.ts +7 -4
- package/src/serve/same-origin.ts +1 -1
- package/src/serve/serve-hub.ts +20 -12
- package/src/serve/tracked-watch.ts +24 -3
- package/src/serve/warm-cell.ts +5 -1
- package/src/shipkit-files.ts +15 -4
- package/src/shipkit.ts +0 -1
- package/src/shot/box.ts +160 -0
- package/src/shot/browser-slot.ts +74 -0
- package/src/shot/client.ts +42 -7
- package/src/shot/clip-encoder.ts +108 -24
- package/src/shot/film-box.ts +292 -0
- package/src/shot/shooter.ts +71 -17
- package/src/shot/shot-ask.ts +10 -2
- package/src/shot/stepped-clip.ts +5 -4
- package/src/site/desk.ts +242 -0
- package/src/site/routes.ts +66 -0
- package/src/site/unit.ts +62 -0
- package/src/social/brands.ts +22 -0
- package/src/social/card-drafts.ts +24 -0
- package/src/social/compose.ts +97 -0
- package/src/social/desk-index.ts +123 -0
- package/src/social/desk-wire.ts +64 -0
- package/src/social/drafts.ts +183 -0
- package/src/social/house.ts +24 -0
- package/src/social/load.ts +332 -0
- package/src/social/md.ts +70 -0
- package/src/social/media-facts.ts +53 -0
- package/src/social/media-kind.ts +189 -0
- package/src/social/media-limit.ts +42 -0
- package/src/social/media-of.ts +30 -0
- package/src/social/migrate.ts +123 -0
- package/src/social/open.ts +17 -0
- package/src/social/post-url.ts +158 -0
- package/src/social/presence.ts +332 -0
- package/src/social/public-read.ts +53 -0
- package/src/social/publish/bluesky.ts +168 -0
- package/src/social/publish/discord.ts +76 -0
- package/src/social/publish/index.ts +24 -0
- package/src/social/publish/secret.ts +13 -0
- package/src/social/push.ts +37 -0
- package/src/social/richtext.ts +37 -0
- package/src/social/routes.ts +186 -0
- package/src/social/stats.ts +134 -0
- package/src/social/text.ts +267 -0
- package/src/social/tracker-route.ts +39 -0
- package/src/social/tracker.ts +255 -0
- package/src/social/unit.ts +53 -0
- package/src/social/writes.ts +130 -0
- package/src/start-repo.ts +14 -9
- package/src/stores/collection.ts +27 -0
- package/src/stores/desk.ts +336 -0
- package/src/stores/model.ts +187 -0
- package/src/stores/routes.ts +126 -0
- package/src/stores/unit.ts +57 -0
- package/src/suite/calibrate.ts +127 -0
- package/src/suite/core-counters.ts +91 -0
- package/src/suite/judge-suites.ts +95 -35
- package/src/suite/suite-cli.ts +44 -10
- package/src/suite/suite-cpu-preload.ts +34 -9
- package/src/trace/tracer.ts +12 -5
- package/src/trailer/adapter.ts +5 -1
- package/src/trailer/build.ts +45 -12
- package/src/trailer/ffmpeg.ts +11 -0
- package/src/trailer/footage.ts +30 -13
- package/src/trailer/grammar.ts +18 -2
- package/src/trailer/graph.ts +28 -6
- package/src/trailer/holes.ts +1 -1
- package/src/trailer/passage.ts +18 -6
- package/src/trailer/plan.ts +74 -3
- package/src/trailer/prune.ts +1 -1
- package/src/trailer/states.ts +1 -1
- package/src/trailer/stitch.ts +67 -26
- package/src/trailer/url.ts +1 -1
- package/src/trailer/versions.ts +24 -0
- package/src/trailer/words.ts +1 -1
- package/src/ts/gate-typecheck.ts +32 -0
- package/src/ts/typecheck-cli.ts +9 -11
- package/src/tui/run-tui.ts +1 -1
- package/src/tui/tui-app.tsx +0 -1
- package/src/tui/tui-store.ts +1 -1
- package/src/veille/asks.ts +155 -0
- package/src/veille/auto.ts +31 -0
- package/src/veille/batch.ts +27 -0
- package/src/veille/chrome.ts +127 -0
- package/src/veille/collection.ts +28 -0
- package/src/veille/desk.ts +242 -0
- package/src/veille/identity.ts +80 -0
- package/src/veille/import.ts +68 -0
- package/src/veille/log.ts +183 -0
- package/src/veille/platforms.ts +118 -0
- package/src/veille/reads.ts +66 -0
- package/src/veille/replied.ts +110 -0
- package/src/veille/routes.ts +185 -0
- package/src/veille/service.ts +81 -0
- package/src/veille/watch.ts +116 -0
- package/src/veille/worth.ts +46 -0
- package/src/wiki/scan-md.ts +18 -0
- package/src/collections/posts.ts +0 -142
- package/src/contracts/manifests/social.contract.ts +0 -20
- package/src/scaffold/files/agent-coding.md +0 -35
- package/src/ts/typecheck-cache.ts +0 -11
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// the trailer renders as a kind of the media store (wiki
|
|
1
|
+
// the trailer renders as a kind of the media store (wiki tools/trailer/index.md, Renders in the media store): each settled
|
|
2
2
|
// render's clone in the view folder and a kept version's own files, by the facts its view record keeps, and the shots
|
|
3
3
|
// folders (trailer-shots.ts). Kept on the
|
|
4
4
|
// disk: the newest render of each live cut, the render an open frame note was written on, and any render seen in the
|
|
5
|
-
// window. A file goes only when its own bytes hash to the key.
|
|
5
|
+
// window. A file goes only when its own bytes hash to the key. A trailer's `voice/` clips go up and stay on the disk:
|
|
6
|
+
// they are its source. The takes and footage cache is never this kind's
|
|
6
7
|
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'
|
|
7
8
|
import { basename, dirname, join, relative } from 'node:path'
|
|
8
9
|
import { factOf, shaOf, shaOfKey } from '../media-store/content.ts'
|
|
@@ -13,7 +14,7 @@ import { isFrame } from './model.ts'
|
|
|
13
14
|
import { readAllCached, storeDir } from './store.ts'
|
|
14
15
|
import { cutOf, cutsOf, pngSize, stripOf, TRAILER_KIND, trailerDir, trailerIds, trailerKey, trailerStamp, videoOf, VIEW_ITEM, viewDir, viewOf, writeView, type View } from './trailer-desk.ts'
|
|
15
16
|
import { noteOf } from './trailer-model.ts'
|
|
16
|
-
import { newestShelves, shotFolders, shotRows } from './trailer-shots.ts'
|
|
17
|
+
import { newestShelves, shotFolders, shotRows, voiceFolders } from './trailer-shots.ts'
|
|
17
18
|
|
|
18
19
|
/** a view record's name, `<trailer>--<cut>--<mtime>` */
|
|
19
20
|
const BASE_RE = /^(.+?)--(.+)--(\d+)$/
|
|
@@ -53,7 +54,7 @@ async function sameAs(root: string, file: string, f: MediaFact): Promise<string
|
|
|
53
54
|
export const trailerMedia: MediaKind = {
|
|
54
55
|
kind: TRAILER_KIND,
|
|
55
56
|
storeOf: (root) => (existsSync(join(root, 'trailer')) ? root : null),
|
|
56
|
-
stamp: (root) => `${trailerStamp(root)}#${existsSync(viewDir(root)) ? readdirSync(viewDir(root)).length : 0}#shots:${shotFolders(root).map((f) => `${f.item}@${f.born}`).join(',')}`,
|
|
57
|
+
stamp: (root) => `${trailerStamp(root)}#${existsSync(viewDir(root)) ? readdirSync(viewDir(root)).length : 0}#shots:${shotFolders(root).map((f) => `${f.item}@${f.born}`).join(',')}#voice:${voiceFolders(root).map((f) => `${f.item}@${f.born}`).join(',')}`,
|
|
57
58
|
async scan(root, o) {
|
|
58
59
|
// every settled render gets its record, whether or not the page was opened since
|
|
59
60
|
for (const id of trailerIds(root)) {
|
|
@@ -114,7 +115,7 @@ export const trailerMedia: MediaKind = {
|
|
|
114
115
|
if (media.from?.video) row(join(root, media.from.video), media.video)
|
|
115
116
|
if (media.from?.strip) row(join(root, media.from.strip), media.strip)
|
|
116
117
|
}
|
|
117
|
-
for (const f of shotFolders(root)) rows.push(...(await shotRows(root, f, take)))
|
|
118
|
+
for (const f of [...shotFolders(root), ...voiceFolders(root)]) rows.push(...(await shotRows(root, f, take)))
|
|
118
119
|
return { rows, filled, left }
|
|
119
120
|
},
|
|
120
121
|
async holds(root) {
|
|
@@ -142,6 +143,7 @@ export const trailerMedia: MediaKind = {
|
|
|
142
143
|
// a shots folder: the shelf of each trailer's newest build stays, any other goes once quiet, unless a note is open on its cut
|
|
143
144
|
const folders = new Map(shotFolders(root).map((f) => [f.item, f]))
|
|
144
145
|
const shelves = newestShelves([...folders.values()])
|
|
146
|
+
const voices = new Set(voiceFolders(root).map((f) => f.item))
|
|
145
147
|
const cutUse = (id: string, cut: string): { open: boolean; at: number } => {
|
|
146
148
|
let at = 0
|
|
147
149
|
let isOpen = false
|
|
@@ -150,6 +152,7 @@ export const trailerMedia: MediaKind = {
|
|
|
150
152
|
return { open: isOpen, at }
|
|
151
153
|
}
|
|
152
154
|
return (row) => {
|
|
155
|
+
if (voices.has(row.item)) return { pinned: true, used: undefined }
|
|
153
156
|
const f = folders.get(row.item)
|
|
154
157
|
if (f) {
|
|
155
158
|
const u = cutUse(f.trailer, f.cut)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// the trailer view's shapes (wiki
|
|
1
|
+
// the trailer view's shapes (wiki tools/trailer/index.md, Frame notes): what the hub answers about a repo's cuts, and a frame
|
|
2
2
|
// note as the view shows it, read from its item of the one store. Pure: the routes and the page share them
|
|
3
3
|
import { isFrame, isReply, partyOf, stateOf, type ReviewItem } from './model.ts'
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// the hub's trailer routes (wiki
|
|
1
|
+
// the hub's trailer routes (wiki tools/trailer/index.md, Frame notes): a repo's cuts with their timelines and notes, a kept
|
|
2
2
|
// render with byte ranges, and the owner's frame notes, each an item of the one review store. Paths are relative to the
|
|
3
3
|
// repo hub's base. null: not a path of these
|
|
4
4
|
import { existsSync, mkdtempSync, rmSync } from 'node:fs'
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
// the shots folders of the trailer kind (wiki
|
|
1
|
+
// the shots folders of the trailer kind (wiki tools/trailer/index.md, Renders in the media store): each build's shelf
|
|
2
2
|
// `out/<cut>-shots/` and each kept version's `versions/<v>/shots/`. Their facts sit in the folder's own `.media.json`,
|
|
3
|
-
// which a build's new shelf drops with the old files. The shelf of each trailer's newest build stays on the disk
|
|
3
|
+
// which a build's new shelf drops with the old files. The shelf of each trailer's newest build stays on the disk. A
|
|
4
|
+
// trailer's `voice/` folder is its source clips (paid, never rebuilt): up the same way, never purged
|
|
4
5
|
import { existsSync, readdirSync, renameSync, statSync, writeFileSync } from 'node:fs'
|
|
5
6
|
import { join, relative } from 'node:path'
|
|
6
7
|
import { factOf, mediaKey } from '../media-store/content.ts'
|
|
7
8
|
import type { MediaRow } from '../media-store/kind.ts'
|
|
8
9
|
import { fetchBack } from '../media-store/remote.ts'
|
|
9
10
|
import { SHOT_FACTS, shotFacts } from '../trailer/shelf.ts'
|
|
11
|
+
import { versionOf } from '../trailer/versions.ts'
|
|
10
12
|
import { TRAILER_KIND, trailerIds } from './trailer-desk.ts'
|
|
11
13
|
|
|
12
14
|
const SHELF_RE = /^(.+)-shots$/
|
|
@@ -35,18 +37,33 @@ export function shotFolders(root: string): ShotFolder[] {
|
|
|
35
37
|
const m = SHELF_RE.exec(f)
|
|
36
38
|
if (m) add(join(dir, 'out', f), m[1]!, false)
|
|
37
39
|
}
|
|
38
|
-
for (const v of existsSync(join(dir, 'versions')) ? readdirSync(join(dir, 'versions')) : []) if (
|
|
40
|
+
for (const v of existsSync(join(dir, 'versions')) ? readdirSync(join(dir, 'versions')) : []) if (versionOf(v) !== null) add(join(dir, 'versions', v, 'shots'), v, true)
|
|
39
41
|
}
|
|
40
42
|
return out
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
/**
|
|
45
|
+
/** each trailer's `voice/` folder, the clips a cut names (`voice file voice/<clip>`): its source, never a render */
|
|
46
|
+
export function voiceFolders(root: string): ShotFolder[] {
|
|
47
|
+
const out: ShotFolder[] = []
|
|
48
|
+
for (const id of trailerIds(root)) {
|
|
49
|
+
const path = join(root, 'trailer', id, 'voice')
|
|
50
|
+
const s = statSync(path, { throwIfNoEntry: false })
|
|
51
|
+
if (!s?.isDirectory()) continue
|
|
52
|
+
// a clip recorded again under its name moves no folder time: the newest file's does
|
|
53
|
+
const born = Math.max(s.mtimeMs, ...readdirSync(path).map((n) => statSync(join(path, n), { throwIfNoEntry: false })?.mtimeMs ?? 0))
|
|
54
|
+
out.push({ item: relative(root, path), trailer: id, cut: 'voice', version: false, born })
|
|
55
|
+
}
|
|
56
|
+
return out
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** a folder's rows (its own files, never a folder inside): its facts filled while `take()` allows, written back when
|
|
60
|
+
* they moved */
|
|
44
61
|
export async function shotRows(root: string, f: ShotFolder, take: () => boolean): Promise<MediaRow[]> {
|
|
45
62
|
const folder = join(root, f.item)
|
|
46
63
|
const facts = shotFacts(folder)
|
|
47
64
|
let moved = false
|
|
48
65
|
const rows: MediaRow[] = []
|
|
49
|
-
const names = new Set([...Object.keys(facts), ...readdirSync(folder).filter((
|
|
66
|
+
const names = new Set([...Object.keys(facts), ...readdirSync(folder, { withFileTypes: true }).filter((d) => d.isFile() && !d.name.startsWith('.')).map((d) => d.name)])
|
|
50
67
|
for (const name of [...names].sort()) {
|
|
51
68
|
const size = statSync(join(folder, name), { throwIfNoEntry: false })?.size
|
|
52
69
|
let fact = facts[name]
|
package/src/review/unit.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// a repo's parts of the one store (wiki
|
|
1
|
+
// a repo's parts of the one store (wiki tools/shipkit/review.md, A project's parts): its subject kinds, topics, sources,
|
|
2
2
|
// auto rules and the dispatcher switch, 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
|
|
@@ -11,7 +11,7 @@ export interface Fact {
|
|
|
11
11
|
value: string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/** a link the hub opens. `host`: a page of the tool that frames the hub (
|
|
14
|
+
/** a link the hub opens. `host`: a page of the tool that frames the hub (a project's admin), its url relative to it:
|
|
15
15
|
* in a frame it is posted to the host (`{ shipkit: 'open', url }`), alone it opens in a new tab */
|
|
16
16
|
export interface Link {
|
|
17
17
|
label: string
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Handoff: where the last session stopped
|
|
2
|
+
|
|
3
|
+
Read this FIRST, act on it, then delete what you acted on. A session that closes with work in flight writes it here, one `## YYYY-MM-DD` section per offload. A handoff with no dated section has nothing waiting. Nothing durable lives here: a rule goes to its page, a real-world act to `sk ask`.
|
|
@@ -7,19 +7,11 @@
|
|
|
7
7
|
- `bun run hub` → the repo toolbox at http://localhost:{{PORT}}
|
|
8
8
|
- `sk ci` → THE gate: run it to check your work, never the parts
|
|
9
9
|
|
|
10
|
-
This folder is the project's internal wiki and its SPEC. Update the page
|
|
11
|
-
BEFORE the change it describes.
|
|
10
|
+
This folder is the project's internal wiki and its SPEC. Update the page BEFORE the change it describes.
|
|
12
11
|
|
|
13
|
-
**Always loaded every session
|
|
12
|
+
**Always loaded every session**: the `@` lines here. A page that does not load lives in a topical folder whose own `index.md` lists it on one line, and that index gets its `@<folder>/index.md` line here.{{CLI_INCLUDE}}
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Read the matching page before touching a surface:
|
|
18
|
-
|
|
19
|
-
| read when touching… | page |
|
|
14
|
+
| read when… | page |
|
|
20
15
|
|---|---|
|
|
21
|
-
|
|
|
16
|
+
| a session starts: work offloaded at the last close, read FIRST | → agent/handoff.md |
|
|
22
17
|
| recent changes and why | → agent/changelog.md |{{CLI_ROW}}
|
|
23
|
-
|
|
24
|
-
Grow this table: a subsystem, a service, a runbook each earn their own page,
|
|
25
|
-
cross-linked from here.
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
// every file is a module even with no import/export (standalone scripts)
|
|
30
30
|
"moduleDetection": "force",
|
|
31
31
|
|
|
32
|
-
// the house TS standard is all five, always on (
|
|
32
|
+
// the house TS standard is all five, always on (patterns/rv-conventions):
|
|
33
33
|
// strict alone leaves dead locals and fallthrough bugs in the codebase
|
|
34
34
|
"strict": true,
|
|
35
35
|
"noUncheckedIndexedAccess": true,
|
|
@@ -38,15 +38,16 @@ export type ScaffoldOpts = {
|
|
|
38
38
|
projectCli?: boolean
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/** every dep the house toolchain needs
|
|
42
|
-
*
|
|
41
|
+
/** every dep the house toolchain needs. The type checker, the linter and
|
|
42
|
+
* the formatter are bun's own; typescript serves the editor and the gate's
|
|
43
|
+
* tsc fallback on a bun with no `bun check` */
|
|
43
44
|
export const TOOLCHAIN = ['typescript', '@types/bun'] as const
|
|
44
45
|
|
|
45
46
|
/** script bodies for a fresh repo whose only source dir is src/. A stack
|
|
46
47
|
* scaffold (vite, hono) adds dev/build on top. No `lint` or `fmt`: a script
|
|
47
48
|
* of either name would shadow `bun lint` and `bun fmt` */
|
|
48
49
|
const SCRIPTS: Record<string, string> = {
|
|
49
|
-
typecheck: '
|
|
50
|
+
typecheck: 'bun check',
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
/** repo-owned ignore lines, written OUTSIDE rule SK004's managed block so its
|
|
@@ -162,8 +163,8 @@ function writeHouseFiles(write: (rel: string, body: string) => void, vars: Recor
|
|
|
162
163
|
// agent/index.md (rule SK003) needs the file to exist, and a repo with no
|
|
163
164
|
// CLAUDE.md at all still gets a place for its docs to live
|
|
164
165
|
write('agent/index.md', template('agent-index.md', vars))
|
|
165
|
-
write('agent/coding.md', template('agent-coding.md', vars))
|
|
166
166
|
write('agent/changelog.md', template('agent-changelog.md', vars))
|
|
167
|
+
write('agent/handoff.md', template('agent-handoff.md', vars))
|
|
167
168
|
// gitignored by policy, so it never ships: it exists so an agent hitting
|
|
168
169
|
// friction with the toolchain finds the place to write it down
|
|
169
170
|
write('.shipkit/reflections/README.md', REFLECTIONS_README)
|
|
@@ -248,7 +249,7 @@ export function adoptCli(root: string, opts: { name: string; print?: (line: stri
|
|
|
248
249
|
const pkg = readPackage(root)
|
|
249
250
|
if (pkg == null) { p(`FAIL: no readable package.json in ${root} — the project CLI needs one`); return null }
|
|
250
251
|
const found = existingCli(pkg, cliFiles(root))
|
|
251
|
-
if (found != null) { p(`skip: ${opts.name} already has a CLI (${found}) — extend it; a project CLI beside a product's bin is wired by hand (
|
|
252
|
+
if (found != null) { p(`skip: ${opts.name} already has a CLI (${found}) — extend it; a project CLI beside a product's bin is wired by hand (guides/cli-tool/index.md)`); return null }
|
|
252
253
|
const lib = installedLib(root)
|
|
253
254
|
if (kitInstalled(lib) === false) { p(`skip: the installed rvlib-shipkit ${lib?.version ?? ''} predates the CLI kit — bun add -d rvlib-shipkit@latest once a release carries it, then re-run`); return null }
|
|
254
255
|
const written: string[] = []
|
package/src/serve/embed.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// a repo's review or trailer page alone, for another tool to frame (wiki
|
|
1
|
+
// a repo's review or trailer page alone, for another tool to frame (wiki tools/shipkit/review.md, The review page):
|
|
2
2
|
// `<base>/embed/?page=review` serves the same app bundled with RELATIVE asset paths, so the page and every request it
|
|
3
|
-
// makes work under any prefix a proxy puts in front of the hub (
|
|
3
|
+
// makes work under any prefix a proxy puts in front of the hub (a project's admin frames it under its own origin). The
|
|
4
4
|
// bundle is made once a process, in memory
|
|
5
5
|
import { join } from 'node:path'
|
|
6
6
|
|
|
@@ -106,7 +106,7 @@ export function repoPath(p: string, root: string): ShortPath {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/** a docs page: repo relative when it is in the repo, else relative to the
|
|
109
|
-
* wiki it belongs to (`
|
|
109
|
+
* wiki it belongs to (`patterns/rv-conventions/package-json.md`) */
|
|
110
110
|
export function docPath(p: string, root: string): ShortPath {
|
|
111
111
|
const outside = p.startsWith('/') || p.startsWith('~/')
|
|
112
112
|
const r = root.replace(/\/+$/, '')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Collection views: the item card (asks · creds
|
|
1
|
+
// Collection views: the item card (asks · creds), and the health/status card with the streaming
|
|
2
2
|
// check runner. Every verb posts to /api/act/* and lands in a git-tracked
|
|
3
3
|
// truth file; the truth chip names the file the item IS (on disagreement
|
|
4
4
|
// the file wins).
|
|
@@ -28,8 +28,6 @@ export const ColCard = observer(({ app, col, id }: { app: RepoSt; col: string; i
|
|
|
28
28
|
const i = c.find(col, id)
|
|
29
29
|
if (i == null) return <div className="ph">item vanished — the truth file moved on</div>
|
|
30
30
|
const askFile = col === 'asks' ? id.replace(/^ask:/, '') : null
|
|
31
|
-
const postM = col === 'posts' ? id.match(/^post:([^/]+)\/(.+?):(pick|topost|invalid|posted|rejected)$/) : null
|
|
32
|
-
const postFile = (i.file ?? '').split('/').pop() ?? ''
|
|
33
31
|
if (col === 'creds') {
|
|
34
32
|
// no remark box, no generic dump — a cred has no truth file; the
|
|
35
33
|
// copy block + steps only matter while it is MISSING
|
|
@@ -70,29 +68,17 @@ export const ColCard = observer(({ app, col, id }: { app: RepoSt; col: string; i
|
|
|
70
68
|
) : null}
|
|
71
69
|
{i.artifact?.url != null ? <div className="row"><a href={i.artifact.url} target="_blank" rel="noreferrer">mint ↗</a></div> : null}
|
|
72
70
|
{i.artifact?.steps != null ? <div className="row"><div>{i.artifact.steps.map((s, n) => <span key={n}>{n + 1}. {s}<br /></span>)}</div></div> : null}
|
|
73
|
-
{postM?.[3] === 'pick' && i.candidates != null ? i.candidates.map((cd) => (
|
|
74
|
-
<div className="cand" key={cd.id}>
|
|
75
|
-
<div className="row"><b>{cd.label}</b><button onClick={() => void c.postPick(postM[1]!, cd.id)}>pick</button></div>
|
|
76
|
-
<div className="candhint">{cd.hint ?? ''}</div>
|
|
77
|
-
</div>
|
|
78
|
-
)) : null}
|
|
79
|
-
{postM?.[3] === 'topost' ? (
|
|
80
|
-
<div className="row">
|
|
81
|
-
<input placeholder="posted URL = proof" value={c.proofDraft} onChange={(e) => runInAction(() => { c.proofDraft = e.target.value })} />
|
|
82
|
-
<button onClick={() => void c.postPosted(postM[1]!, postFile)}>posted ✓</button>
|
|
83
|
-
</div>
|
|
84
|
-
) : null}
|
|
85
71
|
{askFile != null && i.severity != null ? (
|
|
86
72
|
<div className="row">
|
|
87
73
|
<input placeholder="proof URL (optional)" value={c.proofDraft} onChange={(e) => runInAction(() => { c.proofDraft = e.target.value })} />
|
|
88
74
|
<button onClick={() => void c.askDone(askFile)}>done ✓</button>
|
|
89
75
|
</div>
|
|
90
76
|
) : null}
|
|
91
|
-
{askFile != null
|
|
77
|
+
{askFile != null ? (
|
|
92
78
|
<div className="row">
|
|
93
79
|
<input placeholder="remark → lands in the file, agents read it" value={c.remarkDraft}
|
|
94
80
|
onChange={(e) => runInAction(() => { c.remarkDraft = e.target.value })} />
|
|
95
|
-
<button className="ghost" onClick={() => void c.remark(
|
|
81
|
+
<button className="ghost" onClick={() => void c.remark({ kind: 'ask', file: askFile })}>remark</button>
|
|
96
82
|
</div>
|
|
97
83
|
) : null}
|
|
98
84
|
{c.actErr !== '' ? <div className="err">✗ {c.actErr}</div> : null}
|
|
@@ -15,6 +15,7 @@ import type { Resource } from './hub-types.ts'
|
|
|
15
15
|
import { sectionLabel } from './keys.ts'
|
|
16
16
|
import type { RepoSt } from './repo-st.ts'
|
|
17
17
|
import { TimeAgo } from './time-ago.tsx'
|
|
18
|
+
import { Caret } from './icons.tsx'
|
|
18
19
|
|
|
19
20
|
const emptyWords = (app: RepoSt): string => (app.filter === 'red' ? 'no reds here' : app.filter === 'needs' ? 'nothing here needs you' : app.query.trim() !== '' ? 'nothing matches the filter' : 'nothing here yet')
|
|
20
21
|
|
|
@@ -42,7 +43,7 @@ const Group = observer(<K extends string>({ app, col, g, span, row }: { app: Rep
|
|
|
42
43
|
return (
|
|
43
44
|
<tbody className="ctgroup">
|
|
44
45
|
<tr className={`ctgrp g-${g.key}`} data-k={g.key} onClick={() => app.cols.toggleGroup(key, g.foldedByDefault)}>
|
|
45
|
-
<td colSpan={span}><span className="ctcaret"
|
|
46
|
+
<td colSpan={span}><span className="ctcaret"><Caret open={!folded} /></span>{g.label}</td>
|
|
46
47
|
</tr>
|
|
47
48
|
{folded ? null : g.rows.map(row)}
|
|
48
49
|
</tbody>
|
|
@@ -263,19 +263,6 @@ export class ColsSvc {
|
|
|
263
263
|
const url = this.proofDraft.trim()
|
|
264
264
|
return url !== '' ? this.act('ask-proof', { file, url }) : this.act('ask-done', { file })
|
|
265
265
|
}
|
|
266
|
-
postPick(channel: string, file: string): Promise<boolean> {
|
|
267
|
-
return this.act('post-pick', { channel, file })
|
|
268
|
-
}
|
|
269
|
-
async postPosted(channel: string, file: string): Promise<boolean> {
|
|
270
|
-
const url = this.proofDraft.trim()
|
|
271
|
-
if (url === '') {
|
|
272
|
-
this.actErr = 'paste the posted URL first — the proof is the point'
|
|
273
|
-
return false
|
|
274
|
-
}
|
|
275
|
-
const ok = await this.act('post-posted', { channel, file, url })
|
|
276
|
-
if (ok) runInAction(() => { this.proofDraft = '' })
|
|
277
|
-
return ok
|
|
278
|
-
}
|
|
279
266
|
async remark(body: Record<string, unknown>): Promise<void> {
|
|
280
267
|
const text = this.remarkDraft.trim()
|
|
281
268
|
if (text === '') return
|
|
@@ -97,7 +97,7 @@ export function lineWords(view: HouseView | null, now: number): string {
|
|
|
97
97
|
/** a pill of the dock's header: a word or two in a dim box, its hover the
|
|
98
98
|
* whole story. The last run adds its repo, its verdict and its age */
|
|
99
99
|
export type DockPill = {
|
|
100
|
-
key: 'state' | 'queued' |
|
|
100
|
+
key: 'state' | 'queued' | `held:${number}` | 'last' | 'settling' | 'window'
|
|
101
101
|
tone: 'dim' | 'accent' | 'warn'
|
|
102
102
|
text: string
|
|
103
103
|
title: string
|
|
@@ -139,10 +139,12 @@ export function dockPills(view: HouseView | null, now: number, size: DockSize):
|
|
|
139
139
|
: { key: 'state', tone: 'dim', text: 'idle', title: flight }]
|
|
140
140
|
if (queued > 0) out.push({ key: 'queued', tone: 'dim', text: `${queued} queued`, title: flight })
|
|
141
141
|
const settling: string[] = []
|
|
142
|
+
// a loaded machine holds several lines at once: each pill keyed by its place, never by its text, which ticks
|
|
143
|
+
let held = 0
|
|
142
144
|
for (const line of view.held ?? []) {
|
|
143
145
|
const m = line.match(SETTLING)
|
|
144
146
|
if (m != null) settling.push(`${m[1]} ${m[2]}`)
|
|
145
|
-
else out.push({ key:
|
|
147
|
+
else out.push({ key: `held:${held++}`, tone: 'warn', text: line.replace(/ on \d+ cores$/, ''), title: line })
|
|
146
148
|
}
|
|
147
149
|
if (last != null) {
|
|
148
150
|
const v = PILL_MARK[last.bar.status]
|
|
@@ -13,6 +13,7 @@ import { CycleButton } from './cycle-button.tsx'
|
|
|
13
13
|
import { DOCK_KEY } from './keys.ts'
|
|
14
14
|
import { DOCK_SIZES, SLIM_WINDOW_MS, windowWords, type DockPill } from './dock-st.ts'
|
|
15
15
|
import { PillRow } from './pill-row.tsx'
|
|
16
|
+
import { ListFoot } from './project-list.tsx'
|
|
16
17
|
import { TimelineChart } from './timeline-chart.tsx'
|
|
17
18
|
import type { PlacedGroup } from './timeline-geometry.ts'
|
|
18
19
|
|
|
@@ -91,6 +92,7 @@ export const Dock = observer(({ app }: { app: HomeSt }) => {
|
|
|
91
92
|
<CycleButton options={DOCK_SIZES} value={d.size} onChange={(s) => d.setSize(s)} shortcut={DOCK_KEY} title={DOCK_HELP} />
|
|
92
93
|
<PillRow items={d.pills.map((p) => ({ key: p.key, title: p.title, node: <PillFace app={app} p={p} /> }))} />
|
|
93
94
|
{d.error !== '' ? <span className="warnline">{d.error}</span> : null}
|
|
95
|
+
<ListFoot app={app} />
|
|
94
96
|
<CopyUrl />
|
|
95
97
|
</div>
|
|
96
98
|
{d.size === 'line' ? null : <div className="dbody">
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// the repo pages' frames kept alive (wiki tools/shipkit/project-pages.md, Kept frames): the last few opened, across
|
|
2
|
+
// repos, newest first. A switch back to one is a show, never a load; one past the cap unloads the oldest, and of the
|
|
3
|
+
// hidden ones one 3D page at most: its scene holds gigabytes while hidden. A node of the home (home-st.ts)
|
|
4
|
+
import { makeAutoObservable } from 'mobx'
|
|
5
|
+
|
|
6
|
+
export const PAGE_FRAMES_KEPT = 3
|
|
7
|
+
/** hidden 3D pages kept, the shown one aside */
|
|
8
|
+
export const PAGE_GL_HIDDEN = 1
|
|
9
|
+
|
|
10
|
+
export type FrameRef = { repo: string; id: string; gl?: true }
|
|
11
|
+
|
|
12
|
+
export class FrameCache {
|
|
13
|
+
/** newest first, at most PAGE_FRAMES_KEPT */
|
|
14
|
+
kept: FrameRef[] = []
|
|
15
|
+
|
|
16
|
+
constructor(private readonly cap = PAGE_FRAMES_KEPT) {
|
|
17
|
+
makeAutoObservable(this)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** this page opened: it is the newest; a hidden 3D page past PAGE_GL_HIDDEN goes, then the oldest past the cap */
|
|
21
|
+
touch(repo: string, id: string, gl = false): void {
|
|
22
|
+
let hiddenGl = 0
|
|
23
|
+
const rest = this.kept.filter((f) => (f.repo !== repo || f.id !== id) && (f.gl !== true || ++hiddenGl <= PAGE_GL_HIDDEN))
|
|
24
|
+
this.kept = [{ repo, id, ...(gl ? { gl: true as const } : {}) }, ...rest].slice(0, this.cap)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** a repo's kept frames in the order they stand in the page: by id, never by age, so a switch never moves one (a
|
|
28
|
+
* moved iframe loads again) */
|
|
29
|
+
of(repo: string): string[] {
|
|
30
|
+
return this.kept
|
|
31
|
+
.filter((f) => f.repo === repo)
|
|
32
|
+
.map((f) => f.id)
|
|
33
|
+
.sort()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -40,12 +40,23 @@ export type HashSel =
|
|
|
40
40
|
/** a trailer's cuts, played with their notes: a trailer folder and one of its cuts, null for the first; the note
|
|
41
41
|
* open on it, and the notes filter when it is not the page's default (all) */
|
|
42
42
|
| { t: 'trailer'; trailer: string | null; cut: string | null; note?: string | null; filter?: 'open' | 'all' | null }
|
|
43
|
+
/** the store pages: a store, null for the first; a thing of it to scroll to (a picture's path, `field:<heading>`) */
|
|
44
|
+
| { t: 'stores'; store: string | null; asset?: string | null }
|
|
45
|
+
/** the Veille: the post picked, null for none; the window, chips, folds and lightbox as `window=3d&tags=a,b` */
|
|
46
|
+
| { t: 'veille'; post: string | null; q?: string }
|
|
47
|
+
/** Communications: a draft, null for the first the list keeps, one message of its series; the list's view as
|
|
48
|
+
* `fam=feed&ch=x&order=old&who=me` */
|
|
49
|
+
| { t: 'comms'; draft: string | null; part?: string | null; q?: string }
|
|
50
|
+
/** Social: an identity, null for the repo's; its company (`@legal`) or an account, null for its card; a place */
|
|
51
|
+
| { t: 'social'; identity: string | null; account?: string | null; place?: string | null }
|
|
52
|
+
/** a repo's own page (wiki tools/shipkit/project-pages.md): the repo, the page, the page's own keys as a query */
|
|
53
|
+
| { t: 'page'; repo: string; id: string; q?: string }
|
|
43
54
|
|
|
44
55
|
/** whose a gate check is */
|
|
45
56
|
export type CheckOwner = 'shipkit' | 'repo'
|
|
46
57
|
|
|
47
58
|
export type ParsedHash = {
|
|
48
|
-
kind: 'asset' | 'cat' | 'col' | 'item' | 'status' | 'tests' | 'admin' | 'readme' | 'processes' | 'plan' | 'git' | 'when' | 'checks' | 'review' | 'trailer' | 'none'
|
|
59
|
+
kind: 'asset' | 'cat' | 'col' | 'item' | 'status' | 'tests' | 'admin' | 'readme' | 'processes' | 'plan' | 'git' | 'when' | 'checks' | 'review' | 'trailer' | 'stores' | 'veille' | 'comms' | 'social' | 'page' | 'none'
|
|
49
60
|
/** the collection, for an item. null for everything else */
|
|
50
61
|
col: string | null
|
|
51
62
|
id: string
|
|
@@ -74,6 +85,11 @@ const WHEN = 'page:when'
|
|
|
74
85
|
const CHECKS = 'page:checks:'
|
|
75
86
|
const REVIEW = 'page:review'
|
|
76
87
|
const TRAILER = 'page:trailer'
|
|
88
|
+
const STORES = 'page:stores'
|
|
89
|
+
const VEILLE = 'page:veille'
|
|
90
|
+
const COMMS = 'page:comms'
|
|
91
|
+
const SOCIAL = 'page:social'
|
|
92
|
+
const PROJECT_PAGE = /^page:([A-Za-z0-9._-]+)\/([a-z][a-z0-9-]*)(?:\?(.*))?$/
|
|
77
93
|
|
|
78
94
|
/** what this selection puts in the url. null only for no selection at all,
|
|
79
95
|
* and then the hash is left alone rather than wiped */
|
|
@@ -100,12 +116,25 @@ export function hashFor(sel: HashSel | null): string | null {
|
|
|
100
116
|
const note = sel.trailer != null && sel.note ? `/${sel.cut ?? ''}/${sel.note}` : sel.cut == null ? '' : `/${sel.cut}`
|
|
101
117
|
return `${sel.trailer == null ? TRAILER : `${TRAILER}:${sel.trailer}${note}`}${sel.filter ? `?filter=${sel.filter}` : ''}`
|
|
102
118
|
}
|
|
119
|
+
// page:stores:<store>/<asset>, the asset as it is: a path or a heading carries any character
|
|
120
|
+
case 'stores': return sel.store == null ? STORES : `${STORES}:${sel.store}${sel.asset ? `/${sel.asset}` : ''}`
|
|
121
|
+
// page:veille:<platform>:<id>?window=3d, the query only when it says something
|
|
122
|
+
case 'veille': return `${sel.post == null ? VEILLE : `${VEILLE}:${sel.post}`}${sel.q ? `?${sel.q}` : ''}`
|
|
123
|
+
// page:comms:<slug>/<part>?fam=feed, each part only when it says something
|
|
124
|
+
case 'comms': return `${sel.draft == null ? COMMS : `${COMMS}:${sel.draft}${sel.part ? `/${sel.part}` : ''}`}${sel.q ? `?${sel.q}` : ''}`
|
|
125
|
+
// page:social:<identity>/<account>/<place>
|
|
126
|
+
// page:<repo>/<page>?<keys>, the keys only when the page has any
|
|
127
|
+
case 'page': return `page:${sel.repo}/${sel.id}${sel.q ? `?${sel.q}` : ''}`
|
|
128
|
+
case 'social': return sel.identity == null ? SOCIAL : `${SOCIAL}:${[sel.identity, ...(sel.account ? [sel.account, ...(sel.place ? [sel.place] : [])] : [])].join('/')}`
|
|
103
129
|
}
|
|
104
130
|
}
|
|
105
131
|
|
|
106
132
|
export function parseHash(raw: string): ParsedHash {
|
|
107
133
|
const none: ParsedHash = { kind: 'none', col: null, id: '', tools: null }
|
|
108
134
|
if (raw === '') return none
|
|
135
|
+
// a repo's own page: no built-in page name holds a slash before its first colon; the repo rides in `col`
|
|
136
|
+
const own = PROJECT_PAGE.exec(raw)
|
|
137
|
+
if (own != null) return { kind: 'page', col: own[1]!, id: own[2]!, tools: null, ...(own[3] ? { q: own[3] } : {}) }
|
|
109
138
|
if (raw === STATUS) return { kind: 'status', col: null, id: '', tools: null }
|
|
110
139
|
if (raw === TESTS) return { kind: 'tests', col: null, id: '', tools: null }
|
|
111
140
|
if (raw === ADMIN) return { kind: 'admin', col: null, id: '', tools: null }
|
|
@@ -128,6 +157,32 @@ export function parseHash(raw: string): ParsedHash {
|
|
|
128
157
|
const f = qi === -1 ? null : new URLSearchParams(raw.slice(qi + 1)).get('filter')
|
|
129
158
|
return { kind: 'trailer', col: trailer === '' ? null : trailer, id: cut, tools: null, ...(note ? { note } : {}), ...(f === 'open' || f === 'all' ? { filter: f } : {}) }
|
|
130
159
|
}
|
|
160
|
+
// the store rides in `col`, the thing named in `id`: everything after the first slash
|
|
161
|
+
if (raw === STORES || raw.startsWith(`${STORES}:`)) {
|
|
162
|
+
const rest = raw.slice(STORES.length + 1)
|
|
163
|
+
const cut = rest.indexOf('/')
|
|
164
|
+
const store = cut === -1 ? rest : rest.slice(0, cut)
|
|
165
|
+
return { kind: 'stores', col: store === '' ? null : store, id: cut === -1 ? '' : rest.slice(cut + 1), tools: null }
|
|
166
|
+
}
|
|
167
|
+
if (raw === VEILLE || raw.startsWith(`${VEILLE}:`) || raw.startsWith(`${VEILLE}?`)) {
|
|
168
|
+
const qi = raw.indexOf('?')
|
|
169
|
+
const path = qi === -1 ? raw : raw.slice(0, qi)
|
|
170
|
+
const q = qi === -1 ? '' : raw.slice(qi + 1)
|
|
171
|
+
return { kind: 'veille', col: null, id: path.slice(VEILLE.length + 1), tools: null, ...(q ? { q } : {}) }
|
|
172
|
+
}
|
|
173
|
+
// the draft rides in `col`, its part in `id`
|
|
174
|
+
if (raw === COMMS || raw.startsWith(`${COMMS}:`) || raw.startsWith(`${COMMS}?`)) {
|
|
175
|
+
const qi = raw.indexOf('?')
|
|
176
|
+
const path = qi === -1 ? raw : raw.slice(0, qi)
|
|
177
|
+
const q = qi === -1 ? '' : raw.slice(qi + 1)
|
|
178
|
+
const [draft = '', part = ''] = path.slice(COMMS.length + 1).split('/')
|
|
179
|
+
return { kind: 'comms', col: draft === '' ? null : draft, id: part, tools: null, ...(q ? { q } : {}) }
|
|
180
|
+
}
|
|
181
|
+
// the identity rides in `col`, `<account>/<place>` in `id`
|
|
182
|
+
if (raw === SOCIAL || raw.startsWith(`${SOCIAL}:`)) {
|
|
183
|
+
const [identity = '', ...rest] = raw.slice(SOCIAL.length + 1).split('/')
|
|
184
|
+
return { kind: 'social', col: identity === '' ? null : identity, id: rest.join('/'), tools: null }
|
|
185
|
+
}
|
|
131
186
|
if (raw === `${CHECKS}shipkit` || raw === `${CHECKS}repo`) return { kind: 'checks', col: null, id: raw.slice(CHECKS.length), tools: null }
|
|
132
187
|
if (raw.startsWith(`${PROCESSES}:`)) {
|
|
133
188
|
const id = raw.slice(PROCESSES.length + 1)
|
|
@@ -183,6 +238,14 @@ export function selOf(p: ParsedHash): HashSel | null {
|
|
|
183
238
|
case 'checks': return { t: 'checks', from: p.id as CheckOwner }
|
|
184
239
|
case 'review': return { t: 'review', id: p.id === '' ? null : p.id, ...(p.q ? { q: p.q } : {}) }
|
|
185
240
|
case 'trailer': return { t: 'trailer', trailer: p.col, cut: p.id === '' ? null : p.id, ...(p.note ? { note: p.note } : {}), ...(p.filter ? { filter: p.filter } : {}) }
|
|
241
|
+
case 'stores': return { t: 'stores', store: p.col, ...(p.id ? { asset: p.id } : {}) }
|
|
242
|
+
case 'veille': return { t: 'veille', post: p.id === '' ? null : p.id, ...(p.q ? { q: p.q } : {}) }
|
|
243
|
+
case 'comms': return { t: 'comms', draft: p.col, ...(p.id ? { part: p.id } : {}), ...(p.q ? { q: p.q } : {}) }
|
|
244
|
+
case 'page': return { t: 'page', repo: p.col!, id: p.id, ...(p.q ? { q: p.q } : {}) }
|
|
245
|
+
case 'social': {
|
|
246
|
+
const [account = '', place = ''] = p.id.split('/')
|
|
247
|
+
return { t: 'social', identity: p.col, ...(account ? { account } : {}), ...(account && place ? { place } : {}) }
|
|
248
|
+
}
|
|
186
249
|
}
|
|
187
250
|
}
|
|
188
251
|
|