rvlib-shipkit 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/annex/annex.ts +227 -0
- package/src/annex/offload.ts +279 -0
- package/src/checks/SK040-release-words.check.ts +43 -0
- package/src/checks/SK041-annex-links.check.ts +28 -0
- package/src/checks/SK042-post-kinds.check.ts +73 -0
- package/src/cli/cmd_Annex.ts +179 -0
- package/src/cli/cmd_Commands.ts +4 -1
- package/src/cli/cmd_Home.ts +3 -2
- package/src/cli/cmd_Messages.ts +155 -0
- package/src/cli/cmd_Releases.ts +48 -0
- package/src/cli/cmd_Review.ts +161 -6
- package/src/cli/cmd_Shot.ts +4 -4
- package/src/cli/cmd_Social.ts +143 -6
- package/src/cli/family-pages.ts +2 -0
- package/src/cli/kit/index.ts +1 -1
- package/src/cli/kit/verb.ts +11 -3
- package/src/cli/registry.ts +6 -1
- package/src/collections/collection-types.ts +8 -1
- package/src/collections/providers.ts +4 -1
- package/src/commands/model.ts +36 -0
- package/src/commands/registry.ts +49 -0
- package/src/commands/routes.ts +59 -0
- package/src/commands/runner.ts +35 -0
- package/src/commands/runs.ts +112 -0
- package/src/core/app-icon.ts +4 -3
- package/src/core/icon-type.ts +8 -0
- package/src/core/jobs.ts +4 -3
- package/src/core/layout.ts +5 -2
- package/src/core/squircle.ts +95 -0
- package/src/home/daemon-jobs.ts +26 -2
- package/src/home/global-units.ts +3 -0
- package/src/home/gui-app/ShipkitGui.swift +302 -5
- package/src/home/gui-app.ts +63 -33
- package/src/home/hmr-keep.ts +134 -0
- package/src/home/home-start.ts +2 -2
- package/src/home/lib-watch.ts +21 -11
- package/src/home/pm.ts +1 -1
- package/src/home/process-apps.ts +181 -0
- package/src/home/resources.ts +3 -3
- package/src/home/run-web.ts +7 -4
- package/src/home/serve-web.ts +64 -14
- package/src/identities/collection.ts +49 -0
- package/src/identities/identities.ts +110 -8
- package/src/identities/machine.ts +4 -3
- package/src/identities/rating.ts +33 -0
- package/src/identities/shown.ts +170 -0
- package/src/identities/steps.ts +5 -0
- package/src/media-store/purge.ts +15 -1
- package/src/media-store/remote.ts +22 -6
- package/src/messages/brief.ts +117 -0
- package/src/messages/collection.ts +40 -0
- package/src/messages/model.ts +171 -0
- package/src/messages/routes.ts +15 -0
- package/src/messages/score.ts +180 -0
- package/src/messages/tabs.ts +13 -0
- package/src/release/notes.ts +130 -0
- package/src/release/run-bump.ts +41 -18
- package/src/release/run-release.ts +22 -4
- package/src/release/run-releases.ts +17 -15
- package/src/release/unit-resolve.ts +9 -0
- package/src/releases/add.ts +66 -0
- package/src/releases/collection.ts +36 -0
- package/src/releases/from-card.ts +66 -0
- package/src/releases/model.ts +267 -0
- package/src/releases/pictures.ts +89 -0
- package/src/releases/routes.ts +36 -0
- package/src/releases/store.ts +71 -0
- package/src/repo-config.ts +5 -0
- package/src/review/cells.ts +0 -11
- package/src/review/format.ts +10 -6
- package/src/review/model.ts +92 -3
- package/src/review/notes.ts +2 -48
- package/src/review/routes.ts +28 -10
- package/src/review/stage-card.ts +197 -0
- package/src/review/stage-routes.ts +123 -0
- package/src/review/store.ts +36 -0
- package/src/review/trailer-card.ts +99 -0
- package/src/review/trailer-desk.ts +57 -4
- package/src/review/trailer-model.ts +41 -7
- package/src/review/trailer-notes.ts +45 -0
- package/src/review/trailer-routes.ts +22 -13
- package/src/serve/hub-app/app-bridge.ts +71 -0
- package/src/serve/hub-app/commands/commands-page.tsx +122 -0
- package/src/serve/hub-app/commands/commands-st.ts +177 -0
- package/src/serve/hub-app/commands.css +24 -0
- package/src/serve/hub-app/hash-route.ts +40 -1
- package/src/serve/hub-app/home-st.ts +11 -2
- package/src/serve/hub-app/home.html +3 -0
- package/src/serve/hub-app/hub-app.tsx +6 -0
- package/src/serve/hub-app/icons.tsx +5 -0
- package/src/serve/hub-app/identities-view.tsx +4 -1
- package/src/serve/hub-app/identities.css +1 -0
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/keys.ts +2 -2
- package/src/serve/hub-app/machine-st.ts +41 -10
- package/src/serve/hub-app/messages/messages-page.tsx +354 -0
- package/src/serve/hub-app/messages/messages-st.ts +74 -0
- package/src/serve/hub-app/messages.css +35 -0
- package/src/serve/hub-app/releases/releases-page.tsx +94 -0
- package/src/serve/hub-app/releases/releases-st.ts +69 -0
- package/src/serve/hub-app/releases.css +25 -0
- package/src/serve/hub-app/repo-sections.ts +15 -1
- package/src/serve/hub-app/repo-st.ts +56 -5
- package/src/serve/hub-app/review/clip-st.ts +31 -3
- package/src/serve/hub-app/review/note-place.ts +31 -0
- package/src/serve/hub-app/review/review-cells.tsx +27 -3
- package/src/serve/hub-app/review/review-st.ts +77 -2
- package/src/serve/hub-app/review/review-thread.tsx +9 -31
- package/src/serve/hub-app/review/review-views.tsx +164 -58
- package/src/serve/hub-app/review/thread-st.ts +108 -41
- package/src/serve/hub-app/review/trailer-card.tsx +187 -0
- package/src/serve/hub-app/review/trailer-page.tsx +62 -31
- package/src/serve/hub-app/review/trailer-st.ts +138 -26
- package/src/serve/hub-app/review/trailer-timeline.tsx +39 -26
- package/src/serve/hub-app/review.css +49 -6
- package/src/serve/hub-app/social/comms-page.tsx +55 -23
- package/src/serve/hub-app/social/identity-pictures.ts +46 -8
- package/src/serve/hub-app/social/kit.tsx +9 -6
- package/src/serve/hub-app/social/post-card.tsx +10 -2
- package/src/serve/hub-app/social/social-model.ts +37 -3
- package/src/serve/hub-app/social/social-page.tsx +179 -65
- package/src/serve/hub-app/social/social-st.ts +79 -26
- package/src/serve/hub-app/social/stage-popup.tsx +268 -0
- package/src/serve/hub-app/social/stage-st.ts +310 -0
- package/src/serve/hub-app/social/step-layout.ts +42 -0
- package/src/serve/hub-app/social.css +60 -1
- package/src/serve/hub-app/tree-build.ts +38 -1
- package/src/serve/hub-app/tree-svc.ts +10 -3
- package/src/serve/project-gutter-route.ts +4 -2
- package/src/serve/same-origin.ts +24 -1
- package/src/serve/serve-hub.ts +15 -1
- package/src/shipkit-files.ts +9 -7
- package/src/shot/shooter.ts +3 -3
- package/src/shot/shot-ask.ts +14 -3
- package/src/shot/shot.shipkit.ts +1 -1
- package/src/social/discord-layout.ts +48 -5
- package/src/social/fit.ts +84 -0
- package/src/social/identity-words.ts +74 -0
- package/src/social/kind-pages.ts +41 -0
- package/src/social/kinds.ts +92 -0
- package/src/social/load.ts +105 -9
- package/src/social/media-limit.ts +63 -2
- package/src/social/presence.ts +1 -1
- package/src/social/publish/bluesky.ts +58 -19
- package/src/social/publish/index.ts +31 -5
- package/src/social/reach.ts +49 -0
- package/src/social/release-stage.ts +173 -0
- package/src/social/routes.ts +42 -7
- package/src/social/stage.ts +227 -0
- package/src/social/strip.ts +85 -0
- package/src/social/text.ts +6 -2
- package/src/social/unit.ts +57 -1
- package/src/social/writes.ts +11 -0
- package/src/trailer/build.ts +15 -2
- package/src/trailer/grammar.ts +14 -4
- package/src/trailer/public-words.ts +41 -0
package/src/cli/cmd_Review.ts
CHANGED
|
@@ -155,14 +155,21 @@ function flagsOf(args: readonly string[], values: readonly string[], repeat: rea
|
|
|
155
155
|
const ADD_FLAGS = `flags:
|
|
156
156
|
--title "<title>" one short line: what he looks at
|
|
157
157
|
--what "<what>" what changed and why, short markdown: one line, then - bullets
|
|
158
|
-
--
|
|
158
|
+
--post "<line>" the public line for a post of it, what a user gets (the repo's guard reads it)
|
|
159
|
+
--changelog "<category>: <line>" its change in the release being filled: on his approval it lands in .shipkit/releases/next.md with the card's after picture (the repo's guard reads it)
|
|
160
|
+
--image <a.png> the subject; a clip (webm, mp4) goes anywhere an image goes
|
|
159
161
|
--video <clip.mp4> a clip
|
|
160
162
|
--audio <sound.wav> a sound: a waveform and a player (wav, mp3, flac, ogg, opus, m4a)
|
|
161
163
|
--before <a.png> --after <b.png> a before and after: two images, two clips of one size, or two sounds
|
|
162
164
|
--label "<label>" the first view's label
|
|
163
165
|
--view "<label>" <a.png> [<b.png>] another view of the same subject (repeat it); --note "<text>" right after it: a line on that view
|
|
164
166
|
--choice every view is an option he scores and picks one of (two --view or more)
|
|
167
|
+
--pick <view> with --choice: the option you suggest, by its letter (B) or its label; the hub pills it « my pick » (later: sk review pick <id> <view>)
|
|
165
168
|
--gallery "<label>" <a.png> … a grid he rates tile by tile (stars, OK, fix or no, a word), alone or beside other views; a tile is "[<row>/]<label>=[<before>,]<after>": a redraw carries its before, a row holds one asset's variants
|
|
169
|
+
--trailer <cut.trailer> a trailer cut, played in the card by the trailer entry's player, never a compiled clip; his notes land on its shots
|
|
170
|
+
--version v<n> with --trailer: a kept version of that cut, else the cut's own render
|
|
171
|
+
--before v<m> | <cut> with --trailer: the render he switches to on the same shot
|
|
172
|
+
--shots <a,b> with --trailer: the shots the change touched (else, with --before, the shots whose block differs)
|
|
166
173
|
--topic <topic> what part of the project it is about (sk review topics)
|
|
167
174
|
--subject <kind> what is judged (default shot; the repo's unit names its kinds)
|
|
168
175
|
--commit <sha> the commit it shows
|
|
@@ -185,6 +192,33 @@ async function helpWithUnit(context: Ctx, usage: string, kinds: boolean): Promis
|
|
|
185
192
|
return 0
|
|
186
193
|
}
|
|
187
194
|
|
|
195
|
+
/** --trailer and its flags as a card: its cut, pinned renders and shots, the image it keeps (a still cut into a temp
|
|
196
|
+
* folder `drop` removes); null without --trailer, which then refuses its own flags */
|
|
197
|
+
export async function trailerOfFlags(o: Record<string, string>, others: boolean): Promise<{ card: import('../review/model.ts').TrailerCard; image: string; drop: () => void } | null> {
|
|
198
|
+
if (o.trailer === undefined) {
|
|
199
|
+
for (const k of ['version', 'shots']) if (o[k] !== undefined) throw new Error(`--${k}: only with --trailer <cut.trailer>`)
|
|
200
|
+
return null
|
|
201
|
+
}
|
|
202
|
+
const clash = ['image', 'video', 'audio', 'after', 'live'].filter((k) => o[k] !== undefined)
|
|
203
|
+
if (clash.length > 0 || others) throw new Error(`--trailer: the card plays the cut; no ${clash.length > 0 ? clash.map((k) => `--${k}`).join(', ') : '--view, --gallery, --choice or --wip'} beside it`)
|
|
204
|
+
const { mkdtempSync, rmSync } = await import('node:fs')
|
|
205
|
+
const { tmpdir } = await import('node:os')
|
|
206
|
+
const { join } = await import('node:path')
|
|
207
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
208
|
+
const { trailerCardOf } = await import('../review/trailer-card.ts')
|
|
209
|
+
const tmp = mkdtempSync(join(tmpdir(), 'trailer-card-'))
|
|
210
|
+
const drop = (): void => rmSync(tmp, { recursive: true, force: true })
|
|
211
|
+
try {
|
|
212
|
+
const shots = o.shots?.split(',').map((s) => s.trim()).filter((s) => s !== '')
|
|
213
|
+
const input = { file: o.trailer, ...(o.version ? { version: o.version } : {}), ...(o.before ? { before: o.before } : {}), ...(shots ? { shots } : {}) }
|
|
214
|
+
const r = await trailerCardOf(findRepoRoot(process.cwd()), process.cwd(), input, join(tmp, 'still.png'))
|
|
215
|
+
return { ...r, drop }
|
|
216
|
+
} catch (e) {
|
|
217
|
+
drop()
|
|
218
|
+
throw e
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
188
222
|
export class ReviewAddCommand extends Command {
|
|
189
223
|
static override paths = [['review', 'add']]
|
|
190
224
|
static override usage = Command.Usage({
|
|
@@ -195,8 +229,9 @@ export class ReviewAddCommand extends Command {
|
|
|
195
229
|
['one image', 'sk review add --title "the new menu" --what "the menu, bigger" --image shots/menu.png'],
|
|
196
230
|
['a before and after', 'sk review add --title "lamps lit" --what "..." --before a.png --after b.png'],
|
|
197
231
|
['a second version after his answer', 'sk review add --title "lamps lit" --what "..." --image c.png --supersedes <id>'],
|
|
198
|
-
['a pick among three voices', 'sk review add --choice --title "the narrator" --what "..." --view "voice 0" a.flac --note "low, breathy" --view "voice 1" b.flac --view "voice 2" c.flac'],
|
|
232
|
+
['a pick among three voices, yours on the second', 'sk review add --choice --pick B --title "the narrator" --what "..." --view "voice 0" a.flac --note "low, breathy" --view "voice 1" b.flac --view "voice 2" c.flac'],
|
|
199
233
|
['icons he rates one by one', 'sk review add --title "buff icons" --what "..." --gallery "icons" vitality=a.png haste=b.png greed=c.png'],
|
|
234
|
+
['a trailer cut against its last kept version', 'sk review add --trailer trailer/demo/main.trailer --version v4 --before v3 --title "the drop, recut" --what "..."'],
|
|
200
235
|
],
|
|
201
236
|
})
|
|
202
237
|
args = Option.Proxy()
|
|
@@ -212,9 +247,10 @@ export class ReviewAddCommand extends Command {
|
|
|
212
247
|
const kindName = rest[rest.indexOf('--subject') + 1]
|
|
213
248
|
const kind = rest.includes('--subject') && kindName ? h.unit?.kinds?.[kindName] : undefined
|
|
214
249
|
const own = [...Object.keys(kind?.flags ?? {}), ...Object.keys(h.unit?.flags ?? {})]
|
|
215
|
-
const f = flagsOf(rest, ['title', 'what', 'image', 'video', 'audio', 'before', 'after', 'label', 'topic', 'subject', 'commit', 'lane', 'supersedes', 'keeps', 'why', 'live'], ['answers', ...own], ['new', 'wip', 'choice'])
|
|
250
|
+
const f = flagsOf(rest, ['title', 'what', 'post', 'changelog', 'image', 'video', 'audio', 'before', 'after', 'label', 'topic', 'subject', 'commit', 'lane', 'supersedes', 'keeps', 'why', 'live', 'trailer', 'version', 'shots', 'pick'], ['answers', ...own], ['new', 'wip', 'choice'])
|
|
216
251
|
if (f.positionals.length > 0) throw new Error(`unexpected ${f.positionals.join(' ')}`)
|
|
217
252
|
const o = f.one
|
|
253
|
+
const trailer = await trailerOfFlags(o, views.length > 0 || f.on.has('wip') || f.on.has('choice'))
|
|
218
254
|
const repoFlags = Object.fromEntries(own.flatMap((k) => (f.many[k] ? [[k, f.many[k]]] : [])))
|
|
219
255
|
const parsed = kind?.parse ? kind.parse(Object.fromEntries(Object.keys(kind.flags ?? {}).map((k) => [k, f.many[k] ?? []]))) : null
|
|
220
256
|
if (f.on.has('wip') !== (o.live !== undefined)) throw new Error('--wip --live <name>: a draft card names its live shot, and a live shot makes a draft card')
|
|
@@ -226,16 +262,40 @@ export class ReviewAddCommand extends Command {
|
|
|
226
262
|
wipViews = [{ label: '', image: fr.image }, ...(fr.history.length > 0 ? [{ label: 'history', gallery: fr.history }] : [])]
|
|
227
263
|
}
|
|
228
264
|
const answers = await Promise.all((f.many.answers ?? []).map((a) => idOf(h.dir, a)))
|
|
265
|
+
if (o.post !== undefined) {
|
|
266
|
+
// a public line: the repo's guard reads it before the card holds it
|
|
267
|
+
const { dirname } = await import('node:path')
|
|
268
|
+
const { loadSocialUnit } = await import('../social/unit.ts')
|
|
269
|
+
const unit = await loadSocialUnit(dirname(dirname(h.dir)))
|
|
270
|
+
const problems = unit?.guard ? [...unit.guard({ title: '', alt: '', texts: [o.post], files: [] })] : []
|
|
271
|
+
if (problems.length > 0) throw new Error(`--post: the repo's guard refuses it: ${problems.join('; ')}`)
|
|
272
|
+
}
|
|
273
|
+
let changelog: import('../review/model.ts').CardChangelog | undefined
|
|
274
|
+
if (o.changelog !== undefined) {
|
|
275
|
+
// its category and line are public words: the repo's guard reads them before the card holds them
|
|
276
|
+
const { dirname } = await import('node:path')
|
|
277
|
+
const { changelogOfFlag } = await import('../review/model.ts')
|
|
278
|
+
const { publicProblems } = await import('../social/unit.ts')
|
|
279
|
+
const { undeclaredReleases } = await import('../releases/store.ts')
|
|
280
|
+
changelog = changelogOfFlag(o.changelog)
|
|
281
|
+
const why = await undeclaredReleases(dirname(dirname(h.dir)))
|
|
282
|
+
if (why) throw new Error(`--changelog: ${why}`)
|
|
283
|
+
const problems = await publicProblems(dirname(dirname(h.dir)), { texts: [changelog.category, changelog.line] })
|
|
284
|
+
if (problems.length > 0) throw new Error(`--changelog: the repo's guard refuses it: ${problems.join('; ')}`)
|
|
285
|
+
}
|
|
229
286
|
const topic = o.topic ?? parsed?.topic
|
|
230
287
|
let input: import('../review/store.ts').AddInput = {
|
|
231
288
|
title: o.title ?? '',
|
|
232
289
|
what: o.what ?? '',
|
|
233
|
-
...(
|
|
290
|
+
...(o.post ? { post: o.post } : {}),
|
|
291
|
+
...(changelog ? { changelog } : {}),
|
|
292
|
+
...(parsed ? { subject: parsed.subject } : o.subject ? { subject: { kind: o.subject } } : trailer ? { subject: { kind: 'trailer' } } : {}),
|
|
234
293
|
...(topic ? { topic } : {}),
|
|
294
|
+
...(trailer ? { image: trailer.image, trailer: trailer.card } : {}),
|
|
235
295
|
...(o.image ? { image: o.image } : {}),
|
|
236
296
|
...(o.video ? { video: o.video } : {}),
|
|
237
297
|
...(o.audio ? { audio: o.audio } : {}),
|
|
238
|
-
...(o.before ? { before: o.before } : {}),
|
|
298
|
+
...(o.before && !trailer ? { before: o.before } : {}),
|
|
239
299
|
...(o.after ? { after: o.after } : {}),
|
|
240
300
|
...(o.label ? { label: o.label } : {}),
|
|
241
301
|
...(o.commit ? { commit: o.commit } : {}),
|
|
@@ -246,12 +306,15 @@ export class ReviewAddCommand extends Command {
|
|
|
246
306
|
...(answers.length > 0 ? { answers } : {}),
|
|
247
307
|
...(f.on.has('new') ? { fresh: true } : {}),
|
|
248
308
|
...(f.on.has('choice') ? { choice: true } : {}),
|
|
309
|
+
...(o.pick !== undefined ? { agentPick: o.pick } : {}),
|
|
249
310
|
...(o.live !== undefined ? { image: wipViews[0]?.image ?? '', views: wipViews.slice(1), wip: { live: o.live } } : { views }),
|
|
250
311
|
}
|
|
251
312
|
if (h.unit?.add) input = await h.unit.add(input, repoFlags)
|
|
252
|
-
const item = await addItem(h.dir, input)
|
|
313
|
+
const item = await addItem(h.dir, input).finally(() => trailer?.drop())
|
|
253
314
|
h.out(item.id)
|
|
315
|
+
if (item.trailer) h.out(`trailer card: ${item.trailer.trailer}/${item.trailer.after.cut}${item.trailer.before ? ` against ${item.trailer.before.cut}` : ''}${item.trailer.shots.length > 0 ? `, shots ${item.trailer.shots.join(', ')}` : ''}`)
|
|
254
316
|
if (item.origin.by === 'agent' && !item.origin.lane) h.err('no lane on the card: pass --lane <id> (or SK_AGENT), so the hub colours it')
|
|
317
|
+
if (item.choice && item.agentPick === undefined) h.err(`a choice with no pick of yours: every question carries one, sk review pick ${item.id} <view> (or --pick on add)`)
|
|
255
318
|
const { unheardLine } = await import('../review/model.ts')
|
|
256
319
|
const { liveWatchers } = await import('../review/watchers.ts')
|
|
257
320
|
const unheard = unheardLine(item, liveWatchers(h.dir))
|
|
@@ -553,6 +616,29 @@ export class ReviewReopenCommand extends Command {
|
|
|
553
616
|
}
|
|
554
617
|
}
|
|
555
618
|
|
|
619
|
+
export class ReviewPickCommand extends Command {
|
|
620
|
+
static override paths = [['review', 'pick']]
|
|
621
|
+
static override usage = Command.Usage({
|
|
622
|
+
category: 'Review',
|
|
623
|
+
description: "the option you suggest on a choice card he has not answered: the hub's « my pick » pill on it",
|
|
624
|
+
details: `${DETAILS}\n\nsk review pick <id> <view>: the view by its letter (B) or its label; one pick a card, a new one replaces it. On add: --choice … --pick <view>.`,
|
|
625
|
+
examples: [['suggest the second option', 'sk review pick <id> B'], ['by its label', 'sk review pick <id> "Zen Garden"']],
|
|
626
|
+
})
|
|
627
|
+
id = Option.String({ required: true })
|
|
628
|
+
view = Option.String({ required: true })
|
|
629
|
+
|
|
630
|
+
async execute(): Promise<number> {
|
|
631
|
+
return run(this.context, async (h) => {
|
|
632
|
+
const { setAgentPick } = await import('../review/store.ts')
|
|
633
|
+
const { viewLetter, viewName } = await import('../review/model.ts')
|
|
634
|
+
const item = setAgentPick(h.dir, this.id, this.view)
|
|
635
|
+
const n = item.agentPick ?? 0
|
|
636
|
+
h.out(`${this.id}: my pick ${viewLetter(n)} "${viewName(item.views[n], n)}"`)
|
|
637
|
+
return 0
|
|
638
|
+
})
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
556
642
|
type ActOp = 'fixed' | 'wontfix' | 'claim' | 'release' | 'blocked' | 'done' | 'dispatch' | 'ask' | 'drop' | 'reassign'
|
|
557
643
|
|
|
558
644
|
/** one state change: by a worker on its claim, or by the dispatcher on what it routes; the item, then the new state */
|
|
@@ -847,6 +933,73 @@ export class ReviewAnimCommand extends Command {
|
|
|
847
933
|
}
|
|
848
934
|
}
|
|
849
935
|
|
|
936
|
+
export class ReviewStageCommand extends Command {
|
|
937
|
+
static override paths = [['review', 'stage']]
|
|
938
|
+
static override usage = Command.Usage({
|
|
939
|
+
category: 'Review',
|
|
940
|
+
description: "one media of a card staged as a post: a draft in .shipkit/social/drafts/, never posted",
|
|
941
|
+
details: `${DETAILS}\n\nThe media copied in with its metadata left out, the repo's guard run first, the draft committed by its paths. Without --view, the newest version's first media. --dry prints what the draft would be: each account, its place, its count, what it skips. It never publishes: Publish stays his, in Communications. Page: wiki tools/shipkit/review-raised-items.md, A post staged from a card`,
|
|
942
|
+
examples: [
|
|
943
|
+
['the first media, a safe post', 'sk review stage <id> --text "Hands now pinch and lift." --rating safe'],
|
|
944
|
+
["the second view's wipe, polished by an agent", 'sk review stage <id> --view B --side wipe --text "…" --rating mild --polish'],
|
|
945
|
+
['what it would be', 'sk review stage <id> --text "…" --rating safe --dry'],
|
|
946
|
+
],
|
|
947
|
+
})
|
|
948
|
+
id = Option.String({ required: true })
|
|
949
|
+
view = Option.String('--view', { description: 'the view by its letter (A, B…) of the newest version, or <n>.<letter> of an older one' })
|
|
950
|
+
side = Option.String('--side', { description: 'a pair: after (default), before or wipe' })
|
|
951
|
+
tile = Option.String('--tile', { description: 'a gallery: the tile by its label' })
|
|
952
|
+
text = Option.String('--text', { required: true, description: 'the post' })
|
|
953
|
+
rating = Option.String('--rating', { required: true, description: 'safe, mild or explicit' })
|
|
954
|
+
kind = Option.String('--kind', { description: 'what the post is for, a kind of the set or the unit (default feature)' })
|
|
955
|
+
kindWhy = Option.String('--kind-why', { description: 'with --kind custom: one line on why no kind fits' })
|
|
956
|
+
alt = Option.String('--alt', { description: 'what the media shows' })
|
|
957
|
+
slot = Option.String('--slot', { description: '<YYYY-MM-DD> <tag>, a slot of the rhythm' })
|
|
958
|
+
tags = Option.String('--tags', { description: '#a #b' })
|
|
959
|
+
polish = Option.Boolean('--polish', false, { description: "an agent rewrites it in the identity's voice" })
|
|
960
|
+
from = Option.String('--from', { description: "a clip's passage: its in, in seconds" })
|
|
961
|
+
to = Option.String('--to', { description: "a clip's passage: its out, in seconds" })
|
|
962
|
+
fit = Option.Boolean('--fit', false, { description: 'one copy within the tightest limits of the venues it reaches' })
|
|
963
|
+
dry = Option.Boolean('--dry', false, { description: 'write nothing: print the draft as it would load' })
|
|
964
|
+
|
|
965
|
+
async execute(): Promise<number> {
|
|
966
|
+
return run(this.context, async (h) => {
|
|
967
|
+
const { dirname, join } = await import('node:path')
|
|
968
|
+
const { isPostRating, POST_RATINGS } = await import('../identities/rating.ts')
|
|
969
|
+
const { stageInputOf, stageOfCard } = await import('../review/stage-card.ts')
|
|
970
|
+
const { askPolish, fitStage, stageDraft, stageDry } = await import('../social/stage.ts')
|
|
971
|
+
const { loadSocialUnit } = await import('../social/unit.ts')
|
|
972
|
+
if (!isPostRating(this.rating)) throw new Error(`--rating ${this.rating}: one of ${POST_RATINGS.join(', ')}`)
|
|
973
|
+
const root = dirname(dirname(h.dir))
|
|
974
|
+
const id = await idOf(h.dir, this.id)
|
|
975
|
+
const s = stageOfCard(h.dir, id)
|
|
976
|
+
let pick: string | undefined
|
|
977
|
+
if (this.view) {
|
|
978
|
+
const m = /^(?:(\d+)\.)?([A-Z]+)$/i.exec(this.view)
|
|
979
|
+
if (m == null) throw new Error(`--view ${this.view}: a letter, or <n>.<letter>`)
|
|
980
|
+
const tag = `${m[1] ?? Math.max(...s.media.map((x) => Number(x.label.split('.')[0])))}.${m[2]!.toUpperCase()}`
|
|
981
|
+
const of = s.media.filter((x) => x.label.startsWith(`${tag} `))
|
|
982
|
+
const tile = this.tile
|
|
983
|
+
const hit = tile ? of.find((x) => x.tile !== undefined && (x.label.endsWith(`/${tile}`) || x.label.endsWith(` ${tile}`))) : of.find((x) => (x.side ?? 'after') === (this.side ?? 'after'))
|
|
984
|
+
if (hit == null) throw new Error(`no media ${tag}${this.side ? ` ${this.side}` : ''}${this.tile ? ` tile ${this.tile}` : ''}: ${s.media.map((x) => x.label).join(', ')}`)
|
|
985
|
+
pick = hit.key
|
|
986
|
+
}
|
|
987
|
+
const font = h.unit?.anim?.font ? join(root, h.unit.anim.font) : undefined
|
|
988
|
+
if ((this.from === undefined) !== (this.to === undefined)) throw new Error('a passage takes --from and --to')
|
|
989
|
+
const passage = this.from !== undefined && this.to !== undefined ? { from: Number(this.from), to: Number(this.to) } : null
|
|
990
|
+
const { input } = await stageInputOf(h.dir, id, { ...(pick ? { pick } : {}), text: this.text, rating: this.rating, ...(this.kind ? { kind: this.kind } : {}), ...(this.kindWhy ? { kindWhy: this.kindWhy } : {}), ...(this.alt ? { alt: this.alt } : {}), ...(this.slot ? { slot: this.slot } : {}), ...(this.tags ? { tags: this.tags } : {}), ...(passage ? { passage } : {}) }, font)
|
|
991
|
+
const unit = await loadSocialUnit(root)
|
|
992
|
+
const r = this.dry ? await stageDry(root, input, { unit }) : await stageDraft(root, this.fit ? await fitStage(root, input, { unit }) : input, { unit })
|
|
993
|
+
h.out(`${this.dry ? 'would stage' : 'staged'} ${r.slug}${input.media ? `: ${input.media.name}` : ''}, ${input.rating}`)
|
|
994
|
+
for (const p of r.draft?.posts ?? []) h.out(` ${p.key}${p.place ? ` #${p.place}` : ''} ${p.length}${p.refused ? ` refused: ${p.refused}` : ''}`)
|
|
995
|
+
for (const k of r.draft?.skipped ?? []) h.out(` ${k.account} skipped: ${k.why}`)
|
|
996
|
+
for (const e of r.errors) h.err(`WARN ${e}`)
|
|
997
|
+
if (this.polish && !this.dry) h.out(`polish asked: ${(await askPolish(root, r.slug, input.title, unit)).id}`)
|
|
998
|
+
return 0
|
|
999
|
+
})
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
850
1003
|
export class ReviewAutoCommand extends Command {
|
|
851
1004
|
static override paths = [['review', 'auto']]
|
|
852
1005
|
static override usage = Command.Usage({
|
|
@@ -1000,6 +1153,7 @@ export const REVIEW_COMMANDS = [
|
|
|
1000
1153
|
ReviewReplyCommand,
|
|
1001
1154
|
ReviewWithdrawCommand,
|
|
1002
1155
|
ReviewReopenCommand,
|
|
1156
|
+
ReviewPickCommand,
|
|
1003
1157
|
ReviewFixedCommand,
|
|
1004
1158
|
ReviewWontfixCommand,
|
|
1005
1159
|
ReviewClaimCommand,
|
|
@@ -1018,6 +1172,7 @@ export const REVIEW_COMMANDS = [
|
|
|
1018
1172
|
ReviewDeleteCommand,
|
|
1019
1173
|
ReviewMarksCommand,
|
|
1020
1174
|
ReviewAnimCommand,
|
|
1175
|
+
ReviewStageCommand,
|
|
1021
1176
|
ReviewAutoCommand,
|
|
1022
1177
|
ReviewWatchCommand,
|
|
1023
1178
|
]
|
package/src/cli/cmd_Shot.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// sk shot: a
|
|
1
|
+
// sk shot: a still of any url (webp by default), or a clip with --video, through the machine's
|
|
2
2
|
// one warm browser (shot/client.ts). A repo's own CLI wraps it with its setup
|
|
3
3
|
// flags; the trailer's `url` film calls the same functions.
|
|
4
4
|
import { relative } from 'path'
|
|
@@ -22,11 +22,11 @@ export class ShotCommand extends Command {
|
|
|
22
22
|
|
|
23
23
|
static override usage = Command.Usage({
|
|
24
24
|
category: 'Serve',
|
|
25
|
-
description: 'a
|
|
25
|
+
description: 'a webp of any url through the warm browser (a png with --out x.png), or an mp4 clip with --video',
|
|
26
26
|
details:
|
|
27
27
|
'one warm headless chromium for the whole machine (the `shot` global process, started when down). A still reuses the warm page when it already shows the url, so a warm shot answers in about 0.1 s. A page with `<meta name="shot-ready" content="wait">` is shot once it sets content="ready"; any other page --wait ms after its load. --video films a page that is a canvas through its WebCodecs encoder (H.264 muxed with no second encode), and any other page as chromium paints it (its screencast, encoded by ffmpeg as the frames arrive); --dom films the page even when a canvas fills it. --step <hook> films frame by frame: before each frame the page draws its time t (seconds) in `await window[hook](t)`, then its ready mark, so a slow page films smooth at its fps; a canvas page is encoded by its own WebCodecs at the exact time n / fps, any other page a screenshot a frame. A still with --step is the page drawn at --at s',
|
|
28
28
|
examples: [
|
|
29
|
-
['a
|
|
29
|
+
['a still of a running dev server', 'sk shot localhost:5173/'],
|
|
30
30
|
['a phone screen, at the pixel ratio of a phone', 'sk shot :5173/play --viewport 390,844 --dpr 3 --out shots/phone.png'],
|
|
31
31
|
['a 3 s clip', 'sk shot :4808/ --video 3 --out clips/walk.mp4'],
|
|
32
32
|
['a clip of a whole web app page, canvas or not', 'sk shot :5173/settings --video 3 --dom'],
|
|
@@ -37,7 +37,7 @@ export class ShotCommand extends Command {
|
|
|
37
37
|
url = Option.String({ required: true, name: 'url' })
|
|
38
38
|
viewport = Option.String('--viewport', { description: 'w,h in css pixels (default 1280,720)' })
|
|
39
39
|
dpr = Option.String('--dpr', { description: 'device pixel ratio (default 1)' })
|
|
40
|
-
out = Option.String('--out', { description: 'the file (default .shipkit/tmp/shots/<url>.
|
|
40
|
+
out = Option.String('--out', { description: 'the file (default .shipkit/tmp/shots/<url>.webp, or .mp4 with --video); its extension picks the still: .webp and .jpg at quality 90, .png lossless' })
|
|
41
41
|
reload = Option.Boolean('--reload', false, { description: 'load the page again even when the warm page shows this url' })
|
|
42
42
|
wait = Option.String('--wait', { description: 'ms after load for a page with no ready mark (default 300)' })
|
|
43
43
|
video = Option.String('--video', { description: 'seconds of clip: an mp4 of the page (its canvas when a canvas fills it)' })
|
package/src/cli/cmd_Social.ts
CHANGED
|
@@ -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,90 @@ 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
|
+
"--publish posts the waiting messages of its accounts whose automation is live (Discord, Bluesky), each link recorded in its ## Posted; --only <account> keeps that account's alone. 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, A post staged",
|
|
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
|
+
["a release's #announcements line, at release", 'sk social post 20261108-120000-app-1-2-0 --only discord --publish'],
|
|
104
114
|
],
|
|
105
115
|
})
|
|
106
116
|
draft = Option.String({ required: true })
|
|
117
|
+
only = Option.String('--only', { description: 'one account: its messages alone' })
|
|
118
|
+
publish = Option.Boolean('--publish', false, { description: 'post the waiting messages of its live accounts now' })
|
|
107
119
|
override async execute(): Promise<number> {
|
|
108
120
|
return guarded(this.context, async () => {
|
|
109
121
|
const { desk } = await model(undefined)
|
|
110
122
|
const d = desk.drafts.find((x) => x.slug === this.draft || x.slug.replace(/^\d{8}-\d{6}-/, '') === this.draft)
|
|
111
123
|
if (d == null) throw new Error(`no draft "${this.draft}" in .shipkit/social/drafts/: give its folder's name or its topic`)
|
|
124
|
+
const only = this.only
|
|
125
|
+
if (only != null && !d.posts.some((p) => p.platform === only)) throw new Error(`${d.slug} has no message to ${only} (${[...new Set(d.posts.map((p) => p.platform))].join(', ') || 'none'})`)
|
|
126
|
+
if (this.publish) {
|
|
127
|
+
const { publishDraft } = await import('../social/publish/index.ts')
|
|
128
|
+
const { socialMediaBack } = await import('../social/media-kind.ts')
|
|
129
|
+
const before = async (p: { media: { path: string } | null }): Promise<void> => void (p.media ? await socialMediaBack(desk.root, p.media.path) : undefined)
|
|
130
|
+
for (const r of await publishDraft(desk, d.slug, { ...(only != null ? { only } : {}), before })) say(this.context)(`${r.key}: ${r.line}`)
|
|
131
|
+
return 0
|
|
132
|
+
}
|
|
112
133
|
const { socialModel, postText } = await import('../social/text.ts')
|
|
113
|
-
|
|
134
|
+
const lines = postText(socialModel(desk, d.identity), d.slug)
|
|
135
|
+
for (const l of only == null ? lines : lines.filter((l) => !/^[a-z0-9-]+(?:\/[a-z0-9-]+)?\s{2}/.test(l) || l.startsWith(`${only} `) || l.startsWith(`${only}/`))) say(this.context)(l)
|
|
136
|
+
return 0
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
class SocialReleaseCommand extends Command {
|
|
142
|
+
static override paths = [['social', 'release']]
|
|
143
|
+
static override usage = Command.Usage({
|
|
144
|
+
category: 'Social',
|
|
145
|
+
description: "a release staged as one post draft: a heading per venue the social unit declares, never posted",
|
|
146
|
+
details:
|
|
147
|
+
"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",
|
|
148
|
+
examples: [
|
|
149
|
+
["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'],
|
|
150
|
+
],
|
|
151
|
+
})
|
|
152
|
+
version = Option.String({ required: true })
|
|
153
|
+
unit = Option.String('--unit', { description: "the unit released (default: the repo's folder name)" })
|
|
154
|
+
notes = Option.String('--notes', { required: true, description: "the release's notes: a file, or - for stdin" })
|
|
155
|
+
message = Option.String('--message', { description: 'the short message for users: a file, or - for stdin' })
|
|
156
|
+
tag = Option.String('--tag', { description: "the release's tag" })
|
|
157
|
+
since = Option.String('--since', { description: 'the tag before it' })
|
|
158
|
+
title = Option.String('--title', { description: "the draft's title (default <unit> <version>)" })
|
|
159
|
+
override async execute(): Promise<number> {
|
|
160
|
+
return guarded(this.context, async () => {
|
|
161
|
+
const { readFileSync } = await import('node:fs')
|
|
162
|
+
const { basename } = await import('node:path')
|
|
163
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
164
|
+
const { loadRepoConfig } = await import('../repo-config.ts')
|
|
165
|
+
const { loadSocialUnit } = await import('../social/unit.ts')
|
|
166
|
+
const { stageRelease } = await import('../social/release-stage.ts')
|
|
167
|
+
if (this.notes === '-' && this.message === '-') throw new Error('one of --notes and --message reads stdin, never both')
|
|
168
|
+
const text = async (v: string): Promise<string> => (v === '-' ? await new Response(Bun.stdin.stream()).text() : readFileSync(v, 'utf8'))
|
|
169
|
+
const root = findRepoRoot(process.cwd())
|
|
170
|
+
const unit = await loadSocialUnit(root)
|
|
171
|
+
const speaksAs = (await loadRepoConfig(root).catch(() => null))?.speaksAs
|
|
172
|
+
const r = await stageRelease(
|
|
173
|
+
root,
|
|
174
|
+
unit,
|
|
175
|
+
{
|
|
176
|
+
unit: this.unit ?? basename(root),
|
|
177
|
+
version: this.version,
|
|
178
|
+
notes: await text(this.notes),
|
|
179
|
+
...(this.message ? { message: await text(this.message) } : {}),
|
|
180
|
+
...(this.tag ? { tag: this.tag } : {}),
|
|
181
|
+
...(this.since ? { since: this.since } : {}),
|
|
182
|
+
...(this.title ? { title: this.title } : {}),
|
|
183
|
+
},
|
|
184
|
+
speaksAs ? { speaksAs } : {},
|
|
185
|
+
)
|
|
186
|
+
if (r == null) say(this.context)("ok: the repo's social unit declares no release headings: nothing staged")
|
|
187
|
+
else if (!r.created) say(this.context)(`ok: already staged: ${r.slug}`)
|
|
188
|
+
else {
|
|
189
|
+
say(this.context)(`staged ${r.slug}: waiting in Communications, its polish note raised`)
|
|
190
|
+
for (const e of r.errors) say(this.context)(`WARN ${e}`)
|
|
191
|
+
}
|
|
114
192
|
return 0
|
|
115
193
|
})
|
|
116
194
|
}
|
|
@@ -193,7 +271,7 @@ class SocialDiscordApplyCommand extends Command {
|
|
|
193
271
|
category: 'Social',
|
|
194
272
|
description: "an identity's Discord server made to match its layout.md through its bot: roles, channels",
|
|
195
273
|
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",
|
|
274
|
+
"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
275
|
examples: [
|
|
198
276
|
['what would change', 'sk social discord apply studio --dry'],
|
|
199
277
|
['as this repo speaks', 'sk social discord apply'],
|
|
@@ -215,11 +293,14 @@ class SocialDiscordApplyCommand extends Command {
|
|
|
215
293
|
id = speakerOf((await loadRepoConfig(findRepoRoot(process.cwd()))).speaksAs, ids)?.id
|
|
216
294
|
if (id == null) throw new Error('no identity named and none this repo speaks as')
|
|
217
295
|
}
|
|
218
|
-
const
|
|
296
|
+
const i = identityOf(id, ids)
|
|
297
|
+
const a = i.accounts.find((x) => x.id === 'discord')
|
|
219
298
|
if (a == null) throw new Error(`${id} has no discord account (accounts/discord/account.md)`)
|
|
299
|
+
await (await import('../social/identity-words.ts')).refuseUnguarded(i)
|
|
220
300
|
const r = await applyLayout(a, { dry: this.dry, prune: this.prune })
|
|
301
|
+
await recorded(r.recorded, `identities: ${id} discord server pictures set by the bot`)
|
|
221
302
|
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`)
|
|
303
|
+
if (r.changes.length === 0) say(this.context)(`ok: the server of ${id} matches its layout and its pictures`)
|
|
223
304
|
for (const l of r.left) say(this.context)(`left alone: ${l}`)
|
|
224
305
|
return 0
|
|
225
306
|
})
|
|
@@ -254,7 +335,7 @@ class IdentitiesCommand extends Command {
|
|
|
254
335
|
into.set(id, [...(into.get(id) ?? []), r.name])
|
|
255
336
|
}
|
|
256
337
|
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 }))
|
|
338
|
+
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
339
|
return ids.errors.length || unnamed.length ? 1 : 0
|
|
259
340
|
}
|
|
260
341
|
for (const i of ids.identities) {
|
|
@@ -263,6 +344,16 @@ class IdentitiesCommand extends Command {
|
|
|
263
344
|
say(this.context)(` online: ${online.map((a) => `${a.id} ${a.handle}`).join(', ') || 'none'}`)
|
|
264
345
|
const archived = old.get(i.id) ?? []
|
|
265
346
|
say(this.context)(` repos: ${(by.get(i.id) ?? []).join(', ') || 'none'}${archived.length > 0 ? `; archived: ${archived.join(', ')}` : ''}`)
|
|
347
|
+
for (const a of i.accounts) {
|
|
348
|
+
const stale = a.uploads.filter((u) => u.stale && u.kind === 'picture')
|
|
349
|
+
const texts = a.uploads.filter((u) => u.stale && u.kind === 'text').map((u) => u.field)
|
|
350
|
+
if (texts.length > 0) say(this.context)(` to paste again on ${a.name}: ${texts.join(', ')}`)
|
|
351
|
+
if (stale.length === 0) continue
|
|
352
|
+
const hands = stale.filter((u) => u.by == null).map((u) => u.field)
|
|
353
|
+
const api = stale.filter((u) => u.by != null).map((u) => u.field)
|
|
354
|
+
const parts = [...(hands.length > 0 ? [hands.join(', ')] : []), ...(api.length > 0 ? [`the api sets ${api.join(', ')}: sk identities push ${i.id}`] : [])]
|
|
355
|
+
say(this.context)(` to upload on ${a.name}${a.live === '' ? ' (still to create)' : ''}: ${parts.join('; ')}`)
|
|
356
|
+
}
|
|
266
357
|
}
|
|
267
358
|
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
359
|
if (unnamed.length > 0) say(this.context)(`FAIL: ${unnamed.length} repo(s) name no speaksAs (SK038): ${unnamed.join(', ')}`)
|
|
@@ -272,4 +363,50 @@ class IdentitiesCommand extends Command {
|
|
|
272
363
|
}
|
|
273
364
|
}
|
|
274
365
|
|
|
275
|
-
|
|
366
|
+
class IdentitiesPushCommand extends Command {
|
|
367
|
+
static override paths = [['identities', 'push']]
|
|
368
|
+
static override usage = Command.Usage({
|
|
369
|
+
category: 'Social',
|
|
370
|
+
description: "an identity's stale pictures set where an api reaches: Discord's bot, Bluesky",
|
|
371
|
+
details:
|
|
372
|
+
"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",
|
|
373
|
+
examples: [
|
|
374
|
+
['what would be set', 'sk identities push studio --dry'],
|
|
375
|
+
['as this repo speaks', 'sk identities push'],
|
|
376
|
+
],
|
|
377
|
+
})
|
|
378
|
+
identity = Option.String({ required: false })
|
|
379
|
+
dry = Option.Boolean('--dry', false, { description: 'print what would be set, write nothing' })
|
|
380
|
+
override async execute(): Promise<number> {
|
|
381
|
+
return guarded(this.context, async () => {
|
|
382
|
+
const { loadIdentities, identityOf, speakerOf } = await import('../identities/identities.ts')
|
|
383
|
+
const { pushServerPictures } = await import('../social/discord-layout.ts')
|
|
384
|
+
const { pushProfilePictures } = await import('../social/publish/bluesky.ts')
|
|
385
|
+
const ids = await loadIdentities()
|
|
386
|
+
let id = this.identity
|
|
387
|
+
if (id == null) {
|
|
388
|
+
const { findRepoRoot } = await import('../ts/config.ts')
|
|
389
|
+
const { loadRepoConfig } = await import('../repo-config.ts')
|
|
390
|
+
id = speakerOf((await loadRepoConfig(findRepoRoot(process.cwd()))).speaksAs, ids)?.id
|
|
391
|
+
if (id == null) throw new Error('no identity named and none this repo speaks as')
|
|
392
|
+
}
|
|
393
|
+
const i = identityOf(id, ids)
|
|
394
|
+
await (await import('../social/identity-words.ts')).refuseUnguarded(i)
|
|
395
|
+
let set = 0
|
|
396
|
+
for (const a of i.accounts) {
|
|
397
|
+
const r = a.id === 'discord' ? await pushServerPictures(a, { dry: this.dry }) : a.id === 'bluesky' ? await pushProfilePictures(a, { dry: this.dry }) : null
|
|
398
|
+
if (r == null) continue
|
|
399
|
+
await recorded(r.recorded, `identities: ${id} ${a.id} pictures set through its api`)
|
|
400
|
+
set += r.changes.length
|
|
401
|
+
for (const l of r.changes) say(this.context)(`${a.name}: ${l}`)
|
|
402
|
+
for (const l of r.left) say(this.context)(`${a.name}: left alone: ${l}`)
|
|
403
|
+
}
|
|
404
|
+
if (set === 0) say(this.context)(`ok: no stale picture of ${id} an api reaches`)
|
|
405
|
+
const hands = i.accounts.filter((a) => a.uploads.some((u) => u.stale && u.by == null))
|
|
406
|
+
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('; ')}`)
|
|
407
|
+
return 0
|
|
408
|
+
})
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export const SOCIAL_COMMANDS = [SocialCommand, SocialTimelineCommand, SocialCoverageCommand, SocialPostCommand, SocialReleaseCommand, SocialPlanCommand, SocialStateCommand, SocialMigrateCommand, SocialDiscordApplyCommand, IdentitiesCommand, IdentitiesPushCommand]
|
package/src/cli/family-pages.ts
CHANGED
|
@@ -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',
|
package/src/cli/kit/index.ts
CHANGED
|
@@ -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'
|
package/src/cli/kit/verb.ts
CHANGED
|
@@ -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
|
|
164
|
-
|
|
165
|
-
|
|
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
|
package/src/cli/registry.ts
CHANGED
|
@@ -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 } 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,7 @@ export function buildCli(): Cli {
|
|
|
81
83
|
cli.register(BumpCommand)
|
|
82
84
|
cli.register(ReleaseCommand)
|
|
83
85
|
cli.register(ReleasesCommand)
|
|
86
|
+
cli.register(ReleasesAddCommand)
|
|
84
87
|
cli.register(HooksInstallCommand)
|
|
85
88
|
cli.register(HooksPreCommitCommand)
|
|
86
89
|
cli.register(HooksCommitMsgCommand)
|
|
@@ -93,8 +96,10 @@ export function buildCli(): Cli {
|
|
|
93
96
|
for (const c of REVIEW_COMMANDS) cli.register(c)
|
|
94
97
|
for (const c of SOCIAL_COMMANDS) cli.register(c)
|
|
95
98
|
for (const c of MEDIA_COMMANDS) cli.register(c)
|
|
99
|
+
for (const c of ANNEX_COMMANDS) cli.register(c)
|
|
96
100
|
for (const c of BACKUP_COMMANDS) cli.register(c)
|
|
97
101
|
for (const c of VEILLE_COMMANDS) cli.register(c)
|
|
102
|
+
for (const c of MESSAGES_COMMANDS) cli.register(c)
|
|
98
103
|
cli.register(ServeCommand)
|
|
99
104
|
cli.register(PmCommand)
|
|
100
105
|
cli.register(DaemonCommand)
|