tutuca 0.9.39 → 0.9.41

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 (88) hide show
  1. package/dist/tutuca-cli.js +92 -39
  2. package/dist/tutuca-dev.js +18 -0
  3. package/dist/tutuca-dev.min.js +1 -1
  4. package/package.json +6 -7
  5. package/skill/immutable-js/SKILL.md +79 -0
  6. package/skill/immutable-js/references/collection.md +346 -0
  7. package/skill/immutable-js/references/conversions.md +99 -0
  8. package/skill/immutable-js/references/deep-updates.md +172 -0
  9. package/skill/immutable-js/references/equality.md +95 -0
  10. package/skill/immutable-js/references/list.md +266 -0
  11. package/skill/immutable-js/references/map.md +300 -0
  12. package/skill/immutable-js/references/predicates.md +93 -0
  13. package/skill/immutable-js/references/range-repeat.md +55 -0
  14. package/skill/immutable-js/references/record.md +196 -0
  15. package/skill/immutable-js/references/seq.md +248 -0
  16. package/skill/immutable-js/references/set.md +270 -0
  17. package/skill/immutable-js/references/shallow-functional.md +99 -0
  18. package/skill/immutable-js/references/stack.md +210 -0
  19. package/skill/margaui/SKILL.md +101 -0
  20. package/skill/margaui/components/accordion.md +127 -0
  21. package/skill/margaui/components/alert.md +174 -0
  22. package/skill/margaui/components/avatar.md +220 -0
  23. package/skill/margaui/components/badge.md +193 -0
  24. package/skill/margaui/components/breadcrumbs.md +103 -0
  25. package/skill/margaui/components/button.md +322 -0
  26. package/skill/margaui/components/calendar.md +67 -0
  27. package/skill/margaui/components/card.md +373 -0
  28. package/skill/margaui/components/carousel.md +387 -0
  29. package/skill/margaui/components/chat.md +171 -0
  30. package/skill/margaui/components/checkbox.md +101 -0
  31. package/skill/margaui/components/collapse.md +172 -0
  32. package/skill/margaui/components/countdown.md +165 -0
  33. package/skill/margaui/components/diff.md +53 -0
  34. package/skill/margaui/components/divider.md +107 -0
  35. package/skill/margaui/components/dock.md +173 -0
  36. package/skill/margaui/components/drawer.md +184 -0
  37. package/skill/margaui/components/dropdown.md +388 -0
  38. package/skill/margaui/components/fab.md +346 -0
  39. package/skill/margaui/components/fieldset.md +88 -0
  40. package/skill/margaui/components/file-input.md +84 -0
  41. package/skill/margaui/components/filter.md +52 -0
  42. package/skill/margaui/components/footer.md +583 -0
  43. package/skill/margaui/components/hero.md +135 -0
  44. package/skill/margaui/components/hover-3d.md +129 -0
  45. package/skill/margaui/components/hover-gallery.md +49 -0
  46. package/skill/margaui/components/indicator.md +265 -0
  47. package/skill/margaui/components/input.md +389 -0
  48. package/skill/margaui/components/join.md +100 -0
  49. package/skill/margaui/components/kbd.md +127 -0
  50. package/skill/margaui/components/label.md +102 -0
  51. package/skill/margaui/components/link.md +96 -0
  52. package/skill/margaui/components/list.md +182 -0
  53. package/skill/margaui/components/loading.md +105 -0
  54. package/skill/margaui/components/mask.md +168 -0
  55. package/skill/margaui/components/menu.md +856 -0
  56. package/skill/margaui/components/mockup-browser.md +39 -0
  57. package/skill/margaui/components/mockup-code.md +81 -0
  58. package/skill/margaui/components/mockup-phone.md +39 -0
  59. package/skill/margaui/components/mockup-window.md +33 -0
  60. package/skill/margaui/components/modal.md +178 -0
  61. package/skill/margaui/components/navbar.md +282 -0
  62. package/skill/margaui/components/pagination.md +122 -0
  63. package/skill/margaui/components/progress.md +135 -0
  64. package/skill/margaui/components/radial-progress.md +67 -0
  65. package/skill/margaui/components/radio.md +133 -0
  66. package/skill/margaui/components/range.md +134 -0
  67. package/skill/margaui/components/rating.md +170 -0
  68. package/skill/margaui/components/select.md +225 -0
  69. package/skill/margaui/components/skeleton.md +64 -0
  70. package/skill/margaui/components/stack.md +142 -0
  71. package/skill/margaui/components/stat.md +254 -0
  72. package/skill/margaui/components/status.md +73 -0
  73. package/skill/margaui/components/steps.md +138 -0
  74. package/skill/margaui/components/swap.md +152 -0
  75. package/skill/margaui/components/tab.md +248 -0
  76. package/skill/margaui/components/table.md +1018 -0
  77. package/skill/margaui/components/text-rotate.md +91 -0
  78. package/skill/margaui/components/textarea.md +85 -0
  79. package/skill/margaui/components/theme-controller.md +266 -0
  80. package/skill/margaui/components/timeline.md +1356 -0
  81. package/skill/margaui/components/toast.md +165 -0
  82. package/skill/margaui/components/toggle.md +135 -0
  83. package/skill/margaui/components/tooltip.md +181 -0
  84. package/skill/margaui/components/validator.md +163 -0
  85. package/skill/{advanced.md → tutuca/advanced.md} +5 -0
  86. package/skill/{cli.md → tutuca/cli.md} +17 -0
  87. package/skill/{core.md → tutuca/core.md} +5 -0
  88. /package/skill/{SKILL.md → tutuca/SKILL.md} +0 -0
