tutuca 0.9.40 → 0.9.42

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.
Files changed (93) hide show
  1. package/README.md +1 -1
  2. package/dist/tutuca-cli.js +75 -39
  3. package/dist/tutuca-dev.js +1 -0
  4. package/dist/tutuca-dev.min.js +1 -1
  5. package/dist/tutuca-extra.js +1 -0
  6. package/dist/tutuca-extra.min.js +1 -1
  7. package/dist/tutuca.js +1 -0
  8. package/dist/tutuca.min.js +1 -1
  9. package/package.json +6 -7
  10. package/skill/immutable-js/SKILL.md +79 -0
  11. package/skill/immutable-js/references/collection.md +346 -0
  12. package/skill/immutable-js/references/conversions.md +99 -0
  13. package/skill/immutable-js/references/deep-updates.md +172 -0
  14. package/skill/immutable-js/references/equality.md +95 -0
  15. package/skill/immutable-js/references/list.md +266 -0
  16. package/skill/immutable-js/references/map.md +300 -0
  17. package/skill/immutable-js/references/predicates.md +93 -0
  18. package/skill/immutable-js/references/range-repeat.md +55 -0
  19. package/skill/immutable-js/references/record.md +196 -0
  20. package/skill/immutable-js/references/seq.md +248 -0
  21. package/skill/immutable-js/references/set.md +270 -0
  22. package/skill/immutable-js/references/shallow-functional.md +99 -0
  23. package/skill/immutable-js/references/stack.md +210 -0
  24. package/skill/margaui/SKILL.md +101 -0
  25. package/skill/margaui/components/accordion.md +127 -0
  26. package/skill/margaui/components/alert.md +174 -0
  27. package/skill/margaui/components/avatar.md +220 -0
  28. package/skill/margaui/components/badge.md +193 -0
  29. package/skill/margaui/components/breadcrumbs.md +103 -0
  30. package/skill/margaui/components/button.md +322 -0
  31. package/skill/margaui/components/calendar.md +67 -0
  32. package/skill/margaui/components/card.md +373 -0
  33. package/skill/margaui/components/carousel.md +387 -0
  34. package/skill/margaui/components/chat.md +171 -0
  35. package/skill/margaui/components/checkbox.md +101 -0
  36. package/skill/margaui/components/collapse.md +172 -0
  37. package/skill/margaui/components/countdown.md +165 -0
  38. package/skill/margaui/components/diff.md +53 -0
  39. package/skill/margaui/components/divider.md +107 -0
  40. package/skill/margaui/components/dock.md +173 -0
  41. package/skill/margaui/components/drawer.md +184 -0
  42. package/skill/margaui/components/dropdown.md +388 -0
  43. package/skill/margaui/components/fab.md +346 -0
  44. package/skill/margaui/components/fieldset.md +88 -0
  45. package/skill/margaui/components/file-input.md +84 -0
  46. package/skill/margaui/components/filter.md +52 -0
  47. package/skill/margaui/components/footer.md +583 -0
  48. package/skill/margaui/components/hero.md +135 -0
  49. package/skill/margaui/components/hover-3d.md +129 -0
  50. package/skill/margaui/components/hover-gallery.md +49 -0
  51. package/skill/margaui/components/indicator.md +265 -0
  52. package/skill/margaui/components/input.md +389 -0
  53. package/skill/margaui/components/join.md +100 -0
  54. package/skill/margaui/components/kbd.md +127 -0
  55. package/skill/margaui/components/label.md +102 -0
  56. package/skill/margaui/components/link.md +96 -0
  57. package/skill/margaui/components/list.md +182 -0
  58. package/skill/margaui/components/loading.md +105 -0
  59. package/skill/margaui/components/mask.md +168 -0
  60. package/skill/margaui/components/menu.md +856 -0
  61. package/skill/margaui/components/mockup-browser.md +39 -0
  62. package/skill/margaui/components/mockup-code.md +81 -0
  63. package/skill/margaui/components/mockup-phone.md +39 -0
  64. package/skill/margaui/components/mockup-window.md +33 -0
  65. package/skill/margaui/components/modal.md +178 -0
  66. package/skill/margaui/components/navbar.md +282 -0
  67. package/skill/margaui/components/pagination.md +122 -0
  68. package/skill/margaui/components/progress.md +135 -0
  69. package/skill/margaui/components/radial-progress.md +67 -0
  70. package/skill/margaui/components/radio.md +133 -0
  71. package/skill/margaui/components/range.md +134 -0
  72. package/skill/margaui/components/rating.md +170 -0
  73. package/skill/margaui/components/select.md +225 -0
  74. package/skill/margaui/components/skeleton.md +64 -0
  75. package/skill/margaui/components/stack.md +142 -0
  76. package/skill/margaui/components/stat.md +254 -0
  77. package/skill/margaui/components/status.md +73 -0
  78. package/skill/margaui/components/steps.md +138 -0
  79. package/skill/margaui/components/swap.md +152 -0
  80. package/skill/margaui/components/tab.md +248 -0
  81. package/skill/margaui/components/table.md +1018 -0
  82. package/skill/margaui/components/text-rotate.md +91 -0
  83. package/skill/margaui/components/textarea.md +85 -0
  84. package/skill/margaui/components/theme-controller.md +266 -0
  85. package/skill/margaui/components/timeline.md +1356 -0
  86. package/skill/margaui/components/toast.md +165 -0
  87. package/skill/margaui/components/toggle.md +135 -0
  88. package/skill/margaui/components/tooltip.md +181 -0
  89. package/skill/margaui/components/validator.md +163 -0
  90. package/skill/{advanced.md → tutuca/advanced.md} +6 -1
  91. package/skill/{cli.md → tutuca/cli.md} +17 -0
  92. package/skill/{core.md → tutuca/core.md} +39 -5
  93. /package/skill/{SKILL.md → tutuca/SKILL.md} +0 -0
