@stigmer/plugin-package 0.1.0-dev.20261017020314.g644422724c27

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 (273) hide show
  1. package/LICENSE +194 -0
  2. package/README.md +72 -0
  3. package/client/archive.d.ts +27 -0
  4. package/client/archive.d.ts.map +1 -0
  5. package/client/archive.js +38 -0
  6. package/client/archive.js.map +1 -0
  7. package/client/builtin.d.ts +37 -0
  8. package/client/builtin.d.ts.map +1 -0
  9. package/client/builtin.js +49 -0
  10. package/client/builtin.js.map +1 -0
  11. package/client/ignore/defaults.d.ts +2 -0
  12. package/client/ignore/defaults.d.ts.map +1 -0
  13. package/client/ignore/defaults.js +140 -0
  14. package/client/ignore/defaults.js.map +1 -0
  15. package/client/ignore/match.d.ts +3 -0
  16. package/client/ignore/match.d.ts.map +1 -0
  17. package/client/ignore/match.js +166 -0
  18. package/client/ignore/match.js.map +1 -0
  19. package/client/ignore/matcher.d.ts +50 -0
  20. package/client/ignore/matcher.d.ts.map +1 -0
  21. package/client/ignore/matcher.js +116 -0
  22. package/client/ignore/matcher.js.map +1 -0
  23. package/client/ignore/pattern.d.ts +13 -0
  24. package/client/ignore/pattern.d.ts.map +1 -0
  25. package/client/ignore/pattern.js +119 -0
  26. package/client/ignore/pattern.js.map +1 -0
  27. package/client/prepare-eval.d.ts +62 -0
  28. package/client/prepare-eval.d.ts.map +1 -0
  29. package/client/prepare-eval.js +60 -0
  30. package/client/prepare-eval.js.map +1 -0
  31. package/client/prepare.d.ts +99 -0
  32. package/client/prepare.d.ts.map +1 -0
  33. package/client/prepare.js +89 -0
  34. package/client/prepare.js.map +1 -0
  35. package/client/presentation.d.ts +19 -0
  36. package/client/presentation.d.ts.map +1 -0
  37. package/client/presentation.js +44 -0
  38. package/client/presentation.js.map +1 -0
  39. package/client/refs.d.ts +76 -0
  40. package/client/refs.d.ts.map +1 -0
  41. package/client/refs.js +123 -0
  42. package/client/refs.js.map +1 -0
  43. package/client/release.d.ts +20 -0
  44. package/client/release.d.ts.map +1 -0
  45. package/client/release.js +28 -0
  46. package/client/release.js.map +1 -0
  47. package/client/reroot.d.ts +21 -0
  48. package/client/reroot.d.ts.map +1 -0
  49. package/client/reroot.js +37 -0
  50. package/client/reroot.js.map +1 -0
  51. package/client/select.d.ts +74 -0
  52. package/client/select.d.ts.map +1 -0
  53. package/client/select.js +121 -0
  54. package/client/select.js.map +1 -0
  55. package/client/vocabulary.d.ts +13 -0
  56. package/client/vocabulary.d.ts.map +1 -0
  57. package/client/vocabulary.js +17 -0
  58. package/client/vocabulary.js.map +1 -0
  59. package/client.d.ts +51 -0
  60. package/client.d.ts.map +1 -0
  61. package/client.js +51 -0
  62. package/client.js.map +1 -0
  63. package/detect.d.ts +83 -0
  64. package/detect.d.ts.map +1 -0
  65. package/detect.js +210 -0
  66. package/detect.js.map +1 -0
  67. package/dialects/claude.d.ts +34 -0
  68. package/dialects/claude.d.ts.map +1 -0
  69. package/dialects/claude.js +84 -0
  70. package/dialects/claude.js.map +1 -0
  71. package/dialects/codex.d.ts +20 -0
  72. package/dialects/codex.d.ts.map +1 -0
  73. package/dialects/codex.js +21 -0
  74. package/dialects/codex.js.map +1 -0
  75. package/dialects/cursor.d.ts +25 -0
  76. package/dialects/cursor.d.ts.map +1 -0
  77. package/dialects/cursor.js +66 -0
  78. package/dialects/cursor.js.map +1 -0
  79. package/dialects/manifest.d.ts +164 -0
  80. package/dialects/manifest.d.ts.map +1 -0
  81. package/dialects/manifest.js +256 -0
  82. package/dialects/manifest.js.map +1 -0
  83. package/dialects/open.d.ts +19 -0
  84. package/dialects/open.d.ts.map +1 -0
  85. package/dialects/open.js +49 -0
  86. package/dialects/open.js.map +1 -0
  87. package/documents.d.ts +58 -0
  88. package/documents.d.ts.map +1 -0
  89. package/documents.js +121 -0
  90. package/documents.js.map +1 -0
  91. package/evals/eval-dir.d.ts +59 -0
  92. package/evals/eval-dir.d.ts.map +1 -0
  93. package/evals/eval-dir.js +84 -0
  94. package/evals/eval-dir.js.map +1 -0
  95. package/evals/fields.d.ts +78 -0
  96. package/evals/fields.d.ts.map +1 -0
  97. package/evals/fields.js +156 -0
  98. package/evals/fields.js.map +1 -0
  99. package/evals/glob.d.ts +40 -0
  100. package/evals/glob.d.ts.map +1 -0
  101. package/evals/glob.js +146 -0
  102. package/evals/glob.js.map +1 -0
  103. package/evals/graders.d.ts +52 -0
  104. package/evals/graders.d.ts.map +1 -0
  105. package/evals/graders.js +279 -0
  106. package/evals/graders.js.map +1 -0
  107. package/evals/markdown.d.ts +24 -0
  108. package/evals/markdown.d.ts.map +1 -0
  109. package/evals/markdown.js +48 -0
  110. package/evals/markdown.js.map +1 -0
  111. package/evals/mocks.d.ts +50 -0
  112. package/evals/mocks.d.ts.map +1 -0
  113. package/evals/mocks.js +182 -0
  114. package/evals/mocks.js.map +1 -0
  115. package/evals/read-eval-suite.d.ts +110 -0
  116. package/evals/read-eval-suite.d.ts.map +1 -0
  117. package/evals/read-eval-suite.js +603 -0
  118. package/evals/read-eval-suite.js.map +1 -0
  119. package/evals/summary.d.ts +61 -0
  120. package/evals/summary.d.ts.map +1 -0
  121. package/evals/summary.js +69 -0
  122. package/evals/summary.js.map +1 -0
  123. package/evals/types.d.ts +203 -0
  124. package/evals/types.d.ts.map +1 -0
  125. package/evals/types.js +21 -0
  126. package/evals/types.js.map +1 -0
  127. package/files.d.ts +135 -0
  128. package/files.d.ts.map +1 -0
  129. package/files.js +209 -0
  130. package/files.js.map +1 -0
  131. package/frontmatter.d.ts +51 -0
  132. package/frontmatter.d.ts.map +1 -0
  133. package/frontmatter.js +61 -0
  134. package/frontmatter.js.map +1 -0
  135. package/index.d.ts +37 -0
  136. package/index.d.ts.map +1 -0
  137. package/index.js +33 -0
  138. package/index.js.map +1 -0
  139. package/marketplace/messages.d.ts +20 -0
  140. package/marketplace/messages.d.ts.map +1 -0
  141. package/marketplace/messages.js +49 -0
  142. package/marketplace/messages.js.map +1 -0
  143. package/marketplace/outcome.d.ts +70 -0
  144. package/marketplace/outcome.d.ts.map +1 -0
  145. package/marketplace/outcome.js +29 -0
  146. package/marketplace/outcome.js.map +1 -0
  147. package/marketplace/read-marketplace.d.ts +52 -0
  148. package/marketplace/read-marketplace.d.ts.map +1 -0
  149. package/marketplace/read-marketplace.js +351 -0
  150. package/marketplace/read-marketplace.js.map +1 -0
  151. package/messages.d.ts +55 -0
  152. package/messages.d.ts.map +1 -0
  153. package/messages.js +167 -0
  154. package/messages.js.map +1 -0
  155. package/normalise/hooks.d.ts +91 -0
  156. package/normalise/hooks.d.ts.map +1 -0
  157. package/normalise/hooks.js +437 -0
  158. package/normalise/hooks.js.map +1 -0
  159. package/normalise/ignored.d.ts +34 -0
  160. package/normalise/ignored.d.ts.map +1 -0
  161. package/normalise/ignored.js +78 -0
  162. package/normalise/ignored.js.map +1 -0
  163. package/normalise/mcp-servers.d.ts +50 -0
  164. package/normalise/mcp-servers.d.ts.map +1 -0
  165. package/normalise/mcp-servers.js +398 -0
  166. package/normalise/mcp-servers.js.map +1 -0
  167. package/normalise/settings.d.ts +32 -0
  168. package/normalise/settings.d.ts.map +1 -0
  169. package/normalise/settings.js +72 -0
  170. package/normalise/settings.js.map +1 -0
  171. package/normalise/skills.d.ts +39 -0
  172. package/normalise/skills.d.ts.map +1 -0
  173. package/normalise/skills.js +135 -0
  174. package/normalise/skills.js.map +1 -0
  175. package/normalise/stigmer-folder.d.ts +17 -0
  176. package/normalise/stigmer-folder.d.ts.map +1 -0
  177. package/normalise/stigmer-folder.js +19 -0
  178. package/normalise/stigmer-folder.js.map +1 -0
  179. package/normalise/sub-agents.d.ts +54 -0
  180. package/normalise/sub-agents.d.ts.map +1 -0
  181. package/normalise/sub-agents.js +219 -0
  182. package/normalise/sub-agents.js.map +1 -0
  183. package/normalise/variables.d.ts +31 -0
  184. package/normalise/variables.d.ts.map +1 -0
  185. package/normalise/variables.js +170 -0
  186. package/normalise/variables.js.map +1 -0
  187. package/outcome.d.ts +59 -0
  188. package/outcome.d.ts.map +1 -0
  189. package/outcome.js +32 -0
  190. package/outcome.js.map +1 -0
  191. package/package.json +47 -0
  192. package/placeholders.d.ts +65 -0
  193. package/placeholders.d.ts.map +1 -0
  194. package/placeholders.js +99 -0
  195. package/placeholders.js.map +1 -0
  196. package/presentation.d.ts +53 -0
  197. package/presentation.d.ts.map +1 -0
  198. package/presentation.js +156 -0
  199. package/presentation.js.map +1 -0
  200. package/read-plugin-package.d.ts +20 -0
  201. package/read-plugin-package.d.ts.map +1 -0
  202. package/read-plugin-package.js +73 -0
  203. package/read-plugin-package.js.map +1 -0
  204. package/src/client/archive.ts +44 -0
  205. package/src/client/builtin.ts +60 -0
  206. package/src/client/ignore/defaults.ts +155 -0
  207. package/src/client/ignore/match.ts +158 -0
  208. package/src/client/ignore/matcher.ts +156 -0
  209. package/src/client/ignore/pattern.ts +132 -0
  210. package/src/client/prepare-eval.ts +92 -0
  211. package/src/client/prepare.ts +160 -0
  212. package/src/client/presentation.ts +47 -0
  213. package/src/client/refs.ts +170 -0
  214. package/src/client/release.ts +29 -0
  215. package/src/client/reroot.ts +35 -0
  216. package/src/client/select.ts +161 -0
  217. package/src/client/vocabulary.ts +19 -0
  218. package/src/client.ts +102 -0
  219. package/src/detect.ts +245 -0
  220. package/src/dialects/claude.ts +102 -0
  221. package/src/dialects/codex.ts +26 -0
  222. package/src/dialects/cursor.ts +77 -0
  223. package/src/dialects/manifest.ts +316 -0
  224. package/src/dialects/open.ts +50 -0
  225. package/src/documents.ts +158 -0
  226. package/src/evals/eval-dir.ts +101 -0
  227. package/src/evals/fields.ts +184 -0
  228. package/src/evals/glob.ts +141 -0
  229. package/src/evals/graders.ts +293 -0
  230. package/src/evals/markdown.ts +56 -0
  231. package/src/evals/mocks.ts +202 -0
  232. package/src/evals/read-eval-suite.ts +713 -0
  233. package/src/evals/summary.ts +100 -0
  234. package/src/evals/types.ts +217 -0
  235. package/src/files.ts +235 -0
  236. package/src/frontmatter.ts +70 -0
  237. package/src/index.ts +129 -0
  238. package/src/marketplace/messages.ts +61 -0
  239. package/src/marketplace/outcome.ts +91 -0
  240. package/src/marketplace/read-marketplace.ts +388 -0
  241. package/src/messages.ts +248 -0
  242. package/src/normalise/hooks.ts +469 -0
  243. package/src/normalise/ignored.ts +79 -0
  244. package/src/normalise/mcp-servers.ts +423 -0
  245. package/src/normalise/settings.ts +81 -0
  246. package/src/normalise/skills.ts +145 -0
  247. package/src/normalise/stigmer-folder.ts +23 -0
  248. package/src/normalise/sub-agents.ts +231 -0
  249. package/src/normalise/variables.ts +181 -0
  250. package/src/outcome.ts +158 -0
  251. package/src/placeholders.ts +110 -0
  252. package/src/presentation.ts +170 -0
  253. package/src/read-plugin-package.ts +80 -0
  254. package/src/testing.ts +347 -0
  255. package/src/tool-names.ts +30 -0
  256. package/src/trim.ts +10 -0
  257. package/src/types.ts +214 -0
  258. package/testing.d.ts +127 -0
  259. package/testing.d.ts.map +1 -0
  260. package/testing.js +266 -0
  261. package/testing.js.map +1 -0
  262. package/tool-names.d.ts +21 -0
  263. package/tool-names.d.ts.map +1 -0
  264. package/tool-names.js +28 -0
  265. package/tool-names.js.map +1 -0
  266. package/trim.d.ts +7 -0
  267. package/trim.d.ts.map +1 -0
  268. package/trim.js +12 -0
  269. package/trim.js.map +1 -0
  270. package/types.d.ts +179 -0
  271. package/types.d.ts.map +1 -0
  272. package/types.js +19 -0
  273. package/types.js.map +1 -0
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The eval suite as a plugin stores it: what the plugin page and the CLI
3
+ * list before anyone runs it, bounded so the plugin's row stays within one
4
+ * API message.
5
+ *
6
+ * An archive may hold up to its entry limit of files with long names, and
7
+ * every case and finding would otherwise ride on the plugin's status. So
8
+ * the summary keeps the first {@link EVAL_SUMMARY_MAX_CASES} cases and the
9
+ * first {@link EVAL_SUMMARY_MAX_FINDINGS} findings, in the reader's order,
10
+ * the first {@link EVAL_SUMMARY_MAX_CASE_TAGS} tags of each case, and cuts
11
+ * every text it copies from the suite (a case's name, directory and tags,
12
+ * a finding's path) to {@link EVAL_SUMMARY_MAX_TEXT} characters and an
13
+ * ellipsis. A finding's path is cut in its message too, where the message
14
+ * starts with it, and the message is then cut to
15
+ * {@link EVAL_SUMMARY_MAX_MESSAGE}: longer than the other texts, since it
16
+ * holds the cut path and then the problem, which quotes up to
17
+ * {@link EVAL_SUMMARY_MAX_TEXT} characters of a value itself. The
18
+ * suite's tags are the listed cases' kept tags, cut, once each, sorted,
19
+ * and the first {@link EVAL_SUMMARY_MAX_SUITE_TAGS} of those. `caseCount`
20
+ * still counts every case, and the suite's directory is copied whole: the
21
+ * runner leaves it out of every mount, and the reader bounds it. The eval
22
+ * itself reads the archive again, so nothing a run needs is cut.
23
+ *
24
+ * Pinned by `__tests__/eval-summary.test.ts`.
25
+ */
26
+ import type { EvalSuite, EvalSuiteFinding } from "./types.js";
27
+ /** The most cases a stored summary lists. */
28
+ export declare const EVAL_SUMMARY_MAX_CASES = 200;
29
+ /** The most findings a stored summary keeps. */
30
+ export declare const EVAL_SUMMARY_MAX_FINDINGS = 50;
31
+ /** The most characters of any text a stored summary copies, then an ellipsis. */
32
+ export declare const EVAL_SUMMARY_MAX_TEXT = 200;
33
+ /** The most characters of a finding's path a stored summary keeps, then an ellipsis. */
34
+ export declare const EVAL_SUMMARY_MAX_PATH = 200;
35
+ /** The most characters of a finding's message a stored summary keeps, then an ellipsis. */
36
+ export declare const EVAL_SUMMARY_MAX_MESSAGE = 1000;
37
+ /** The most tags a stored summary lists for one case. */
38
+ export declare const EVAL_SUMMARY_MAX_CASE_TAGS = 32;
39
+ /** The most tags a stored summary lists for the suite. */
40
+ export declare const EVAL_SUMMARY_MAX_SUITE_TAGS = 200;
41
+ /** One case as the summary lists it. */
42
+ export interface EvalSuiteSummaryCase {
43
+ readonly name: string;
44
+ readonly dir: string;
45
+ readonly tags: readonly string[];
46
+ /** The feature Stigmer does not run yet; absent when the case runs. */
47
+ readonly unsupported?: string;
48
+ }
49
+ /** The suite as a plugin stores it. */
50
+ export interface EvalSuiteSummary {
51
+ readonly dir: string;
52
+ /** Every case the suite holds, listed or not. */
53
+ readonly caseCount: number;
54
+ /** The listed cases' tags, once each, sorted, the first EVAL_SUMMARY_MAX_SUITE_TAGS of them. */
55
+ readonly caseTags: readonly string[];
56
+ readonly cases: readonly EvalSuiteSummaryCase[];
57
+ readonly findings: readonly EvalSuiteFinding[];
58
+ }
59
+ /** The suite, bounded for storage on the plugin. */
60
+ export declare function summariseEvalSuite(suite: EvalSuite): EvalSuiteSummary;
61
+ //# sourceMappingURL=summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/evals/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,gDAAgD;AAChD,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,MAAoB,CAAC;AAEvD,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,MAAwB,CAAC;AAE3D,2FAA2F;AAC3F,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,yDAAyD;AACzD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,gBAAgB,CAcrE"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The eval suite as a plugin stores it: what the plugin page and the CLI
3
+ * list before anyone runs it, bounded so the plugin's row stays within one
4
+ * API message.
5
+ *
6
+ * An archive may hold up to its entry limit of files with long names, and
7
+ * every case and finding would otherwise ride on the plugin's status. So
8
+ * the summary keeps the first {@link EVAL_SUMMARY_MAX_CASES} cases and the
9
+ * first {@link EVAL_SUMMARY_MAX_FINDINGS} findings, in the reader's order,
10
+ * the first {@link EVAL_SUMMARY_MAX_CASE_TAGS} tags of each case, and cuts
11
+ * every text it copies from the suite (a case's name, directory and tags,
12
+ * a finding's path) to {@link EVAL_SUMMARY_MAX_TEXT} characters and an
13
+ * ellipsis. A finding's path is cut in its message too, where the message
14
+ * starts with it, and the message is then cut to
15
+ * {@link EVAL_SUMMARY_MAX_MESSAGE}: longer than the other texts, since it
16
+ * holds the cut path and then the problem, which quotes up to
17
+ * {@link EVAL_SUMMARY_MAX_TEXT} characters of a value itself. The
18
+ * suite's tags are the listed cases' kept tags, cut, once each, sorted,
19
+ * and the first {@link EVAL_SUMMARY_MAX_SUITE_TAGS} of those. `caseCount`
20
+ * still counts every case, and the suite's directory is copied whole: the
21
+ * runner leaves it out of every mount, and the reader bounds it. The eval
22
+ * itself reads the archive again, so nothing a run needs is cut.
23
+ *
24
+ * Pinned by `__tests__/eval-summary.test.ts`.
25
+ */
26
+ import { cutText, excerpt, QUOTED_TEXT_LIMIT } from "./fields.js";
27
+ /** The most cases a stored summary lists. */
28
+ export const EVAL_SUMMARY_MAX_CASES = 200;
29
+ /** The most findings a stored summary keeps. */
30
+ export const EVAL_SUMMARY_MAX_FINDINGS = 50;
31
+ /** The most characters of any text a stored summary copies, then an ellipsis. */
32
+ export const EVAL_SUMMARY_MAX_TEXT = QUOTED_TEXT_LIMIT;
33
+ /** The most characters of a finding's path a stored summary keeps, then an ellipsis. */
34
+ export const EVAL_SUMMARY_MAX_PATH = EVAL_SUMMARY_MAX_TEXT;
35
+ /** The most characters of a finding's message a stored summary keeps, then an ellipsis. */
36
+ export const EVAL_SUMMARY_MAX_MESSAGE = 1000;
37
+ /** The most tags a stored summary lists for one case. */
38
+ export const EVAL_SUMMARY_MAX_CASE_TAGS = 32;
39
+ /** The most tags a stored summary lists for the suite. */
40
+ export const EVAL_SUMMARY_MAX_SUITE_TAGS = 200;
41
+ /** The suite, bounded for storage on the plugin. */
42
+ export function summariseEvalSuite(suite) {
43
+ const listed = suite.cases.slice(0, EVAL_SUMMARY_MAX_CASES);
44
+ return {
45
+ dir: suite.dir,
46
+ caseCount: suite.cases.length,
47
+ caseTags: [...new Set(listed.flatMap(keptTags))].sort().slice(0, EVAL_SUMMARY_MAX_SUITE_TAGS),
48
+ cases: listed.map((c) => ({
49
+ name: excerpt(c.name),
50
+ dir: excerpt(c.dir),
51
+ tags: keptTags(c),
52
+ ...(c.unsupported !== undefined && { unsupported: c.unsupported }),
53
+ })),
54
+ findings: suite.findings.slice(0, EVAL_SUMMARY_MAX_FINDINGS).map(cutFinding),
55
+ };
56
+ }
57
+ /** A case's tags as the summary keeps them: the first few, each cut. */
58
+ function keptTags(evalCase) {
59
+ return evalCase.tags.slice(0, EVAL_SUMMARY_MAX_CASE_TAGS).map(excerpt);
60
+ }
61
+ /** A finding with its path cut, in the field and at the start of its message, then its message cut. */
62
+ function cutFinding(finding) {
63
+ const path = excerpt(finding.path);
64
+ const prefix = `${finding.path}: `;
65
+ const named = path !== finding.path && finding.message.startsWith(prefix) ? `${path}: ${finding.message.slice(prefix.length)}` : finding.message;
66
+ const message = cutText(named, EVAL_SUMMARY_MAX_MESSAGE);
67
+ return path === finding.path && message === finding.message ? finding : { ...finding, path, message };
68
+ }
69
+ //# sourceMappingURL=summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/evals/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGlE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,gDAAgD;AAChD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,wFAAwF;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAE3D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,yDAAyD;AACzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,0DAA0D;AAC1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAsB/C,oDAAoD;AACpD,MAAM,UAAU,kBAAkB,CAAC,KAAgB;IACjD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAC5D,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;QAC7B,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,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,KAAK,OAAO,CAAC,IAAI,IAAI,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACxG,CAAC"}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * The eval suite model: what `readEvalSuite` returns for a plugin's
3
+ * `evals/` folder, in Claude Code's plugin-eval format (case format
4
+ * `schema_version: "1.1"`).
5
+ *
6
+ * One normalised shape whichever file a field came from: a case may be a
7
+ * `prompt.md`, a `case.yaml`, or both, and its graders may be
8
+ * `graders/*.md` files or `case.yaml` entries. The reader applies the
9
+ * format's precedence (prompt.md frontmatter over case.yaml, graders from
10
+ * case.yaml first, then graders/*.md in path order) so a consumer never
11
+ * re-derives it. Defaults the format documents are applied here too (runs
12
+ * 3, max_turns 10, timeout 300 s, weight 1, focus last_message, tool_used
13
+ * min 1), so the server's graders and the CLI's offline listing read the
14
+ * same values.
15
+ *
16
+ * Features Stigmer does not run yet are still read, so a case that uses
17
+ * one is listed with the feature named (`unsupported`) rather than run
18
+ * without it: a degraded run is a wrong score.
19
+ */
20
+ import type { JsonObject } from "../documents.js";
21
+ /** What a `regex` grader's `target` or an `llm` grader's `focus` names. */
22
+ export type EvalFocus = {
23
+ readonly kind: "last_message";
24
+ } | {
25
+ readonly kind: "trace";
26
+ } | {
27
+ readonly kind: "files";
28
+ } | {
29
+ readonly kind: "file";
30
+ readonly path: string;
31
+ } | {
32
+ readonly kind: "mock_calls";
33
+ };
34
+ /** A grader's `arm` setting; `undefined` when the grader leaves it unset. */
35
+ export type EvalGraderArm = "with-only" | "both";
36
+ /** A tool reference in `tool_order`: a name, or a name and an input regex. */
37
+ export interface EvalToolRef {
38
+ readonly tool: string;
39
+ /** JavaScript regex over the call's JSON-encoded input; absent matches any. */
40
+ readonly inputMatch?: string;
41
+ }
42
+ /** The type-specific options of a grader. */
43
+ export type EvalGraderCheck = {
44
+ readonly type: "regex";
45
+ readonly pattern: string;
46
+ /** JavaScript regex flags, e.g. "i". Empty when unset. */
47
+ readonly flags: string;
48
+ /** `contains` (the default), `not_contains`, or exactly N matches. */
49
+ readonly match: {
50
+ readonly kind: "contains";
51
+ } | {
52
+ readonly kind: "not_contains";
53
+ } | {
54
+ readonly kind: "count";
55
+ readonly count: number;
56
+ };
57
+ readonly target: EvalFocus;
58
+ } | {
59
+ readonly type: "tool_used";
60
+ readonly tool: string;
61
+ readonly inputMatch?: string;
62
+ /** Default 1. */
63
+ readonly min: number;
64
+ /** Absent means unlimited. */
65
+ readonly max?: number;
66
+ } | {
67
+ readonly type: "tool_order";
68
+ readonly before: EvalToolRef;
69
+ readonly after: EvalToolRef;
70
+ } | {
71
+ readonly type: "file_exists";
72
+ /** A glob over the paths created during the run. */
73
+ readonly path: string;
74
+ /** Default true. */
75
+ readonly exists: boolean;
76
+ } | {
77
+ readonly type: "llm";
78
+ readonly criteria: string;
79
+ readonly focus: EvalFocus;
80
+ } | {
81
+ readonly type: "baseline";
82
+ /** A `.jsonl` transcript, relative to the case directory. */
83
+ readonly baselineFile: string;
84
+ readonly criteria: string;
85
+ };
86
+ export type EvalGraderType = EvalGraderCheck["type"];
87
+ /** One grader of a case. */
88
+ export interface EvalGrader {
89
+ /** The `graders/<name>.md` filename without `.md`, or the entry's `name`. */
90
+ readonly name: string;
91
+ /** Plugin-relative path of the file that declared it. */
92
+ readonly path: string;
93
+ /** Any positive number; default 1. */
94
+ readonly weight: number;
95
+ readonly arm?: EvalGraderArm;
96
+ readonly check: EvalGraderCheck;
97
+ }
98
+ /**
99
+ * The `context` block of a `case.yaml`. Each path is relative to the case
100
+ * directory, normalised (no `./`, no `..`), and checked against the case's
101
+ * files: the script a file, each directory a directory, the history a
102
+ * `.jsonl` file whose conversation can be resumed.
103
+ */
104
+ export interface EvalCaseContext {
105
+ readonly scaffoldScript?: string;
106
+ readonly historyFile?: string;
107
+ readonly addDirs: readonly string[];
108
+ }
109
+ /** One mocked tool of a server, as the case's tries answer it. */
110
+ export interface EvalMockTool {
111
+ readonly tool: string;
112
+ /** Plugin-relative path of the file whose body answers: the tool's own `<tool>.md`, or the server's `_server.md`. */
113
+ readonly file: string;
114
+ /** `fixed` returns the body; `agent` has the judge model answer from it. */
115
+ readonly kind: "fixed" | "agent";
116
+ /** `fixed` only: the body is returned as a tool error. */
117
+ readonly error: boolean;
118
+ /** The `expect:` block as written, already compiled once by the reader. */
119
+ readonly expect?: JsonObject;
120
+ /** `agent` only: the only conditions under which the agent may end the run. */
121
+ readonly abortWhen?: string;
122
+ }
123
+ /** One plugin MCP server a case mocks: its tool mocks, suite and case merged file by file. */
124
+ export interface EvalMockServer {
125
+ /** The server's key in the plugin's MCP configuration. */
126
+ readonly server: string;
127
+ /** The mocked tools, sorted by name; empty when the server's directory holds no tool mock. */
128
+ readonly tools: readonly EvalMockTool[];
129
+ /** Plugin-relative path of the server's `_tools.json`, when there is one. */
130
+ readonly toolsFile?: string;
131
+ }
132
+ /** One case of the suite, normalised. */
133
+ export interface EvalCase {
134
+ /** `name`, else the directory's name. */
135
+ readonly name: string;
136
+ /** The case directory, relative to the plugin's root, e.g. "evals/first-case". */
137
+ readonly dir: string;
138
+ readonly description?: string;
139
+ readonly tags: readonly string[];
140
+ /** The prompt sent to the agent, exactly as written. */
141
+ readonly prompt: string;
142
+ /** Tries per arm, 1 to 50; default 3. */
143
+ readonly runs: number;
144
+ /** As written; Stigmer's catalog decides whether it names a model. */
145
+ readonly model?: string;
146
+ /** Turn cap, 1 to 200; default 10. */
147
+ readonly maxTurns: number;
148
+ /** Wall-clock cap per try, 1 to 3600; default 300. */
149
+ readonly timeoutSeconds: number;
150
+ /** The case's `allowed_tools`, as written. */
151
+ readonly allowedTools: readonly string[];
152
+ readonly appendSystemPrompt?: string;
153
+ /** The case's `env`; keys match `EVAL_[A-Z0-9_]*`. */
154
+ readonly env: Readonly<Record<string, string>>;
155
+ /**
156
+ * `plugins` as written, relative to the case directory. An entry that
157
+ * resolves to the plugin's root names the plugin under test (the format's
158
+ * override of auto-detect); any other entry makes the case
159
+ * `unsupported: "plugins"`, since Stigmer evaluates the installed plugin
160
+ * alone.
161
+ */
162
+ readonly plugins: readonly string[];
163
+ readonly context: EvalCaseContext;
164
+ /** The plugin-relative paths of every file under the case directory. */
165
+ readonly files: readonly string[];
166
+ readonly graders: readonly EvalGrader[];
167
+ /** The plugin's MCP servers this case has mock directories for, sorted by key. */
168
+ readonly mocks: readonly EvalMockServer[];
169
+ /** Whether the case's or the suite's mocks hold adopted replays (`mocks/.replay/`), which Stigmer does not read. */
170
+ readonly replays: boolean;
171
+ /**
172
+ * The first feature this case uses that Stigmer does not run yet, as a
173
+ * stable phrase the report prints after "not run: ", e.g. "plugins";
174
+ * absent when Stigmer runs the case.
175
+ */
176
+ readonly unsupported?: string;
177
+ }
178
+ /** A problem reading the suite: a case that cannot load, an unknown key. */
179
+ export interface EvalSuiteFinding {
180
+ readonly kind: "eval-dir-invalid" | "eval-case-invalid" | "eval-grader-invalid" | "eval-field-unknown" | "eval-mock-invalid" | "eval-schema-version-unsupported";
181
+ /** One user-facing sentence naming the file and field, as the format reports it. */
182
+ readonly message: string;
183
+ /** The plugin-relative path the finding points at. */
184
+ readonly path: string;
185
+ }
186
+ /** The suite: the cases that loaded and the findings for those that did not. */
187
+ export interface EvalSuite {
188
+ /**
189
+ * A plugin's suite: "evals", or the manifest's `experimental.evals` when
190
+ * it is usable. A pushed folder: the empty string, the archive's root.
191
+ */
192
+ readonly dir: string;
193
+ /** Cases in directory order (sorted by path). */
194
+ readonly cases: readonly EvalCase[];
195
+ readonly findings: readonly EvalSuiteFinding[];
196
+ /**
197
+ * The servers a mock may stand in for, sorted. A plugin's suite: the MCP
198
+ * server keys the plugin declares. A pushed folder: the mock directories
199
+ * its cases read, each resolved against an agent's servers when it runs.
200
+ */
201
+ readonly servers: readonly string[];
202
+ }
203
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d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GAAG,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC"}
package/evals/types.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The eval suite model: what `readEvalSuite` returns for a plugin's
3
+ * `evals/` folder, in Claude Code's plugin-eval format (case format
4
+ * `schema_version: "1.1"`).
5
+ *
6
+ * One normalised shape whichever file a field came from: a case may be a
7
+ * `prompt.md`, a `case.yaml`, or both, and its graders may be
8
+ * `graders/*.md` files or `case.yaml` entries. The reader applies the
9
+ * format's precedence (prompt.md frontmatter over case.yaml, graders from
10
+ * case.yaml first, then graders/*.md in path order) so a consumer never
11
+ * re-derives it. Defaults the format documents are applied here too (runs
12
+ * 3, max_turns 10, timeout 300 s, weight 1, focus last_message, tool_used
13
+ * min 1), so the server's graders and the CLI's offline listing read the
14
+ * same values.
15
+ *
16
+ * Features Stigmer does not run yet are still read, so a case that uses
17
+ * one is listed with the feature named (`unsupported`) rather than run
18
+ * without it: a degraded run is a wrong score.
19
+ */
20
+ export {};
21
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/evals/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
package/files.d.ts ADDED
@@ -0,0 +1,135 @@
1
+ /**
2
+ * The reader the library is pure over, and the path discipline every path in
3
+ * a package obeys.
4
+ *
5
+ * `PluginFiles` is a sorted list of SIZED entries plus `read`. The size is
6
+ * declared up front so the library can refuse an over-cap document before a
7
+ * byte is read: an archive reader may hold a deflated entry whose declared
8
+ * size is the only defence against inflating a bomb, and a cap checked after
9
+ * `read` would be no defence at all. The reader's contract is that `read`
10
+ * never returns more than `size` bytes (a directory reader uses the file's
11
+ * stat size; an archive reader passes the central directory's declared size
12
+ * as its inflate limit). The library checks both sides anyway: the declared
13
+ * size before reading, the returned length after, refusing either as
14
+ * `document-too-large`. Nothing here touches the filesystem or any `node:*`
15
+ * module; the CLI's directory walker and the server's archive reader each
16
+ * implement this interface at their edge.
17
+ *
18
+ * Containment is lexical here and physical in each reader. A listed path
19
+ * that is absolute, contains `..` or a backslash, or has an empty segment is
20
+ * refused by the library; a reader never follows a symlink, and an archive
21
+ * has none. A path DECLARED in a manifest must begin with `./` (or be `.`),
22
+ * the open format's rule for every plugin-relative path.
23
+ */
24
+ import type { PluginErrorKind } from "./outcome.js";
25
+ export interface PluginFileEntry {
26
+ /** Plugin-relative POSIX path, no leading `./`, files only. */
27
+ readonly path: string;
28
+ /** The entry's declared size in bytes; `read` returns at most this many. */
29
+ readonly size: number;
30
+ }
31
+ export interface PluginFiles {
32
+ /** Sorted by path (code-point order), files only, every path contained. */
33
+ readonly entries: readonly PluginFileEntry[];
34
+ /** The bytes of one listed path. */
35
+ read(path: string): Uint8Array;
36
+ }
37
+ /**
38
+ * Per-document byte caps, checked from declared sizes. A plugin's documents
39
+ * are small by nature; the caps exist so no reader can be made to inflate
40
+ * a large entry through the library, not to bound legitimate content.
41
+ */
42
+ export declare const PLUGIN_DOCUMENT_LIMITS: {
43
+ /** A manifest (`plugin.json` in any dialect). Real manifests are a few KB. */
44
+ readonly manifest: number;
45
+ /** An MCP configuration file. */
46
+ readonly mcpConfig: number;
47
+ /** A hooks file (`hooks/hooks.json` or a declared one): JSON, the manifest's cap. */
48
+ readonly hooks: number;
49
+ /** A Claude plugin's `settings.json`: JSON, the manifest's cap. */
50
+ readonly settings: number;
51
+ /**
52
+ * A `SKILL.md`. The server's skill push gate inflates a `SKILL.md` alone
53
+ * under the same 1 MB cap, so a skill this library accepts is one the push
54
+ * gate accepts.
55
+ */
56
+ readonly skillMd: number;
57
+ /** A sub-agent file (`agents/*.md`): a prompt, so the `SKILL.md` cap. */
58
+ readonly subAgent: number;
59
+ /**
60
+ * A plugin's logo, the image a storefront card shows. Checked from the
61
+ * listing's declared size before a client hands the file's URL to an
62
+ * `<img>`; measured across the three vendors' catalogues on 2026-09-18,
63
+ * the largest published logo is 361 KB and the median 7.5 KB.
64
+ */
65
+ readonly logo: number;
66
+ /**
67
+ * A marketplace file in any dialect. The largest public catalogue
68
+ * (`cursor/plugins`, 79 entries with descriptions) is under 32 KB; the cap
69
+ * leaves room for catalogues an order of magnitude larger.
70
+ */
71
+ readonly marketplace: number;
72
+ /**
73
+ * A file of a plugin's eval suite the reader opens: a `prompt.md`, a
74
+ * `case.yaml`, a `graders/*.md`. Prompts and rubrics, so the `SKILL.md`
75
+ * cap.
76
+ */
77
+ readonly evalDocument: number;
78
+ };
79
+ export type PluginDocumentClass = keyof typeof PLUGIN_DOCUMENT_LIMITS;
80
+ /** An in-memory `PluginFiles` over path -> content; the testing builders' product. */
81
+ export declare function inMemoryPluginFiles(files: ReadonlyMap<string, Uint8Array | string>): PluginFiles;
82
+ /** Code-point order, the order `entries` is sorted in. */
83
+ export declare function comparePaths(a: string, b: string): number;
84
+ /** UTF-8 text with a leading byte-order mark removed (a manifest saved with a BOM was a known load failure elsewhere). */
85
+ export declare function decodeUtf8(bytes: Uint8Array): string;
86
+ /**
87
+ * Lexical containment of a LISTED path: relative, forward slashes only, no
88
+ * `.` or `..` segments, no empty segments. Readers produce such paths; the
89
+ * library refuses a reader that did not.
90
+ */
91
+ export declare function isContainedPath(path: string): boolean;
92
+ export type DeclaredPathOutcome = {
93
+ readonly ok: true;
94
+ readonly path: string;
95
+ } | {
96
+ readonly ok: false;
97
+ readonly kind: Extract<PluginErrorKind, "path-not-relative" | "path-escapes-root" | "path-glob-unsupported">;
98
+ };
99
+ /**
100
+ * Normalise a path DECLARED in a manifest (`"./skills/"`, `"."`,
101
+ * `"./agents/reviewer.md"`) to a plugin-relative path with no leading `./`
102
+ * and no trailing slash; the plugin root itself is the empty string. The
103
+ * open format requires the `./` prefix; the vendor dialects document the
104
+ * same rule; a glob is refused because no plugin in the wild uses one and
105
+ * expanding globs is a second path language the library would then have
106
+ * to own.
107
+ */
108
+ export declare function resolveDeclaredPath(value: string): DeclaredPathOutcome;
109
+ /** `dir + "/" + name`, or `name` at the plugin root. */
110
+ export declare function joinPath(dir: string, name: string): string;
111
+ /** The last segment of a plugin-relative path. */
112
+ export declare function basename(path: string): string;
113
+ /** The path without its last segment; the empty string at the root. */
114
+ export declare function dirname(path: string): string;
115
+ /**
116
+ * Indexed access over a `PluginFiles`: membership, the files under a
117
+ * directory, a directory's immediate children. Built once per read; every
118
+ * lookup is a map or a prefix walk over the sorted entries.
119
+ */
120
+ export declare class PluginFileIndex {
121
+ readonly files: PluginFiles;
122
+ private readonly byPath;
123
+ constructor(files: PluginFiles);
124
+ has(path: string): boolean;
125
+ entry(path: string): PluginFileEntry | undefined;
126
+ /** Every file under `dir` (recursively), in entry order; every file at the root when `dir` is empty. */
127
+ filesUnder(dir: string): readonly string[];
128
+ /** True when at least one file lives under `dir`. */
129
+ isDirectory(dir: string): boolean;
130
+ /** The immediate child directory names under `dir`, sorted, deduplicated. */
131
+ childDirectories(dir: string): readonly string[];
132
+ /** The immediate child FILE names under `dir`, sorted. */
133
+ childFiles(dir: string): readonly string[];
134
+ }
135
+ //# sourceMappingURL=files.d.ts.map
package/files.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["src/files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,QAAQ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