@tobos/cli 0.4.47 → 0.4.49

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.
@@ -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-KNDAUICC.js";
8
+ } from "./chunk-FAVJGDWJ.js";
9
9
 
10
10
  // ../deck/src/deck-json.ts
11
11
  init_define_TOBOS_PRESENT_TYPES();
@@ -0,0 +1,124 @@
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. A beat's loop\n * repeats on a timeline of its own, beside it, which this one never holds: seeking its labels\n * would reach none past a loop that runs for ever.\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 ranges;\n /** The ranges that are loops, which `loops` starts or stops. */\n private loopRanges;\n /** The beat shown, -1 before the first or off the stage. */\n private at;\n /**\n * Whether loops play, or each stays at its start. Off until a stage that plays them says so:\n * a page of the PDF never does.\n */\n private looping;\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 /** A beat's loop, repeating from its start each time the scene arrives in its range. */\n private addLoop;\n /** Play the loops, or keep each at its start: a still view, a render. Sound plays on as it was. */\n loops(on: boolean): void;\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, its loops stop. */\n leave(): void;\n /**\n * After a move to `beat` (-1: none), each range runs while the beat is in it, whichever way it\n * moved there, and stops outside it. `stepped`: a step forward, heard, played into the beat.\n */\n private move;\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}\n/** A scene's place in the outline: its id, which is its file's name, its title and whether it shows. */\nexport interface OutlineScene {\n id: string;\n title: string;\n /** Left out of presenting, the share link and its PDF; still on the deck's page. */\n hidden?: true;\n}\nexport interface OutlineChapter {\n id: string;\n title: string;\n scenes: OutlineScene[];\n}\n/**\n * A deck's outline: its title, and its scenes in order (ADR 0006). A deck has no chapters, or\n * every scene is in one, never a mix: with chapters, `chapters` and their scenes; with none, its\n * `scenes`. Data, held by Tobos, never a file of the deck; Tobos's own decks keep theirs in\n * `outline.json` in the codebase, in this shape.\n */\nexport type Outline = {\n title: string;\n chapters: OutlineChapter[];\n scenes?: never;\n} | {\n title: string;\n scenes: OutlineScene[];\n chapters?: never;\n};\n/** deck.json: what the deck's code needs, its packages. The outline isn't in it (ADR 0006). */\nexport interface DeckJson {\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 multiple-choice poll: each phone picks one option; its result shows 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/** An open-text poll: 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 * A poll: what a scene asks the room, who answer on their phones (the format's `activity`). It\n * is open while the deck is presented on its scene, up to its `reveals` beat.\n */\nexport type Activity = ChoiceActivity | TextActivity;\n/** A scene as the build has it: what its file is, whether or not the outline places it. */\nexport interface BuildScene {\n beats: string[];\n /** The scene's specifier in the import map. */\n module: string;\n activity?: Activity;\n}\nexport interface ManifestScene extends BuildScene {\n id: string;\n title: string;\n /** Left out of presenting, the share link and its PDF (the outline's `hidden`). */\n hidden?: true;\n}\nexport interface ManifestChapter {\n id: string;\n title: string;\n scenes: ManifestScene[];\n}\n/**\n * What a build makes of one revision of a deck, which the server stores with it: every scene file\n * by its id, placed or not, and what the viewer loads. The outline isn't part of it: it is joined\n * in when a manifest is read (joinOutline). Format 1's modules call the engine's media(); a later\n * one's import media (`import cow from '$media/cow.jpg'`), compiled into lookups of the same media\n * map. A revision keeps the format it was pushed with.\n */\nexport interface Build {\n format: 1 | 2;\n /** Each top-level `scenes/<id>.svelte` that exports beats, by its id. */\n scenes: Record<string, BuildScene>;\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 * and only what is on a slide must be on the server (share.ts). A manifest pushed before the build recorded it\n * had it written in afterwards, as its build then would have (TOB-397).\n */\n uses: Uses;\n}\n/**\n * A build stored before the outline left deck.json (ADR 0006): the scenes deck.json listed, in\n * its chapters, and its title, instead of `scenes`. Read as a build (buildScenes), its outline\n * being the deck's now.\n */\nexport type LegacyBuild = Omit<Build, 'scenes'> & {\n title: string;\n chapters: ManifestChapter[];\n};\n/** A build as the server may have stored it: from now on, or from before ADR 0006. */\nexport type StoredBuild = Build | LegacyBuild;\n/**\n * What the viewer needs to show one revision of a deck: its build, with the deck's outline as it\n * is now joined in (joinOutline). Only the scenes both have are in it. A deck with no chapters has\n * its scenes in one chapter with an empty id and title, which nothing names on a slide.\n */\nexport type Manifest = Omit<Build, 'scenes'> & {\n title: string;\n chapters: ManifestChapter[];\n};\n/** A manifest as a share link has it: what its modules use isn't part of it (share.ts). */\nexport type SharedManifest = Omit<Manifest, 'uses'>;\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 session 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 session, 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 { SharedManifest } from '@tobos/deck/types';\nimport type { Results } from './activities.ts';\n/** One activity's responses in the current session. */\nexport interface Responses {\n /**\n * The most phones that had the deck's join link open at once during this session, and never fewer\n * than answered.\n */\n readonly joined: number;\n /** People who have answered this activity during this session. */\n readonly answered: number;\n /** Multiple choice's responses per option, in the order the scene declares them; else 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: SharedManifest): void;\n/** The current session'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 session: 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';\nimport { type JoinInfo } from './registry.ts';\nexport { playAudio, playVideo, type PlayAudioOptions, type PlayVideoOptions } from './playback.ts';\nexport { useResponses, type Responses } from './responses.svelte.ts';\nexport type { Activity, ChoiceActivity, TextActivity, TextField } from '@tobos/deck/types';\n/** Finds elements inside the current scene only. */\nexport type Query = (selector: string) => Element[];\n/** One click's worth of a scene: an ID, and the animation into it. */\nexport interface Beat {\n id: string;\n /** Add the animation into this beat to the scene's timeline. */\n enter?: (tl: gsap.core.Timeline, q: Query) => unknown;\n /**\n * Add one round of an animation that repeats while the scene is at this beat, and on through\n * the beats after it up to `until`. Each arrival in that range, by any move, plays it from its\n * start; leaving the range puts it back there, which is also what a still view, a render and a\n * PDF show. End it as it starts, so a round follows the last without a jump.\n */\n loop?: (tl: gsap.core.Timeline, q: Query) => unknown;\n /** With `loop`: the later beat of this scene it stops at. Default: it repeats to the scene's end. */\n until?: string;\n}\n/** The props the engine passes to every scene. */\nexport interface SceneProps {\n /** The current beat's ID. */\n beat: string;\n /** The current beat's index in the scene, from 0. */\n index: number;\n}\n/** Where a scene sits in the deck, for layouts that show it (a wayfinder, an agenda). */\nexport interface DeckContext {\n title: string;\n chapters: {\n id: string;\n title: string;\n scenes: {\n id: string;\n title: string;\n }[];\n }[];\n chapter: {\n id: string;\n title: string;\n };\n scene: {\n id: string;\n title: string;\n };\n}\nexport declare const DECK_CONTEXT = \"tobos:deck\";\n/** The deck, its chapters and the current scene. Call during component setup. */\nexport declare function useDeck(): DeckContext;\nexport type { JoinInfo } from './registry.ts';\n/**\n * The deck's join code, for a scene to show its own way: the digits, the link as people type\n * it, the full URL, and the QR code as an image's address. Undefined while the deck has no\n * activity.\n */\nexport declare function useJoin(): JoinInfo | undefined;\nexport interface JoinCodeProps {\n /** The QR code's width and height, in stage pixels. */\n size?: number;\n}\n/**\n * The deck's join code: a QR code, and under it the link it holds, which phones open to answer\n * the deck's activities. The scene sizes it; the link takes the scene's font.\n */\nexport declare const JoinCode: Component<JoinCodeProps>;\n", "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" };
51
+ }
52
+ });
53
+
54
+ // <define:TOBOS_SKILL>
55
+ var define_TOBOS_SKILL_default;
56
+ var init_define_TOBOS_SKILL = __esm({
57
+ "<define:TOBOS_SKILL>"() {
58
+ 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 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's design. The person's own house styles are decks in `tobos ls`: start from one with `--from <id>`, which copies its master, 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 deck's outline, its chapters and scenes in order, their titles and which are hidden, isn't a file: Tobos holds it, and `tobos outline` shows and changes it, live at once. A new scene's file shows nowhere until `tobos outline place <scene>` puts it in. deck.json lists only the npm packages.\n- A deck has no chapters, or every scene is in one. Its first chapter, `tobos outline chapter add <id> \"Title\"`, takes every scene; add the others after it, and move scenes in. Make a chapter's id six random lowercase letters and digits, starting with a letter (`k7gh02`): its title is what the slides show. `tobos outline chapter remove --all` takes every chapter out, the scenes staying in order.\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- Make a folder with `tobos mkdir /path` (or a move into a path that isn't there), and rename one in place with `tobos mv /path --name New`. A folder stays when it empties.\n- Deleting a folder or a deck is the person's, on the web: you never delete one. An empty folder they no longer want, tell them about, and leave it.\n- A deck shared with the person can have one shortcut in their folders: `tobos mv` of it places that shortcut, or moves it, and `tobos ls /path` marks it as one, with its owner. The deck stays its owner's. Leaving a deck shared with them, and deleting a shortcut, are the person's, on the web.\n- A deck or folder the person deleted waits in their trash for 30 days, and is gone to you meanwhile: `tobos ls` doesn't list it, and naming it answers that it isn't there. Only the person restores it, from the trash on the web.\n\n## What stays the person's\n\n- **Exit code 5** is a 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 starts decks from its design, and can view sees the slides.\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. Presenting starts there alone: no link you can get presents the deck.\n" };
59
+ }
60
+ });
61
+
62
+ // <define:TOBOS_TOOLCHAIN>
63
+ var define_TOBOS_TOOLCHAIN_default;
64
+ var init_define_TOBOS_TOOLCHAIN = __esm({
65
+ "<define:TOBOS_TOOLCHAIN>"() {
66
+ define_TOBOS_TOOLCHAIN_default = { "svelte-check": "4.7.6", typescript: "6.0.3", svelte: "5.57.2", gsap: "3.15.0" };
67
+ }
68
+ });
69
+
70
+ // src/out.ts
71
+ init_define_TOBOS_PRESENT_TYPES();
72
+ init_define_TOBOS_SKILL();
73
+ init_define_TOBOS_TOOLCHAIN();
74
+ var EXIT = { ok: 0, error: 1, problems: 2, auth: 3, conflict: 4, limit: 5 };
75
+ 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.";
76
+ var CliError = class extends Error {
77
+ exit;
78
+ extra;
79
+ constructor(message, exit = EXIT.error, extra = {}) {
80
+ super(message);
81
+ this.exit = exit;
82
+ this.extra = extra;
83
+ }
84
+ };
85
+ var update;
86
+ function offerUpdate(line) {
87
+ update = line;
88
+ }
89
+ function createOutput(json) {
90
+ return {
91
+ json,
92
+ note(message, always = false) {
93
+ if (!json || always) process.stderr.write(`${message}
94
+ `);
95
+ },
96
+ result(value, human) {
97
+ if (json) process.stdout.write(`${JSON.stringify(update ? { ...value, update } : value)}
98
+ `);
99
+ else {
100
+ const text = human();
101
+ if (text) process.stdout.write(text.endsWith("\n") ? text : `${text}
102
+ `);
103
+ }
104
+ }
105
+ };
106
+ }
107
+
108
+ export {
109
+ __commonJS,
110
+ __export,
111
+ __toESM,
112
+ init_define_TOBOS_PRESENT_TYPES,
113
+ define_TOBOS_PRESENT_TYPES_default,
114
+ init_define_TOBOS_SKILL,
115
+ define_TOBOS_SKILL_default,
116
+ init_define_TOBOS_TOOLCHAIN,
117
+ define_TOBOS_TOOLCHAIN_default,
118
+ EXIT,
119
+ ASK_THE_PERSON,
120
+ CliError,
121
+ update,
122
+ offerUpdate,
123
+ createOutput
124
+ };
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  mergeText,
8
8
  parseMediaJson,
9
9
  unpackTar
10
- } from "./chunk-TIEXYQJA.js";
10
+ } from "./chunk-CEQVVOY7.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-KNDAUICC.js";
22
+ } from "./chunk-FAVJGDWJ.js";
23
23
 