package/README.md CHANGED
@@ -27,7 +27,7 @@ For an interactive walk-through with editable examples, see the
27
27
  <body>
28
28
  <div id="app"></div>
29
29
  <script type="module">
30
- import { component, html, tutuca } from "https://esm.sh/tutuca";
30
+ import { component, html, tutuca } from "https://cdn.jsdelivr.net/npm/tutuca/+esm";
31
31
 
32
32
  const Counter = component({
33
33
  name: "Counter",
@@ -5125,6 +5125,7 @@ var init_transactor = __esm(() => {
5125
5125
  args[i] = args[i].toHandlerArg(dispatcher);
5126
5126
  }
5127
5127
  }
5128
+ args.push(new EventContext(this.path, this.transactor, this));
5128
5129
  return [handler, args];
5129
5130
  }
5130
5131
  lookupName(name) {
@@ -10378,24 +10379,53 @@ __export(exports_install_skill, {
10378
10379
  run: () => run,
10379
10380
  describe: () => describe
10380
10381
  });
10381
- import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
10382
+ import { cpSync, existsSync, mkdirSync, readdirSync } from "node:fs";
10382
10383
  import { homedir } from "node:os";
10383
10384
  import { dirname, resolve } from "node:path";
10384
- import { parseArgs } from "node:util";
10385
10385
  import { fileURLToPath } from "node:url";
10386
- function findSkillDir() {
10386
+ import { parseArgs } from "node:util";
10387
+ function findSkillsRoot() {
10387
10388
  const here = dirname(fileURLToPath(import.meta.url));
10388
10389
  const candidates = [resolve(here, "..", "..", "..", "skill"), resolve(here, "..", "skill")];
10389
10390
  for (const c of candidates) {
10390
- if (existsSync(resolve(c, "SKILL.md")))
10391
+ if (existsSync(resolve(c, "tutuca", "SKILL.md")))
10391
10392
  return c;
10392
10393
  }
10393
10394
  return null;
10394
10395
  }
10395
- function targetDir(scope) {
10396
- if (scope === "user")
10397
- return resolve(homedir(), ".claude/skills/tutuca");
10398
- return resolve(process.cwd(), ".claude/skills/tutuca");
10396
+ function targetDir(scope, name) {
10397
+ const base = scope === "user" ? homedir() : process.cwd();
10398
+ return resolve(base, ".claude/skills", name);
10399
+ }
10400
+ function targetHasSkillFiles(dir) {
10401
+ if (!existsSync(dir))
10402
+ return false;
10403
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
10404
+ if (entry.isFile() && entry.name.endsWith(".md"))
10405
+ return true;
10406
+ if (entry.isDirectory() && targetHasSkillFiles(resolve(dir, entry.name)))
10407
+ return true;
10408
+ }
10409
+ return false;
10410
+ }
10411
+ function installSkill(skill, root, scope, force) {
10412
+ const src = resolve(root, skill.srcSubdir);
10413
+ if (!existsSync(resolve(src, "SKILL.md"))) {
10414
+ process.stderr.write(`tutuca: missing skill assets for ${skill.name} at ${src}
10415
+ `);
10416
+ process.exit(1);
10417
+ }
10418
+ const target = targetDir(scope, skill.name);
10419
+ if (targetHasSkillFiles(target) && !force) {
10420
+ process.stderr.write(`tutuca: ${target} already contains skill files. Re-run with --force to overwrite.
10421
+ `);
10422
+ process.exit(1);
10423
+ }
10424
+ mkdirSync(target, { recursive: true });
10425
+ cpSync(src, target, { recursive: true });
10426
+ const rel = scope === "project" ? `.claude/skills/${skill.name}` : target;
10427
+ process.stdout.write(`installed ${skill.name} skill → ${rel}
10428
+ `);
10399
10429
  }
10400
10430
  async function run(argv) {
10401
10431
  const parsed = parseArgs({
@@ -10403,62 +10433,68 @@ async function run(argv) {
10403
10433
  options: {
10404
10434
  user: { type: "boolean", default: false },
10405
10435
  project: { type: "boolean", default: false },
10436
+ "margaui-skill": { type: "boolean", default: false },
10437
+ "immutable-skill": { type: "boolean", default: false },
10438
+ all: { type: "boolean", default: false },
10406
10439
  force: { type: "boolean", short: "f", default: false },
10407
10440
  help: { type: "boolean", short: "h", default: false }
10408
10441
  },
10409
10442
  allowPositionals: false
10410
10443
  });
10411
10444
  if (parsed.values.help) {
10412
- process.stdout.write(`tutuca install-skill [--user | --project] [--force]
10445
+ process.stdout.write(`tutuca install-skill [--user | --project] [--margaui-skill | --immutable-skill | --all] [--force]
10446
+ ` + `
10447
+ ` + ` Installs Claude Code skill assets into .claude/skills/<name>/.
10448
+ ` + ` Defaults to --project (cwd); --user installs at ~/.claude/skills/.
10449
+ ` + `
10450
+ ` + ` Selection:
10451
+ ` + ` (default) install the tutuca skill
10452
+ ` + ` --margaui-skill install the margaui skill instead
10453
+ ` + ` --immutable-skill install the immutable-js skill instead
10454
+ ` + ` --all install every bundled skill (tutuca + margaui + immutable-js)
10413
10455
  ` + `
10414
- ` + ` Copies SKILL.md + core.md + cli.md + advanced.md into
10415
- ` + ` .claude/skills/tutuca/. Defaults to --project (cwd).
10416
- ` + ` --user installs at ~/.claude/skills/tutuca/.
10417
10456
  ` + ` --force overwrites existing files.
10418
10457
  `);
10419
10458
  return;
10420
10459
  }
10421
10460
  if (parsed.values.user && parsed.values.project) {
10422
10461
  process.stderr.write(`tutuca: --user and --project are mutually exclusive
10462
+ `);
10463
+ process.exit(1);
10464
+ }
10465
+ const selectionFlags = ["margaui-skill", "immutable-skill", "all"].filter((k) => parsed.values[k]);
10466
+ if (selectionFlags.length > 1) {
10467
+ process.stderr.write(`tutuca: ${selectionFlags.map((f) => `--${f}`).join(", ")} are mutually exclusive
10423
10468
  `);
10424
10469
  process.exit(1);
10425
10470
  }
10426
10471
  const scope = parsed.values.user ? "user" : "project";
10427
- const target = targetDir(scope);
10428
- const src = findSkillDir();
10429
- if (!src) {
10472
+ const root = findSkillsRoot();
10473
+ if (!root) {
10430
10474
  process.stderr.write(`tutuca: skill assets not found alongside this CLI.
10431
10475
  ` + "If you're running from a checkout, run `bun scripts/build-skill.js` first.\n");
10432
10476
  process.exit(1);
10433
10477
  }
10434
- if (existsSync(target) && !parsed.values.force) {
10435
- const existing = readdirSync(target).filter((n) => SKILL_FILES.includes(n));
10436
- if (existing.length > 0) {
10437
- process.stderr.write(`tutuca: ${target} already contains skill files. Re-run with --force to overwrite.
10438
- `);
10439
- process.exit(1);
10440
- }
10478
+ let selected;
10479
+ if (parsed.values.all) {
10480
+ selected = SKILLS;
10481
+ } else {
10482
+ const selFlag = SKILLS.find((s) => s.flag && parsed.values[s.flag]);
10483
+ selected = selFlag ? [selFlag] : SKILLS.filter((s) => s.name === "tutuca");
10441
10484
  }
10442
- mkdirSync(target, { recursive: true });
10443
- for (const name of SKILL_FILES) {
10444
- const from = resolve(src, name);
10445
- if (!existsSync(from)) {
10446
- process.stderr.write(`tutuca: missing skill asset: ${from}
10447
- `);
10448
- process.exit(1);
10449
- }
10450
- const buf = readFileSync(from);
10451
- writeFileSync(resolve(target, name), buf);
10485
+ for (const skill of selected) {
10486
+ installSkill(skill, root, scope, parsed.values.force);
10452
10487
  }
10453
- const rel = scope === "project" ? ".claude/skills/tutuca" : target;
10454
- process.stdout.write(`installed tutuca skill → ${rel}
10455
- `);
10456
10488
  process.stdout.write(`Open a Claude Code session in this directory to use it.
10457
10489
  `);
10458
10490
  }
10459
- var describe = "Install the tutuca Claude Code skill into .claude/skills/tutuca/.", SKILL_FILES;
10491
+ var describe = "Install Claude Code skills (tutuca, margaui, immutable-js) into .claude/skills/.", SKILLS;
10460
10492
  var init_install_skill = __esm(() => {
10461
- SKILL_FILES = ["SKILL.md", "core.md", "cli.md", "advanced.md"];
10493
+ SKILLS = [
10494
+ { name: "tutuca", srcSubdir: "tutuca", flag: null },
10495
+ { name: "margaui", srcSubdir: "margaui", flag: "margaui-skill" },
10496
+ { name: "immutable-js", srcSubdir: "immutable-js", flag: "immutable-skill" }
10497
+ ];
10462
10498
  });
10463
10499
 
10464
10500
  // tools/tutuca.js
@@ -10670,7 +10706,7 @@ async function loadAndNormalize(modulePath) {
10670
10706
  }
10671
10707
 
10672
10708
  // tools/cli/output.js
10673
- import { writeFileSync as writeFileSync2 } from "node:fs";
10709
+ import { writeFileSync } from "node:fs";
10674
10710
 
10675
10711
  // tools/format/cli.js
10676
10712
  var exports_cli = {};
@@ -11191,7 +11227,7 @@ async function formatResult(formatName, result, options = {}) {
11191
11227
  async function emit(result, { format: format5, pretty, output }) {
11192
11228
  const text = await formatResult(format5, result, { pretty });
11193
11229
  if (output) {
11194
- writeFileSync2(output, text);
11230
+ writeFileSync(output, text);
11195
11231
  } else {
11196
11232
  process.stdout.write(text);
11197
11233
  if (!text.endsWith(`
@@ -4987,6 +4987,7 @@ class InputEvent extends Transaction {
4987
4987
  args[i] = args[i].toHandlerArg(dispatcher);
4988
4988
  }
4989
4989
  }
4990
+ args.push(new EventContext(this.path, this.transactor, this));
4990
4991
  return [handler, args];
4991
4992
  }
4992
4993
  lookupName(name) {