@tobos/cli 0.4.29 → 0.4.30
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/chunk-67QAOIEN.js +350 -0
- package/dist/{chunk-3SEPIUUD.js → chunk-QZRWMMBR.js} +46 -2
- package/dist/cli.js +464 -574
- package/dist/{render-C7UKAYCT.js → render-WZUAK4TK.js} +2 -4
- package/dist/types-YY3IZCJO.js +27477 -0
- package/package.json +1 -1
- package/dist/chunk-BEVE4YBG.js +0 -55
- package/dist/chunk-TQNXR6KB.js +0 -55937
- package/dist/src-K2VVILG5.js +0 -50
- package/dist/types-BX3YXER7.js +0 -222
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __tobosRequire } from 'node:module';
|
|
3
|
+
const require = __tobosRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
init_define_TOBOS_PRESENT_TYPES,
|
|
6
|
+
init_define_TOBOS_SKILL,
|
|
7
|
+
init_define_TOBOS_TOOLCHAIN
|
|
8
|
+
} from "./chunk-QZRWMMBR.js";
|
|
9
|
+
|
|
10
|
+
// ../deck/src/deck-json.ts
|
|
11
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
12
|
+
init_define_TOBOS_SKILL();
|
|
13
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
14
|
+
var ID = /^[a-z][a-z0-9-]*$/;
|
|
15
|
+
var FILE = "deck.json";
|
|
16
|
+
var PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
17
|
+
var EXACT_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
18
|
+
var PROVIDED = /* @__PURE__ */ new Set(["svelte", "gsap"]);
|
|
19
|
+
var SCENES_MAX = 500;
|
|
20
|
+
var TITLE_MAX = 200;
|
|
21
|
+
var own = (entries) => Object.assign(/* @__PURE__ */ Object.create(null), Object.fromEntries(entries));
|
|
22
|
+
function problem(message, rule = "deck-json") {
|
|
23
|
+
return { file: FILE, rule, message, severity: "error" };
|
|
24
|
+
}
|
|
25
|
+
function isObject(value) {
|
|
26
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27
|
+
}
|
|
28
|
+
function parseDeckJson(text) {
|
|
29
|
+
if (text === void 0) return { problems: [problem("deck.json is missing.")] };
|
|
30
|
+
let raw;
|
|
31
|
+
try {
|
|
32
|
+
raw = JSON.parse(text);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
return { problems: [problem(`deck.json is not valid JSON: ${error.message}`)] };
|
|
35
|
+
}
|
|
36
|
+
const problems = [];
|
|
37
|
+
if (!isObject(raw)) return { problems: [problem("deck.json must be an object.")] };
|
|
38
|
+
const titled = (title, where, empty = true) => {
|
|
39
|
+
if (typeof title !== "string" || !empty && title.trim() === "")
|
|
40
|
+
problems.push(problem(`${where} must be a${empty ? "" : " non-empty"} string.`));
|
|
41
|
+
else if (title.length > TITLE_MAX)
|
|
42
|
+
problems.push(problem(`${where} is ${title.length} characters; at most ${TITLE_MAX}.`));
|
|
43
|
+
};
|
|
44
|
+
titled(raw.title, '"title"', false);
|
|
45
|
+
const chapterIds = /* @__PURE__ */ new Set();
|
|
46
|
+
const sceneIds = /* @__PURE__ */ new Set();
|
|
47
|
+
if (!Array.isArray(raw.chapters) || raw.chapters.length === 0) {
|
|
48
|
+
problems.push(problem('"chapters" must be a list with at least one chapter.'));
|
|
49
|
+
} else {
|
|
50
|
+
raw.chapters.forEach((chapter, c) => {
|
|
51
|
+
const where = `chapters[${c}]`;
|
|
52
|
+
if (!isObject(chapter)) return problems.push(problem(`${where} must be an object.`));
|
|
53
|
+
if (typeof chapter.id !== "string" || !ID.test(chapter.id))
|
|
54
|
+
problems.push(problem(`${where}.id must be lowercase letters, digits and dashes.`));
|
|
55
|
+
else if (chapterIds.has(chapter.id))
|
|
56
|
+
problems.push(problem(`Chapter "${chapter.id}" is listed twice.`));
|
|
57
|
+
else chapterIds.add(chapter.id);
|
|
58
|
+
titled(chapter.title, `${where}.title`);
|
|
59
|
+
if (!Array.isArray(chapter.scenes) || chapter.scenes.length === 0)
|
|
60
|
+
return problems.push(problem(`${where}.scenes must be a list with at least one scene.`));
|
|
61
|
+
chapter.scenes.forEach((scene, s) => {
|
|
62
|
+
const at = `${where}.scenes[${s}]`;
|
|
63
|
+
if (!isObject(scene)) return problems.push(problem(`${at} must be an object.`));
|
|
64
|
+
if (typeof scene.id !== "string" || !ID.test(scene.id))
|
|
65
|
+
problems.push(problem(`${at}.id must be lowercase letters, digits and dashes.`));
|
|
66
|
+
else if (sceneIds.has(scene.id))
|
|
67
|
+
problems.push(problem(`Scene "${scene.id}" is listed twice.`));
|
|
68
|
+
else sceneIds.add(scene.id);
|
|
69
|
+
titled(scene.title, `${at}.title`);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
const count = raw.chapters.reduce(
|
|
73
|
+
(sum, chapter) => sum + (isObject(chapter) && Array.isArray(chapter.scenes) ? chapter.scenes.length : 0),
|
|
74
|
+
0
|
|
75
|
+
);
|
|
76
|
+
if (count > SCENES_MAX)
|
|
77
|
+
problems.push(
|
|
78
|
+
problem(
|
|
79
|
+
`deck.json lists ${count} scenes; a deck may have ${SCENES_MAX}. Split it into several decks.`,
|
|
80
|
+
"scenes"
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (raw.dependencies !== void 0) {
|
|
85
|
+
if (!isObject(raw.dependencies)) problems.push(problem('"dependencies" must be an object.'));
|
|
86
|
+
else
|
|
87
|
+
for (const [name, version] of Object.entries(raw.dependencies)) {
|
|
88
|
+
if (!PACKAGE.test(name) || name.startsWith("@deck/") || name.startsWith("@tobos/"))
|
|
89
|
+
problems.push(problem(`"${name}" is not a package name a deck can depend on.`));
|
|
90
|
+
else if (PROVIDED.has(name))
|
|
91
|
+
problems.push(
|
|
92
|
+
problem(`"${name}" comes with Tobos: import it without listing it in "dependencies".`)
|
|
93
|
+
);
|
|
94
|
+
if (typeof version !== "string" || !EXACT_VERSION.test(version))
|
|
95
|
+
problems.push(problem(`"${name}" needs an exact version, like "7.9.0".`));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (problems.length > 0) return { problems };
|
|
99
|
+
const deck = {
|
|
100
|
+
title: raw.title,
|
|
101
|
+
chapters: raw.chapters.map((chapter) => ({
|
|
102
|
+
id: chapter.id,
|
|
103
|
+
title: chapter.title,
|
|
104
|
+
scenes: chapter.scenes.map((scene) => ({ id: scene.id, title: scene.title }))
|
|
105
|
+
}))
|
|
106
|
+
};
|
|
107
|
+
if (raw.dependencies !== void 0)
|
|
108
|
+
deck.dependencies = own(Object.entries(raw.dependencies));
|
|
109
|
+
return { deck, problems };
|
|
110
|
+
}
|
|
111
|
+
function parseMediaJson(text) {
|
|
112
|
+
if (text === void 0) return { media: own([]), problems: [] };
|
|
113
|
+
const bad = (message) => ({
|
|
114
|
+
media: own([]),
|
|
115
|
+
problems: [{ file: "media.json", rule: "media-json", message, severity: "error" }]
|
|
116
|
+
});
|
|
117
|
+
let raw;
|
|
118
|
+
try {
|
|
119
|
+
raw = JSON.parse(text);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
return bad(`media.json is not valid JSON: ${error.message}`);
|
|
122
|
+
}
|
|
123
|
+
if (!isObject(raw)) return bad("media.json must be an object.");
|
|
124
|
+
for (const [name, entry] of Object.entries(raw)) {
|
|
125
|
+
if (!isObject(entry) || typeof entry.hash !== "string" || !/^[0-9a-f]{64}$/.test(entry.hash) || typeof entry.size !== "number" || typeof entry.type !== "string")
|
|
126
|
+
return bad(`media.json entry "${name}" needs a sha256 "hash", a "size" and a "type".`);
|
|
127
|
+
}
|
|
128
|
+
return { media: own(Object.entries(raw)), problems: [] };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ../deck/src/format-problems.ts
|
|
132
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
133
|
+
init_define_TOBOS_SKILL();
|
|
134
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
135
|
+
function formatProblems(problems, limit = Infinity) {
|
|
136
|
+
const lines = problems.slice(0, limit).map((p) => {
|
|
137
|
+
const where = p.line ? `${p.file}:${p.line}${p.column ? `:${p.column}` : ""}` : p.file;
|
|
138
|
+
return `${where} ${p.severity} ${p.rule}: ${p.message}`;
|
|
139
|
+
});
|
|
140
|
+
const more = problems.length - lines.length;
|
|
141
|
+
if (more > 0) lines.push(`\u2026 and ${more} more: \`tobos check\` lists them all.`);
|
|
142
|
+
return lines.join("\n");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// ../deck/src/media-type.ts
|
|
146
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
147
|
+
init_define_TOBOS_SKILL();
|
|
148
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
149
|
+
import { extname } from "node:path";
|
|
150
|
+
var TYPES = {
|
|
151
|
+
".jpg": "image/jpeg",
|
|
152
|
+
".jpeg": "image/jpeg",
|
|
153
|
+
".png": "image/png",
|
|
154
|
+
".webp": "image/webp",
|
|
155
|
+
".avif": "image/avif",
|
|
156
|
+
".gif": "image/gif",
|
|
157
|
+
".svg": "image/svg+xml",
|
|
158
|
+
".mp4": "video/mp4",
|
|
159
|
+
".webm": "video/webm",
|
|
160
|
+
".mov": "video/quicktime",
|
|
161
|
+
".mp3": "audio/mpeg",
|
|
162
|
+
".m4a": "audio/mp4",
|
|
163
|
+
".aac": "audio/aac",
|
|
164
|
+
".opus": "audio/ogg",
|
|
165
|
+
".ogg": "audio/ogg",
|
|
166
|
+
".weba": "audio/webm",
|
|
167
|
+
".flac": "audio/flac",
|
|
168
|
+
".wav": "audio/wav",
|
|
169
|
+
".aif": "audio/aiff",
|
|
170
|
+
".aiff": "audio/aiff",
|
|
171
|
+
".pdf": "application/pdf",
|
|
172
|
+
".glb": "model/gltf-binary",
|
|
173
|
+
".gltf": "model/gltf+json",
|
|
174
|
+
".json": "application/json",
|
|
175
|
+
".bin": "application/octet-stream",
|
|
176
|
+
".woff2": "font/woff2",
|
|
177
|
+
".vtt": "text/vtt",
|
|
178
|
+
".txt": "text/plain"
|
|
179
|
+
};
|
|
180
|
+
function mediaTypeOf(name) {
|
|
181
|
+
return TYPES[extname(name).toLowerCase()] ?? "application/octet-stream";
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// ../deck/src/merge.ts
|
|
185
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
186
|
+
init_define_TOBOS_SKILL();
|
|
187
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
188
|
+
var MOST = 4e6;
|
|
189
|
+
function mergeText(base, ours, theirs) {
|
|
190
|
+
if (ours === theirs || theirs === base) return ours;
|
|
191
|
+
if (ours === base) return theirs;
|
|
192
|
+
const [b, o, t] = [base, ours, theirs].map(split);
|
|
193
|
+
let changes;
|
|
194
|
+
try {
|
|
195
|
+
changes = [hunksOf(b, o), hunksOf(b, t)];
|
|
196
|
+
} catch (error) {
|
|
197
|
+
if (error instanceof TooLarge) return void 0;
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
const hunks = [
|
|
201
|
+
...changes[0].map((h) => ({ ...h, side: 0 })),
|
|
202
|
+
...changes[1].map((h) => ({ ...h, side: 1 }))
|
|
203
|
+
].sort((x, y) => x.from - y.from || x.to - y.to);
|
|
204
|
+
const merged = [];
|
|
205
|
+
let at = 0;
|
|
206
|
+
for (let i = 0; i < hunks.length; ) {
|
|
207
|
+
const group = [hunks[i]];
|
|
208
|
+
let to = hunks[i].to;
|
|
209
|
+
for (i++; i < hunks.length && overlaps(hunks[i], group.at(-1).from, to); i++) {
|
|
210
|
+
group.push(hunks[i]);
|
|
211
|
+
to = Math.max(to, hunks[i].to);
|
|
212
|
+
}
|
|
213
|
+
const from = group[0].from;
|
|
214
|
+
const sides = new Set(group.map((h) => h.side));
|
|
215
|
+
let lines;
|
|
216
|
+
if (sides.size === 1) lines = applied(b, group, from, to);
|
|
217
|
+
else {
|
|
218
|
+
const mine = applied(
|
|
219
|
+
b,
|
|
220
|
+
group.filter((h) => h.side === 0),
|
|
221
|
+
from,
|
|
222
|
+
to
|
|
223
|
+
);
|
|
224
|
+
const yours = applied(
|
|
225
|
+
b,
|
|
226
|
+
group.filter((h) => h.side === 1),
|
|
227
|
+
from,
|
|
228
|
+
to
|
|
229
|
+
);
|
|
230
|
+
if (mine.join("") !== yours.join("")) return void 0;
|
|
231
|
+
lines = mine;
|
|
232
|
+
}
|
|
233
|
+
merged.push(...b.slice(at, from), ...lines);
|
|
234
|
+
at = to;
|
|
235
|
+
}
|
|
236
|
+
merged.push(...b.slice(at));
|
|
237
|
+
return merged.join("");
|
|
238
|
+
}
|
|
239
|
+
function overlaps(hunk, from, to) {
|
|
240
|
+
return hunk.from < to || hunk.from === from || hunk.from === to && (hunk.to === to || from === to);
|
|
241
|
+
}
|
|
242
|
+
function applied(base, hunks, from, to) {
|
|
243
|
+
const out = [];
|
|
244
|
+
let at = from;
|
|
245
|
+
for (const hunk of hunks) {
|
|
246
|
+
out.push(...base.slice(at, hunk.from), ...hunk.lines);
|
|
247
|
+
at = hunk.to;
|
|
248
|
+
}
|
|
249
|
+
out.push(...base.slice(at, to));
|
|
250
|
+
return out;
|
|
251
|
+
}
|
|
252
|
+
function split(text) {
|
|
253
|
+
return text.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
254
|
+
}
|
|
255
|
+
function hunksOf(all, other) {
|
|
256
|
+
let start = 0;
|
|
257
|
+
while (start < all.length && start < other.length && all[start] === other[start]) start++;
|
|
258
|
+
let end = 0;
|
|
259
|
+
while (end < all.length - start && end < other.length - start && all[all.length - 1 - end] === other[other.length - 1 - end])
|
|
260
|
+
end++;
|
|
261
|
+
const a = all.slice(start, all.length - end);
|
|
262
|
+
const b = other.slice(start, other.length - end);
|
|
263
|
+
if ((a.length + 1) * (b.length + 1) > MOST) throw new TooLarge();
|
|
264
|
+
return middleHunks(a, b).map((h) => ({ ...h, from: h.from + start, to: h.to + start }));
|
|
265
|
+
}
|
|
266
|
+
var TooLarge = class extends Error {
|
|
267
|
+
};
|
|
268
|
+
function middleHunks(a, b) {
|
|
269
|
+
const width = b.length + 1;
|
|
270
|
+
const tail = new Int32Array((a.length + 1) * width);
|
|
271
|
+
for (let i2 = a.length - 1; i2 >= 0; i2--)
|
|
272
|
+
for (let j2 = b.length - 1; j2 >= 0; j2--)
|
|
273
|
+
tail[i2 * width + j2] = a[i2] === b[j2] ? tail[(i2 + 1) * width + j2 + 1] + 1 : Math.max(tail[(i2 + 1) * width + j2], tail[i2 * width + j2 + 1]);
|
|
274
|
+
const hunks = [];
|
|
275
|
+
let [i, j] = [0, 0];
|
|
276
|
+
let open;
|
|
277
|
+
const close = () => {
|
|
278
|
+
if (open) hunks.push(open);
|
|
279
|
+
open = void 0;
|
|
280
|
+
};
|
|
281
|
+
while (i < a.length || j < b.length) {
|
|
282
|
+
if (i < a.length && j < b.length && a[i] === b[j]) {
|
|
283
|
+
close();
|
|
284
|
+
i++;
|
|
285
|
+
j++;
|
|
286
|
+
} else if (j < b.length && (i === a.length || tail[i * width + j + 1] >= tail[(i + 1) * width + j])) {
|
|
287
|
+
open ??= { from: i, to: i, lines: [] };
|
|
288
|
+
open.lines.push(b[j++]);
|
|
289
|
+
} else {
|
|
290
|
+
open ??= { from: i, to: i, lines: [] };
|
|
291
|
+
open.to = ++i;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
close();
|
|
295
|
+
return hunks;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// ../deck/src/tar.ts
|
|
299
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
300
|
+
init_define_TOBOS_SKILL();
|
|
301
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
302
|
+
import { promisify } from "node:util";
|
|
303
|
+
import { gunzipSync, gzip } from "node:zlib";
|
|
304
|
+
var gzipped = promisify(gzip);
|
|
305
|
+
var BLOCK = 512;
|
|
306
|
+
function unpackTar(gzipped2) {
|
|
307
|
+
const tar = gunzipSync(gzipped2);
|
|
308
|
+
const files = /* @__PURE__ */ new Map();
|
|
309
|
+
let longPath;
|
|
310
|
+
for (let at = 0; at + BLOCK <= tar.length; ) {
|
|
311
|
+
const block = tar.subarray(at, at + BLOCK);
|
|
312
|
+
if (block.every((b) => b === 0)) break;
|
|
313
|
+
const field = (from, length) => block.subarray(from, from + length).toString("utf8").replace(/\0.*$/s, "");
|
|
314
|
+
const size = Number.parseInt(field(124, 12).trim() || "0", 8);
|
|
315
|
+
const type = field(156, 1) || "0";
|
|
316
|
+
const prefix = field(345, 155);
|
|
317
|
+
const name = prefix ? `${prefix}/${field(0, 100)}` : field(0, 100);
|
|
318
|
+
const body = tar.subarray(at + BLOCK, at + BLOCK + size);
|
|
319
|
+
at += BLOCK + Math.ceil(size / BLOCK) * BLOCK;
|
|
320
|
+
if (type === "x") {
|
|
321
|
+
longPath = paxPath(body);
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
if (type === "0" || type === "\0") files.set(longPath ?? name, new Uint8Array(body));
|
|
325
|
+
longPath = void 0;
|
|
326
|
+
}
|
|
327
|
+
return files;
|
|
328
|
+
}
|
|
329
|
+
function paxPath(body) {
|
|
330
|
+
const bytes = Buffer.from(body);
|
|
331
|
+
let path;
|
|
332
|
+
for (let at = 0; at < bytes.length; ) {
|
|
333
|
+
const space = bytes.indexOf(32, at);
|
|
334
|
+
const length = Number(bytes.subarray(at, space).toString("ascii"));
|
|
335
|
+
if (space < 0 || !Number.isInteger(length) || length <= space - at + 1) break;
|
|
336
|
+
const record = bytes.subarray(space + 1, at + length - 1).toString("utf8");
|
|
337
|
+
if (record.startsWith("path=")) path = record.slice("path=".length);
|
|
338
|
+
at += length;
|
|
339
|
+
}
|
|
340
|
+
return path;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export {
|
|
344
|
+
formatProblems,
|
|
345
|
+
parseDeckJson,
|
|
346
|
+
parseMediaJson,
|
|
347
|
+
mediaTypeOf,
|
|
348
|
+
mergeText,
|
|
349
|
+
unpackTar
|
|
350
|
+
};
|
|
@@ -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
|
|
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 no one is logged in. Ask the person for their e-mail address and run `tobos login <email>`. Then ask, in one line, for the 6-digit code it mailed them (it may be in spam, and using it accepts https://tobos.ai/terms), and run `tobos login --code <code>`. 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, also in a browser `tobos open` logged in.\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- **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\n## The story\n\nA deck's story is the talk as the speaker tells it, in paragraphs. What follows a mention of a scene, `[Title](scene:<id>)` or one of its beats, `[Title](scene:<id>/<beat>)`, up to the next mention, is that scene's: the presenter sees it as speaker notes. The server holds the story, not git: the person types in it on the deck's page, and you change it with `tobos story`.\n\n- Read it again right before each change: the person may be typing.\n- Change what the person asked, and keep the rest of their words as they are.\n- An edit is anchored on exact text that occurs once in its paragraph. Exit code 4 means the paragraph changed meanwhile: anchor on it as the reply gives it, and try again.\n- Set `TOBOS_AGENT` to your name (`claude`, `codex`), so the page shows what you wrote.\n" };
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
@@ -128,6 +128,44 @@ var init_define_TOBOS_TOOLCHAIN = __esm({
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
+
// src/out.ts
|
|
132
|
+
init_define_TOBOS_PRESENT_TYPES();
|
|
133
|
+
init_define_TOBOS_SKILL();
|
|
134
|
+
init_define_TOBOS_TOOLCHAIN();
|
|
135
|
+
var EXIT = { ok: 0, error: 1, problems: 2, auth: 3, conflict: 4, limit: 5 };
|
|
136
|
+
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.";
|
|
137
|
+
var CliError = class extends Error {
|
|
138
|
+
exit;
|
|
139
|
+
extra;
|
|
140
|
+
constructor(message, exit = EXIT.error, extra = {}) {
|
|
141
|
+
super(message);
|
|
142
|
+
this.exit = exit;
|
|
143
|
+
this.extra = extra;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var update;
|
|
147
|
+
function offerUpdate(line) {
|
|
148
|
+
update = line;
|
|
149
|
+
}
|
|
150
|
+
function createOutput(json) {
|
|
151
|
+
return {
|
|
152
|
+
json,
|
|
153
|
+
note(message, always = false) {
|
|
154
|
+
if (!json || always) process.stderr.write(`${message}
|
|
155
|
+
`);
|
|
156
|
+
},
|
|
157
|
+
result(value, human) {
|
|
158
|
+
if (json) process.stdout.write(`${JSON.stringify(update ? { ...value, update } : value)}
|
|
159
|
+
`);
|
|
160
|
+
else {
|
|
161
|
+
const text = human();
|
|
162
|
+
if (text) process.stdout.write(text.endsWith("\n") ? text : `${text}
|
|
163
|
+
`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
131
169
|
export {
|
|
132
170
|
__commonJS,
|
|
133
171
|
__export,
|
|
@@ -137,5 +175,11 @@ export {
|
|
|
137
175
|
init_define_TOBOS_SKILL,
|
|
138
176
|
define_TOBOS_SKILL_default,
|
|
139
177
|
init_define_TOBOS_TOOLCHAIN,
|
|
140
|
-
define_TOBOS_TOOLCHAIN_default
|
|
178
|
+
define_TOBOS_TOOLCHAIN_default,
|
|
179
|
+
EXIT,
|
|
180
|
+
ASK_THE_PERSON,
|
|
181
|
+
CliError,
|
|
182
|
+
update,
|
|
183
|
+
offerUpdate,
|
|
184
|
+
createOutput
|
|
141
185
|
};
|