@tobos/cli 0.4.19 → 0.4.21

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.
@@ -55055,6 +55055,11 @@ function parseMediaJson(text3) {
55055
55055
  }
55056
55056
  return { media: own(Object.entries(raw)), problems: [] };
55057
55057
  }
55058
+ function formatMediaJson(media) {
55059
+ const sorted = Object.entries(media).sort(([a], [b]) => a.localeCompare(b));
55060
+ return `${JSON.stringify(Object.fromEntries(sorted), null, 2)}
55061
+ `;
55062
+ }
55058
55063
  function parseMasterJson(text3) {
55059
55064
  if (text3 === void 0) return { rules: {}, problems: [] };
55060
55065
  const bad = (message) => ({
@@ -55086,6 +55091,87 @@ function sha256(data2) {
55086
55091
  return createHash("sha256").update(data2).digest("hex");
55087
55092
  }
55088
55093
 
55094
+ // ../deck/src/share.ts
55095
+ init_define_TOBOS_PRESENT_TYPES();
55096
+ init_define_TOBOS_SKILL();
55097
+ init_define_TOBOS_TOOLCHAIN();
55098
+ var DECK_PREFIX = "@deck/";
55099
+ var MASTER_PREFIX = `${DECK_PREFIX}master/`;
55100
+ function sharedManifest(manifest) {
55101
+ const { uses, ...rest2 } = manifest;
55102
+ const chapters = manifest.chapters.map((chapter) => ({
55103
+ ...chapter,
55104
+ scenes: chapter.scenes.filter((scene) => !scene.activity).map((scene) => {
55105
+ const shown = { ...scene };
55106
+ delete shown.note;
55107
+ return shown;
55108
+ })
55109
+ })).filter((chapter) => chapter.scenes.length > 0);
55110
+ if (!uses) {
55111
+ const left = new Set(
55112
+ manifest.chapters.flatMap((c) => c.scenes.filter((s) => s.activity).map((s) => s.module))
55113
+ );
55114
+ return {
55115
+ ...rest2,
55116
+ imports: Object.fromEntries(
55117
+ Object.entries(manifest.imports).filter(([specifier]) => !left.has(specifier))
55118
+ ),
55119
+ chapters
55120
+ };
55121
+ }
55122
+ const { reached, media } = walk2(
55123
+ manifest.media,
55124
+ uses,
55125
+ chapters.flatMap((c) => c.scenes.map((s) => s.module))
55126
+ );
55127
+ return {
55128
+ ...rest2,
55129
+ // The packages the server bundled stay: they are npm's, not the deck's.
55130
+ imports: Object.fromEntries(
55131
+ Object.entries(manifest.imports).filter(
55132
+ ([specifier]) => !specifier.startsWith(DECK_PREFIX) || reached.has(specifier)
55133
+ )
55134
+ ),
55135
+ media: Object.fromEntries(Object.entries(manifest.media).filter(([name]) => media.has(name))),
55136
+ chapters
55137
+ };
55138
+ }
55139
+ function mediaInUse(manifest) {
55140
+ const { uses } = manifest;
55141
+ if (!uses) return manifest.media;
55142
+ const roots = [
55143
+ ...manifest.chapters.flatMap((c) => c.scenes.map((s) => s.module)),
55144
+ ...Object.keys(uses.modules).filter((specifier) => specifier.startsWith(MASTER_PREFIX))
55145
+ ];
55146
+ const { media } = walk2(manifest.media, uses, roots);
55147
+ return Object.fromEntries(
55148
+ Object.entries(manifest.media).filter(
55149
+ ([name]) => media.has(name) || name.startsWith("master/")
55150
+ )
55151
+ );
55152
+ }
55153
+ function walk2(all, uses, roots) {
55154
+ const reached = /* @__PURE__ */ new Set();
55155
+ const media = new Set(uses.styles);
55156
+ const patterns = /* @__PURE__ */ new Set();
55157
+ const queue = [...roots];
55158
+ while (queue.length > 0) {
55159
+ const specifier = queue.pop();
55160
+ if (reached.has(specifier)) continue;
55161
+ reached.add(specifier);
55162
+ const used = Object.hasOwn(uses.modules, specifier) ? uses.modules[specifier] : void 0;
55163
+ queue.push(...used?.imports ?? []);
55164
+ for (const name of used?.media ?? []) media.add(name);
55165
+ for (const pattern of used?.patterns ?? []) patterns.add(pattern);
55166
+ }
55167
+ const named = Object.keys(all).filter((name) => !media.has(name));
55168
+ for (const name of mediaMatching(named, patterns)) media.add(name);
55169
+ return { reached, media };
55170
+ }
55171
+ function servesModule(manifest, path) {
55172
+ return Object.values(manifest.imports).includes(path) || (manifest.styles ?? []).includes(path);
55173
+ }
55174
+
55089
55175
  // ../deck/src/strip-types.ts
55090
55176
  init_define_TOBOS_PRESENT_TYPES();
55091
55177
  init_define_TOBOS_SKILL();
@@ -55106,7 +55192,7 @@ function stripTypes(source2) {
55106
55192
  }
55107
55193
 
55108
55194
  // ../deck/src/build.ts
55109
- var DECK_PREFIX = "@deck/";
55195
+ var DECK_PREFIX2 = "@deck/";
55110
55196
  var SOURCE = /\.(svelte|ts|js|mjs|json)$/;
55111
55197
  var RUNTIME_PACKAGES = /* @__PURE__ */ new Set(["svelte", "gsap", "@tobos/present"]);
55112
55198
  var BuildCache = class {
@@ -55420,7 +55506,7 @@ function emitModules(compiled) {
55420
55506
  for (const entry of file.imports) {
55421
55507
  const spec = entry.specifier;
55422
55508
  if (!spec.startsWith("./") && !spec.startsWith("../")) continue;
55423
- const replacement = DECK_PREFIX + resolvePath(path, spec);
55509
+ const replacement = DECK_PREFIX2 + resolvePath(path, spec);
55424
55510
  const quoted = entry.dynamic && /^['"`]/.test(file.code.slice(entry.start, entry.start + 1));
55425
55511
  code += file.code.slice(last, entry.start) + (quoted ? JSON.stringify(replacement) : replacement);
55426
55512
  last = entry.end;
@@ -55428,7 +55514,7 @@ function emitModules(compiled) {
55428
55514
  code += file.code.slice(last);
55429
55515
  const name = `m/${sha256(code).slice(0, 20)}.js`;
55430
55516
  modules.set(name, code);
55431
- imports2[DECK_PREFIX + path] = name;
55517
+ imports2[DECK_PREFIX2 + path] = name;
55432
55518
  }
55433
55519
  return {
55434
55520
  modules,
@@ -55458,11 +55544,11 @@ function modulesUses(compiled, mediaOf) {
55458
55544
  const imports2 = /* @__PURE__ */ new Set();
55459
55545
  for (const { specifier } of file.imports)
55460
55546
  if (specifier?.startsWith("./") || specifier?.startsWith("../"))
55461
- imports2.add(DECK_PREFIX + resolvePath(path, specifier));
55547
+ imports2.add(DECK_PREFIX2 + resolvePath(path, specifier));
55462
55548
  const names = /* @__PURE__ */ new Set();
55463
55549
  const patterns = /* @__PURE__ */ new Set();
55464
55550
  for (const ref2 of mediaOf.get(path) ?? []) (ref2.pattern ? patterns : names).add(ref2.name);
55465
- modules[DECK_PREFIX + path] = {
55551
+ modules[DECK_PREFIX2 + path] = {
55466
55552
  ...imports2.size ? { imports: [...imports2].sort() } : {},
55467
55553
  ...names.size ? { media: [...names].sort() } : {},
55468
55554
  ...patterns.size ? { patterns: [...patterns].sort() } : {}
@@ -55471,23 +55557,19 @@ function modulesUses(compiled, mediaOf) {
55471
55557
  return modules;
55472
55558
  }
55473
55559
  var sizeText = (bytes) => bytes < 1e6 ? `${Math.ceil(bytes / 1e3)} KB` : `${+(bytes / 1e6).toFixed(1)} MB`;
55474
- function unusedMedia(media, uses) {
55475
- const used = new Set(uses.styles);
55476
- const patterns = /* @__PURE__ */ new Set();
55477
- for (const { media: names, patterns: more } of Object.values(uses.modules)) {
55478
- for (const name of names ?? []) used.add(name);
55479
- for (const pattern of more ?? []) patterns.add(pattern);
55480
- }
55481
- const named = Object.keys(media).filter((name) => !used.has(name) && !name.startsWith("master/"));
55482
- const matched = new Set(mediaMatching(named, patterns));
55483
- const unused = named.filter((name) => !matched.has(name));
55560
+ var KEPT_MEDIA_DAYS = 7;
55561
+ function unusedMedia(manifest) {
55562
+ const { media } = manifest;
55563
+ const used = mediaInUse(manifest);
55564
+ const unused = Object.keys(media).filter((name) => !Object.hasOwn(used, name));
55484
55565
  if (unused.length === 0) return void 0;
55485
55566
  const bytes = unused.reduce((sum, name) => sum + media[name].size, 0);
55486
55567
  const shown = unused.length > 10 ? [...unused.slice(0, 10), `${unused.length - 10} more`] : unused;
55568
+ const one = unused.length === 1;
55487
55569
  return {
55488
55570
  file: "media.json",
55489
55571
  rule: "media",
55490
- message: `media.json lists ${unused.length === 1 ? "1 file" : `${unused.length} files`} no scene or master uses (${sizeText(bytes)}): ${and(shown)}. Remove ${unused.length === 1 ? "it" : "them"} from media/ and media.json to free their room.`,
55572
+ message: `media.json lists ${one ? "1 file" : `${unused.length} files`} no slide shows (${sizeText(bytes)}): ${and(shown)}. ${one ? "It doesn't" : "They don't"} count toward the plan, and the server keeps ${one ? "it" : "them"} for ${KEPT_MEDIA_DAYS} days: to show ${one ? "it" : "one"} after that, drop it again, or push it from media/.`,
55491
55573
  severity: "warning"
55492
55574
  };
55493
55575
  }
@@ -55585,8 +55667,6 @@ async function buildDeck(tree, options = {}) {
55585
55667
  modules: modulesUses(graph.compiled, mediaOf),
55586
55668
  styles: stylesheet?.media ?? []
55587
55669
  };
55588
- const unused = unusedMedia(media, uses);
55589
- if (unused) problems.push(unused);
55590
55670
  const chapters = deck.chapters.map((chapter) => ({
55591
55671
  id: chapter.id,
55592
55672
  title: chapter.title,
@@ -55597,11 +55677,13 @@ async function buildDeck(tree, options = {}) {
55597
55677
  id: scene.id,
55598
55678
  title: scene.title,
55599
55679
  beats: (analysis?.beats ?? []).map((b) => b.id),
55600
- module: DECK_PREFIX + file,
55680
+ module: DECK_PREFIX2 + file,
55601
55681
  ...analysis?.activity ? { activity: analysis.activity.activity } : {}
55602
55682
  };
55603
55683
  })
55604
55684
  }));
55685
+ const unused = unusedMedia({ chapters, media, uses });
55686
+ if (unused) problems.push(unused);
55605
55687
  for (const [key2, file] of graph.fresh) options.cache?.set(key2, file);
55606
55688
  return {
55607
55689
  problems,
@@ -55663,65 +55745,61 @@ async function masterOf(tree) {
55663
55745
  return { files, media, dependencies: await masterDependencies(tree) };
55664
55746
  }
55665
55747
 
55666
- // ../deck/src/share.ts
55748
+ // ../deck/src/format-problems.ts
55667
55749
  init_define_TOBOS_PRESENT_TYPES();
55668
55750
  init_define_TOBOS_SKILL();
55669
55751
  init_define_TOBOS_TOOLCHAIN();
55670
- var DECK_PREFIX2 = "@deck/";
55671
- function sharedManifest(manifest) {
55672
- const { uses, ...rest2 } = manifest;
55673
- const chapters = manifest.chapters.map((chapter) => ({
55674
- ...chapter,
55675
- scenes: chapter.scenes.filter((scene) => !scene.activity).map((scene) => {
55676
- const shown = { ...scene };
55677
- delete shown.note;
55678
- return shown;
55679
- })
55680
- })).filter((chapter) => chapter.scenes.length > 0);
55681
- if (!uses) {
55682
- const left = new Set(
55683
- manifest.chapters.flatMap((c) => c.scenes.filter((s) => s.activity).map((s) => s.module))
55684
- );
55685
- return {
55686
- ...rest2,
55687
- imports: Object.fromEntries(
55688
- Object.entries(manifest.imports).filter(([specifier]) => !left.has(specifier))
55689
- ),
55690
- chapters
55691
- };
55692
- }
55693
- const reached = /* @__PURE__ */ new Set();
55694
- const media = new Set(uses.styles);
55695
- const patterns = /* @__PURE__ */ new Set();
55696
- const queue = chapters.flatMap((c) => c.scenes.map((s) => s.module));
55697
- while (queue.length > 0) {
55698
- const specifier = queue.pop();
55699
- if (reached.has(specifier)) continue;
55700
- reached.add(specifier);
55701
- const used = Object.hasOwn(uses.modules, specifier) ? uses.modules[specifier] : void 0;
55702
- queue.push(...used?.imports ?? []);
55703
- for (const name of used?.media ?? []) media.add(name);
55704
- for (const pattern of used?.patterns ?? []) patterns.add(pattern);
55705
- }
55706
- const named = Object.keys(manifest.media).filter((name) => !media.has(name));
55707
- for (const name of mediaMatching(named, patterns)) media.add(name);
55708
- return {
55709
- ...rest2,
55710
- // The packages the server bundled stay: they are npm's, not the deck's.
55711
- imports: Object.fromEntries(
55712
- Object.entries(manifest.imports).filter(
55713
- ([specifier]) => !specifier.startsWith(DECK_PREFIX2) || reached.has(specifier)
55714
- )
55715
- ),
55716
- media: Object.fromEntries(Object.entries(manifest.media).filter(([name]) => media.has(name))),
55717
- chapters
55718
- };
55719
- }
55720
- function servesModule(manifest, path) {
55721
- return Object.values(manifest.imports).includes(path) || (manifest.styles ?? []).includes(path);
55752
+ function formatProblems(problems, limit = Infinity) {
55753
+ const lines2 = problems.slice(0, limit).map((p) => {
55754
+ const where = p.line ? `${p.file}:${p.line}${p.column ? `:${p.column}` : ""}` : p.file;
55755
+ return `${where} ${p.severity} ${p.rule}: ${p.message}`;
55756
+ });
55757
+ const more = problems.length - lines2.length;
55758
+ if (more > 0) lines2.push(`\u2026 and ${more} more: \`tobos check\` lists them all.`);
55759
+ return lines2.join("\n");
55760
+ }
55761
+
55762
+ // ../deck/src/media-type.ts
55763
+ init_define_TOBOS_PRESENT_TYPES();
55764
+ init_define_TOBOS_SKILL();
55765
+ init_define_TOBOS_TOOLCHAIN();
55766
+ import { extname } from "node:path";
55767
+ var TYPES = {
55768
+ ".jpg": "image/jpeg",
55769
+ ".jpeg": "image/jpeg",
55770
+ ".png": "image/png",
55771
+ ".webp": "image/webp",
55772
+ ".avif": "image/avif",
55773
+ ".gif": "image/gif",
55774
+ ".svg": "image/svg+xml",
55775
+ ".mp4": "video/mp4",
55776
+ ".webm": "video/webm",
55777
+ ".mov": "video/quicktime",
55778
+ ".mp3": "audio/mpeg",
55779
+ ".m4a": "audio/mp4",
55780
+ ".aac": "audio/aac",
55781
+ ".opus": "audio/ogg",
55782
+ ".ogg": "audio/ogg",
55783
+ ".weba": "audio/webm",
55784
+ ".flac": "audio/flac",
55785
+ ".wav": "audio/wav",
55786
+ ".aif": "audio/aiff",
55787
+ ".aiff": "audio/aiff",
55788
+ ".pdf": "application/pdf",
55789
+ ".glb": "model/gltf-binary",
55790
+ ".gltf": "model/gltf+json",
55791
+ ".json": "application/json",
55792
+ ".bin": "application/octet-stream",
55793
+ ".woff2": "font/woff2",
55794
+ ".vtt": "text/vtt",
55795
+ ".txt": "text/plain"
55796
+ };
55797
+ function mediaTypeOf(name) {
55798
+ return TYPES[extname(name).toLowerCase()] ?? "application/octet-stream";
55722
55799
  }
55723
55800
 
55724
55801
  export {
55802
+ formatProblems,
55725
55803
  TEXT_MAX,
55726
55804
  openActivity,
55727
55805
  activitiesOf,
@@ -55731,10 +55809,14 @@ export {
55731
55809
  ID,
55732
55810
  parseDeckJson,
55733
55811
  parseMediaJson,
55812
+ formatMediaJson,
55734
55813
  sha256,
55814
+ sharedManifest,
55815
+ mediaInUse,
55816
+ servesModule,
55735
55817
  createCache,
55818
+ KEPT_MEDIA_DAYS,
55736
55819
  buildDeck,
55737
55820
  masterOf,
55738
- sharedManifest,
55739
- servesModule
55821
+ mediaTypeOf
55740
55822
  };
package/dist/cli.js CHANGED
@@ -2,8 +2,10 @@
2
2
  import { createRequire as __tobosRequire } from 'node:module';
3
3
  const require = __tobosRequire(import.meta.url);
4
4
  import {
5
- formatProblems
6
- } from "./chunk-XJ7FDNTP.js";
5
+ formatMediaJson,
6
+ formatProblems,
7
+ mediaTypeOf
8
+ } from "./chunk-6VC3QOQM.js";
7
9
  import {
8
10
  ASK_THE_PERSON,
9
11
  CliError,
@@ -87,7 +89,7 @@ function settings() {
87
89
  }
88
90
 
89
91
  // src/api.ts
90
- var VERSION = true ? "0.4.19" : "dev";
92
+ var VERSION = true ? "0.4.21" : "dev";
91
93
  function newer(a, b) {
92
94
  const parse = (v) => /^\d+\.\d+\.\d+/.test(v) ? v.split(".").map((n) => parseInt(n)) : null;
93
95
  const x = parse(a);
@@ -340,38 +342,8 @@ import {
340
342
  statSync,
341
343
  writeFileSync as writeFileSync2
342
344
  } from "node:fs";
343
- import { extname, join as join4, relative, sep } from "node:path";
345
+ import { join as join4, relative, sep } from "node:path";
344
346
  import { Readable } from "node:stream";
345
- var TYPES = {
346
- ".jpg": "image/jpeg",
347
- ".jpeg": "image/jpeg",
348
- ".png": "image/png",
349
- ".webp": "image/webp",
350
- ".avif": "image/avif",
351
- ".gif": "image/gif",
352
- ".svg": "image/svg+xml",
353
- ".mp4": "video/mp4",
354
- ".webm": "video/webm",
355
- ".mov": "video/quicktime",
356
- ".mp3": "audio/mpeg",
357
- ".m4a": "audio/mp4",
358
- ".aac": "audio/aac",
359
- ".opus": "audio/ogg",
360
- ".ogg": "audio/ogg",
361
- ".weba": "audio/webm",
362
- ".flac": "audio/flac",
363
- ".wav": "audio/wav",
364
- ".aif": "audio/aiff",
365
- ".aiff": "audio/aiff",
366
- ".pdf": "application/pdf",
367
- ".glb": "model/gltf-binary",
368
- ".gltf": "model/gltf+json",
369
- ".json": "application/json",
370
- ".bin": "application/octet-stream",
371
- ".woff2": "font/woff2",
372
- ".vtt": "text/vtt",
373
- ".txt": "text/plain"
374
- };
375
347
  var LOSSLESS = /\.(wav|aiff?|flac)$/i;
376
348
  var shellWord = (path) => /^[\w./-]+$/.test(path) ? path : `'${path.replaceAll("'", "'\\''")}'`;
377
349
  function sizeNote(name, size) {
@@ -439,13 +411,13 @@ async function syncMediaJson(root) {
439
411
  media[name] = {
440
412
  hash,
441
413
  size,
442
- type: TYPES[extname(name).toLowerCase()] ?? "application/octet-stream"
414
+ type: mediaTypeOf(name)
443
415
  };
444
416
  }
445
417
  mkdirSync2(join4(root, ".tobos"), { recursive: true });
446
418
  writeFileSync2(cacheFile, JSON.stringify(cache));
447
419
  const sorted = Object.fromEntries(Object.entries(media).sort(([a], [b]) => a.localeCompare(b)));
448
- const after = JSON.stringify(sorted, null, 2) + "\n";
420
+ const after = formatMediaJson(sorted);
449
421
  if (after !== before) writeFileSync2(file2, after);
450
422
  return { media: sorted, changed: after !== before };
451
423
  }
@@ -462,7 +434,7 @@ async function uploadMedia(root, media, server, deck, note) {
462
434
  const path = mediaFile(root, name);
463
435
  if (!existsSync2(path))
464
436
  throw new CliError(
465
- `media/${name} is in media.json but not on this machine, and the server doesn't have it.`
437
+ `media/${name} is on a slide but not on this machine, and the server doesn't have it: put it in media/, then push again.`
466
438
  );
467
439
  note(`uploading media/${name} (${Math.round(entry.size / 1e3)} kB)`);
468
440
  const response = await request(`/api/media/${hash}?deck=${deck}`, {
@@ -758,7 +730,7 @@ async function pushedFiles(root) {
758
730
  }
759
731
  }
760
732
  async function runCheck(dir2) {
761
- const { buildDeck } = await import("./src-6IFWTNIY.js");
733
+ const { buildDeck } = await import("./src-ZEUJHNUL.js");
762
734
  const started = performance.now();
763
735
  const files = await pushedFiles(dir2.root);
764
736
  const result = await buildDeck(directoryTree(dir2.root, files));
@@ -819,7 +791,7 @@ async function check(out, args) {
819
791
  await syncMediaJson(deck.root);
820
792
  const result = await runCheck(deck);
821
793
  if (args.values.types) {
822
- const { checkTypes } = await import("./types-QVZY4DVU.js");
794
+ const { checkTypes } = await import("./types-WUAQW4MO.js");
823
795
  const sent = result.files && new Set(result.files);
824
796
  result.problems.push(
825
797
  ...(await checkTypes(deck.root, (m) => out.note(m))).filter((p) => sent?.has(p.file) ?? true)
@@ -846,11 +818,13 @@ async function pushWorkingCopy(out, deck, message) {
846
818
  const result = await runCheck(deck);
847
819
  const { errors, warnings } = problemSummary(result.problems);
848
820
  if (errors > 0) return { ok: false, errors, warnings, problems: result.problems };
849
- for (const [name, entry] of Object.entries(media)) {
821
+ const { mediaInUse } = await import("./src-ZEUJHNUL.js");
822
+ const shown = result.manifest ? mediaInUse(result.manifest) : media;
823
+ for (const [name, entry] of Object.entries(shown)) {
850
824
  const note = sizeNote(name, entry.size);
851
825
  if (note) out.note(note, true);
852
826
  }
853
- const uploaded = await uploadMedia(root, media, server, deck.id, (m) => out.note(m));
827
+ const uploaded = await uploadMedia(root, shown, server, deck.id, (m) => out.note(m));
854
828
  await gitOk(["add", "-A"], { cwd: root });
855
829
  const committed = (await gitOk(["diff", "--cached", "--name-only"], { cwd: root })).split("\n").filter(Boolean);
856
830
  for (const file2 of committed) out.note(` ${file2}`);
@@ -3,12 +3,17 @@ import { createRequire as __tobosRequire } from 'node:module';
3
3
  const require = __tobosRequire(import.meta.url);
4
4
  import {
5
5
  ID,
6
+ KEPT_MEDIA_DAYS,
6
7
  TEXT_MAX,
7
8
  activitiesOf,
8
9
  buildDeck,
9
10
  createCache,
11
+ formatMediaJson,
12
+ formatProblems,
10
13
  isSafePath,
11
14
  masterOf,
15
+ mediaInUse,
16
+ mediaTypeOf,
12
17
  memoryTree,
13
18
  openActivity,
14
19
  parseDeckJson,
@@ -17,20 +22,21 @@ import {
17
22
  servesModule,
18
23
  sha256,
19
24
  sharedManifest
20
- } from "./chunk-LMYDB4CF.js";
21
- import {
22
- formatProblems
23
- } from "./chunk-XJ7FDNTP.js";
25
+ } from "./chunk-6VC3QOQM.js";
24
26
  import "./chunk-O52ON2LV.js";
25
27
  export {
26
28
  ID,
29
+ KEPT_MEDIA_DAYS,
27
30
  TEXT_MAX,
28
31
  activitiesOf,
29
32
  buildDeck,
30
33
  createCache,
34
+ formatMediaJson,
31
35
  formatProblems,
32
36
  isSafePath,
33
37
  masterOf,
38
+ mediaInUse,
39
+ mediaTypeOf,
34
40
  memoryTree,
35
41
  openActivity,
36
42
  parseDeckJson,
@@ -3,8 +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-LMYDB4CF.js";
7
- import "./chunk-XJ7FDNTP.js";
6
+ } from "./chunk-6VC3QOQM.js";
8
7
  import {
9
8
  CliError
10
9
  } from "./chunk-4CLH25WE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tobos/cli",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "description": "The command line of Tobos: https://tobos.ai",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-ALv2",
@@ -1,26 +0,0 @@
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-O52ON2LV.js";
9
-
10
- // ../deck/src/format-problems.ts
11
- init_define_TOBOS_PRESENT_TYPES();
12
- init_define_TOBOS_SKILL();
13
- init_define_TOBOS_TOOLCHAIN();
14
- function formatProblems(problems, limit = Infinity) {
15
- const lines = problems.slice(0, limit).map((p) => {
16
- const where = p.line ? `${p.file}:${p.line}${p.column ? `:${p.column}` : ""}` : p.file;
17
- return `${where} ${p.severity} ${p.rule}: ${p.message}`;
18
- });
19
- const more = problems.length - lines.length;
20
- if (more > 0) lines.push(`\u2026 and ${more} more: \`tobos check\` lists them all.`);
21
- return lines.join("\n");
22
- }
23
-
24
- export {
25
- formatProblems
26
- };