rvlib-shipkit 2.11.0 → 2.13.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 +56 -12
- package/README.md +1 -1
- package/package.json +4 -2
- package/src/agent-time/store.ts +2 -2
- package/src/check.ts +1 -1
- package/src/checks/SK001-package-json-shape.check.ts +4 -0
- package/src/checks/SK003-claude-md-shape.check.ts +1 -1
- package/src/checks/SK004-gitignore-policy.check.ts +27 -2
- package/src/checks/SK005-rvlib-versions.check.ts +1 -1
- package/src/checks/SK008-reviewer-agent.check.ts +2 -2
- package/src/checks/SK012-config-barrel-import.check.ts +1 -1
- package/src/checks/SK015-nested-repo.check.ts +1 -1
- package/src/checks/SK035-public-clean.check.ts +46 -0
- package/src/checks/SK036-draft-media-size.check.ts +28 -0
- package/src/cli/cmd_Backup.ts +152 -0
- package/src/cli/cmd_Ci.ts +8 -11
- package/src/cli/cmd_Drill.ts +145 -0
- package/src/cli/cmd_Home.ts +50 -3
- package/src/cli/cmd_Media.ts +96 -5
- package/src/cli/cmd_Review.ts +8 -2
- package/src/cli/cmd_Shot.ts +5 -2
- package/src/cli/cmd_Smoke.ts +4 -1
- package/src/cli/cmd_Social.ts +226 -0
- package/src/cli/cmd_Start.ts +1 -1
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_Trailer.ts +9 -2
- package/src/cli/cmd_Veille.ts +173 -0
- package/src/cli/family-pages.ts +3 -0
- 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 +11 -2
- package/src/collections/providers.ts +4 -4
- package/src/collections/review.ts +2 -1
- package/src/collections/tests.ts +19 -8
- 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/core/app-icon.ts +9 -3
- package/src/core/bun-builtins.ts +2 -2
- package/src/core/discover-checks.ts +37 -5
- 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/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/one-way-in-policy.ts +27 -19
- package/src/core/run-ci.ts +6 -8
- package/src/core/run-fixers.ts +9 -9
- package/src/core/slots.ts +21 -0
- 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 +34 -1
- package/src/home/home-routes.ts +22 -15
- package/src/home/hubs.ts +10 -3
- package/src/home/inbox-shape.ts +61 -6
- package/src/home/inbox.ts +75 -4
- package/src/home/lib-watch.ts +10 -3
- package/src/home/machine-stores.ts +15 -29
- package/src/home/run-daemon.ts +15 -18
- package/src/home/run-pm.ts +2 -0
- package/src/home/serve-daemon.ts +4 -3
- package/src/home/serve-web.ts +110 -1
- package/src/hooks/commit-message.ts +28 -19
- package/src/hooks/leak-guard.ts +10 -3
- package/src/hooks/run-hooks.ts +2 -6
- 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 +1 -1
- 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 +9 -1
- 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 +11 -1
- package/src/media-store/daemon.ts +56 -70
- package/src/media-store/hand.ts +58 -0
- package/src/media-store/put.ts +122 -0
- package/src/media-store/space.ts +73 -11
- 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 +301 -0
- package/src/release/published-here.ts +22 -0
- package/src/release/run-bump.ts +2 -1
- package/src/release/run-release.ts +4 -1
- package/src/repo-config.ts +53 -2
- package/src/review/http.ts +16 -2
- package/src/review/media-kind.ts +3 -3
- package/src/review/media-read.ts +3 -3
- package/src/review/model.ts +24 -5
- package/src/review/notes.ts +77 -0
- package/src/review/project.ts +6 -38
- package/src/review/routes.ts +8 -13
- package/src/review/store.ts +46 -4
- package/src/review/trailer-media.ts +24 -3
- package/src/review/trailer-shots.ts +106 -0
- package/src/review/unit.ts +1 -1
- package/src/scaffold/files/agent-handoff.md +3 -0
- package/src/scaffold/files/agent-index.md +4 -12
- package/src/scaffold/project-scaffold.ts +5 -4
- package/src/serve/embed.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 +12 -14
- 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 +31 -7
- 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 +49 -5
- 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 +352 -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 +59 -6
- package/src/serve/hub-app/inbox-view.tsx +48 -6
- package/src/serve/hub-app/inbox.css +12 -1
- package/src/serve/hub-app/index.html +3 -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-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 +75 -19
- package/src/serve/hub-app/review/review-cells.tsx +3 -3
- package/src/serve/hub-app/review/review-kit.ts +30 -7
- package/src/serve/hub-app/review/review-page.tsx +1 -1
- package/src/serve/hub-app/review/review-st.ts +33 -11
- package/src/serve/hub-app/review/review-thread.tsx +11 -9
- package/src/serve/hub-app/review/review-views.tsx +84 -19
- package/src/serve/hub-app/review/thread-st.ts +1 -10
- package/src/serve/hub-app/review/trailer-page.tsx +2 -1
- package/src/serve/hub-app/review.css +17 -8
- 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 +306 -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 +674 -0
- package/src/serve/hub-app/social/social-st.ts +986 -0
- package/src/serve/hub-app/social.css +289 -0
- package/src/serve/hub-app/stores/stores-page.tsx +311 -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/test-view.tsx +9 -2
- package/src/serve/hub-app/tests-svc.ts +16 -1
- 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 +514 -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 +14 -9
- package/src/serve/project-gutter-route.ts +44 -12
- package/src/serve/resources-wire.ts +48 -0
- package/src/serve/run-lanes.ts +7 -4
- package/src/serve/same-origin.ts +1 -1
- package/src/serve/serve-hub.ts +27 -18
- 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 +162 -0
- package/src/shot/browser-slot.ts +62 -0
- package/src/shot/client.ts +43 -7
- package/src/shot/clip-encoder.ts +93 -12
- package/src/shot/film-box.ts +188 -0
- package/src/shot/shooter.ts +50 -15
- 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/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 +319 -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 +31 -0
- package/src/social/richtext.ts +37 -0
- package/src/social/routes.ts +180 -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 +94 -34
- package/src/suite/suite-cli.ts +44 -10
- package/src/suite/suite-cpu-preload.ts +34 -9
- package/src/trailer/adapter.ts +4 -0
- package/src/trailer/build.ts +42 -11
- 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/passage.ts +21 -6
- package/src/trailer/plan.ts +74 -3
- package/src/trailer/shelf.ts +16 -0
- package/src/trailer/stitch.ts +67 -26
- package/src/trailer/url.ts +1 -1
- package/src/trailer/versions.ts +24 -0
- package/src/ts/gate-typecheck.ts +32 -0
- package/src/ts/typecheck-cli.ts +9 -11
- package/src/tui/tui-app.tsx +0 -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
|
@@ -31,17 +31,19 @@
|
|
|
31
31
|
--s0:2px;--s1:4px;--s2:8px;--s3:12px;--s4:16px}
|
|
32
32
|
/* THE LIGHT TOKENS: the same names, read on a light page (theme-st.ts sets
|
|
33
33
|
<html data-theme>). Every token of the block above has its light value
|
|
34
|
-
here, and tests/hub-css-invariants.test.ts fails a missing one
|
|
35
|
-
:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
--
|
|
34
|
+
here, and tests/hub-css-invariants.test.ts fails a missing one. Each ink
|
|
35
|
+
holds its contrast on every surface, sel included: ink 13:1, dim 6.5:1, a
|
|
36
|
+
state or kind hue 4.6:1 (tests/hub-css-invariants.test.ts) */
|
|
37
|
+
:root[data-theme=light]{--bg:#f1f3f6;--panel:#ffffff;
|
|
38
|
+
--bg-side:#e6e9ee;--bg-top:#eaedf1;--bg-dock:#e3e7ec;--panel2:#e3e7ec;--line:#bcc4ce;--ink:#16191d;--dim:#464b51;
|
|
39
|
+
--accent:#355e87;--sel:#d2e0ef;--chk1:#e3e7ec;--chk2:#f7f8fa;
|
|
40
|
+
--red:#a83733;--warn:#86550b;--ok:#256e45;--blue:#275fa0;
|
|
39
41
|
--scrim:rgba(20,24,30,.35);--shadow:rgba(20,24,30,.16);--solid:#000;
|
|
40
42
|
--hi1:rgba(0,0,0,.2);--hi2:rgba(0,0,0,.11);--hi3:rgba(0,0,0,.045);
|
|
41
43
|
--ground:#e3ede6;--groundline:#c6d6cb;--tag:#eef2f6;
|
|
42
|
-
--k1:#
|
|
43
|
-
--review:#
|
|
44
|
-
--ref-lazy:#
|
|
44
|
+
--k1:#3b6087;--k2:#695099;--k3:#24676f;--k4:#8e4470;--k5:#585f67;--k6:#4f56a8;
|
|
45
|
+
--review:#a72288;
|
|
46
|
+
--ref-lazy:#944d0a;--ref-eager:#1d5abd;
|
|
45
47
|
--wash:rgba(59,104,150,.12);--wash2:rgba(59,104,150,.08);--hair:rgba(59,104,150,.45);
|
|
46
48
|
--errbg:#fbe9e8;--errline:#efc4c2;--errink:#8a2520;
|
|
47
49
|
--okbg:#e6f3eb;--okline:#9ccdaf}
|
|
@@ -74,6 +76,11 @@ a,a:visited{color:var(--accent)}
|
|
|
74
76
|
.pside > aside{flex:1}
|
|
75
77
|
.pmain{display:flex;flex-direction:column}
|
|
76
78
|
.pmain > main{flex:1}
|
|
79
|
+
/* a repo's own pages (pages-frames.tsx): every kept frame, the shown one alone displayed */
|
|
80
|
+
.pframes{flex:1;min-height:0;display:flex;flex-direction:column}
|
|
81
|
+
.pframes[hidden],.pframe[hidden]{display:none}
|
|
82
|
+
.pframe{flex:1;min-height:0;display:flex;flex-direction:column}
|
|
83
|
+
.pframe iframe{flex:1;width:100%;min-height:0;border:0;display:block}
|
|
77
84
|
|
|
78
85
|
/* ── a repo's bar: on the home the strip (home-strip.css .hstrip), on a hub
|
|
79
86
|
of its own the header (.hdr). Its name, its check… button and a spinner
|
|
@@ -97,6 +104,15 @@ a,a:visited{color:var(--accent)}
|
|
|
97
104
|
.hicon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:24px;height:22px;padding:0;border:0;background:none;color:var(--dim)}
|
|
98
105
|
.hicon:hover{color:var(--accent)}
|
|
99
106
|
.hicon .hico{width:15px;height:15px}
|
|
107
|
+
/* the home's places at the start of the top bar, apart from the page's own pieces; the page shown is lit */
|
|
108
|
+
.hplaces{flex:none;display:inline-flex;align-items:center;gap:var(--s0);margin-right:var(--s2);padding-right:var(--s2);border-right:1px solid var(--line)}
|
|
109
|
+
.hpl.cur{color:var(--accent);background:var(--sel);border-radius:4px}
|
|
110
|
+
/* every fold's caret (icons.tsx Caret): 14 px, turned by its state, never a text glyph a font draws at 6 px */
|
|
111
|
+
.caret{flex:none;display:inline-block;width:14px;height:14px;vertical-align:-2px;transition:transform .12s ease}
|
|
112
|
+
.caret.open{transform:rotate(90deg)}
|
|
113
|
+
.caret.v{transform:rotate(90deg)}
|
|
114
|
+
.caret.v.open{transform:rotate(-90deg)}
|
|
115
|
+
@media (prefers-reduced-motion:reduce){.caret{transition:none}}
|
|
100
116
|
|
|
101
117
|
/* a row of a (?) legend: one glyph or word, then its meaning */
|
|
102
118
|
.lrow{display:flex;gap:var(--s2);align-items:center;height:29px;flex:none;padding:0 var(--s3)}
|
|
@@ -111,8 +127,8 @@ aside > .tscroll{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scroll
|
|
|
111
127
|
aside > .tscroll::-webkit-scrollbar{width:6px}
|
|
112
128
|
aside > .tscroll::-webkit-scrollbar-track{background:transparent}
|
|
113
129
|
aside > .tscroll::-webkit-scrollbar-thumb{background:var(--line);border-radius:3px}
|
|
114
|
-
/* a section, the tree's top row: the project list's
|
|
115
|
-
.
|
|
130
|
+
/* a section, the tree's top row: the project list's rows (project-list.css
|
|
131
|
+
.pjrow), a little shorter, the current one lit and marked in the accent.
|
|
116
132
|
The chevron column is the tree's own, so a section's rows line up under it */
|
|
117
133
|
.tsec{display:grid;grid-template-columns:14px 16px minmax(0,1fr) auto auto;align-items:center;gap:var(--s2);height:26px;padding:0 var(--s1) 0 var(--s2);color:var(--dim);font-size:13px;cursor:pointer;white-space:nowrap}
|
|
118
134
|
.tsec:hover{background:var(--panel2);color:var(--ink)}
|
|
@@ -122,6 +138,8 @@ aside > .tscroll::-webkit-scrollbar-thumb{background:var(--line);border-radius:3
|
|
|
122
138
|
.tsec.on{box-shadow:inset 2px 0 0 var(--accent)}
|
|
123
139
|
.tsec.cur{background:var(--sel);color:var(--ink);box-shadow:inset 3px 0 0 var(--accent);font-weight:600}
|
|
124
140
|
.tsec .hico{width:16px;height:16px}
|
|
141
|
+
.tsec.tpfirst{margin-top:var(--s2);box-shadow:inset 0 1px 0 var(--line)}
|
|
142
|
+
.tsec.tpfirst.cur{box-shadow:inset 3px 0 0 var(--accent),inset 0 1px 0 var(--line)}
|
|
125
143
|
.tsec:hover .tw{color:var(--ink)}
|
|
126
144
|
.rsecl{min-width:0;overflow:hidden;text-overflow:ellipsis}
|
|
127
145
|
.rsecn{min-width:16px;height:16px;padding:0 var(--s1);border-radius:8px;font-size:10px;font-weight:700;line-height:16px;text-align:center;color:var(--bg)}
|
|
@@ -689,7 +707,7 @@ a.tok{color:var(--accent)}
|
|
|
689
707
|
.ctgrp:hover td{color:var(--accent)}
|
|
690
708
|
.ctgrp.g-fail td{color:var(--red)}
|
|
691
709
|
.ctgrp.g-warn td{color:var(--warn)}
|
|
692
|
-
.ctcaret{display:inline-
|
|
710
|
+
.ctcaret{display:inline-flex;width:18px}
|
|
693
711
|
.ctrow{cursor:pointer}
|
|
694
712
|
.ctrow:hover{background:var(--panel2)}
|
|
695
713
|
.ctdot{font-size:10px}
|
|
@@ -22,6 +22,9 @@ export const ICON = {
|
|
|
22
22
|
activity: 'M6 3v14M6 6.5a2 2 0 1 0 0 .01M6 13.5a2 2 0 1 0 0 .01M10 6.5h7M10 13.5h7M10 10h5',
|
|
23
23
|
fork: 'M6 5v10M6 3a2 2 0 1 0 0 .01M6 17a2 2 0 1 0 0 .01M14 5a2 2 0 1 0 0 .01M14 7c0 4.5-8 3.5-8 7',
|
|
24
24
|
search: 'M8.5 3a5.5 5.5 0 1 0 0 11a5.5 5.5 0 1 0 0-11M12.5 12.5 17 17',
|
|
25
|
+
// fold every cell: two chevrons meeting; unfold every cell: two chevrons apart
|
|
26
|
+
foldAll: 'M6 3.5l4 4 4-4M6 16.5l4-4 4 4',
|
|
27
|
+
unfoldAll: 'M6 7.5l4-4 4 4M6 12.5l4 4 4-4',
|
|
25
28
|
// a repo page's sections, then its two runs and its editor
|
|
26
29
|
readme: 'M5 2.5h7l3 3v12H5zM12 2.5v3h3M7.5 9h5M7.5 12h5M7.5 15h3',
|
|
27
30
|
checks: 'M4 10.5 7.5 14 16 5.5',
|
|
@@ -30,11 +33,17 @@ export const ICON = {
|
|
|
30
33
|
secrets: 'M7 7a3 3 0 1 0 0 6a3 3 0 1 0 0-6M10 10h7.5M15 10v2.5M17.5 10v2',
|
|
31
34
|
runs: 'M3 5h8M3 10h12M3 15h6',
|
|
32
35
|
asks: 'M3 4h14v9H8l-4 3.5V13H3z',
|
|
33
|
-
//
|
|
36
|
+
// a review bubble with a pen (rate_review), and a clapper (movie)
|
|
34
37
|
review: 'M3 3.5h14v10H7.5L3 17zM7 10.5l4.5-4.5 1.5 1.5L8.5 12H7z',
|
|
35
38
|
tests: 'M8 3h4M8.5 3v5L4 16.5h12L11.5 8V3M6.2 12.5h7.6',
|
|
36
39
|
media: 'M3 4h14v12H3zM3 13l4-4 4 4 2-2 4 4M13 7.5h.01',
|
|
37
40
|
trailer: 'M2.5 4.5h15v11h-15zM2.5 8.5h15M6 4.5 7.5 8.5M10 4.5l1.5 4M14 4.5l1.5 4',
|
|
41
|
+
// a shop front: an awning over a door
|
|
42
|
+
veille: 'M10 4.5c-4 0-7 3.5-7.5 5.5.5 2 3.5 5.5 7.5 5.5s7-3.5 7.5-5.5c-.5-2-3.5-5.5-7.5-5.5zM10 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6z',
|
|
43
|
+
stores: 'M3 4h14l1 4H2zM2 8c0 1.4 1.3 2.5 2.7 2.5S7.3 9.4 7.3 8c0 1.4 1.3 2.5 2.7 2.5S12.7 9.4 12.7 8c0 1.4 1.3 2.5 2.7 2.5S18 9.4 18 8M4 10.5V17h12v-6.5M8 17v-4h4v4',
|
|
44
|
+
// a megaphone (the drafts he posts), two people (the identities and their accounts)
|
|
45
|
+
comms: 'M3 8h3l8-4v12l-8-4H3zM6 12l1.5 4.5',
|
|
46
|
+
social: 'M7 9a2.5 2.5 0 1 0 0-5a2.5 2.5 0 1 0 0 5M2.5 16c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5M13.5 9a2 2 0 1 0 0-4M13 11.5c2.5 0 4.5 1.8 4.5 4.5',
|
|
38
47
|
wikis: 'M10 5.5C8.5 4 6 3.5 3 4v11c3-.5 5.5 0 7 1.5c1.5-1.5 4-2 7-1.5V4c-3-.5-5.5 0-7 1.5zM10 5.5v11',
|
|
39
48
|
admin: 'M4 5h12M4 10h12M4 15h12M7 3.5v3M13 8.5v3M9 13.5v3',
|
|
40
49
|
health: 'M2 10h3.5l2-5 5 10 2-5H18',
|
|
@@ -62,6 +71,12 @@ export const ICON = {
|
|
|
62
71
|
restart: 'M15.5 10a5.5 5.5 0 1 1-1.6-3.9M14.2 3v3.3h-3.3',
|
|
63
72
|
} as const
|
|
64
73
|
|
|
74
|
+
/** every fold's caret: a chevron that points at what a click shows. `v`: a word button that unfolds below
|
|
75
|
+
* (« more », « show »), down while folded and up once open; else right while folded, down once open */
|
|
76
|
+
export const Caret = ({ open, v = false }: { open: boolean; v?: boolean }) => (
|
|
77
|
+
<svg className={`caret${v ? ' v' : ''}${open ? ' open' : ''}`} viewBox="0 0 20 20" width="14" height="14" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"><path d="M7.5 4.5 13 10l-5.5 5.5" /></svg>
|
|
78
|
+
)
|
|
79
|
+
|
|
65
80
|
export const Icon = ({ d }: { d: string }) => (
|
|
66
81
|
<svg className="hico" viewBox="0 0 20 20" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"><path d={d} /></svg>
|
|
67
82
|
)
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// the identity view's state (wiki build/shipkit/social.md, Identities; home.md, Identities): every identity as the
|
|
2
|
+
// daemon reads its folder, the one picked from the address (`/identities#<id>[/<part>[/<place>]]`), and the desk
|
|
3
|
+
// its accounts, setup and messages come from. The desk is a repo's Social desk read again: its identities are the
|
|
4
|
+
// machine's whatever the repo, its drafts that repo's, so an identity reads the desk of the repo that speaks as it
|
|
5
|
+
// with the most drafts
|
|
6
|
+
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
7
|
+
import type { DataPlace, IdentitiesAnswer, MachineIdentity } from '../../identities/machine-route.ts'
|
|
8
|
+
import type { HomeSt } from './home-st.ts'
|
|
9
|
+
import { identityRows, isSection, type IdentityRow, type IdentitySel } from './identity-address.ts'
|
|
10
|
+
import { walkKey, WalkEntry, type WalkHost } from './list-walk.ts'
|
|
11
|
+
import { ownTrouble, reach } from './reach.ts'
|
|
12
|
+
import { LEGAL } from './social/social-model.ts'
|
|
13
|
+
import { SocialSt } from './social/social-st.ts'
|
|
14
|
+
|
|
15
|
+
export class IdentitiesSt implements WalkHost<IdentityRow> {
|
|
16
|
+
data: IdentitiesAnswer | null = null
|
|
17
|
+
error = ''
|
|
18
|
+
loading = false
|
|
19
|
+
/** what the address picked */
|
|
20
|
+
sel: IdentitySel = { id: null, part: null, place: null }
|
|
21
|
+
/** what the last open said, or why it failed */
|
|
22
|
+
note = ''
|
|
23
|
+
/** the desk the shown identity reads (applyDesk) */
|
|
24
|
+
desk: SocialSt | null = null
|
|
25
|
+
/** one desk per repo read, kept for the life of the page */
|
|
26
|
+
private desks = new Map<string, SocialSt>()
|
|
27
|
+
private gen = 0
|
|
28
|
+
/** the list's filter, `/` focuses it */
|
|
29
|
+
query = ''
|
|
30
|
+
searchEl: HTMLInputElement | null = null
|
|
31
|
+
/** the row the arrows last landed on; a click or an address clears it. A repo row under it opens only on Enter */
|
|
32
|
+
cursor: string | null = null
|
|
33
|
+
/** a walk with the arrows is one history entry (HomeSt.show asks it) */
|
|
34
|
+
readonly entry = new WalkEntry()
|
|
35
|
+
|
|
36
|
+
constructor(private readonly st: HomeSt) {
|
|
37
|
+
makeAutoObservable<this, 'st' | 'gen' | 'desks'>(this, { st: false, gen: false, desks: false, entry: false, searchEl: false, data: observableRef, desk: observableRef })
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
start(): void {
|
|
41
|
+
void this.load()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** read once for the picker, never again while it holds them */
|
|
45
|
+
ensure(): void {
|
|
46
|
+
if (this.data == null && !this.loading) void this.load()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
select(sel: IdentitySel): void {
|
|
50
|
+
this.sel = sel
|
|
51
|
+
this.cursor = null
|
|
52
|
+
this.applyDesk()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
setQuery(q: string): void {
|
|
56
|
+
this.query = q
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── the list and its keys: the repo tree's (list-walk.ts) ────────────
|
|
60
|
+
|
|
61
|
+
/** the shown identity's rows, the filter applied */
|
|
62
|
+
get rows(): IdentityRow[] {
|
|
63
|
+
const i = this.shown
|
|
64
|
+
if (i == null) return []
|
|
65
|
+
return identityRows(i, this.desk?.identityOf(i.id)?.legal != null, this.query)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** the row of the part shown */
|
|
69
|
+
home(rows: readonly IdentityRow[]): number {
|
|
70
|
+
return rows.findIndex((r) => r.repo == null && r.part === this.sel.part)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** the row lit: the cursor's, else the part shown's */
|
|
74
|
+
get lit(): string | null {
|
|
75
|
+
const rows = this.rows
|
|
76
|
+
return this.cursor ?? rows[this.home(rows)]?.key ?? null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
inert(): boolean {
|
|
80
|
+
return false
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** an arrow on a part opens it at once, one history entry for the walk; on a repo it only takes the cursor */
|
|
84
|
+
land(row: IdentityRow): void {
|
|
85
|
+
const id = this.shownId
|
|
86
|
+
if (row.repo == null) this.entry.run(() => this.st.openIdentity({ id, part: row.part, place: null }))
|
|
87
|
+
this.cursor = row.key
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
activate(row: IdentityRow): void {
|
|
91
|
+
const id = this.shownId
|
|
92
|
+
if (row.repo != null && id != null) this.openRepo(row.repo, id)
|
|
93
|
+
else this.st.openIdentity({ id, part: row.part, place: null })
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
isOpen(): boolean {
|
|
97
|
+
return false
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
toggle(): void {}
|
|
101
|
+
|
|
102
|
+
/** true = the key was the list's */
|
|
103
|
+
key(k: string): boolean {
|
|
104
|
+
return walkKey(this, k)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** the identity on screen: the one the address names, else the first */
|
|
108
|
+
get shown(): MachineIdentity | null {
|
|
109
|
+
const ids = this.data?.identities ?? []
|
|
110
|
+
return ids.find((i) => i.id === this.sel.id) ?? (this.sel.id == null ? ids[0] ?? null : null)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get shownId(): string | null {
|
|
114
|
+
return this.shown?.id ?? this.sel.id
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** the repo whose desk the identity reads: the one speaking as it with the most drafts, else the first speaking as
|
|
118
|
+
* it, else the first repo of the list (an identity no repo speaks as has no drafts, its accounts are the same) */
|
|
119
|
+
deskRepo(i: MachineIdentity): string | null {
|
|
120
|
+
const drafts = i.data.filter((p) => p.place === 'drafts' && p.repo != null && (p.count ?? 0) > 0).sort((a, b) => (b.count ?? 0) - (a.count ?? 0))
|
|
121
|
+
return drafts[0]?.repo ?? i.repos[0] ?? this.st.projects.list[0]?.name ?? null
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** the other repos speaking as it that hold drafts: their Communications are a click away */
|
|
125
|
+
otherDrafts(i: MachineIdentity): DataPlace[] {
|
|
126
|
+
const own = this.deskRepo(i)
|
|
127
|
+
return i.data.filter((p) => p.place === 'drafts' && p.repo != null && p.repo !== own && (p.count ?? 0) > 0)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
private deskOf(repo: string): SocialSt {
|
|
131
|
+
let d = this.desks.get(repo)
|
|
132
|
+
if (d == null) {
|
|
133
|
+
const home = this.st
|
|
134
|
+
d = new SocialSt(home.repo(repo), {
|
|
135
|
+
social: (identity, account, place) => home.openIdentity({ id: identity, part: account, place }),
|
|
136
|
+
draft: (slug) => {
|
|
137
|
+
home.repo(repo).showComms(slug, null)
|
|
138
|
+
home.select(repo)
|
|
139
|
+
},
|
|
140
|
+
})
|
|
141
|
+
this.desks.set(repo, d)
|
|
142
|
+
}
|
|
143
|
+
return d
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** the desk shows what the address picked: the company, an account and its place, else the identity */
|
|
147
|
+
private applyDesk(): void {
|
|
148
|
+
const i = this.shown
|
|
149
|
+
const repo = i == null ? null : this.deskRepo(i)
|
|
150
|
+
const d = repo == null ? null : this.deskOf(repo)
|
|
151
|
+
this.desk = d
|
|
152
|
+
if (i == null || d == null) return
|
|
153
|
+
const part = this.sel.part
|
|
154
|
+
if (part === LEGAL) d.selectSocial(i.id, LEGAL, null)
|
|
155
|
+
else if (part == null || isSection(part)) d.selectSocial(i.id, null, null)
|
|
156
|
+
else d.selectSocial(i.id, part, this.sel.place)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** the hub of the desk's repo, started when it is down */
|
|
160
|
+
ensureHub(): void {
|
|
161
|
+
const i = this.shown
|
|
162
|
+
const repo = i == null ? null : this.deskRepo(i)
|
|
163
|
+
if (repo != null && this.st.machine?.data != null) void this.st.machine.hub(repo, 'ensure')
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async load(): Promise<void> {
|
|
167
|
+
const id = ++this.gen
|
|
168
|
+
this.loading = true
|
|
169
|
+
try {
|
|
170
|
+
const r = await reach('/api/home/identities.json', { cache: 'no-store' })
|
|
171
|
+
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`)
|
|
172
|
+
const j = (await r.json()) as IdentitiesAnswer
|
|
173
|
+
runInAction(() => {
|
|
174
|
+
if (id !== this.gen) return
|
|
175
|
+
this.data = j
|
|
176
|
+
this.error = ''
|
|
177
|
+
this.applyDesk()
|
|
178
|
+
})
|
|
179
|
+
} catch (e) {
|
|
180
|
+
runInAction(() => { if (id === this.gen) this.error = ownTrouble(e, this.st.machine, (m) => `the identities could not be read: ${m}`) })
|
|
181
|
+
} finally {
|
|
182
|
+
runInAction(() => { if (id === this.gen) this.loading = false })
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** a place of an identity's data, in VS Code or the Finder: the daemon resolves the path from the two names */
|
|
187
|
+
async open(identity: string, p: DataPlace, app: 'code' | 'finder'): Promise<void> {
|
|
188
|
+
try {
|
|
189
|
+
const r = await reach('/api/home/identities/open', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: identity, place: p.place, repo: p.repo, app }) })
|
|
190
|
+
if (!r.ok) throw new Error(await r.text())
|
|
191
|
+
runInAction(() => { this.note = `opened ${p.shown} in ${app === 'code' ? 'VS Code' : 'the Finder'}` })
|
|
192
|
+
} catch (e) {
|
|
193
|
+
runInAction(() => { this.note = ownTrouble(e, this.st.machine, (m) => `open ${p.shown}: ${m}`) })
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** a repo of an identity: its Social page */
|
|
198
|
+
openRepo(repo: string, identity: string): void {
|
|
199
|
+
this.st.repo(repo).showSocial(identity)
|
|
200
|
+
this.st.select(repo)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** a repo's own page of the identity: its Veille, its Communications */
|
|
204
|
+
openRepoPage(repo: string, page: 'veille' | 'comms'): void {
|
|
205
|
+
const r = this.st.repo(repo)
|
|
206
|
+
if (page === 'veille') r.showVeille(null)
|
|
207
|
+
else r.showComms(null)
|
|
208
|
+
this.st.select(repo)
|
|
209
|
+
}
|
|
210
|
+
}
|