@litfamily/litcodex 1.0.3 → 1.0.5

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/README.md +115 -77
  2. package/dist/cli-model-route.js +27 -27
  3. package/dist/cli.js +6 -4
  4. package/dist/config-migration/catalog.d.ts +40 -1
  5. package/dist/config-migration/catalog.js +202 -57
  6. package/dist/config-migration/cli.d.ts +2 -1
  7. package/dist/config-migration/cli.js +34 -32
  8. package/dist/config-migration/gpt56-policy.d.ts +19 -10
  9. package/dist/config-migration/gpt56-policy.js +92 -50
  10. package/dist/config-migration/index.d.ts +2 -0
  11. package/dist/config-migration/index.js +28 -10
  12. package/dist/install/doctor-config.js +5 -5
  13. package/dist/install/doctor-render.js +16 -16
  14. package/dist/install/doctor.js +2 -2
  15. package/dist/install/execute.js +5 -4
  16. package/dist/install/generated-skill-payload-hashes.d.ts +30 -3
  17. package/dist/install/generated-skill-payload-hashes.js +30 -3
  18. package/dist/install/host-capabilities.d.ts +3 -4
  19. package/dist/install/host-capabilities.js +17 -19
  20. package/dist/install/install-model-prompt.js +44 -26
  21. package/dist/install/install-options.js +41 -46
  22. package/dist/install/install-presentation.js +2 -1
  23. package/dist/install/skill-catalog.d.ts +1 -1
  24. package/dist/install/skill-catalog.js +6 -1
  25. package/dist/install/skill-resource-hashes.d.ts +1 -1
  26. package/dist/install/skill-resource-hashes.js +1 -1
  27. package/dist/install/uninstall.js +6 -7
  28. package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
  29. package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
  30. package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
  31. package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
  32. package/marketplace/plugins/litcodex/components/lit-loop/agents/litcodex-default.toml +1 -1
  33. package/marketplace/plugins/litcodex/components/lit-loop/agents/litcodex-explorer.toml +1 -1
  34. package/marketplace/plugins/litcodex/components/lit-loop/agents/litcodex-librarian.toml +1 -1
  35. package/marketplace/plugins/litcodex/components/lit-loop/agents/litcodex-metis.toml +1 -1
  36. package/marketplace/plugins/litcodex/components/lit-loop/directives/litwork.md +1 -1
  37. package/marketplace/plugins/litcodex/components/lit-loop/dist/lit-mark.d.ts +2 -2
  38. package/marketplace/plugins/litcodex/components/lit-loop/dist/lit-mark.js +4 -44
  39. package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
  40. package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
  41. package/marketplace/plugins/litcodex/components/rules/dist/model-metadata.d.ts +2 -1
  42. package/marketplace/plugins/litcodex/components/rules/dist/model-metadata.js +9 -1
  43. package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
  44. package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
  45. package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
  46. package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
  47. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/SKILL.md +22 -19
  48. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/canonical-library.md +7 -1
  49. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/complete-contract.md +17 -11
  50. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/default-editorial-pixel.json +64 -0
  51. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/production-interview.md +25 -0
  52. package/marketplace/plugins/litcodex/skills/readme-studio/SKILL.md +94 -0
  53. package/marketplace/plugins/litcodex/skills/readme-studio/references/decoration-patterns.md +36 -0
  54. package/marketplace/plugins/litcodex/skills/readme-studio/references/facts-and-assembly.md +36 -0
  55. package/marketplace/plugins/litcodex/skills/readme-studio/references/motion-and-delivery.md +47 -0
  56. package/marketplace/plugins/litcodex/skills/readme-studio/references/typography-and-imagery.md +34 -0
  57. package/marketplace/plugins/litcodex/skills/readme-studio/scripts/validate-readme-facts.mjs +130 -0
  58. package/marketplace/plugins/litcodex/skills/readme-studio/templates/cover-source.json +35 -0
  59. package/marketplace/plugins/litcodex/skills/readme-studio/templates/hyperframes-cover/index.html +61 -0
  60. package/marketplace/plugins/litcodex/skills/readme-studio/templates/hyperframes-cover/index.motion.json +6 -0
  61. package/marketplace/plugins/litcodex/skills/readme-studio/templates/hyperframes-cover/package-lock.json +1969 -0
  62. package/marketplace/plugins/litcodex/skills/readme-studio/templates/hyperframes-cover/package.json +14 -0
  63. package/marketplace/plugins/litcodex/skills/readme-studio/templates/readme-cover-section.md +85 -0
  64. package/marketplace/plugins/litcodex/skills/readme-studio/templates/readme-facts.json +11 -0
  65. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/package-lock.json +3783 -0
  66. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/package.json +15 -0
  67. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/src/ReadmeCover.tsx +102 -0
  68. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/src/Root.tsx +48 -0
  69. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/src/index.tsx +4 -0
  70. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/src/layout.ts +35 -0
  71. package/marketplace/plugins/litcodex/skills/readme-studio/templates/remotion-cover/src/motion.ts +25 -0
  72. package/marketplace/plugins/litcodex/skills/readme-studio/templates/typography/package-lock.json +133 -0
  73. package/marketplace/plugins/litcodex/skills/readme-studio/templates/typography/package.json +8 -0
  74. package/marketplace/plugins/litcodex/skills/readme-studio/templates/typography/shape-text-to-svg.mjs +238 -0
  75. package/model-catalog.json +163 -4
  76. package/node_modules/@litcodex/lit-loop/agents/litcodex-default.toml +1 -1
  77. package/node_modules/@litcodex/lit-loop/agents/litcodex-explorer.toml +1 -1
  78. package/node_modules/@litcodex/lit-loop/agents/litcodex-librarian.toml +1 -1
  79. package/node_modules/@litcodex/lit-loop/agents/litcodex-metis.toml +1 -1
  80. package/node_modules/@litcodex/lit-loop/directives/litwork.md +1 -1
  81. package/node_modules/@litcodex/lit-loop/dist/lit-mark.d.ts +2 -2
  82. package/node_modules/@litcodex/lit-loop/dist/lit-mark.js +4 -44
  83. package/node_modules/@litcodex/lit-loop/package.json +1 -1
  84. package/package.json +2 -2
  85. package/readme-assets/badge-version.svg +1 -1
  86. package/readme-assets/cover-motion-still.webp +0 -0
  87. package/readme-assets/cover-motion.webp +0 -0
  88. package/readme-assets/litfamily-machines.png +0 -0
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env node
2
+ import { lstatSync, readFileSync, realpathSync } from "node:fs";
3
+ import { isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import process from "node:process";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ function isRecord(value) {
8
+ return value !== null && typeof value === "object" && !Array.isArray(value);
9
+ }
10
+
11
+ function nonEmptyString(value) {
12
+ return typeof value === "string" && value.trim().length > 0;
13
+ }
14
+
15
+ function safeHttpUrl(value) {
16
+ if (!nonEmptyString(value) || value !== value.trim() || /[\u0000-\u0020\u007f]/u.test(value)) return false;
17
+ try {
18
+ const url = new URL(value);
19
+ return (url.protocol === "http:" || url.protocol === "https:") && url.hostname.length > 0 && !url.username && !url.password;
20
+ } catch {
21
+ return false;
22
+ }
23
+ }
24
+
25
+ function safeEvidenceFile(root, source) {
26
+ if (!nonEmptyString(source) || isAbsolute(source) || source.includes("\\")) return false;
27
+ const segments = source.split("/");
28
+ if (segments.some((segment) => segment === "" || segment === "." || segment === "..")) return false;
29
+ const target = resolve(root, ...segments);
30
+ const relativeTarget = relative(root, target);
31
+ if (relativeTarget === "" || relativeTarget.startsWith(`..${sep}`) || isAbsolute(relativeTarget)) return false;
32
+ let cursor = root;
33
+ try {
34
+ for (const segment of relativeTarget.split(sep)) {
35
+ cursor = join(cursor, segment);
36
+ const stat = lstatSync(cursor);
37
+ if (stat.isSymbolicLink()) return false;
38
+ if (cursor !== target && !stat.isDirectory()) return false;
39
+ if (cursor === target && !stat.isFile()) return false;
40
+ }
41
+ const realTarget = realpathSync(target);
42
+ const realRelative = relative(root, realTarget);
43
+ return realRelative !== "" && !realRelative.startsWith(`..${sep}`) && !isAbsolute(realRelative);
44
+ } catch {
45
+ return false;
46
+ }
47
+ }
48
+
49
+ export function validateReadmeFacts(input, projectRoot = process.cwd()) {
50
+ const issues = [];
51
+ const report = (problems) => ({
52
+ valid: problems.length === 0,
53
+ validation_scope: "structure-only",
54
+ factual_accuracy: "not-checked",
55
+ source_contents_compared: false,
56
+ badge_truth_checked: false,
57
+ issues: problems,
58
+ });
59
+ if (!isRecord(input)) return report(["facts document must be an object"]);
60
+ if (input.schema_id !== "litcodex.readme-facts/v1") issues.push("schema_id must be litcodex.readme-facts/v1");
61
+ if (!Array.isArray(input.facts) || input.facts.length === 0) {
62
+ issues.push("facts must contain at least one sourced claim");
63
+ } else {
64
+ const seen = new Set();
65
+ let root;
66
+ try {
67
+ root = realpathSync(projectRoot);
68
+ } catch {
69
+ return report(["project root must be an existing directory"]);
70
+ }
71
+ if (!lstatSync(root).isDirectory()) return report(["project root must be an existing directory"]);
72
+ for (const fact of input.facts) {
73
+ if (!isRecord(fact)) {
74
+ issues.push("each fact must be an object");
75
+ continue;
76
+ }
77
+ const claim = nonEmptyString(fact.claim) ? fact.claim.trim() : "<unnamed claim>";
78
+ if (!nonEmptyString(fact.claim)) issues.push("each fact needs a non-empty claim id");
79
+ if (seen.has(claim)) issues.push(`${claim} is duplicated`);
80
+ seen.add(claim);
81
+ if (!nonEmptyString(fact.value)) issues.push(`${claim} needs a non-empty value`);
82
+ if (!safeEvidenceFile(root, fact.source)) issues.push(`${claim} must cite a regular non-symlink file using a safe relative evidence path`);
83
+ }
84
+ }
85
+ if (input.badges !== undefined && !Array.isArray(input.badges)) {
86
+ issues.push("badges must be an array when present");
87
+ } else if (Array.isArray(input.badges)) {
88
+ let root;
89
+ try {
90
+ root = realpathSync(projectRoot);
91
+ } catch {
92
+ return report([...issues, "project root must be an existing directory"]);
93
+ }
94
+ for (const badge of input.badges) {
95
+ if (!isRecord(badge) || !nonEmptyString(badge.label)) {
96
+ issues.push("each badge needs a non-empty label");
97
+ continue;
98
+ }
99
+ if (!safeHttpUrl(badge.url)) issues.push(`badge ${badge.label} must use an absolute http(s) URL without embedded credentials`);
100
+ if (!safeEvidenceFile(root, badge.source)) issues.push(`badge ${badge.label} must cite a regular non-symlink evidence file`);
101
+ }
102
+ }
103
+ return report(issues);
104
+ }
105
+
106
+ function parseArgs(argv) {
107
+ const options = {};
108
+ for (let index = 0; index < argv.length; index += 1) {
109
+ const key = argv[index];
110
+ if (key !== "--facts" && key !== "--project-root") throw new Error(`unknown option ${key}`);
111
+ const value = argv[index + 1];
112
+ if (value === undefined || value.startsWith("--")) throw new Error(`${key} requires a value`);
113
+ options[key === "--facts" ? "facts" : "projectRoot"] = value;
114
+ index += 1;
115
+ }
116
+ if (!options.facts || !options.projectRoot) throw new Error("usage: validate-readme-facts.mjs --facts <json-file> --project-root <repository-root>");
117
+ return options;
118
+ }
119
+
120
+ if (process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))) {
121
+ try {
122
+ const options = parseArgs(process.argv.slice(2));
123
+ const result = validateReadmeFacts(JSON.parse(readFileSync(resolve(options.facts), "utf8")), resolve(options.projectRoot));
124
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
125
+ if (!result.valid) process.exitCode = 1;
126
+ } catch (error) {
127
+ process.stderr.write(`readme-studio: ${error instanceof Error ? error.message : String(error)}\n`);
128
+ process.exitCode = 1;
129
+ }
130
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "schema_id": "litcodex.readme-cover-source/v1",
3
+ "editable_text": {
4
+ "title": "",
5
+ "subtitle": "",
6
+ "micro_label": ""
7
+ },
8
+ "font_runs": [
9
+ {
10
+ "text_key": "title",
11
+ "font_path": "",
12
+ "file_name": "",
13
+ "sha256": "",
14
+ "family_and_style": "",
15
+ "license": "",
16
+ "license_source": ""
17
+ }
18
+ ],
19
+ "background": {
20
+ "origin": "native-generation-or-user-supplied",
21
+ "tool_or_supplier": "",
22
+ "original_path": "",
23
+ "working_copy": "",
24
+ "inspected": false
25
+ },
26
+ "composition": {
27
+ "engine": "",
28
+ "engine_version": "",
29
+ "license_class_checked": false,
30
+ "width": 1600,
31
+ "height": 800,
32
+ "fps": 60,
33
+ "duration_frames": 300
34
+ }
35
+ }
@@ -0,0 +1,61 @@
1
+ <!doctype html>
2
+ <html lang="en" data-fps="60">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Local README cover composition</title>
7
+ <style>
8
+ * { box-sizing: border-box; }
9
+ html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #10191e; }
10
+ #cover { --field-color: #0c151a; --ink: #f4f1e9; --frame-color: rgba(244,241,233,.44); --rule-color: rgba(244,241,233,.64); --glow-color: rgba(169,220,200,.18); --rim-color: rgba(169,220,200,.42); position: relative; width: 1600px; height: 800px; overflow: hidden; color: var(--ink); }
11
+ #cover[data-theme="light"] { --field-color: #fbf8f0; --ink: #15242a; --frame-color: rgba(21,36,42,.42); --rule-color: rgba(21,36,42,.6); --glow-color: rgba(232,106,74,.16); --rim-color: rgba(232,106,74,.34); }
12
+ #cover[data-theme="dark"] .theme-light-only, #cover[data-theme="light"] .theme-dark-only { display: none; }
13
+ #background { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; filter: blur(18px); animation: background-breath 5s cubic-bezier(.65,0,.35,1) both; }
14
+ #focal-plane { position: absolute; inset: 0; width: 100%; height: 100%; background-image: url("assets/cover-background.png"); background-size: cover; background-position: center center; -webkit-mask-image: linear-gradient(90deg, transparent 47%, rgba(0,0,0,.55) 58%, #000 67%); mask-image: linear-gradient(90deg, transparent 47%, rgba(0,0,0,.55) 58%, #000 67%); animation: background-breath 5s cubic-bezier(.65,0,.35,1) both; }
15
+ #veil { position: absolute; inset: 0; background: linear-gradient(115deg, rgba(8,17,22,.16), transparent 58%, rgba(169,220,200,.10)); }
16
+ #rim-light { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 53%, var(--rim-color) 60%, transparent 68%), radial-gradient(ellipse at 94% 18%, var(--rim-color) 0%, transparent 48%); mix-blend-mode: screen; opacity: .16; animation: rim-light-cycle 5s cubic-bezier(.65,0,.35,1) both; }
17
+ #cover[data-theme="light"] #rim-light { mix-blend-mode: soft-light; }
18
+ #text-field { position: absolute; inset: 0 auto 0 0; width: 62%; height: 100%; background: linear-gradient(90deg, var(--field-color) 0%, var(--field-color) 88%, transparent 100%); }
19
+ #glow { position: absolute; width: 620px; height: 620px; top: -12%; right: -4%; border-radius: 50%; background: var(--glow-color); filter: blur(82px); opacity: .34; animation: glow-breath 5s cubic-bezier(.65,0,.35,1) both; pointer-events: none; }
20
+ #identity { position: absolute; inset: 126px; border: 1px solid var(--frame-color); transform: perspective(1200px) rotateY(-3deg); }
21
+ #label, #label-light { position: absolute; left: 126px; top: 96px; width: 32%; height: 26px; object-fit: contain; object-position: left center; }
22
+ #title, #title-light { position: absolute; left: 126px; top: 232px; width: 50%; height: 216px; object-fit: contain; object-position: left center; animation: title-entry-reset 800ms cubic-bezier(.65,0,.35,1) both; }
23
+ #subtitle, #subtitle-light { position: absolute; left: 126px; bottom: 152px; width: 38%; max-height: 48px; object-fit: contain; object-position: left center; animation: title-entry-reset 800ms cubic-bezier(.65,0,.35,1) both; }
24
+ #rule { position: absolute; left: 126px; bottom: 80px; width: 42%; height: 1px; background: var(--rule-color); }
25
+ #grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .06; mix-blend-mode: soft-light; pointer-events: none; }
26
+ #cover[data-layout="mobile"] { width: 1080px; height: 1350px; }
27
+ #cover[data-layout="mobile"] #text-field { inset: 0 0 auto; width: 100%; height: 62%; background: linear-gradient(180deg, var(--field-color) 0%, var(--field-color) 89%, transparent 100%); }
28
+ #cover[data-layout="mobile"] #glow { width: 470px; height: 470px; top: 6%; right: -14%; }
29
+ #cover[data-layout="mobile"] #focal-plane { background-position: 84% center; -webkit-mask-image: linear-gradient(180deg, transparent 44%, rgba(0,0,0,.55) 56%, #000 68%); mask-image: linear-gradient(180deg, transparent 44%, rgba(0,0,0,.55) 56%, #000 68%); }
30
+ #cover[data-layout="mobile"] #rim-light { background: linear-gradient(180deg, transparent 58%, var(--rim-color) 62%, transparent 72%), radial-gradient(ellipse at 88% 96%, var(--rim-color) 0%, transparent 48%); }
31
+ #cover[data-layout="mobile"] #identity { inset: 5%; transform: none; }
32
+ #cover[data-layout="mobile"] #label, #cover[data-layout="mobile"] #label-light { left: 7%; top: 12%; width: 56%; height: 3.5%; }
33
+ #cover[data-layout="mobile"] #title, #cover[data-layout="mobile"] #title-light { left: 7%; top: 21%; width: 86%; height: 22%; }
34
+ #cover[data-layout="mobile"] #subtitle, #cover[data-layout="mobile"] #subtitle-light { left: 7%; bottom: 45%; width: 76%; max-height: 5.5%; }
35
+ #cover[data-layout="mobile"] #rule { left: 7%; bottom: 12%; width: 72%; }
36
+ @keyframes background-breath { 0%, 12%, 88%, 100% { transform: scale(1.035); } 46%, 54% { transform: scale(1.075); } }
37
+ @keyframes title-entry-reset { 0%, 100% { transform: translateY(0); } 22% { transform: translateY(8px); } 48% { transform: translateY(0); } }
38
+ @keyframes glow-breath { 0%, 12%, 88%, 100% { opacity: .34; } 46%, 54% { opacity: .52; } }
39
+ @keyframes rim-light-cycle { 0%, 12%, 88%, 100% { opacity: .16; } 46%, 54% { opacity: .3; } }
40
+ </style>
41
+ </head>
42
+ <body>
43
+ <main id="cover" data-composition-id="readme-cover" data-start="0" data-duration="5" data-width="1600" data-height="800" data-theme="dark" data-layout="wide" data-no-timeline aria-label="README cover">
44
+ <img id="background" src="assets/cover-background.png" alt="" />
45
+ <div id="focal-plane" aria-hidden="true"></div>
46
+ <div id="veil"></div>
47
+ <div id="rim-light"></div>
48
+ <div id="text-field"></div>
49
+ <div id="glow" data-layout-allow-overflow></div>
50
+ <div id="identity"></div>
51
+ <img id="label" class="theme-dark-only" src="assets/micro-label-outline-dark.svg" alt="" />
52
+ <img id="label-light" class="theme-light-only" src="assets/micro-label-outline-light.svg" alt="" />
53
+ <img id="title" class="theme-dark-only" src="assets/title-outline-dark.svg" alt="" />
54
+ <img id="title-light" class="theme-light-only" src="assets/title-outline-light.svg" alt="" />
55
+ <img id="subtitle" class="theme-dark-only" src="assets/subtitle-outline-dark.svg" alt="" />
56
+ <img id="subtitle-light" class="theme-light-only" src="assets/subtitle-outline-light.svg" alt="" />
57
+ <div id="rule"></div>
58
+ <svg id="grain" viewBox="0 0 1600 800" preserveAspectRatio="none" aria-hidden="true"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency=".72" numOctaves="2" seed="17"/><feColorMatrix values=".35 0 0 0 .2 0 .35 0 0 .2 0 0 .35 0 .2 0 0 0 .18 0"/></filter><rect width="100%" height="100%" filter="url(#noise)"/></svg>
59
+ </main>
60
+ </body>
61
+ </html>
@@ -0,0 +1,6 @@
1
+ {
2
+ "duration": 5,
3
+ "assertions": [
4
+ { "kind": "keepsMoving", "withinSelector": "#cover", "maxStaticSec": 1.2 }
5
+ ]
6
+ }