rvlib-shipkit 2.19.0 → 2.21.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.
Files changed (196) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/package.json +1 -1
  3. package/src/annex/annex.ts +227 -0
  4. package/src/annex/offload.ts +279 -0
  5. package/src/checks/SK004-gitignore-policy.check.ts +6 -3
  6. package/src/checks/SK040-release-words.check.ts +43 -0
  7. package/src/checks/SK041-annex-links.check.ts +28 -0
  8. package/src/checks/SK042-post-kinds.check.ts +73 -0
  9. package/src/cli/cmd_Annex.ts +179 -0
  10. package/src/cli/cmd_Commands.ts +4 -1
  11. package/src/cli/cmd_GlobalProcesses.ts +2 -107
  12. package/src/cli/cmd_Home.ts +4 -3
  13. package/src/cli/cmd_Messages.ts +155 -0
  14. package/src/cli/cmd_Overview.ts +2 -1
  15. package/src/cli/cmd_Releases.ts +84 -0
  16. package/src/cli/cmd_Review.ts +176 -12
  17. package/src/cli/cmd_Shot.ts +4 -4
  18. package/src/cli/cmd_Social.ts +151 -8
  19. package/src/cli/cmd_Sound.ts +17 -4
  20. package/src/cli/cmd_Trailer.ts +67 -1
  21. package/src/cli/family-pages.ts +2 -0
  22. package/src/cli/kit/index.ts +1 -1
  23. package/src/cli/kit/verb.ts +11 -3
  24. package/src/cli/registry.ts +7 -1
  25. package/src/collections/collection-types.ts +8 -1
  26. package/src/collections/providers.ts +4 -1
  27. package/src/collections/review.ts +23 -4
  28. package/src/commands/model.ts +36 -0
  29. package/src/commands/registry.ts +49 -0
  30. package/src/commands/routes.ts +59 -0
  31. package/src/commands/runner.ts +35 -0
  32. package/src/commands/runs.ts +112 -0
  33. package/src/core/app-icon.ts +4 -3
  34. package/src/core/icon-type.ts +8 -0
  35. package/src/core/jobs.ts +4 -3
  36. package/src/core/layout.ts +11 -2
  37. package/src/core/squircle.ts +95 -0
  38. package/src/home/daemon-jobs.ts +26 -2
  39. package/src/home/global-units.ts +3 -0
  40. package/src/home/gui-app/ShipkitGui.swift +337 -5
  41. package/src/home/gui-app.ts +64 -33
  42. package/src/home/hmr-keep.ts +134 -0
  43. package/src/home/home-start.ts +2 -2
  44. package/src/home/lib-watch.ts +21 -11
  45. package/src/home/pm-switch.ts +112 -0
  46. package/src/home/pm.ts +1 -1
  47. package/src/home/process-apps.ts +181 -0
  48. package/src/home/resources.ts +3 -3
  49. package/src/home/run-web.ts +7 -4
  50. package/src/home/serve-web.ts +64 -14
  51. package/src/identities/collection.ts +49 -0
  52. package/src/identities/identities.ts +121 -14
  53. package/src/identities/machine.ts +4 -3
  54. package/src/identities/rating.ts +33 -0
  55. package/src/identities/shown.ts +170 -0
  56. package/src/identities/steps.ts +5 -0
  57. package/src/media-store/purge.ts +15 -1
  58. package/src/media-store/remote.ts +22 -6
  59. package/src/messages/brief.ts +117 -0
  60. package/src/messages/collection.ts +40 -0
  61. package/src/messages/model.ts +171 -0
  62. package/src/messages/routes.ts +15 -0
  63. package/src/messages/score.ts +182 -0
  64. package/src/messages/tabs.ts +13 -0
  65. package/src/release/notes.ts +130 -0
  66. package/src/release/run-bump.ts +41 -18
  67. package/src/release/run-release.ts +22 -4
  68. package/src/release/run-releases.ts +17 -15
  69. package/src/release/unit-resolve.ts +9 -0
  70. package/src/releases/add.ts +94 -0
  71. package/src/releases/before.ts +31 -0
  72. package/src/releases/collection.ts +36 -0
  73. package/src/releases/from-card.ts +151 -0
  74. package/src/releases/model.ts +327 -0
  75. package/src/releases/pictures.ts +110 -0
  76. package/src/releases/routes.ts +36 -0
  77. package/src/releases/store.ts +71 -0
  78. package/src/repo-config.ts +5 -0
  79. package/src/review/cells.ts +0 -11
  80. package/src/review/format.ts +10 -6
  81. package/src/review/http.ts +1 -1
  82. package/src/review/model.ts +102 -3
  83. package/src/review/notes.ts +2 -48
  84. package/src/review/routes.ts +28 -10
  85. package/src/review/stage-card.ts +197 -0
  86. package/src/review/stage-routes.ts +123 -0
  87. package/src/review/store.ts +47 -1
  88. package/src/review/trailer-card.ts +99 -0
  89. package/src/review/trailer-desk.ts +76 -4
  90. package/src/review/trailer-model.ts +106 -7
  91. package/src/review/trailer-notes.ts +45 -0
  92. package/src/review/trailer-routes.ts +119 -13
  93. package/src/review/trailer-voices.ts +144 -0
  94. package/src/review/watchers.ts +58 -1
  95. package/src/serve/hub-app/app-bridge.ts +71 -0
  96. package/src/serve/hub-app/benign-errors.ts +22 -0
  97. package/src/serve/hub-app/commands/commands-page.tsx +122 -0
  98. package/src/serve/hub-app/commands/commands-st.ts +177 -0
  99. package/src/serve/hub-app/commands.css +24 -0
  100. package/src/serve/hub-app/hash-route.ts +59 -8
  101. package/src/serve/hub-app/home-st.ts +19 -2
  102. package/src/serve/hub-app/home.html +3 -0
  103. package/src/serve/hub-app/hub-app.tsx +8 -0
  104. package/src/serve/hub-app/icons.tsx +5 -0
  105. package/src/serve/hub-app/identities-view.tsx +4 -1
  106. package/src/serve/hub-app/identities.css +1 -0
  107. package/src/serve/hub-app/index.html +3 -0
  108. package/src/serve/hub-app/keys.ts +2 -2
  109. package/src/serve/hub-app/machine-st.ts +41 -10
  110. package/src/serve/hub-app/messages/messages-page.tsx +354 -0
  111. package/src/serve/hub-app/messages/messages-st.ts +74 -0
  112. package/src/serve/hub-app/messages.css +35 -0
  113. package/src/serve/hub-app/project-list.css +7 -2
  114. package/src/serve/hub-app/project-list.tsx +9 -0
  115. package/src/serve/hub-app/projects-svc.ts +16 -6
  116. package/src/serve/hub-app/releases/releases-page.tsx +187 -0
  117. package/src/serve/hub-app/releases/releases-st.ts +111 -0
  118. package/src/serve/hub-app/releases.css +52 -0
  119. package/src/serve/hub-app/repo-sections.ts +16 -2
  120. package/src/serve/hub-app/repo-st.ts +66 -10
  121. package/src/serve/hub-app/review/clip-st.ts +34 -4
  122. package/src/serve/hub-app/review/kit.tsx +3 -3
  123. package/src/serve/hub-app/review/note-place.ts +31 -0
  124. package/src/serve/hub-app/review/review-cells.tsx +27 -3
  125. package/src/serve/hub-app/review/review-st.ts +77 -2
  126. package/src/serve/hub-app/review/review-thread.tsx +9 -31
  127. package/src/serve/hub-app/review/review-views.tsx +164 -58
  128. package/src/serve/hub-app/review/thread-st.ts +108 -41
  129. package/src/serve/hub-app/review/trailer-card.tsx +187 -0
  130. package/src/serve/hub-app/review/trailer-page.tsx +92 -36
  131. package/src/serve/hub-app/review/trailer-st.ts +306 -34
  132. package/src/serve/hub-app/review/trailer-timeline.tsx +68 -23
  133. package/src/serve/hub-app/review/trailer-voices-st.ts +370 -0
  134. package/src/serve/hub-app/review/trailer-voices.tsx +574 -0
  135. package/src/serve/hub-app/review.css +137 -6
  136. package/src/serve/hub-app/social/comms-page.tsx +65 -28
  137. package/src/serve/hub-app/social/identity-pictures.ts +46 -8
  138. package/src/serve/hub-app/social/kit.tsx +9 -6
  139. package/src/serve/hub-app/social/next-release.tsx +118 -0
  140. package/src/serve/hub-app/social/post-card.tsx +10 -2
  141. package/src/serve/hub-app/social/social-model.ts +39 -3
  142. package/src/serve/hub-app/social/social-page.tsx +179 -65
  143. package/src/serve/hub-app/social/social-st.ts +117 -27
  144. package/src/serve/hub-app/social/stage-popup.tsx +268 -0
  145. package/src/serve/hub-app/social/stage-st.ts +310 -0
  146. package/src/serve/hub-app/social/step-layout.ts +42 -0
  147. package/src/serve/hub-app/social.css +68 -1
  148. package/src/serve/hub-app/tree-build.ts +40 -1
  149. package/src/serve/hub-app/tree-svc.ts +10 -3
  150. package/src/serve/project-gutter-route.ts +12 -2
  151. package/src/serve/project-gutter.ts +4 -2
  152. package/src/serve/same-origin.ts +24 -1
  153. package/src/serve/serve-hub.ts +15 -1
  154. package/src/shipkit-files.ts +9 -7
  155. package/src/shot/box.ts +33 -12
  156. package/src/shot/client.ts +1 -1
  157. package/src/shot/shooter.ts +22 -12
  158. package/src/shot/shot-ask.ts +14 -3
  159. package/src/shot/shot.shipkit.ts +1 -1
  160. package/src/social/desk-index.ts +49 -8
  161. package/src/social/discord-layout.ts +54 -7
  162. package/src/social/drafts.ts +1 -1
  163. package/src/social/fit.ts +84 -0
  164. package/src/social/identity-words.ts +74 -0
  165. package/src/social/kind-pages.ts +41 -0
  166. package/src/social/kinds.ts +93 -0
  167. package/src/social/load.ts +125 -10
  168. package/src/social/media-limit.ts +63 -2
  169. package/src/social/presence.ts +1 -1
  170. package/src/social/publish/bluesky.ts +58 -19
  171. package/src/social/publish/index.ts +47 -6
  172. package/src/social/reach.ts +49 -0
  173. package/src/social/release-stage.ts +277 -0
  174. package/src/social/routes.ts +44 -8
  175. package/src/social/stage.ts +246 -0
  176. package/src/social/strip.ts +85 -0
  177. package/src/social/text.ts +6 -2
  178. package/src/social/unit.ts +57 -1
  179. package/src/social/writes.ts +11 -0
  180. package/src/trailer/bed.ts +111 -0
  181. package/src/trailer/build.ts +72 -40
  182. package/src/trailer/ffmpeg.ts +6 -0
  183. package/src/trailer/grammar.ts +37 -6
  184. package/src/trailer/graph.ts +12 -1
  185. package/src/trailer/public-words.ts +41 -0
  186. package/src/trailer/shot-plan.ts +75 -0
  187. package/src/trailer/shot-state.ts +191 -0
  188. package/src/trailer/sound/audio.ts +28 -0
  189. package/src/trailer/sound/brand.ts +53 -3
  190. package/src/trailer/sound/gen.ts +61 -2
  191. package/src/trailer/sound/index.ts +25 -11
  192. package/src/trailer/sound/presets.ts +86 -5
  193. package/src/trailer/sound/run.ts +1 -1
  194. package/src/trailer/sound/takes.ts +94 -0
  195. package/src/trailer/titles.ts +36 -0
  196. package/src/trailer/url.ts +1 -1
