@tobos/cli 0.4.24 → 0.4.26
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/dist/{chunk-X7UZGZNN.js → chunk-AAEIX4XE.js} +1 -1
- package/dist/{chunk-Y5NUJPUC.js → chunk-CIDXWFWY.js} +1 -1
- package/dist/{chunk-UCYGK5ZH.js → chunk-Q4BZVT4D.js} +2 -2
- package/dist/cli.js +48 -12
- package/dist/{render-6D4XWOIK.js → render-A67ZX3V6.js} +2 -2
- package/dist/{src-YFKD6CMU.js → src-X7IVBYPX.js} +2 -2
- package/dist/{types-SO25OPOX.js → types-SVU2BZB5.js} +3 -3
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
init_define_TOBOS_PRESENT_TYPES,
|
|
9
9
|
init_define_TOBOS_SKILL,
|
|
10
10
|
init_define_TOBOS_TOOLCHAIN
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Q4BZVT4D.js";
|
|
12
12
|
|
|
13
13
|
// ../node_modules/.pnpm/aria-query@5.3.1/node_modules/aria-query/lib/util/iteratorProxy.js
|
|
14
14
|
var require_iteratorProxy = __commonJS({
|
|
@@ -47,7 +47,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
47
47
|
var define_TOBOS_PRESENT_TYPES_default;
|
|
48
48
|
var init_define_TOBOS_PRESENT_TYPES = __esm({
|
|
49
49
|
"<define:TOBOS_PRESENT_TYPES>"() {
|
|
50
|
-
define_TOBOS_PRESENT_TYPES_default = { "registry.d.ts": "/** State the viewer sets up before any scene loads, and the scene API reads. */\nexport declare function setMedia(media: Record<string, {\n hash: string;\n}>): void;\nexport declare function mediaUrl(name: string): string;\n/** The deck's join code, and the ways to show it. */\nexport interface JoinInfo {\n /** The six digits: `482913`. */\n code: string;\n /** The link as people type it, without the scheme: `tobosusercontent.com/482913`. */\n link: string;\n /** The full URL the QR code holds: `https://tobosusercontent.com/482913`. */\n url: string;\n /** The QR code, black on white, as an image's address: `<img src={join.qr} />`. */\n qr: string;\n}\nexport declare function setJoin(info: JoinInfo | undefined): void;\nexport declare function joinInfo(): JoinInfo | undefined;\n/** Whether this is a share link's page, for people outside the deck's account. */\nexport declare function setShared(value: boolean): void;\nexport declare function isShared(): boolean;\n", "timeline.d.ts": "import type { Beat } from './index.ts';\n/**\n * Whether the scene timeline that holds this animation is playing a step forward, in real\n * time, as opposed to being sought (a jump, a step back, a finish, a still view or a render).\n */\nexport declare function playingForward(animation: gsap.core.Animation): boolean;\n/**\n * Whether the scene timeline that holds this animation is playing a step forward that may be\n * heard: one this window was moved to itself, not one it follows from another window.\n */\nexport declare function playingAloud(animation: gsap.core.Animation): boolean;\n/**\n * A sound that plays on through a range of a scene's beats, from the one that starts it up to,\n * not including, the one it stops at (playAudio's `until`).\n */\nexport interface Span {\n /** Play it from its start, heard. */\n start(): void;\n /** Stop it, fading it out or at once; resolves once it is silent. */\n stop(fade: boolean): Promise<void>;\n}\n/**\n * Add a span to the scene `tl` is the timeline of, while one of its beats' `enter` runs: from\n * that beat up to the one `until` names. False where `until` names no later beat of the scene.\n */\nexport declare function addSpan(tl: gsap.core.Timeline, until: string, span: Span): boolean;\n/**\n * One scene's beats as one paused GSAP timeline, with a label after each beat's animation.\n * Stepping forward tweens the playhead to the next label; everything else seeks.\n */\nexport declare class SceneTimeline {\n readonly timeline: gsap.core.Timeline;\n private labels;\n private tween;\n /** Whether the step playing may be heard. */\n aloud: boolean;\n private ids;\n /** The beat whose `enter` is running, while the timeline is built. */\n private building;\n private spans;\n /** The spans' stops still fading out. */\n private fades;\n constructor(root: Element, beats: readonly Beat[]);\n addSpan(until: string, span: Span): boolean;\n /**\n * Whether a span is still fading out: a scene leaving the stage is unmounted once it is\n * silent, since its sound goes with its elements.\n */\n get fading(): Promise<void> | null;\n get playing(): boolean;\n /** Finish the beat that is playing, at once. */\n finish(): void;\n /** Before the first beat: the scene waiting for its entrance. */\n hold(): void;\n /** The scene has left the stage: its spans fade out. */\n leave(): void;\n /**\n * After a move to `beat` (-1: none), each span plays on while the beat is in its range,\n * whichever way it moved there, and fades out outside it. Only a step forward onto its first\n * beat, heard, starts it.\n */\n private sound;\n /**\n * Show a beat: play the animation into it, or land on its end state. `aloud`: whether its\n * sound plays, or the step plays silent.\n */\n show(beat: number, animate: boolean, aloud?: boolean): void;\n /** Put the playhead part-way through the animation into a beat (0..1), for filmstrips. */\n sample(beat: number, progress: number): void;\n /** How long the animation into a beat takes, in seconds. */\n duration(beat: number): number;\n kill(): void;\n}\n", "playback.d.ts": "interface ClipOptions {\n /** Where the clip starts in the video or sound, in seconds. Default 0. */\n from?: number;\n /** Where the clip ends in the video or sound, in seconds. Default: its end. */\n to?: number;\n /** Speed: 1 is real time, 0.5 half speed. Default 1. */\n rate?: number;\n /**\n * When the clip starts within the beat: GSAP's position parameter (`'<'`, `'+=0.5'`, a\n * number). Default: after what the beat has animated so far, like any `tl.to`.\n */\n position?: gsap.Position;\n}\nexport interface PlayAudioOptions extends ClipOptions {\n /**\n * The beat the sound plays until. It plays on through the beats before it, whichever way the\n * presenter moves among them, and fades out when this beat or one outside the range is shown,\n * or the scene is left. The beat it starts in doesn't wait for it, and `to` and `position`\n * don't apply: it plays from `from` to its end, or until then.\n */\n until?: string;\n /** With `until`: how long it fades out, in seconds. Default 1; 0 stops it at once. */\n fade?: number;\n}\nexport interface PlayVideoOptions extends ClipOptions {\n /** Play the video's own sound with it. Default: muted. */\n sound?: boolean;\n}\n/**\n * Play a video (or the clip `from`\u2013`to` of it) as part of a beat. Stepping forward plays it in\n * real time; going back, jumping or reloading shows the frame for that position at once; a\n * click while it plays lands on its last frame. Before its beat it shows the clip's first frame.\n *\n * ```ts\n * { id: 'turn', enter: (tl, q) => playVideo(tl, q('video')) }\n * ```\n *\n * The video plays inline and preloads, and is muted unless `sound` is set. Several videos\n * (`q('video')` finding more than one) play side by side, each its own length.\n */\nexport declare function playVideo(tl: gsap.core.Timeline, target: Element | ArrayLike<Element> | null | undefined, options?: PlayVideoOptions): gsap.core.Timeline;\n/**\n * Play a sound (or the clip `from`\u2013`to` of it) as part of a beat. Stepping forward plays it in\n * real time; a click while it plays stops it and plays the next beat; going back, jumping or\n * reloading is silent. So is a scene mounted ahead, and a window that only follows another.\n *\n * ```ts\n * { id: 'listen', enter: (tl, q) => playAudio(tl, q('audio')) }\n * ```\n *\n * The sound preloads. Several (`q('audio')` finding more than one) play together, each its own\n * length.\n */\nexport declare function playAudio(tl: gsap.core.Timeline, target: Element | ArrayLike<Element> | null | undefined, options?: PlayAudioOptions): gsap.core.Timeline;\n/**\n * Call `listener` each time the browser refuses this window sound, until a click or key press\n * in it lets it play. Returns a function that stops listening.\n */\nexport declare function onSoundRefused(listener: () => void): () => void;\n/**\n * Wait until the videos and sounds inside `root` know their length, so `playVideo` and\n * `playAudio` can size their clips when the scene's timeline is built. Those that won't load (no\n * source, `preload=\"none\"`, an error) don't hold it up, nor does anything past `timeout`.\n */\nexport declare function mediaKnowTheirLength(root: Element, timeout?: number): Promise<void>;\n/**\n * Wait until every video inside `root` shows the frame it was last sought to: no seek pending,\n * a frame decoded, and that frame handed to the screen again (`repaint`). Videos that won't load\n * don't hold it up.\n */\nexport declare function videoFramesReady(root: Element): Promise<void>;\nexport {};\n", "deck/types.d.ts": "export type Severity = 'error' | 'warning';\n/** One thing wrong with a deck. Lines and columns are 1-based. */\nexport interface Problem {\n file: string;\n line?: number;\n column?: number;\n rule: string;\n message: string;\n severity: Severity;\n}\nexport interface DeckScene {\n id: string;\n title: string;\n}\nexport interface DeckChapter {\n id: string;\n title: string;\n scenes: DeckScene[];\n}\n/** deck.json */\nexport interface DeckJson {\n title: string;\n chapters: DeckChapter[];\n dependencies?: Record<string, string>;\n}\nexport interface MediaEntry {\n hash: string;\n size: number;\n type: string;\n}\n/** media.json: path inside media/ \u2192 the file's content hash. */\nexport type MediaJson = Record<string, MediaEntry>;\n/** A poll: each phone picks one option. Its result shows on the projector from `reveals` on. */\nexport interface ChoiceActivity {\n id: string;\n kind: 'choice';\n prompt: string;\n options: string[];\n /** The beat of its scene that closes the poll and shows its result. */\n reveals?: string;\n}\nexport interface TextField {\n id: string;\n label: string;\n multiline?: boolean;\n /** The most characters it takes. 500 unless the scene says otherwise; in a manifest, always set. */\n max?: number;\n}\n/** A form: each phone fills in its fields. The answers are only stored. */\nexport interface TextActivity {\n id: string;\n kind: 'text';\n prompt?: string;\n fields: TextField[];\n}\n/**\n * Something the room responds to on their phones, declared by a scene. It is open while the\n * deck is presented on its scene, up to its `reveals` beat.\n */\nexport type Activity = ChoiceActivity | TextActivity;\nexport interface ManifestScene {\n id: string;\n title: string;\n beats: string[];\n /** The scene's specifier in the import map. */\n module: string;\n activity?: Activity;\n}\nexport interface ManifestChapter {\n id: string;\n title: string;\n scenes: ManifestScene[];\n}\n/** What the viewer needs to show one revision of a deck. */\nexport interface Manifest {\n format: 1;\n title: string;\n chapters: ManifestChapter[];\n /**\n * Deck specifiers (`@deck/scenes/a.svelte`) \u2192 module paths relative to the viewer (`m/<hash>.js`).\n * The server adds the package specifiers once it has bundled them (`d3` \u2192 `p/<bundle>/d3.js`).\n */\n imports: Record<string, string>;\n media: MediaJson;\n /** deck.json's dependencies: package \u2192 exact version. */\n dependencies: Record<string, string>;\n /** The package specifiers the deck imports, by dependency: `{ three: ['three', 'three/addons/\u2026'] }`. */\n packages: Record<string, string[]>;\n /**\n * Stylesheets, relative to the viewer: the master's tokens.css (`m/<hash>.css`), then those of\n * the packages it imports (`p/<bundle>/katex/dist/katex.min.css`), which the server adds.\n */\n styles?: string[];\n /**\n * What the deck's code uses of the deck, so a share gets only what the scenes it shows reach\n * (share.ts). Not in a manifest pushed before the build recorded it, which sharedManifest()\n * shares as it did then.\n */\n uses?: Uses;\n}\n/** What each of a deck's modules uses of the deck itself, and what its stylesheet does. */\nexport interface Uses {\n /**\n * By specifier (`@deck/scenes/a.svelte`): the deck's modules it imports, statically or not; the\n * media.json names its media() calls name; and their patterns (`frames/*.png`), which a share\n * matches against media.json, so a pattern is here once, not as every name it matches. Each is\n * left out when it has none.\n */\n modules: Record<string, {\n imports?: string[];\n media?: string[];\n patterns?: string[];\n }>;\n /** The media.json names tokens.css links, which every page that shows the deck loads. */\n styles: string[];\n}\n/** A deck's files, from a directory or from a git revision. Paths use `/` and have no leading slash. */\nexport interface DeckTree {\n files(): string[];\n read(path: string): Uint8Array | undefined;\n}\n", "activities.d.ts": "/** What the server tells about a deck's activities: phones what is open, the projector the results. */\n/** An activity as a phone needs it: no more. */\nexport type PhoneActivity = {\n id: string;\n kind: 'choice';\n prompt: string;\n options: string[];\n} | {\n id: string;\n kind: 'text';\n prompt?: string;\n fields: {\n id: string;\n label: string;\n multiline?: boolean;\n max: number;\n }[];\n};\n/** Nothing live, or the show and its open activity, if any. */\nexport type PhoneState = {\n live: false;\n} | {\n live: true;\n show: string;\n activity: PhoneActivity | null;\n};\n/** What the projector hears: the show, and every activity answered in it. */\nexport interface Results {\n show: string | null;\n joined: number;\n activities: Record<string, {\n answered: number;\n counts?: number[];\n }>;\n}\n", "viewer/stream.d.ts": "/**\n * A server-sent events stream that outlasts the server going away. EventSource reconnects by\n * itself only when a connection drops; when a reconnect is answered with an error, as the proxy\n * answers 502 while the app restarts for a release, it gives up for good. This one opens it\n * again, waiting longer each time, up to a minute.\n *\n * `onOpen` runs on every connection, `again` on all but the first: what was sent while the\n * stream was away is missed, so that is the moment to read the state afresh.\n */\nexport declare function stream(url: string, listeners: Record<string, (data: string) => void>, onOpen?: (again: boolean) => void): () => void;\n", "responses.svelte.d.ts": "/**\n * What the room has answered, for the projector: the audience and presenter windows, and the\n * preview on the deck's page, follow it from the server. Print and render, and a link that isn't\n * a presenter's, have zeros. It is live data, which the position can't recreate.\n */\nimport type { Manifest } from '@tobos/deck/types';\nimport type { Results } from './activities.ts';\n/** One activity's responses in the current show. */\nexport interface Responses {\n /**\n * The most phones that had the deck's join link open at once during this show, and never fewer\n * than answered.\n */\n readonly joined: number;\n /** People who have answered this activity during this show. */\n readonly answered: number;\n /** A poll's responses per option, in the order the scene declares them. A form's is empty. */\n readonly counts: number[];\n}\n/** The deck's activities, so a poll nobody answered yet has a zero per option. */\nexport declare function setActivities(manifest: Manifest): void;\n/** The current show's responses: reactive, for a scene or the presenter's view. */\nexport declare function liveResults(): Readonly<Results>;\n/**\n * The room's responses to an activity of this deck in the current show: how many joined, how\n * many answered, and a poll's counts per option. Call during component setup.\n */\nexport declare function useResponses(id: string): Responses;\n/** Follow the server's results stream (server-sent events) until the returned function is called. */\nexport declare function followResponses(url: string): () => void;\n", "index.d.ts": `import { type Component } from 'svelte';
|
|
50
|
+
define_TOBOS_PRESENT_TYPES_default = { "registry.d.ts": "/** State the viewer sets up before any scene loads, and the scene API reads. */\nexport declare function setMedia(media: Record<string, {\n hash: string;\n}>): void;\nexport declare function mediaUrl(name: string): string;\n/** The deck's join code, and the ways to show it. */\nexport interface JoinInfo {\n /** The six digits: `482913`. */\n code: string;\n /** The link as people type it, without the scheme: `tobosusercontent.com/482913`. */\n link: string;\n /** The full URL the QR code holds: `https://tobosusercontent.com/482913`. */\n url: string;\n /** The QR code, black on white, as an image's address: `<img src={join.qr} />`. */\n qr: string;\n}\nexport declare function setJoin(info: JoinInfo | undefined): void;\nexport declare function joinInfo(): JoinInfo | undefined;\n/** Whether this is a share link's page, for people outside the deck's account. */\nexport declare function setShared(value: boolean): void;\nexport declare function isShared(): boolean;\n", "timeline.d.ts": "import type { Beat } from './index.ts';\n/**\n * Whether the scene timeline that holds this animation is playing a step forward, in real\n * time, as opposed to being sought (a jump, a step back, a finish, a still view or a render).\n */\nexport declare function playingForward(animation: gsap.core.Animation): boolean;\n/**\n * Whether the scene timeline that holds this animation is playing a step forward that may be\n * heard: one this window was moved to itself, not one it follows from another window.\n */\nexport declare function playingAloud(animation: gsap.core.Animation): boolean;\n/**\n * A sound that plays on through a range of a scene's beats, from the one that starts it up to,\n * not including, the one it stops at (playAudio's `until`).\n */\nexport interface Span {\n /** Play it from its start, heard. */\n start(): void;\n /** Stop it, fading it out or at once; resolves once it is silent. */\n stop(fade: boolean): Promise<void>;\n}\n/**\n * Add a span to the scene `tl` is the timeline of, while one of its beats' `enter` runs: from\n * that beat up to the one `until` names. False where `until` names no later beat of the scene.\n */\nexport declare function addSpan(tl: gsap.core.Timeline, until: string, span: Span): boolean;\n/**\n * One scene's beats as one paused GSAP timeline, with a label after each beat's animation.\n * Stepping forward tweens the playhead to the next label; everything else seeks.\n */\nexport declare class SceneTimeline {\n readonly timeline: gsap.core.Timeline;\n private labels;\n private tween;\n /** Whether the step playing may be heard. */\n aloud: boolean;\n private ids;\n /** The beat whose `enter` is running, while the timeline is built. */\n private building;\n private spans;\n /** The spans' stops still fading out. */\n private fades;\n constructor(root: Element, beats: readonly Beat[]);\n addSpan(until: string, span: Span): boolean;\n /**\n * Whether a span is still fading out: a scene leaving the stage is unmounted once it is\n * silent, since its sound goes with its elements.\n */\n get fading(): Promise<void> | null;\n get playing(): boolean;\n /** Finish the beat that is playing, at once. */\n finish(): void;\n /** Before the first beat: the scene waiting for its entrance. */\n hold(): void;\n /** The scene has left the stage: its spans fade out. */\n leave(): void;\n /**\n * After a move to `beat` (-1: none), each span plays on while the beat is in its range,\n * whichever way it moved there, and fades out outside it. Only a step forward onto its first\n * beat, heard, starts it.\n */\n private sound;\n /**\n * Show a beat: play the animation into it, or land on its end state. `aloud`: whether its\n * sound plays, or the step plays silent.\n */\n show(beat: number, animate: boolean, aloud?: boolean): void;\n /** Put the playhead part-way through the animation into a beat (0..1), for filmstrips. */\n sample(beat: number, progress: number): void;\n /** How long the animation into a beat takes, in seconds. */\n duration(beat: number): number;\n kill(): void;\n}\n", "playback.d.ts": "interface ClipOptions {\n /** Where the clip starts in the video or sound, in seconds. Default 0. */\n from?: number;\n /** Where the clip ends in the video or sound, in seconds. Default: its end. */\n to?: number;\n /** Speed: 1 is real time, 0.5 half speed. Default 1. */\n rate?: number;\n /**\n * When the clip starts within the beat: GSAP's position parameter (`'<'`, `'+=0.5'`, a\n * number). Default: after what the beat has animated so far, like any `tl.to`.\n */\n position?: gsap.Position;\n}\nexport interface PlayAudioOptions extends ClipOptions {\n /**\n * The beat the sound plays until. It plays on through the beats before it, whichever way the\n * presenter moves among them, and fades out when this beat or one outside the range is shown,\n * or the scene is left. The beat it starts in doesn't wait for it, and `to` and `position`\n * don't apply: it plays from `from` to its end, or until then.\n */\n until?: string;\n /** With `until`: how long it fades out, in seconds. Default 1; 0 stops it at once. */\n fade?: number;\n}\nexport interface PlayVideoOptions extends ClipOptions {\n /** Play the video's own sound with it. Default: muted. */\n sound?: boolean;\n}\n/**\n * Play a video (or the clip `from`\u2013`to` of it) as part of a beat. Stepping forward plays it in\n * real time; going back, jumping or reloading shows the frame for that position at once; a\n * click while it plays lands on its last frame. Before its beat it shows the clip's first frame.\n *\n * ```ts\n * { id: 'turn', enter: (tl, q) => playVideo(tl, q('video')) }\n * ```\n *\n * The video plays inline and preloads, and is muted unless `sound` is set. Several videos\n * (`q('video')` finding more than one) play side by side, each its own length.\n */\nexport declare function playVideo(tl: gsap.core.Timeline, target: Element | ArrayLike<Element> | null | undefined, options?: PlayVideoOptions): gsap.core.Timeline;\n/**\n * Play a sound (or the clip `from`\u2013`to` of it) as part of a beat. Stepping forward plays it in\n * real time; a click while it plays stops it and plays the next beat; going back, jumping or\n * reloading is silent. So is a scene mounted ahead, and a window that only follows another.\n *\n * ```ts\n * { id: 'listen', enter: (tl, q) => playAudio(tl, q('audio')) }\n * ```\n *\n * The sound preloads. Several (`q('audio')` finding more than one) play together, each its own\n * length.\n */\nexport declare function playAudio(tl: gsap.core.Timeline, target: Element | ArrayLike<Element> | null | undefined, options?: PlayAudioOptions): gsap.core.Timeline;\n/**\n * Call `listener` each time the browser refuses this window sound, until a click or key press\n * in it lets it play. Returns a function that stops listening.\n */\nexport declare function onSoundRefused(listener: () => void): () => void;\n/**\n * Wait until the videos and sounds inside `root` know their length, so `playVideo` and\n * `playAudio` can size their clips when the scene's timeline is built. Those that won't load (no\n * source, `preload=\"none\"`, an error) don't hold it up, nor does anything past `timeout`.\n */\nexport declare function mediaKnowTheirLength(root: Element, timeout?: number): Promise<void>;\n/**\n * Wait until every video inside `root` shows the frame it was last sought to: no seek pending,\n * a frame decoded, and that frame handed to the screen again (`repaint`). Videos that won't load\n * don't hold it up.\n */\nexport declare function videoFramesReady(root: Element): Promise<void>;\nexport {};\n", "deck/types.d.ts": "export type Severity = 'error' | 'warning';\n/** One thing wrong with a deck. Lines and columns are 1-based. */\nexport interface Problem {\n file: string;\n line?: number;\n column?: number;\n rule: string;\n message: string;\n severity: Severity;\n}\nexport interface DeckScene {\n id: string;\n title: string;\n}\nexport interface DeckChapter {\n id: string;\n title: string;\n scenes: DeckScene[];\n}\n/** deck.json */\nexport interface DeckJson {\n title: string;\n chapters: DeckChapter[];\n dependencies?: Record<string, string>;\n}\nexport interface MediaEntry {\n hash: string;\n size: number;\n type: string;\n}\n/** media.json: path inside media/ \u2192 the file's content hash. */\nexport type MediaJson = Record<string, MediaEntry>;\n/** A poll: each phone picks one option. Its result shows on the projector from `reveals` on. */\nexport interface ChoiceActivity {\n id: string;\n kind: 'choice';\n prompt: string;\n options: string[];\n /** The beat of its scene that closes the poll and shows its result. */\n reveals?: string;\n}\nexport interface TextField {\n id: string;\n label: string;\n multiline?: boolean;\n /** The most characters it takes. 500 unless the scene says otherwise; in a manifest, always set. */\n max?: number;\n}\n/** A form: each phone fills in its fields. The answers are only stored. */\nexport interface TextActivity {\n id: string;\n kind: 'text';\n prompt?: string;\n fields: TextField[];\n}\n/**\n * Something the room responds to on their phones, declared by a scene. It is open while the\n * deck is presented on its scene, up to its `reveals` beat.\n */\nexport type Activity = ChoiceActivity | TextActivity;\nexport interface ManifestScene {\n id: string;\n title: string;\n beats: string[];\n /** The scene's specifier in the import map. */\n module: string;\n activity?: Activity;\n}\nexport interface ManifestChapter {\n id: string;\n title: string;\n scenes: ManifestScene[];\n}\n/** What the viewer needs to show one revision of a deck. */\nexport interface Manifest {\n format: 1;\n title: string;\n chapters: ManifestChapter[];\n /**\n * Deck specifiers (`@deck/scenes/a.svelte`) \u2192 module paths relative to the viewer (`m/<hash>.js`).\n * The server adds the package specifiers once it has bundled them (`d3` \u2192 `p/<bundle>/d3.js`).\n */\n imports: Record<string, string>;\n media: MediaJson;\n /** deck.json's dependencies: package \u2192 exact version. */\n dependencies: Record<string, string>;\n /** The package specifiers the deck imports, by dependency: `{ three: ['three', 'three/addons/\u2026'] }`. */\n packages: Record<string, string[]>;\n /**\n * Stylesheets, relative to the viewer: the master's tokens.css (`m/<hash>.css`), then those of\n * the packages it imports (`p/<bundle>/katex/dist/katex.min.css`), which the server adds.\n */\n styles?: string[];\n /**\n * What the deck's code uses of the deck, so a share gets only what the scenes it shows reach\n * (share.ts). Not in a manifest pushed before the build recorded it, which sharedManifest()\n * shares as it did then.\n */\n uses?: Uses;\n}\n/** What each of a deck's modules uses of the deck itself, and what its stylesheet does. */\nexport interface Uses {\n /**\n * By specifier (`@deck/scenes/a.svelte`): the deck's modules it imports, statically or not; the\n * media.json names its media() calls name; and their patterns (`frames/*.png`), which a share\n * matches against media.json, so a pattern is here once, not as every name it matches. Each is\n * left out when it has none.\n */\n modules: Record<string, {\n imports?: string[];\n media?: string[];\n patterns?: string[];\n }>;\n /** The media.json names tokens.css links, which every page that shows the deck loads. */\n styles: string[];\n}\n/** A deck's files, from a directory or from a git revision. Paths use `/` and have no leading slash. */\nexport interface DeckTree {\n files(): string[];\n read(path: string): Uint8Array | undefined;\n}\n", "activities.d.ts": "/** What the server tells about a deck's activities: phones what is open, the projector the results. */\n/** An activity as a phone needs it: no more. */\nexport type PhoneActivity = {\n id: string;\n kind: 'choice';\n prompt: string;\n options: string[];\n} | {\n id: string;\n kind: 'text';\n prompt?: string;\n fields: {\n id: string;\n label: string;\n multiline?: boolean;\n max: number;\n }[];\n};\n/** Nothing live, or the show and its open activity, if any. */\nexport type PhoneState = {\n live: false;\n} | {\n live: true;\n show: string;\n activity: PhoneActivity | null;\n};\n/** What the projector hears: the show, and every activity answered in it. */\nexport interface Results {\n show: string | null;\n joined: number;\n activities: Record<string, {\n answered: number;\n counts?: number[];\n }>;\n}\n", "viewer/stream.d.ts": "/**\n * A server-sent events stream that outlasts the server going away. EventSource reconnects by\n * itself only when a connection drops; when a reconnect is answered with an error, as the proxy\n * answers 502 while the app restarts for a release, it gives up for good. This one opens it\n * again, waiting longer each time, up to a minute.\n *\n * `onOpen` runs on every connection, `again` on all but the first: what was sent while the\n * stream was away is missed, so that is the moment to read the state afresh.\n */\nexport declare function stream(url: string, listeners: Record<string, (data: string) => void>, onOpen?: (again: boolean) => void): () => void;\n", "viewer/events.d.ts": 'type Listener = (data: string) => void;\ndeclare const TYPES: readonly ["push", "results", "notes"];\nexport type EventType = (typeof TYPES)[number];\n/** Listen for one type of event on `url`, the window\'s stream: until the returned function runs. */\nexport declare function listen(url: string, type: EventType, listener: Listener, onReopen?: () => void): () => void;\nexport {};\n', "responses.svelte.d.ts": "/**\n * What the room has answered, for the projector: the audience and presenter windows, and the\n * preview on the deck's page, follow it from the server. Print and render, and a link that isn't\n * a presenter's, have zeros. It is live data, which the position can't recreate.\n */\nimport type { Manifest } from '@tobos/deck/types';\nimport type { Results } from './activities.ts';\n/** One activity's responses in the current show. */\nexport interface Responses {\n /**\n * The most phones that had the deck's join link open at once during this show, and never fewer\n * than answered.\n */\n readonly joined: number;\n /** People who have answered this activity during this show. */\n readonly answered: number;\n /** A poll's responses per option, in the order the scene declares them. A form's is empty. */\n readonly counts: number[];\n}\n/** The deck's activities, so a poll nobody answered yet has a zero per option. */\nexport declare function setActivities(manifest: Manifest): void;\n/** The current show's responses: reactive, for a scene or the presenter's view. */\nexport declare function liveResults(): Readonly<Results>;\n/**\n * The room's responses to an activity of this deck in the current show: how many joined, how\n * many answered, and a poll's counts per option. Call during component setup.\n */\nexport declare function useResponses(id: string): Responses;\n/** Follow the room's results on the window's stream (events.ts) until the returned function runs. */\nexport declare function followResponses(url: string): () => void;\n", "index.d.ts": `import { type Component } from 'svelte';
|
|
51
51
|
import { type JoinInfo } from './registry.ts';
|
|
52
52
|
export { playAudio, playVideo, type PlayAudioOptions, type PlayVideoOptions } from './playback.ts';
|
|
53
53
|
export { useResponses, type Responses } from './responses.svelte.ts';
|
|
@@ -116,7 +116,7 @@ export declare const JoinCode: Component<JoinCodeProps>;
|
|
|
116
116
|
var define_TOBOS_SKILL_default;
|
|
117
117
|
var init_define_TOBOS_SKILL = __esm({
|
|
118
118
|
"<define:TOBOS_SKILL>"() {
|
|
119
|
-
define_TOBOS_SKILL_default = { "SKILL.md": "---\nname: tobos-present\ndescription: Build presentations as code with Tobos Present. Use when the user wants a talk, lecture, pitch or slide deck made, changed, rendered, presented or exported as a PDF, or mentions Tobos or `tobos`.\n---\n\n<!-- Installed by the `tobos` CLI and overwritten when it updates, so changes made here don't last. -->\n\n# Tobos Present\n\nTobos hosts presentations written as code: a deck is a git repository, one Svelte 5 file per scene, advancing one beat per click. You build it with the `tobos` command; Tobos checks every push, hosts the deck and puts it on stage. `tobos --help` lists every command, and each takes `--json`.\n\n## Get to the deck\n\n- `tobos decks` lists the decks and templates the person can work on, by id. `tobos clone <id>` gets one; `tobos new \"Title\"` starts one and clones it.\n- A new deck starts from Tobos simple. The person's own templates, their house styles, are in `tobos decks`: start from one with `--from <id>`, and ask which when there are several.\n- Then read the deck's `AGENTS.md`: it points to the loop, the format and the deck's slide master.\n\nExit code 3 means no one is logged in. Ask the person for their e-mail address and run `tobos login <email>`. Then ask, in one line, for the 6-digit code it mailed them (it may be in spam, and using it accepts https://tobos.ai/terms), and run `tobos login --code <code>`. In CI or a sandbox with no one to ask, `TOBOS_TOKEN` and `TOBOS_SERVER` stand in for the login.\n\n## Follow the person\n\nThey decide what to make and how much of it you build: one scene at a time, or the whole deck at once. Build what they ask, at the size they ask, from what they have told you about the talk. When they ask how Tobos works or where to start, give them the tour, https://tobos.ai/tour, and nothing of your own: no explanation, no deck to try.\n\n## What stays the person's\n\n- **Exit code 5** is a plan's limit or an archived deck. Show the person the message as it is, which says what they can do, and wait for their answer. The deck stays in Tobos: a deck built elsewhere to upload later, media shrunk or hosted elsewhere to fit, or someone else's account would decide for them what is theirs to decide.\n- **Archiving, opening again and deleting** a deck, and deleting a session's answers, are done by the person on the deck's page, also in a browser `tobos open` logged in.\n- **People.** `tobos invite` puts on a deck only whom the person names, at the level they say: the mail goes to someone else, in the person's name. Can edit builds it with their own agent, can present presents it with its notes and polls, and can view sees the slides; on a template, can edit and can use.\n- **The URL `tobos open` prints** opens once, for whoever opens it first: give it to the person unopened, and run the command again for another window or computer.\n\n## The story\n\nA deck's story is the talk as the speaker tells it, in paragraphs. What follows a mention of a scene, `[Title](scene:<id>)` or one of its beats, `[Title](scene:<id>/<beat>)`, up to the next mention, is that scene's: the presenter sees it as speaker notes. The server holds the story, not git: the person types in it on the deck's page, and you change it with `tobos story`.\n\n- Read it again right before each change: the person may be typing.\n- Change what the person asked, and keep the rest of their words as they are.\n- An edit is anchored on exact text that occurs once in its paragraph. Exit code 4 means the paragraph changed meanwhile: anchor on it as the reply gives it, and try again.\n- Set `TOBOS_AGENT` to your name (`claude`, `codex`), so the page shows what you wrote.\n" };
|
|
119
|
+
define_TOBOS_SKILL_default = { "SKILL.md": "---\nname: tobos-present\ndescription: Build presentations as code with Tobos Present. Use when the user wants a talk, lecture, pitch or slide deck made, changed, rendered, presented or exported as a PDF, or mentions Tobos or `tobos`.\n---\n\n<!-- Installed by the `tobos` CLI and overwritten when it updates, so changes made here don't last. -->\n\n# Tobos Present\n\nTobos hosts presentations written as code: a deck is a git repository, one Svelte 5 file per scene, advancing one beat per click. You build it with the `tobos` command; Tobos checks every push, hosts the deck and puts it on stage. `tobos --help` lists every command, and each takes `--json`.\n\n## Get to the deck\n\n- `tobos decks` lists the decks and templates the person can work on, by id. `tobos clone <id>` gets one; `tobos new \"Title\"` starts one and clones it.\n- A new deck starts from Tobos simple. The person's own templates, their house styles, are in `tobos decks`: start from one with `--from <id>`, and ask which when there are several.\n- Then read the deck's `AGENTS.md`: it points to the loop, the format and the deck's slide master.\n- The person's decks are in folders, which `tobos --help` lists the commands for.\n\nExit code 3 means no one is logged in. Ask the person for their e-mail address and run `tobos login <email>`. Then ask, in one line, for the 6-digit code it mailed them (it may be in spam, and using it accepts https://tobos.ai/terms), and run `tobos login --code <code>`. In CI or a sandbox with no one to ask, `TOBOS_TOKEN` and `TOBOS_SERVER` stand in for the login.\n\n## Follow the person\n\nThey decide what to make and how much of it you build: one scene at a time, or the whole deck at once. Build what they ask, at the size they ask, from what they have told you about the talk. When they ask how Tobos works or where to start, give them the tour, https://tobos.ai/tour, and nothing of your own: no explanation, no deck to try.\n\n## Folders\n\n- Look at the person's folders before you make or move a deck, and file it under a folder name they have already, as they wrote it, rather than a new one that means the same.\n- File every deck you make: once it is made, move it into the folder it belongs in.\n- Before you move more than a handful of decks, show the person the tree you propose, and make it once they say yes.\n- A reorganisation is taken back by moving the decks back where they were: note where they were before you move them.\n- A folder stays when a move empties it, until the person removes it: removing is theirs, as deleting a deck is.\n\n## What stays the person's\n\n- **Exit code 5** is a plan's limit or an archived deck. Show the person the message as it is, which says what they can do, and wait for their answer. The deck stays in Tobos: a deck built elsewhere to upload later, media shrunk or hosted elsewhere to fit, or someone else's account would decide for them what is theirs to decide.\n- **Archiving, opening again and deleting** a deck, and deleting a session's answers, are done by the person on the deck's page, also in a browser `tobos open` logged in.\n- **People.** `tobos invite` puts on a deck only whom the person names, at the level they say: the mail goes to someone else, in the person's name. Can edit builds it with their own agent, can present presents it with its notes and polls, and can view sees the slides; on a template, can edit and can use.\n- **The URL `tobos open` prints** opens once, for whoever opens it first: give it to the person unopened, and run the command again for another window or computer.\n\n## The story\n\nA deck's story is the talk as the speaker tells it, in paragraphs. What follows a mention of a scene, `[Title](scene:<id>)` or one of its beats, `[Title](scene:<id>/<beat>)`, up to the next mention, is that scene's: the presenter sees it as speaker notes. The server holds the story, not git: the person types in it on the deck's page, and you change it with `tobos story`.\n\n- Read it again right before each change: the person may be typing.\n- Change what the person asked, and keep the rest of their words as they are.\n- An edit is anchored on exact text that occurs once in its paragraph. Exit code 4 means the paragraph changed meanwhile: anchor on it as the reply gives it, and try again.\n- Set `TOBOS_AGENT` to your name (`claude`, `codex`), so the page shows what you wrote.\n" };
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
formatMediaJson,
|
|
6
6
|
formatProblems,
|
|
7
7
|
mediaTypeOf
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AAEIX4XE.js";
|
|
9
9
|
import {
|
|
10
10
|
ASK_THE_PERSON,
|
|
11
11
|
CliError,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
createOutput,
|
|
14
14
|
offerUpdate,
|
|
15
15
|
update
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CIDXWFWY.js";
|
|
17
17
|
import {
|
|
18
18
|
define_TOBOS_SKILL_default,
|
|
19
19
|
init_define_TOBOS_PRESENT_TYPES,
|
|
20
20
|
init_define_TOBOS_SKILL,
|
|
21
21
|
init_define_TOBOS_TOOLCHAIN
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Q4BZVT4D.js";
|
|
23
23
|
|
|
24
24
|
// src/main.ts
|
|
25
25
|
init_define_TOBOS_PRESENT_TYPES();
|
|
@@ -89,7 +89,7 @@ function settings() {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// src/api.ts
|
|
92
|
-
var VERSION = true ? "0.4.
|
|
92
|
+
var VERSION = true ? "0.4.26" : "dev";
|
|
93
93
|
function newer(a, b) {
|
|
94
94
|
const parse = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n) => parseInt(n)) : null;
|
|
95
95
|
const x = parse(a);
|
|
@@ -650,13 +650,41 @@ function aboutDeck(d) {
|
|
|
650
650
|
].filter(Boolean);
|
|
651
651
|
return notes.length ? ` (${notes.join("; ")})` : "";
|
|
652
652
|
}
|
|
653
|
-
|
|
653
|
+
var inFolder = (path) => path === "/" ? "" : `${path}/`;
|
|
654
|
+
async function decks(out, args) {
|
|
655
|
+
const path = args.positionals[0];
|
|
656
|
+
if (path !== void 0) {
|
|
657
|
+
const listed = await api(
|
|
658
|
+
`/api/drive?${new URLSearchParams({ path })}`
|
|
659
|
+
);
|
|
660
|
+
out.result(
|
|
661
|
+
listed,
|
|
662
|
+
() => listed.entries.length === 0 ? `${listed.path} is empty.` : listed.entries.map((e) => e.kind === "folder" ? `${e.name}/` : `${e.id} ${e.title}`).join("\n")
|
|
663
|
+
);
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
654
666
|
const { decks: decks2 } = await api("/api/decks");
|
|
655
667
|
out.result(
|
|
656
668
|
{ decks: decks2 },
|
|
657
|
-
() => decks2.length === 0 ? 'No decks yet. `tobos new "Title"` starts one.' : decks2.map((d) => `${d.id} ${d.title}${aboutDeck(d)}`).join("\n")
|
|
669
|
+
() => decks2.length === 0 ? 'No decks yet. `tobos new "Title"` starts one.' : decks2.map((d) => `${d.id} ${inFolder(d.folder ?? "/")}${d.title}${aboutDeck(d)}`).join("\n")
|
|
658
670
|
);
|
|
659
671
|
}
|
|
672
|
+
async function mv(out, args) {
|
|
673
|
+
const named = args.positionals.slice(0, -1);
|
|
674
|
+
const to = args.positionals.at(-1);
|
|
675
|
+
if (!to || named.length === 0)
|
|
676
|
+
throw new CliError(
|
|
677
|
+
"What goes where? `tobos mv <deck or /folder>\u2026 <folder>`: decks by id or title, folders by path."
|
|
678
|
+
);
|
|
679
|
+
const moved = await api("/api/drive/move", {
|
|
680
|
+
body: {
|
|
681
|
+
decks: named.filter((name) => !name.startsWith("/")),
|
|
682
|
+
folders: named.filter((name) => name.startsWith("/")),
|
|
683
|
+
to
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
out.result(moved, () => `Moved ${plural(named.length, "item")} into ${moved.to}.`);
|
|
687
|
+
}
|
|
660
688
|
async function cloneInto(out, info, dir2) {
|
|
661
689
|
const { server } = settings();
|
|
662
690
|
if (existsSync4(dir2)) throw new CliError(`${dir2} already exists.`);
|
|
@@ -732,7 +760,7 @@ async function pushedFiles(root) {
|
|
|
732
760
|
}
|
|
733
761
|
}
|
|
734
762
|
async function runCheck(dir2) {
|
|
735
|
-
const { buildDeck } = await import("./src-
|
|
763
|
+
const { buildDeck } = await import("./src-X7IVBYPX.js");
|
|
736
764
|
const started = performance.now();
|
|
737
765
|
const files = await pushedFiles(dir2.root);
|
|
738
766
|
const result = await buildDeck(directoryTree(dir2.root, files));
|
|
@@ -793,7 +821,7 @@ async function check(out, args) {
|
|
|
793
821
|
await syncMediaJson(deck.root);
|
|
794
822
|
const result = await runCheck(deck);
|
|
795
823
|
if (args.values.types) {
|
|
796
|
-
const { checkTypes } = await import("./types-
|
|
824
|
+
const { checkTypes } = await import("./types-SVU2BZB5.js");
|
|
797
825
|
const sent = result.files && new Set(result.files);
|
|
798
826
|
result.problems.push(
|
|
799
827
|
...(await checkTypes(deck.root, (m) => out.note(m))).filter((p) => sent?.has(p.file) ?? true)
|
|
@@ -820,7 +848,7 @@ async function pushWorkingCopy(out, deck, message) {
|
|
|
820
848
|
const result = await runCheck(deck);
|
|
821
849
|
const { errors, warnings } = problemSummary(result.problems);
|
|
822
850
|
if (errors > 0) return { ok: false, errors, warnings, problems: result.problems };
|
|
823
|
-
const { mediaInUse } = await import("./src-
|
|
851
|
+
const { mediaInUse } = await import("./src-X7IVBYPX.js");
|
|
824
852
|
const shown = result.manifest ? mediaInUse(result.manifest) : media;
|
|
825
853
|
for (const [name, entry] of Object.entries(shown)) {
|
|
826
854
|
const note = sizeNote(name, entry.size);
|
|
@@ -1072,7 +1100,7 @@ async function exportDeck(out, args) {
|
|
|
1072
1100
|
);
|
|
1073
1101
|
}
|
|
1074
1102
|
async function render(out, args) {
|
|
1075
|
-
const { renderBeats } = await import("./render-
|
|
1103
|
+
const { renderBeats } = await import("./render-A67ZX3V6.js");
|
|
1076
1104
|
const deck = await findDeck().catch(() => void 0);
|
|
1077
1105
|
const id = typeof args.values.deck === "string" ? parseId(args.values.deck) : deck?.id;
|
|
1078
1106
|
if (!id) throw new CliError("Run this inside a cloned deck, or pass --deck <id>.");
|
|
@@ -1165,8 +1193,15 @@ Account
|
|
|
1165
1193
|
tobos login --code <code> finish: the code they read from the mail
|
|
1166
1194
|
tobos logout forget this machine's token
|
|
1167
1195
|
tobos whoami who you are, on which server
|
|
1168
|
-
tobos decks
|
|
1169
|
-
with you; an archived one is
|
|
1196
|
+
tobos decks [/path] your decks and templates, by id, each in its folder,
|
|
1197
|
+
and those shared with you; an archived one is
|
|
1198
|
+
read-only. With a path: what that folder holds,
|
|
1199
|
+
its folders, then its decks
|
|
1200
|
+
|
|
1201
|
+
Folders (your decks and templates in a tree; a deck by its id or title, a folder by its path)
|
|
1202
|
+
tobos mv <deck or /folder>\u2026 </path> move them into that folder, made if there is none
|
|
1203
|
+
(a folder emptied stays, until the person removes
|
|
1204
|
+
it on the web)
|
|
1170
1205
|
|
|
1171
1206
|
Working on a deck
|
|
1172
1207
|
tobos new "Title" [--dir dir] [--no-clone] create a deck and clone it here, into ./<id>
|
|
@@ -1243,6 +1278,7 @@ var TABLE = {
|
|
|
1243
1278
|
template: { type: "boolean" }
|
|
1244
1279
|
}
|
|
1245
1280
|
},
|
|
1281
|
+
mv: { run: mv },
|
|
1246
1282
|
clone: { run: clone },
|
|
1247
1283
|
pull: { run: pull },
|
|
1248
1284
|
check: { run: check, options: { types: { type: "boolean" } } },
|
|
@@ -3,12 +3,12 @@ import { createRequire as __tobosRequire } from 'node:module';
|
|
|
3
3
|
const require = __tobosRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
CliError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CIDXWFWY.js";
|
|
7
7
|
import {
|
|
8
8
|
init_define_TOBOS_PRESENT_TYPES,
|
|
9
9
|
init_define_TOBOS_SKILL,
|
|
10
10
|
init_define_TOBOS_TOOLCHAIN
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Q4BZVT4D.js";
|
|
12
12
|
|
|
13
13
|
// src/render.ts
|
|
14
14
|
init_define_TOBOS_PRESENT_TYPES();
|
|
@@ -3,17 +3,17 @@ import { createRequire as __tobosRequire } from 'node:module';
|
|
|
3
3
|
const require = __tobosRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
parseDeckJson
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AAEIX4XE.js";
|
|
7
7
|
import {
|
|
8
8
|
CliError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CIDXWFWY.js";
|
|
10
10
|
import {
|
|
11
11
|
define_TOBOS_PRESENT_TYPES_default,
|
|
12
12
|
define_TOBOS_TOOLCHAIN_default,
|
|
13
13
|
init_define_TOBOS_PRESENT_TYPES,
|
|
14
14
|
init_define_TOBOS_SKILL,
|
|
15
15
|
init_define_TOBOS_TOOLCHAIN
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Q4BZVT4D.js";
|
|
17
17
|
|
|
18
18
|
// src/types.ts
|
|
19
19
|
init_define_TOBOS_PRESENT_TYPES();
|