@tobos/cli 0.4.46 → 0.4.47
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.
|
@@ -55,7 +55,7 @@ var init_define_TOBOS_PRESENT_TYPES = __esm({
|
|
|
55
55
|
var define_TOBOS_SKILL_default;
|
|
56
56
|
var init_define_TOBOS_SKILL = __esm({
|
|
57
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- A folder
|
|
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
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mergeText,
|
|
8
8
|
parseMediaJson,
|
|
9
9
|
unpackTar
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TIEXYQJA.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-
|
|
22
|
+
} from "./chunk-KNDAUICC.js";
|
|
23
23
|
|
|
24
24
|
// src/main.ts
|
|
25
25
|
init_define_TOBOS_PRESENT_TYPES();
|
|
@@ -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. A folder a move empties
|
|
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.",
|
|
176
176
|
input: {
|
|
177
177
|
properties: {
|
|
178
178
|
decks: {
|
|
@@ -183,17 +183,26 @@ var VERBS = {
|
|
|
183
183
|
folders: {
|
|
184
184
|
type: "array",
|
|
185
185
|
items: { type: "string" },
|
|
186
|
-
description: "Folders to move, each by its path, with all that is in them."
|
|
186
|
+
description: "Folders to move, each by its path, with all that is in them; or, with `name`, the one folder to rename."
|
|
187
187
|
},
|
|
188
|
-
to: {
|
|
188
|
+
to: {
|
|
189
|
+
type: "string",
|
|
190
|
+
description: `Where they go, or with nothing to move, the folder to make. ${FOLDER_PATH}`
|
|
191
|
+
},
|
|
192
|
+
name: {
|
|
193
|
+
type: "string",
|
|
194
|
+
description: "The new name of the one folder in `folders`, renamed where it is, with no decks and no `to`."
|
|
195
|
+
}
|
|
189
196
|
},
|
|
190
|
-
required: [
|
|
197
|
+
required: []
|
|
191
198
|
},
|
|
192
199
|
cli: [
|
|
193
200
|
{
|
|
194
201
|
usage: "tobos mv <deck or /folder>\u2026 </path>",
|
|
195
|
-
does: "move decks and folders into that folder, made if there is none; a folder a move empties
|
|
196
|
-
}
|
|
202
|
+
does: "move decks and folders into that folder, made if there is none; a folder a move empties stays"
|
|
203
|
+
},
|
|
204
|
+
{ usage: "tobos mv </folder> --name <name>", does: "rename a folder where it is" },
|
|
205
|
+
{ usage: "tobos mkdir </path>", does: "make an empty folder, and those on its path" }
|
|
197
206
|
]
|
|
198
207
|
}
|
|
199
208
|
};
|
|
@@ -269,7 +278,7 @@ function settings() {
|
|
|
269
278
|
}
|
|
270
279
|
|
|
271
280
|
// src/api.ts
|
|
272
|
-
var VERSION = true ? "0.4.
|
|
281
|
+
var VERSION = true ? "0.4.47" : "dev";
|
|
273
282
|
function newer(a, b) {
|
|
274
283
|
const parse = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n) => parseInt(n)) : null;
|
|
275
284
|
const x = parse(a);
|
|
@@ -978,21 +987,41 @@ async function ls(out, args) {
|
|
|
978
987
|
);
|
|
979
988
|
}
|
|
980
989
|
async function mv(out, args) {
|
|
990
|
+
const name = args.values.name;
|
|
991
|
+
if (typeof name === "string") {
|
|
992
|
+
const [folder, ...more] = args.positionals;
|
|
993
|
+
if (!folder?.startsWith("/") || more.length)
|
|
994
|
+
throw new CliError(
|
|
995
|
+
"--name renames one folder where it is: `tobos mv </folder> --name <name>`, the folder by its path."
|
|
996
|
+
);
|
|
997
|
+
const renamed = await api("/api/drive/move", {
|
|
998
|
+
body: { folders: [folder], name }
|
|
999
|
+
});
|
|
1000
|
+
out.result(renamed, () => `Renamed ${folder} to ${renamed.to}.`);
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
981
1003
|
const named = args.positionals.slice(0, -1);
|
|
982
1004
|
const to = args.positionals.at(-1);
|
|
983
1005
|
if (!to || named.length === 0)
|
|
984
1006
|
throw new CliError(
|
|
985
|
-
"What goes where? `tobos mv <deck or /folder>\u2026 <folder>`: decks by id or title, folders by path."
|
|
1007
|
+
"What goes where? `tobos mv <deck or /folder>\u2026 <folder>`: decks by id or title, folders by path. `tobos mkdir </path>` makes an empty folder."
|
|
986
1008
|
);
|
|
987
1009
|
const moved = await api("/api/drive/move", {
|
|
988
1010
|
body: {
|
|
989
|
-
decks: named.filter((
|
|
990
|
-
folders: named.filter((
|
|
1011
|
+
decks: named.filter((name2) => !name2.startsWith("/")),
|
|
1012
|
+
folders: named.filter((name2) => name2.startsWith("/")),
|
|
991
1013
|
to
|
|
992
1014
|
}
|
|
993
1015
|
});
|
|
994
1016
|
out.result(moved, () => `Moved ${plural(named.length, "item")} into ${moved.to}.`);
|
|
995
1017
|
}
|
|
1018
|
+
async function mkdir(out, args) {
|
|
1019
|
+
const [path, ...more] = args.positionals;
|
|
1020
|
+
if (!path || more.length)
|
|
1021
|
+
throw new CliError("Which folder? `tobos mkdir </path>`, such as /Courses/AI 101.");
|
|
1022
|
+
const made = await api("/api/drive/move", { body: { to: path } });
|
|
1023
|
+
out.result(made, () => `Made ${made.to}.`);
|
|
1024
|
+
}
|
|
996
1025
|
var plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
997
1026
|
async function pull(out, args) {
|
|
998
1027
|
const given = args.positionals[0];
|
|
@@ -1120,7 +1149,7 @@ async function check(out, args) {
|
|
|
1120
1149
|
);
|
|
1121
1150
|
const problems = [...written.problems];
|
|
1122
1151
|
if (args.values.types) {
|
|
1123
|
-
const { checkTypes } = await import("./types-
|
|
1152
|
+
const { checkTypes } = await import("./types-2BLKEROB.js");
|
|
1124
1153
|
problems.push(...await checkTypes(copy.root, (m) => out.note(m)));
|
|
1125
1154
|
}
|
|
1126
1155
|
const { errors, warnings } = problemSummary(problems);
|
|
@@ -1325,7 +1354,7 @@ async function openApp(out) {
|
|
|
1325
1354
|
out.result({ url, opened }, () => url);
|
|
1326
1355
|
}
|
|
1327
1356
|
async function render(out, args) {
|
|
1328
|
-
const { renderBeats } = await import("./render-
|
|
1357
|
+
const { renderBeats } = await import("./render-5CD43LFN.js");
|
|
1329
1358
|
const copy = findCopy();
|
|
1330
1359
|
const deck = copy?.base ? { id: copy.base.deck, root: copy.root } : void 0;
|
|
1331
1360
|
const id = typeof args.values.deck === "string" ? parseId(args.values.deck) : deck?.id;
|
|
@@ -1470,7 +1499,8 @@ var TABLE = {
|
|
|
1470
1499
|
from: { type: "string" }
|
|
1471
1500
|
}
|
|
1472
1501
|
},
|
|
1473
|
-
mv: { run: mv },
|
|
1502
|
+
mv: { run: mv, options: { name: { type: "string" } } },
|
|
1503
|
+
mkdir: { run: mkdir },
|
|
1474
1504
|
pull: { run: pull },
|
|
1475
1505
|
outline: {
|
|
1476
1506
|
run: outline,
|
|
@@ -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-
|
|
6
|
+
} from "./chunk-TIEXYQJA.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-
|
|
17
|
+
} from "./chunk-KNDAUICC.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({
|