@bitcobblers/wod-wiki-tools 0.42.2148 → 0.43.2150

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 (43) hide show
  1. package/dist/bin/wod.cjs +110 -11
  2. package/dist/bin/wod.cjs.map +1 -1
  3. package/dist/bin/wod.mjs +2 -2
  4. package/dist/{chunk-DHEXWQBU.mjs → chunk-D2AQYVU3.mjs} +48 -6
  5. package/dist/chunk-D2AQYVU3.mjs.map +1 -0
  6. package/dist/{chunk-VXFSQEMS.mjs → chunk-RVKV4WMA.mjs} +3 -3
  7. package/dist/chunk-RVKV4WMA.mjs.map +1 -0
  8. package/dist/index.cjs +110 -11
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.mjs +2 -2
  13. package/dist/{scaffoldCatalog-BY6FUYYW.mjs → scaffoldCatalog-OXITWHCI.mjs} +3 -3
  14. package/dist/{scaffoldCatalog-BY6FUYYW.mjs.map → scaffoldCatalog-OXITWHCI.mjs.map} +1 -1
  15. package/dist/skills/README.md +40 -0
  16. package/dist/skills/wod-extraction/SKILL.md +656 -0
  17. package/dist/skills-CZDOAQUB.mjs +57 -0
  18. package/dist/skills-CZDOAQUB.mjs.map +1 -0
  19. package/dist/web/playground/assets/main-DGG3i9qV.js +206 -0
  20. package/dist/web/playground/assets/main-ju42oR5B.css +2 -0
  21. package/dist/web/playground/assets/seedSync.worker-Dtm5ikdF.js +36 -0
  22. package/dist/web/playground/assets/{statementBuilderFlow-BeAnFeTJ.js → statementBuilderFlow-B3qp5guB.js} +2 -2
  23. package/dist/web/playground/index.html +2 -2
  24. package/dist/web/{server/seed/core/chunks/canvas.034cd2d8.json → playground/seed/core/chunks/canvas.851cb23d.json} +1 -1
  25. package/dist/web/playground/seed/core/chunks/{efforts.de0a7ecf.json → efforts.d87cfa3d.json} +1 -1
  26. package/dist/web/playground/seed/core/manifest.json +7 -7
  27. package/dist/web/playground/seed/core/report.html +10 -10
  28. package/dist/web/server/assets/main-fU6_8XGm.js +206 -0
  29. package/dist/web/server/assets/main-ju42oR5B.css +2 -0
  30. package/dist/web/server/assets/seedSync.worker-Dtm5ikdF.js +36 -0
  31. package/dist/web/server/assets/{statementBuilderFlow-CRtDUMGT.js → statementBuilderFlow-RCWlzYMU.js} +2 -2
  32. package/dist/web/server/index.html +2 -2
  33. package/dist/web/{playground/seed/core/chunks/canvas.034cd2d8.json → server/seed/core/chunks/canvas.851cb23d.json} +1 -1
  34. package/dist/web/server/seed/core/chunks/{efforts.de0a7ecf.json → efforts.d87cfa3d.json} +1 -1
  35. package/dist/web/server/seed/core/manifest.json +7 -7
  36. package/dist/web/server/seed/core/report.html +10 -10
  37. package/package.json +7 -7
  38. package/dist/chunk-DHEXWQBU.mjs.map +0 -1
  39. package/dist/chunk-VXFSQEMS.mjs.map +0 -1
  40. package/dist/web/playground/assets/main-Ca77F_Lt.js +0 -206
  41. package/dist/web/playground/assets/main-CnObKKRQ.css +0 -2
  42. package/dist/web/server/assets/main-CnObKKRQ.css +0 -2
  43. package/dist/web/server/assets/main-D9NNBwfl.js +0 -206
