@tobos/cli 0.4.31 → 0.4.33
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.
|
@@ -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 written as code: a deck is a folder of files, one Svelte 5 file per scene, advancing one beat per click. You build it with the `tobos` command, which needs no git; Tobos checks every push, keeps every version, hosts the deck and puts it on stage. `tobos --help` lists every command, and each takes `--json`.\n\n## Get to the deck\n\n- `tobos ls` lists the decks and templates the person can work on, by id. `tobos pull <id>` gets one; `tobos new \"Title\"` starts one and pulls it.\n- A new deck starts from Tobos simple. The person's own templates, their house styles, are in `tobos ls`: start from one with `--from <id>`, and ask which when there are several.\n- Then read the deck's `AGENTS.md`: it points to the loop, the format and the deck's slide master.\n- The person's decks are in folders, which `tobos --help` lists the commands for.\n\nExit code 3 means this machine isn't connected to the person's account. Run `tobos login`: it prints an address, which the person opens on any device, logs in at (a first login signs them up, and accepts https://tobos.ai/terms) and approves this machine. Give it to them in one line, then, once they did, run `tobos login` again. In CI or a sandbox with no one to ask, `TOBOS_TOKEN` and `TOBOS_SERVER` stand in for the login.\n\n## Follow the person\n\nThey decide what to make and how much of it you build: one scene at a time, or the whole deck at once. Build what they ask, at the size they ask, from what they have told you about the talk. When they ask how Tobos works or where to start, give them the tour, https://tobos.ai/tour, and nothing of your own: no explanation, no deck to try.\n\n## Folders\n\n- Look at the person's folders before you make or move a deck, and file it under a folder name they have already, as they wrote it, rather than a new one that means the same.\n- File every deck you make: once it is made, move it into the folder it belongs in.\n- Before you move more than a handful of decks, show the person the tree you propose, and make it once they say yes.\n- A reorganisation is taken back by moving the decks back where they were: note where they were before you move them.\n- A folder goes when it empties, by a move or a deck's deletion: there is no removing one. A folder with only archived decks in it isn't empty.\n\n## What stays the person's\n\n- **Exit code 5** is a plan's limit or an archived deck. Show the person the message as it is, which says what they can do, and wait for their answer. The deck stays in Tobos: a deck built elsewhere to upload later, media shrunk or hosted elsewhere to fit, or someone else's account would decide for them what is theirs to decide.\n- **Archiving, opening again and deleting** a deck, and deleting a session's answers, are done by the person on the deck's page, in their own browser.\n- **Who is on a deck, and its link,** are the person's, on the deck's page: they put people on it, change what each may do, take them off, and turn the link on or off there. You neither see nor change any of it: `tobos ls` tells you only what you may do on each deck and whose it is. Can edit builds it with their own agent, can present presents it with its notes and polls, and can view sees the slides; on a template, can edit and can use.\n- **
|
|
119
|
+
define_TOBOS_SKILL_default = { "SKILL.md": "---\nname: tobos-present\ndescription: Build presentations as code with Tobos Present. Use when the user wants a talk, lecture, pitch or slide deck made, changed, rendered, presented or exported as a PDF, or mentions Tobos or `tobos`.\n---\n\n<!-- Installed by the `tobos` CLI and overwritten when it updates, so changes made here don't last. -->\n\n# Tobos Present\n\nTobos hosts presentations written as code: a deck is a folder of files, one Svelte 5 file per scene, advancing one beat per click. You build it with the `tobos` command, which needs no git; Tobos checks every push, keeps every version, hosts the deck and puts it on stage. `tobos --help` lists every command, and each takes `--json`.\n\n## Get to the deck\n\n- `tobos ls` lists the decks and templates the person can work on, by id. `tobos pull <id>` gets one; `tobos new \"Title\"` starts one and pulls it.\n- A new deck starts from Tobos simple. The person's own templates, their house styles, are in `tobos ls`: start from one with `--from <id>`, and ask which when there are several.\n- Then read the deck's `AGENTS.md`: it points to the loop, the format and the deck's slide master.\n- The person's decks are in folders, which `tobos --help` lists the commands for.\n\nExit code 3 means this machine isn't connected to the person's account. Run `tobos login`: it prints an address, which the person opens on any device, logs in at (a first login signs them up, and accepts https://tobos.ai/terms) and approves this machine. Give it to them in one line, then, once they did, run `tobos login` again. In CI or a sandbox with no one to ask, `TOBOS_TOKEN` and `TOBOS_SERVER` stand in for the login.\n\n## Follow the person\n\nThey decide what to make and how much of it you build: one scene at a time, or the whole deck at once. Build what they ask, at the size they ask, from what they have told you about the talk. When they ask how Tobos works or where to start, give them the tour, https://tobos.ai/tour, and nothing of your own: no explanation, no deck to try.\n\n## Folders\n\n- Look at the person's folders before you make or move a deck, and file it under a folder name they have already, as they wrote it, rather than a new one that means the same.\n- File every deck you make: once it is made, move it into the folder it belongs in.\n- Before you move more than a handful of decks, show the person the tree you propose, and make it once they say yes.\n- A reorganisation is taken back by moving the decks back where they were: note where they were before you move them.\n- A folder goes when it empties, by a move or a deck's deletion: there is no removing one. A folder with only archived decks in it isn't empty.\n\n## What stays the person's\n\n- **Exit code 5** is a plan's limit or an archived deck. Show the person the message as it is, which says what they can do, and wait for their answer. The deck stays in Tobos: a deck built elsewhere to upload later, media shrunk or hosted elsewhere to fit, or someone else's account would decide for them what is theirs to decide.\n- **Archiving, opening again and deleting** a deck, and deleting a session's answers, are done by the person on the deck's page, in their own browser.\n- **Who is on a deck, and its link,** are the person's, on the deck's page: they put people on it, change what each may do, take them off, and turn the link on or off there. You neither see nor change any of it: `tobos ls` tells you only what you may do on each deck and whose it is. Can edit builds it with their own agent, can present presents it with its notes and polls, and can view sees the slides; on a template, can edit and can use.\n- **Each scene's notes,** what the speaker says, are the person's: they write them under the stage on the deck's page, and the presenter sees them. You neither read nor write them, and a scene needs none from you.\n- **The URL `tobos open` prints** is the deck's page, where the person watches it, presents it and shares it; `--presenter` gives a presenter's link instead, which opens once, for whoever opens it first.\n" };
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
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-LBUZHZFX.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-5LA45GOP.js";
|
|
23
23
|
|
|
24
24
|
// src/main.ts
|
|
25
25
|
init_define_TOBOS_PRESENT_TYPES();
|
|
@@ -27,6 +27,166 @@ init_define_TOBOS_SKILL();
|
|
|
27
27
|
init_define_TOBOS_TOOLCHAIN();
|
|
28
28
|
import { parseArgs } from "node:util";
|
|
29
29
|
|
|
30
|
+
// ../deck/src/verbs.ts
|
|
31
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
32
|
+
init_define_TOBOS_SKILL();
|
|
33
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
34
|
+
var FOLDER_PATH = "A folder\u2019s path from the root, such as `/Courses/AI 101`; `/` is the root.";
|
|
35
|
+
var REV = { type: "string", description: "A version of the deck; its latest if left out." };
|
|
36
|
+
var CHANGESET_SCHEMA = {
|
|
37
|
+
type: "object",
|
|
38
|
+
properties: {
|
|
39
|
+
base: {
|
|
40
|
+
type: ["string", "null"],
|
|
41
|
+
description: "The version the files were read at: the `rev` that a read, `new` or the last write gave. If the deck changed since, Tobos merges: only lines both changed differently are a conflict."
|
|
42
|
+
},
|
|
43
|
+
message: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "What the change does, as a commit message says: needed unless `dry`."
|
|
46
|
+
},
|
|
47
|
+
dry: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Check it, and land no version: what the check says of the deck as it would be. A file from the web for media/ is still fetched and stored, so the check sees it. Its answer is no version to write on."
|
|
50
|
+
},
|
|
51
|
+
files: {
|
|
52
|
+
type: "object",
|
|
53
|
+
description: 'Each path to change: its new text in full; `{"patch": [{"find", "replace"}]}` to change part of it, each `find` once in the file as it is now; for a file in media/, `{"url"}`, the address of a file on the web, which Tobos fetches, or `{"base64"}` or `{"hash"}` of an upload; or null to delete it. Only Tobos writes media.json, from what goes into media/.',
|
|
54
|
+
additionalProperties: {
|
|
55
|
+
anyOf: [
|
|
56
|
+
{ type: "string" },
|
|
57
|
+
{
|
|
58
|
+
type: "object",
|
|
59
|
+
properties: {
|
|
60
|
+
patch: {
|
|
61
|
+
type: "array",
|
|
62
|
+
items: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: { find: { type: "string" }, replace: { type: "string" } },
|
|
65
|
+
required: ["find", "replace"],
|
|
66
|
+
additionalProperties: false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
required: ["patch"],
|
|
71
|
+
additionalProperties: false
|
|
72
|
+
},
|
|
73
|
+
...["url", "base64", "hash"].map((key) => ({
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: { [key]: { type: "string" } },
|
|
76
|
+
required: [key],
|
|
77
|
+
additionalProperties: false
|
|
78
|
+
})),
|
|
79
|
+
{ type: "null" }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
required: ["base", "files"]
|
|
85
|
+
};
|
|
86
|
+
var VERBS = {
|
|
87
|
+
list: {
|
|
88
|
+
does: "The decks and templates 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.",
|
|
89
|
+
input: { properties: { path: { type: "string", description: FOLDER_PATH } }, required: [] },
|
|
90
|
+
cli: [
|
|
91
|
+
{
|
|
92
|
+
usage: "tobos ls [/path]",
|
|
93
|
+
does: "your decks and templates, by id, with your level on each, whose it is and its folder; with a path, what that folder holds"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
read: {
|
|
98
|
+
does: "A deck\u2019s files at a version, its latest unless another is named, with that version, `rev`, to write on.",
|
|
99
|
+
input: {
|
|
100
|
+
properties: {
|
|
101
|
+
paths: {
|
|
102
|
+
type: "array",
|
|
103
|
+
items: { type: "string" },
|
|
104
|
+
description: "The files to read, such as `deck.json` and `scenes/intro.svelte`, or `master/`."
|
|
105
|
+
},
|
|
106
|
+
rev: REV,
|
|
107
|
+
since: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "Reading media/: a version you read, for only the files added since then."
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
required: []
|
|
113
|
+
},
|
|
114
|
+
cli: [
|
|
115
|
+
{ usage: "tobos pull <id> [dir]", does: "a working copy of a deck, into ./<id> or dir" },
|
|
116
|
+
{
|
|
117
|
+
usage: "tobos pull",
|
|
118
|
+
does: "the latest version into the copy, merged with your changes; a conflict is left between <<<<<<< and >>>>>>> to resolve"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
chat: 'Without `paths`, lists its files with their sizes; with them, gives each file\u2019s text, many in one call (a path ending in `/` reads every file under it). Reading media/ (`paths: ["media/"]`) shows its pictures, video and sound instead: each file\u2019s name, type and size, when it was added and by whom, and contact sheets to see what they show, with the address of the deck\u2019s page where the person drops files. With `since`, only the files added since that version. Paths of files in media/ show just those, one alone as large as the sheet. A picture the person gave you in the chat reaches you, not Tobos: give them the address of the deck\u2019s page that reading media/ gives, where they drop it.'
|
|
122
|
+
},
|
|
123
|
+
write: {
|
|
124
|
+
does: "Changes a deck\u2019s files as one version, live at once, made on the version they were read at: Tobos merges what changed since, checks the deck as it would be, and saves nothing, saying why, if the check refuses it or someone changed the same lines. Dry, it only checks.",
|
|
125
|
+
input: {
|
|
126
|
+
properties: { ...CHANGESET_SCHEMA.properties },
|
|
127
|
+
required: CHANGESET_SCHEMA.required
|
|
128
|
+
},
|
|
129
|
+
cli: [
|
|
130
|
+
{
|
|
131
|
+
usage: 'tobos push [-m "what changed"]',
|
|
132
|
+
does: "the copy\u2019s changes as one version, media uploaded"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
usage: "tobos check [--types]",
|
|
136
|
+
does: "the same, dry: the server\u2019s check, nothing saved; --types adds TypeScript\u2019s view, here"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
chat: "Each file\u2019s text in full, a patch of part of it, a file on the web for media/, or null to delete it. All or nothing, so put everything a step needs into one call."
|
|
140
|
+
},
|
|
141
|
+
new: {
|
|
142
|
+
does: "Makes a deck in the person\u2019s account from a template, Tobos simple unless another is named, such as the person\u2019s own house style (ask which when they have several), with its first version, `rev`; or, as a template, a new template: a copy of all of the one it starts from.",
|
|
143
|
+
input: {
|
|
144
|
+
properties: {
|
|
145
|
+
title: { type: "string", description: "The title of the talk." },
|
|
146
|
+
from: { type: "string", description: "The id of the template to start from." },
|
|
147
|
+
template: { type: "boolean", description: "Make a template rather than a deck." }
|
|
148
|
+
},
|
|
149
|
+
required: ["title"]
|
|
150
|
+
},
|
|
151
|
+
chat: "Gives the deck\u2019s id, its first version, `rev`, its files, and its address in Tobos; `list` gives templates\u2019 ids.",
|
|
152
|
+
cli: [
|
|
153
|
+
{
|
|
154
|
+
usage: 'tobos new "Title" [--from <id>] [--template] [--dir dir]',
|
|
155
|
+
does: "a deck from a template (Tobos simple unless --from), or a template; pulled into ./<id> or dir (--no-pull: only made)"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
move: {
|
|
160
|
+
does: "Moves the person\u2019s decks and templates, 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 goes. Refused, with nothing moved, 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, or if a folder would go into itself.",
|
|
161
|
+
input: {
|
|
162
|
+
properties: {
|
|
163
|
+
decks: {
|
|
164
|
+
type: "array",
|
|
165
|
+
items: { type: "string" },
|
|
166
|
+
description: "Decks and templates to move, each by its id or title."
|
|
167
|
+
},
|
|
168
|
+
folders: {
|
|
169
|
+
type: "array",
|
|
170
|
+
items: { type: "string" },
|
|
171
|
+
description: "Folders to move, each by its path, with all that is in them."
|
|
172
|
+
},
|
|
173
|
+
to: { type: "string", description: `Where they go. ${FOLDER_PATH}` }
|
|
174
|
+
},
|
|
175
|
+
required: ["to"]
|
|
176
|
+
},
|
|
177
|
+
cli: [
|
|
178
|
+
{
|
|
179
|
+
usage: "tobos mv <deck or /folder>\u2026 </path>",
|
|
180
|
+
does: "move decks and folders into that folder, made if there is none; a folder a move empties goes"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
function verbsAppendix(door) {
|
|
186
|
+
const verbs = Object.entries(VERBS);
|
|
187
|
+
return door === "chat" ? verbs.map(([name, verb]) => `- \`${name}\`: ${verb.does}`).join("\n") : verbs.flatMap(([, verb]) => verb.cli.map((c) => `- \`${c.usage}\`: ${c.does}`)).join("\n");
|
|
188
|
+
}
|
|
189
|
+
|
|
30
190
|
// src/api.ts
|
|
31
191
|
init_define_TOBOS_PRESENT_TYPES();
|
|
32
192
|
init_define_TOBOS_SKILL();
|
|
@@ -94,7 +254,7 @@ function settings() {
|
|
|
94
254
|
}
|
|
95
255
|
|
|
96
256
|
// src/api.ts
|
|
97
|
-
var VERSION = true ? "0.4.
|
|
257
|
+
var VERSION = true ? "0.4.33" : "dev";
|
|
98
258
|
function newer(a, b) {
|
|
99
259
|
const parse = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n) => parseInt(n)) : null;
|
|
100
260
|
const x = parse(a);
|
|
@@ -535,13 +695,34 @@ init_define_TOBOS_SKILL();
|
|
|
535
695
|
init_define_TOBOS_TOOLCHAIN();
|
|
536
696
|
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
537
697
|
import { join as join3 } from "node:path";
|
|
698
|
+
var WORKING = `# Working on a deck
|
|
699
|
+
|
|
700
|
+
You work in a copy of the deck, from \`tobos pull <id>\` or \`tobos new\`, with no git: the server keeps
|
|
701
|
+
the versions. Every push is live: every open preview follows within a second, so the person
|
|
702
|
+
watches the deck take shape.
|
|
703
|
+
|
|
704
|
+
1. Change \`deck.json\`, the scenes and whatever else the step needs.
|
|
705
|
+
2. \`tobos check\`: fix every error it reports.
|
|
706
|
+
3. \`tobos render <scene>/<beat>\` pushes what changed and writes a PNG of that beat; \`--film\`
|
|
707
|
+
writes frames through its animation. Look at each one.
|
|
708
|
+
4. \`tobos push -m "what changed"\`. \`render\` and \`open\` push the same way when the copy has
|
|
709
|
+
changed, and \`-m\` names that push too.
|
|
710
|
+
|
|
711
|
+
A step is done when every beat it changed has been rendered and looked at.
|
|
712
|
+
|
|
713
|
+
\`.tobos/\` holds this file and the version the copy is of: leave it be. A push leaves out what
|
|
714
|
+
is in \`.tobos/\`, \`.git/\`, \`sources/\` and \`node_modules/\` at the copy's top.
|
|
715
|
+
|
|
716
|
+
${verbsAppendix("cli")}
|
|
717
|
+
|
|
718
|
+
`;
|
|
538
719
|
async function writeFormatGuide(root, server) {
|
|
539
720
|
const dir2 = join3(root, ".tobos");
|
|
540
721
|
mkdirSync3(dir2, { recursive: true });
|
|
541
722
|
const format = await request("/api/format", { anonymous: true, server });
|
|
542
723
|
if (!format.ok)
|
|
543
724
|
throw new CliError(`Couldn't fetch the format guide from ${server} (${format.status}).`);
|
|
544
|
-
writeFileSync3(join3(dir2, "FORMAT.md"), await format.text());
|
|
725
|
+
writeFileSync3(join3(dir2, "FORMAT.md"), WORKING + await format.text());
|
|
545
726
|
}
|
|
546
727
|
|
|
547
728
|
// src/skill.ts
|
|
@@ -874,7 +1055,7 @@ async function check(out, args) {
|
|
|
874
1055
|
);
|
|
875
1056
|
const problems = [...written.problems];
|
|
876
1057
|
if (args.values.types) {
|
|
877
|
-
const { checkTypes } = await import("./types-
|
|
1058
|
+
const { checkTypes } = await import("./types-EPPCS5WP.js");
|
|
878
1059
|
problems.push(...await checkTypes(copy.root, (m) => out.note(m)));
|
|
879
1060
|
}
|
|
880
1061
|
const { errors, warnings } = problemSummary(problems);
|
|
@@ -958,68 +1139,8 @@ async function openApp(out) {
|
|
|
958
1139
|
const opened = await openUrl(url);
|
|
959
1140
|
out.result({ url, opened }, () => url);
|
|
960
1141
|
}
|
|
961
|
-
async function storyTx(id, ops) {
|
|
962
|
-
try {
|
|
963
|
-
return await api(`/api/decks/${id}/story/tx`, {
|
|
964
|
-
body: { ops, agent: process.env.TOBOS_AGENT || void 0 }
|
|
965
|
-
});
|
|
966
|
-
} catch (error) {
|
|
967
|
-
if (error instanceof CliError && (error.extra.status === 409 || error.extra.status === 422)) {
|
|
968
|
-
const now = error.extra.paragraph;
|
|
969
|
-
throw new CliError(
|
|
970
|
-
now ? `${error.message}
|
|
971
|
-
It is now:
|
|
972
|
-
\xB6 ${now.id} ${now.text}` : error.message,
|
|
973
|
-
error.extra.status === 409 ? EXIT.conflict : EXIT.error,
|
|
974
|
-
error.extra
|
|
975
|
-
);
|
|
976
|
-
}
|
|
977
|
-
throw error;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
async function story(out, args) {
|
|
981
|
-
const [action, ...rest] = args.positionals;
|
|
982
|
-
const id = await deckId(args);
|
|
983
|
-
if (!action) {
|
|
984
|
-
const story2 = await api(`/api/decks/${id}/story`);
|
|
985
|
-
out.result(
|
|
986
|
-
{ ...story2 },
|
|
987
|
-
() => story2.paragraphs.length ? story2.paragraphs.map((p) => `\xB6 ${p.id.padEnd(4)} ${p.text}`).join("\n\n") : 'No story yet. `tobos story add "\u2026"` writes its first paragraph.'
|
|
988
|
-
);
|
|
989
|
-
return;
|
|
990
|
-
}
|
|
991
|
-
if (action === "edit") {
|
|
992
|
-
const [paragraph, find, replace] = rest;
|
|
993
|
-
if (!paragraph || find === void 0 || replace === void 0)
|
|
994
|
-
throw new CliError(
|
|
995
|
-
'`tobos story edit <\xB6 id> "the exact text" "what replaces it"` (`tobos story` shows the ids).'
|
|
996
|
-
);
|
|
997
|
-
const result = await storyTx(id, [{ op: "set", id: paragraph, find, replace }]);
|
|
998
|
-
out.result({ ...result, paragraph }, () => `Changed ${paragraph}.`);
|
|
999
|
-
return;
|
|
1000
|
-
}
|
|
1001
|
-
if (action === "add") {
|
|
1002
|
-
const text = rest.join(" ").trim();
|
|
1003
|
-
if (!text) throw new CliError('`tobos story add [--after <\xB6 id>] "the paragraph"`.');
|
|
1004
|
-
const after = args.values.after ?? "end";
|
|
1005
|
-
const result = await storyTx(id, [
|
|
1006
|
-
{ op: "insert", after: after === "start" ? null : after, text, key: "new:1" }
|
|
1007
|
-
]);
|
|
1008
|
-
const paragraph = result.ids["new:1"] ?? null;
|
|
1009
|
-
out.result({ ...result, paragraph }, () => `Added ${paragraph}.`);
|
|
1010
|
-
return;
|
|
1011
|
-
}
|
|
1012
|
-
if (action === "delete") {
|
|
1013
|
-
const paragraph = rest[0];
|
|
1014
|
-
if (!paragraph) throw new CliError("`tobos story delete <\xB6 id>`.");
|
|
1015
|
-
const result = await storyTx(id, [{ op: "delete", id: paragraph }]);
|
|
1016
|
-
out.result({ ...result, paragraph }, () => `Deleted ${paragraph}.`);
|
|
1017
|
-
return;
|
|
1018
|
-
}
|
|
1019
|
-
throw new CliError(`No \`tobos story ${action}\`: edit, add or delete.`);
|
|
1020
|
-
}
|
|
1021
1142
|
async function render(out, args) {
|
|
1022
|
-
const { renderBeats } = await import("./render-
|
|
1143
|
+
const { renderBeats } = await import("./render-W67XG7W4.js");
|
|
1023
1144
|
const copy = findCopy();
|
|
1024
1145
|
const deck = copy?.base ? { id: copy.base.deck, root: copy.root } : void 0;
|
|
1025
1146
|
const id = typeof args.values.deck === "string" ? parseId(args.values.deck) : deck?.id;
|
|
@@ -1085,34 +1206,29 @@ async function skill(out, args) {
|
|
|
1085
1206
|
}
|
|
1086
1207
|
|
|
1087
1208
|
// src/main.ts
|
|
1209
|
+
function row(usage, does) {
|
|
1210
|
+
const lines = [];
|
|
1211
|
+
for (const word of does.split(" ")) {
|
|
1212
|
+
const last = lines.at(-1);
|
|
1213
|
+
if (last !== void 0 && last.length + word.length < 50) lines[lines.length - 1] += ` ${word}`;
|
|
1214
|
+
else lines.push(word);
|
|
1215
|
+
}
|
|
1216
|
+
const first = ` ${usage}`;
|
|
1217
|
+
const pad = " ".repeat(46);
|
|
1218
|
+
return [first.length < 45 ? first.padEnd(46) + lines[0] : `${first}
|
|
1219
|
+
${pad}${lines[0]}`].concat(lines.slice(1).map((line) => pad + line)).join("\n");
|
|
1220
|
+
}
|
|
1221
|
+
var VERB_ROWS = Object.values(VERBS).flatMap((verb) => verb.cli.map((c) => row(c.usage, c.does))).join("\n");
|
|
1088
1222
|
var HELP = `tobos ${VERSION}: the command line of Tobos, the office suite your coding agent works in.
|
|
1089
1223
|
|
|
1090
1224
|
Account
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
tobos logout forget this machine's token
|
|
1095
|
-
tobos whoami who you are, on which server
|
|
1096
|
-
tobos ls [/path] your decks and templates, by id, each in its folder,
|
|
1097
|
-
and those shared with you; an archived one is
|
|
1098
|
-
read-only. With a path: what that folder holds,
|
|
1099
|
-
its folders, then its decks
|
|
1225
|
+
${row("tobos login [--server URL]", "connect this machine: prints an address for the person to open and approve (logging in, or signing up, there); run it again once they did")}
|
|
1226
|
+
${row("tobos logout", "forget this machine's token")}
|
|
1227
|
+
${row("tobos whoami", "who you are, on which server")}
|
|
1100
1228
|
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
Working on a deck (a working copy: no git; the server keeps the versions)
|
|
1106
|
-
tobos new "Title" [--dir dir] [--no-pull] create a deck and pull it here, into ./<id>
|
|
1107
|
-
(or into dir; --no-pull: only create it)
|
|
1108
|
-
tobos pull <id> [dir] a working copy of a deck, with the agent pack
|
|
1109
|
-
tobos pull the latest version into the copy, merged with your
|
|
1110
|
-
changes; a conflict is left between <<<<<<< and
|
|
1111
|
-
>>>>>>> to resolve; and the format guide
|
|
1112
|
-
tobos check [--types] the server's check of your changes; nothing lands;
|
|
1113
|
-
--types: TypeScript too, here (installs a checker once)
|
|
1114
|
-
tobos push [-m "what changed"] your changes as one version, media uploaded; the
|
|
1115
|
-
server checks it, and it goes live
|
|
1229
|
+
The five verbs (a deck by its id, or its title to mv it; a folder by its path; in a working copy,
|
|
1230
|
+
with no git: the server keeps the versions)
|
|
1231
|
+
${VERB_ROWS}
|
|
1116
1232
|
|
|
1117
1233
|
Looking at it (from the working copy, render and open push what changed first; with --deck <id>,
|
|
1118
1234
|
from anywhere)
|
|
@@ -1124,29 +1240,14 @@ from anywhere)
|
|
|
1124
1240
|
the URL only, open nothing
|
|
1125
1241
|
tobos open outside a deck: the person's decks, in Tobos
|
|
1126
1242
|
|
|
1127
|
-
The story (what the speaker says, held by the server; a scene mentioned: [Title](scene:<id>),
|
|
1128
|
-
a beat: [Title](scene:<id>/<beat>))
|
|
1129
|
-
tobos story the text, by \xB6 id
|
|
1130
|
-
tobos story edit <\xB6> "old" "new" change it, anchored on the exact text
|
|
1131
|
-
tobos story add [--after <\xB6>] "\u2026" a new paragraph (at the end, or after \xB6)
|
|
1132
|
-
tobos story delete <\xB6> a paragraph goes
|
|
1133
|
-
TOBOS_AGENT=<name> says which agent you are: the
|
|
1134
|
-
deck's page marks what you wrote
|
|
1135
|
-
|
|
1136
1243
|
The skill (what your harness reads to know Tobos without this help)
|
|
1137
1244
|
tobos skill install put it where Claude Code, Codex, OpenCode and others
|
|
1138
1245
|
read skills; later CLIs keep it up to date
|
|
1139
1246
|
|
|
1140
|
-
Templates (decks people start from: a new deck copies a template's master/)
|
|
1141
|
-
tobos new "Title" --from <id> start a deck from that template (default: Tobos
|
|
1142
|
-
simple; \`tobos ls\` lists the person's own)
|
|
1143
|
-
tobos new "Our brand" --template a new template: a copy of Tobos simple (or of --from)
|
|
1144
|
-
|
|
1145
1247
|
Every command takes --json and then prints one JSON object.
|
|
1146
|
-
Exit codes: 0 ok, 1 error, 2 the deck has problems, 3 not logged in (or not yet approved),
|
|
1147
|
-
changed the same lines (pull, resolve, push again
|
|
1148
|
-
|
|
1149
|
-
message and wait.
|
|
1248
|
+
Exit codes: 0 ok, 1 error, 2 the deck has problems, 3 not logged in (or not yet approved),
|
|
1249
|
+
4 a conflict: someone changed the same lines (pull, resolve, push again), 5 a plan's limit or an
|
|
1250
|
+
archived deck: the person decides what to do, so show them the message and wait.
|
|
1150
1251
|
`;
|
|
1151
1252
|
var COMMON = {
|
|
1152
1253
|
json: { type: "boolean" },
|
|
@@ -1182,10 +1283,6 @@ var TABLE = {
|
|
|
1182
1283
|
}
|
|
1183
1284
|
},
|
|
1184
1285
|
skill: { run: skill },
|
|
1185
|
-
story: {
|
|
1186
|
-
run: story,
|
|
1187
|
-
options: { deck: { type: "string" }, after: { type: "string" } }
|
|
1188
|
-
},
|
|
1189
1286
|
render: {
|
|
1190
1287
|
run: render,
|
|
1191
1288
|
options: {
|
|
@@ -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-LBUZHZFX.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-5LA45GOP.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({
|