decklight 0.6.0 → 0.7.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/README.md +16 -8
- package/SPEC.md +166 -10
- package/cli/agents.mjs +52 -2
- package/cli/banner.mjs +125 -0
- package/cli/bundle.mjs +14 -4
- package/cli/{rec.mjs → cast.mjs} +25 -8
- package/cli/comments.mjs +389 -0
- package/cli/commit-flow.mjs +157 -0
- package/cli/commit-message.mjs +125 -0
- package/cli/decklight.mjs +88 -25
- package/cli/dev.mjs +159 -13
- package/cli/edit.mjs +927 -39
- package/cli/git-tree.mjs +87 -0
- package/cli/git.mjs +22 -0
- package/cli/init.mjs +37 -5
- package/cli/port-conflict.mjs +187 -16
- package/cli/publish.mjs +15 -40
- package/cli/record.mjs +154 -0
- package/cli/review-remote.mjs +330 -0
- package/cli/review-store.mjs +107 -0
- package/cli/review-submit.mjs +292 -0
- package/cli/review.mjs +361 -0
- package/cli/serve.mjs +36 -1
- package/cli/skill-content.mjs +3 -1
- package/cli/units.mjs +2 -2
- package/cli/util.mjs +59 -0
- package/dist/build-info.json +1 -0
- package/dist/decklight.css +244 -1
- package/dist/decklight.js +102 -79
- package/dist/decklight.js.map +4 -4
- package/docs/architecture.svg +7 -0
- package/package.json +2 -1
- package/tools/args.mjs +20 -0
- package/tools/deck-html.mjs +50 -0
- package/tools/elevenlabs-tts.mjs +1 -1
- package/tools/lipsync-server.mjs +64 -2
- package/tools/lipsync.mjs +40 -24
- package/tools/local-voice.mjs +170 -16
- package/tools/publish-voices.mjs +78 -18
- package/tools/recording-impact.mjs +110 -0
- package/tools/review-anchor.mjs +180 -0
- package/tools/test-impact.mjs +259 -0
- package/tools/tts-engines.mjs +26 -4
- package/tools/tts-setup.mjs +1 -1
- package/tools/video.mjs +15 -3
- package/tools/voiceover-server.mjs +167 -7
- package/tools/voiceover.mjs +30 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Copyright 2026 Gilles Philippart
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Committing on YOUR word, with a snapshot underneath so the word can wait.
|
|
6
|
+
*
|
|
7
|
+
* The cadence used to commit the deck every `--commit-every` seconds. It cost
|
|
8
|
+
* nothing to write and it produced the thing everyone actually saw: a column of
|
|
9
|
+
* `decklight: autosave talk.html`, one every five minutes, in which no commit
|
|
10
|
+
* marks anything and `git log` answers no question. The commits were a backup
|
|
11
|
+
* wearing a history's clothes.
|
|
12
|
+
*
|
|
13
|
+
* So the two jobs are separated, because they were never the same job:
|
|
14
|
+
*
|
|
15
|
+
* the BACKUP is a snapshot, and it is silent. Every tick, the deck's current
|
|
16
|
+
* bytes are written to `refs/decklight/wip` — a real commit object, parented
|
|
17
|
+
* on HEAD, reachable by name and by nothing else. It is not on your branch,
|
|
18
|
+
* it does not move your branch, `git log` never shows it, and a push never
|
|
19
|
+
* carries it. A crash costs you `git show decklight/wip:<deck>`, not an
|
|
20
|
+
* afternoon.
|
|
21
|
+
*
|
|
22
|
+
* the HISTORY is a commit, and it is yours. decklight asks — once per stretch
|
|
23
|
+
* of uncommitted work — and the commit happens when you answer, with a
|
|
24
|
+
* message about what changed.
|
|
25
|
+
*
|
|
26
|
+
* ONE NAG PER EPISODE is the load-bearing rule, and it is the one the push
|
|
27
|
+
* toast (src/core/devmode.js) learned first: "a limit expressed as a count
|
|
28
|
+
* cannot become a limit expressed as every few minutes by accident, which is
|
|
29
|
+
* what happens to interval-based nudges and why people turn them off". The
|
|
30
|
+
* trigger here is time OR size, whichever comes first, but it fires once and
|
|
31
|
+
* then stays quiet until a commit resets the episode. An unanswered nag is an
|
|
32
|
+
* answer.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import { execFileSync } from 'node:child_process';
|
|
36
|
+
import { putBlob } from './git-tree.mjs';
|
|
37
|
+
|
|
38
|
+
/** The ref the snapshot lives on — outside every branch, on purpose. */
|
|
39
|
+
export const WIP_REF = 'refs/decklight/wip';
|
|
40
|
+
|
|
41
|
+
/** How long uncommitted work may sit before the nag, and how much may change. */
|
|
42
|
+
export const NAG_AFTER_MS = 10 * 60 * 1000;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* How long any single git call in the watch may take before it is killed.
|
|
46
|
+
*
|
|
47
|
+
* The watch runs on the event loop. An unbounded `execFileSync` there is not a
|
|
48
|
+
* slow snapshot, it is a dead server — so every call this file makes carries a
|
|
49
|
+
* cap, and a git that blows through it costs one tick.
|
|
50
|
+
*/
|
|
51
|
+
export const GIT_TIMEOUT_MS = 10_000;
|
|
52
|
+
/** `git`, but it can never hold the server for longer than the cap. */
|
|
53
|
+
const boundedGit = (args, cwd) =>
|
|
54
|
+
execFileSync('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: GIT_TIMEOUT_MS }).trim();
|
|
55
|
+
export const NAG_AFTER_LINES = 40;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* How much of the deck differs from HEAD, and whether anything does.
|
|
59
|
+
*
|
|
60
|
+
* `--numstat` over the deck alone, because the deck is the only thing decklight
|
|
61
|
+
* commits and the only thing it is entitled to describe. A repository holding
|
|
62
|
+
* somebody's whole project reports its own state through git; this reports the
|
|
63
|
+
* deck's.
|
|
64
|
+
*
|
|
65
|
+
* A deck with no HEAD to compare against (the very first commit has not
|
|
66
|
+
* happened) counts as dirty with unknown size: there is something to commit,
|
|
67
|
+
* and no numstat can say how much.
|
|
68
|
+
*/
|
|
69
|
+
export function deckDirty(cwd, deckRel, { run = boundedGit } = {}) {
|
|
70
|
+
let out;
|
|
71
|
+
try { out = run(['diff', '--numstat', 'HEAD', '--', deckRel], cwd); }
|
|
72
|
+
catch { return { dirty: true, lines: 0, firstCommit: true }; }
|
|
73
|
+
const line = (out ?? '').split('\n').find(Boolean);
|
|
74
|
+
if (!line) {
|
|
75
|
+
// Nothing against HEAD — but an untracked deck has no diff either, and it
|
|
76
|
+
// is the most uncommitted a file can be.
|
|
77
|
+
let tracked = true;
|
|
78
|
+
try { run(['ls-files', '--error-unmatch', '--', deckRel], cwd); }
|
|
79
|
+
catch { tracked = false; }
|
|
80
|
+
return tracked ? { dirty: false, lines: 0 } : { dirty: true, lines: 0, untracked: true };
|
|
81
|
+
}
|
|
82
|
+
const [add, del] = line.split('\t');
|
|
83
|
+
return { dirty: true, lines: (Number(add) || 0) + (Number(del) || 0) };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Write the deck's current bytes to the snapshot ref. Returns the sha, or null.
|
|
88
|
+
*
|
|
89
|
+
* Deck-only, and that is the whole reason this is plumbing rather than
|
|
90
|
+
* `git stash create`: stash snapshots every tracked change in the working
|
|
91
|
+
* tree, and decklight commits one file. Someone editing a deck inside a larger
|
|
92
|
+
* repository must not have their unrelated work swept into decklight's ref.
|
|
93
|
+
*
|
|
94
|
+
* Nothing here touches the index, the working tree, or any branch: a blob, a
|
|
95
|
+
* tree built from HEAD's with one path replaced, a commit parented on HEAD, and
|
|
96
|
+
* a ref update. It is invisible until somebody asks for it by name.
|
|
97
|
+
*
|
|
98
|
+
* NEVER FATAL. This is the safety net, so it fails the way a safety net should
|
|
99
|
+
* — quietly, leaving everything else working. A repository mid-rebase, a
|
|
100
|
+
* detached HEAD, a missing object: the editing session carries on.
|
|
101
|
+
*/
|
|
102
|
+
export function snapshotWip(cwd, deckPath, deckRel, { exec = execFileSync, timeout = GIT_TIMEOUT_MS } = {}) {
|
|
103
|
+
// git-tree's helpers take `(args, input)` — `mktree` FEEDS ITS ENTRIES ON
|
|
104
|
+
// STDIN, so an adapter that drops the second argument writes an empty tree
|
|
105
|
+
// and reports success. The snapshot then holds a commit with nothing in it,
|
|
106
|
+
// which is the one failure this whole file exists to prevent.
|
|
107
|
+
//
|
|
108
|
+
// EVERY call is bounded. This runs on a timer, on the server's event loop,
|
|
109
|
+
// and `execFileSync` blocks it for as long as the child takes — so a git that
|
|
110
|
+
// never returns does not cost a snapshot, it costs the whole author server:
|
|
111
|
+
// still listening, answering nothing, until somebody kills it. That is not a
|
|
112
|
+
// hypothetical. `git hash-object -w --stdin` was found wedged for eight hours
|
|
113
|
+
// with the server dead behind it, and because a `file://` deck probes the
|
|
114
|
+
// author port, it silently broke every headless render on the machine too.
|
|
115
|
+
const g = (args, input) => exec('git', args, { cwd, encoding: 'utf8', input, timeout }).trim();
|
|
116
|
+
try {
|
|
117
|
+
const head = g(['rev-parse', 'HEAD']);
|
|
118
|
+
// The PATH form, not `--stdin`. Handing git a 700 KB deck down a pipe is a
|
|
119
|
+
// deadlock waiting for a slow reader; letting it open the file itself has
|
|
120
|
+
// no pipe to deadlock on, and is what wedged above.
|
|
121
|
+
const blob = g(['hash-object', '-w', '--', deckPath]);
|
|
122
|
+
const tree = putBlob(g, `${head}^{tree}`, deckRel.split(/[/\\]/).filter(Boolean), blob);
|
|
123
|
+
const sha = g(['commit-tree', tree, '-p', head, '-m',
|
|
124
|
+
`decklight: wip snapshot of ${deckRel}`]);
|
|
125
|
+
g(['update-ref', WIP_REF, sha]);
|
|
126
|
+
return sha;
|
|
127
|
+
} catch { return null; }
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Should we nag right now?
|
|
132
|
+
*
|
|
133
|
+
* Pure, so the whole rule is testable without a clock or a repository — the
|
|
134
|
+
* planServices idiom. `nagged` is the episode latch: once true, nothing here
|
|
135
|
+
* says yes again until a commit clears it.
|
|
136
|
+
*/
|
|
137
|
+
export function planNag({
|
|
138
|
+
dirty = false, lines = 0, sinceMs = 0, nagged = false, dismissed = false,
|
|
139
|
+
afterMs = NAG_AFTER_MS, afterLines = NAG_AFTER_LINES,
|
|
140
|
+
} = {}) {
|
|
141
|
+
if (!dirty || nagged || dismissed) return false;
|
|
142
|
+
return sinceMs >= afterMs || lines >= afterLines;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** What the chip says — the count and the age, so the ask is proportionate. */
|
|
146
|
+
export function nagText({ lines = 0, sinceMs = 0 } = {}) {
|
|
147
|
+
const mins = Math.floor(sinceMs / 60000);
|
|
148
|
+
const age = mins >= 60 ? `${Math.floor(mins / 60)}h` : mins >= 1 ? `${mins}m` : 'just now';
|
|
149
|
+
const size = lines ? `${lines} line${lines === 1 ? '' : 's'}` : 'changes';
|
|
150
|
+
return `${size} uncommitted${mins >= 1 ? ` · ${age}` : ''}`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** The line author prints when the snapshot is what stands behind the nag. */
|
|
154
|
+
export function wipLine(deckRel) {
|
|
155
|
+
return ` git: committing ${deckRel} when you say so — a silent snapshot rides on`
|
|
156
|
+
+ ` ${WIP_REF.replace('refs/', '')} in between (git show decklight/wip:${deckRel})`;
|
|
157
|
+
}
|
package/cli/commit-message.mjs
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
import { execFile } from 'node:child_process';
|
|
32
|
+
import { readFileSync } from 'node:fs';
|
|
32
33
|
import { basename, relative } from 'node:path';
|
|
33
34
|
import { agentAsk } from './agents.mjs';
|
|
34
35
|
import { commitSubject, git } from './git.mjs';
|
|
@@ -342,9 +343,133 @@ export async function describeCommit({
|
|
|
342
343
|
return amendSubject(cwd, sha, subject, { run }) ? subject : null;
|
|
343
344
|
}
|
|
344
345
|
|
|
346
|
+
/**
|
|
347
|
+
* A subject for work that is NOT COMMITTED YET — what the commit overlay's
|
|
348
|
+
* "write one for me" button asks for.
|
|
349
|
+
*
|
|
350
|
+
* The same prompt, the same read-only argv, the same cap and the same stated
|
|
351
|
+
* truncation as `describeCommit`; three things differ, and each is because
|
|
352
|
+
* there is no commit yet:
|
|
353
|
+
*
|
|
354
|
+
* the diff is `git diff HEAD` rather than `git show <sha>`;
|
|
355
|
+
* the deck is read FROM DISK, because the working tree is the subject here
|
|
356
|
+
* (in describeCommit reading from disk would name a slide the commit does
|
|
357
|
+
* not contain — here it is the only honest source);
|
|
358
|
+
* nothing is amended. It returns the sentence and the caller decides — a
|
|
359
|
+
* person is looking at a text box, and putting words in it is the most
|
|
360
|
+
* this is allowed to do.
|
|
361
|
+
*
|
|
362
|
+
* Returns null for every failure, exactly like its sibling: no agent, nothing
|
|
363
|
+
* changed, a timeout, an answer that was not a subject. The overlay then shows
|
|
364
|
+
* an empty box, which is the state it was in anyway.
|
|
365
|
+
*/
|
|
366
|
+
export async function describeWorking({
|
|
367
|
+
cwd, deckPath, deckRel, template, agent = null,
|
|
368
|
+
env = process.env, timeoutMs = ASK_TIMEOUT_MS, run = git, exec = ask,
|
|
369
|
+
resolve = agentAsk, read = null,
|
|
370
|
+
} = {}) {
|
|
371
|
+
const deck = basename(deckPath);
|
|
372
|
+
const cmd = resolve(agent, 'x', { env });
|
|
373
|
+
if (!cmd) return null;
|
|
374
|
+
const rel = deckRel || relative(cwd, deckPath) || deck;
|
|
375
|
+
|
|
376
|
+
let out_;
|
|
377
|
+
try { out_ = run(['diff', '--unified=1', 'HEAD', '--', rel], cwd) ?? ''; }
|
|
378
|
+
catch { return null; }
|
|
379
|
+
if (!out_.trim()) return null;
|
|
380
|
+
const truncated = out_.length > MAX_DIFF;
|
|
381
|
+
const diff = truncated ? out_.slice(0, MAX_DIFF) : out_;
|
|
382
|
+
|
|
383
|
+
let html = '';
|
|
384
|
+
try { html = (read ?? readFileSync)(deckPath, 'utf8'); } catch { /* headings are optional */ }
|
|
385
|
+
const prompt = messagePrompt({
|
|
386
|
+
deck, template, diff, truncated,
|
|
387
|
+
title: deckTitle(html),
|
|
388
|
+
slides: changedSlides(html, diff),
|
|
389
|
+
});
|
|
390
|
+
const spawned = resolve(agent, prompt, { env });
|
|
391
|
+
if (!spawned) return null;
|
|
392
|
+
let answer;
|
|
393
|
+
try { answer = await exec(spawned, cwd, timeoutMs); }
|
|
394
|
+
catch { return null; }
|
|
395
|
+
if (answer == null) return null;
|
|
396
|
+
const found = subjectFrom(answer);
|
|
397
|
+
if (!found) return null;
|
|
398
|
+
const subject = commitSubject(found, template);
|
|
399
|
+
return subject === template ? null : subject;
|
|
400
|
+
}
|
|
401
|
+
|
|
345
402
|
/** The startup line: what is on, who does it, and what leaves the machine. */
|
|
346
403
|
export function messagesLine(agentName) {
|
|
347
404
|
return agentName
|
|
348
405
|
? `git: ${agentName} writes the commit subjects — the deck's diffs are sent to it`
|
|
349
406
|
: 'git: --commit-messages needs an agent on PATH — subjects stay generic';
|
|
350
407
|
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Where the answer lives: git's own config, in the repository it is about.
|
|
411
|
+
*
|
|
412
|
+
* The setting only means anything when there IS a repository — it describes
|
|
413
|
+
* what happens to that repository's commits — so git config is where it
|
|
414
|
+
* belongs rather than a file decklight invents. It is per-repo, it survives,
|
|
415
|
+
* and it is inspectable and reversible with the tool the user already knows:
|
|
416
|
+
* `git config decklight.commit-messages false`.
|
|
417
|
+
*/
|
|
418
|
+
export const PREF_KEY = 'decklight.commit-messages';
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* The stored answer: true, false, or null when nobody has been asked yet.
|
|
422
|
+
*
|
|
423
|
+
* `git config --get` EXITS 1 for a key that is not set, and `git()` throws on a
|
|
424
|
+
* non-zero exit — so the unset case, which is every first run, arrives here as
|
|
425
|
+
* an exception rather than an empty string. Unreadable and unset are the same
|
|
426
|
+
* answer: nobody has said, so ask (or stay off).
|
|
427
|
+
*/
|
|
428
|
+
export function storedPref(cwd, { run = git } = {}) {
|
|
429
|
+
let v = '';
|
|
430
|
+
try { v = (run(['config', '--get', PREF_KEY], cwd) ?? '').trim(); } catch { return null; }
|
|
431
|
+
return v === 'true' ? true : v === 'false' ? false : null;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Remember the answer, so the next session does not ask again.
|
|
436
|
+
*
|
|
437
|
+
* Never fatal: this is a convenience, and a repository that refuses the write
|
|
438
|
+
* (a read-only config, a worktree in a strange state) should cost the user a
|
|
439
|
+
* repeated question, not a failed startup.
|
|
440
|
+
*/
|
|
441
|
+
export function rememberPref(cwd, on, { run = git } = {}) {
|
|
442
|
+
try { run(['config', PREF_KEY, on ? 'true' : 'false'], cwd); return true; } catch { return false; }
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Whether to ask, and what the answer already is.
|
|
447
|
+
*
|
|
448
|
+
* Asked ONCE, at the moment a repository is created — the same moment the
|
|
449
|
+
* autocommit itself is offered, because that is when the commits this governs
|
|
450
|
+
* come into existence. An existing repository is never interrupted to be asked
|
|
451
|
+
* a new question; it uses the flag.
|
|
452
|
+
*
|
|
453
|
+
* The default is YES, and that is a defensible default only because it is a
|
|
454
|
+
* QUESTION. The permission is still explicitly given by a person who was told
|
|
455
|
+
* what leaves the machine — decklight still never infers it from what happens
|
|
456
|
+
* to be on PATH, which is the rule `lipsync --veo` follows. So: no agent
|
|
457
|
+
* installed, or no TTY to answer, means no question and no feature.
|
|
458
|
+
*/
|
|
459
|
+
export function planCommitMessages({
|
|
460
|
+
args = [], tty = false, agents = 0, creatingRepo = false, stored = null,
|
|
461
|
+
} = {}) {
|
|
462
|
+
if (args.includes('--no-commit-messages')) return { action: 'off' };
|
|
463
|
+
if (args.includes('--commit-messages')) return { action: 'on' };
|
|
464
|
+
if (stored !== null) return { action: stored ? 'on' : 'off' };
|
|
465
|
+
// Nothing to drive it, nothing to write the subjects with: the feature is
|
|
466
|
+
// unavailable, and offering it would be offering a switch wired to nothing.
|
|
467
|
+
if (!agents) return { action: 'skip' };
|
|
468
|
+
if (!creatingRepo) return { action: 'skip' };
|
|
469
|
+
return { action: tty ? 'ask' : 'skip' };
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** The question, worded so the cost is on screen before the answer is given. */
|
|
473
|
+
export const ASK_MESSAGES =
|
|
474
|
+
' let an agent write your commit subjects instead of "autosave"?'
|
|
475
|
+
+ ' (sends the deck\'s diffs to it) [Y/n] ';
|
package/cli/decklight.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* decklight — the Decklight command line.
|
|
7
7
|
*
|
|
8
|
-
* decklight
|
|
8
|
+
* decklight cast record a terminal cast from a YAML script
|
|
9
9
|
* decklight refresh re-run embedded scripts, rewrite drifted casts
|
|
10
10
|
* decklight export convert a cast to asciicast v2
|
|
11
11
|
* decklight pdf render a deck to a PDF — one slide per page, no print dialog
|
|
@@ -19,20 +19,21 @@
|
|
|
19
19
|
* decklight template install deck templates for `init --from`
|
|
20
20
|
* decklight importer install import adapters for formats decklight cannot read itself
|
|
21
21
|
* decklight transform install build-time transforms, run via `bundle --transform <name>`
|
|
22
|
-
* decklight engine install a speech engine beyond the six built in — the
|
|
22
|
+
* decklight engine install a speech engine beyond the six built in — the V picker then offers it
|
|
23
23
|
* decklight extension check a transform file — the marketplace admission gate, not a bundle step
|
|
24
|
-
* decklight voice add a marketplace voice to the
|
|
24
|
+
* decklight voice add a marketplace voice to the V picker — a reference, never a model
|
|
25
25
|
* decklight agent teach A a coding agent beyond the built-in roster — a descriptor, never code
|
|
26
26
|
* decklight tts serve the live voice bridge (on-the-fly Gemini narration)
|
|
27
27
|
* decklight lipsync serve the lip-sync bridge (character visemes + talking-head video)
|
|
28
28
|
* decklight video render a deck to a narrated mp4 (stills + voiceover audio)
|
|
29
29
|
*
|
|
30
|
-
* The subcommand implementations live in
|
|
30
|
+
* The subcommand implementations live in cast.mjs and
|
|
31
31
|
* bundle.mjs (importable modules; direct execution still works but
|
|
32
32
|
* this dispatcher is the documented entry point).
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
import { readFileSync } from 'node:fs';
|
|
35
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
36
|
+
import { versionLine, parseDescribe } from './util.mjs';
|
|
36
37
|
|
|
37
38
|
const GLOBAL_HELP = `decklight — author, record, and package Decklight presentations
|
|
38
39
|
|
|
@@ -46,8 +47,9 @@ Commands:
|
|
|
46
47
|
EXAMPLE: decklight skills claude codex (or --all, or omit to use detected agents)
|
|
47
48
|
EXAMPLE: decklight skills --global (install into each agent's config home, every project)
|
|
48
49
|
EXAMPLE: decklight skills claude --pack (zip it to upload in your claude.ai skill settings)
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
cast record a truthful terminal cast by running a YAML command script in a real PTY
|
|
51
|
+
(this records a TERMINAL — decklight record records your VOICE)
|
|
52
|
+
EXAMPLE: decklight cast deck.term.yaml -o deck.cast.json
|
|
51
53
|
refresh re-execute the script embedded in each cast; rewrite the ones whose output drifted
|
|
52
54
|
EXAMPLE: decklight refresh casts/
|
|
53
55
|
export flatten a cast to asciicast v2 (markers per step) for the asciinema ecosystem
|
|
@@ -106,6 +108,21 @@ Commands:
|
|
|
106
108
|
author one command for the whole authoring loop: live-reload editing + every bridge this
|
|
107
109
|
machine can run, one Ctrl-C; E in the player edits speaker notes back into the file
|
|
108
110
|
EXAMPLE: decklight author demo/showcase.html (bridges without prerequisites are skipped)
|
|
111
|
+
record capture the deck's narration in YOUR voice — the deck reads you its notes
|
|
112
|
+
one ⟨CLICK⟩ beat at a time, and → ends a beat AND reveals the next build
|
|
113
|
+
(this records YOU — decklight cast records a terminal)
|
|
114
|
+
EXAMPLE: decklight record talk.html (serves it: a microphone needs 127.0.0.1)
|
|
115
|
+
voiceover batch-synthesize the deck's narration into a folder with a live engine
|
|
116
|
+
(piper/chirp/gemini/elevenlabs) — the headless counterpart of the deck's ⇧V
|
|
117
|
+
EXAMPLE: decklight voiceover talk.html -o voices/chirp --engine chirp --voice Achernar
|
|
118
|
+
review leave comments on somebody's deck, anchored to slides and carried by git
|
|
119
|
+
(writes <deck>.review.jsonl beside it; never touches the deck itself)
|
|
120
|
+
EXAMPLE: decklight review talk.html (then M in the deck)
|
|
121
|
+
\`review submit\` pushes them to a review/<you>-<date> branch (--pr opens one)
|
|
122
|
+
comments what reviewers said, resolved against the deck as it is now — a comment
|
|
123
|
+
whose slide moved is found anyway, and one whose slide is gone is still shown
|
|
124
|
+
EXAMPLE: decklight comments talk.html (--import to take in a reviewer's file,
|
|
125
|
+
--incoming to see what reviews are waiting on the remote)
|
|
109
126
|
present play a deck you did not author — read-only over localhost, under a CSP header;
|
|
110
127
|
prints what the file will execute, and strips what it cannot account for
|
|
111
128
|
EXAMPLE: decklight present talk.html (no editing surface, nothing is written)
|
|
@@ -129,6 +146,26 @@ let rest = argv.slice(1);
|
|
|
129
146
|
const { version } = JSON.parse(
|
|
130
147
|
readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
|
|
131
148
|
);
|
|
149
|
+
// which BUILD of that version — commits past the release tag and the sha.
|
|
150
|
+
// TWO sources, strictly ordered: a git CHECKOUT answers live (one ~10ms
|
|
151
|
+
// describe, dev machines only), because the stamped dist/build-info.json
|
|
152
|
+
// describes the tree at BUILD time and dist/ survives `git checkout` — a
|
|
153
|
+
// stale stamp once named the feature-branch build while main was the thing
|
|
154
|
+
// actually running, which is the exact misdirection this banner exists to
|
|
155
|
+
// prevent. A tarball ships no .git, pays nothing, and reads the stamp its
|
|
156
|
+
// build froze beside the code — there the two cannot diverge.
|
|
157
|
+
let buildInfo = null;
|
|
158
|
+
if (existsSync(new URL('../.git', import.meta.url))) {
|
|
159
|
+
try {
|
|
160
|
+
const { execFileSync } = await import('node:child_process');
|
|
161
|
+
buildInfo = parseDescribe(execFileSync('git', ['describe', '--tags', '--long', '--dirty=.dirty'],
|
|
162
|
+
{ cwd: new URL('..', import.meta.url), encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }));
|
|
163
|
+
} catch { buildInfo = null; } // a tagless clone: plain is the whole truth
|
|
164
|
+
} else {
|
|
165
|
+
try { buildInfo = JSON.parse(readFileSync(new URL('../dist/build-info.json', import.meta.url), 'utf8')); }
|
|
166
|
+
catch { buildInfo = null; }
|
|
167
|
+
}
|
|
168
|
+
const banner = versionLine(version, buildInfo);
|
|
132
169
|
|
|
133
170
|
if (!cmd || cmd === '--help' || cmd === '-h') globalHelp();
|
|
134
171
|
// A newer decklight than the one npx pinned (#314). Read from a cache the last
|
|
@@ -139,7 +176,7 @@ const notice = updateNotice(version);
|
|
|
139
176
|
refreshInBackground();
|
|
140
177
|
|
|
141
178
|
if (cmd === '--version' || cmd === '-v' || cmd === 'version') {
|
|
142
|
-
process.stdout.write(
|
|
179
|
+
process.stdout.write(`${banner}\n`);
|
|
143
180
|
if (notice) process.stderr.write(`${notice}\n`);
|
|
144
181
|
process.exit(0);
|
|
145
182
|
}
|
|
@@ -150,9 +187,15 @@ if (cmd === 'help') {
|
|
|
150
187
|
}
|
|
151
188
|
|
|
152
189
|
// every real command announces the version it runs as — on stderr, so piped
|
|
153
|
-
// output (export, bundle) stays clean
|
|
154
|
-
|
|
155
|
-
|
|
190
|
+
// output (export, bundle) stays clean.
|
|
191
|
+
//
|
|
192
|
+
// EXCEPT under author, which spawns this same CLI two or three times: the
|
|
193
|
+
// parent has already said which version everything runs as, and repeating it
|
|
194
|
+
// once per child was the first third of author's startup wall.
|
|
195
|
+
if (!process.env.DECKLIGHT_BANNER) {
|
|
196
|
+
process.stderr.write(`${banner}\n`);
|
|
197
|
+
if (notice) process.stderr.write(`${notice}\n`);
|
|
198
|
+
}
|
|
156
199
|
|
|
157
200
|
// When a parent supervises us (author runs the deck server and the bridges), go when it
|
|
158
201
|
// goes — a SIGKILLed parent never gets to reap its children. No-op otherwise.
|
|
@@ -187,19 +230,19 @@ switch (cmd) {
|
|
|
187
230
|
await skillsMain(rest);
|
|
188
231
|
break;
|
|
189
232
|
}
|
|
190
|
-
case '
|
|
191
|
-
const {
|
|
192
|
-
await
|
|
233
|
+
case 'cast': {
|
|
234
|
+
const { castMain } = await import('./cast.mjs');
|
|
235
|
+
await castMain(rest);
|
|
193
236
|
break;
|
|
194
237
|
}
|
|
195
238
|
case 'refresh': {
|
|
196
|
-
const {
|
|
197
|
-
await
|
|
239
|
+
const { castMain } = await import('./cast.mjs');
|
|
240
|
+
await castMain(rest.includes('--help') ? ['--help'] : ['refresh', ...rest]);
|
|
198
241
|
break;
|
|
199
242
|
}
|
|
200
243
|
case 'export': {
|
|
201
|
-
const {
|
|
202
|
-
await
|
|
244
|
+
const { castMain } = await import('./cast.mjs');
|
|
245
|
+
await castMain(rest.includes('--help') ? ['--help'] : ['export', ...rest]);
|
|
203
246
|
break;
|
|
204
247
|
}
|
|
205
248
|
case 'bundle': {
|
|
@@ -294,6 +337,33 @@ switch (cmd) {
|
|
|
294
337
|
await devMain(rest);
|
|
295
338
|
break;
|
|
296
339
|
}
|
|
340
|
+
case 'record': {
|
|
341
|
+
const { recordMain } = await import('./record.mjs');
|
|
342
|
+
process.exitCode = await recordMain(rest);
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
case 'voiceover': {
|
|
346
|
+
// tools/voiceover.mjs arg-parses and exits at LOAD (it cannot be imported
|
|
347
|
+
// — deck-html.mjs's note), so it is spawned, exactly as `video
|
|
348
|
+
// --voiceover` already spawns it. stdio inherited: its per-slide progress
|
|
349
|
+
// and cost lines are the whole point of running it in a terminal.
|
|
350
|
+
const { spawnSync } = await import('node:child_process');
|
|
351
|
+
const { fileURLToPath } = await import('node:url');
|
|
352
|
+
const script = fileURLToPath(new URL('../tools/voiceover.mjs', import.meta.url));
|
|
353
|
+
const r = spawnSync(process.execPath, [script, ...rest], { stdio: 'inherit' });
|
|
354
|
+
process.exitCode = r.status ?? 1;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
case 'review': {
|
|
358
|
+
const { reviewMain } = await import('./review.mjs');
|
|
359
|
+
process.exitCode = await reviewMain(rest);
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
case 'comments': {
|
|
363
|
+
const { commentsMain } = await import('./comments.mjs');
|
|
364
|
+
process.exitCode = await commentsMain(rest);
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
297
367
|
case 'present': {
|
|
298
368
|
const { presentMain } = await import('./present.mjs');
|
|
299
369
|
process.exitCode = await presentMain(rest);
|
|
@@ -304,13 +374,6 @@ switch (cmd) {
|
|
|
304
374
|
process.exitCode = await associateMain(rest);
|
|
305
375
|
break;
|
|
306
376
|
}
|
|
307
|
-
case 'edit': {
|
|
308
|
-
// Removed as a command (COMMANDS in MARKETPLACE.md) — but a removal must
|
|
309
|
-
// refuse out loud, naming the way forward, not shrug "unknown command".
|
|
310
|
-
// The server itself lives on in edit.mjs; `author` starts it.
|
|
311
|
-
process.stderr.write('decklight edit was folded into the authoring loop — run `decklight author <deck.html>` instead\n');
|
|
312
|
-
process.exit(1);
|
|
313
|
-
}
|
|
314
377
|
default:
|
|
315
378
|
process.stderr.write(`decklight: unknown command "${cmd}"\n\n`);
|
|
316
379
|
globalHelp(1);
|