@tobos/cli 0.4.11 → 0.4.13
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 +28 -18
- 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: 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) |
|
|
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: 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` | a PDF of every beat |\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 lets 1 person 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
|
|
|
@@ -58099,7 +58099,7 @@ function settings() {
|
|
|
58099
58099
|
|
|
58100
58100
|
// src/api.ts
|
|
58101
58101
|
init_out();
|
|
58102
|
-
var VERSION = true ? "0.4.
|
|
58102
|
+
var VERSION = true ? "0.4.13" : "dev";
|
|
58103
58103
|
function newer(a, b) {
|
|
58104
58104
|
const parse9 = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n2) => parseInt(n2)) : null;
|
|
58105
58105
|
const x = parse9(a);
|
|
@@ -58948,7 +58948,7 @@ async function deckId(args) {
|
|
|
58948
58948
|
async function open2(out, args) {
|
|
58949
58949
|
const position3 = args.positionals[0];
|
|
58950
58950
|
if (!position3 && typeof args.values.deck !== "string" && !await findDeck().catch(() => null))
|
|
58951
|
-
return openApp(out
|
|
58951
|
+
return openApp(out);
|
|
58952
58952
|
const view = args.values.presenter ? "presenter" : void 0;
|
|
58953
58953
|
const id2 = await deckId(args);
|
|
58954
58954
|
const { pushed } = await pushIfChanged(out, id2);
|
|
@@ -58957,13 +58957,16 @@ async function open2(out, args) {
|
|
|
58957
58957
|
const opened = !args.values.print && await openUrl(full);
|
|
58958
58958
|
out.result({ url: full, opened, pushed }, () => full);
|
|
58959
58959
|
}
|
|
58960
|
-
async function openApp(out
|
|
58961
|
-
const { url } = await api("/api/login/browser", {
|
|
58962
|
-
|
|
58960
|
+
async function openApp(out) {
|
|
58961
|
+
const { url, code } = await api("/api/login/browser", {
|
|
58962
|
+
method: "POST"
|
|
58963
|
+
});
|
|
58964
|
+
const page = `${new URL(url).origin}/login`;
|
|
58963
58965
|
out.result(
|
|
58964
|
-
{ url,
|
|
58965
|
-
() =>
|
|
58966
|
-
|
|
58966
|
+
{ url, code, page },
|
|
58967
|
+
() => code ? `Open this link, or enter ${code} at ${page}. It works once, within 10 minutes.
|
|
58968
|
+
${url}` : `Open this link. It works once, within 10 minutes.
|
|
58969
|
+
${url}`
|
|
58967
58970
|
);
|
|
58968
58971
|
}
|
|
58969
58972
|
async function storyTx(id2, ops) {
|
|
@@ -59026,6 +59029,7 @@ async function story(out, args) {
|
|
|
59026
59029
|
}
|
|
59027
59030
|
throw new CliError(`No \`tobos story ${action}\`: edit, add or delete.`);
|
|
59028
59031
|
}
|
|
59032
|
+
var waiting = (p) => p.joined ? "" : ` (invited, not logged in yet${p.lapsesAt ? `; lapses ${new Date(p.lapsesAt).toLocaleDateString("en-GB", { day: "numeric", month: "short" })}` : ""})`;
|
|
59029
59033
|
var CAN = {
|
|
59030
59034
|
edit: "editor",
|
|
59031
59035
|
present: "presenter",
|
|
@@ -59038,13 +59042,14 @@ var CAN_WORDS = {
|
|
|
59038
59042
|
presenter: "can present",
|
|
59039
59043
|
viewer: "can view"
|
|
59040
59044
|
};
|
|
59045
|
+
var canWords = (role, kind = "deck") => kind === "template" && role === "viewer" ? "can use" : CAN_WORDS[role];
|
|
59041
59046
|
async function people(out, args) {
|
|
59042
59047
|
const id2 = await deckId(args);
|
|
59043
|
-
const { people: people2 } = await api(`/api/decks/${id2}/people`);
|
|
59048
|
+
const { people: people2, kind } = await api(`/api/decks/${id2}/people`);
|
|
59044
59049
|
out.result(
|
|
59045
|
-
{ people: people2 },
|
|
59050
|
+
{ ...kind ? { kind } : {}, people: people2 },
|
|
59046
59051
|
() => people2.map(
|
|
59047
|
-
(p) => `${p.email.padEnd(32)} ${
|
|
59052
|
+
(p) => `${p.email.padEnd(32)} ${canWords(p.role, kind)}${p.paused ? ", paused: views until the plan allows more editors" : ""}${waiting(p)}`
|
|
59048
59053
|
).join("\n")
|
|
59049
59054
|
);
|
|
59050
59055
|
}
|
|
@@ -59057,7 +59062,7 @@ async function invite(out, args) {
|
|
|
59057
59062
|
);
|
|
59058
59063
|
const id2 = await deckId(args);
|
|
59059
59064
|
const done = await api(`/api/decks/${id2}/people`, { body: { email, level } });
|
|
59060
|
-
const now = `${done.email} ${
|
|
59065
|
+
const now = `${done.email} ${canWords(done.level, done.kind)} now`;
|
|
59061
59066
|
out.result(
|
|
59062
59067
|
done,
|
|
59063
59068
|
() => done.mailed ? `${now}; they got a mail with the way in.` : done.mailFailed ? `${now}, but the invite mail couldn't be sent: send them ${done.link}` : done.link ? `${now}. They had an invite to it in the last day, so no second mail: send them ${done.link}` : `${now}.`
|
|
@@ -59071,7 +59076,10 @@ async function uninvite(out, args) {
|
|
|
59071
59076
|
method: "DELETE",
|
|
59072
59077
|
body: { email }
|
|
59073
59078
|
});
|
|
59074
|
-
out.result(
|
|
59079
|
+
out.result(
|
|
59080
|
+
done,
|
|
59081
|
+
() => `${done.removed} is off the ${done.kind ?? "deck"}; their access has ended.`
|
|
59082
|
+
);
|
|
59075
59083
|
}
|
|
59076
59084
|
async function exportTarget(args, file2) {
|
|
59077
59085
|
if (args.values.out) return resolve3(args.values.out);
|
|
@@ -59204,8 +59212,9 @@ Working on a deck
|
|
|
59204
59212
|
Looking at it (from the working copy, render and open push what changed first)
|
|
59205
59213
|
tobos render scene/beat | scene | --all PNGs of beats, for you to look at
|
|
59206
59214
|
[--film] [--frames 6] [--out dir] --film: frames through the animation
|
|
59207
|
-
tobos open [scene/beat] [--presenter] the deck in a browser (prints the URL)
|
|
59208
|
-
tobos open outside a deck:
|
|
59215
|
+
tobos open [scene/beat] [--presenter] the deck in a browser (prints the URL, which opens once)
|
|
59216
|
+
tobos open outside a deck: a link, or its code for /login,
|
|
59217
|
+
that logs a browser in once; show the person both
|
|
59209
59218
|
tobos export pdf [--out file] a PDF of every beat
|
|
59210
59219
|
|
|
59211
59220
|
The story (what the speaker says, held by the server; a scene mentioned: [Title](scene:<id>),
|
|
@@ -59218,13 +59227,14 @@ a beat: [Title](scene:<id>/<beat>))
|
|
|
59218
59227
|
deck's page marks what you wrote
|
|
59219
59228
|
|
|
59220
59229
|
People on a deck or template (from its working copy, or --deck <id>)
|
|
59221
|
-
tobos people who is on it,
|
|
59230
|
+
tobos people who is on it, what each may do, and when a
|
|
59231
|
+
waiting invite lapses
|
|
59222
59232
|
tobos invite <email> --can edit|present|view
|
|
59223
59233
|
its owner puts them on it, mailed the way in;
|
|
59224
59234
|
someone on it already gets the new level. On a
|
|
59225
59235
|
template, --can edit|use
|
|
59226
59236
|
tobos uninvite <email> take them off, and their access ends at once;
|
|
59227
|
-
with your own address, leave
|
|
59237
|
+
with your own address, leave it
|
|
59228
59238
|
|
|
59229
59239
|
The skill (what your harness reads to know Tobos without this help)
|
|
59230
59240
|
tobos skill install put it where Claude Code, Codex, OpenCode and others
|