@vibe-agent-toolkit/cli 0.2.0-rc.6 → 0.2.0-rc.7

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 (194) hide show
  1. package/README.md +4 -4
  2. package/dist/bin.js +41 -158
  3. package/dist/bin.js.map +1 -1
  4. package/dist/command-loaders.d.ts +2 -2
  5. package/dist/command-loaders.d.ts.map +1 -1
  6. package/dist/command-loaders.js +4 -2
  7. package/dist/command-loaders.js.map +1 -1
  8. package/dist/commands/ard/emit.d.ts +104 -0
  9. package/dist/commands/ard/emit.d.ts.map +1 -0
  10. package/dist/commands/ard/emit.js +223 -0
  11. package/dist/commands/ard/emit.js.map +1 -0
  12. package/dist/commands/ard/index.d.ts +12 -0
  13. package/dist/commands/ard/index.d.ts.map +1 -0
  14. package/dist/commands/ard/index.js +79 -0
  15. package/dist/commands/ard/index.js.map +1 -0
  16. package/dist/commands/ard/surfaces.d.ts +56 -0
  17. package/dist/commands/ard/surfaces.d.ts.map +1 -0
  18. package/dist/commands/ard/surfaces.js +150 -0
  19. package/dist/commands/ard/surfaces.js.map +1 -0
  20. package/dist/commands/audit.d.ts +75 -8
  21. package/dist/commands/audit.d.ts.map +1 -1
  22. package/dist/commands/audit.js +605 -140
  23. package/dist/commands/audit.js.map +1 -1
  24. package/dist/commands/claude/budget.d.ts +13 -0
  25. package/dist/commands/claude/budget.d.ts.map +1 -1
  26. package/dist/commands/claude/budget.js +80 -28
  27. package/dist/commands/claude/budget.js.map +1 -1
  28. package/dist/commands/claude/context.js +1 -1
  29. package/dist/commands/claude/context.js.map +1 -1
  30. package/dist/commands/claude/marketplace/validate.d.ts +55 -22
  31. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  32. package/dist/commands/claude/marketplace/validate.js +380 -75
  33. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  34. package/dist/commands/claude/org/skills.d.ts +84 -3
  35. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  36. package/dist/commands/claude/org/skills.js +218 -46
  37. package/dist/commands/claude/org/skills.js.map +1 -1
  38. package/dist/commands/claude/plugin/build.d.ts +8 -0
  39. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  40. package/dist/commands/claude/plugin/build.js +16 -2
  41. package/dist/commands/claude/plugin/build.js.map +1 -1
  42. package/dist/commands/claude/plugin/tree-copy.d.ts +72 -0
  43. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  44. package/dist/commands/claude/plugin/tree-copy.js +215 -10
  45. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  46. package/dist/commands/corpus/index.d.ts.map +1 -1
  47. package/dist/commands/corpus/index.js +3 -0
  48. package/dist/commands/corpus/index.js.map +1 -1
  49. package/dist/commands/corpus/report.d.ts +0 -1
  50. package/dist/commands/corpus/report.d.ts.map +1 -1
  51. package/dist/commands/corpus/report.js +0 -1
  52. package/dist/commands/corpus/report.js.map +1 -1
  53. package/dist/commands/corpus/runner.d.ts +58 -1
  54. package/dist/commands/corpus/runner.d.ts.map +1 -1
  55. package/dist/commands/corpus/runner.js +90 -15
  56. package/dist/commands/corpus/runner.js.map +1 -1
  57. package/dist/commands/corpus/scan.d.ts.map +1 -1
  58. package/dist/commands/corpus/scan.js +0 -1
  59. package/dist/commands/corpus/scan.js.map +1 -1
  60. package/dist/commands/doctor.d.ts +14 -0
  61. package/dist/commands/doctor.d.ts.map +1 -1
  62. package/dist/commands/doctor.js +96 -18
  63. package/dist/commands/doctor.js.map +1 -1
  64. package/dist/commands/okf/index.d.ts +11 -0
  65. package/dist/commands/okf/index.d.ts.map +1 -0
  66. package/dist/commands/okf/index.js +102 -0
  67. package/dist/commands/okf/index.js.map +1 -0
  68. package/dist/commands/okf/validate.d.ts +82 -0
  69. package/dist/commands/okf/validate.d.ts.map +1 -0
  70. package/dist/commands/okf/validate.js +157 -0
  71. package/dist/commands/okf/validate.js.map +1 -0
  72. package/dist/commands/phase-utils.d.ts +19 -3
  73. package/dist/commands/phase-utils.d.ts.map +1 -1
  74. package/dist/commands/phase-utils.js +26 -5
  75. package/dist/commands/phase-utils.js.map +1 -1
  76. package/dist/commands/rag/index-command.d.ts +27 -2
  77. package/dist/commands/rag/index-command.d.ts.map +1 -1
  78. package/dist/commands/rag/index-command.js +44 -7
  79. package/dist/commands/rag/index-command.js.map +1 -1
  80. package/dist/commands/rag/index.d.ts.map +1 -1
  81. package/dist/commands/rag/index.js +2 -0
  82. package/dist/commands/rag/index.js.map +1 -1
  83. package/dist/commands/resources/check-progress.d.ts +3 -0
  84. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  85. package/dist/commands/resources/check-progress.js +6 -0
  86. package/dist/commands/resources/check-progress.js.map +1 -1
  87. package/dist/commands/resources/check.d.ts +33 -4
  88. package/dist/commands/resources/check.d.ts.map +1 -1
  89. package/dist/commands/resources/check.js +131 -44
  90. package/dist/commands/resources/check.js.map +1 -1
  91. package/dist/commands/resources/index.d.ts.map +1 -1
  92. package/dist/commands/resources/index.js +41 -9
  93. package/dist/commands/resources/index.js.map +1 -1
  94. package/dist/commands/resources/query.d.ts +18 -1
  95. package/dist/commands/resources/query.d.ts.map +1 -1
  96. package/dist/commands/resources/query.js +29 -4
  97. package/dist/commands/resources/query.js.map +1 -1
  98. package/dist/commands/resources/validate.d.ts +29 -0
  99. package/dist/commands/resources/validate.d.ts.map +1 -1
  100. package/dist/commands/resources/validate.js +116 -13
  101. package/dist/commands/resources/validate.js.map +1 -1
  102. package/dist/commands/skill/review.d.ts.map +1 -1
  103. package/dist/commands/skill/review.js +9 -2
  104. package/dist/commands/skill/review.js.map +1 -1
  105. package/dist/commands/skill/test/run.d.ts.map +1 -1
  106. package/dist/commands/skill/test/run.js +21 -6
  107. package/dist/commands/skill/test/run.js.map +1 -1
  108. package/dist/commands/skills/build.d.ts.map +1 -1
  109. package/dist/commands/skills/build.js +16 -3
  110. package/dist/commands/skills/build.js.map +1 -1
  111. package/dist/commands/skills/list.d.ts +2 -1
  112. package/dist/commands/skills/list.d.ts.map +1 -1
  113. package/dist/commands/skills/list.js +31 -9
  114. package/dist/commands/skills/list.js.map +1 -1
  115. package/dist/commands/skills/skill-discovery.d.ts +40 -1
  116. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  117. package/dist/commands/skills/skill-discovery.js +32 -3
  118. package/dist/commands/skills/skill-discovery.js.map +1 -1
  119. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  120. package/dist/commands/skills/validate-command.js +11 -3
  121. package/dist/commands/skills/validate-command.js.map +1 -1
  122. package/dist/commands/skills/validate.d.ts +66 -7
  123. package/dist/commands/skills/validate.d.ts.map +1 -1
  124. package/dist/commands/skills/validate.js +133 -29
  125. package/dist/commands/skills/validate.js.map +1 -1
  126. package/dist/commands/verify.d.ts +94 -3
  127. package/dist/commands/verify.d.ts.map +1 -1
  128. package/dist/commands/verify.js +192 -45
  129. package/dist/commands/verify.js.map +1 -1
  130. package/dist/skill-resolution/packaging-config.d.ts +49 -5
  131. package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
  132. package/dist/skill-resolution/packaging-config.js +59 -19
  133. package/dist/skill-resolution/packaging-config.js.map +1 -1
  134. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  135. package/dist/skill-resolution/resolve-skill-reference.js +6 -3
  136. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  137. package/dist/utils/command-error.d.ts +31 -0
  138. package/dist/utils/command-error.d.ts.map +1 -1
  139. package/dist/utils/command-error.js +45 -0
  140. package/dist/utils/command-error.js.map +1 -1
  141. package/dist/utils/edge-lens-evaluation.d.ts +83 -0
  142. package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
  143. package/dist/utils/edge-lens-evaluation.js +110 -0
  144. package/dist/utils/edge-lens-evaluation.js.map +1 -0
  145. package/dist/utils/optional-backend.d.ts +5 -4
  146. package/dist/utils/optional-backend.d.ts.map +1 -1
  147. package/dist/utils/optional-backend.js +5 -4
  148. package/dist/utils/optional-backend.js.map +1 -1
  149. package/dist/utils/project-root-policy.d.ts +20 -0
  150. package/dist/utils/project-root-policy.d.ts.map +1 -1
  151. package/dist/utils/project-root-policy.js +32 -0
  152. package/dist/utils/project-root-policy.js.map +1 -1
  153. package/dist/utils/projection-query.d.ts +41 -4
  154. package/dist/utils/projection-query.d.ts.map +1 -1
  155. package/dist/utils/projection-query.js +44 -10
  156. package/dist/utils/projection-query.js.map +1 -1
  157. package/dist/utils/projection-store.d.ts +41 -15
  158. package/dist/utils/projection-store.d.ts.map +1 -1
  159. package/dist/utils/projection-store.js +65 -18
  160. package/dist/utils/projection-store.js.map +1 -1
  161. package/dist/utils/repeatable-option.d.ts +37 -0
  162. package/dist/utils/repeatable-option.d.ts.map +1 -0
  163. package/dist/utils/repeatable-option.js +39 -0
  164. package/dist/utils/repeatable-option.js.map +1 -0
  165. package/dist/utils/resource-loader.d.ts +4 -3
  166. package/dist/utils/resource-loader.d.ts.map +1 -1
  167. package/dist/utils/resource-loader.js +61 -30
  168. package/dist/utils/resource-loader.js.map +1 -1
  169. package/dist/utils/root-argv.d.ts +53 -0
  170. package/dist/utils/root-argv.d.ts.map +1 -0
  171. package/dist/utils/root-argv.js +215 -0
  172. package/dist/utils/root-argv.js.map +1 -0
  173. package/dist/utils/run-integrity.d.ts +95 -0
  174. package/dist/utils/run-integrity.d.ts.map +1 -0
  175. package/dist/utils/run-integrity.js +102 -0
  176. package/dist/utils/run-integrity.js.map +1 -0
  177. package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
  178. package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
  179. package/dist/utils/sqlite-experimental-warning.js +144 -0
  180. package/dist/utils/sqlite-experimental-warning.js.map +1 -0
  181. package/dist/utils/user-context-scanner.d.ts +8 -0
  182. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  183. package/dist/utils/user-context-scanner.js +4 -0
  184. package/dist/utils/user-context-scanner.js.map +1 -1
  185. package/dist/utils/validate-help-files.d.ts.map +1 -1
  186. package/dist/utils/validate-help-files.js +9 -2
  187. package/dist/utils/validate-help-files.js.map +1 -1
  188. package/docs/audit.md +120 -7
  189. package/docs/doctor.md +6 -6
  190. package/docs/index.md +1 -1
  191. package/docs/rag.md +3 -1
  192. package/docs/resources.md +5 -1
  193. package/docs/skills.md +47 -62
  194. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"packaging-config.d.ts","sourceRoot":"","sources":["../../src/skill-resolution/packaging-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIhG,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,2BAA2B,CAAC;AAS9E,+FAA+F;AAC/F,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gCAAgC,CACpD,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAsB9B;AAED,wBAAsB,yBAAyB,CAC7C,aAAa,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,EACnE,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAY9B;AAED;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAsBtC;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAYjG"}
