@open-document/core 0.1.0 → 0.3.0

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 (52) hide show
  1. package/dist/{build-BWZJ1gvL.js → build-C3pMGxJN.js} +2 -6
  2. package/dist/check-Dtwb1wvU.js +42 -0
  3. package/dist/cli/bin.d.ts +1 -1
  4. package/dist/cli/bin.js +124 -13
  5. package/dist/{config-EBFfKtWH.d.ts → config-CSC5lHsR.d.ts} +3 -2
  6. package/dist/config-Dg1AMP0r.js +2461 -0
  7. package/dist/context-FoX0afRf.js +26 -0
  8. package/dist/{dev-CZtw1oqs.js → dev-Cdd7NZRQ.js} +2 -6
  9. package/dist/diagram-xlVDekYk.js +763 -0
  10. package/dist/export-ClJ4T1uU.js +36 -0
  11. package/dist/import-D7Psi8WK.js +25 -0
  12. package/dist/index.d.ts +238 -117
  13. package/dist/index.js +516 -57
  14. package/dist/ops/index.d.ts +98 -8
  15. package/dist/ops/index.js +3 -202
  16. package/dist/ops-Ci5Xw6QG.js +1270 -0
  17. package/dist/{preview-DUfQl7Ij.js → preview-BhbCiAKC.js} +2 -6
  18. package/dist/sdk-CWMsH9Ms.d.ts +123 -0
  19. package/dist/vite/index.d.ts +9 -4
  20. package/dist/vite/index.js +2 -5
  21. package/env.d.ts +33 -1
  22. package/package.json +17 -6
  23. package/skills/create-doc/SKILL.md +6 -2
  24. package/skills/current-doc/SKILL.md +120 -0
  25. package/skills/doc-authoring/SKILL.md +79 -0
  26. package/skills/doc-authoring/references/long-form.md +131 -0
  27. package/src/app/components/data-table.tsx +196 -0
  28. package/src/app/components/diagram.tsx +76 -0
  29. package/src/app/components/flow-page.tsx +20 -3
  30. package/src/app/components/footnote.tsx +196 -0
  31. package/src/app/components/inspector/inspector.tsx +16 -0
  32. package/src/app/components/numbering.tsx +208 -0
  33. package/src/app/lib/agent-bridge.ts +128 -0
  34. package/src/app/lib/diagnostics.ts +282 -0
  35. package/src/app/lib/export-html.ts +35 -11
  36. package/src/app/lib/export-pdf.ts +54 -19
  37. package/src/app/lib/flow-measure.ts +100 -31
  38. package/src/app/lib/flow.test.ts +46 -0
  39. package/src/app/lib/flow.ts +28 -3
  40. package/src/app/lib/footnotes.test.tsx +102 -0
  41. package/src/app/lib/footnotes.ts +94 -0
  42. package/src/app/lib/labels.ts +175 -0
  43. package/src/app/lib/page-context.tsx +6 -1
  44. package/src/app/lib/scan.ts +26 -0
  45. package/src/app/lib/sdk.ts +3 -0
  46. package/src/app/lib/use-doc-pages.ts +50 -15
  47. package/src/app/routes/doc.tsx +25 -5
  48. package/dist/config-DBp4mOOf.js +0 -1121
  49. package/dist/design-BJLvOcCO.js +0 -53
  50. package/dist/edit-ops-DSdUroVO.js +0 -1225
  51. package/dist/sync-6GTPAt2t.js +0 -86
  52. package/dist/sync-C6CsPmyK.js +0 -3
@@ -1,86 +0,0 @@
1
- import chalk from "chalk";
2
- import fs from "node:fs/promises";
3
- import path from "node:path";
4
- import { existsSync } from "node:fs";
5
-
6
- //#region src/cli/sync.ts
7
- const SKILL_TARGET_DIRS = [".agents/skills", ".claude/skills"];
8
- async function listFiles(dir) {
9
- const out = [];
10
- const walk = async (current) => {
11
- const entries = await fs.readdir(current, { withFileTypes: true });
12
- for (const entry of entries) {
13
- const abs = path.join(current, entry.name);
14
- if (entry.isDirectory()) await walk(abs);
15
- else out.push(path.relative(dir, abs));
16
- }
17
- };
18
- await walk(dir);
19
- return out.sort();
20
- }
21
- async function sameTree(src, dst) {
22
- if (!existsSync(dst)) return false;
23
- const [srcFiles, dstFiles] = await Promise.all([listFiles(src), listFiles(dst)]);
24
- if (srcFiles.length !== dstFiles.length) return false;
25
- if (srcFiles.some((f, i) => f !== dstFiles[i])) return false;
26
- for (const rel of srcFiles) {
27
- const [a, b] = await Promise.all([fs.readFile(path.join(src, rel), "utf8"), fs.readFile(path.join(dst, rel), "utf8")]);
28
- if (a !== b) return false;
29
- }
30
- return true;
31
- }
32
- async function skillNames(builtinDir) {
33
- if (!existsSync(builtinDir)) return [];
34
- const entries = await fs.readdir(builtinDir, { withFileTypes: true });
35
- return entries.filter((e) => e.isDirectory()).map((e) => e.name).sort();
36
- }
37
- async function detectSkillsDrift(builtinDir, userCwd = process.cwd()) {
38
- const names = await skillNames(builtinDir);
39
- const primaryTarget = path.join(userCwd, SKILL_TARGET_DIRS[0]);
40
- const drift = [];
41
- for (const name of names) {
42
- const src = path.join(builtinDir, name);
43
- const dst = path.join(primaryTarget, name);
44
- if (!existsSync(dst)) drift.push({
45
- name,
46
- status: "added"
47
- });
48
- else if (!await sameTree(src, dst)) drift.push({
49
- name,
50
- status: "updated"
51
- });
52
- else drift.push({
53
- name,
54
- status: "unchanged"
55
- });
56
- }
57
- return drift;
58
- }
59
- async function syncSkills(builtinDir, opts = {}, userCwd = process.cwd()) {
60
- const drift = await detectSkillsDrift(builtinDir, userCwd);
61
- const stale = drift.filter((d) => d.status !== "unchanged");
62
- if (stale.length === 0) {
63
- process.stdout.write(`${chalk.green("✔")} Skills already up to date.\n`);
64
- return;
65
- }
66
- for (const { name, status } of stale) {
67
- if (opts.dryRun) {
68
- process.stdout.write(`${chalk.yellow("~")} ${name} ${chalk.dim(`(${status})`)}\n`);
69
- continue;
70
- }
71
- for (const targetDir of SKILL_TARGET_DIRS) {
72
- const dst = path.join(userCwd, targetDir, name);
73
- await fs.rm(dst, {
74
- recursive: true,
75
- force: true
76
- });
77
- await fs.mkdir(path.dirname(dst), { recursive: true });
78
- await fs.cp(path.join(builtinDir, name), dst, { recursive: true });
79
- }
80
- process.stdout.write(`${chalk.green("✔")} ${name} ${chalk.dim(`(${status})`)}\n`);
81
- }
82
- if (opts.dryRun) process.stdout.write(chalk.dim("\nDry run — nothing written.\n"));
83
- }
84
-
85
- //#endregion
86
- export { detectSkillsDrift, syncSkills };
@@ -1,3 +0,0 @@
1
- import { detectSkillsDrift, syncSkills } from "./sync-6GTPAt2t.js";
2
-
3
- export { syncSkills };