rvlib-shipkit 2.27.0 → 2.28.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 +16 -0
- package/package.json +1 -1
- package/src/agent-time/hooks.ts +10 -3
- package/src/agent-time/live.ts +11 -5
- package/src/agent-time/registry.ts +289 -0
- package/src/agent-time/store.ts +2 -2
- package/src/annex/born.ts +2 -2
- package/src/annex/offload.ts +12 -11
- package/src/asks/ask-after.ts +6 -2
- package/src/asks/ask-bar-fold.ts +57 -0
- package/src/asks/ask-migrate.ts +280 -0
- package/src/asks/ask-steps-fold.ts +166 -0
- package/src/asks/ask-store.ts +586 -0
- package/src/assets/kits/identity-kit.ts +106 -38
- package/src/assets/kits/poster-thumbnail.ts +282 -0
- package/src/checks/SK003-claude-md-shape.check.ts +92 -25
- package/src/checks/SK004-gitignore-policy.check.ts +8 -4
- package/src/checks/SK013-one-way-in-policy.check.ts +10 -0
- package/src/checks/SK026-asks-autoclose.check.ts +9 -23
- package/src/checks/SK038-speaks-as.check.ts +3 -3
- package/src/checks/SK042-post-kinds.check.ts +26 -24
- package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
- package/src/checks/SK050-retired-commands.check.ts +127 -0
- package/src/cli/cmd_Asks.ts +204 -53
- package/src/cli/cmd_Backup.ts +151 -8
- package/src/cli/cmd_Calls.ts +1 -0
- package/src/cli/cmd_Commands.ts +140 -34
- package/src/cli/cmd_Contracts.ts +1 -0
- package/src/cli/cmd_Keys.ts +1 -0
- package/src/cli/cmd_Lanes.ts +15 -4
- package/src/cli/cmd_Messages.ts +152 -1
- package/src/cli/cmd_Needs.ts +1 -0
- package/src/cli/cmd_Review.ts +931 -229
- package/src/cli/cmd_Secret.ts +255 -34
- package/src/cli/cmd_Social.ts +36 -33
- package/src/cli/cmd_SocialDrafts.ts +235 -0
- package/src/cli/cmd_Sound.ts +22 -1
- package/src/cli/cmd_Start.ts +3 -2
- package/src/cli/cmd_ThreadHolds.ts +34 -0
- package/src/cli/cmd_ThreadKinds.ts +146 -0
- package/src/cli/cmd_ThreadReflect.ts +83 -0
- package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
- package/src/cli/cmd_Vault.ts +1 -1
- package/src/cli/cmd_When.ts +1 -0
- package/src/cli/family-help.ts +2 -2
- package/src/cli/family-pages.ts +1 -1
- package/src/cli/kit/builtins.ts +1 -0
- package/src/cli/kit/verb.ts +6 -2
- package/src/cli/registry.ts +21 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +25 -74
- package/src/collections/collection-types.ts +9 -5
- package/src/collections/md-body.ts +5 -3
- package/src/collections/pings.ts +13 -6
- package/src/collections/providers.ts +53 -61
- package/src/collections/reflections.ts +9 -4
- package/src/core/discover-checks.ts +18 -3
- package/src/core/git.ts +31 -0
- package/src/core/house-layout.ts +17 -0
- package/src/core/layout.ts +10 -5
- package/src/core/locked-write.ts +4 -1
- package/src/core/machine-db.ts +5 -3
- package/src/core/migrate-layout.ts +8 -10
- package/src/home/activity.ts +8 -15
- package/src/home/daemon-jobs.ts +13 -1
- package/src/home/home-paths.ts +6 -3
- package/src/home/home-routes.ts +8 -0
- package/src/home/inbox-shape.ts +233 -100
- package/src/home/inbox.ts +26 -71
- package/src/home/machine-fold.ts +10 -15
- package/src/home/machine-host.ts +19 -1
- package/src/home/other-macs.ts +2 -2
- package/src/home/serve-web.ts +6 -5
- package/src/home/space-page.ts +1 -1
- package/src/home/vault-page.ts +51 -17
- package/src/home/vault-words.ts +2 -2
- package/src/hooks/one-way-in-guard.ts +24 -2
- package/src/hq/files-send.ts +27 -28
- package/src/hq/hq-db.ts +4 -1
- package/src/hq/hq-local.ts +37 -4
- package/src/hq/hq-routes.ts +10 -2
- package/src/hq/hq-store.ts +6 -2
- package/src/hq/kinds/ask.ts +6 -6
- package/src/hq/outbox.ts +5 -3
- package/src/hq/replica.ts +1 -2
- package/src/hq/vault-route.ts +112 -0
- package/src/identities/collection.ts +2 -2
- package/src/identities/identities.ts +9 -8
- package/src/identities/machine-route.ts +8 -3
- package/src/ledger/db.ts +8 -1
- package/src/media-store/backup/daemon.ts +48 -8
- package/src/media-store/backup/keys.ts +1 -1
- package/src/media-store/backup/manifest.ts +20 -2
- package/src/media-store/backup/prune.ts +365 -0
- package/src/media-store/backup/retention.ts +122 -0
- package/src/media-store/backup/run.ts +14 -8
- package/src/media-store/backup/sources.ts +18 -17
- package/src/media-store/backup/thread-copy.ts +340 -0
- package/src/media-store/copy/config.ts +3 -4
- package/src/media-store/copy/store.ts +2 -2
- package/src/media-store/db.ts +2 -2
- package/src/media-store/forget.ts +118 -0
- package/src/media-store/purge.ts +3 -2
- package/src/media-store/space-listing.ts +20 -4
- package/src/media-store/space.ts +6 -5
- package/src/messages/guard.ts +49 -0
- package/src/messages/model.ts +1 -1
- package/src/messages/objects.ts +201 -0
- package/src/messages/routes.ts +2 -2
- package/src/messages/score.ts +1 -1
- package/src/messages/write.ts +285 -0
- package/src/pages/frame-client.ts +181 -4
- package/src/reflections/reflections-queue.ts +1 -1
- package/src/release/gate-checkout.ts +2 -1
- package/src/release/git-facts.ts +3 -2
- package/src/release/public-clean.ts +3 -2
- package/src/repo-config.ts +40 -18
- package/src/review/anim.ts +1 -1
- package/src/review/answer-kinds.ts +131 -0
- package/src/review/band.ts +53 -0
- package/src/review/branch-hold.ts +84 -0
- package/src/review/card-db.ts +16 -6
- package/src/review/card-rows.ts +4 -3
- package/src/review/cells.ts +297 -65
- package/src/review/close.ts +92 -0
- package/src/review/draft-card.ts +8 -16
- package/src/review/draft-model.ts +2 -2
- package/src/review/events.ts +171 -0
- package/src/review/format.ts +128 -14
- package/src/review/glyphs.ts +63 -0
- package/src/review/gone.ts +1 -1
- package/src/review/holds-sync.ts +62 -0
- package/src/review/holds.ts +85 -0
- package/src/review/house-kind-defs.ts +41 -0
- package/src/review/inbox-hook.ts +22 -9
- package/src/review/inbox-read.ts +201 -0
- package/src/review/instructions.ts +199 -0
- package/src/review/kind-apply.ts +61 -0
- package/src/review/kind-catalog.ts +96 -0
- package/src/review/kinds.ts +278 -0
- package/src/review/lane-ask.ts +109 -0
- package/src/review/model.ts +396 -86
- package/src/review/move.ts +3 -3
- package/src/review/need-address.ts +15 -0
- package/src/review/need-threads.ts +93 -0
- package/src/review/object-card.ts +48 -0
- package/src/review/object-read.ts +31 -0
- package/src/review/owner-verdict.ts +36 -0
- package/src/review/parties.ts +182 -0
- package/src/review/previews.ts +3 -1
- package/src/review/projections.ts +235 -0
- package/src/review/referring.ts +54 -0
- package/src/review/reflection-object.ts +195 -0
- package/src/review/routes.ts +137 -32
- package/src/review/secret-route.ts +80 -0
- package/src/review/snooze.ts +38 -0
- package/src/review/stage-card.ts +4 -4
- package/src/review/store.ts +366 -85
- package/src/review/supersede.ts +116 -0
- package/src/review/take-back.ts +52 -0
- package/src/review/thread-fold.ts +20 -7
- package/src/review/threads.ts +236 -39
- package/src/review/traces.ts +218 -0
- package/src/review/trailer-card.ts +2 -2
- package/src/review/unit.ts +71 -5
- package/src/review/verdict-items.ts +73 -0
- package/src/review/verdict-write.ts +15 -0
- package/src/review/wait.ts +85 -0
- package/src/review/watchers.ts +22 -9
- package/src/scaffold/files/claude-settings-local.json +2 -0
- package/src/secrets/archive-mark.ts +52 -0
- package/src/secrets/archive.ts +83 -0
- package/src/secrets/copy.ts +14 -14
- package/src/secrets/keychain-write.ts +48 -0
- package/src/secrets/keychain.ts +8 -5
- package/src/secrets/lapse-mark.ts +33 -0
- package/src/secrets/lapse.ts +60 -0
- package/src/secrets/list.ts +16 -22
- package/src/secrets/manager.ts +31 -16
- package/src/secrets/read.ts +161 -33
- package/src/secrets/tail.ts +31 -0
- package/src/serve/hub-app/asks-page.tsx +2 -1
- package/src/serve/hub-app/auto-text.tsx +14 -6
- package/src/serve/hub-app/benign-errors.ts +15 -1
- package/src/serve/hub-app/card-head.tsx +49 -0
- package/src/serve/hub-app/check-view.tsx +3 -2
- package/src/serve/hub-app/code-copy.ts +35 -0
- package/src/serve/hub-app/col-card.tsx +31 -40
- package/src/serve/hub-app/col-list-page.tsx +5 -2
- package/src/serve/hub-app/col-tables-view.tsx +7 -4
- package/src/serve/hub-app/col-tables.ts +5 -5
- package/src/serve/hub-app/cols-svc.ts +4 -79
- package/src/serve/hub-app/commands/commands-page.tsx +2 -1
- package/src/serve/hub-app/controls.css +83 -0
- package/src/serve/hub-app/frames-st.ts +17 -1
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/home-st.ts +57 -6
- package/src/serve/hub-app/home-strip.css +1 -6
- package/src/serve/hub-app/home-strip.tsx +2 -1
- package/src/serve/hub-app/home.html +3 -0
- package/src/serve/hub-app/house-wiki-view.tsx +20 -0
- package/src/serve/hub-app/hub-app.tsx +48 -32
- package/src/serve/hub-app/hub-types.ts +2 -0
- package/src/serve/hub-app/hub.css +50 -61
- package/src/serve/hub-app/icons.tsx +14 -4
- package/src/serve/hub-app/identities-view.tsx +4 -3
- package/src/serve/hub-app/inbox-st.ts +203 -42
- package/src/serve/hub-app/inbox-view.tsx +189 -101
- package/src/serve/hub-app/inbox.css +47 -44
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/instructions.css +30 -0
- package/src/serve/hub-app/keys.ts +5 -3
- package/src/serve/hub-app/machine-st.ts +2 -2
- package/src/serve/hub-app/machines-view.tsx +4 -11
- package/src/serve/hub-app/machines.css +0 -9
- package/src/serve/hub-app/markdown.css +51 -0
- package/src/serve/hub-app/md-copy.tsx +18 -40
- package/src/serve/hub-app/md.ts +25 -9
- package/src/serve/hub-app/media-view.tsx +2 -2
- package/src/serve/hub-app/messages/messages-page.tsx +2 -1
- package/src/serve/hub-app/messages/messages-st.ts +1 -1
- package/src/serve/hub-app/messages.css +0 -1
- package/src/serve/hub-app/objects.css +51 -0
- package/src/serve/hub-app/page-keys.ts +1 -1
- package/src/serve/hub-app/pages-frames.tsx +11 -1
- package/src/serve/hub-app/palette-st.ts +4 -4
- package/src/serve/hub-app/pane-boundary.tsx +72 -0
- package/src/serve/hub-app/pane-errors.ts +54 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/planned-view.tsx +3 -3
- package/src/serve/hub-app/planned.css +0 -4
- package/src/serve/hub-app/processes-view.tsx +3 -2
- package/src/serve/hub-app/project-list.css +5 -13
- package/src/serve/hub-app/project-list.tsx +3 -6
- package/src/serve/hub-app/projects-svc.ts +6 -2
- package/src/serve/hub-app/readme.css +9 -15
- package/src/serve/hub-app/reflections-page.tsx +54 -1
- package/src/serve/hub-app/releases/releases-page.tsx +3 -2
- package/src/serve/hub-app/releases.css +0 -1
- package/src/serve/hub-app/review/code-colors.ts +30 -0
- package/src/serve/hub-app/review/diff-view.tsx +75 -0
- package/src/serve/hub-app/review/dock.tsx +104 -0
- package/src/serve/hub-app/review/draft-card.tsx +2 -2
- package/src/serve/hub-app/review/group-block.tsx +209 -0
- package/src/serve/hub-app/review/instructions-view.tsx +116 -0
- package/src/serve/hub-app/review/item-verdict.tsx +38 -0
- package/src/serve/hub-app/review/kind-states.tsx +193 -0
- package/src/serve/hub-app/review/kind-view.tsx +1 -37
- package/src/serve/hub-app/review/kit.tsx +57 -54
- package/src/serve/hub-app/review/lane-bar.tsx +64 -0
- package/src/serve/hub-app/review/object-card.tsx +62 -0
- package/src/serve/hub-app/review/object-panel.tsx +179 -0
- package/src/serve/hub-app/review/question-views.tsx +385 -0
- package/src/serve/hub-app/review/review-cells.tsx +86 -105
- package/src/serve/hub-app/review/review-list.tsx +104 -47
- package/src/serve/hub-app/review/review-page.tsx +5 -4
- package/src/serve/hub-app/review/review-st.ts +68 -28
- package/src/serve/hub-app/review/review-thread.tsx +171 -40
- package/src/serve/hub-app/review/review-views.tsx +35 -31
- package/src/serve/hub-app/review/thread-close.tsx +124 -0
- package/src/serve/hub-app/review/thread-control.tsx +4 -4
- package/src/serve/hub-app/review/thread-st.ts +222 -22
- package/src/serve/hub-app/review/trailer-card.tsx +1 -1
- package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
- package/src/serve/hub-app/review.css +216 -57
- package/src/serve/hub-app/section-head.tsx +51 -0
- package/src/serve/hub-app/social/calendar.tsx +5 -11
- package/src/serve/hub-app/social/comms-page.tsx +23 -10
- package/src/serve/hub-app/social/kit.tsx +8 -15
- package/src/serve/hub-app/social/next-release.tsx +3 -5
- package/src/serve/hub-app/social/post-card.tsx +3 -0
- package/src/serve/hub-app/social/post-page.tsx +80 -0
- package/src/serve/hub-app/social/problems.tsx +5 -9
- package/src/serve/hub-app/social/social-model.ts +13 -5
- package/src/serve/hub-app/social/social-page.tsx +1 -1
- package/src/serve/hub-app/social/social-st.ts +42 -5
- package/src/serve/hub-app/social.css +7 -17
- package/src/serve/hub-app/space.css +1 -1
- package/src/serve/hub-app/stores/stores-page.tsx +6 -2
- package/src/serve/hub-app/thread-row.tsx +101 -0
- package/src/serve/hub-app/time-ago.tsx +3 -2
- package/src/serve/hub-app/time-view.tsx +2 -1
- package/src/serve/hub-app/time.css +2 -5
- package/src/serve/hub-app/tree-row.tsx +1 -9
- package/src/serve/hub-app/vault-view.tsx +4 -4
- package/src/serve/hub-app/veille/veille-page.tsx +2 -11
- package/src/serve/hub-app/veille.css +0 -1
- package/src/serve/hub-app/waiting-svc.ts +4 -4
- package/src/serve/hub-app/when-view.tsx +6 -3
- package/src/serve/hub-app/wiki-st.ts +30 -4
- package/src/serve/hub-app/wikis-view.tsx +4 -3
- package/src/serve/hub-runtime.ts +20 -6
- package/src/serve/project-gutter-route.ts +16 -6
- package/src/serve/project-gutter.ts +6 -53
- package/src/serve/same-origin.ts +3 -0
- package/src/serve/secret-gate.ts +21 -0
- package/src/serve/serve-hub.ts +29 -20
- package/src/serve/tailnet-caller.ts +117 -0
- package/src/shipkit.ts +2 -2
- package/src/site/desk.ts +2 -2
- package/src/smoke/run-smoke.ts +3 -4
- package/src/social/brands.ts +4 -0
- package/src/social/card-drafts.ts +11 -19
- package/src/social/desk-index.ts +34 -13
- package/src/social/drafts.ts +4 -4
- package/src/social/import-drafts.ts +244 -0
- package/src/social/kind-pages.ts +3 -3
- package/src/social/kinds.ts +1 -1
- package/src/social/load.ts +89 -64
- package/src/social/media-kind.ts +68 -161
- package/src/social/media-of.ts +5 -4
- package/src/social/open.ts +3 -2
- package/src/social/post-object.ts +120 -0
- package/src/social/post-sources.ts +136 -0
- package/src/social/post-text.ts +103 -0
- package/src/social/posts.ts +378 -0
- package/src/social/presence.ts +7 -5
- package/src/social/publish/index.ts +17 -5
- package/src/social/publish/secret.ts +2 -2
- package/src/social/release-stage.ts +58 -57
- package/src/social/routes.ts +64 -24
- package/src/social/stage.ts +42 -57
- package/src/social/text.ts +4 -3
- package/src/social/thumbnail.ts +135 -43
- package/src/social/tracker.ts +1 -1
- package/src/social/writes.ts +12 -29
- package/src/stores/desk.ts +16 -11
- package/src/stores/unit.ts +2 -2
- package/src/trailer/sound/eleven.ts +33 -3
- package/src/urls/rows.ts +1 -1
- package/src/vault/vault-http.ts +11 -3
- package/src/vault/vault-import.ts +6 -1
- package/src/veille/identity.ts +2 -2
- package/src/wiki/graph-pages.ts +13 -1
- package/src/wiki/scan-md.ts +1 -1
- package/src/asks/asks-queue.ts +0 -424
- package/src/messages/suggest.ts +0 -96
- package/src/social/migrate.ts +0 -123
|
@@ -15,13 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
/* a machine */
|
|
17
17
|
.mcmachine{margin-top:var(--s3);border:1px solid var(--line);border-radius:6px;background:var(--panel);overflow:hidden}
|
|
18
|
-
.mchead{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:var(--s2);width:100%;padding:var(--s2) var(--s3);cursor:pointer}
|
|
19
|
-
div.mchead{cursor:default}
|
|
20
|
-
.mchead b{font-size:15px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
21
|
-
.mchead:hover b{color:var(--accent)}
|
|
22
|
-
div.mchead:hover b{color:inherit}
|
|
23
|
-
.mchead:focus-visible{outline:1px solid var(--accent);outline-offset:-1px}
|
|
24
|
-
.mchead .caret{flex:none;color:var(--dim)}
|
|
25
18
|
.mcmine{flex:none;padding:0 var(--s2);border:1px solid var(--line);border-radius:999px;color:var(--dim);font-size:11.5px;line-height:18px}
|
|
26
19
|
.mcmachine.gone{opacity:.6}
|
|
27
20
|
|
|
@@ -37,8 +30,6 @@ div.mchead:hover b{color:inherit}
|
|
|
37
30
|
.mcdisk .tvspark{width:56px}
|
|
38
31
|
.mcrepos{color:var(--dim)}
|
|
39
32
|
.mcasks{margin-top:var(--s4);border:1px solid var(--line);border-radius:6px;background:var(--panel)}
|
|
40
|
-
.mcasks .mchead{display:flex;flex-wrap:wrap;gap:0 var(--s3);align-items:baseline;cursor:default}
|
|
41
|
-
.mcasks .mchead b{white-space:normal}
|
|
42
33
|
.mcask{display:grid;grid-template-columns:140px minmax(0,1fr) auto;column-gap:var(--s3);padding:var(--s1) var(--s3);border-top:1px solid var(--hi3)}
|
|
43
34
|
.mcask > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
44
35
|
@media (max-width:720px){.mcask{display:flex;flex-wrap:wrap;gap:0 var(--s3)}.mcask > span{white-space:normal}}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* every markdown the hub draws (md.ts), one look on every page: a container `.md`, inline markdown `.mdi`.
|
|
2
|
+
A title sits apart from what is above it and close to its own section, a table and a code block take air above
|
|
3
|
+
them, a table's rows are striped under a distinct header, inline code is amber (--code, AA on each theme), every
|
|
4
|
+
code block copies from its button (code-copy.ts). Sizes are in em, so the look follows the text around it */
|
|
5
|
+
.md{font-size:12px;line-height:1.5;color:var(--ink)}
|
|
6
|
+
/* markdown that takes the type of the text around it (a post, a store text, a release line) */
|
|
7
|
+
.md.mdflow{font-size:inherit;line-height:inherit}
|
|
8
|
+
.md>:first-child{margin-top:0}
|
|
9
|
+
.md>:last-child{margin-bottom:0}
|
|
10
|
+
|
|
11
|
+
.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{color:var(--accent);letter-spacing:.02em;line-height:1.3}
|
|
12
|
+
.md h1{font-size:1.12em}
|
|
13
|
+
.md h2{font-size:1.05em}
|
|
14
|
+
.md h3,.md h4,.md h5,.md h6{font-size:1em}
|
|
15
|
+
.md h1,.md h2{margin:calc(var(--s4) + var(--s2)) 0 var(--s2)}
|
|
16
|
+
.md h3,.md h4,.md h5,.md h6{margin:var(--s4) 0 var(--s1)}
|
|
17
|
+
.md p{margin:var(--s1) 0}
|
|
18
|
+
.md ul,.md ol{margin:var(--s1) 0;padding-left:var(--s4)}
|
|
19
|
+
.md li{margin:var(--s0) 0}
|
|
20
|
+
.md blockquote{margin:var(--s2) 0;padding:var(--s0) var(--s2);border-left:2px solid var(--line);color:var(--dim)}
|
|
21
|
+
.md hr{border:0;border-top:1px solid var(--line);margin:var(--s3) 0}
|
|
22
|
+
.md a{color:var(--accent)}
|
|
23
|
+
|
|
24
|
+
/* a table: air above it, odd rows striped, its header row tinted */
|
|
25
|
+
.md table{border-collapse:collapse;margin:var(--s3) 0 var(--s2);font-size:.95em;max-width:100%}
|
|
26
|
+
.md th,.md td{border:1px solid var(--line);padding:var(--s0) var(--s2);text-align:left;vertical-align:top}
|
|
27
|
+
/* a table's header row, every table of the app: the markdown's and the shared Table's (time-charts.tsx) */
|
|
28
|
+
.md th,.tvtable th{color:var(--accent);font-weight:650;letter-spacing:.05em;text-transform:uppercase;background:var(--panel2)}
|
|
29
|
+
.tvtable th{font-size:10.5px}
|
|
30
|
+
.md th{font-size:.88em;background:color-mix(in srgb,var(--accent) 14%,var(--panel2));border-bottom-color:color-mix(in srgb,var(--accent) 40%,var(--line))}
|
|
31
|
+
.md tbody tr:nth-child(odd)>td{background:color-mix(in srgb,var(--ink) 7%,transparent)}
|
|
32
|
+
|
|
33
|
+
/* inline code: amber on a faint amber wash */
|
|
34
|
+
.md code,.mdi code{display:inline;max-height:none;margin:0;padding:0 var(--s1);border-radius:4px;
|
|
35
|
+
font:.9em/1.4 ui-monospace,Menlo,monospace;color:var(--code);background:var(--codebg);
|
|
36
|
+
border:1px solid color-mix(in srgb,var(--code) 28%,transparent);white-space:pre-wrap;overflow-wrap:anywhere}
|
|
37
|
+
|
|
38
|
+
/* a code block, in its box with its « copy » button: shown on hover and on focus, always on a touch screen */
|
|
39
|
+
.mdpre{position:relative;margin:var(--s3) 0 var(--s2)}
|
|
40
|
+
.md>.mdpre:first-child{margin-top:0}
|
|
41
|
+
.md pre{margin:0;padding:var(--s2);background:var(--bg);border:1px solid var(--line);border-radius:4px;
|
|
42
|
+
overflow-x:auto;font:.92em/1.5 ui-monospace,Menlo,monospace;white-space:pre;transition:border-color .1s}
|
|
43
|
+
.md pre code{padding:0;border:0;background:none;color:var(--ink);font:inherit;white-space:inherit}
|
|
44
|
+
.mdcopy{position:absolute;top:var(--s1);right:var(--s1);height:22px;padding:0 var(--s2);font:11.5px system-ui,sans-serif;
|
|
45
|
+
color:var(--ink);background:var(--panel2);border:1px solid var(--line);border-radius:4px;cursor:pointer;opacity:0;transition:opacity .12s}
|
|
46
|
+
.mdpre:hover .mdcopy,.mdpre:focus-within .mdcopy{opacity:1}
|
|
47
|
+
.mdcopy:hover{border-color:var(--accent)}
|
|
48
|
+
.mdcopy.copied{opacity:1;color:var(--ok);border-color:var(--ok)}
|
|
49
|
+
.mdcopy.refused{opacity:1;color:var(--red);border-color:var(--red)}
|
|
50
|
+
.mdpre.copied pre{border-color:var(--ok)}
|
|
51
|
+
@media (hover:none){.mdcopy{opacity:1}}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// markdown a human copies values out of (an ask): the readme's type scale, every inline code span a chip that a
|
|
2
|
-
// click copies whole
|
|
3
|
-
// page and tints what was copied, never with added text, so nothing moves. The html is md.ts
|
|
4
|
-
|
|
2
|
+
// click copies whole (a code block copies from its own button, as everywhere: code-copy.ts). A copy says so in a toast
|
|
3
|
+
// at the foot of the page and tints what was copied, never with added text, so nothing moves. The html is md.ts
|
|
4
|
+
// renderMd's, so sanitized
|
|
5
|
+
import { memo, useCallback, useEffect, useState } from 'react'
|
|
5
6
|
import { createPortal } from 'react-dom'
|
|
6
7
|
import { renderMd } from './md.ts'
|
|
7
8
|
|
|
@@ -40,40 +41,17 @@ export function CopyMd({ md, className = '' }: { md: string; className?: string
|
|
|
40
41
|
)
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
/** the markdown itself, drawn again only when its html changes: a render rewrites the html and would drop the
|
|
44
|
-
*
|
|
45
|
-
const MdBox = memo(({ html, className, copy }: { html: string; className: string; copy: (text: string, el: Element) => void }) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}, [html])
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
ref={box}
|
|
62
|
-
className={`md readme-body mdcopyable ${className}`}
|
|
63
|
-
dangerouslySetInnerHTML={{ __html: html }}
|
|
64
|
-
onClick={(e) => {
|
|
65
|
-
const t = e.target as Element
|
|
66
|
-
const btn = t.closest('.mdcopy')
|
|
67
|
-
const pre = btn?.parentElement
|
|
68
|
-
if (btn && pre) {
|
|
69
|
-
copy(pre.querySelector('code')?.textContent ?? '', pre)
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
const code = t.closest('code')
|
|
73
|
-
// a selection being made is never overwritten by a click's copy
|
|
74
|
-
if (!code || code.closest('pre') || String(globalThis.getSelection?.() ?? '') !== '') return
|
|
75
|
-
copy(code.textContent ?? '', code)
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
)
|
|
79
|
-
})
|
|
44
|
+
/** the markdown itself, drawn again only when its html changes: a render rewrites the html and would drop the tint
|
|
45
|
+
* of what was just copied */
|
|
46
|
+
const MdBox = memo(({ html, className, copy }: { html: string; className: string; copy: (text: string, el: Element) => void }) => (
|
|
47
|
+
<div
|
|
48
|
+
className={`md readme-body mdcopyable ${className}`}
|
|
49
|
+
dangerouslySetInnerHTML={{ __html: html }}
|
|
50
|
+
onClick={(e) => {
|
|
51
|
+
const code = (e.target as Element).closest('code')
|
|
52
|
+
// a selection being made is never overwritten by a click's copy
|
|
53
|
+
if (!code || code.closest('pre') || String(globalThis.getSelection?.() ?? '') !== '') return
|
|
54
|
+
copy(code.textContent ?? '', code)
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
))
|
package/src/serve/hub-app/md.ts
CHANGED
|
@@ -14,16 +14,23 @@ const CARD_TAGS = [
|
|
|
14
14
|
'code', 'pre', 'strong', 'em', 'b', 'i', 'a', 'br', 'blockquote', 'hr',
|
|
15
15
|
]
|
|
16
16
|
|
|
17
|
+
/** every code block in a box with its « copy » button (code-copy.ts answers its click): added after the sanitizer,
|
|
18
|
+
* which keeps no button, and outside the block, so the button stays put while the block scrolls sideways */
|
|
19
|
+
const withCopy = (html: string): string =>
|
|
20
|
+
html.replaceAll('<pre>', '<div class="mdpre"><pre>').replaceAll('</pre>', '</pre><button type="button" class="mdcopy" title="copy the whole block">copy</button></div>')
|
|
21
|
+
|
|
17
22
|
export const renderMd = (src: string): string =>
|
|
18
|
-
sanitizeHtml(marked.parse(src) as string, {
|
|
23
|
+
withCopy(sanitizeHtml(marked.parse(src) as string, {
|
|
19
24
|
allowedTags: CARD_TAGS,
|
|
20
25
|
allowedAttributes: { a: ['href', 'target', 'rel'] },
|
|
21
26
|
allowedSchemes: ['http', 'https'],
|
|
22
27
|
allowProtocolRelative: false,
|
|
28
|
+
// a placeholder an agent writes (`<address>`) shows as written, never vanishes as an unknown tag
|
|
29
|
+
disallowedTagsMode: 'escape',
|
|
23
30
|
transformTags: {
|
|
24
31
|
a: (tagName, attribs) => ({ tagName, attribs: { ...attribs, target: '_blank', rel: 'noreferrer' } }),
|
|
25
32
|
},
|
|
26
|
-
})
|
|
33
|
+
}))
|
|
27
34
|
|
|
28
35
|
/** ONE LINE of markdown, for text that already carries a line structure of
|
|
29
36
|
* its own. A wire line keeps its prefix and its place in the log, and the
|
|
@@ -35,6 +42,8 @@ export const renderMdInline = (src: string): string =>
|
|
|
35
42
|
allowedAttributes: { a: ['href', 'target', 'rel'] },
|
|
36
43
|
allowedSchemes: ['http', 'https'],
|
|
37
44
|
allowProtocolRelative: false,
|
|
45
|
+
// a placeholder an agent writes (`<address>`) shows as written, never vanishes as an unknown tag
|
|
46
|
+
disallowedTagsMode: 'escape',
|
|
38
47
|
transformTags: {
|
|
39
48
|
a: (tagName, attribs) => ({ tagName, attribs: { ...attribs, target: '_blank', rel: 'noreferrer' } }),
|
|
40
49
|
},
|
|
@@ -55,7 +64,7 @@ export const readmeImageSrc = (src: string, fileUrl: (rel: string) => string): s
|
|
|
55
64
|
* lean on. A relative image is rewritten to the repo's file route, an image
|
|
56
65
|
* with no loadable source is dropped */
|
|
57
66
|
export const renderReadme = (src: string, fileUrl: (rel: string) => string): string =>
|
|
58
|
-
sanitizeHtml(marked.parse(src) as string, {
|
|
67
|
+
withCopy(sanitizeHtml(marked.parse(src) as string, {
|
|
59
68
|
allowedTags: [...CARD_TAGS, 'h5', 'h6', 'img', 'details', 'summary', 'kbd', 'sup', 'sub', 'del'],
|
|
60
69
|
allowedAttributes: { a: ['href', 'target', 'rel'], img: ['src', 'alt', 'title', 'width', 'height'] },
|
|
61
70
|
allowedSchemes: ['http', 'https'],
|
|
@@ -69,7 +78,7 @@ export const renderReadme = (src: string, fileUrl: (rel: string) => string): str
|
|
|
69
78
|
},
|
|
70
79
|
},
|
|
71
80
|
exclusiveFilter: (frame) => frame.tag === 'img' && (frame.attribs.src ?? '') === '',
|
|
72
|
-
})
|
|
81
|
+
}))
|
|
73
82
|
|
|
74
83
|
/** a wiki page in the wikis page's preview: the card allowlist, and every ref
|
|
75
84
|
* the server resolved (`links`, token → node, graph-pages.ts) as an anchor
|
|
@@ -77,7 +86,7 @@ export const renderReadme = (src: string, fileUrl: (rel: string) => string): str
|
|
|
77
86
|
* the sheet tells them apart: `@` loads with the page (eager), `→`, a link or
|
|
78
87
|
* a path in a code span is read on demand (lazy, written `→ path` here
|
|
79
88
|
* whatever the page wrote) */
|
|
80
|
-
export const renderWikiPage = (src: string, links: Record<string, string
|
|
89
|
+
export const renderWikiPage = (src: string, links: Record<string, string>, image?: (rel: string) => string | null): string => {
|
|
81
90
|
const to = (t: string, eager = false): string | null => (links[t] == null ? null : `#wiki${eager ? '-eager' : ''}:${encodeURIComponent(links[t]!)}`)
|
|
82
91
|
// fences stay as written: a ref in a code block is an example, not a link
|
|
83
92
|
const linked = src.split(/(^```[\s\S]*?^```\s*$)/m).map((part, i) => i % 2 === 1 ? part : part
|
|
@@ -87,12 +96,19 @@ export const renderWikiPage = (src: string, links: Record<string, string>): stri
|
|
|
87
96
|
// a code span that is exactly a page's path: a lazy ref, its arrow added unless the page wrote one
|
|
88
97
|
.replace(/(→\s*)?(?<!\[)`([\w.][\w./-]*\.md)`/g, (m, arrow: string | undefined, t: string) => (to(t) == null ? m : `${arrow ?? '→ '}[\`${t}\`](${to(t)})`)),
|
|
89
98
|
).join('')
|
|
90
|
-
return sanitizeHtml(marked.parse(linked) as string, {
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
return withCopy(sanitizeHtml(marked.parse(linked) as string, {
|
|
100
|
+
// a picture only through `image`: a file of the wiki itself (a generated page's icons), never a remote url
|
|
101
|
+
allowedTags: [...CARD_TAGS, 'h5', 'h6', 'del', ...(image ? ['img'] : [])],
|
|
102
|
+
allowedAttributes: { a: ['href', 'target', 'rel', 'data-wiki', 'data-ref'], img: ['src', 'alt', 'title', 'width', 'height'] },
|
|
93
103
|
allowedSchemes: ['http', 'https'],
|
|
94
104
|
allowProtocolRelative: false,
|
|
105
|
+
exclusiveFilter: (frame) => frame.tag === 'img' && (frame.attribs.src ?? '') === '',
|
|
95
106
|
transformTags: {
|
|
107
|
+
img: (tagName, attribs): sanitizeHtml.Tag => {
|
|
108
|
+
const { src: raw, ...rest } = attribs
|
|
109
|
+
const src = image?.(raw ?? '') ?? null
|
|
110
|
+
return { tagName, attribs: src == null ? rest : { ...rest, src } }
|
|
111
|
+
},
|
|
96
112
|
a: (tagName, attribs): sanitizeHtml.Tag => {
|
|
97
113
|
const href = attribs.href ?? ''
|
|
98
114
|
const ref = /^#wiki(-eager)?:(.*)$/.exec(href)
|
|
@@ -100,5 +116,5 @@ export const renderWikiPage = (src: string, links: Record<string, string>): stri
|
|
|
100
116
|
return { tagName, attribs: { ...attribs, target: '_blank', rel: 'noreferrer' } }
|
|
101
117
|
},
|
|
102
118
|
},
|
|
103
|
-
})
|
|
119
|
+
}))
|
|
104
120
|
}
|
|
@@ -164,7 +164,7 @@ export const ToolsBar = observer(({ app }: { app: RepoSt }) => {
|
|
|
164
164
|
) : null}
|
|
165
165
|
<span className="sp" />
|
|
166
166
|
<button className="ghost" onClick={() => m.toggleVariants()}>
|
|
167
|
-
{m.variantsOpen ? 'variants
|
|
167
|
+
<Caret side open={m.variantsOpen} /> {m.variantsOpen ? 'variants' : `variants (${d.rolls.length})`}
|
|
168
168
|
</button>
|
|
169
169
|
</div>
|
|
170
170
|
)
|
|
@@ -181,7 +181,7 @@ export const VariantsBar = observer(({ app }: { app: RepoSt }) => {
|
|
|
181
181
|
if (m.curId == null) return null
|
|
182
182
|
if (!m.variantsOpen) return (
|
|
183
183
|
<div className="vbar closed" title="open the variants bar" onClick={() => m.toggleVariants()}>
|
|
184
|
-
<span className="vcount">{rolls.length}</span
|
|
184
|
+
<span className="vcount">{rolls.length}</span><Caret side open={false} />
|
|
185
185
|
</div>
|
|
186
186
|
)
|
|
187
187
|
return (
|
|
@@ -9,6 +9,7 @@ import { MESSAGES_TABS } from '../../../messages/tabs.ts'
|
|
|
9
9
|
import type { RepoSt } from '../repo-st.ts'
|
|
10
10
|
import { NEW_FAMILY, type MessagesSt, type RunView, type StoreView } from './messages-st.ts'
|
|
11
11
|
import { ThreadControl } from '../review/thread-control.tsx'
|
|
12
|
+
import { SectionHead } from '../section-head.tsx'
|
|
12
13
|
|
|
13
14
|
type Msg = StoreView['messages'][number]
|
|
14
15
|
|
|
@@ -169,7 +170,7 @@ const Messages = observer(({ ms }: { ms: MessagesSt }) => {
|
|
|
169
170
|
<Note ms={ms} at="" />
|
|
170
171
|
{[...families].map(([f, list]) => (
|
|
171
172
|
<div key={f} className="msg-family">
|
|
172
|
-
<
|
|
173
|
+
<SectionHead label={f} n={list.length} />
|
|
173
174
|
{list.map((m) => (
|
|
174
175
|
<MessageCard key={m.id} ms={ms} m={m} />
|
|
175
176
|
))}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Its one write is the owner's suggestion (a message, a phrasing), sent with the hash of the file it read
|
|
4
4
|
import { makeAutoObservable, runInAction } from 'mobx'
|
|
5
5
|
import type { RunView, StoreView } from '../../../messages/score.ts'
|
|
6
|
-
import type { MessageSuggestion, Suggestion } from '../../../messages/
|
|
6
|
+
import type { MessageSuggestion, Suggestion } from '../../../messages/write.ts'
|
|
7
7
|
import type { MessagesTab } from '../../../messages/tabs.ts'
|
|
8
8
|
import { reach } from '../reach.ts'
|
|
9
9
|
import type { RepoSt } from '../repo-st.ts'
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
.msg-page nav button,.msg-page select{font:inherit;padding:var(--s1) var(--s3);border-radius:7px;border:1px solid var(--line);background:var(--panel);color:var(--ink);cursor:pointer}
|
|
9
9
|
.msg-page nav button.on{background:var(--accent);border-color:var(--accent);color:var(--panel)}
|
|
10
10
|
.msg-family{display:grid;gap:var(--s3)}
|
|
11
|
-
.msg-family h2{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);margin:var(--s3) 0 0}
|
|
12
11
|
.msg-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:var(--s3) var(--s4);display:grid;gap:var(--s2);min-width:0}
|
|
13
12
|
.msg-card h3{margin:0;font-size:15px}
|
|
14
13
|
.msg-card h3 small{color:var(--dim);font-weight:400;margin-left:var(--s2)}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* a post group where a thread refers to it (review/group-block.tsx), and a post's own page in Communications (social/post-page.tsx) */
|
|
2
|
+
.ob-error{color:var(--red);padding:var(--s2) var(--s3);white-space:pre-wrap}
|
|
3
|
+
.ob-draft{margin:var(--s3) var(--s2);padding:var(--s3);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;background:var(--panel2);display:flex;flex-direction:column;gap:var(--s2)}
|
|
4
|
+
.ob-head{display:flex;align-items:baseline;gap:var(--s2);flex-wrap:wrap}
|
|
5
|
+
.ob-kind{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--dim)}
|
|
6
|
+
.ob-places{display:flex;flex-direction:column;gap:var(--s1)}
|
|
7
|
+
.ob-place{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;padding:var(--s1) 0;border-bottom:1px dashed var(--line)}
|
|
8
|
+
.ob-place:last-child{border-bottom:0}
|
|
9
|
+
.ob-place a{color:var(--ok);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
|
|
10
|
+
.ob-place input{flex:1;min-width:160px}
|
|
11
|
+
.ob-account{min-width:140px;font-weight:600}
|
|
12
|
+
.ob-s-dropped .ob-account{color:var(--dim);text-decoration:line-through}
|
|
13
|
+
.ob-refused{font-size:12px;color:var(--warn)}
|
|
14
|
+
.ob-words{flex-basis:100%;font-size:12px}
|
|
15
|
+
.ob-words summary{cursor:pointer}
|
|
16
|
+
.ob-words .rv-pre{white-space:pre-wrap;padding:var(--s2);background:var(--bg);border-radius:6px}
|
|
17
|
+
.ob-acts{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
|
|
18
|
+
.ob-versions summary{cursor:pointer;color:var(--dim);font-size:12px}
|
|
19
|
+
.so-postpage .so-text{white-space:pre-wrap}
|
|
20
|
+
.so-threadrefs{display:flex;flex-direction:column;gap:var(--s1)}
|
|
21
|
+
.so-threadref{display:flex;align-items:center;gap:var(--s2);color:var(--ink);text-decoration:none;padding:var(--s1) var(--s2);border-radius:6px}
|
|
22
|
+
.so-threadref:hover{background:var(--panel2)}
|
|
23
|
+
.so-threadref.open{font-weight:600}
|
|
24
|
+
.so-cmd{display:inline-flex;align-items:center;gap:var(--s1)}
|
|
25
|
+
.so-cmd code{font-size:12px}
|
|
26
|
+
@media (max-width:640px){.ob-account{min-width:0}.ob-draft{margin:var(--s2) 0}}
|
|
27
|
+
/* four states in a narrow filter column: two by two, never past its width */
|
|
28
|
+
.seg.so-stateseg{display:grid;grid-template-columns:1fr 1fr;width:100%;height:auto;border-radius:8px}
|
|
29
|
+
.seg.so-stateseg button{min-width:0;height:22px}
|
|
30
|
+
/* an object's card where a thread shows it (review/object-card.tsx): a persona, a value proposition, a page top */
|
|
31
|
+
.oc-card{padding:var(--s3);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;background:var(--panel2);display:flex;flex-direction:column;gap:var(--s2);min-width:0}
|
|
32
|
+
.oc-title{font-weight:600}
|
|
33
|
+
.oc-chip{font-size:11px;padding:0 var(--s1);border:1px solid var(--line);border-radius:3px;color:var(--dim)}
|
|
34
|
+
.oc-fields{display:flex;flex-direction:column;gap:var(--s1)}
|
|
35
|
+
.oc-field{display:grid;grid-template-columns:minmax(56px,84px) minmax(0,1fr);gap:var(--s2);align-items:baseline}
|
|
36
|
+
.oc-field.fill .oc-text{color:var(--warn);font-style:italic}
|
|
37
|
+
.oc-label{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--dim)}
|
|
38
|
+
.oc-lines{display:flex;flex-direction:column;border-top:1px solid var(--line)}
|
|
39
|
+
.oc-line{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:var(--s2);align-items:start;padding:var(--s1) 0;border-bottom:1px solid var(--line)}
|
|
40
|
+
.oc-id{font-family:var(--mono,monospace);font-size:11px;color:var(--dim);padding-top:var(--s0)}
|
|
41
|
+
.oc-words{display:flex;flex-direction:column;gap:var(--s0);min-width:0}
|
|
42
|
+
.oc-second{color:var(--dim)}
|
|
43
|
+
.oc-note{font-size:11px;color:var(--dim)}
|
|
44
|
+
.oc-scores{display:flex;flex-wrap:wrap;gap:var(--s1)}
|
|
45
|
+
.oc-score{font-size:11px;padding:0 var(--s1);border-radius:3px;border:1px solid var(--line);font-variant-numeric:tabular-nums}
|
|
46
|
+
.oc-who{color:var(--dim);margin-right:var(--s1)}
|
|
47
|
+
.oc-best{font-weight:700;font-variant-numeric:tabular-nums;min-width:2.2em;text-align:right}
|
|
48
|
+
.oc-score.hi,.oc-best.hi{color:var(--ok)}
|
|
49
|
+
.oc-score.mid,.oc-best.mid{color:var(--warn)}
|
|
50
|
+
.oc-score.lo,.oc-best.lo,.oc-score.veto{color:var(--red)}
|
|
51
|
+
.oc-run{font-size:11px;color:var(--dim)}
|
|
@@ -80,7 +80,7 @@ export const pageKeys = (home: HomeSt, embed: string | null) => (e: KeyboardEven
|
|
|
80
80
|
if (pk.t === 'picker' || pk.t === 'search') home.palette.toggle()
|
|
81
81
|
else if (pk.t === 'dock') home.dock.cycle()
|
|
82
82
|
else if (pk.t === 'rail') home.layout.toggleRail()
|
|
83
|
-
else if (pk.t === 'home' || pk.t === 'inbox' || pk.t === 'planned' || pk.t === 'activity' || pk.t === 'insights') {
|
|
83
|
+
else if (pk.t === 'home' || pk.t === 'wiki' || pk.t === 'inbox' || pk.t === 'planned' || pk.t === 'activity' || pk.t === 'insights') {
|
|
84
84
|
home.palette.close()
|
|
85
85
|
if (home.machine != null) home.navigate(PLACE_PATH[pk.t === 'home' ? 'overview' : pk.t])
|
|
86
86
|
} else if (pk.t === 'step') {
|
|
@@ -8,7 +8,7 @@ import { useEffect, useRef, useState } from 'react'
|
|
|
8
8
|
import type { RepoSt } from './repo-st.ts'
|
|
9
9
|
import { postJson } from './review/review-kit.ts'
|
|
10
10
|
|
|
11
|
-
type Msg = { shipkit?: unknown; keys?: unknown; title?: unknown; badge?: unknown; hash?: unknown; key?: unknown; code?: unknown; altKey?: unknown; shiftKey?: unknown; metaKey?: unknown; ctrlKey?: unknown; address?: unknown; name?: unknown; text?: unknown }
|
|
11
|
+
type Msg = { shipkit?: unknown; keys?: unknown; title?: unknown; badge?: unknown; hash?: unknown; key?: unknown; code?: unknown; altKey?: unknown; shiftKey?: unknown; metaKey?: unknown; ctrlKey?: unknown; address?: unknown; name?: unknown; text?: unknown; id?: unknown; addresses?: unknown }
|
|
12
12
|
|
|
13
13
|
/** the keys a frame passes up as typed on the hub: ⌥ letters, ⌥⇧ letters, the home's ⌘ keys */
|
|
14
14
|
function replayKey(m: Msg): void {
|
|
@@ -85,6 +85,16 @@ const PageFrame = observer(({ app, id, on }: { app: RepoSt; id: string; on: bool
|
|
|
85
85
|
if (typeof m.address === 'string' && typeof m.text === 'string')
|
|
86
86
|
void postJson<{ id: string }>(app.url('/api/review/note'), { address: m.address, name: typeof m.name === 'string' ? m.name : m.address, text: m.text, from: id }).then((r) => app.showReview(r.id))
|
|
87
87
|
return
|
|
88
|
+
case 'threads-of': {
|
|
89
|
+
const asked = Array.isArray(m.addresses) ? m.addresses.filter((a): a is string => typeof a === 'string') : []
|
|
90
|
+
if (typeof m.id !== 'number' || asked.length === 0) return
|
|
91
|
+
const answer = (objects: unknown[]): void => post({ shipkit: 'threads-of', id: m.id, objects })
|
|
92
|
+
fetch(app.url(`/api/review/of?${asked.map((a) => `address=${encodeURIComponent(a)}`).join('&')}`))
|
|
93
|
+
.then((r) => (r.ok ? (r.json() as Promise<{ objects: unknown[] }>) : { objects: [] }))
|
|
94
|
+
.then((r) => answer(r.objects))
|
|
95
|
+
.catch(() => answer([]))
|
|
96
|
+
return
|
|
97
|
+
}
|
|
88
98
|
case 'key': return replayKey(m)
|
|
89
99
|
}
|
|
90
100
|
}
|
|
@@ -85,14 +85,14 @@ export class PaletteSt {
|
|
|
85
85
|
return st.projects.list.filter((p) => p.name !== on).flatMap((p) => ANY_REPO_PAGES.map((id) => ({ id: `page:${p.name}/${id}`, label: sectionLabel(id), section: 'page', repo: p.name, face: { repo: p.name }, run: () => st.openPage(p.name, id) })))
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
/**
|
|
89
|
-
* opened on the inbox. They come once the inbox answers */
|
|
88
|
+
/** every thread that waits for the owner in every repo, the shown one too, under its title (an ask with no thread
|
|
89
|
+
* yet under its number too) and what it waits on, opened on the inbox. They come once the inbox answers */
|
|
90
90
|
get waiting(): Jump[] {
|
|
91
91
|
const st = this.st
|
|
92
92
|
if (st.machine == null) return []
|
|
93
93
|
return st.waiting.rows.map((r) => {
|
|
94
|
-
const n =
|
|
95
|
-
return { id: `waiting:${r.repo}/${r.id}`, label: n != null ? `${n} · ${r.title}` : r.title, section: r.
|
|
94
|
+
const n = /^ask:(\d+)-/.exec(r.id)?.[1]
|
|
95
|
+
return { id: `waiting:${r.repo}/${r.id}`, label: n != null ? `${n} · ${r.title}` : r.title, section: r.wait, repo: r.repo, face: { repo: r.repo }, run: () => st.navigate(r.open) }
|
|
96
96
|
})
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// one pane of the hub that fails to draw shows a small card in its own place, and every other pane keeps working: a
|
|
2
|
+
// lane's half edit served by the hot reload, a bad value in one message. The card names what failed, gives the error's
|
|
3
|
+
// first line, « reload this pane » (a remount) and « copy error » (the whole text, for an agent). React reports what a
|
|
4
|
+
// boundary caught through the console, never as a window error, so bun's dev overlay never covers the hub for it
|
|
5
|
+
import { observer } from 'mobx-react-lite'
|
|
6
|
+
import { Component, Fragment, useState, type ErrorInfo, type ReactNode } from 'react'
|
|
7
|
+
import { errorText, panes, type PaneError } from './pane-errors.ts'
|
|
8
|
+
import { copyText } from './review/review-kit.ts'
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
/** what the pane is ('sidebar', 'thread cell'): the card's words, and what a trip names */
|
|
12
|
+
pane: string
|
|
13
|
+
/** whose pane it is (a repo, a message id), shown before the kind */
|
|
14
|
+
at?: string
|
|
15
|
+
/** a failed pane draws again once this moves (the page it shows): a healthy one never remounts for it */
|
|
16
|
+
resetKey?: string
|
|
17
|
+
children: ReactNode
|
|
18
|
+
}
|
|
19
|
+
type State = { failed: PaneError | null; thrown: unknown; gen: number }
|
|
20
|
+
|
|
21
|
+
export class PaneBoundary extends Component<Props, State> {
|
|
22
|
+
override state: State = { failed: null, thrown: null, gen: 0 }
|
|
23
|
+
|
|
24
|
+
static getDerivedStateFromError(thrown: unknown): Partial<State> {
|
|
25
|
+
return { thrown }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override componentDidCatch(err: unknown, info: ErrorInfo): void {
|
|
29
|
+
this.setState({ failed: panes.report(this.path, err, info.componentStack ?? '') })
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
override componentDidUpdate(prev: Props): void {
|
|
33
|
+
if (prev.resetKey !== this.props.resetKey && (this.state.thrown != null || this.state.failed != null)) this.reload()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get path(): string {
|
|
37
|
+
return this.props.at == null || this.props.at === '' ? this.props.pane : `${this.props.at} › ${this.props.pane}`
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private readonly reload = (): void => this.setState((s) => ({ failed: null, thrown: null, gen: s.gen + 1 }))
|
|
41
|
+
|
|
42
|
+
override render(): ReactNode {
|
|
43
|
+
if (this.state.thrown != null || this.state.failed != null) return <PaneCard path={this.path} failed={this.state.failed} thrown={this.state.thrown} reload={this.reload} />
|
|
44
|
+
return (
|
|
45
|
+
<Fragment key={this.state.gen}>
|
|
46
|
+
<Trip kind={this.props.pane} path={this.path} />
|
|
47
|
+
{this.props.children}
|
|
48
|
+
</Fragment>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** throws while the pane is tripped (pane-errors.ts) */
|
|
54
|
+
const Trip = observer(({ kind, path }: { kind: string; path: string }) => {
|
|
55
|
+
if (panes.isTripped(kind, path)) throw new Error(`the ${path} pane was tripped on purpose (app.panes.untrip to clear it)`)
|
|
56
|
+
return null
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const PaneCard = ({ path, failed, thrown, reload }: { path: string; failed: PaneError | null; thrown: unknown; reload: () => void }) => {
|
|
60
|
+
const [copied, setCopied] = useState(false)
|
|
61
|
+
const line = failed?.message ?? (thrown instanceof Error ? `${thrown.name}: ${thrown.message}` : String(thrown)).split('\n')[0]
|
|
62
|
+
return (
|
|
63
|
+
<div className="pane-err" role="alert" data-pane={path}>
|
|
64
|
+
<b>the {path} pane failed to draw</b>
|
|
65
|
+
<code>{line}</code>
|
|
66
|
+
<span className="pane-errrow">
|
|
67
|
+
<button onClick={reload}>reload this pane</button>
|
|
68
|
+
<button className="ghost" disabled={failed == null} onClick={() => failed != null && void copyText(errorText(failed)).then(setCopied)}>{copied ? 'copied' : 'copy error'}</button>
|
|
69
|
+
</span>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// what failed to draw in the hub, pane by pane (pane-boundary.tsx). A caught error is loud where agents look: the
|
|
2
|
+
// page console, which `sk shot` and the browser checks read, and the daemon's log on the home, one line each
|
|
3
|
+
// (home-routes.ts, /api/home/page-error). `trip` makes a pane throw on its next draw: the browser check's trigger, and a
|
|
4
|
+
// console probe (`app.panes.trip('sidebar')`)
|
|
5
|
+
import { makeAutoObservable, observable } from 'mobx'
|
|
6
|
+
|
|
7
|
+
export type PaneError = { pane: string; message: string; stack: string; components: string; at: number; url: string }
|
|
8
|
+
|
|
9
|
+
/** the first line of what was thrown, the line the card shows */
|
|
10
|
+
export const firstLine = (e: unknown): string => {
|
|
11
|
+
const s = e instanceof Error ? `${e.name}: ${e.message}` : String(e)
|
|
12
|
+
return s.split('\n')[0] ?? s
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** everything an agent needs to find the cause, as one text */
|
|
16
|
+
export const errorText = (e: PaneError): string =>
|
|
17
|
+
[`the hub's ${e.pane} pane failed to draw: ${e.message}`, `at ${e.url}`, e.stack, e.components === '' ? '' : `components:${e.components}`].filter((l) => l !== '').join('\n')
|
|
18
|
+
|
|
19
|
+
/** how many caught errors the page keeps for the console */
|
|
20
|
+
const KEPT = 50
|
|
21
|
+
|
|
22
|
+
export class PaneErrors {
|
|
23
|
+
list: PaneError[] = []
|
|
24
|
+
readonly tripped = observable.set<string>()
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
makeAutoObservable(this, { tripped: false })
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
report(pane: string, err: unknown, components: string): PaneError {
|
|
31
|
+
const e: PaneError = { pane, message: firstLine(err), stack: err instanceof Error ? (err.stack ?? '') : '', components, at: Date.now(), url: location.href }
|
|
32
|
+
this.list = [...this.list.slice(-(KEPT - 1)), e]
|
|
33
|
+
console.error(errorText(e))
|
|
34
|
+
if (document.body.dataset.home != null)
|
|
35
|
+
void fetch('/api/home/page-error', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ pane, message: e.message, url: e.url }) }).catch(() => {})
|
|
36
|
+
return e
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
trip(pane: string): void {
|
|
40
|
+
this.tripped.add(pane)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
untrip(pane: string): void {
|
|
44
|
+
this.tripped.delete(pane)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** a pane trips by its kind ('sidebar') or its whole path ('app › sidebar') */
|
|
48
|
+
isTripped(kind: string, path: string): boolean {
|
|
49
|
+
return this.tripped.has(kind) || this.tripped.has(path)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** the one log of the page, under the root as `app.panes` */
|
|
54
|
+
export const panes = new PaneErrors()
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// the machine's plan, already carried by /api/resources.json, so the page
|
|
4
4
|
// reads nothing of its own. The home's planned page is the same plan for
|
|
5
5
|
// every repo at once.
|
|
6
|
+
import { CardHead } from './card-head.tsx'
|
|
6
7
|
import { observer } from 'mobx-react-lite'
|
|
7
8
|
import type { PlanRow } from '../../plan/planner.ts'
|
|
8
9
|
import { LAST_TONE, markOf, reasonWords, whenWords } from './planned-st.ts'
|
|
@@ -44,8 +45,8 @@ export const PlanPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
44
45
|
</div>
|
|
45
46
|
<div className="usays">what the machine runs here on its own time, soonest first. Every repo at once: the planned page (⌘')</div>
|
|
46
47
|
{app.cols.planned == null ? <div className="dim">no plan covers this repo</div> : null}
|
|
47
|
-
{timed.length > 0 ? <section className="csec"><
|
|
48
|
-
{onSave.length > 0 ? <section className="csec"><
|
|
48
|
+
{timed.length > 0 ? <section className="csec"><CardHead title="next" n={timed.length} /><PlanTable app={app} rows={timed} /></section> : null}
|
|
49
|
+
{onSave.length > 0 ? <section className="csec"><CardHead title="on a save only" n={onSave.length} /><PlanTable app={app} rows={onSave} /></section> : null}
|
|
49
50
|
</div>
|
|
50
51
|
)
|
|
51
52
|
})
|
|
@@ -15,7 +15,7 @@ import type { HomeSt } from './home-st.ts'
|
|
|
15
15
|
import { checkAddress, plainClick, repoPage } from './home-st.ts'
|
|
16
16
|
import { LAST_TONE, markOf, reasonWords, whenWords, type Section } from './planned-st.ts'
|
|
17
17
|
import { ageWords, stampWords } from './time-ago.tsx'
|
|
18
|
-
import {
|
|
18
|
+
import { SectionHead } from './section-head.tsx'
|
|
19
19
|
|
|
20
20
|
/** a link that works as one (a new tab on cmd+click) and moves in place on a plain click */
|
|
21
21
|
const InPlace = ({ href, className, go, children }: { href: string; className: string; go: () => void; children: ReactNode }) => (
|
|
@@ -100,13 +100,13 @@ export const PlannedView = observer(({ app }: { app: HomeSt }) => {
|
|
|
100
100
|
const item = <Row key={`${row.repo}\0${row.check}`} app={app} r={row} now={now} />
|
|
101
101
|
if (section === prev) return [item]
|
|
102
102
|
prev = section
|
|
103
|
-
return [<
|
|
103
|
+
return [<SectionHead key={`s:${section}`} label={section} />, item]
|
|
104
104
|
})}
|
|
105
105
|
{d == null ? <div className="pldim">loading…</div> : st.rows.length === 0 ? <div className="pldim">{st.timed === 0 ? 'nothing is planned' : 'nothing matches'}</div> : null}
|
|
106
106
|
</div>
|
|
107
107
|
{st.waitingLine !== '' ? (
|
|
108
108
|
<div className="plwait">
|
|
109
|
-
<
|
|
109
|
+
<SectionHead label={st.waitingLine} open={st.waitingOpen} onFold={() => st.toggleWaiting()} />
|
|
110
110
|
{st.waitingOpen ? <div className="pllist">{st.waiting.map((r) => <Row key={`${r.repo}\0${r.check}`} app={app} r={r} now={now} />)}</div> : null}
|
|
111
111
|
</div>
|
|
112
112
|
) : null}
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
.plfind{display:block;width:240px;max-width:100%;box-sizing:border-box;margin-bottom:var(--s3);background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:4px;padding:var(--s1) var(--s2);font:inherit}
|
|
7
7
|
.plfind:focus{outline:none;border-color:var(--accent)}
|
|
8
8
|
.pllist{max-width:560px}
|
|
9
|
-
.plsec{margin-top:var(--s3);padding:var(--s1) var(--s2);color:var(--dim);text-transform:lowercase}
|
|
10
|
-
.plsec:first-child{margin-top:0}
|
|
11
9
|
.plr{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;column-gap:var(--s3);padding:var(--s0) var(--s2);border-radius:3px;white-space:nowrap}
|
|
12
10
|
.plr:hover{background:var(--panel)}
|
|
13
11
|
.plwhen{color:var(--dim);font-variant-numeric:tabular-nums}
|
|
@@ -25,8 +23,6 @@
|
|
|
25
23
|
.s-due{background:var(--ink)}
|
|
26
24
|
.s-waiting{border:1px dashed var(--dim)}
|
|
27
25
|
.plwait{margin-top:var(--s3)}
|
|
28
|
-
.plwaitline{all:unset;cursor:pointer;color:var(--dim);font-size:12px}
|
|
29
|
-
.plwaitline:hover{color:var(--ink)}
|
|
30
26
|
.s-failed{width:auto;height:auto;border-radius:0;font-style:normal;color:var(--red)}
|
|
31
27
|
.s-failed::before{content:'✕'}
|
|
32
28
|
.m-failed .plmark{color:var(--red)}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// lines alone, never a card per process. The process a tree row opened gets
|
|
3
3
|
// its description and its log under the table. pm runs them, so the page
|
|
4
4
|
// reads the machine, never the hub.
|
|
5
|
+
import { CardHead } from './card-head.tsx'
|
|
5
6
|
import { observer } from 'mobx-react-lite'
|
|
6
7
|
import { useEffect, useRef } from 'react'
|
|
7
8
|
import { Log, ProcessMenu, ProcessTable } from './home-strip.tsx'
|
|
@@ -18,9 +19,9 @@ const ProcessDetail = observer(({ app, r }: { app: RepoSt; r: ProcessRow }) => {
|
|
|
18
19
|
if (m == null) return null
|
|
19
20
|
return (
|
|
20
21
|
<section ref={el} className="csec pdetail" id={`process-${r.id}`}>
|
|
21
|
-
<
|
|
22
|
+
<CardHead title={r.label} />
|
|
22
23
|
<ProcessMenu m={m} r={r} close={noop} lastLog={r.tail.length === 0} />
|
|
23
|
-
{r.tail.length === 0 ? null : <><
|
|
24
|
+
{r.tail.length === 0 ? null : <><CardHead title="log" /><Log lines={r.tail} /></>}
|
|
24
25
|
</section>
|
|
25
26
|
)
|
|
26
27
|
})
|