@tobos/cli 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tobos.js +25 -36
- package/package.json +1 -1
package/dist/tobos.js
CHANGED
|
@@ -116,7 +116,7 @@ export declare const JoinCode: Component<JoinCodeProps>;
|
|
|
116
116
|
var define_TOBOS_SKILL_default;
|
|
117
117
|
var init_define_TOBOS_SKILL = __esm({
|
|
118
118
|
"<define:TOBOS_SKILL>"() {
|
|
119
|
-
define_TOBOS_SKILL_default = { "SKILL.md": "---\nname: tobos-present\ndescription: Build presentations as code with Tobos Present. Use when the user wants a talk, lecture, pitch or slide deck made, changed, rendered, presented or exported as a PDF, or mentions Tobos or `tobos`.\n---\n\n<!-- Installed by the `tobos` CLI and overwritten when it updates, so changes made here don't last. -->\n\n# Tobos Present\n\nTobos hosts presentations that you write as code: one Svelte 5 file per scene, with beats (one click each) and GSAP animations. You build; Tobos checks every push, hosts the deck, and puts it on stage with a presenter view. There is no AI on Tobos's side, and no MCP server in a harness: everything goes through the `tobos` command and git.\n\n## Set up (once per machine)\n\n```sh\nnpm i -g @tobos/cli # the `tobos` command; needs Node 22.18+ and git\ntobos login you@example.com # e-mails the person a 6-digit code (and signs them up if new)\ntobos login --code 123456 # the code they paste to you from the mail\n```\n\nAsk the person for their e-mail address first, then for the code in one line: it's in their e-mail, maybe in spam, and using it accepts https://tobos.ai/terms. Only they can read it; never guess or reuse one. It works for 10 minutes. In CI or a sandbox with no login, set `TOBOS_TOKEN` to the token `tobos login` stored (and `TOBOS_SERVER`, if not tobos.ai) instead.\n\n## Start or continue a deck\n\n```sh\ntobos decks # the decks you can work on, by id\ntobos new \"Title of the talk\" # create one and clone it into ./<id>\ntobos clone <id> # or clone an existing one\ntobos pull # in a clone: the latest pushes and format guide\n```\n\nThen **read the deck's `AGENTS.md`**. It, `.tobos/FORMAT.md` and `master/GUIDE.md` are the instructions for everything that follows: the loop (`check` \u2192 `render` \u2192 look \u2192 `push`), the format, the slide master's layouts and rules.\n\n## Follow the person\n\nThey decide what to make and how much you do: some build a deck one scene at a time, some want all of it at once. Do what they ask, at the size they ask. Don't ask what a talk is about, who it's for or how long it runs, and don't propose an outline they didn't ask for.\n\n## Polls and forms\n\nA scene can ask the room a poll or a short form, which people answer on their phones through the deck's join code: `<JoinCode/>` shows its QR code, and the poll's result shows on the projector at a beat you choose. See \"Activities\" in the deck's `.tobos/FORMAT.md`. The responses download from the deck's page as a CSV per show (one class or talk): a row per phone, a column per question.\n\n## The story\n\nA deck has one story: the talk as the speaker tells it, paragraph by paragraph, with scenes mentioned as Markdown links, `[Dartmouth College](scene:same-problem)`, or one of their beats, `[Dartmouth College](scene:same-problem/quote)` (the ids from deck.json; the label is the scene's title). What follows a mention, up to the next, is that scene's: the deck's page shows it under the stage, and the presenter sees it as speaker notes. The server holds it, not git, so there is no file to edit: the person types in it live on the deck's page, and you change it with `tobos story`, which reads and writes it on the server.\n\n- `tobos story` prints it with a \xB6 id per paragraph (`p4`). Read it again before each change: the person may be typing.\n- Your changes apply at once, as the person's do, and the deck's page marks what you wrote. Change what the person asked you to, and leave the rest of their words as they are.\n- An edit is anchored on the exact text it replaces, which has to occur once in the paragraph. If someone changed it meanwhile, the command exits with code 4 and the paragraph as it is now: anchor on that and try again.\n- Set `TOBOS_AGENT` to your name (`claude`, `codex`): the page shows who wrote what.\n\n## Commands\n\n| Command | Does |\n| -------------------------------------------------------- | -------------------------------------------------------------- |\n| `tobos check` \xB7 `--types` | compile and check the deck, offline; `--types`: TypeScript too |\n| `tobos push -m \"\u2026\"` | upload media, commit, push; the server checks it again |\n| `tobos render scene/beat` \xB7 `scene` \xB7 `--all` \xB7 `--film` | PNGs of beats; pushes what changed first |\n| `tobos open [scene/beat] [--presenter]` | the deck in a browser; pushes what changed first |\n| `tobos open` (outside a deck) | a browser login, once: show the person its link and code |\n| `tobos export pdf` |
|
|
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 that you write as code: one Svelte 5 file per scene, with beats (one click each) and GSAP animations. You build; Tobos checks every push, hosts the deck, and puts it on stage with a presenter view. There is no AI on Tobos's side, and no MCP server in a harness: everything goes through the `tobos` command and git.\n\n## Set up (once per machine)\n\n```sh\nnpm i -g @tobos/cli # the `tobos` command; needs Node 22.18+ and git\ntobos login you@example.com # e-mails the person a 6-digit code (and signs them up if new)\ntobos login --code 123456 # the code they paste to you from the mail\n```\n\nAsk the person for their e-mail address first, then for the code in one line: it's in their e-mail, maybe in spam, and using it accepts https://tobos.ai/terms. Only they can read it; never guess or reuse one. It works for 10 minutes. In CI or a sandbox with no login, set `TOBOS_TOKEN` to the token `tobos login` stored (and `TOBOS_SERVER`, if not tobos.ai) instead.\n\n## Start or continue a deck\n\n```sh\ntobos decks # the decks you can work on, by id\ntobos new \"Title of the talk\" # create one and clone it into ./<id>\ntobos clone <id> # or clone an existing one\ntobos pull # in a clone: the latest pushes and format guide\n```\n\nThen **read the deck's `AGENTS.md`**. It, `.tobos/FORMAT.md` and `master/GUIDE.md` are the instructions for everything that follows: the loop (`check` \u2192 `render` \u2192 look \u2192 `push`), the format, the slide master's layouts and rules.\n\n## Follow the person\n\nThey decide what to make and how much you do: some build a deck one scene at a time, some want all of it at once. Do what they ask, at the size they ask. Don't ask what a talk is about, who it's for or how long it runs, and don't propose an outline they didn't ask for.\n\n## Polls and forms\n\nA scene can ask the room a poll or a short form, which people answer on their phones through the deck's join code: `<JoinCode/>` shows its QR code, and the poll's result shows on the projector at a beat you choose. See \"Activities\" in the deck's `.tobos/FORMAT.md`. The responses download from the deck's page as a CSV per show (one class or talk): a row per phone, a column per question.\n\n## The story\n\nA deck has one story: the talk as the speaker tells it, paragraph by paragraph, with scenes mentioned as Markdown links, `[Dartmouth College](scene:same-problem)`, or one of their beats, `[Dartmouth College](scene:same-problem/quote)` (the ids from deck.json; the label is the scene's title). What follows a mention, up to the next, is that scene's: the deck's page shows it under the stage, and the presenter sees it as speaker notes. The server holds it, not git, so there is no file to edit: the person types in it live on the deck's page, and you change it with `tobos story`, which reads and writes it on the server.\n\n- `tobos story` prints it with a \xB6 id per paragraph (`p4`). Read it again before each change: the person may be typing.\n- Your changes apply at once, as the person's do, and the deck's page marks what you wrote. Change what the person asked you to, and leave the rest of their words as they are.\n- An edit is anchored on the exact text it replaces, which has to occur once in the paragraph. If someone changed it meanwhile, the command exits with code 4 and the paragraph as it is now: anchor on that and try again.\n- Set `TOBOS_AGENT` to your name (`claude`, `codex`): the page shows who wrote what.\n\n## Commands\n\n| Command | Does |\n| -------------------------------------------------------- | -------------------------------------------------------------- |\n| `tobos check` \xB7 `--types` | compile and check the deck, offline; `--types`: TypeScript too |\n| `tobos push -m \"\u2026\"` | upload media, commit, push; the server checks it again |\n| `tobos render scene/beat` \xB7 `scene` \xB7 `--all` \xB7 `--film` | PNGs of beats; pushes what changed first |\n| `tobos open [scene/beat] [--presenter]` | the deck in a browser; pushes what changed first |\n| `tobos open` (outside a deck) | a browser login, once: show the person its link and code |\n| `tobos export pdf` | the deck's PDF: a page per scene at its last beat, no polls |\n| `tobos story` | the story, by \xB6 id |\n| `tobos story edit <\xB6> \"old\" \"new\"` | change it, anchored on the exact text |\n| `tobos story add [--after <\xB6>] \"\u2026\"` \xB7 `delete <\xB6>` | add a paragraph, or delete one |\n| `tobos new \"Title\" --from <id>` | a deck from that template (default: the person's own) |\n| `tobos new \"Our brand\" --template` | a new template: a copy of the default, or of `--from` |\n| `tobos whoami` \xB7 `tobos logout` | who is logged in, on which server; or log this machine out |\n| `tobos skill install` | this skill, where the person's harnesses read skills |\n| `tobos people` | who is on it, what each may do, when a waiting invite lapses |\n| `tobos invite <email> --can edit` \xB7 `present` \xB7 `view` | put someone on it; they get a mail (a template: edit \xB7 `use`) |\n| `tobos uninvite <email>` | take them off; their access ends at once |\n\nInvite only whom the person names, at the level they say: the mail goes to someone else, from the person's name. An invite nobody logs in with lapses after 14 days (`tobos people` says when). Inviting them again before then sends no mail and doesn't move the date; once it has lapsed, and they are gone from `tobos people`, invite them again if the person still wants them on it. Only the deck's owner puts people on it and takes them off; anyone else who may edit or present it, or is on a template, sees the owner and themselves in `tobos people`, a deck's viewers no one, and anyone leaves with `tobos uninvite` and their own address. Can edit builds the deck with their own agent and turns its link on or off; can present presents it with its notes and polls; can view sees the slides only. A template is shared the same way, at can edit or can use (`--can use`): using it is seeing its gallery and starting decks from it.\n\nThe URL `tobos open` prints opens once, for whoever opens it first: don't fetch it to check it, and run the command again for another window or another computer.\n\nEvery command takes `--json`. Exit codes: 0 ok, 1 error, 2 the deck has problems, 3 not logged in, 4 the story changed meanwhile, 5 a plan's limit or an archived deck.\n\nWhen a command says a newer `tobos` is out, run `npm i -g @tobos/cli`; the next command updates this skill.\n\nExit code 5 means the person decides what happens next: a plan's limit (Free keeps 3 decks open at a time, and only Pro lets people besides the owner edit them), or an archived deck. Show them the message, which says what they can do (archive a deck on its page to make room, open one again, or buy Pro; or, on someone else's deck, ask its owner), and wait for their answer. Don't work around it: no deck built outside Tobos to upload later, no media shrunk or hosted elsewhere, no one else's account. An archived deck can still be cloned, read and shared, but takes no pushes and can't be presented.\n\nArchiving a deck, opening it again, deleting it, and deleting a session with its answers are the person's own, on the deck's page: leave them to the person, also in a browser `tobos open` logged in.\n" };
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
@@ -57824,11 +57824,10 @@ var init_types = __esm({
|
|
|
57824
57824
|
// src/render.ts
|
|
57825
57825
|
var render_exports = {};
|
|
57826
57826
|
__export(render_exports, {
|
|
57827
|
-
exportPdf: () => exportPdf,
|
|
57828
57827
|
renderBeats: () => renderBeats
|
|
57829
57828
|
});
|
|
57830
57829
|
import { execFile } from "node:child_process";
|
|
57831
|
-
import { mkdirSync as mkdirSync6, readFileSync as readFileSync6
|
|
57830
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync6 } from "node:fs";
|
|
57832
57831
|
import { createRequire } from "node:module";
|
|
57833
57832
|
import { homedir as homedir4 } from "node:os";
|
|
57834
57833
|
import { dirname as dirname4, join as join8 } from "node:path";
|
|
@@ -57996,27 +57995,6 @@ async function stripOf(browser, frames, target) {
|
|
|
57996
57995
|
await page.screenshot({ path: target });
|
|
57997
57996
|
await page.close();
|
|
57998
57997
|
}
|
|
57999
|
-
async function exportPdf(url, target, note) {
|
|
58000
|
-
mkdirSync6(dirname4(target), { recursive: true });
|
|
58001
|
-
const browser = await launch();
|
|
58002
|
-
try {
|
|
58003
|
-
note("rendering every beat\u2026");
|
|
58004
|
-
const { page, ready } = await openViewer(browser, url, 1);
|
|
58005
|
-
if (ready === false)
|
|
58006
|
-
note("not everything was drawn in time: some pages may lack fonts, images or video frames");
|
|
58007
|
-
const pages = await page.locator(".tobos-page").count();
|
|
58008
|
-
const pdf = await page.pdf({
|
|
58009
|
-
width: "1920px",
|
|
58010
|
-
height: "1080px",
|
|
58011
|
-
printBackground: true,
|
|
58012
|
-
preferCSSPageSize: true
|
|
58013
|
-
});
|
|
58014
|
-
writeFileSync6(target, pdf);
|
|
58015
|
-
return pages;
|
|
58016
|
-
} finally {
|
|
58017
|
-
await browser.close();
|
|
58018
|
-
}
|
|
58019
|
-
}
|
|
58020
57998
|
var CRASHED;
|
|
58021
57999
|
var init_render = __esm({
|
|
58022
58000
|
"src/render.ts"() {
|
|
@@ -58099,7 +58077,7 @@ function settings() {
|
|
|
58099
58077
|
|
|
58100
58078
|
// src/api.ts
|
|
58101
58079
|
init_out();
|
|
58102
|
-
var VERSION = true ? "0.4.
|
|
58080
|
+
var VERSION = true ? "0.4.16" : "dev";
|
|
58103
58081
|
function newer(a, b) {
|
|
58104
58082
|
const parse9 = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n2) => parseInt(n2)) : null;
|
|
58105
58083
|
const x = parse9(a);
|
|
@@ -58185,9 +58163,9 @@ init_define_TOBOS_PRESENT_TYPES();
|
|
|
58185
58163
|
init_define_TOBOS_SKILL();
|
|
58186
58164
|
init_define_TOBOS_TOOLCHAIN();
|
|
58187
58165
|
init_src4();
|
|
58188
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync7 } from "node:fs";
|
|
58166
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync7, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "node:fs";
|
|
58189
58167
|
import { hostname } from "node:os";
|
|
58190
|
-
import { join as join9, relative as relative3, resolve as resolve3 } from "node:path";
|
|
58168
|
+
import { dirname as dirname5, join as join9, relative as relative3, resolve as resolve3 } from "node:path";
|
|
58191
58169
|
|
|
58192
58170
|
// ../deck/src/node.ts
|
|
58193
58171
|
init_define_TOBOS_PRESENT_TYPES();
|
|
@@ -59092,14 +59070,25 @@ async function exportDeck(out, args) {
|
|
|
59092
59070
|
const kind = args.positionals[0];
|
|
59093
59071
|
if (kind !== "pdf") throw new CliError("Export what? `tobos export pdf`.");
|
|
59094
59072
|
const id2 = await deckId(args);
|
|
59095
|
-
|
|
59096
|
-
const
|
|
59073
|
+
out.note("getting the PDF of the latest push\u2026");
|
|
59074
|
+
const response = await request(`/api/decks/${id2}/deck.pdf`);
|
|
59075
|
+
if (!response.ok) {
|
|
59076
|
+
const text3 = await response.text();
|
|
59077
|
+
let data2;
|
|
59078
|
+
try {
|
|
59079
|
+
data2 = JSON.parse(text3);
|
|
59080
|
+
} catch {
|
|
59081
|
+
data2 = { error: text3.slice(0, 500) };
|
|
59082
|
+
}
|
|
59083
|
+
throw failure(response, data2);
|
|
59084
|
+
}
|
|
59085
|
+
const pdf = new Uint8Array(await response.arrayBuffer());
|
|
59097
59086
|
const target = await exportTarget(args, `${id2}.pdf`);
|
|
59098
|
-
|
|
59099
|
-
|
|
59100
|
-
const pages =
|
|
59087
|
+
mkdirSync7(dirname5(target), { recursive: true });
|
|
59088
|
+
writeFileSync6(target, pdf);
|
|
59089
|
+
const pages = Buffer.from(pdf).toString("latin1").match(/\/Type\s*\/Page(?![s\w])/g)?.length ?? 0;
|
|
59101
59090
|
out.result(
|
|
59102
|
-
{ file: target, pages
|
|
59091
|
+
{ file: target, pages },
|
|
59103
59092
|
() => `Wrote ${relative3(process.cwd(), target)} (${pages} pages).`
|
|
59104
59093
|
);
|
|
59105
59094
|
}
|
|
@@ -59215,7 +59204,8 @@ Looking at it (from the working copy, render and open push what changed first)
|
|
|
59215
59204
|
tobos open [scene/beat] [--presenter] the deck in a browser (prints the URL, which opens once)
|
|
59216
59205
|
tobos open outside a deck: a link, or its code for /login,
|
|
59217
59206
|
that logs a browser in once; show the person both
|
|
59218
|
-
tobos export pdf [--out file]
|
|
59207
|
+
tobos export pdf [--out file] the deck's PDF, as its page and its link give it:
|
|
59208
|
+
a page per scene at its last beat, no polls
|
|
59219
59209
|
|
|
59220
59210
|
The story (what the speaker says, held by the server; a scene mentioned: [Title](scene:<id>),
|
|
59221
59211
|
a beat: [Title](scene:<id>/<beat>))
|
|
@@ -59287,8 +59277,7 @@ var TABLE = {
|
|
|
59287
59277
|
run: exportDeck,
|
|
59288
59278
|
options: {
|
|
59289
59279
|
out: { type: "string" },
|
|
59290
|
-
deck: { type: "string" }
|
|
59291
|
-
handout: { type: "boolean" }
|
|
59280
|
+
deck: { type: "string" }
|
|
59292
59281
|
}
|
|
59293
59282
|
},
|
|
59294
59283
|
people: { run: people, options: { deck: { type: "string" } } },
|