24
24
  // src/main.ts
25
25
  init_define_TOBOS_PRESENT_TYPES();
@@ -90,7 +90,7 @@ var CHANGESET_SCHEMA = {
90
90
  };
91
91
  var VERBS = {
92
92
  list: {
93
- does: "The decks the person works on, by id: their own, and those shared with them that they may present or change. Each with its title, your level on it and whose it is, whether it is archived (read-only), when it last changed, its address in Tobos, and, for the person\u2019s own, its folder. With a path, what that folder holds: its folders, then its decks.",
93
+ does: "The decks the person works on, by id: their own, and those shared with them that they may present or change. Each with its title, your level on it and whose it is, whether it is archived (read-only), when it last changed, its address in Tobos, and, for the person\u2019s own, its folder. With a path, what that folder holds: its folders, then its decks, a shortcut to a deck shared with the person marked as one, with its owner.",
94
94
  input: { properties: { path: { type: "string", description: FOLDER_PATH } }, required: [] },
95
95
  cli: [
96
96
  {
@@ -172,7 +172,7 @@ var VERBS = {
172
172
  ]
173
173
  },
174
174
  move: {
175
- does: "Moves the person\u2019s decks, a deck by its id or title, and folders, by path, with all that is in them, into a folder, made with the folders on its path if there are none. With `name`, renames one folder where it is instead; with nothing to move, makes the folder at `to`. A folder stays when a move empties it: only the person deletes one. Refused, with nothing changed, if one isn\u2019t there, if a title is two decks\u2019 (name that one by its id), if the folder has one of a moved folder\u2019s name already, if a folder would go into itself, or if a folder to make or a new name is there already.",
175
+ does: "Moves the person\u2019s decks, a deck by its id or title, and folders, by path, with all that is in them, into a folder, made with the folders on its path if there are none. A deck shared with the person moves as its one shortcut in their folders, made by its first move; the deck stays its owner\u2019s, where they keep it. With `name`, renames one folder where it is instead; with nothing to move, makes the folder at `to`. A folder stays when a move empties it: only the person deletes one, on the web. Refused, with nothing changed, if one isn\u2019t there, if a title is two decks\u2019 (name that one by its id), if the folder has one of a moved folder\u2019s name already, if a folder would go into itself, or if a folder to make or a new name is there already.",
176
176
  input: {
177
177
  properties: {
178
178
  decks: {
@@ -278,7 +278,7 @@ function settings() {
278
278
  }
279
279
 
280
280
  // src/api.ts
281
- var VERSION = true ? "0.4.47" : "dev";
281
+ var VERSION = true ? "0.4.49" : "dev";
282
282
  function newer(a, b) {
283
283
  const parse = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n) => parseInt(n)) : null;
284
284
  const x = parse(a);
@@ -747,8 +747,10 @@ The outline (below) changes with \`tobos outline\`, live at once, with no push:
747
747
  prints it and the scene files it doesn't place; \`place <scene> --after <scene>\` (or
748
748
  \`--before <scene>\`, \`--chapter <id> [--start]\`, \`--title "\u2026"\`), \`move <scene>\u2026 --after
749
749
  <scene>\`, \`hide\` and \`show <scene>\u2026\`, \`rename <scene> "Title"\`, \`remove <scene>\u2026\`, \`title
750
- "\u2026"\`, and \`chapter add|rename|move|remove\`. \`tobos pull\` says what changed in it on the deck's
751
- page since. Exit code 4 means it changed meanwhile: \`tobos outline\`, then again.
750
+ "\u2026"\`, and \`chapter add|rename|move|remove\`. A deck has no chapters or every scene in one: its
751
+ first chapter, \`chapter add\`, takes every scene, and \`chapter remove --all\` takes every chapter
752
+ out. \`tobos pull\` says what changed in it on the deck's page since. Exit code 4 means it changed
753
+ meanwhile: \`tobos outline\`, then again.
752
754
 
753
755
  \`.tobos/\` holds this file and the version the copy is of: leave it be. A push leaves out what
754
756
  is in \`.tobos/\`, \`.git/\`, \`sources/\` and \`node_modules/\` at the copy's top.
@@ -976,7 +978,9 @@ async function ls(out, args) {
976
978
  );
977
979
  out.result(
978
980
  listed,
979
- () => listed.entries.length === 0 ? `${listed.path} is empty.` : listed.entries.map((e) => e.kind === "folder" ? `${e.name}/` : `${e.id} ${e.title}`).join("\n")
981
+ () => listed.entries.length === 0 ? `${listed.path} is empty.` : listed.entries.map(
982
+ (e) => e.kind === "folder" ? `${e.name}/` : `${e.id} ${e.title}${e.shortcut ? ` (a shortcut: ${e.owner}'s deck)` : ""}`
983
+ ).join("\n")
980
984
  );
981
985
  return;
982
986
  }
@@ -1149,7 +1153,7 @@ async function check(out, args) {
1149
1153
  );
1150
1154
  const problems = [...written.problems];
1151
1155
  if (args.values.types) {
1152
- const { checkTypes } = await import("./types-2BLKEROB.js");
1156
+ const { checkTypes } = await import("./types-7TCIR6PZ.js");
1153
1157
  problems.push(...await checkTypes(copy.root, (m) => out.note(m)));
1154
1158
  }
1155
1159
  const { errors, warnings } = problemSummary(problems);
@@ -1220,15 +1224,15 @@ async function pushIfChanged(out, id, message) {
1220
1224
  }
1221
1225
  function saidOutline(outline2) {
1222
1226
  let n = 0;
1223
- const width = Math.max(0, ...outline2.chapters.flatMap((c) => c.scenes.map((s) => s.id.length)));
1227
+ const all = outline2.scenes ?? (outline2.chapters ?? []).flatMap((c) => c.scenes);
1228
+ const width = Math.max(0, ...all.map((s) => s.id.length));
1229
+ const scene = (s, indent) => `${indent}${String(++n).padStart(3)} ${s.id.padEnd(width)} ${s.title}${s.hidden ? " (hidden)" : ""}`;
1224
1230
  return [
1225
1231
  `${outline2.title} (outline version ${outline2.version})`,
1226
- ...outline2.chapters.flatMap((c) => [
1232
+ ...outline2.scenes ? [" No chapters", ...outline2.scenes.map((s) => scene(s, " "))] : (outline2.chapters ?? []).flatMap((c) => [
1227
1233
  ` ${c.title} [${c.id}]`,
1228
1234
  ...c.scenes.length ? [] : [" (no scenes)"],
1229
- ...c.scenes.map(
1230
- (s) => ` ${String(++n).padStart(3)} ${s.id.padEnd(width)} ${s.title}${s.hidden ? " (hidden)" : ""}`
1231
- )
1235
+ ...c.scenes.map((s) => scene(s, " "))
1232
1236
  ]),
1233
1237
  outline2.unplaced.length ? `Not placed, so not shown (\`tobos outline place <scene>\`): ${outline2.unplaced.join(", ")}` : ""
1234
1238
  ].filter(Boolean).join("\n");
@@ -1241,6 +1245,7 @@ function placeFrom(args) {
1241
1245
  if (typeof after === "string") return { after };
1242
1246
  if (typeof before === "string") return { before };
1243
1247
  if (typeof chapter === "string") return { chapter, at: start ? "start" : "end" };
1248
+ if (start) return { at: "start" };
1244
1249
  return void 0;
1245
1250
  }
1246
1251
  function opsFrom(args) {
@@ -1286,9 +1291,10 @@ function opsFrom(args) {
1286
1291
  if (verb === "rename" && id && words.length)
1287
1292
  return [{ op: "renameChapter", chapter: id, title: words.join(" ") }];
1288
1293
  if (verb === "move" && id) return [{ op: "moveChapter", chapter: id, before }];
1294
+ if (verb === "remove" && args.values.all && !id) return [{ op: "removeChapters" }];
1289
1295
  if (verb === "remove" && id) return [{ op: "removeChapter", chapter: id }];
1290
1296
  throw new CliError(
1291
- '`tobos outline chapter add <id> "Title" [--before c]`, `chapter rename <id> "Title"`, `chapter move <id> [--before c]` (last without), or `chapter remove <id>` (an empty one).'
1297
+ '`tobos outline chapter add <id> "Title" [--before c]`, `chapter rename <id> "Title"`, `chapter move <id> [--before c]` (last without), `chapter remove <id>` (an empty one), or `chapter remove --all` (every chapter, the scenes staying in order).'
1292
1298
  );
1293
1299
  }
1294
1300
  default:
@@ -1309,13 +1315,14 @@ async function outline(out, args) {
1309
1315
  }
1310
1316
  const ops = opsFrom(args);
1311
1317
  for (const op of ops) {
1318
+ if (op.op === "addChapter" && !(await now()).chapters?.length) {
1319
+ if (op.before)
1320
+ throw new CliError("This deck has no chapters: its first goes without --before.");
1321
+ op.scenes = "all";
1322
+ }
1312
1323
  if (!("to" in op) || op.to !== void 0) continue;
1313
- const last = (await now()).chapters.at(-1);
1314
- if (!last)
1315
- throw new CliError(
1316
- 'The outline has no chapter: `tobos outline chapter add <id> "Title"` makes one.'
1317
- );
1318
- op.to = { chapter: last.id, at: "end" };
1324
+ const last = (await now()).chapters?.at(-1);
1325
+ op.to = last ? { chapter: last.id, at: "end" } : { at: "end" };
1319
1326
  }
1320
1327
  const written = await api(`/api/decks/${id}/files`, {
1321
1328
  server,
@@ -1354,7 +1361,7 @@ async function openApp(out) {
1354
1361
  out.result({ url, opened }, () => url);
1355
1362
  }
1356
1363
  async function render(out, args) {
1357
- const { renderBeats } = await import("./render-5CD43LFN.js");
1364
+ const { renderBeats } = await import("./render-UNQZU7KB.js");
1358
1365
  const copy = findCopy();
1359
1366
  const deck = copy?.base ? { id: copy.base.deck, root: copy.root } : void 0;
1360
1367
  const id = typeof args.values.deck === "string" ? parseId(args.values.deck) : deck?.id;
@@ -1451,15 +1458,17 @@ The outline's operations (its chapters and scenes in order, their titles and whe
1451
1458
  Tobos holds it, no file of the copy; each change is live at once, with no push; a scene by its
1452
1459
  file's name, scenes/<scene>.svelte, which shows nowhere until it is placed)
1453
1460
  tobos outline place <scene>\u2026 into the outline: --after <scene>, --before <scene>,
1454
- [--title "T"] [--hidden] --chapter <id> [--start], or at the end
1461
+ [--title "T"] [--hidden] --chapter <id> [--start], --start, or at the end
1455
1462
  tobos outline move <scene>\u2026 (where) where as for place
1456
1463
  tobos outline hide | show <scene>\u2026 left out of presenting, the link and the PDF, or not
1457
1464
  tobos outline rename <scene> "Title" the title the deck's page and Agenda show
1458
1465
  tobos outline remove <scene>\u2026 out of the outline; its file stays
1459
1466
  tobos outline title "Title" the deck's title
1460
- tobos outline chapter add <id> "Title" a chapter, [--before <id>], or last
1467
+ tobos outline chapter add <id> "Title" a chapter, [--before <id>], or last; a deck's
1468
+ first takes every scene (no chapters, or all in one)
1461
1469
  tobos outline chapter rename|move|remove a chapter's title; its place [--before <id>]; an
1462
1470
  empty one, out
1471
+ tobos outline chapter remove --all every chapter out, the scenes staying in order
1463
1472
 
1464
1473
  Looking at it (from the working copy, render and open push what changed first; with --deck <id>,
1465
1474
  from anywhere)
@@ -1511,7 +1520,8 @@ var TABLE = {
1511
1520
  chapter: { type: "string" },
1512
1521
  start: { type: "boolean" },
1513
1522
  title: { type: "string" },
1514
- hidden: { type: "boolean" }
1523
+ hidden: { type: "boolean" },
1524
+ all: { type: "boolean" }
1515
1525
  }
1516
1526
  },
1517
1527
  check: { run: check, options: { types: { type: "boolean" } } },
@@ -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-KNDAUICC.js";
9
+ } from "./chunk-FAVJGDWJ.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-TIEXYQJA.js";
6
+ } from "./chunk-CEQVVOY7.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-KNDAUICC.js";
17
+ } from "./chunk-FAVJGDWJ.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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tobos/cli",
3
- "version": "0.4.47",
3
+ "version": "0.4.49",
4
4
  "description": "The command line of Tobos: https://tobos.ai",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-ALv2",
@@ -1,124 +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": "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. A beat's loop\n * repeats on a timeline of its own, beside it, which this one never holds: seeking its labels\n * would reach none past a loop that runs for ever.\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 ranges;\n /** The ranges that are loops, which `loops` starts or stops. */\n private loopRanges;\n /** The beat shown, -1 before the first or off the stage. */\n private at;\n /**\n * Whether loops play, or each stays at its start. Off until a stage that plays them says so:\n * a page of the PDF never does.\n */\n private looping;\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 /** A beat's loop, repeating from its start each time the scene arrives in its range. */\n private addLoop;\n /** Play the loops, or keep each at its start: a still view, a render. Sound plays on as it was. */\n loops(on: boolean): void;\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, its loops stop. */\n leave(): void;\n /**\n * After a move to `beat` (-1: none), each range runs while the beat is in it, whichever way it\n * moved there, and stops outside it. `stepped`: a step forward, heard, played into the beat.\n */\n private move;\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}\n/** A scene's place in the outline: its id, which is its file's name, its title and whether it shows. */\nexport interface OutlineScene {\n id: string;\n title: string;\n /** Left out of presenting, the share link and its PDF; still on the deck's page. */\n hidden?: true;\n}\nexport interface OutlineChapter {\n id: string;\n title: string;\n scenes: OutlineScene[];\n}\n/**\n * A deck's outline: its title, and its chapters and their scenes in order (ADR 0006). Data, held\n * by Tobos, never a file of the deck; Tobos's own decks keep theirs in `outline.json` in the\n * codebase, in this shape.\n */\nexport interface Outline {\n title: string;\n chapters: OutlineChapter[];\n}\n/** deck.json: what the deck's code needs, its packages. The outline isn't in it (ADR 0006). */\nexport interface DeckJson {\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 multiple-choice poll: each phone picks one option; its result shows 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/** An open-text poll: 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 * A poll: what a scene asks the room, who answer on their phones (the format's `activity`). It\n * is open while the deck is presented on its scene, up to its `reveals` beat.\n */\nexport type Activity = ChoiceActivity | TextActivity;\n/** A scene as the build has it: what its file is, whether or not the outline places it. */\nexport interface BuildScene {\n beats: string[];\n /** The scene's specifier in the import map. */\n module: string;\n activity?: Activity;\n}\nexport interface ManifestScene extends BuildScene {\n id: string;\n title: string;\n /** Left out of presenting, the share link and its PDF (the outline's `hidden`). */\n hidden?: true;\n}\nexport interface ManifestChapter {\n id: string;\n title: string;\n scenes: ManifestScene[];\n}\n/**\n * What a build makes of one revision of a deck, which the server stores with it: every scene file\n * by its id, placed or not, and what the viewer loads. The outline isn't part of it: it is joined\n * in when a manifest is read (joinOutline). Format 1's modules call the engine's media(); a later\n * one's import media (`import cow from '$media/cow.jpg'`), compiled into lookups of the same media\n * map. A revision keeps the format it was pushed with.\n */\nexport interface Build {\n format: 1 | 2;\n /** Each top-level `scenes/<id>.svelte` that exports beats, by its id. */\n scenes: Record<string, BuildScene>;\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 * and only what is on a slide must be on the server (share.ts). A manifest pushed before the build recorded it\n * had it written in afterwards, as its build then would have (TOB-397).\n */\n uses: Uses;\n}\n/**\n * A build stored before the outline left deck.json (ADR 0006): the scenes deck.json listed, in\n * its chapters, and its title, instead of `scenes`. Read as a build (buildScenes), its outline\n * being the deck's now.\n */\nexport type LegacyBuild = Omit<Build, 'scenes'> & {\n title: string;\n chapters: ManifestChapter[];\n};\n/** A build as the server may have stored it: from now on, or from before ADR 0006. */\nexport type StoredBuild = Build | LegacyBuild;\n/**\n * What the viewer needs to show one revision of a deck: its build, with the deck's outline as it\n * is now joined in (joinOutline). Only the scenes both have are in it.\n */\nexport type Manifest = Omit<Build, 'scenes'> & {\n title: string;\n chapters: ManifestChapter[];\n};\n/** A manifest as a share link has it: what its modules use isn't part of it (share.ts). */\nexport type SharedManifest = Omit<Manifest, 'uses'>;\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 session 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 session, 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 { SharedManifest } from '@tobos/deck/types';\nimport type { Results } from './activities.ts';\n/** One activity's responses in the current session. */\nexport interface Responses {\n /**\n * The most phones that had the deck's join link open at once during this session, and never fewer\n * than answered.\n */\n readonly joined: number;\n /** People who have answered this activity during this session. */\n readonly answered: number;\n /** Multiple choice's responses per option, in the order the scene declares them; else 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: SharedManifest): void;\n/** The current session'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 session: 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';\nimport { type JoinInfo } from './registry.ts';\nexport { playAudio, playVideo, type PlayAudioOptions, type PlayVideoOptions } from './playback.ts';\nexport { useResponses, type Responses } from './responses.svelte.ts';\nexport type { Activity, ChoiceActivity, TextActivity, TextField } from '@tobos/deck/types';\n/** Finds elements inside the current scene only. */\nexport type Query = (selector: string) => Element[];\n/** One click's worth of a scene: an ID, and the animation into it. */\nexport interface Beat {\n id: string;\n /** Add the animation into this beat to the scene's timeline. */\n enter?: (tl: gsap.core.Timeline, q: Query) => unknown;\n /**\n * Add one round of an animation that repeats while the scene is at this beat, and on through\n * the beats after it up to `until`. Each arrival in that range, by any move, plays it from its\n * start; leaving the range puts it back there, which is also what a still view, a render and a\n * PDF show. End it as it starts, so a round follows the last without a jump.\n */\n loop?: (tl: gsap.core.Timeline, q: Query) => unknown;\n /** With `loop`: the later beat of this scene it stops at. Default: it repeats to the scene's end. */\n until?: string;\n}\n/** The props the engine passes to every scene. */\nexport interface SceneProps {\n /** The current beat's ID. */\n beat: string;\n /** The current beat's index in the scene, from 0. */\n index: number;\n}\n/** Where a scene sits in the deck, for layouts that show it (a wayfinder, an agenda). */\nexport interface DeckContext {\n title: string;\n chapters: {\n id: string;\n title: string;\n scenes: {\n id: string;\n title: string;\n }[];\n }[];\n chapter: {\n id: string;\n title: string;\n };\n scene: {\n id: string;\n title: string;\n };\n}\nexport declare const DECK_CONTEXT = \"tobos:deck\";\n/** The deck, its chapters and the current scene. Call during component setup. */\nexport declare function useDeck(): DeckContext;\nexport type { JoinInfo } from './registry.ts';\n/**\n * The deck's join code, for a scene to show its own way: the digits, the link as people type\n * it, the full URL, and the QR code as an image's address. Undefined while the deck has no\n * activity.\n */\nexport declare function useJoin(): JoinInfo | undefined;\nexport interface JoinCodeProps {\n /** The QR code's width and height, in stage pixels. */\n size?: number;\n}\n/**\n * The deck's join code: a QR code, and under it the link it holds, which phones open to answer\n * the deck's activities. The scene sizes it; the link takes the scene's font.\n */\nexport declare const JoinCode: Component<JoinCodeProps>;\n", "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" };
51
- }
52
- });
53
-
54
- // <define:TOBOS_SKILL>
55
- var define_TOBOS_SKILL_default;
56
- var init_define_TOBOS_SKILL = __esm({
57
- "<define:TOBOS_SKILL>"() {
58
- 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 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's design. The person's own house styles are decks in `tobos ls`: start from one with `--from <id>`, which copies its master, 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 deck's outline, its chapters and scenes in order, their titles and which are hidden, isn't a file: Tobos holds it, and `tobos outline` shows and changes it, live at once. A new scene's file shows nowhere until `tobos outline place <scene>` puts it in. deck.json lists only the npm packages.\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- Make a folder with `tobos mkdir /path` (or a move into a path that isn't there), and rename one in place with `tobos mv /path --name New`. A folder stays when it empties.\n- Deleting a folder or a deck is the person's: you never delete one. An empty folder they no longer want, tell them about, and leave it.\n\n## What stays the person's\n\n- **Exit code 5** is a 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 starts decks from its design, and can view sees the slides.\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. Presenting starts there alone: no link you can get presents the deck.\n" };
59
- }
60
- });
61
-
62
- // <define:TOBOS_TOOLCHAIN>
63
- var define_TOBOS_TOOLCHAIN_default;
64
- var init_define_TOBOS_TOOLCHAIN = __esm({
65
- "<define:TOBOS_TOOLCHAIN>"() {
66
- define_TOBOS_TOOLCHAIN_default = { "svelte-check": "4.7.6", typescript: "6.0.3", svelte: "5.57.2", gsap: "3.15.0" };
67
- }
68
- });
69
-
70
- // src/out.ts
71
- init_define_TOBOS_PRESENT_TYPES();
72
- init_define_TOBOS_SKILL();
73
- init_define_TOBOS_TOOLCHAIN();
74
- var EXIT = { ok: 0, error: 1, problems: 2, auth: 3, conflict: 4, limit: 5 };
75
- 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.";
76
- var CliError = class extends Error {
77
- exit;
78
- extra;
79
- constructor(message, exit = EXIT.error, extra = {}) {
80
- super(message);
81
- this.exit = exit;
82
- this.extra = extra;
83
- }
84
- };
85
- var update;
86
- function offerUpdate(line) {
87
- update = line;
88
- }
89
- function createOutput(json) {
90
- return {
91
- json,
92
- note(message, always = false) {
93
- if (!json || always) process.stderr.write(`${message}
94
- `);
95
- },
96
- result(value, human) {
97
- if (json) process.stdout.write(`${JSON.stringify(update ? { ...value, update } : value)}
98
- `);
99
- else {
100
- const text = human();
101
- if (text) process.stdout.write(text.endsWith("\n") ? text : `${text}
102
- `);
103
- }
104
- }
105
- };
106
- }
107
-
108
- export {
109
- __commonJS,
110
- __export,
111
- __toESM,
112
- init_define_TOBOS_PRESENT_TYPES,
113
- define_TOBOS_PRESENT_TYPES_default,
114
- init_define_TOBOS_SKILL,
115
- define_TOBOS_SKILL_default,
116
- init_define_TOBOS_TOOLCHAIN,
117
- define_TOBOS_TOOLCHAIN_default,
118
- EXIT,
119
- ASK_THE_PERSON,
120
- CliError,
121
- update,
122
- offerUpdate,
123
- createOutput
124
- };