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
@@ -26,6 +26,13 @@ async function guarded(c: Ctx, body: () => Promise<number>): Promise<number> {
26
26
  }
27
27
  }
28
28
 
29
+ /** the shown.md files a push wrote, committed by their paths alone */
30
+ async function recorded(files: string[], message: string): Promise<void> {
31
+ if (files.length === 0) return
32
+ const { commitPaths } = await import('../social/writes.ts')
33
+ commitPaths(files, message)
34
+ }
35
+
29
36
  const asOpt = (): string | undefined => Option.String('--as', { description: "the identity, by id (default: the one this repo speaks as)" })
30
37
 
31
38
  class SocialCommand extends Command {
@@ -98,19 +105,96 @@ class SocialPostCommand extends Command {
98
105
  static override usage = Command.Usage({
99
106
  category: 'Social',
100
107
  description: 'one draft across every account of its headings: posted with its date and link, or waiting',
108
+ details:
109
+ "The draft by its folder's name, its topic or its path (its draft.md too). --publish posts the waiting messages of its accounts whose automation is live (Discord, Bluesky), each link recorded in its ## Posted; a posted one stays « already posted ». --edit sends a posted message's text again at its link where the venue edits in place (Discord), and names why where it cannot: never a second copy. --only <key> keeps one message, its heading's key (`discord`, `discord/nsfw`), else an account's every message. A message the repo's guard or a place refuses never posts. Every other account waits for his paste: nothing posts without an order. Page: wiki tools/shipkit/social.md, `sk social`",
101
110
  examples: [
102
111
  ['by its topic', 'sk social post arena-face-lift'],
103
112
  ['by its whole name', 'sk social post 20261025-131139-arena-face-lift'],
113
+ ['by its path', 'sk social post .shipkit/social/drafts/20261025-131139-arena-face-lift/'],
114
+ ['a pinned #welcome whose text changed, edited at its link', 'sk social post welcome --only discord --publish --edit'],
115
+ ["a release's #announcements line, at release", 'sk social post 20261108-120000-app-1-2-0 --only discord --publish'],
104
116
  ],
105
117
  })
106
118
  draft = Option.String({ required: true })
119
+ only = Option.String('--only', { description: "one message by its key (discord, discord/nsfw), else one account's messages" })
120
+ publish = Option.Boolean('--publish', false, { description: 'post the waiting messages of its live accounts now' })
121
+ edit = Option.Boolean('--edit', false, { description: "with --publish: a posted message's text sent again at its link, where the venue edits in place" })
107
122
  override async execute(): Promise<number> {
108
123
  return guarded(this.context, async () => {
109
124
  const { desk } = await model(undefined)
110
- const d = desk.drafts.find((x) => x.slug === this.draft || x.slug.replace(/^\d{8}-\d{6}-/, '') === this.draft)
111
- if (d == null) throw new Error(`no draft "${this.draft}" in .shipkit/social/drafts/: give its folder's name or its topic`)
125
+ const { findDraft } = await import('../social/load.ts')
126
+ const d = findDraft(desk, this.draft, process.cwd())
127
+ if (this.edit && !this.publish) throw new Error('--edit sends again what is posted: it goes with --publish')
128
+ const only = this.only
129
+ if (only != null && !d.posts.some((p) => p.platform === only || p.key === only)) throw new Error(`${d.slug} has no message to ${only} (${[...new Set(d.posts.map((p) => p.key))].join(', ') || 'none'})`)
130
+ if (this.publish) {
131
+ const { publishDraft } = await import('../social/publish/index.ts')
132
+ const { socialMediaBack } = await import('../social/media-kind.ts')
133
+ const before = async (p: { media: { path: string } | null }): Promise<void> => void (p.media ? await socialMediaBack(desk.root, p.media.path) : undefined)
134
+ for (const r of await publishDraft(desk, d.slug, { ...(only != null ? { only } : {}), edit: this.edit, before })) say(this.context)(`${r.key}: ${r.line}`)
135
+ return 0
136
+ }
112
137
  const { socialModel, postText } = await import('../social/text.ts')
113
- for (const l of postText(socialModel(desk, d.identity), d.slug)) say(this.context)(l)
138
+ const { onlyOf } = await import('../social/publish/index.ts')
139
+ const lines = postText(socialModel(desk, d.identity), d.slug)
140
+ const keys = new Set(onlyOf(d.posts, only ?? undefined).map((p) => p.key))
141
+ for (const l of only == null ? lines : lines.filter((l) => !/^[a-z0-9-]+(?:\/[a-z0-9-]+)?\s{2}/.test(l) || keys.has(l.split(/\s{2}/)[0]!))) say(this.context)(l)
142
+ return 0
143
+ })
144
+ }
145
+ }
146
+
147
+ class SocialReleaseCommand extends Command {
148
+ static override paths = [['social', 'release']]
149
+ static override usage = Command.Usage({
150
+ category: 'Social',
151
+ description: "a release staged as one post draft: a heading per venue the social unit declares, never posted",
152
+ details:
153
+ "The draft waits in Communications with its polish note: the release message (else the notes' lines) under each heading of the social unit's release.headings, the notes in its angle, the range --since..--tag whose approved cards lend it their media. A second call for the same release writes nothing. A repo whose social unit declares no release headings stages nothing. Page: wiki tools/shipkit/social.md, A post staged",
154
+ examples: [
155
+ ["an app's release, its notes on stdin, its message from a file", 'sk social release 1.2.0 --unit app --notes - --message msg.md --tag app-v1.2.0 --since app-v1.1.0'],
156
+ ],
157
+ })
158
+ version = Option.String({ required: true })
159
+ unit = Option.String('--unit', { description: "the unit released (default: the repo's folder name)" })
160
+ notes = Option.String('--notes', { required: true, description: "the release's notes: a file, or - for stdin" })
161
+ message = Option.String('--message', { description: 'the short message for users: a file, or - for stdin' })
162
+ tag = Option.String('--tag', { description: "the release's tag" })
163
+ since = Option.String('--since', { description: 'the tag before it' })
164
+ title = Option.String('--title', { description: "the draft's title (default <unit> <version>)" })
165
+ override async execute(): Promise<number> {
166
+ return guarded(this.context, async () => {
167
+ const { readFileSync } = await import('node:fs')
168
+ const { basename } = await import('node:path')
169
+ const { findRepoRoot } = await import('../ts/config.ts')
170
+ const { loadRepoConfig } = await import('../repo-config.ts')
171
+ const { loadSocialUnit } = await import('../social/unit.ts')
172
+ const { stageRelease } = await import('../social/release-stage.ts')
173
+ if (this.notes === '-' && this.message === '-') throw new Error('one of --notes and --message reads stdin, never both')
174
+ const text = async (v: string): Promise<string> => (v === '-' ? await new Response(Bun.stdin.stream()).text() : readFileSync(v, 'utf8'))
175
+ const root = findRepoRoot(process.cwd())
176
+ const unit = await loadSocialUnit(root)
177
+ const speaksAs = (await loadRepoConfig(root).catch(() => null))?.speaksAs
178
+ const r = await stageRelease(
179
+ root,
180
+ unit,
181
+ {
182
+ unit: this.unit ?? basename(root),
183
+ version: this.version,
184
+ notes: await text(this.notes),
185
+ ...(this.message ? { message: await text(this.message) } : {}),
186
+ ...(this.tag ? { tag: this.tag } : {}),
187
+ ...(this.since ? { since: this.since } : {}),
188
+ ...(this.title ? { title: this.title } : {}),
189
+ },
190
+ speaksAs ? { speaksAs } : {},
191
+ )
192
+ if (r == null) say(this.context)("ok: the repo's social unit declares no release headings: nothing staged")
193
+ else if (!r.created) say(this.context)(`ok: already staged: ${r.slug}`)
194
+ else {
195
+ say(this.context)(`staged ${r.slug}: waiting in Communications, its polish note raised`)
196
+ for (const e of r.errors) say(this.context)(`WARN ${e}`)
197
+ }
114
198
  return 0
115
199
  })
116
200
  }
@@ -193,7 +277,7 @@ class SocialDiscordApplyCommand extends Command {
193
277
  category: 'Social',
194
278
  description: "an identity's Discord server made to match its layout.md through its bot: roles, channels",
195
279
  details:
196
- "The layout is `layout.md` beside the identity's discord `account.md`, which names the server (`guild`) and the bot's token (`secret`). It creates, renames, moves, sets topics, read only, age restricted and role only channels; a server that matches gets no write. It never deletes but with --prune, and then only an empty text channel the layout lacks. With no guild yet, it names the servers the bot is in. Page: wiki tools/shipkit/social-identities.md, The server's layout",
280
+ "The layout is `layout.md` beside the identity's discord `account.md`, which names the server (`guild`) and the bot's token (`secret`). It creates, renames, moves, sets topics, read only, age restricted and role only channels; a server that matches gets no write. It never deletes but with --prune, and then only an empty text channel the layout lacks. With no guild yet, it names the servers the bot is in. Nothing is sent while the guard of a repo speaking as the identity refuses one of its words or pictures. Page: wiki tools/shipkit/social-identities.md, The server's layout",
197
281
  examples: [
198
282
  ['what would change', 'sk social discord apply studio --dry'],
199
283
  ['as this repo speaks', 'sk social discord apply'],
@@ -215,11 +299,14 @@ class SocialDiscordApplyCommand extends Command {
215
299
  id = speakerOf((await loadRepoConfig(findRepoRoot(process.cwd()))).speaksAs, ids)?.id
216
300
  if (id == null) throw new Error('no identity named and none this repo speaks as')
217
301
  }
218
- const a = identityOf(id, ids).accounts.find((x) => x.id === 'discord')
302
+ const i = identityOf(id, ids)
303
+ const a = i.accounts.find((x) => x.id === 'discord')
219
304
  if (a == null) throw new Error(`${id} has no discord account (accounts/discord/account.md)`)
305
+ await (await import('../social/identity-words.ts')).refuseUnguarded(i)
220
306
  const r = await applyLayout(a, { dry: this.dry, prune: this.prune })
307
+ await recorded(r.recorded, `identities: ${id} discord server pictures set by the bot`)
221
308
  for (const l of r.changes) say(this.context)(l)
222
- if (r.changes.length === 0) say(this.context)(`ok: the server of ${id} matches its layout`)
309
+ if (r.changes.length === 0) say(this.context)(`ok: the server of ${id} matches its layout and its pictures`)
223
310
  for (const l of r.left) say(this.context)(`left alone: ${l}`)
224
311
  return 0
225
312
  })
@@ -254,7 +341,7 @@ class IdentitiesCommand extends Command {
254
341
  into.set(id, [...(into.get(id) ?? []), r.name])
255
342
  }
256
343
  if (this.json) {
257
- say(this.context)(JSON.stringify({ dir: ids.dir, identities: ids.identities.map((i) => ({ id: i.id, name: i.name, default: i.default, site: i.site, accounts: i.accounts.map((a) => ({ id: a.id, handle: a.handle, live: a.live })), repos: by.get(i.id) ?? [], archived: old.get(i.id) ?? [] })), unnamed, seen: all.length, errors: ids.errors }))
344
+ say(this.context)(JSON.stringify({ dir: ids.dir, identities: ids.identities.map((i) => ({ id: i.id, name: i.name, default: i.default, site: i.site, accounts: i.accounts.map((a) => ({ id: a.id, handle: a.handle, live: a.live, stale: a.uploads.filter((u) => u.stale).map((u) => ({ row: u.field, kind: u.kind, by: u.by, file: u.files[0] ?? null, shown: u.shown?.sha ?? null })) })), repos: by.get(i.id) ?? [], archived: old.get(i.id) ?? [] })), unnamed, seen: all.length, errors: ids.errors }))
258
345
  return ids.errors.length || unnamed.length ? 1 : 0
259
346
  }
260
347
  for (const i of ids.identities) {
@@ -263,6 +350,16 @@ class IdentitiesCommand extends Command {
263
350
  say(this.context)(` online: ${online.map((a) => `${a.id} ${a.handle}`).join(', ') || 'none'}`)
264
351
  const archived = old.get(i.id) ?? []
265
352
  say(this.context)(` repos: ${(by.get(i.id) ?? []).join(', ') || 'none'}${archived.length > 0 ? `; archived: ${archived.join(', ')}` : ''}`)
353
+ for (const a of i.accounts) {
354
+ const stale = a.uploads.filter((u) => u.stale && u.kind === 'picture')
355
+ const texts = a.uploads.filter((u) => u.stale && u.kind === 'text').map((u) => u.field)
356
+ if (texts.length > 0) say(this.context)(` to paste again on ${a.name}: ${texts.join(', ')}`)
357
+ if (stale.length === 0) continue
358
+ const hands = stale.filter((u) => u.by == null).map((u) => u.field)
359
+ const api = stale.filter((u) => u.by != null).map((u) => u.field)
360
+ const parts = [...(hands.length > 0 ? [hands.join(', ')] : []), ...(api.length > 0 ? [`the api sets ${api.join(', ')}: sk identities push ${i.id}`] : [])]
361
+ say(this.context)(` to upload on ${a.name}${a.live === '' ? ' (still to create)' : ''}: ${parts.join('; ')}`)
362
+ }
266
363
  }
267
364
  if (all.length === 0) say(this.context)(`note: no house repo seen from ${process.cwd()}, so every identity lists none: run it from a repo beside the house`)
268
365
  if (unnamed.length > 0) say(this.context)(`FAIL: ${unnamed.length} repo(s) name no speaksAs (SK038): ${unnamed.join(', ')}`)
@@ -272,4 +369,50 @@ class IdentitiesCommand extends Command {
272
369
  }
273
370
  }
274
371
 
275
- export const SOCIAL_COMMANDS = [SocialCommand, SocialTimelineCommand, SocialCoverageCommand, SocialPostCommand, SocialPlanCommand, SocialStateCommand, SocialMigrateCommand, SocialDiscordApplyCommand, IdentitiesCommand]
372
+ class IdentitiesPushCommand extends Command {
373
+ static override paths = [['identities', 'push']]
374
+ static override usage = Command.Usage({
375
+ category: 'Social',
376
+ description: "an identity's stale pictures set where an api reaches: Discord's bot, Bluesky",
377
+ details:
378
+ "Each account records in shown.md the sha of the picture each row was last given; a row whose picture changed since, or that records none, is stale. This sets the stale rows an api reaches (Discord: icon, banner and invite splash through the bot; Bluesky with automation live: avatar and banner) and records each one. X, Reddit and the rest stay his hands: the hub's identity view and sk needs list them. Nothing is set while the guard of a repo speaking as the identity refuses one of its words or pictures. Page: wiki tools/shipkit/social-identities.md, What each account shows",
379
+ examples: [
380
+ ['what would be set', 'sk identities push studio --dry'],
381
+ ['as this repo speaks', 'sk identities push'],
382
+ ],
383
+ })
384
+ identity = Option.String({ required: false })
385
+ dry = Option.Boolean('--dry', false, { description: 'print what would be set, write nothing' })
386
+ override async execute(): Promise<number> {
387
+ return guarded(this.context, async () => {
388
+ const { loadIdentities, identityOf, speakerOf } = await import('../identities/identities.ts')
389
+ const { pushServerPictures } = await import('../social/discord-layout.ts')
390
+ const { pushProfilePictures } = await import('../social/publish/bluesky.ts')
391
+ const ids = await loadIdentities()
392
+ let id = this.identity
393
+ if (id == null) {
394
+ const { findRepoRoot } = await import('../ts/config.ts')
395
+ const { loadRepoConfig } = await import('../repo-config.ts')
396
+ id = speakerOf((await loadRepoConfig(findRepoRoot(process.cwd()))).speaksAs, ids)?.id
397
+ if (id == null) throw new Error('no identity named and none this repo speaks as')
398
+ }
399
+ const i = identityOf(id, ids)
400
+ await (await import('../social/identity-words.ts')).refuseUnguarded(i)
401
+ let set = 0
402
+ for (const a of i.accounts) {
403
+ const r = a.id === 'discord' ? await pushServerPictures(a, { dry: this.dry }) : a.id === 'bluesky' ? await pushProfilePictures(a, { dry: this.dry }) : null
404
+ if (r == null) continue
405
+ await recorded(r.recorded, `identities: ${id} ${a.id} pictures set through its api`)
406
+ set += r.changes.length
407
+ for (const l of r.changes) say(this.context)(`${a.name}: ${l}`)
408
+ for (const l of r.left) say(this.context)(`${a.name}: left alone: ${l}`)
409
+ }
410
+ if (set === 0) say(this.context)(`ok: no stale picture of ${id} an api reaches`)
411
+ const hands = i.accounts.filter((a) => a.uploads.some((u) => u.stale && u.by == null))
412
+ if (hands.length > 0) say(this.context)(`his hands: ${hands.map((a) => `${a.name} ${a.uploads.filter((u) => u.stale && u.by == null).map((u) => u.field).join(', ')}`).join('; ')}`)
413
+ return 0
414
+ })
415
+ }
416
+ }
417
+
418
+ export const SOCIAL_COMMANDS = [SocialCommand, SocialTimelineCommand, SocialCoverageCommand, SocialPostCommand, SocialReleaseCommand, SocialPlanCommand, SocialStateCommand, SocialMigrateCommand, SocialDiscordApplyCommand, IdentitiesCommand, IdentitiesPushCommand]
@@ -52,6 +52,7 @@ export class SoundVoiceCommand extends Command {
52
52
  ['an ElevenLabs voice, its second take', 'sk sound voice "[whispers] Hey." --eleven pNInz6obpgDQGcFmaJgB --seed 2 --out hey.wav'],
53
53
  ['a clip cloned, free', 'sk sound voice "Ahoy." --clone voices/sailor.flac --out ahoy.wav'],
54
54
  ['a voice designed from words, free', 'sk sound voice "Ahoy." --design "an old sailor, gravelly and warm" --out ahoy.wav'],
55
+ ['your own recording, trimmed and levelled', 'sk sound voice "Ahoy." --take .shipkit/voice/takes/me/0a1b2c3d4e5f.webm --out ahoy.wav'],
55
56
  ],
56
57
  })