1
+ {"version":3,"file":"packaging-config.d.ts","sourceRoot":"","sources":["../../src/skill-resolution/packaging-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAGhG,OAAO,EAAE,KAAK,yBAAyB,EAA4B,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAmB,KAAK,UAAU,EAAoB,MAAM,2BAA2B,CAAC;AAS/F,+FAA+F;AAC/F,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,gCAAgC,CACpD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAwB9B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,yBAAyB,CAC7C,aAAa,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,EACnE,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAY9B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAiBtC;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAYjG"}
@@ -1,6 +1,6 @@
1
1
  import { findProjectRoot, safePath } from '@vibe-agent-toolkit/utils';
2
2
  import { discoverSkillsFromConfig } from '../commands/skills/skill-discovery.js';
3
- import { loadConfigCached } from '../utils/config-loader.js';
3
+ import { ConfigLoadError, loadConfigCached } from '../utils/config-loader.js';
4
4
  import { collectDeclaredEvalSuites, mergeSkillPackagingConfig } from '../utils/skill-packaging-config.js';
5
5
  /** configRoot → (abs SKILL.md path → declared skill name). One expansion per root. */
6
6
  const skillDiscoveryCache = new Map();
@@ -20,10 +20,19 @@ export function resetSkillDiscoveryCache() {
20
20
  * skill's eval suite is an answer key no matter whose bundle is being built.
21
21
  *
22
22
  * Memoized per config root so a run over N skills under one root pays for discovery
23
- * once, not N times. Returns `[]` when there is no governing config or no skills
24
- * section — wild mode, where there is no project to enumerate.
23
+ * once, not N times — and served from the SAME discovery {@link getDiscoveredSkillsByPath}
24
+ * ran for {@link resolveSkillPackagingConfig}, so one root is crawled once per run, not
25
+ * once per question, and a crawl that refuses answers both questions the same way.
26
+ * Returns `[]` when there is no governing config or no skills section — wild mode,
27
+ * where there is no project to enumerate.
28
+ *
29
+ * ⚠️ Swallows exactly one failure: a config that cannot be LOADED (`ConfigLoadError`),
30
+ * which the caller's own config resolution has already reported. A failed DISCOVERY is
31
+ * not that and propagates — see {@link resolveSkillPackagingConfig} for what it means.
32
+ * The old bare `catch` here treated the two alike, so a refused directory listing
33
+ * quietly became "this project declares no eval suites".
25
34
  */
26
- export async function resolveProjectDeclaredEvalSuites(skillPath) {
35
+ export async function resolveProjectDeclaredEvalSuites(skillPath, unreadable) {
27
36
  const projectRoot = findProjectRoot(safePath.resolve(safePath.join(skillPath, '..')));
28
37
  if (projectRoot === null)
29
38
  return [];
@@ -34,24 +43,44 @@ export async function resolveProjectDeclaredEvalSuites(skillPath) {
34
43
  try {
35
44
  const config = loadConfigCached(projectRoot);
36
45
  if (config?.skills !== undefined) {
37
- suites = collectDeclaredEvalSuites(config.skills, await discoverSkillsFromConfig(config.skills, projectRoot));
46
+ const byPath = await getDiscoveredSkillsByPath(config.skills, projectRoot, unreadable);
47
+ suites = collectDeclaredEvalSuites(config.skills, [...byPath.entries()].map(([sourcePath, name]) => ({ name, sourcePath })));
38
48
  }
39
49
  }
40
- catch {
41
- // A broken or unreadable config is already reported by the caller's own config
42
- // load; degrade to the subject's own declaration rather than aborting the run.
50
+ catch (err) {
51
+ if (!(err instanceof ConfigLoadError))
52
+ throw err;
53
+ // Already reported by the caller's own config load; degrade to the subject's own
54
+ // declaration rather than aborting the run.
43
55
  suites = [];
44
56
  }
45
57
  declaredEvalSuiteCache.set(projectRoot, suites);
46
58
  return suites;
47
59
  }
48
- export async function getDiscoveredSkillsByPath(skillsSection, configRoot) {
60
+ /**
61
+ * The config root's declared skills, as absolute SKILL.md path → declared name.
62
+ *
63
+ * One expansion of `skills.include` per root per run. A discovery that THROWS is
64
+ * not memoized — the next question re-asks the filesystem — and under `'refuse'`
65
+ * it throws whenever the crawl refuses a directory it cannot list
66
+ * (`DirectoryListingRefusedError` from `@vibe-agent-toolkit/utils/crawl`): the
67
+ * declared population is then unknown, and the caller decides whether that stops
68
+ * the command or degrades it. A caller that degrades passes `{ degrade }` and
69
+ * gets every skill the crawl COULD see, with the refusal handed to its handler
70
+ * — see `DiscoveryUnreadablePolicy`. Nothing here decides for them.
71
+ *
72
+ * ⚠️ The memo is per root, not per policy: the first question about a root
73
+ * decides how that root's refusals are handled for the rest of the run. Every
74
+ * command resets the memo at its start (`resetSkillDiscoveryCache`), and only
75
+ * `vat audit` degrades, so a run never mixes the two.
76
+ */
77
+ export async function getDiscoveredSkillsByPath(skillsSection, configRoot, unreadable) {
49
78
  const cached = skillDiscoveryCache.get(configRoot);
50
79
  if (cached !== undefined)
51
80
  return cached;
52
81
  const map = new Map();
53
82
  if (skillsSection !== undefined) {
54
- const discovered = await discoverSkillsFromConfig(skillsSection, configRoot);
83
+ const discovered = await discoverSkillsFromConfig(skillsSection, configRoot, unreadable);
55
84
  for (const entry of discovered) {
56
85
  map.set(safePath.resolve(entry.sourcePath), entry.name);
57
86
  }
@@ -65,8 +94,25 @@ export async function getDiscoveredSkillsByPath(skillsSection, configRoot) {
65
94
  * FULL merge (`skills.defaults` + `skills.config[name]`, keeping
66
95
  * `validation.allow`). `null` when there is no governing config, no `skills`
67
96
  * section, or the skill is not declared (wild mode).
97
+ *
98
+ * 🚨 `null` means "no config governs this skill" and NOTHING else. Two failures
99
+ * propagate instead of being folded into it, because both mean the answer is
100
+ * unknown rather than "none":
101
+ * - `ConfigLoadError` — the governing config exists and could not be loaded;
102
+ * - `DirectoryListingRefusedError` — the config loaded, but expanding its
103
+ * `skills.include` reached a directory the crawl could not list, so the
104
+ * declared population (and whether this skill is in it) is unknown.
105
+ * The second used to be swallowed by a bare `catch { return null; }` around the
106
+ * discovery, with no stated reason. Under it, ONE `chmod 000` directory anywhere
107
+ * an include pattern reaches returned `null` for EVERY skill under the config:
108
+ * `vat audit` validated them all config-free, reported `success`, exited 0 and
109
+ * named the directory only under `--debug`. A caller that would rather degrade
110
+ * than stop passes `{ degrade }` — `vat audit` does, files a
111
+ * `SCAN_PATH_UNREADABLE` finding on the directory, and every skill the crawl
112
+ * could still see keeps its config; the rest say `'refuse'`, as the same
113
+ * refusal already stops `vat skills validate` and `vat skills build`.
68
114
  */
69
- export async function resolveSkillPackagingConfig(skillPath) {
115
+ export async function resolveSkillPackagingConfig(skillPath, unreadable) {
70
116
  const absSkillPath = safePath.resolve(skillPath);
71
117
  const skillDir = safePath.resolve(safePath.join(absSkillPath, '..'));
72
118
  const projectRoot = findProjectRoot(skillDir);
@@ -75,14 +121,8 @@ export async function resolveSkillPackagingConfig(skillPath) {
75
121
  const config = loadConfigCached(projectRoot);
76
122
  if (config?.skills === undefined)
77
123
  return null;
78
- let matchedName;
79
- try {
80
- const byPath = await getDiscoveredSkillsByPath(config.skills, projectRoot);
81
- matchedName = byPath.get(absSkillPath);
82
- }
83
- catch {
84
- return null;
85
- }
124
+ const byPath = await getDiscoveredSkillsByPath(config.skills, projectRoot, unreadable);
125
+ const matchedName = byPath.get(absSkillPath);
86
126
  if (matchedName === undefined)
87
127
  return null;
88
128
  const { defaults, config: perSkillConfig } = config.skills;
@@ -1 +1 @@
1
- {"version":3,"file":"packaging-config.js","sourceRoot":"","sources":["../../src/skill-resolution/packaging-config.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAmB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO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
1
- {"version":3,"file":"resolve-skill-reference.d.ts","sourceRoot":"","sources":["../../src/skill-resolution/resolve-skill-reference.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAC;AA2E3G;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAQxC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAKzC;AAuED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAe7F"}
1
+ {"version":3,"file":"resolve-skill-reference.d.ts","sourceRoot":"","sources":["../../src/skill-resolution/resolve-skill-reference.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAC;AA8E3G;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAQxC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAKzC;AAuED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAe7F"}
@@ -92,7 +92,10 @@ async function findFirstDeclaredSkillEntry(absPath, matches) {
92
92
  const config = loadConfigCached(configRoot);
93
93
  if (config?.skills === undefined)
94
94
  return undefined;
95
- const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot);
95
+ // `'refuse'`: a reference resolved against a partial declared list can land
96
+ // on `not-found` for a skill that exists. The throw propagates to the
97
+ // command (`vat skill test` wraps it as `SkillBuildError`, named).
98
+ const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot, 'refuse');
96
99
  for (const [sourcePath, name] of byPath.entries()) {
97
100
  const result = await matches(sourcePath, name, configRoot, config);
98
101
  if (result !== undefined)
@@ -176,7 +179,7 @@ async function resolveBareName(ref, cwd) {
176
179
  : { kind: 'not-found', ref };
177
180
  }
178
181
  const byName = new Map(); // name → abs SKILL.md path
179
- const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot);
182
+ const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot, 'refuse');
180
183
  for (const [skillMdPath, name] of byPath.entries())
181
184
  byName.set(name, skillMdPath);
182
185
  const sourcePath = byName.get(ref);
@@ -214,7 +217,7 @@ export async function resolveSkillReference(ref, cwd) {
214
217
  return resolveBareName(ref, cwd);
215
218
  }
216
219
  async function buildBuildable(name, sourcePath, configRoot, config) {
217
- const packagingConfig = (await resolveSkillPackagingConfig(sourcePath)) ?? {};
220
+ const packagingConfig = (await resolveSkillPackagingConfig(sourcePath, 'refuse')) ?? {};
218
221
  const { distribution, expectedDistDir } = computeSkillDistribution(name, sourcePath, configRoot, config);
219
222
  return { kind: 'buildable', name, sourcePath, configRoot, packagingConfig, distribution, expectedDistDir };
220
223
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-skill-reference.js","sourceRoot":"","sources":["../../src/skill-resolution/resolve-skill-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,oCAAoC,EACpC,iBAAiB,GA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CAAC,MAAM,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,eAAe;QAAE,OAAO,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1E,OAAO,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACnC,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,IAAY,EACZ,UAAkB,EAClB,UAAkB,EAClB,MAAwD;IAExD,MAAM,eAAe,GAAG,CAAC,MAAM,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACxF,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACzG,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAC7G,CAAC"}
@@ -82,6 +82,37 @@ export declare function reportCommandError(error: unknown, logger: Logger, start
82
82
  * omitted) for YAML — matching the success path's own two-branch switch
83
83
  */
84
84
  export declare function handleCommandError(error: unknown, logger: Logger, startTime: number, commandName: string, format?: string | undefined): never;
85
+ /**
86
+ * Publish an EXPECTED failure in the format the operator asked for, then exit
87
+ * with the code the command's own contract assigns it.
88
+ *
89
+ * The third ending of one failure, beside {@link handleCommandError} (the
90
+ * UNEXPECTED failure, always exit 2) and {@link handleValidationGateFailure}
91
+ * (a validation gate, always exit 1, always YAML). This one covers the failure
92
+ * that is neither: the command ran, understood the project, and has a
93
+ * documented non-zero code for what it found — `vat ard emit` exiting 1 for
94
+ * "this project declares no `ard:` block" or 2 for "there is no config file
95
+ * here".
96
+ *
97
+ * 🔑 It exists because those endings were written inline, and an inline ending
98
+ * publishes nothing: `ard emit` honoured `--format json` on its success path
99
+ * and through `handleCommandError`, then wrote **zero bytes to stdout** on the
100
+ * two exits a repository actually reaches — the commonest being the first run
101
+ * of any repository that never opted into ARD. A CI wrapper reading stdout got
102
+ * an empty document and a bare non-zero code, which is the exact failure the
103
+ * `format` note on {@link handleCommandError} exists to forbid.
104
+ *
105
+ * The message goes to stderr as it always did — humans read it there — and the
106
+ * document goes to stdout, matching what both neighbours already do.
107
+ *
108
+ * @param message - What went wrong, in the command's own words
109
+ * @param exitCode - The code this command's `--help` assigns to this outcome
110
+ * @param startTime - Command start time (from Date.now()), so the document
111
+ * reports the run's real duration rather than a fabricated zero
112
+ * @param format - What the operator asked for: `json`, or anything else (and
113
+ * omitted) for YAML — the same two-branch switch the success path uses
114
+ */
115
+ export declare function handleExpectedFailure(message: string, exitCode: number, startTime: number, format?: string | undefined): never;
85
116
  /** The payload a command publishes when its own validation gate stops it. */
86
117
  export interface ValidationGateFailure {
87
118
  status: 'error';
@@ -1 +1 @@
1
- {"version":3,"file":"command-error.d.ts","sourceRoot":"","sources":["../../src/utils/command-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAExG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMvD;AAED,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,oB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M,GAAG,MAAM,CAE5E"}
@@ -106,6 +106,51 @@ export function handleCommandError(error, logger, startTime, commandName, format
106
106
  }
107
107
  process.exit(2);
108
108
  }
109
+ /**
110
+ * Publish an EXPECTED failure in the format the operator asked for, then exit
111
+ * with the code the command's own contract assigns it.
112
+ *
113
+ * The third ending of one failure, beside {@link handleCommandError} (the
114
+ * UNEXPECTED failure, always exit 2) and {@link handleValidationGateFailure}
115
+ * (a validation gate, always exit 1, always YAML). This one covers the failure
116
+ * that is neither: the command ran, understood the project, and has a
117
+ * documented non-zero code for what it found — `vat ard emit` exiting 1 for
118
+ * "this project declares no `ard:` block" or 2 for "there is no config file
119
+ * here".
120
+ *
121
+ * 🔑 It exists because those endings were written inline, and an inline ending
122
+ * publishes nothing: `ard emit` honoured `--format json` on its success path
123
+ * and through `handleCommandError`, then wrote **zero bytes to stdout** on the
124
+ * two exits a repository actually reaches — the commonest being the first run
125
+ * of any repository that never opted into ARD. A CI wrapper reading stdout got
126
+ * an empty document and a bare non-zero code, which is the exact failure the
127
+ * `format` note on {@link handleCommandError} exists to forbid.
128
+ *
129
+ * The message goes to stderr as it always did — humans read it there — and the
130
+ * document goes to stdout, matching what both neighbours already do.
131
+ *
132
+ * @param message - What went wrong, in the command's own words
133
+ * @param exitCode - The code this command's `--help` assigns to this outcome
134
+ * @param startTime - Command start time (from Date.now()), so the document
135
+ * reports the run's real duration rather than a fabricated zero
136
+ * @param format - What the operator asked for: `json`, or anything else (and
137
+ * omitted) for YAML — the same two-branch switch the success path uses
138
+ */
139
+ export function handleExpectedFailure(message, exitCode, startTime, format) {
140
+ process.stderr.write(`${message}\n`);
141
+ const document = {
142
+ status: 'error',
143
+ error: message,
144
+ duration: formatDuration(Date.now() - startTime),
145
+ };
146
+ if (format === 'json') {
147
+ writeJsonOutput(document);
148
+ }
149
+ else {
150
+ writeYamlOutput(document);
151
+ }
152
+ process.exit(exitCode);
153
+ }
109
154
  /**
110
155
  * Pure: the document {@link handleValidationGateFailure} writes.
111
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E,GAAG,SAAS,CAAC;KACjD,CAAC;IACF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC;AAUD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAe,EACf,MAAkC;IAElC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACnF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAe,EACf,MAAkC;IAElC,eAAe,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,0BAA0B,CAAC,iBAAyB;IAClE,OAAO,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Evaluating the authored-link lens over a populated projection, so SQL can ask
3
+ * about edges.
4
+ *
5
+ * ## Why the CLI does this rather than the population
6
+ *
7
+ * `edges` and `edge_resolutions` are derived per lens, and the set of lenses is
8
+ * not known at population time — zones.md §2: *"A lens may be declared in config
9
+ * **or invented on demand** to answer a question nobody anticipated."* So a
10
+ * population cannot produce them without first inventing the lens, which is a
11
+ * question, not a fact. Inventing one here costs a definition and a pass over
12
+ * rows already in memory; it commits the data model to nothing, and the rows go
13
+ * into the per-run in-memory database that `projection-query.ts` guarantees
14
+ * holds this tree and nothing else.
15
+ *
16
+ * ## One lens per extent, and the extent is the thing worth naming
17
+ *
18
+ * A corpus has more than one extent — this repository has two, `filesystem`
19
+ * (the tracked tree) and `agentic-convention` (the CLAUDE.md closure) — and an
20
+ * edge relation over one is a different relation from an edge relation over the
21
+ * other. Evaluating every extent and keying the rows on the lens's own
22
+ * `contextId` means a caller SELECTs the population they meant, rather than
23
+ * silently getting whichever one happened to be evaluated. `lens_contexts` says
24
+ * which lenses exist and which extent each reads over, so the join is
25
+ * discoverable from SQL alone.
26
+ *
27
+ * ⚠️ **Only `species: 'extent'` rows are read over.** A lens over a lens is not
28
+ * a thing this evaluation models, and `resolution_contexts` holds no lens rows
29
+ * anyway — nothing in the population mints one. The filter is there so that
30
+ * stops being true loudly rather than silently if something ever does.
31
+ */
32
+ import { type Projection, type ResolutionContextRow } from '@vibe-agent-toolkit/resources';
33
+ /**
34
+ * The rows one sweep of the corpus produced, ready for `writeDerived`.
35
+ *
36
+ * 🪤 **The three field names must be `DERIVED_TABLES`' own keys, and nothing
37
+ * used to check that.** `writeDerived` looks each relation up by
38
+ * `bundle[spec.key]`, and every member of `DerivedRows` is optional — so
39
+ * renaming a derived relation left this interface spelling the OLD name, which
40
+ * type-checked cleanly as a tolerated excess property while the renamed
41
+ * relation was silently never written. Verified: the rename compiled with zero
42
+ * errors under `--strict`.
43
+ *
44
+ * The `satisfies` below is what makes the correspondence real rather than a
45
+ * coincidence of spelling — a renamed relation now fails to compile here.
46
+ */
47
+ export interface EvaluatedLenses {
48
+ readonly lensContexts: readonly ResolutionContextRow[];
49
+ readonly edges: readonly Record<string, unknown>[];
50
+ readonly edgeResolutions: readonly Record<string, unknown>[];
51
+ }
52
+ /**
53
+ * Every key of {@link EvaluatedLenses} names a real derived relation.
54
+ *
55
+ * A compile-time assertion with no runtime cost beyond one frozen object: it
56
+ * pins the field names of `EvaluatedLenses` to `DerivedTableName`, which is
57
+ * the correspondence `writeDerived` depends on and cannot express itself.
58
+ */
59
+ export declare const EVALUATED_LENS_RELATIONS: {
60
+ readonly lensContexts: true;
61
+ readonly edges: true;
62
+ readonly edgeResolutions: true;
63
+ };
64
+ /**
65
+ * Evaluate the authored-link lens over every extent in a projection.
66
+ *
67
+ * @param projection - A populated projection
68
+ * @returns The lens rows and the two relations, in step with each other
69
+ */
70
+ export declare function evaluateAuthoredLenses(projection: Projection): EvaluatedLenses;
71
+ /**
72
+ * The lens id for one extent's authored-link view.
73
+ *
74
+ * Derived from the extent's own id rather than minted fresh, so the same tree
75
+ * produces the same lens id on every run and a reader can predict it. It is
76
+ * NOT a digest: nothing here needs collision resistance, and a readable id is
77
+ * what makes `WHERE contextId = …` writable by hand.
78
+ *
79
+ * @param extentContextId - The extent this lens reads over
80
+ * @returns The lens's `contextId`
81
+ */
82
+ export declare function authoredLensId(extentContextId: string): string;
83
+ //# sourceMappingURL=edge-lens-evaluation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-lens-evaluation.d.ts","sourceRoot":"","sources":["../../src/utils/edge-lens-evaluation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAavC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACnD,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;;;CAEqE,CAAC;AAE3G;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CAsC9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Evaluating the authored-link lens over a populated projection, so SQL can ask
3
+ * about edges.
4
+ *
5
+ * ## Why the CLI does this rather than the population
6
+ *
7
+ * `edges` and `edge_resolutions` are derived per lens, and the set of lenses is
8
+ * not known at population time — zones.md §2: *"A lens may be declared in config
9
+ * **or invented on demand** to answer a question nobody anticipated."* So a
10
+ * population cannot produce them without first inventing the lens, which is a
11
+ * question, not a fact. Inventing one here costs a definition and a pass over
12
+ * rows already in memory; it commits the data model to nothing, and the rows go
13
+ * into the per-run in-memory database that `projection-query.ts` guarantees
14
+ * holds this tree and nothing else.
15
+ *
16
+ * ## One lens per extent, and the extent is the thing worth naming
17
+ *
18
+ * A corpus has more than one extent — this repository has two, `filesystem`
19
+ * (the tracked tree) and `agentic-convention` (the CLAUDE.md closure) — and an
20
+ * edge relation over one is a different relation from an edge relation over the
21
+ * other. Evaluating every extent and keying the rows on the lens's own
22
+ * `contextId` means a caller SELECTs the population they meant, rather than
23
+ * silently getting whichever one happened to be evaluated. `lens_contexts` says
24
+ * which lenses exist and which extent each reads over, so the join is
25
+ * discoverable from SQL alone.
26
+ *
27
+ * ⚠️ **Only `species: 'extent'` rows are read over.** A lens over a lens is not
28
+ * a thing this evaluation models, and `resolution_contexts` holds no lens rows
29
+ * anyway — nothing in the population mints one. The filter is there so that
30
+ * stops being true loudly rather than silently if something ever does.
31
+ */
32
+ import { AUTHORED_EDGE_FORMS, buildReferenceIndex, resolveEdges, } from '@vibe-agent-toolkit/resources';
33
+ /**
34
+ * The lens kind these evaluations declare.
35
+ *
36
+ * `ZoneKindSchema` is an open vocabulary, so this names the POLICY rather than
37
+ * the mechanism: what makes two of these lenses the same is that both admit the
38
+ * authored forms and nothing else. A lens that promoted bare tokens would be a
39
+ * different kind, not a variant of this one, because the two answer differently
40
+ * by an order of magnitude and a reader comparing them must be able to tell.
41
+ */
42
+ const AUTHORED_LENS_KIND = 'authored-link';
43
+ /**
44
+ * Every key of {@link EvaluatedLenses} names a real derived relation.
45
+ *
46
+ * A compile-time assertion with no runtime cost beyond one frozen object: it
47
+ * pins the field names of `EvaluatedLenses` to `DerivedTableName`, which is
48
+ * the correspondence `writeDerived` depends on and cannot express itself.
49
+ */
50
+ export const EVALUATED_LENS_RELATIONS = {
51
+ lensContexts: true, edges: true, edgeResolutions: true,
52
+ };
53
+ /**
54
+ * Evaluate the authored-link lens over every extent in a projection.
55
+ *
56
+ * @param projection - A populated projection
57
+ * @returns The lens rows and the two relations, in step with each other
58
+ */
59
+ export function evaluateAuthoredLenses(projection) {
60
+ const lensContexts = [];
61
+ const edges = [];
62
+ const edgeResolutions = [];
63
+ // Built ONCE for every lens. It is a pure function of `blob_references` and
64
+ // reads nothing from a lens, so rebuilding it per extent is duplicated work a
65
+ // one-member extent would pay in full — 43 ms at one extent against 713 ms at
66
+ // ten, measured on this repository.
67
+ const referencesByBlob = buildReferenceIndex(projection);
68
+ for (const context of projection.resolutionContexts) {
69
+ if (context.species !== 'extent')
70
+ continue;
71
+ const contextId = authoredLensId(context.contextId);
72
+ lensContexts.push({
73
+ contextId,
74
+ species: 'lens',
75
+ kind: AUTHORED_LENS_KIND,
76
+ rootId: context.rootId,
77
+ extentContextId: context.contextId,
78
+ // Null because this lens's kind is not `tree`; the schema refuses a role
79
+ // on any other kind, which is that check doing its job rather than a
80
+ // field being forgotten.
81
+ role: null,
82
+ });
83
+ const relation = resolveEdges(projection, {
84
+ contextId,
85
+ extentContextId: context.contextId,
86
+ forms: AUTHORED_EDGE_FORMS,
87
+ // Ordinary markdown. `claude-import` is the other dialect and belongs to
88
+ // the `@`-import forms, which the authored-only policy does not admit.
89
+ dialect: 'href',
90
+ }, { referencesByBlob });
91
+ edges.push(...relation.edges);
92
+ edgeResolutions.push(...relation.edgeResolutions);
93
+ }
94
+ return { lensContexts, edges, edgeResolutions };
95
+ }
96
+ /**
97
+ * The lens id for one extent's authored-link view.
98
+ *
99
+ * Derived from the extent's own id rather than minted fresh, so the same tree
100
+ * produces the same lens id on every run and a reader can predict it. It is
101
+ * NOT a digest: nothing here needs collision resistance, and a readable id is
102
+ * what makes `WHERE contextId = …` writable by hand.
103
+ *
104
+ * @param extentContextId - The extent this lens reads over
105
+ * @returns The lens's `contextId`
106
+ */
107
+ export function authoredLensId(extentContextId) {
108
+ return `lens-${AUTHORED_LENS_KIND}-${extentContextId}`;
109
+ }
110
+ //# sourceMappingURL=edge-lens-evaluation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-lens-evaluation.js","sourceRoot":"","sources":["../../src/utils/edge-lens-evaluation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,GAIb,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAsB3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI;CACkD,CAAC;AAE3G;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC3D,MAAM,YAAY,GAA2B,EAAE,CAAC;IAChD,MAAM,KAAK,GAA8B,EAAE,CAAC;IAC5C,MAAM,eAAe,GAA8B,EAAE,CAAC;IAEtD,4EAA4E;IAC5E,8EAA8E;IAC9E,8EAA8E;IAC9E,oCAAoC;IACpC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAEzD,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,kBAAkB,EAAE,CAAC;QACpD,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ;YAAE,SAAS;QAC3C,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpD,YAAY,CAAC,IAAI,CAAC;YAChB,SAAS;YACT,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,eAAe,EAAE,OAAO,CAAC,SAAS;YAClC,yEAAyE;YACzE,qEAAqE;YACrE,yBAAyB;YACzB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,EAAE;YACxC,SAAS;YACT,eAAe,EAAE,OAAO,CAAC,SAAS;YAClC,KAAK,EAAE,mBAAmB;YAC1B,yEAAyE;YACzE,uEAAuE;YACvE,OAAO,EAAE,MAAM;SAChB,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,eAAe,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;AAClD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,eAAuB;IACpD,OAAO,QAAQ,kBAAkB,IAAI,eAAe,EAAE,CAAC;AACzD,CAAC"}
@@ -5,10 +5,11 @@
5
5
  * ## Why this exists rather than four `await import()` calls
6
6
  *
7
7
  * `@vibe-agent-toolkit/rag-lancedb` pulls a platform-native LanceDB binary
8
- * (119.6 MiB unpacked on `win32-x64`, 40.3 MiB compressed to download) plus
9
- * `onnxruntime-web` (133 MB) and `gpt-tokenizer` (44 MB). Measured on the
10
- * published `vibe-agent-toolkit@0.1.42`: **275 MB of a 351 MB install is the
11
- * RAG lane**, and a static import chain from `bin.ts` meant
8
+ * (97.8 MB unpacked on `darwin-arm64`, and larger still on `win32-x64`, where
9
+ * it measured 119.6 MiB) plus `onnxruntime-web` (137.5 MB) and `gpt-tokenizer`
10
+ * (42.2 MB). Summed over the RAG lane's third-party closure against this
11
+ * release's pins, on `darwin-arm64`: **~287 MB unpacked**, and a static import
12
+ * chain from `bin.ts` meant
12
13
  * `import('@lancedb/lancedb')` — **1,350 ms cold** — ran before `vat --version`
13
14
  * could print a string. It is a named seam rather than a one-off fix because
14
15
  * "optional backend" is a shape VAT keeps growing — a projection store is
@@ -1 +1 @@
1
- {"version":3,"file":"optional-backend.d.ts","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOvD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,KAAK,CAcpE;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EACxD,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAC9C,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAalC"}
1
+ {"version":3,"file":"optional-backend.d.ts","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOvD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,KAAK,CAcpE;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EACxD,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAC9C,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAalC"}
@@ -5,10 +5,11 @@
5
5
  * ## Why this exists rather than four `await import()` calls
6
6
  *
7
7
  * `@vibe-agent-toolkit/rag-lancedb` pulls a platform-native LanceDB binary
8
- * (119.6 MiB unpacked on `win32-x64`, 40.3 MiB compressed to download) plus
9
- * `onnxruntime-web` (133 MB) and `gpt-tokenizer` (44 MB). Measured on the
10
- * published `vibe-agent-toolkit@0.1.42`: **275 MB of a 351 MB install is the
11
- * RAG lane**, and a static import chain from `bin.ts` meant
8
+ * (97.8 MB unpacked on `darwin-arm64`, and larger still on `win32-x64`, where
9
+ * it measured 119.6 MiB) plus `onnxruntime-web` (137.5 MB) and `gpt-tokenizer`
10
+ * (42.2 MB). Summed over the RAG lane's third-party closure against this
11
+ * release's pins, on `darwin-arm64`: **~287 MB unpacked**, and a static import
12
+ * chain from `bin.ts` meant
12
13
  * `import('@lancedb/lancedb')` — **1,350 ms cold** — ran before `vat --version`
13
14
  * could print a string. It is a named seam rather than a one-off fix because
14
15
  * "optional backend" is a shape VAT keeps growing — a projection store is
@@ -1 +1 @@
1
- {"version":3,"file":"optional-backend.js","sourceRoot":"","sources":["../../src/utils/optional-backend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+C;IAE/C,OAAO,KAAK,EAAE,GAAG,IAAU,EAAiB,EAAE;QAC5C,IAAI,OAA0C,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC"}
@@ -30,4 +30,24 @@ export declare function projectRootOrLoudCwd(startDir: string, logger: Logger):
30
30
  * `tolerate null` policy — return `string | null`; caller handles either case.
31
31
  */
32
32
  export declare function projectRootOrNull(startDir: string): string | null;
33
+ /**
34
+ * Fail loudly on a `[path]` argument that names no directory.
35
+ *
36
+ * Every `resources` verb takes an optional `[path]`, and two things can be
37
+ * meant by it: a SCOPE (`scan`, `validate` — crawl this subtree) or a LOCATOR
38
+ * (`query`, `check` — find the project from here; the projection is always the
39
+ * whole tree). Both start by resolving the argument, and both must refuse one
40
+ * that resolves to nothing — the scoping verbs would otherwise degrade into a
41
+ * glob matching nothing (`filesScanned: 0`, green), and the locating verbs
42
+ * walked UP from the missing path to whatever project the cwd is in and
43
+ * answered about THAT tree at exit 0, byte-identical to a correct run.
44
+ *
45
+ * One function so the two families refuse with one message; a reader who saw
46
+ * `validate` say "Path does not exist" should get the same words from `query`.
47
+ *
48
+ * @param pathArg - The argument as typed, relative to cwd or absolute
49
+ * @returns The resolved absolute path
50
+ * @throws When it does not exist or is not a directory
51
+ */
52
+ export declare function assertDirectoryArgument(pathArg: string): string;
33
53
  //# sourceMappingURL=project-root-policy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-root-policy.d.ts","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAShF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjE"}
1
+ {"version":3,"file":"project-root-policy.d.ts","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAShF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW/D"}