@@ -10378,24 +10378,53 @@ __export(exports_install_skill, {
10378
10378
  run: () => run,
10379
10379
  describe: () => describe
10380
10380
  });
10381
- import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
10381
+ import { cpSync, existsSync, mkdirSync, readdirSync } from "node:fs";
10382
10382
  import { homedir } from "node:os";
10383
10383
  import { dirname, resolve } from "node:path";
10384
- import { parseArgs } from "node:util";
10385
10384
  import { fileURLToPath } from "node:url";
10386
- function findSkillDir() {
10385
+ import { parseArgs } from "node:util";
10386
+ function findSkillsRoot() {
10387
10387
  const here = dirname(fileURLToPath(import.meta.url));
10388
10388
  const candidates = [resolve(here, "..", "..", "..", "skill"), resolve(here, "..", "skill")];
10389
10389
  for (const c of candidates) {
10390
- if (existsSync(resolve(c, "SKILL.md")))
10390
+ if (existsSync(resolve(c, "tutuca", "SKILL.md")))
10391
10391
  return c;
10392
10392
  }
10393
10393
  return null;
10394
10394
  }
10395
- function targetDir(scope) {
10396
- if (scope === "user")
10397
- return resolve(homedir(), ".claude/skills/tutuca");
10398
- return resolve(process.cwd(), ".claude/skills/tutuca");
10395
+ function targetDir(scope, name) {
10396
+ const base = scope === "user" ? homedir() : process.cwd();
10397
+ return resolve(base, ".claude/skills", name);
10398
+ }
10399
+ function targetHasSkillFiles(dir) {
10400
+ if (!existsSync(dir))
10401
+ return false;
10402
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
10403
+ if (entry.isFile() && entry.name.endsWith(".md"))
10404
+ return true;
10405
+ if (entry.isDirectory() && targetHasSkillFiles(resolve(dir, entry.name)))
10406
+ return true;
10407
+ }
10408
+ return false;
10409
+ }
10410
+ function installSkill(skill, root, scope, force) {
10411
+ const src = resolve(root, skill.srcSubdir);
10412
+ if (!existsSync(resolve(src, "SKILL.md"))) {
10413
+ process.stderr.write(`tutuca: missing skill assets for ${skill.name} at ${src}
10414
+ `);
10415
+ process.exit(1);
10416
+ }
10417
+ const target = targetDir(scope, skill.name);
10418
+ if (targetHasSkillFiles(target) && !force) {
10419
+ process.stderr.write(`tutuca: ${target} already contains skill files. Re-run with --force to overwrite.
10420
+ `);
10421
+ process.exit(1);
10422
+ }
10423
+ mkdirSync(target, { recursive: true });
10424
+ cpSync(src, target, { recursive: true });
10425
+ const rel = scope === "project" ? `.claude/skills/${skill.name}` : target;
10426
+ process.stdout.write(`installed ${skill.name} skill → ${rel}
10427
+ `);
10399
10428
  }
10400
10429
  async function run(argv) {
10401
10430
  const parsed = parseArgs({
@@ -10403,62 +10432,68 @@ async function run(argv) {
10403
10432
  options: {
10404
10433
  user: { type: "boolean", default: false },
10405
10434
  project: { type: "boolean", default: false },
10435
+ "margaui-skill": { type: "boolean", default: false },
10436
+ "immutable-skill": { type: "boolean", default: false },
10437
+ all: { type: "boolean", default: false },
10406
10438
  force: { type: "boolean", short: "f", default: false },
10407
10439
  help: { type: "boolean", short: "h", default: false }
10408
10440
  },
10409
10441
  allowPositionals: false
10410
10442
  });
10411
10443
  if (parsed.values.help) {
10412
- process.stdout.write(`tutuca install-skill [--user | --project] [--force]
10444
+ process.stdout.write(`tutuca install-skill [--user | --project] [--margaui-skill | --immutable-skill | --all] [--force]
10445
+ ` + `
10446
+ ` + ` Installs Claude Code skill assets into .claude/skills/<name>/.
10447
+ ` + ` Defaults to --project (cwd); --user installs at ~/.claude/skills/.
10448
+ ` + `
10449
+ ` + ` Selection:
10450
+ ` + ` (default) install the tutuca skill
10451
+ ` + ` --margaui-skill install the margaui skill instead
10452
+ ` + ` --immutable-skill install the immutable-js skill instead
10453
+ ` + ` --all install every bundled skill (tutuca + margaui + immutable-js)
10413
10454
  ` + `
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
10455
  ` + ` --force overwrites existing files.
10418
10456
  `);
10419
10457
  return;
10420
10458
  }
10421
10459
  if (parsed.values.user && parsed.values.project) {
10422
10460
  process.stderr.write(`tutuca: --user and --project are mutually exclusive
10461
+ `);
10462
+ process.exit(1);
10463
+ }
10464
+ const selectionFlags = ["margaui-skill", "immutable-skill", "all"].filter((k) => parsed.values[k]);
10465
+ if (selectionFlags.length > 1) {
10466
+ process.stderr.write(`tutuca: ${selectionFlags.map((f) => `--${f}`).join(", ")} are mutually exclusive
10423
10467
  `);
10424
10468
  process.exit(1);
10425
10469
  }
10426
10470
  const scope = parsed.values.user ? "user" : "project";
10427
- const target = targetDir(scope);
10428
- const src = findSkillDir();
10429
- if (!src) {
10471
+ const root = findSkillsRoot();
10472
+ if (!root) {
10430
10473
  process.stderr.write(`tutuca: skill assets not found alongside this CLI.
10431
10474
  ` + "If you're running from a checkout, run `bun scripts/build-skill.js` first.\n");
10432
10475
  process.exit(1);
10433
10476
  }
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
- }
10477
+ let selected;
10478
+ if (parsed.values.all) {
10479
+ selected = SKILLS;
10480
+ } else {
10481
+ const selFlag = SKILLS.find((s) => s.flag && parsed.values[s.flag]);
10482
+ selected = selFlag ? [selFlag] : SKILLS.filter((s) => s.name === "tutuca");
10441
10483
  }
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);
10484
+ for (const skill of selected) {
10485
+ installSkill(skill, root, scope, parsed.values.force);
10452
10486
  }
10453
- const rel = scope === "project" ? ".claude/skills/tutuca" : target;
10454
- process.stdout.write(`installed tutuca skill → ${rel}
10455
- `);
10456
10487
  process.stdout.write(`Open a Claude Code session in this directory to use it.
10457
10488
  `);
10458
10489
  }
10459
- var describe = "Install the tutuca Claude Code skill into .claude/skills/tutuca/.", SKILL_FILES;
10490
+ var describe = "Install Claude Code skills (tutuca, margaui, immutable-js) into .claude/skills/.", SKILLS;
10460
10491
  var init_install_skill = __esm(() => {
10461
- SKILL_FILES = ["SKILL.md", "core.md", "cli.md", "advanced.md"];
10492
+ SKILLS = [
10493
+ { name: "tutuca", srcSubdir: "tutuca", flag: null },
10494
+ { name: "margaui", srcSubdir: "margaui", flag: "margaui-skill" },
10495
+ { name: "immutable-js", srcSubdir: "immutable-js", flag: "immutable-skill" }
10496
+ ];
10462
10497
  });
10463
10498
 
10464
10499
  // tools/tutuca.js
@@ -10670,7 +10705,7 @@ async function loadAndNormalize(modulePath) {
10670
10705
  }
10671
10706
 
10672
10707
  // tools/cli/output.js
10673
- import { writeFileSync as writeFileSync2 } from "node:fs";
10708
+ import { writeFileSync } from "node:fs";
10674
10709
 
10675
10710
  // tools/format/cli.js
10676
10711
  var exports_cli = {};
@@ -10815,6 +10850,24 @@ function lintIdToMessage(id, info) {
10815
10850
  return `Misnested formatting tag </${info.tag}> — adoption agency will reorder nodes${fmtLocationSuffix(info)}`;
10816
10851
  case "HTML_UNEXPECTED_END_TAG":
10817
10852
  return `Unexpected end tag </${info.tag}>${fmtLocationSuffix(info)}`;
10853
+ case "HTML_UNCLOSED_BEFORE_END":
10854
+ return `<${info.unclosed}> still open when </${info.tag}> was seen — implicitly closed${fmtLocationSuffix(info)}`;
10855
+ case "HTML_DUPLICATE_ATTRIBUTE":
10856
+ return `Duplicate attribute '${info.name}' — second occurrence dropped${fmtLocationSuffix(info)}`;
10857
+ case "HTML_ATTRIBUTES_ON_END_TAG":
10858
+ return `Attributes on end tag </${info.tag}> — dropped by the parser${fmtLocationSuffix(info)}`;
10859
+ case "HTML_SELF_CLOSING_END_TAG":
10860
+ return `Self-closing end tag </${info.tag}/> — trailing '/' is meaningless${fmtLocationSuffix(info)}`;
10861
+ case "HTML_MISSING_ATTRIBUTE_VALUE":
10862
+ return `Attribute '${info.name}' is missing a value${fmtLocationSuffix(info)}`;
10863
+ case "HTML_CDATA_IN_HTML_NAMESPACE":
10864
+ return `CDATA section in HTML namespace — reinterpreted as a bogus comment${fmtLocationSuffix(info)}`;
10865
+ case "HTML_BOGUS_COMMENT":
10866
+ return `Bogus comment — content dropped by the parser${fmtLocationSuffix(info)}`;
10867
+ case "HTML_SVG_ATTR_WILL_LOWERCASE":
10868
+ return `SVG attribute '${info.raw}' will be rewritten to '${info.canonical}'${fmtLocationSuffix(info)}`;
10869
+ case "HTML_MATHML_ATTR_WILL_LOWERCASE":
10870
+ return `MathML attribute '${info.raw}' will be rewritten to '${info.canonical}'${fmtLocationSuffix(info)}`;
10818
10871
  case "LINT_ERROR":
10819
10872
  return info.message;
10820
10873
  default:
@@ -11173,7 +11226,7 @@ async function formatResult(formatName, result, options = {}) {
11173
11226
  async function emit(result, { format: format5, pretty, output }) {
11174
11227
  const text = await formatResult(format5, result, { pretty });
11175
11228
  if (output) {
11176
- writeFileSync2(output, text);
11229
+ writeFileSync(output, text);
11177
11230
  } else {
11178
11231
  process.stdout.write(text);
11179
11232
  if (!text.endsWith(`
@@ -4471,6 +4471,24 @@ function lintIdToMessage(id, info) {
4471
4471
  return `Misnested formatting tag </${info.tag}> — adoption agency will reorder nodes${fmtLocationSuffix(info)}`;
4472
4472
  case "HTML_UNEXPECTED_END_TAG":
4473
4473
  return `Unexpected end tag </${info.tag}>${fmtLocationSuffix(info)}`;
4474
+ case "HTML_UNCLOSED_BEFORE_END":
4475
+ return `<${info.unclosed}> still open when </${info.tag}> was seen — implicitly closed${fmtLocationSuffix(info)}`;
4476
+ case "HTML_DUPLICATE_ATTRIBUTE":
4477
+ return `Duplicate attribute '${info.name}' — second occurrence dropped${fmtLocationSuffix(info)}`;
4478
+ case "HTML_ATTRIBUTES_ON_END_TAG":
4479
+ return `Attributes on end tag </${info.tag}> — dropped by the parser${fmtLocationSuffix(info)}`;
4480
+ case "HTML_SELF_CLOSING_END_TAG":
4481
+ return `Self-closing end tag </${info.tag}/> — trailing '/' is meaningless${fmtLocationSuffix(info)}`;
4482
+ case "HTML_MISSING_ATTRIBUTE_VALUE":
4483
+ return `Attribute '${info.name}' is missing a value${fmtLocationSuffix(info)}`;
4484
+ case "HTML_CDATA_IN_HTML_NAMESPACE":
4485
+ return `CDATA section in HTML namespace — reinterpreted as a bogus comment${fmtLocationSuffix(info)}`;
4486
+ case "HTML_BOGUS_COMMENT":
4487
+ return `Bogus comment — content dropped by the parser${fmtLocationSuffix(info)}`;
4488
+ case "HTML_SVG_ATTR_WILL_LOWERCASE":
4489
+ return `SVG attribute '${info.raw}' will be rewritten to '${info.canonical}'${fmtLocationSuffix(info)}`;
4490
+ case "HTML_MATHML_ATTR_WILL_LOWERCASE":
4491
+ return `MathML attribute '${info.raw}' will be rewritten to '${info.canonical}'${fmtLocationSuffix(info)}`;
4474
4492
  case "LINT_ERROR":
4475
4493
  return info.message;
4476
4494
  default: