@tobos/cli 0.4.33 → 0.4.35

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.
@@ -0,0 +1,183 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __tobosRequire } from 'node:module';
3
+ const require = __tobosRequire(import.meta.url);
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __esm = (fn, res, err) => function __init() {
11
+ if (err) throw err[0];
12
+ try {
13
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ } catch (e) {
15
+ throw err = [e], e;
16
+ }
17
+ };
18
+ var __commonJS = (cb, mod) => function __require() {
19
+ try {
20
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
+ } catch (e) {
22
+ throw mod = 0, e;
23
+ }
24
+ };
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ // If the importer is in node compatibility mode or this is not an ESM
39
+ // file that has been converted to a CommonJS file using a Babel-
40
+ // compatible transform (i.e. "__esModule" has not been set), then set
41
+ // "default" to the CommonJS "module.exports" for node compatibility.
42
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
+ mod
44
+ ));
45
+
46
+ // <define:TOBOS_PRESENT_TYPES>
47
+ var define_TOBOS_PRESENT_TYPES_default;
48
+ var init_define_TOBOS_PRESENT_TYPES = __esm({
49
+ "<define:TOBOS_PRESENT_TYPES>"() {
50
+ define_TOBOS_PRESENT_TYPES_default = { "registry.d.ts": "export declare function setMedia(media: Record<string, {\n hash: string;\n}>): void;\n/** The URL of a file in media/, what `import cow from '$media/cow.jpg'` gives. */\nexport declare function mediaUrl(name: string): string;\n/**\n * What `import.meta.glob('$media/cow/*.png')` gives: each file of media/ a pattern matches, by its\n * specifier (`$media/cow/a.png`), in order, with its URL. On a share, only those it has.\n */\nexport declare function mediaGlob(patterns: string[]): Record<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/**\n * What the viewer needs to show one revision of a deck. Format 1's modules call the engine's\n * media(); a later one's import media (`import cow from '$media/cow.jpg'`), compiled into lookups\n * of the same media map. A revision keeps the format it was pushed with.\n */\nexport interface Manifest {\n format: 1 | 2;\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 it imports; and its `import.meta.glob` patterns (`frames/*.png`), or in format\n * 1 its media() calls' (share.ts), which a share matches against media.json, so a pattern is here\n * once, not as every name it matches. Each is 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
+ import { type JoinInfo } from './registry.ts';
52
+ export { playAudio, playVideo, type PlayAudioOptions, type PlayVideoOptions } from './playback.ts';
53
+ export { useResponses, type Responses } from './responses.svelte.ts';
54
+ export type { Activity, ChoiceActivity, TextActivity, TextField } from '@tobos/deck/types';
55
+ /** Finds elements inside the current scene only. */
56
+ export type Query = (selector: string) => Element[];
57
+ /** One click's worth of a scene: an ID, and the animation into it. */
58
+ export interface Beat {
59
+ id: string;
60
+ /** Add the animation into this beat to the scene's timeline. */
61
+ enter?: (tl: gsap.core.Timeline, q: Query) => unknown;
62
+ }
63
+ /** The props the engine passes to every scene. */
64
+ export interface SceneProps {
65
+ /** The current beat's ID. */
66
+ beat: string;
67
+ /** The current beat's index in the scene, from 0. */
68
+ index: number;
69
+ }
70
+ /** Where a scene sits in the deck, for layouts that show it (a wayfinder, an agenda). */
71
+ export interface DeckContext {
72
+ title: string;
73
+ chapters: {
74
+ id: string;
75
+ title: string;
76
+ scenes: {
77
+ id: string;
78
+ title: string;
79
+ }[];
80
+ }[];
81
+ chapter: {
82
+ id: string;
83
+ title: string;
84
+ };
85
+ scene: {
86
+ id: string;
87
+ title: string;
88
+ };
89
+ }
90
+ export declare const DECK_CONTEXT = "tobos:deck";
91
+ /** The deck, its chapters and the current scene. Call during component setup. */
92
+ export declare function useDeck(): DeckContext;
93
+ export type { JoinInfo } from './registry.ts';
94
+ /**
95
+ * The deck's join code, for a scene to show its own way: the digits, the link as people type
96
+ * it, the full URL, and the QR code as an image's address. Undefined while the deck has no
97
+ * activity.
98
+ */
99
+ export declare function useJoin(): JoinInfo | undefined;
100
+ export interface JoinCodeProps {
101
+ /** The QR code's width and height, in stage pixels. */
102
+ size?: number;
103
+ }
104
+ /**
105
+ * The deck's join code: a QR code, and under it the link it holds, which phones open to answer
106
+ * the deck's activities. The scene sizes it; the link takes the scene's font.
107
+ */
108
+ export declare const JoinCode: Component<JoinCodeProps>;
109
+ `, "media.d.ts": "// What a deck's code may write of media/, besides the engine's API: `tobos check --types`\n// declares it beside the engine's types (cli/build.ts), as the build compiles it\n// (deck/src/media-imports.ts).\n\n/** A file of media/: its URL. `import cow from '$media/cow.jpg'` */\ndeclare module '$media/*' {\n const url: string;\n export default url;\n}\n\ninterface ImportMeta {\n /**\n * The files of media/ a pattern matches, `import.meta.glob('$media/cow/*.png')`: each file's\n * URL by its specifier (`'$media/cow/a.png'`), in order. `*` matches within a folder's name, a\n * `**` folder any number of folders. The pattern is a string literal, or an array of them.\n */\n glob(pattern: string | string[]): Record<string, string>;\n}\n" };
110
+ }
111
+ });
112
+
113
+ // <define:TOBOS_SKILL>
114
+ var define_TOBOS_SKILL_default;
115
+ var init_define_TOBOS_SKILL = __esm({
116
+ "<define:TOBOS_SKILL>"() {
117
+ 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 folder of files, one Svelte 5 file per scene, advancing one beat per click. You build it with the `tobos` command, which needs no git; Tobos checks every push, keeps every version, 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 ls` lists the decks and templates the person can work on, by id. `tobos pull <id>` gets one; `tobos new \"Title\"` starts one and pulls it.\n- A new deck starts from Tobos standard. The person's own templates, their house styles, are in `tobos ls`: 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 this machine isn't connected to the person's account. Run `tobos login`: it prints an address, which the person opens on any device, logs in at (a first login signs them up, and accepts https://tobos.ai/terms) and approves this machine. Give it to them in one line, then, once they did, run `tobos login` again. 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 goes when it empties, by a move or a deck's deletion: there is no removing one. A folder with only archived decks in it isn't empty.\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, in their own browser.\n- **Who is on a deck, and its link,** are the person's, on the deck's page: they put people on it, change what each may do, take them off, and turn the link on or off there. You neither see nor change any of it: `tobos ls` tells you only what you may do on each deck and whose it is. 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- **Each scene's notes,** what the speaker says, are the person's: they write them under the stage on the deck's page, and the presenter sees them. You neither read nor write them, and a scene needs none from you.\n- **The URL `tobos open` prints** is the deck's page, where the person watches it, presents it and shares it; `--presenter` gives a presenter's link instead, which opens once, for whoever opens it first.\n" };
118
+ }
119
+ });
120
+
121
+ // <define:TOBOS_TOOLCHAIN>
122
+ var define_TOBOS_TOOLCHAIN_default;
123
+ var init_define_TOBOS_TOOLCHAIN = __esm({
124
+ "<define:TOBOS_TOOLCHAIN>"() {
125
+ define_TOBOS_TOOLCHAIN_default = { "svelte-check": "4.7.6", typescript: "6.0.3", svelte: "5.57.2", gsap: "3.15.0" };
126
+ }
127
+ });
128
+
129
+ // src/out.ts
130
+ init_define_TOBOS_PRESENT_TYPES();
131
+ init_define_TOBOS_SKILL();
132
+ init_define_TOBOS_TOOLCHAIN();
133
+ var EXIT = { ok: 0, error: 1, problems: 2, auth: 3, conflict: 4, limit: 5 };
134
+ var ASK_THE_PERSON = "This is for the person you work for to decide: show them the above, and wait for their answer. Don\u2019t work around it, for instance by building the deck outside Tobos.";
135
+ var CliError = class extends Error {
136
+ exit;
137
+ extra;
138
+ constructor(message, exit = EXIT.error, extra = {}) {
139
+ super(message);
140
+ this.exit = exit;
141
+ this.extra = extra;
142
+ }
143
+ };
144
+ var update;
145
+ function offerUpdate(line) {
146
+ update = line;
147
+ }
148
+ function createOutput(json) {
149
+ return {
150
+ json,
151
+ note(message, always = false) {
152
+ if (!json || always) process.stderr.write(`${message}
153
+ `);
154
+ },
155
+ result(value, human) {
156
+ if (json) process.stdout.write(`${JSON.stringify(update ? { ...value, update } : value)}
157
+ `);
158
+ else {
159
+ const text = human();
160
+ if (text) process.stdout.write(text.endsWith("\n") ? text : `${text}
161
+ `);
162
+ }
163
+ }
164
+ };
165
+ }
166
+
167
+ export {
168
+ __commonJS,
169
+ __export,
170
+ __toESM,
171
+ init_define_TOBOS_PRESENT_TYPES,
172
+ define_TOBOS_PRESENT_TYPES_default,
173
+ init_define_TOBOS_SKILL,
174
+ define_TOBOS_SKILL_default,
175
+ init_define_TOBOS_TOOLCHAIN,
176
+ define_TOBOS_TOOLCHAIN_default,
177
+ EXIT,
178
+ ASK_THE_PERSON,
179
+ CliError,
180
+ update,
181
+ offerUpdate,
182
+ createOutput
183
+ };
@@ -5,7 +5,7 @@ import {
5
5
  init_define_TOBOS_PRESENT_TYPES,
6
6
  init_define_TOBOS_SKILL,
7
7
  init_define_TOBOS_TOOLCHAIN
8
- } from "./chunk-5LA45GOP.js";
8
+ } from "./chunk-6KO5UAPI.js";
9
9
 
10
10
  // ../deck/src/deck-json.ts
11
11
  init_define_TOBOS_PRESENT_TYPES();
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  mergeText,
8
8
  parseMediaJson,
9
9
  unpackTar
10
- } from "./chunk-LBUZHZFX.js";
10
+ } from "./chunk-D4RKNNNF.js";
11
11
  import {
12
12
  ASK_THE_PERSON,
13
13
  CliError,
@@ -19,7 +19,7 @@ import {
19
19
  init_define_TOBOS_TOOLCHAIN,
20
20
  offerUpdate,
21
21
  update
22
- } from "./chunk-5LA45GOP.js";
22
+ } from "./chunk-6KO5UAPI.js";
23
23
 
24
24
  // src/main.ts
25
25
  init_define_TOBOS_PRESENT_TYPES();
@@ -139,7 +139,7 @@ var VERBS = {
139
139
  chat: "Each file\u2019s text in full, a patch of part of it, a file on the web for media/, or null to delete it. All or nothing, so put everything a step needs into one call."
140
140
  },
141
141
  new: {
142
- does: "Makes a deck in the person\u2019s account from a template, Tobos simple unless another is named, such as the person\u2019s own house style (ask which when they have several), with its first version, `rev`; or, as a template, a new template: a copy of all of the one it starts from.",
142
+ does: "Makes a deck in the person\u2019s account from a template, Tobos standard unless another is named, such as the person\u2019s own house style (ask which when they have several), with its first version, `rev`; or, as a template, a new template: a copy of all of the one it starts from.",
143
143
  input: {
144
144
  properties: {
145
145
  title: { type: "string", description: "The title of the talk." },
@@ -152,7 +152,7 @@ var VERBS = {
152
152
  cli: [
153
153
  {
154
154
  usage: 'tobos new "Title" [--from <id>] [--template] [--dir dir]',
155
- does: "a deck from a template (Tobos simple unless --from), or a template; pulled into ./<id> or dir (--no-pull: only made)"
155
+ does: "a deck from a template (Tobos standard unless --from), or a template; pulled into ./<id> or dir (--no-pull: only made)"
156
156
  }
157
157
  ]
158
158
  },
@@ -254,7 +254,7 @@ function settings() {
254
254
  }
255
255
 
256
256
  // src/api.ts
257
- var VERSION = true ? "0.4.33" : "dev";
257
+ var VERSION = true ? "0.4.35" : "dev";
258
258
  function newer(a, b) {
259
259
  const parse = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n) => parseInt(n)) : null;
260
260
  const x = parse(a);
@@ -1055,7 +1055,7 @@ async function check(out, args) {
1055
1055
  );
1056
1056
  const problems = [...written.problems];
1057
1057
  if (args.values.types) {
1058
- const { checkTypes } = await import("./types-EPPCS5WP.js");
1058
+ const { checkTypes } = await import("./types-ZEN3SASZ.js");
1059
1059
  problems.push(...await checkTypes(copy.root, (m) => out.note(m)));
1060
1060
  }
1061
1061
  const { errors, warnings } = problemSummary(problems);
@@ -1140,7 +1140,7 @@ async function openApp(out) {
1140
1140
  out.result({ url, opened }, () => url);
1141
1141
  }
1142
1142
  async function render(out, args) {
1143
- const { renderBeats } = await import("./render-W67XG7W4.js");
1143
+ const { renderBeats } = await import("./render-V7UKV2L7.js");
1144
1144
  const copy = findCopy();
1145
1145
  const deck = copy?.base ? { id: copy.base.deck, root: copy.root } : void 0;
1146
1146
  const id = typeof args.values.deck === "string" ? parseId(args.values.deck) : deck?.id;
@@ -6,7 +6,7 @@ import {
6
6
  init_define_TOBOS_PRESENT_TYPES,
7
7
  init_define_TOBOS_SKILL,
8
8
  init_define_TOBOS_TOOLCHAIN
9
- } from "./chunk-5LA45GOP.js";
9
+ } from "./chunk-6KO5UAPI.js";
10
10
 
11
11
  // src/render.ts
12
12
  init_define_TOBOS_PRESENT_TYPES();
@@ -3,7 +3,7 @@ import { createRequire as __tobosRequire } from 'node:module';
3
3
  const require = __tobosRequire(import.meta.url);
4
4
  import {
5
5
  parseDeckJson
6
- } from "./chunk-LBUZHZFX.js";
6
+ } from "./chunk-D4RKNNNF.js";
7
7
  import {
8
8
  CliError,
9
9
  __commonJS,
@@ -14,7 +14,7 @@ import {
14
14
  init_define_TOBOS_PRESENT_TYPES,
15
15
  init_define_TOBOS_SKILL,
16
16
  init_define_TOBOS_TOOLCHAIN
17
- } from "./chunk-5LA45GOP.js";
17
+ } from "./chunk-6KO5UAPI.js";
18
18
 
19
19
  // ../node_modules/.pnpm/aria-query@5.3.1/node_modules/aria-query/lib/util/iteratorProxy.js
20
20
  var require_iteratorProxy = __commonJS({
@@ -27226,6 +27226,11 @@ init_define_TOBOS_PRESENT_TYPES();
27226
27226
  init_define_TOBOS_SKILL();
27227
27227
  init_define_TOBOS_TOOLCHAIN();
27228
27228
 
27229
+ // ../deck/src/media-imports.ts
27230
+ init_define_TOBOS_PRESENT_TYPES();
27231
+ init_define_TOBOS_SKILL();
27232
+ init_define_TOBOS_TOOLCHAIN();
27233
+
27229
27234
  // ../deck/src/tree.ts
27230
27235
  init_define_TOBOS_PRESENT_TYPES();
27231
27236
  init_define_TOBOS_SKILL();
@@ -27234,13 +27239,6 @@ var encoder = new TextEncoder();
27234
27239
  var decoder = new TextDecoder();
27235
27240
 
27236
27241
  // ../deck/src/analyze.ts
27237
- var TS_VALUES = /* @__PURE__ */ new Set([
27238
- "TSAsExpression",
27239
- "TSSatisfiesExpression",
27240
- "TSNonNullExpression",
27241
- "TSInstantiationExpression"
27242
- ]);
27243
- var WRAPPERS = /* @__PURE__ */ new Set([...TS_VALUES, "ParenthesizedExpression"]);
27244
27242
  function* declarations(source2, start, end) {
27245
27243
  const starts = [...source2.matchAll(start)];
27246
27244
  let stop = -1;
@@ -27271,6 +27269,11 @@ init_define_TOBOS_PRESENT_TYPES();
27271
27269
  init_define_TOBOS_SKILL();
27272
27270
  init_define_TOBOS_TOOLCHAIN();
27273
27271
 
27272
+ // ../deck/src/media-pattern.ts
27273
+ init_define_TOBOS_PRESENT_TYPES();
27274
+ init_define_TOBOS_SKILL();
27275
+ init_define_TOBOS_TOOLCHAIN();
27276
+
27274
27277
  // ../deck/src/share.ts
27275
27278
  init_define_TOBOS_PRESENT_TYPES();
27276
27279
  init_define_TOBOS_SKILL();
@@ -27391,6 +27394,8 @@ function writeConfig(root) {
27391
27394
  paths
27392
27395
  },
27393
27396
  include: [
27397
+ // `$media` imports and `import.meta.glob`, as the build compiles them.
27398
+ "present/media.d.ts",
27394
27399
  "../../scenes/**/*",
27395
27400
  "../../master/**/*",
27396
27401
  "../../lib/**/*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tobos/cli",
3
- "version": "0.4.33",
3
+ "version": "0.4.35",
4
4
  "description": "The command line of Tobos: https://tobos.ai",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-ALv2",
@@ -1,185 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __tobosRequire } from 'node:module';
3
- const require = __tobosRequire(import.meta.url);
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __esm = (fn, res, err) => function __init() {
11
- if (err) throw err[0];
12
- try {
13
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
- } catch (e) {
15
- throw err = [e], e;
16
- }
17
- };
18
- var __commonJS = (cb, mod) => function __require() {
19
- try {
20
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
- } catch (e) {
22
- throw mod = 0, e;
23
- }
24
- };
25
- var __export = (target, all) => {
26
- for (var name in all)
27
- __defProp(target, name, { get: all[name], enumerable: true });
28
- };
29
- var __copyProps = (to, from, except, desc) => {
30
- if (from && typeof from === "object" || typeof from === "function") {
31
- for (let key of __getOwnPropNames(from))
32
- if (!__hasOwnProp.call(to, key) && key !== except)
33
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
- }
35
- return to;
36
- };
37
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
- // If the importer is in node compatibility mode or this is not an ESM
39
- // file that has been converted to a CommonJS file using a Babel-
40
- // compatible transform (i.e. "__esModule" has not been set), then set
41
- // "default" to the CommonJS "module.exports" for node compatibility.
42
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
- mod
44
- ));
45
-
46
- // <define:TOBOS_PRESENT_TYPES>
47
- var define_TOBOS_PRESENT_TYPES_default;
48
- var init_define_TOBOS_PRESENT_TYPES = __esm({
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", "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
- import { type JoinInfo } from './registry.ts';
52
- export { playAudio, playVideo, type PlayAudioOptions, type PlayVideoOptions } from './playback.ts';
53
- export { useResponses, type Responses } from './responses.svelte.ts';
54
- export type { Activity, ChoiceActivity, TextActivity, TextField } from '@tobos/deck/types';
55
- /** Finds elements inside the current scene only. */
56
- export type Query = (selector: string) => Element[];
57
- /** One click's worth of a scene: an ID, and the animation into it. */
58
- export interface Beat {
59
- id: string;
60
- /** Add the animation into this beat to the scene's timeline. */
61
- enter?: (tl: gsap.core.Timeline, q: Query) => unknown;
62
- }
63
- /** The props the engine passes to every scene. */
64
- export interface SceneProps {
65
- /** The current beat's ID. */
66
- beat: string;
67
- /** The current beat's index in the scene, from 0. */
68
- index: number;
69
- }
70
- /** Where a scene sits in the deck, for layouts that show it (a wayfinder, an agenda). */
71
- export interface DeckContext {
72
- title: string;
73
- chapters: {
74
- id: string;
75
- title: string;
76
- scenes: {
77
- id: string;
78
- title: string;
79
- }[];
80
- }[];
81
- chapter: {
82
- id: string;
83
- title: string;
84
- };
85
- scene: {
86
- id: string;
87
- title: string;
88
- };
89
- }
90
- export declare const DECK_CONTEXT = "tobos:deck";
91
- /** The deck, its chapters and the current scene. Call during component setup. */
92
- export declare function useDeck(): DeckContext;
93
- /** The URL of a file in the deck's media/ folder. The name must be a string literal. */
94
- export declare function media(name: string): string;
95
- export type { JoinInfo } from './registry.ts';
96
- /**
97
- * The deck's join code, for a scene to show its own way: the digits, the link as people type
98
- * it, the full URL, and the QR code as an image's address. Undefined while the deck has no
99
- * activity.
100
- */
101
- export declare function useJoin(): JoinInfo | undefined;
102
- export interface JoinCodeProps {
103
- /** The QR code's width and height, in stage pixels. */
104
- size?: number;
105
- }
106
- /**
107
- * The deck's join code: a QR code, and under it the link it holds, which phones open to answer
108
- * the deck's activities. The scene sizes it; the link takes the scene's font.
109
- */
110
- export declare const JoinCode: Component<JoinCodeProps>;
111
- ` };
112
- }
113
- });
114
-
115
- // <define:TOBOS_SKILL>
116
- var define_TOBOS_SKILL_default;
117
- var init_define_TOBOS_SKILL = __esm({
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 folder of files, one Svelte 5 file per scene, advancing one beat per click. You build it with the `tobos` command, which needs no git; Tobos checks every push, keeps every version, 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 ls` lists the decks and templates the person can work on, by id. `tobos pull <id>` gets one; `tobos new \"Title\"` starts one and pulls it.\n- A new deck starts from Tobos simple. The person's own templates, their house styles, are in `tobos ls`: 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 this machine isn't connected to the person's account. Run `tobos login`: it prints an address, which the person opens on any device, logs in at (a first login signs them up, and accepts https://tobos.ai/terms) and approves this machine. Give it to them in one line, then, once they did, run `tobos login` again. 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 goes when it empties, by a move or a deck's deletion: there is no removing one. A folder with only archived decks in it isn't empty.\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, in their own browser.\n- **Who is on a deck, and its link,** are the person's, on the deck's page: they put people on it, change what each may do, take them off, and turn the link on or off there. You neither see nor change any of it: `tobos ls` tells you only what you may do on each deck and whose it is. 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- **Each scene's notes,** what the speaker says, are the person's: they write them under the stage on the deck's page, and the presenter sees them. You neither read nor write them, and a scene needs none from you.\n- **The URL `tobos open` prints** is the deck's page, where the person watches it, presents it and shares it; `--presenter` gives a presenter's link instead, which opens once, for whoever opens it first.\n" };
120
- }
121
- });
122
-
123
- // <define:TOBOS_TOOLCHAIN>
124
- var define_TOBOS_TOOLCHAIN_default;
125
- var init_define_TOBOS_TOOLCHAIN = __esm({
126
- "<define:TOBOS_TOOLCHAIN>"() {
127
- define_TOBOS_TOOLCHAIN_default = { "svelte-check": "4.7.6", typescript: "6.0.3", svelte: "5.57.2", gsap: "3.15.0" };
128
- }
129
- });
130
-
131
- // src/out.ts
132
- init_define_TOBOS_PRESENT_TYPES();
133
- init_define_TOBOS_SKILL();
134
- init_define_TOBOS_TOOLCHAIN();
135
- var EXIT = { ok: 0, error: 1, problems: 2, auth: 3, conflict: 4, limit: 5 };
136
- var ASK_THE_PERSON = "This is for the person you work for to decide: show them the above, and wait for their answer. Don\u2019t work around it, for instance by building the deck outside Tobos.";
137
- var CliError = class extends Error {
138
- exit;
139
- extra;
140
- constructor(message, exit = EXIT.error, extra = {}) {
141
- super(message);
142
- this.exit = exit;
143
- this.extra = extra;
144
- }
145
- };
146
- var update;
147
- function offerUpdate(line) {
148
- update = line;
149
- }
150
- function createOutput(json) {
151
- return {
152
- json,
153
- note(message, always = false) {
154
- if (!json || always) process.stderr.write(`${message}
155
- `);
156
- },
157
- result(value, human) {
158
- if (json) process.stdout.write(`${JSON.stringify(update ? { ...value, update } : value)}
159
- `);
160
- else {
161
- const text = human();
162
- if (text) process.stdout.write(text.endsWith("\n") ? text : `${text}
163
- `);
164
- }
165
- }
166
- };
167
- }
168
-
169
- export {
170
- __commonJS,
171
- __export,
172
- __toESM,
173
- init_define_TOBOS_PRESENT_TYPES,
174
- define_TOBOS_PRESENT_TYPES_default,
175
- init_define_TOBOS_SKILL,
176
- define_TOBOS_SKILL_default,
177
- init_define_TOBOS_TOOLCHAIN,
178
- define_TOBOS_TOOLCHAIN_default,
179
- EXIT,
180
- ASK_THE_PERSON,
181
- CliError,
182
- update,
183
- offerUpdate,
184
- createOutput
185
- };