package/dist/bin/wod.cjs CHANGED
@@ -1029,7 +1029,7 @@ var init_compiler = __esm({
1029
1029
  var VERSION;
1030
1030
  var init_version = __esm({
1031
1031
  "src/version.ts"() {
1032
- VERSION = "0.42.2148";
1032
+ VERSION = "0.43.2150";
1033
1033
  }
1034
1034
  });
1035
1035
 
@@ -1238,6 +1238,63 @@ directory, \`https://owner.github.io/repo/\`, e.g.
1238
1238
  }
1239
1239
  });
1240
1240
 
1241
+ // src/cli/skills.ts
1242
+ var skills_exports = {};
1243
+ __export(skills_exports, {
1244
+ bundledSkillsRoot: () => bundledSkillsRoot,
1245
+ installSkills: () => installSkills,
1246
+ listBundledSkills: () => listBundledSkills
1247
+ });
1248
+ function frontmatterField(source, key) {
1249
+ const match = source.match(new RegExp(`^${key}:[ ]*(.*)$`, "m"));
1250
+ return match?.[1].trim().replace(/^(['"])(.*)\1$/, "$2") || void 0;
1251
+ }
1252
+ function listBundledSkills(root) {
1253
+ if (!fs.existsSync(root)) return [];
1254
+ return fs.readdirSync(root, { withFileTypes: true }).filter((entry) => entry.isDirectory() && fs.existsSync(path.join(root, entry.name, "SKILL.md"))).sort((a, b) => a.name.localeCompare(b.name)).map((entry) => {
1255
+ const source = fs.readFileSync(path.join(root, entry.name, "SKILL.md"), "utf-8");
1256
+ return {
1257
+ name: entry.name,
1258
+ description: frontmatterField(source, "description") ?? "",
1259
+ path: path.join(root, entry.name)
1260
+ };
1261
+ });
1262
+ }
1263
+ function bundledSkillsRoot() {
1264
+ const scriptDir = path.dirname(fs.realpathSync(process.argv[1] ?? process.cwd()));
1265
+ const candidates = ["skills", "../skills", "../../skills", "../../../skills", "../../../../skills"].map(
1266
+ (rel) => path.resolve(scriptDir, rel)
1267
+ );
1268
+ return candidates.find((candidate) => listBundledSkills(candidate).length > 0);
1269
+ }
1270
+ function installSkills(options = {}) {
1271
+ const root = options.root ?? bundledSkillsRoot();
1272
+ if (!root) {
1273
+ throw new Error("no bundled skills found next to this CLI \u2014 reinstall the package or run from the wod-wiki checkout");
1274
+ }
1275
+ const skills = listBundledSkills(root);
1276
+ if (skills.length === 0) throw new Error(`no skills under ${root}`);
1277
+ const target = path.join(path.resolve(options.dir ?? process.cwd()), ".agents", "skills");
1278
+ const installed = [];
1279
+ const skipped = [];
1280
+ for (const skill of skills) {
1281
+ const destination = path.join(target, skill.name);
1282
+ if (fs.existsSync(destination) && options.force !== true) {
1283
+ skipped.push(skill.name);
1284
+ continue;
1285
+ }
1286
+ fs.rmSync(destination, { recursive: true, force: true });
1287
+ fs.mkdirSync(target, { recursive: true });
1288
+ fs.cpSync(skill.path, destination, { recursive: true });
1289
+ installed.push(skill.name);
1290
+ }
1291
+ return { root, target, installed, skipped };
1292
+ }
1293
+ var init_skills = __esm({
1294
+ "src/cli/skills.ts"() {
1295
+ }
1296
+ });
1297
+
1241
1298
  // src/server/errors.ts
1242
1299
  var HttpError;
1243
1300
  var init_errors = __esm({
@@ -1541,13 +1598,13 @@ __export(server_exports, {
1541
1598
  runCliServer: () => runCliServer
1542
1599
  });
1543
1600
  function withResolvers() {
1544
- let resolve3;
1601
+ let resolve4;
1545
1602
  let reject;
1546
1603
  const promise = new Promise((res, rej) => {
1547
- resolve3 = res;
1604
+ resolve4 = res;
1548
1605
  reject = rej;
1549
1606
  });
1550
- return { promise, resolve: resolve3, reject };
1607
+ return { promise, resolve: resolve4, reject };
1551
1608
  }
1552
1609
  function startHttpServer(handler, host, port) {
1553
1610
  const b = globalThis.Bun;
@@ -1555,7 +1612,7 @@ function startHttpServer(handler, host, port) {
1555
1612
  const s = b.serve({ port, hostname: host, fetch: handler });
1556
1613
  return Promise.resolve({ stop: () => s.stop() });
1557
1614
  }
1558
- const { promise, resolve: resolve3, reject } = withResolvers();
1615
+ const { promise, resolve: resolve4, reject } = withResolvers();
1559
1616
  const server = http__default.default.createServer(async (req, res) => {
1560
1617
  try {
1561
1618
  const url = new URL(req.url || "/", `http://${req.headers.host || `${host}:${port}`}`);
@@ -1580,7 +1637,7 @@ function startHttpServer(handler, host, port) {
1580
1637
  });
1581
1638
  server.once("error", reject);
1582
1639
  server.listen(port, host, () => {
1583
- resolve3({
1640
+ resolve4({
1584
1641
  stop: () => {
1585
1642
  const close = withResolvers();
1586
1643
  server.close(() => close.resolve());
@@ -1724,8 +1781,8 @@ async function loadLanguagePack(moduleSpec) {
1724
1781
  try {
1725
1782
  let importPath = moduleSpec;
1726
1783
  if (moduleSpec.startsWith(".") || moduleSpec.startsWith("/") || moduleSpec.includes("\\") || moduleSpec.endsWith(".ts") || moduleSpec.endsWith(".js") || moduleSpec.endsWith(".mjs")) {
1727
- const { resolve: resolve3, pathToFileURL } = getPathUtils();
1728
- const resolved = resolve3(process.cwd(), moduleSpec);
1784
+ const { resolve: resolve4, pathToFileURL } = getPathUtils();
1785
+ const resolved = resolve4(process.cwd(), moduleSpec);
1729
1786
  importPath = pathToFileURL(resolved).href;
1730
1787
  }
1731
1788
  const imported = await import(
@@ -3944,7 +4001,7 @@ function parseCliArgs(args) {
3944
4001
  if (Number.isSafeInteger(v) && v >= 0) result.seedVersion = v;
3945
4002
  i++;
3946
4003
  } else if (!result.subcommand) {
3947
- if (arg === "parse" || arg === "run" || arg === "query" || arg === "download" || arg === "export" || arg === "import" || arg === "publish" || arg === "build" || arg === "seed" || arg === "reset" || arg === "init" || arg === "db" || arg === "server" || arg === "serve" || arg === "playground" || arg === "init-catalog" || arg === "help" || arg === "version") {
4004
+ if (arg === "parse" || arg === "run" || arg === "query" || arg === "download" || arg === "export" || arg === "import" || arg === "publish" || arg === "build" || arg === "seed" || arg === "reset" || arg === "init" || arg === "db" || arg === "server" || arg === "serve" || arg === "playground" || arg === "init-catalog" || arg === "skills" || arg === "help" || arg === "version") {
3948
4005
  result.subcommand = arg;
3949
4006
  } else {
3950
4007
  result.target = arg;
@@ -3984,13 +4041,13 @@ function readBunStdinText() {
3984
4041
  async function readStdin() {
3985
4042
  const bunText = readBunStdinText();
3986
4043
  if (bunText) return bunText();
3987
- return new Promise((resolve3, reject) => {
4044
+ return new Promise((resolve4, reject) => {
3988
4045
  const chunks = [];
3989
4046
  process.stdin.on("data", (chunk) => {
3990
4047
  chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
3991
4048
  });
3992
4049
  process.stdin.on("end", () => {
3993
- resolve3(Buffer.concat(chunks).toString("utf-8"));
4050
+ resolve4(Buffer.concat(chunks).toString("utf-8"));
3994
4051
  });
3995
4052
  process.stdin.on("error", (err) => {
3996
4053
  reject(err);
@@ -4014,6 +4071,13 @@ USAGE:
4014
4071
  Scaffold a new catalog repository (package.json, example
4015
4072
  collection, GitHub Actions Pages workflow). Refuses an
4016
4073
  existing destination.
4074
+ wod skills <list | install> [options]
4075
+ Agent skills bundled with this CLI \u2014 the Whiteboard
4076
+ Script extraction rules an agent needs to parse and write
4077
+ correct workouts. install copies them to
4078
+ <dir>/.agents/skills/ (no network); they are also
4079
+ publishable via npx skills add bitcobblers/wod-wiki.
4080
+ wod skills install [--dir <path>] [--force]
4017
4081
  wod seed [options]
4018
4082
  wod reset [options]
4019
4083
  wod init Initialize the configured database (idempotent)
@@ -4268,12 +4332,47 @@ async function cliMain(argv = process.argv.slice(2), io = {}) {
4268
4332
  const result = scaffoldCatalog2(parsed.target);
4269
4333
  writeOut(`[wod init-catalog] Created ${result.dir} (${result.files.length} files)`);
4270
4334
  writeOut(`Next: cd ${parsed.target} && bun install && bunx wod build . --output dist`);
4335
+ writeOut(`Agents: wod skills install --dir ${parsed.target} (Whiteboard Script extraction rules \u2192 .agents/skills/)`);
4271
4336
  return 0;
4272
4337
  } catch (error) {
4273
4338
  writeErr(`[wod init-catalog] ${error.message}`);
4274
4339
  return 1;
4275
4340
  }
4276
4341
  }
4342
+ if (parsed.subcommand === "skills") {
4343
+ const action = parsed.target ?? "list";
4344
+ const { bundledSkillsRoot: bundledSkillsRoot2, installSkills: installSkills2, listBundledSkills: listBundledSkills2 } = await Promise.resolve().then(() => (init_skills(), skills_exports));
4345
+ try {
4346
+ if (action === "list") {
4347
+ const root = bundledSkillsRoot2();
4348
+ if (!root) {
4349
+ writeErr("[wod skills] No bundled skills found next to this CLI");
4350
+ return 1;
4351
+ }
4352
+ const skills = listBundledSkills2(root);
4353
+ for (const skill of skills) writeOut(`${skill.name} \u2014 ${skill.description}`);
4354
+ writeOut(`[wod skills] ${skills.length} skill(s) from ${root}`);
4355
+ return 0;
4356
+ }
4357
+ if (action === "install") {
4358
+ const result = installSkills2({ dir: parsed.dir, force: parsed.force === true });
4359
+ for (const name of result.installed) writeOut(`[wod skills] installed ${name} \u2192 ${nodePath().join(result.target, name)}`);
4360
+ for (const name of result.skipped) writeOut(`[wod skills] ${name} already installed (use --force to replace)`);
4361
+ writeOut(`[wod skills] ${result.installed.length} installed, ${result.skipped.length} kept \u2014 source ${result.root}`);
4362
+ if (result.installed.length === 0 && result.skipped.length === 0) {
4363
+ writeErr("[wod skills] No bundled skills found");
4364
+ return 1;
4365
+ }
4366
+ writeOut("[wod skills] Agents read .agents/skills/; use `npx skills add bitcobblers/wod-wiki` for per-agent links.");
4367
+ return 0;
4368
+ }
4369
+ writeErr(`[wod skills] Unknown action '${action}' (expected: list | install)`);
4370
+ return 1;
4371
+ } catch (error) {
4372
+ writeErr(`[wod skills] ${error.message}`);
4373
+ return 1;
4374
+ }
4375
+ }
4277
4376
  if (parsed.subcommand === "parse") {
4278
4377
  if (!parsed.target) {
4279
4378
  writeErr('[wod parse] Error: Missing input file or "-" for stdin');