57
58
  text = Option.String({ required: true, name: 'line' })
@@ -70,14 +71,22 @@ export class SoundVoiceCommand extends Command {
70
71
  language = Option.String('--language', { description: 'en, fr… (ElevenLabs) or English, French… (comfy-ts)' })
71
72
  comfy = Option.String('--comfy', { description: COMFY })
72
73
  seed = Option.String('--seed', { description: 'the take (default 1)' })
74
+ take = Option.String('--take', { description: 'your own recording of the line, repo relative: trimmed and levelled, no voice made' })
75
+ offset = Option.String('--offset', { description: 'with --take: where the recording\'s 0 sits on the line, seconds (negative cuts its head; default its first sound)' })
76
+ mask = Option.String('--mask', { description: 'with --take: ranges of the recording played silent, seconds, a-b,c-d' })
77
+ tweak = Option.String('--tweak', { description: 'with --take: a light disguise in semitones, pitch=<n>,formant=<n>; the length kept' })
73
78
  out = Option.String('--out', { description: 'the file it writes (required)' })
74
79
 
75
80
  execute(): Promise<number> {
76
81
  return run(this.context, async (say, root, cwd) => {
77
- const [{ resolve }, { genVoice }, { voiceOf }] = await Promise.all([import('node:path'), import('../trailer/sound/gen.ts'), import('../trailer/sound/brand.ts')])
82
+ const [{ resolve }, { genVoice, genTake }, { voiceOf, isRecord, standinOf, DEFAULT_VOICE }] = await Promise.all([import('node:path'), import('../trailer/sound/gen.ts'), import('../trailer/sound/brand.ts')])
83
+ const given = [this.eleven, this.clone, this.design, this.take].filter((x) => x !== undefined).length
84
+ if (given > 1) throw new Error('one voice: --eleven, --clone, --design or --take')
85
+ if (this.take !== undefined) {
86
+ const { maskOf, tweakOf } = await import('../trailer/sound/presets.ts')
87
+ return genTake({ take: resolve(root, this.take), offset: this.offset === undefined ? null : num('--offset', this.offset, 0), mask: maskOf(this.mask), tweak: tweakOf(this.tweak), out: resolve(cwd, outOf(this.out)), say })
88
+ }
78
89
  const brand = await brandSound(root)
79
- const given = [this.eleven, this.clone, this.design].filter((x) => x !== undefined).length
80
- if (given > 1) throw new Error('one voice: --eleven, --clone or --design')
81
90
  const n = (k: string, v: string | undefined): number | undefined => (v === undefined ? undefined : num(k, v, 0))
82
91
  const lang = this.language !== undefined ? { language: this.language } : {}
83
92
  const eng = this.engine !== undefined ? { engine: this.engine } : {}
@@ -85,7 +94,11 @@ export class SoundVoiceCommand extends Command {
85
94
  if (this.eleven !== undefined) voice = { eleven: this.eleven, ...(this.model ? { model: this.model } : {}), ...strip({ stability: n('--stability', this.stability), similarity: n('--similarity', this.similarity), speed: n('--speed', this.speed) }), ...lang }
86
95
  else if (this.clone !== undefined) voice = { clone: this.clone, ...(this.transcript !== undefined ? { transcript: this.transcript } : {}), ...eng, ...lang }
87
96
  else if (this.design !== undefined) voice = { design: this.design, ...(this.designLine !== undefined ? { line: this.designLine } : {}), ...strip({ seed: n('--design-seed', this.designSeed) }), ...eng, ...lang }
88
- else voice = voiceOf(brand, this.by)
97
+ else {
98
+ // a recorded voice says its line through its standin here: his take comes by --take
99
+ const v = voiceOf(brand, this.by)
100
+ voice = isRecord(v) ? standinOf(brand, v, this.by ?? DEFAULT_VOICE).voice : v
101
+ }
89
102
  await genVoice({ root, text: this.text, voice, seed: num('--seed', this.seed, 1), comfy: this.comfy ?? brand?.comfy, elevenKey: brand?.elevenKey, out: resolve(cwd, outOf(this.out)), say })
90
103
  })
91
104
  }
@@ -89,7 +89,7 @@ export class TrailerCheckCommand extends Command {
89
89
  const b = await import('../trailer/build.ts')
90
90
  const l = await b.load(b.trailerFile(this.file, root, cwd), root, this.variant !== undefined ? { variant: this.variant } : {})
91
91
  if (!b.sayErrors(l, say, cwd)) return 1
92
- for (const line of b.timeline(l, b.takesOfLoaded(l), await b.worldOf(l), cwd)) say(line)
92
+ for (const line of await b.planTimeline(l, b.takesOfLoaded(l), await b.worldOf(l), cwd)) say(line)
93
93
  for (const line of await b.soundLines(l)) say(` ${line}`)
94
94
  for (const line of await b.fontLines(l)) say(` ${line}`)
95
95
  say(`ok: checked in ${((performance.now() - t0) / 1000).toFixed(2)} s`)
@@ -98,6 +98,71 @@ export class TrailerCheckCommand extends Command {
98
98
  }
99
99
  }
100
100
 
101
+ export class TrailerPlanCommand extends Command {
102
+ static override paths = [['trailer', 'plan']]
103
+
104
+ static override usage = Command.Usage({
105
+ category: 'Trailer',
106
+ description: 'each shot\'s state for the owner: queued, filming, waiting on a card, ready',
107
+ details: `${DETAILS}. The plan of a cut is .shipkit/trailer-plan/<trailer>/<cut>.json, local to this machine like its takes. A shot no lane speaks for is ready once filmed: a take of an older world stays ready. A waiting shot turns ready when the owner approves its card, and queued again on any other answer. With no mark: every shot's state and the summary line. The cut is a file, a folder or a cut's name (v3-voice)`,
108
+ examples: [
109
+ ['what the lanes plan, every shot', 'sk trailer plan v3-voice'],
110
+ ['two shots to film again', 'sk trailer plan v3-voice hook,buy --queued --by trailer --why "old studio UI"'],
111
+ ['filming them now', 'sk trailer plan v3-voice hook buy --filming --by trailer'],
112
+ ['their new takes on a card', 'sk trailer plan v3-voice hook,buy --waiting 20261108-221500-hook --by trailer'],
113
+ ['compared with a refilm and kept', 'sk trailer plan v3-voice tz-close --ready --by trailer --why "take compared and kept"'],
114
+ ['no lane speaks for them any more', 'sk trailer plan v3-voice hook --clear'],
115
+ ],
116
+ })
117
+
118
+ words = Option.Rest({ required: 0 })
119
+ queued = Option.Boolean('--queued', false, { description: 'a lane will film them again' })
120
+ filming = Option.Boolean('--filming', false, { description: 'a lane films them now' })
121
+ waiting = Option.String('--waiting', { description: 'their new take waits for the owner\'s answer on this card' })
122
+ ready = Option.Boolean('--ready', false, { description: 'checked and kept: final' })
123
+ clear = Option.Boolean('--clear', false, { description: 'drop their entries: ready once filmed' })
124
+ by = Option.String('--by', { description: 'the lane\'s name (default: SK_AGENT)' })
125
+ why = Option.String('--why', { description: 'why, in plain words: "old studio UI", "new dress"' })
126
+
127
+ async execute(): Promise<number> {
128
+ return run(this.context, async (say, root, cwd) => {
129
+ const { existsSync } = await import('node:fs')
130
+ const { basename, resolve } = await import('node:path')
131
+ const b = await import('../trailer/build.ts')
132
+ const { cutIdOf, writePlan } = await import('../trailer/shot-plan.ts')
133
+ const { ID_RE } = await import('../review/model.ts')
134
+ const [first, ...rest] = this.words
135
+ // the first word names the cut: a path, or the stem of one cut under trailer/
136
+ const named = first === undefined ? [] : b.cutFiles(root).filter((f) => basename(f, '.trailer') === first)
137
+ if (named.length > 1) throw new b.Refused(`several cuts are named ${first}: ${named.map((f) => f.slice(root.length + 1)).join(', ')}; name its file`)
138
+ const isPath = first !== undefined && (first.endsWith('.trailer') || existsSync(resolve(cwd, first)))
139
+ const file = named[0] ?? b.trailerFile(isPath ? first : undefined, root, cwd)
140
+ const shots = (named.length > 0 || isPath ? rest : this.words).flatMap((w) => w.split(',')).filter(Boolean)
141
+ const marks = [this.queued && 'queued', this.filming && 'filming', this.waiting !== undefined && 'waiting', this.ready && 'ready', this.clear && 'clear'].filter((x): x is string => typeof x === 'string')
142
+ if (marks.length > 1) throw new b.Refused(`one mark at a time, got --${marks.join(' --')}`)
143
+ const l = await b.load(file, root)
144
+ if (!b.sayErrors(l, say, cwd)) return 1
145
+ if (marks.length === 1) {
146
+ if (shots.length === 0) throw new b.Refused(`--${marks[0]} marks shots: name them after the cut (hook,buy)`)
147
+ const known = new Set([...l.t.shots, ...l.t.footage].map((s) => s.name))
148
+ const unknown = shots.filter((s) => !known.has(s))
149
+ if (unknown.length > 0) throw new b.Refused(`${basename(file)} has no shot ${unknown.join(', ')}; its shots: ${[...known].join(', ')}`)
150
+ if (this.waiting !== undefined && !ID_RE.test(this.waiting)) throw new b.Refused(`--waiting takes a review card's id (YYYYMMDD-HHMMSS-slug, as sk review add prints it), got ${this.waiting}`)
151
+ const by = this.by ?? process.env.SK_AGENT
152
+ if (marks[0] !== 'clear' && !by) throw new b.Refused('--by <lane>: the owner reads who plans each shot (or set SK_AGENT)')
153
+ const { trailer, cut } = cutIdOf(file)
154
+ writePlan(root, trailer, cut, shots, marks[0] === 'clear' ? null : { mark: marks[0] as 'queued' | 'filming' | 'waiting' | 'ready', by: by!, ...(this.why ? { why: this.why } : {}), ...(this.waiting ? { card: this.waiting } : {}) })
155
+ } else if (shots.length > 0) throw new b.Refused(`a mark says what happens to ${shots.join(', ')}: --queued, --filming, --waiting <card>, --ready or --clear`)
156
+ const lines = await b.planTimeline(l, b.takesOfLoaded(l), await b.worldOf(l), cwd)
157
+ // after a mark: the marked shots' lines and the summary; with none, the whole timeline
158
+ const only = new Set(shots)
159
+ const nameOf = (line: string): string | undefined => /^\s+(?:\d+\s+[\d.]+ s|footage)\s+(\S+)\s/.exec(line)?.[1]
160
+ for (const line of lines) if (only.size === 0 || only.has(nameOf(line) ?? '') || line === lines.at(-1)) say(line)
161
+ return 0
162
+ })
163
+ }
164
+ }
165
+
101
166
  export class TrailerScoreCommand extends Command {
102
167
  static override paths = [['trailer', 'score']]
103
168
 
@@ -376,6 +441,7 @@ export class TrailerPruneCommand extends Command {
376
441
  export const TRAILER_COMMANDS = [
377
442
  TrailerCommand,
378
443
  TrailerCheckCommand,
444
+ TrailerPlanCommand,
379
445
  TrailerScoreCommand,
380
446
  TrailerShotCommand,
381
447
  TrailerSectionCommand,
@@ -5,6 +5,7 @@ import { homedir } from 'os'
5
5
  import { join } from 'path'
6
6
 
7
7
  export const FAMILY_PAGES: Readonly<Record<string, string>> = {
8
+ Annex: 'tools/shipkit/annex.md',
8
9
  Asks: 'preferences/human-loop/index.md',
9
10
  Assets: 'tools/generate-assets/index.md',
10
11
  Drill: 'meta/speed-up-agents/index.md',
@@ -12,6 +13,7 @@ export const FAMILY_PAGES: Readonly<Record<string, string>> = {
12
13
  Health: 'tools/shipkit/index.md',
13
14
  Home: 'tools/shipkit/home.md',
14
15
  Media: 'tools/shipkit/media-store.md',
16
+ Messages: 'tools/shipkit/messages.md',
15
17
  Refactor: 'patterns/typescript/index.md',
16
18
  Review: 'tools/shipkit/review.md',
17
19
  Scaffold: 'patterns/pocketbase/index.md',
@@ -5,4 +5,4 @@ export { Command, Option } from 'clipanion'
5
5
  export { type Family, familiesFor, listing, listingOf } from './families.ts'
6
6
  export { callsFile, logCall } from './calls.ts'
7
7
  export { type ProjectCliSpec, projectCli, runProjectCli } from './project-cli.ts'
8
- export { argvOf, type AskTool, type CommandClass, type Essential, type Film, filmCall, type KitContext, type Run, type Verb, verbs } from './verb.ts'
8
+ export { argvOf, type AskTool, type CommandClass, type Effect, type Essential, type Film, filmCall, type KitContext, type Run, type Verb, verbs } from './verb.ts'
@@ -36,6 +36,9 @@ export type Run =
36
36
  /** a row that shoots a state: `still` writes one image at `--out`, `clip` a video, its length `--seconds` */
37
37
  export type Film = 'still' | 'clip'
38
38
 
39
+ /** `outward`: acts beyond this machine or spends money (a push, a deploy, a paid api); the hub asks before it runs */
40
+ export type Effect = 'outward'
41
+
39
42
  /** an everyday command, listed on the essentials page every session loads */
40
43
  export type Essential = {
41
44
  /** its arguments as an agent types them: '<x> <y>' */
@@ -59,6 +62,7 @@ export type Verb = {
59
62
  /** 'own': `--help` also runs the tool with `--help`, which prints its flags and exits 0 */
60
63
  help?: 'own'
61
64
  essential?: Essential
65
+ effect?: Effect
62
66
  /** filmable: takes `--out <path>`, a clip also `--seconds <n>` (a trailer `film` line calls it) */
63
67
  film?: Film
64
68
  /** with film: the row's take version, a bump films every trailer take of the row again */
@@ -127,6 +131,7 @@ export function verbs(rows: Verb[]): CommandClass[] {
127
131
  static override paths = [v.path.split(' ')]
128
132
  static override usage = Command.Usage({ category: v.category, description: v.description, details: v.details, examples: v.examples })
129
133
  static essential = v.essential
134
+ static effect = v.effect
130
135
  static film = v.film
131
136
  static filmVersion = v.version
132
137
  static filmLength = v.length
@@ -160,10 +165,13 @@ export function verbs(rows: Verb[]): CommandClass[] {
160
165
 
161
166
  /** the marks a command class carries: set by `verbs()` from its row, or
162
167
  * declared as statics on a hand written class */
163
- export function marksOf(c: object): { essential?: Essential; film?: Film; version?: number | string; length?: 'own'; words?: Record<string, unknown>; stamp?: string[] } {
164
- const o = c as { essential?: unknown; film?: unknown; filmVersion?: unknown; filmLength?: unknown; filmWords?: unknown; filmStamp?: unknown }
165
- const out: { essential?: Essential; film?: Film; version?: number | string; length?: 'own'; words?: Record<string, unknown>; stamp?: string[] } = {}
168
+ export type Marks = { essential?: Essential; effect?: Effect; film?: Film; version?: number | string; length?: 'own'; words?: Record<string, unknown>; stamp?: string[] }
169
+
170
+ export function marksOf(c: object): Marks {
171
+ const o = c as { essential?: unknown; effect?: unknown; film?: unknown; filmVersion?: unknown; filmLength?: unknown; filmWords?: unknown; filmStamp?: unknown }
172
+ const out: Marks = {}
166
173
  if (typeof o.essential === 'object' && o.essential !== null) out.essential = o.essential as Essential
174
+ if (o.effect === 'outward') out.effect = 'outward'
167
175
  if (o.film === 'still' || o.film === 'clip') {
168
176
  out.film = o.film
169
177
  if (typeof o.filmVersion === 'number' || typeof o.filmVersion === 'string') out.version = o.filmVersion
@@ -33,7 +33,7 @@ import { NeedsCommand } from './cmd_Needs.ts'
33
33
  import { PbCollectionCommand } from './cmd_Pb.ts'
34
34
  import { ReflectCommand } from './cmd_Reflect.ts'
35
35
  import { ReleaseCommand } from './cmd_Release.ts'
36
- import { ReleasesCommand } from './cmd_Releases.ts'
36
+ import { ReleasesAddCommand, ReleasesCommand, ReleasesRefreshCommand } from './cmd_Releases.ts'
37
37
  import { ChecksCommand, UnitsAliasCommand } from './cmd_Checks.ts'
38
38
  import { WhenCommand } from './cmd_When.ts'
39
39
  import { CacheAuditCommand } from './cmd_CacheAudit.ts'
@@ -48,8 +48,10 @@ import { SOUND_COMMANDS } from './cmd_Sound.ts'
48
48
  import { REVIEW_COMMANDS } from './cmd_Review.ts'
49
49
  import { SOCIAL_COMMANDS } from './cmd_Social.ts'
50
50
  import { MEDIA_COMMANDS } from './cmd_Media.ts'
51
+ import { ANNEX_COMMANDS } from './cmd_Annex.ts'
51
52
  import { BACKUP_COMMANDS } from './cmd_Backup.ts'
52
53
  import { VEILLE_COMMANDS } from './cmd_Veille.ts'
54
+ import { MESSAGES_COMMANDS } from './cmd_Messages.ts'
53
55
  import { TuiCommand } from './cmd_Tui.ts'
54
56
  import { SecretListCommand, SecretReadCommand, SecretSetCommand } from './cmd_Secret.ts'
55
57
  import { WikiLintCommand, WikiServeCommand } from './cmd_Wiki.ts'
@@ -81,6 +83,8 @@ export function buildCli(): Cli {
81
83
  cli.register(BumpCommand)
82
84
  cli.register(ReleaseCommand)
83
85
  cli.register(ReleasesCommand)
86
+ cli.register(ReleasesAddCommand)
87
+ cli.register(ReleasesRefreshCommand)
84
88
  cli.register(HooksInstallCommand)
85
89
  cli.register(HooksPreCommitCommand)
86
90
  cli.register(HooksCommitMsgCommand)
@@ -93,8 +97,10 @@ export function buildCli(): Cli {
93
97
  for (const c of REVIEW_COMMANDS) cli.register(c)
94
98
  for (const c of SOCIAL_COMMANDS) cli.register(c)
95
99
  for (const c of MEDIA_COMMANDS) cli.register(c)
100
+ for (const c of ANNEX_COMMANDS) cli.register(c)
96
101
  for (const c of BACKUP_COMMANDS) cli.register(c)
97
102
  for (const c of VEILLE_COMMANDS) cli.register(c)
103
+ for (const c of MESSAGES_COMMANDS) cli.register(c)
98
104
  cli.register(ServeCommand)
99
105
  cli.register(PmCommand)
100
106
  cli.register(DaemonCommand)
@@ -32,7 +32,7 @@ export const NO_CHECK = 'in no check'
32
32
  * section a row lives under (hub-app/tree-build.ts KIND_SECTION). There is no
33
33
  * catch all kind: a row belongs to an owner, and what belongs to the hub
34
34
  * itself is its status (serve/hub-problems.ts), never a row */
35
- export const RESOURCE_TYPES = ['ask', 'secret', 'asset', 'post', 'workflow', 'wiki', 'contract', 'check', 'test', 'reflection', 'process', 'card', 'cut', 'store', 'veille'] as const
35
+ export const RESOURCE_TYPES = ['ask', 'secret', 'asset', 'post', 'workflow', 'wiki', 'contract', 'check', 'test', 'reflection', 'process', 'command', 'card', 'cut', 'voice', 'store', 'release', 'veille', 'message'] as const
36
36
 
37
37
  /** the collection of the review cards that wait on him (collections/review.ts) */
38
38
  export const REVIEW_COL = 'review'
@@ -40,8 +40,12 @@ export const REVIEW_COL = 'review'
40
40
  export const TRAILER_COL = 'trailers'
41
41
  /** the collection of the store pages, one row a store (stores/collection.ts) */
42
42
  export const STORES_COL = 'stores'
43
+ /** the collection of the release files, one row a version, next first (releases/collection.ts) */
44
+ export const RELEASES_COL = 'releases'
43
45
  /** the collection of the Veille, one row for the identity whose posts it ranks (veille/collection.ts) */
44
46
  export const VEILLE_COL = 'veille'
47
+ /** the collection of the messages page's tabs, one row each under its section (messages/collection.ts) */
48
+ export const MESSAGES_COL = 'messages'
45
49
 
46
50
  export type ResourceType = (typeof RESOURCE_TYPES)[number]
47
51
 
@@ -243,6 +247,9 @@ export type Instance = {
243
247
  /** the group it sits in on the tree, under its section: an asset's kit
244
248
  * category. Absent = directly under the section */
245
249
  group?: string
250
+ /** its place among its siblings on the tree, where the labels' alphabet is the wrong order (a page's tabs, in the
251
+ * page's order). Absent = after the ordered ones, by label */
252
+ order?: number
246
253
  type: ResourceType
247
254
  /** a slash path. Where a truth file exists this IS its repo-relative
248
255
  * path; otherwise a VIRTUAL path under a root named for the type, and
@@ -28,7 +28,10 @@ import { assetState, secretState, type SecretLevel, type SecretProbe } from './s
28
28
  import { reflectionsCollection } from './reflections.ts'
29
29
  import { reviewCollection, trailersCollection } from './review.ts'
30
30
  import { storesCollection } from '../stores/collection.ts'
31
+ import { messagesCollection } from '../messages/collection.ts'
32
+ import { releasesCollection } from '../releases/collection.ts'
31
33
  import { veilleCollection } from '../veille/collection.ts'
34
+ import { picturesCollection } from '../identities/collection.ts'
32
35
  import { testsCollection } from './tests.ts'
33
36
  import { checksCollection } from './checks.ts'
34
37
  import { LAYOUT } from '../core/layout.ts'
@@ -419,6 +422,6 @@ export function buildCollections(root: string, c: RepoConfig, kit: ResolvedKit |
419
422
  reflectionsCollection(root),
420
423
  testsCollection(root, c),
421
424
  // only where the repo has a review store, a trailer folder or a store folder: the section of a repo with none is greyed
422
- ...[reviewCollection(root), trailersCollection(root), storesCollection(root), veilleCollection(root)].filter((x): x is Collection => x !== null),
425
+ ...[reviewCollection(root), trailersCollection(root), storesCollection(root), releasesCollection(root), messagesCollection(root), veilleCollection(root), picturesCollection(root)].filter((x): x is Collection => x !== null),
423
426
  ]
424
427
  }
@@ -1,13 +1,16 @@
1
1
  // the review store and the trailer cuts as tree rows (wiki tools/shipkit/review.md). Under the review section, one row a
2
2
  // card that waits on HIM (the owner's verdict, his answer to a question): yellow, so `sk needs` lists it too. Under the trailer
3
- // section, one row a cut, its open frame notes in the slot: they wait on agents, never on him, so a cut is never yellow.
4
- // Each collection exists only where the repo has its folder, so a repo with none draws the section greyed
3
+ // section, one row a cut, its open frame notes in the slot: they wait on agents, never on him, so a cut is never yellow;
4
+ // and one yellow row a line of his own voice he has not recorded yet (the page's Voices). Each collection exists only where the repo has its folder, so a repo with none draws the section greyed
5
5
  import { existsSync } from 'node:fs'
6
6
  import { join } from 'node:path'
7
7
  import { STATUS_LABEL, isFrame, stateOf, type ReviewItem } from '../review/model.ts'
8
8
  import { readAllCached, storeDir, storeStamp, warmStore } from '../review/store.ts'
9
9
  import { statusOf, waitingOnOwner, type Thread } from '../review/threads.ts'
10
10
  import { cutsOf, trailerIds } from '../review/trailer-desk.ts'
11
+ import { voicesDesk } from '../review/trailer-voices.ts'
12
+ import { recordVoices } from '../trailer/sound/brand.ts'
13
+ import { brandSound } from '../trailer/sound/index.ts'
11
14
  import { REVIEW_COL, TRAILER_COL, type Collection, type Instance } from './collection-types.ts'
12
15
 
13
16
  const waiting = new Map<string, { stamp: string; threads: Thread[]; items: ReviewItem[] }>()
@@ -66,7 +69,23 @@ export function trailersCollection(root: string): Collection | null {
66
69
  const s = x.item.subject
67
70
  if (isFrame(s) && stateOf(x, false).state !== 'closed') open.set(`${s.trailer}/${s.cut}`, (open.get(`${s.trailer}/${s.cut}`) ?? 0) + 1)
68
71
  }
69
- return ids.flatMap((id) =>
72
+ // a line of his recorded voice with no take waits on him: yellow, one row a text
73
+ const voices: Instance[] = []
74
+ const brand = await brandSound(root).catch(() => undefined)
75
+ if (recordVoices(brand).length > 0)
76
+ for (const id of ids)
77
+ for (const l of (await voicesDesk(root, id, brand))?.lines ?? [])
78
+ if (l.mine && !l.take)
79
+ voices.push({
80
+ id: `voice:${id}/${l.key}`,
81
+ text: `${id}: "${l.words}" waits for your voice`,
82
+ label: l.words.length > 48 ? `${l.words.slice(0, 47).trimEnd()}…` : l.words,
83
+ slot: 'to record',
84
+ type: 'voice',
85
+ path: l.uses[0]?.file ?? `trailer/${id}`,
86
+ severity: 'yellow',
87
+ })
88
+ return [...voices, ...ids.flatMap((id) =>
70
89
  cutsOf(join(root, 'trailer', id)).map((c): Instance => {
71
90
  const n = open.get(`${id}/${c.cut}`) ?? 0
72
91
  const rendered = existsSync(join(root, 'trailer', id, 'out', `${c.name}.mp4`))
@@ -80,7 +99,7 @@ export function trailersCollection(root: string): Collection | null {
80
99
  state: rendered ? 'idle' : 'quiet',
81
100
  }
82
101
  }),
83
- )
102
+ )]
84
103
  },
85
104
  }
86
105
  }
@@ -0,0 +1,36 @@
1
+ // what the commands page and its routes share: the view it reads, and when a run waits for a confirm. Pure, so the
2
+ // page bundles it
3
+ import type { CommandRow } from '../cli/cmd_Commands.ts'
4
+ import type { Reach } from '../serve/same-origin.ts'
5
+ import type { RunView } from './runs.ts'
6
+
7
+ export type { RunView }
8
+
9
+ /** what `GET /api/commands` answers */
10
+ export type CommandsView = {
11
+ bin: string
12
+ rows: CommandRow[]
13
+ runs: RunView[]
14
+ /** where the page reaches the hub from: a run from his phone confirms first */
15
+ reach: Reach
16
+ /** why the repo shows no command: no CLI, or one that failed to list */
17
+ error: string | null
18
+ }
19
+
20
+ /** what `GET /api/commands/runs/<id>` answers */
21
+ export type LogView = { run: RunView; text: string; next: number; size: number }
22
+
23
+ /** why a run of this row waits for a confirm click, null when it runs at once */
24
+ export function confirmWhy(row: Pick<CommandRow, 'effect'>, reach: Reach): string | null {
25
+ if (row.effect === 'outward') return 'it acts beyond this machine or spends money'
26
+ if (reach === 'tailnet') return 'it starts on the Mac from another device'
27
+ return null
28
+ }
29
+
30
+ /** the args an example line gives its command: what follows the binary and the command's words; null for a line
31
+ * of another command, which the page shows without a run button */
32
+ export function exampleArgs(bin: string, path: string, line: string): string | null {
33
+ const head = `${bin} ${path}`
34
+ if (line === head) return ''
35
+ return line.startsWith(`${head} `) ? line.slice(head.length + 1) : null
36
+ }