vc-extras 0.0.0-stage → 0.1.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 (149) hide show
  1. package/README.md +70 -2
  2. package/agents/tester.md +23 -0
  3. package/install-extras.mjs +134 -0
  4. package/install-menu.mjs +63 -0
  5. package/install-skills.mjs +112 -0
  6. package/package.json +26 -4
  7. package/plugins/config-ui/index.ts +160 -0
  8. package/plugins/config-ui/lib/arguments.mjs +24 -0
  9. package/plugins/config-ui/lib/documents.mjs +67 -0
  10. package/plugins/config-ui/lib/frontmatter.mjs +91 -0
  11. package/plugins/config-ui/lib/open.mjs +17 -0
  12. package/plugins/config-ui/lib/ownership.mjs +99 -0
  13. package/plugins/config-ui/lib/page.mjs +11 -0
  14. package/plugins/config-ui/lib/patch.mjs +36 -0
  15. package/plugins/config-ui/lib/paths.mjs +14 -0
  16. package/plugins/config-ui/lib/plugin-fields.mjs +86 -0
  17. package/plugins/config-ui/lib/plugin-validation.mjs +28 -0
  18. package/plugins/config-ui/lib/redaction.mjs +8 -0
  19. package/plugins/config-ui/lib/registry.mjs +282 -0
  20. package/plugins/config-ui/lib/secrets.mjs +45 -0
  21. package/plugins/config-ui/lib/server.mjs +251 -0
  22. package/plugins/config-ui/lib/sources.mjs +96 -0
  23. package/plugins/config-ui/lib/state.mjs +157 -0
  24. package/plugins/config-ui/lib/themes.mjs +113 -0
  25. package/plugins/config-ui/lib/writer.mjs +691 -0
  26. package/plugins/config-ui/package.json +12 -0
  27. package/plugins/config-ui/project-local-owner.ts +106 -0
  28. package/plugins/config-ui/web/app.mjs +997 -0
  29. package/plugins/config-ui/web/index.html +342 -0
  30. package/plugins/essrj/context.ts +47 -0
  31. package/plugins/essrj/data.ts +190 -0
  32. package/plugins/essrj/index.ts +139 -0
  33. package/plugins/essrj/package.json +12 -0
  34. package/plugins/essrj/project-local-owner.ts +106 -0
  35. package/plugins/essrj/render.ts +217 -0
  36. package/plugins/essrj/types.ts +40 -0
  37. package/plugins.json +38 -0
  38. package/skills/animate/LICENSE +21 -0
  39. package/skills/animate/RECIPES.md +324 -0
  40. package/skills/animate/SKILL.md +208 -0
  41. package/skills/animate/UPSTREAM.md +19 -0
  42. package/skills/animation-performance/LICENSE +21 -0
  43. package/skills/animation-performance/SKILL.md +223 -0
  44. package/skills/animation-performance/UPSTREAM.md +19 -0
  45. package/skills/answer-me-with-html/SKILL.md +174 -0
  46. package/skills/answer-me-with-html/scripts/am.mjs +12896 -0
  47. package/skills/apple-design/LICENSE +21 -0
  48. package/skills/apple-design/SKILL.md +291 -0
  49. package/skills/apple-design/UPSTREAM.md +19 -0
  50. package/skills/bad-smell/SKILL.md +44 -0
  51. package/skills/commit/SKILL.md +90 -0
  52. package/skills/emil-design-eng/LICENSE +21 -0
  53. package/skills/emil-design-eng/SKILL.md +677 -0
  54. package/skills/emil-design-eng/UPSTREAM.md +19 -0
  55. package/skills/find-the-truth/SKILL.md +38 -0
  56. package/skills/find-the-truth/references/trace-method.md +48 -0
  57. package/skills/find-the-truth/references/truth-method.md +39 -0
  58. package/skills/gestures/LICENSE +21 -0
  59. package/skills/gestures/SKILL.md +107 -0
  60. package/skills/gestures/UPSTREAM.md +19 -0
  61. package/skills/humanizer-zh/LICENSE +21 -0
  62. package/skills/humanizer-zh/SKILL.md +409 -0
  63. package/skills/humanizer-zh/UPSTREAM.md +7 -0
  64. package/skills/impeccable/LICENSE +191 -0
  65. package/skills/impeccable/NOTICE.md +11 -0
  66. package/skills/impeccable/SKILL.md +90 -0
  67. package/skills/impeccable/licenses/modern-screenshot-MIT.txt +9 -0
  68. package/skills/impeccable/licenses/platform-design-skills-MIT.txt +21 -0
  69. package/skills/impeccable/reference/adapt.md +318 -0
  70. package/skills/impeccable/reference/adapt.native.md +58 -0
  71. package/skills/impeccable/reference/android.md +46 -0
  72. package/skills/impeccable/reference/animate.md +89 -0
  73. package/skills/impeccable/reference/audit.md +139 -0
  74. package/skills/impeccable/reference/audit.native.md +139 -0
  75. package/skills/impeccable/reference/bolder.md +33 -0
  76. package/skills/impeccable/reference/clarify.md +94 -0
  77. package/skills/impeccable/reference/colorize.md +86 -0
  78. package/skills/impeccable/reference/component-review.md +63 -0
  79. package/skills/impeccable/reference/craft-floor.md +44 -0
  80. package/skills/impeccable/reference/craft.md +5 -0
  81. package/skills/impeccable/reference/critique.md +819 -0
  82. package/skills/impeccable/reference/degraded/asset-producer.md +42 -0
  83. package/skills/impeccable/reference/degraded/documenter.md +24 -0
  84. package/skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
  85. package/skills/impeccable/reference/degraded/manual-edit-applier.md +93 -0
  86. package/skills/impeccable/reference/delight.md +70 -0
  87. package/skills/impeccable/reference/distill.md +111 -0
  88. package/skills/impeccable/reference/doctor.md +54 -0
  89. package/skills/impeccable/reference/document.md +416 -0
  90. package/skills/impeccable/reference/extract.md +69 -0
  91. package/skills/impeccable/reference/generate.md +101 -0
  92. package/skills/impeccable/reference/harden.md +362 -0
  93. package/skills/impeccable/reference/hooks.md +114 -0
  94. package/skills/impeccable/reference/init.md +131 -0
  95. package/skills/impeccable/reference/ios.md +51 -0
  96. package/skills/impeccable/reference/layout.md +84 -0
  97. package/skills/impeccable/reference/live-setup.md +104 -0
  98. package/skills/impeccable/reference/live.md +327 -0
  99. package/skills/impeccable/reference/mode-operate.md +21 -0
  100. package/skills/impeccable/reference/mode-persuade.md +19 -0
  101. package/skills/impeccable/reference/mode-read.md +21 -0
  102. package/skills/impeccable/reference/new-work.md +152 -0
  103. package/skills/impeccable/reference/onboard.md +234 -0
  104. package/skills/impeccable/reference/operate.md +61 -0
  105. package/skills/impeccable/reference/optimize.md +257 -0
  106. package/skills/impeccable/reference/overdrive.md +127 -0
  107. package/skills/impeccable/reference/polish.md +105 -0
  108. package/skills/impeccable/reference/quieter.md +99 -0
  109. package/skills/impeccable/reference/region-map.md +26 -0
  110. package/skills/impeccable/reference/routing.md +24 -0
  111. package/skills/impeccable/reference/shape.md +59 -0
  112. package/skills/impeccable/reference/typeset.md +90 -0
  113. package/skills/impeccable/reference/visualize.md +47 -0
  114. package/skills/impeccable/scripts/VERSION +1 -0
  115. package/skills/impeccable/scripts/command-metadata.json +98 -0
  116. package/skills/impeccable/scripts/data/font-index-failures.json +121 -0
  117. package/skills/impeccable/scripts/data/font-index.json +1 -0
  118. package/skills/impeccable/scripts/engine-checksums.txt +9 -0
  119. package/skills/impeccable/scripts/impeccable +249 -0
  120. package/skills/impeccable/scripts/impeccable.cmd +278 -0
  121. package/skills/impeccable/scripts/live-browser-dom.js +320 -0
  122. package/skills/impeccable/scripts/live-browser-ignores.js +246 -0
  123. package/skills/impeccable/scripts/live-browser-session.js +183 -0
  124. package/skills/impeccable/scripts/live-browser.js +13862 -0
  125. package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  126. package/skills/improve-animations/AUDIT.md +115 -0
  127. package/skills/improve-animations/LICENSE +21 -0
  128. package/skills/improve-animations/PLAN-TEMPLATE.md +73 -0
  129. package/skills/improve-animations/SKILL.md +110 -0
  130. package/skills/improve-animations/UPSTREAM.md +19 -0
  131. package/skills/pick-ui-library/LICENSE +21 -0
  132. package/skills/pick-ui-library/SKILL.md +85 -0
  133. package/skills/pick-ui-library/UPSTREAM.md +19 -0
  134. package/skills/review-animations/LICENSE +21 -0
  135. package/skills/review-animations/SKILL.md +120 -0
  136. package/skills/review-animations/STANDARDS.md +187 -0
  137. package/skills/review-animations/UPSTREAM.md +19 -0
  138. package/skills/test/SKILL.md +29 -0
  139. package/skills/test/references/test-method.md +60 -0
  140. package/skills/write-doc/SKILL.md +115 -0
  141. package/skills/write-doc/examples/result-report.md +53 -0
  142. package/skills/write-doc/examples/task-summary.md +45 -0
  143. package/skills/write-doc/references/terminology.md +147 -0
  144. package/specs/design-demo.md +1102 -0
  145. package/specs/frontend-immersive.md +28 -0
  146. package/specs/web-modes/explore.md +31 -0
  147. package/specs/web-modes/risk.md +15 -0
  148. package/specs/web-modes/verify.md +16 -0
  149. package/vc-extras.mjs +78 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "vibe-config-ui",