@@ -0,0 +1,310 @@
1
+ // the stage popup's state (wiki tools/shipkit/review-raised-items.md, A post staged from a card): what the card offers
2
+ // (its media, its words, the repo's lines), his text, the rating, where it goes; each change runs a dry stage on the
3
+ // server, so every count, place and problem shown is the desk's own load, never a guess of the page. Enter stages
4
+ import { makeAutoObservable, runInAction } from 'mobx'
5
+ import type { PostRating } from '../../../identities/rating.ts'
6
+ import type { Chip, Stageable } from '../../../review/stage-card.ts'
7
+ import type { StageAccount } from '../../../review/stage-routes.ts'
8
+ import type { DeskKind } from '../../../social/kind-pages.ts'
9
+ import { sourceKind } from '../../../social/kinds.ts'
10
+ import { postJson } from '../review/review-kit.ts'
11
+ import { reach } from '../reach.ts'
12
+
13
+ export type StageData = {
14
+ head: string
15
+ first: string
16
+ title: string
17
+ media: Stageable[]
18
+ words: Chip[]
19
+ identity: { id: string; name: string; adult: boolean } | null
20
+ ratings: PostRating[]
21
+ rating: PostRating | null
22
+ accounts: StageAccount[]
23
+ lines: { text: string; source: string }[]
24
+ slots: { value: string; what: string; taken: boolean }[]
25
+ tags: string[]
26
+ drafts: { slug: string; title: string }[]
27
+ /** the kinds the repo takes, each with what it is for and its rules page */
28
+ kinds?: DeskKind[]
29
+ errors: string[]
30
+ }
31
+
32
+ export type DryAnswer = {
33
+ slug: string
34
+ posts: { key: string; platform: string; place: string; length: number; refused: string }[]
35
+ skipped: { account: string; why: string }[]
36
+ errors: string[]
37
+ polish?: string
38
+ }
39
+
40
+ const DRY_MS = 180
41
+
42
+ /** what a link to the popup prefills: his text, the rating, the kind and a custom kind's reason */
43
+ export type StageFill = { text: string; rating: PostRating | null; kind?: string; kindWhy?: string }
44
+
45
+ /** the two urls a popup talks to, what each of its bodies carries besides his draft (a release draft's slug), and the
46
+ * kind a new draft takes unless he picks another; no kind, the popup writes no draft of its own and picks none */
47
+ export type StageSource = { get: string; post: string; extra?: Record<string, unknown>; kind?: string }
48
+
49
+ /** a card's stage popup */
50
+ export const cardSource = (url: (p: string) => string, card: string): StageSource => ({
51
+ get: url(`/api/review/${encodeURIComponent(card)}/stage`),
52
+ post: url(`/api/review/${encodeURIComponent(card)}/stage`),
53
+ kind: sourceKind({ review: card }),
54
+ })
55
+
56
+ /** a release draft's: the approved cards it ships as its media */
57
+ export const releaseSource = (url: (p: string) => string, slug: string): StageSource => ({ get: url(`/api/social/release-media?slug=${encodeURIComponent(slug)}`), post: url('/api/social/release-media'), extra: { slug } })
58
+
59
+ export class StageSt {
60
+ data: StageData | null = null
61
+ error: string | null = null
62
+ busy = false
63
+ pick = ''
64
+ text = ''
65
+ alt = ''
66
+ rating: PostRating | null = null
67
+ /** what the post is for, its source's kind until he picks another */
68
+ kind = ''
69
+ /** a `custom` kind's line on why no kind fits */
70
+ kindWhy = ''
71
+ tags: string[] = []
72
+ slot = ''
73
+ /** a channel he picked on an account, over its default */
74
+ place: { account: string; place: string } | null = null
75
+ polish = false
76
+ /** a clip's passage, his in and out on its player */
77
+ passage: { from: number | null; to: number | null } = { from: null, to: null }
78
+ /** one copy within the tightest limits of the venues it reaches */
79
+ fit = false
80
+ dry: DryAnswer | null = null
81
+ /** where the text box's cursor stands: a chip goes in there */
82
+ caret = 0
83
+ private timer: ReturnType<typeof setTimeout> | null = null
84
+ private asked = 0
85
+
86
+ constructor(
87
+ /** where the popup reads its data and sends his draft: a card's stage route, or a release draft's media route */
88
+ private readonly source: StageSource,
89
+ /** a pick, or the start of one (`<item>#<view>`): the first media it names */
90
+ want: string,
91
+ private readonly done: (slug: string) => void,
92
+ /** what a link prefills: his text, the rating, the kind */
93
+ private readonly fill?: StageFill,
94
+ ) {
95
+ this.pick = want
96
+ this.kind = source.kind ?? ''
97
+ makeAutoObservable<this, 'source' | 'done' | 'fill' | 'timer' | 'asked'>(this, { source: false, done: false, fill: false, timer: false, asked: false })
98
+ void this.load()
99
+ }
100
+
101
+ async load(): Promise<void> {
102
+ try {
103
+ const r = await reach(this.source.get)
104
+ const d = (await r.json()) as StageData & { error?: string }
105
+ if (!r.ok) throw new Error(d.error ?? `HTTP ${r.status}`)
106
+ runInAction(() => {
107
+ this.data = d
108
+ this.rating = this.fill?.rating ?? d.rating
109
+ const w = this.pick
110
+ const m = d.media.find((x) => x.key === w) ?? d.media.find((x) => w !== '' && (x.key.startsWith(`${w}.`) || x.key.startsWith(`${w}/`))) ?? d.media[0]
111
+ this.pick = m?.key ?? ''
112
+ this.alt = m?.note ?? ''
113
+ this.text = this.fill?.text || (d.words.find((w) => w.from === 'post')?.text ?? '')
114
+ this.caret = this.text.length
115
+ // a kind the link names that the repo takes; any other word keeps the source's
116
+ const k = this.fill?.kind
117
+ if (k && d.kinds?.some((x) => x.id === k)) this.kind = k
118
+ this.kindWhy = this.fill?.kindWhy ?? ''
119
+ })
120
+ this.again()
121
+ } catch (e) {
122
+ runInAction(() => (this.error = (e as Error).message))
123
+ }
124
+ }
125
+
126
+ get media(): Stageable | null {
127
+ return this.data?.media.find((m) => m.key === this.pick) ?? null
128
+ }
129
+
130
+ /** the guard's lines and the load's: Stage waits while one stands; a venue's limit stands no more once « fit » is on */
131
+ get problems(): string[] {
132
+ return (this.dry?.errors ?? []).filter((e) => !(this.fit && this.overLimit(e)))
133
+ }
134
+
135
+ /** a line of a venue's media limit, which « fit » answers */
136
+ overLimit(e: string): boolean {
137
+ return e.includes('« fit » makes it a copy that fits')
138
+ }
139
+
140
+ get anyOverLimit(): boolean {
141
+ return (this.dry?.errors ?? []).some((e) => this.overLimit(e))
142
+ }
143
+
144
+ setIn(t: number): void {
145
+ this.passage = { from: Math.round(t * 100) / 100, to: this.passage.to !== null && this.passage.to > t ? this.passage.to : null }
146
+ }
147
+
148
+ setOut(t: number): void {
149
+ this.passage = { from: this.passage.from !== null && this.passage.from < t ? this.passage.from : 0, to: Math.round(t * 100) / 100 }
150
+ }
151
+
152
+ clearPassage(): void {
153
+ this.passage = { from: null, to: null }
154
+ }
155
+
156
+ setFit(on: boolean): void {
157
+ this.fit = on
158
+ }
159
+
160
+ /** the popup offers a kind: it writes a draft of its own, and the repo lists its kinds */
161
+ get picksKind(): boolean {
162
+ return this.source.kind != null && (this.data?.kinds?.length ?? 0) > 0
163
+ }
164
+
165
+ /** the kind picked, with what it is for and its rules page */
166
+ get kindInfo(): DeskKind | null {
167
+ return this.data?.kinds?.find((k) => k.id === this.kind) ?? null
168
+ }
169
+
170
+ /** a custom kind still waiting for its line on why no kind fits */
171
+ get needsWhy(): boolean {
172
+ return this.picksKind && this.kind === 'custom' && this.kindWhy.trim() === ''
173
+ }
174
+
175
+ get ready(): boolean {
176
+ return this.data !== null && this.rating !== null && this.text.trim() !== '' && !this.needsWhy && this.dry !== null && this.problems.length === 0 && !this.busy
177
+ }
178
+
179
+ /** why Stage waits, in plain words */
180
+ get waits(): string {
181
+ if (this.rating === null) return 'pick a rating: this voice is adult, so no rating is chosen for you'
182
+ if (this.needsWhy) return 'say why no kind fits: a custom post carries its reason'
183
+ if (this.text.trim() === '') return 'write the post'
184
+ if (this.problems.length > 0) return 'fix the line above first'
185
+ return ''
186
+ }
187
+
188
+ setPick(key: string): void {
189
+ this.pick = key
190
+ this.passage = { from: null, to: null }
191
+ const m = this.media
192
+ if (m && (this.alt === '' || this.data?.media.some((x) => x.note === this.alt))) this.alt = m.note
193
+ this.again()
194
+ }
195
+
196
+ setText(t: string, caret?: number): void {
197
+ this.text = t
198
+ if (caret !== undefined) this.caret = caret
199
+ this.again()
200
+ }
201
+
202
+ setCaret(n: number): void {
203
+ this.caret = n
204
+ }
205
+
206
+ /** a chip goes in at the cursor, a space on each side where words would touch */
207
+ insert(words: string): void {
208
+ const at = Math.min(this.caret, this.text.length)
209
+ const before = this.text.slice(0, at)
210
+ const after = this.text.slice(at)
211
+ const lead = before === '' || /\s$/.test(before) ? '' : ' '
212
+ const tail = after === '' || /^\s/.test(after) ? '' : ' '
213
+ this.text = `${before}${lead}${words}${tail}${after}`
214
+ this.caret = before.length + lead.length + words.length
215
+ this.again()
216
+ }
217
+
218
+ setAlt(t: string): void {
219
+ this.alt = t
220
+ this.again()
221
+ }
222
+
223
+ setRating(r: PostRating): void {
224
+ this.rating = r
225
+ this.place = null
226
+ this.again()
227
+ }
228
+
229
+ setKind(k: string): void {
230
+ this.kind = k
231
+ this.again()
232
+ }
233
+
234
+ setKindWhy(t: string): void {
235
+ this.kindWhy = t
236
+ this.again()
237
+ }
238
+
239
+ toggleTag(t: string): void {
240
+ this.tags = this.tags.includes(t) ? this.tags.filter((x) => x !== t) : [...this.tags, t]
241
+ this.again()
242
+ }
243
+
244
+ setSlot(v: string): void {
245
+ this.slot = v
246
+ this.again()
247
+ }
248
+
249
+ setPlace(account: string, place: string, fallback: string): void {
250
+ this.place = place === fallback ? null : { account, place }
251
+ this.again()
252
+ }
253
+
254
+ setPolish(on: boolean): void {
255
+ this.polish = on
256
+ }
257
+
258
+ private body(dry: boolean): Record<string, unknown> {
259
+ return {
260
+ ...this.source.extra,
261
+ pick: this.pick,
262
+ text: this.text,
263
+ rating: this.rating,
264
+ ...(this.picksKind ? { kind: this.kind, ...(this.kind === 'custom' && this.kindWhy.trim() ? { kindWhy: this.kindWhy.trim() } : {}) } : {}),
265
+ alt: this.alt,
266
+ ...(this.slot ? { slot: this.slot } : {}),
267
+ ...(this.tags.length ? { tags: this.tags.join(' ') } : {}),
268
+ ...(this.place ? { place: this.place } : {}),
269
+ ...(this.polish ? { polish: true } : {}),
270
+ ...(this.fit ? { fit: true } : {}),
271
+ ...(this.passage.from !== null && this.passage.to !== null && this.media?.kind === 'clip' ? { passage: this.passage } : {}),
272
+ dry,
273
+ }
274
+ }
275
+
276
+ /** a dry stage soon after his last change; an older answer that lands late is dropped */
277
+ private again(): void {
278
+ if (this.timer !== null) clearTimeout(this.timer)
279
+ if (this.rating === null || this.data === null) return
280
+ this.timer = setTimeout(() => void this.runDry(), DRY_MS)
281
+ }
282
+
283
+ private async runDry(): Promise<void> {
284
+ const n = ++this.asked
285
+ try {
286
+ const r = await postJson<DryAnswer>(this.source.post, this.body(true))
287
+ if (n === this.asked) runInAction(() => ((this.dry = r), (this.error = null)))
288
+ } catch (e) {
289
+ if (n === this.asked) runInAction(() => (this.error = (e as Error).message))
290
+ }
291
+ }
292
+
293
+ /** Enter: the draft written; the popup closes on its slug */
294
+ async stage(): Promise<void> {
295
+ if (!this.ready) return
296
+ this.busy = true
297
+ try {
298
+ const r = await postJson<DryAnswer>(this.source.post, this.body(false))
299
+ this.done(r.slug)
300
+ } catch (e) {
301
+ runInAction(() => (this.error = (e as Error).message))
302
+ } finally {
303
+ runInAction(() => (this.busy = false))
304
+ }
305
+ }
306
+
307
+ dispose(): void {
308
+ if (this.timer !== null) clearTimeout(this.timer)
309
+ }
310
+ }
@@ -0,0 +1,42 @@
1
+ // how a setup step reads (wiki tools/shipkit/social-identities.md, The accounts, `## Setup`): never a cut value. A
2
+ // step whose rows are all short keeps them as chips in its sentence; a step with a long row or a picture is its
3
+ // sentence, then a form of its rows in the order it names them
4
+
5
+ /** what a `[[ref]]` names: a draft, a picture row, a text row by its length, or nothing */
6
+ export type RefKind = 'draft' | 'picture' | 'long' | 'short' | 'bad'
7
+
8
+ /** a piece of the sentence: words, a ref drawn whole (`chip`), or a form row named by its field (`tag`) */
9
+ export type StepPiece = { text: string } | { ref: string; as: 'chip' | 'tag' }
10
+
11
+ export type StepLayout = { sentence: StepPiece[]; fields: string[] }
12
+
13
+ /** a text value that fits a chip: one line, 40 characters at most */
14
+ export const SHORT = 40
15
+
16
+ export const textKind = (value: string): 'long' | 'short' => (value.length > SHORT || value.includes('\n') ? 'long' : 'short')
17
+
18
+ const REF = /\[\[([^\]]+)\]\]/g
19
+ // what may sit between the rows that end a step: spaces, commas, semicolons, a colon, a period, « and »
20
+ const BETWEEN = /^(?:[\s,;:.]|\band\b)*$/
21
+
22
+ export function stepLayout(text: string, kindOf: (ref: string) => RefKind): StepLayout {
23
+ const parts = text.split(REF)
24
+ const pieces: StepPiece[] = parts.map((p, j) => (j % 2 === 0 ? { text: p } : { ref: p, as: 'chip' }))
25
+ const rowRef = (p: StepPiece): p is { ref: string; as: 'chip' | 'tag' } => 'ref' in p && ['picture', 'long', 'short'].includes(kindOf(p.ref))
26
+ const form = pieces.some((p) => 'ref' in p && (kindOf(p.ref) === 'picture' || kindOf(p.ref) === 'long'))
27
+ if (!form) return { sentence: pieces.filter((p) => !('text' in p) || p.text !== ''), fields: [] }
28
+ const fields = [...new Set(pieces.filter(rowRef).map((p) => p.ref))]
29
+ // the rows that end the step live in the form only; its last words before them stay
30
+ let end = pieces.length
31
+ for (let j = pieces.length - 1; j >= 0; j--) {
32
+ const p = pieces[j]!
33
+ if ('text' in p && BETWEEN.test(p.text)) continue
34
+ if (rowRef(p)) end = j
35
+ else break
36
+ }
37
+ const sentence = pieces
38
+ .slice(0, end)
39
+ .map((p): StepPiece => (rowRef(p) ? { ref: p.ref, as: 'tag' } : p))
40
+ .filter((p) => !('text' in p) || p.text !== '')
41
+ return { sentence, fields }
42
+ }
@@ -71,6 +71,17 @@ a.so-icon:visited{color:var(--dim)}
71
71
  .so-rowname{flex:none;width:96px;align-self:center}
72
72
  .so-rowvalue{flex:1;min-width:0;overflow-wrap:anywhere}
73
73
  .so-uppics{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--s1)}
74
+ /* a picture row the account does not show as it is now */
75
+ .so-stale{display:flex;flex-direction:column;gap:2px;padding:var(--s1) var(--s2);border-radius:4px;border-left:4px solid var(--tone);background:color-mix(in srgb,var(--tone) 16%,var(--panel));font-size:12px;color:var(--ink)}
76
+ .so-stale b{font-size:12.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--tone)}
77
+ .so-uploaded{align-self:stretch;justify-content:center;margin:0 var(--s2) var(--s2);font-weight:700}
78
+ .so-upband{font-weight:700;color:var(--dim);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;background:var(--panel2)}
79
+ .so-shownok{align-self:flex-start;margin:0 var(--s2) var(--s2)}
80
+ /* a text row he pastes: its state and « Done, pasted » at the row's end; a changed one marked whole */
81
+ .so-paste{flex:none;display:inline-flex;flex-direction:column;align-items:flex-end;gap:2px}
82
+ .so-chip .so-paste{flex-direction:row;align-items:center}
83
+ .so-pastebtn{font-size:11px;line-height:18px;padding:0 var(--s2);font-weight:700}
84
+ .so-rowtone{box-shadow:inset 4px 0 0 var(--tone);background:color-mix(in srgb,var(--tone) 10%,var(--panel))}
74
85
 