3
+ "version": "0.1.0",
4
+ "description": "Browser configuration editor for Pi and the Emma workflow",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "keywords": ["pi-package"],
8
+ "engines": { "node": ">=22.19.0" },
9
+ "files": ["index.ts", "project-local-owner.ts", "lib/", "web/"],
10
+ "dependencies": { "jsonc-parser": "3.3.1", "smol-toml": "1.9.1" },
11
+ "pi": { "extensions": ["./index.ts"] }
12
+ }
@@ -0,0 +1,106 @@
1
+ import { existsSync, lstatSync, readFileSync, realpathSync } from "node:fs";
2
+ import { basename, dirname, isAbsolute, join, matchesGlob, relative, resolve, sep } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ export function shouldYieldToProject(extensionUrl: string, declaration: string, cwd: string, projectTrusted: boolean): boolean {
6
+ if (projectTrusted !== true) return false;
7
+ const projectRoot = resolve(cwd);
8
+ const emmaRoot = join(projectRoot, ".emma");
9
+ const extensionPath = fileURLToPath(extensionUrl);
10
+ if (isInside(emmaRoot, extensionPath)) return false;
11
+
12
+ const manifestPath = join(emmaRoot, "package.json");
13
+ const settingsPath = join(projectRoot, ".pi", "settings.json");
14
+ if (!isRegularOwnedFile(projectRoot, manifestPath) || !isRegularOwnedFile(projectRoot, settingsPath)) return false;
15
+
16
+ try {
17
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
18
+ const settings = JSON.parse(readFileSync(settingsPath, "utf8"));
19
+ if (manifest?.name !== "vibe-emma-local" || !Array.isArray(manifest.pi?.extensions) ||
20
+ !manifest.pi.extensions.includes(declaration) || !Array.isArray(settings?.packages)) return false;
21
+ const resource = resolve(emmaRoot, declaration.replace(/^\.\//, ""));
22
+ if (!isRegularOwnedFile(emmaRoot, resource)) return false;
23
+ const settingsRoot = dirname(settingsPath);
24
+ return settings.packages.some((entry: string | { source?: string; extensions?: string[] }) => {
25
+ const source = typeof entry === "string" ? entry : entry?.source;
26
+ if (!source || !packageEntryEnables(entry, declaration, resource)) return false;
27
+ return samePath(resolve(settingsRoot, source.replace(/\\/g, "/")), emmaRoot);
28
+ });
29
+ } catch {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ function packageEntryEnables(entry: string | { autoload?: boolean; extensions?: string[] }, declaration: string, resource: string): boolean {
35
+ if (typeof entry === "string") return true;
36
+ if (entry.extensions === undefined) return entry.autoload !== false;
37
+ if (!Array.isArray(entry.extensions) || entry.extensions.length === 0 || entry.extensions.some(value => typeof value !== "string")) return false;
38
+ const relativePath = normalizeExactPath(declaration);
39
+ const absolutePath = toPosix(resource);
40
+ const fileName = basename(relativePath);
41
+ if (entry.autoload === false) {
42
+ // Pi treats an autoload-disabled entry as a delta, applied in order.
43
+ let enabled = false;
44
+ for (const value of entry.extensions) {
45
+ const prefix = value[0];
46
+ const exact = prefix === "+" || prefix === "-";
47
+ const pattern = exact || prefix === "!" ? value.slice(1) : value;
48
+ if (exact ? matchesExact(pattern, relativePath, absolutePath) : matchesPattern(pattern, relativePath, fileName, absolutePath)) {
49
+ enabled = prefix !== "-" && prefix !== "!";
50
+ }
51
+ }
52
+ return enabled;
53
+ }
54
+ const includes = entry.extensions.filter((value) => !/^[!+-]/.test(value));
55
+ const excludes = entry.extensions.filter((value) => value.startsWith("!")).map((value) => value.slice(1));
56
+ const forceIncludes = entry.extensions.filter((value) => value.startsWith("+")).map((value) => value.slice(1));
57
+ const forceExcludes = entry.extensions.filter((value) => value.startsWith("-")).map((value) => value.slice(1));
58
+ let enabled = includes.length === 0 || includes.some((pattern) => matchesPattern(pattern, relativePath, fileName, absolutePath));
59
+ if (excludes.some((pattern) => matchesPattern(pattern, relativePath, fileName, absolutePath))) enabled = false;
60
+ if (forceIncludes.some((pattern) => matchesExact(pattern, relativePath, absolutePath))) enabled = true;
61
+ if (forceExcludes.some((pattern) => matchesExact(pattern, relativePath, absolutePath))) enabled = false;
62
+ return enabled;
63
+ }
64
+
65
+ function matchesPattern(pattern: string, relativePath: string, fileName: string, absolutePath: string): boolean {
66
+ const normalized = toPosix(pattern);
67
+ return [relativePath, fileName, absolutePath].some((candidate) => matchesGlob(candidate, normalized));
68
+ }
69
+
70
+ function matchesExact(pattern: string, relativePath: string, absolutePath: string): boolean {
71
+ const normalized = normalizeExactPath(pattern);
72
+ return normalized === relativePath || normalized === absolutePath;
73
+ }
74
+
75
+ function normalizeExactPath(value: string): string {
76
+ return toPosix(value).replace(/^\.\//, "");
77
+ }
78
+
79
+ function toPosix(value: string): string {
80
+ return value.replace(/\\/g, "/");
81
+ }
82
+
83
+ function isRegularOwnedFile(root: string, file: string): boolean {
84
+ if (!existsSync(file)) return false;
85
+ try {
86
+ if (!lstatSync(file).isFile()) return false;
87
+ const realRoot = realpathSync(root);
88
+ const realFile = realpathSync(file);
89
+ return isInside(realRoot, realFile);
90
+ } catch {
91
+ return false;
92
+ }
93
+ }
94
+
95
+ function isInside(root: string, candidate: string): boolean {
96
+ const value = relative(resolve(root), resolve(candidate));
97
+ return value === "" || (!value.startsWith(`..${sep}`) && value !== ".." && !isAbsolute(value));
98
+ }
99
+
100
+ function samePath(left: string, right: string): boolean {
101
+ const normalize = (value: string) => {
102
+ const resolved = resolve(value).replace(/[\\/]+$/, "");
103
+ return process.platform === "win32" ? resolved.toLowerCase() : resolved;
104
+ };
105
+ return normalize(left) === normalize(right);
106
+ }