75
86
  /* the list on the left */
76
87
  .so-listcol{height:100%;display:flex;flex-direction:column;min-height:0;background:var(--panel)}
@@ -92,6 +103,18 @@ a.so-icon:visited{color:var(--dim)}
92
103
  .so-draftrow.on .so-rowtitle{font-weight:800}
93
104
  .so-rowtitle.small{font-size:12px}
94
105
  .so-art{color:var(--review);margin-right:var(--s1)}
106
+ .so-kindwarn{color:var(--warn);margin-right:var(--s1);font-weight:700}
107
+ .so-kindproblem{font-size:12px;color:var(--warn);border-left:3px solid var(--warn);padding:2px var(--s2);background:color-mix(in srgb,var(--warn) 8%,transparent);border-radius:3px}
108
+ /* the next release (next-release.tsx): a dashed section on top of the list, never a draft */
109
+ .so-nextsec{display:flex;flex-direction:column;gap:2px;margin-bottom:var(--s2);padding:var(--s1);border:1px dashed var(--line);border-radius:8px}
110
+ .so-nexthead{display:flex;align-items:center;gap:var(--s2);border:0;background:none;padding:2px var(--s1);font:inherit;font-size:12px;font-weight:700;color:var(--ink);cursor:pointer;text-align:left;white-space:nowrap;min-width:0}
111
+ .so-nextrow .so-rowtitle{font-style:italic}
112
+ .so-nextnote{font-size:12px;color:var(--dim);border-left:3px solid var(--line);padding:2px var(--s2)}
113
+ .so-preview{border-style:dashed}
114
+ .so-nexttext{white-space:pre-wrap;font-size:13px;padding:var(--s1) 0}
115
+ .so-nextcat{display:flex;flex-direction:column;gap:var(--s2)}
116
+ .so-kind{font-weight:700;color:var(--kt,var(--accent));border:1px solid color-mix(in srgb,var(--kt,var(--accent)) 55%,var(--line));border-radius:3px;padding:0 var(--s1);line-height:18px;text-decoration:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
117
+ a.so-kind:hover{text-decoration:underline}
95
118
  .so-frac{flex:none;font-size:11px;font-weight:700;color:var(--dim);font-variant-numeric:tabular-nums}
96
119
  .so-frac.t-ok{color:var(--ok)}
97
120
  .so-who{flex:none;font-size:10px;font-weight:700;line-height:16px;padding:0 var(--s1);border-radius:3px;color:var(--k2);border:1px solid color-mix(in srgb,var(--k2) 55%,var(--line));max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -256,7 +279,15 @@ a.so-go:visited{color:var(--accent)}
256
279
  .so-steptext{flex:1;min-width:0;font-size:13.5px;line-height:1.5}
257
280
  .so-chip{display:inline-flex;align-items:center;gap:var(--s1);vertical-align:middle;margin:var(--s0)}
258
281
  .so-chip button,.so-chip .so-btn{font-size:11px;line-height:18px;padding:0 var(--s2)}
259
- .so-chipvalue{display:inline-flex;align-items:center;gap:var(--s1);max-width:360px}
282
+ .so-chipvalue{display:inline-flex;align-items:center;gap:var(--s1);max-width:100%;text-align:left}
283
+ .so-stepform{margin-top:var(--s2);border:1px solid var(--line);border-radius:6px;background:var(--panel);overflow:hidden;line-height:1.45}
284
+ .so-stepform > .so-row:first-child{border-top:0}
285
+ .so-stepform .so-rowfield{width:132px}
286
+ .so-steptext:has(> .so-stepform){container-type:inline-size}
287
+ @container (max-width:480px){.so-stepform .so-row{flex-wrap:wrap}.so-stepform .so-rowfield{width:100%}}
288
+ .so-step.done .so-stepform{opacity:.7}
289
+ .so-steppics{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:var(--s1)}
290
+ .so-steptag{font-size:11px;font-weight:700;color:var(--dim);border:1px dashed var(--line);border-radius:4px;padding:0 var(--s1);white-space:nowrap}
260
291
  .so-stepimg{height:34px;max-width:120px;object-fit:cover;border-radius:4px}
261
292
  .so-badref{color:var(--red);font-size:11px}
262
293
  .so-swatches{display:flex;gap:var(--s2);flex-wrap:wrap;padding:var(--s2) var(--s3)}
@@ -292,3 +323,39 @@ a.so-go:visited{color:var(--accent)}
292
323
  .so-probrow{color:var(--ink);padding-left:calc(var(--s3) + var(--s4) + var(--s2))}
293
324
  .so-probrow b{flex:none;max-width:55%;font-weight:600}
294
325
  div.so-probrow{cursor:default}
326
+
327
+ /* a message refused by the repo's guard or a place, and a rated message's own switch */
328
+ .so-refused{font-size:12px;margin-top:var(--s1)}
329
+
330
+ /* the stage popup over a card: the media on the left, the words and where they go on the right */
331
+ .sg-veil{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;background:var(--scrim);padding:var(--s3)}
332
+ .sg-pop{width:min(1180px,100%);max-height:100%;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 40px var(--scrim);display:flex;flex-direction:column}
333
+ .sg-head{display:flex;align-items:center;gap:var(--s2);padding:var(--s2) var(--s3);border-bottom:1px solid var(--line)}
334
+ .sg-head .sp,.sg-foot .sp{flex:1}
335
+ .sg-body{display:flex;gap:var(--s3);padding:var(--s3);min-height:0}
336
+ .sg-left{flex:1 1 52%;min-width:0;display:flex;flex-direction:column;gap:var(--s2)}
337
+ .sg-right{flex:1 1 48%;min-width:0;display:flex;flex-direction:column;gap:var(--s2)}
338
+ .sg-media{background:var(--bg);border-radius:8px;display:flex;align-items:center;justify-content:center;min-height:240px;max-height:62vh;overflow:hidden}
339
+ .sg-media img,.sg-media video{max-width:100%;max-height:62vh;object-fit:contain;display:block}
340
+ .sg-none{color:var(--dim)}
341
+ .sg-strip,.sg-chips{display:flex;flex-wrap:wrap;gap:var(--s1);align-items:center}
342
+ .sg-strip .rv-chip.on,.sg-chips .rv-chip.on{outline:2px solid var(--accent)}
343
+ .sg-from{font-size:11px;color:var(--dim);text-transform:uppercase;letter-spacing:.04em;margin-right:var(--s1)}
344
+ .sg-words{display:flex;flex-direction:column;gap:var(--s1);max-height:26vh;overflow:auto}
345
+ .sg-words .rv-chip{text-align:left;white-space:normal}
346
+ .sg-field{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
347
+ .sg-field > span:first-child{font-size:11px;color:var(--dim);text-transform:uppercase;letter-spacing:.04em;min-width:58px}
348
+ .sg-field input:not([type]),.sg-field select{flex:1;min-width:0}
349
+ .sg-text{width:100%;min-height:72px;resize:vertical;font:inherit}
350
+ .sg-goes{display:flex;flex-wrap:wrap;gap:var(--s1) var(--s3)}
351
+ .sg-acc{display:inline-flex;align-items:center;gap:var(--s1)}
352
+ .sg-acc.skip{opacity:.5}
353
+ .sg-acc.bad{color:var(--red)}
354
+ .sg-acc select{max-width:160px}
355
+ .sg-polish > span:first-child{min-width:0;text-transform:none;font-size:13px;color:var(--ink);letter-spacing:0}
356
+ .sg-problem{font-size:13px}
357
+ .sg-error{padding:var(--s1) var(--s3)}
358
+ .sg-foot{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
359
+ .sg-note{font-size:12px}
360
+ .rv-stagebtn{font-size:12px;padding:0 var(--s1)}
361
+ @media (max-width:767px){.sg-body{flex-direction:column}.sg-veil{padding:0}.sg-pop{border-radius:0;height:100%}}
@@ -6,6 +6,8 @@
6
6
  // gets its row when a resource lands in it.
7
7
  import { type Resource, type ResourceState, type ResourceType, type TestFacts } from '../../collections/collection-types.ts'
8
8
  import type { ProcessRow, RowDot } from '../../home/process-rows.ts'
9
+ import type { CommandRow } from '../../cli/cmd_Commands.ts'
10
+ import type { RunView } from '../../commands/model.ts'
9
11
  import { checkVerdictWords, plural } from '../../core/outcome-words.ts'
10
12
  import { runsWords } from '../../core/runs-matrix.ts'
11
13
  import { checkName } from './check-words.ts'
@@ -76,10 +78,14 @@ export const KIND_SECTION: Record<ResourceType, SectionId> = {
76
78
  post: 'media',
77
79
  wiki: 'wikis',
78
80
  process: 'processes',
81
+ command: 'commands',
79
82
  card: 'review',
80
83
  cut: 'trailer',
84
+ voice: 'trailer',
81
85
  store: 'stores',
86
+ release: 'releases',
82
87
  veille: 'veille',
88
+ message: 'messages',
83
89
  }
84
90
 
85
91
  /** a process's colour: up reads green, crashed red, on its way orange,
@@ -101,6 +107,30 @@ export const processResources = (rows: readonly ProcessRow[]): Resource[] =>
101
107
  state: PROCESS_STATE[r.dot],
102
108
  }))
103
109
 
110
+ /** the project CLI's commands as tree leaves, read from the CLI itself (commands-st.ts), never from
111
+ * /api/resources.json. A family of more than one command is a branch named by its first word, its leaves by the
112
+ * rest; a command with a run going reads orange */
113
+ export function commandResources(rows: readonly CommandRow[], runs: readonly RunView[]): Resource[] {
114
+ const size = new Map<string, number>()
115
+ for (const r of rows) size.set(r.path.split(' ')[0]!, (size.get(r.path.split(' ')[0]!) ?? 0) + 1)
116
+ const going = new Set(runs.filter((r) => r.state === 'running').map((r) => r.path))
117
+ return rows.map((r): Resource => {
118
+ const family = r.path.split(' ')[0]!
119
+ const grouped = (size.get(family) ?? 0) > 1 && r.path !== family
120
+ return {
121
+ id: `command:${r.path}`,
122
+ type: 'command',
123
+ collection: 'commands',
124
+ path: `commands/${r.path.split(' ').join('/')}`,
125
+ virtual: true,
126
+ title: grouped ? r.path.slice(family.length + 1) : r.path,
127
+ text: r.description,
128
+ state: going.has(r.path) ? 'warn' : 'idle',
129
+ ...(grouped ? { group: family } : {}),
130
+ }
131
+ })
132
+ }
133
+
104
134
  /** a gate check lives under WHOSE it is: shipkit ships the SK checks, a
105
135
  * repo owns what it declared. A kind the map does not know (a newer hub)
106
136
  * still lands somewhere */
@@ -132,6 +162,10 @@ const byLabel = (a: TreeNode, b: TreeNode): number => {
132
162
  const ad = a.res == null
133
163
  const bd = b.res == null
134
164
  if (ad !== bd) return ad ? -1 : 1 // groups first, then leaves
165
+ // leaves in a declared order first (a page's tabs), then by label
166
+ const ao = a.res?.order ?? Infinity
167
+ const bo = b.res?.order ?? Infinity
168
+ if (ao !== bo) return ao - bo
135
169
  return a.label.localeCompare(b.label)
136
170
  }
137
171
 
@@ -179,7 +213,8 @@ const groupOf = (r: Resource): Seg[] => {
179
213
  if (r.check != null || r.type === 'contract' || r.type === 'secret') return []
180
214
  if (r.type === 'ask') return isDone(r) ? [{ key: 'type:ask:done', label: 'done', kind: 'done', page: null }] : []
181
215
  if (r.type === 'asset' && r.group != null) return [{ key: `cat:${r.group}`, label: r.group, kind: 'category', page: { t: 'cat', cat: r.group } }]
182
- if (r.type === 'wiki' || r.type === 'asset' || r.type === 'test' || r.type === 'process' || r.type === 'reflection') return []
216
+ if (r.type === 'command' && r.group != null) return [{ key: `cmdfam:${r.group}`, label: r.group, kind: 'command', page: null }]
217
+ if (r.type === 'wiki' || r.type === 'asset' || r.type === 'test' || r.type === 'process' || r.type === 'command' || r.type === 'reflection' || r.type === 'message' || r.type === 'release') return []
183
218
  return [{ key: `type:${r.type}`, label: r.type, kind: r.type, page: { t: 'col', id: r.collection } }]
184
219
  }
185
220
 
@@ -398,10 +433,14 @@ export const TYPE_MARK: Record<string, TypeMark> = {
398
433
  test: { glyph: '\u2263', hue: 'k5', word: 'a test file: the check that runs it, its last runs against its budget, the command that runs it alone' },
399
434
  reflection: { glyph: '\u203b', hue: 'k2', word: 'a reflection: friction this repo logged against the wiki, waiting to be folded in' },
400
435
  process: { glyph: '\u223f', hue: 'k1', word: 'a global process this repo declares: its state, its menu, its log' },
436
+ command: { glyph: '$', hue: 'k6', word: "a command of the repo's project CLI: its examples, its args, run from the page with its log live" },
401
437
  card: { glyph: '\u25a3', hue: 'k2', word: 'a review card waiting for your answer: approve, fix, reject, circle a detail' },
402
438
  cut: { glyph: '\u25b6', hue: 'k3', word: 'a trailer cut: play it with its timeline, pin a note on any frame' },
439
+ voice: { glyph: '\u266a', hue: 'k2', word: 'a trailer line your own voice reads, not recorded yet: record it in the trailer page, Voices' },
403
440
  store: { glyph: '\u25a5', hue: 'k4', word: 'a store page (Steam, itch): every text to paste, every picture to upload, a note on each' },
441
+ release: { glyph: '\u2691', hue: 'k5', word: 'a version of the release notes: next.md being filled, or a released one, each change with its picture' },
404
442
  veille: { glyph: '\u25ce', hue: 'k6', word: 'the Veille: the posts an identity scrolls past, ranked by the worth of a reply' },
443
+ message: { glyph: '\u275d', hue: 'k3', word: 'a tab of the messages page: the value for its cost, the personas, the page tops, the readers\u2019 notes' },
405
444
  done: { glyph: '\u2713', hue: 'k5', word: 'a done ask: answered, filed under done, out of every count above it' },
406
445
  }
407
446
 
@@ -9,7 +9,7 @@ import type { RepoSt } from './repo-st.ts'
9
9
  import type { Resource } from './hub-types.ts'
10
10
  import { repoSections, type RepoSection } from './repo-sections.ts'
11
11
  import { walkKey, type WalkHost } from './list-walk.ts'
12
- import { buildTree, dirKeys, flattenTree, matchesQuery, passesFilter, processResources, whenCounts, type TreeNode, type TreeRow } from './tree-build.ts'
12
+ import { buildTree, commandResources, dirKeys, flattenTree, matchesQuery, passesFilter, processResources, whenCounts, type TreeNode, type TreeRow } from './tree-build.ts'
13
13
 
14
14
  const EXPANDED_KEY = 'shipkit.tree.expanded'
15
15
 
@@ -49,9 +49,10 @@ export class TreeSvc implements WalkHost<TreeRow> {
49
49
  * branches that still hold something. A search names a thing to find,
50
50
  * so it reads every row: the severity group applies only while it is empty */
51
51
  /** every row the tree can show: the hub's resources, then the repo's
52
- * global processes, which pm reports and the hub never lists */
52
+ * global processes, which pm reports and the hub never lists, then the
53
+ * commands of its project CLI, which the CLI itself lists */
53
54
  private get all(): Resource[] {
54
- return [...this.st.cols.resources, ...processResources(this.st.globalProcesses)]
55
+ return [...this.st.cols.resources, ...processResources(this.st.globalProcesses), ...commandResources(this.st.commands.rows, this.st.commands.runs)]
55
56
  }
56
57
 
57
58
  get visible(): Resource[] {
@@ -121,6 +122,12 @@ export class TreeSvc implements WalkHost<TreeRow> {
121
122
  this.expanded.has(key) ? this.expanded.delete(key) : this.expanded.add(key)
122
123
  this.save()
123
124
  }
125
+ /** unfold a branch the page shown lives in, so its rows are in sight (a page's tab rows); kept like a fold */
126
+ reveal(key: string): void {
127
+ if (this.expanded.has(key)) return
128
+ this.expanded.add(key)
129
+ this.save()
130
+ }
124
131
  expandAll(): void {
125
132
  for (const k of dirKeys(this.nodes)) this.expanded.add(k)
126
133
  this.save()
@@ -25,9 +25,10 @@ import { identityOfText, identityProblem, type Identity } from '../core/identity
25
25
  import { writeIdentity } from '../core/identity.ts'
26
26
  import { appIconOf, appIconPngs, identityOfRoot } from '../core/app-icon.ts'
27
27
  import { waitingCards } from '../collections/review.ts'
28
+ import { voicesWaiting } from '../review/trailer-voices.ts'
28
29
  import { storeDir, warmStore } from '../review/store.ts'
29
30
  import { writeArchived } from '../core/archived.ts'
30
- import { identitiesDir } from '../identities/identities.ts'
31
+ import { identitiesDir, pictureVersion } from '../identities/identities.ts'
31
32
  import { identityCache, markFile, railOf, speakerIdOf, type RailIdentity } from '../identities/machine.ts'
32
33
  import { speaksAsOfText } from '../social/house.ts'
33
34
 
@@ -78,6 +79,8 @@ export type ProjectRow = {
78
79
  askTitles: string[]
79
80
  /** the review cards that wait on the owner (collections/review.ts waitingCards), oldest first: read on every request */
80
81
  cards: { id: string; title: string }[]
82
+ /** the trailer lines his own voice reads that he has not recorded yet (review/trailer-voices.ts), every trailer of the repo */
83
+ voices: number
81
84
  /** package.json `description`, else the README's first line of prose */
82
85
  description: string | null
83
86
  /** package.json `version` */
@@ -356,6 +359,10 @@ export function projectGutter(d: GutterDeps) {
356
359
  const ids = await loopWatch.spanned('projects: ids', readIds)
357
360
  // each store read whole once, in steps, before the rows read its waiting cards
358
361
  await loopWatch.spanned('projects: review stores', async () => { for (const r of repos) await warmStore(storeDir(r.path)) })
362
+ const voices = new Map<string, number>()
363
+ await loopWatch.spanned('projects: voices', async () => {
364
+ for (const r of repos) voices.set(r.path, Object.values(await voicesWaiting(r.path).catch(() => ({}))).reduce((a: number, b: number) => a + b, 0))
365
+ })
359
366
  const projects = repos.map((r, i): ProjectRow => loopWatch.timed(`projects: row ${r.name}`, () => {
360
367
  const config = readText(join(r.path, 'repo.config.ts'))
361
368
  const pkg = readText(join(r.path, 'package.json'))
@@ -373,6 +380,7 @@ export function projectGutter(d: GutterDeps) {
373
380
  asks: asks.length,
374
381
  askTitles: asks,
375
382
  cards: cardsOf(r.path),
383
+ voices: voices.get(r.path) ?? 0,
376
384
  description,
377
385
  version: versionOf(pkg),
378
386
  branch: branchOf(readText(join(r.path, '.git', 'HEAD'))),
@@ -441,7 +449,9 @@ export function projectGutter(d: GutterDeps) {
441
449
  const i = (await readIds()).identities.find((x) => x.id === id)
442
450
  const file = i == null ? null : markFile(i)
443
451
  if (file == null || !existsSync(file)) return new Response(`no mark for the identity ${JSON.stringify(id)}`, { status: 404 })
444
- return new Response(Bun.file(file), { headers: { 'cache-control': 'max-age=86400' } })
452
+ // the url names the file's version (markUrl): kept for good while it is the current one, else asked again
453
+ const v = new URL(req.url).searchParams.get('v')
454
+ return new Response(Bun.file(file), { headers: { 'cache-control': v != null && v !== '' && v === pictureVersion(file) ? 'public, max-age=31536000, immutable' : 'no-cache' } })
445
455
  }
446
456
  if (path.startsWith('/api/projects/app-icon/')) {
447
457
  if (repos.length === 0) await answer()
@@ -15,6 +15,7 @@ import { defaultHubPort } from './hub-port.ts'
15
15
  import { LAYOUT } from '../core/layout.ts'
16
16
  import { isArchived } from '../core/archived.ts'
17
17
  import { CLAUDE_FILES } from '../home/pm-inputs.ts'
18
+ import { DEFAULT_AGENT_DIR } from '../core/agent-dir.ts'
18
19
 
19
20
  export type WiredRepo = { name: string; path: string; icon: string | null }
20
21
 
@@ -40,10 +41,11 @@ export function includeTargets(repo: string, home: string): string[] {
40
41
 
41
42
  /** the house wiki index this repo includes: the first include outside the
42
43
  * repo, else (the repo that hosts the house) the first one that exists and
43
- * is not another CLAUDE file */
44
+ * is neither another CLAUDE file nor the repo's own agent/ wiki */
44
45
  export function houseIndex(repo: string, home: string): string | null {
45
46
  const targets = includeTargets(repo, home).filter((t) => existsSync(t))
46
- return targets.find((t) => !inside(t, repo)) ?? targets.find((t) => !basename(t).startsWith('CLAUDE')) ?? null
47
+ const own = join(repo, DEFAULT_AGENT_DIR, 'index.md')
48
+ return targets.find((t) => !inside(t, repo)) ?? targets.find((t) => t !== own && !basename(t).startsWith('CLAUDE')) ?? null
47
49
  }
48
50
 
49
51
  /** a repo's own icon, first hit wins. `.shipkit/identity/icon.png` is the rail