wicked-crew 0.17.0 → 0.18.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 (547) hide show
  1. package/README.md +71 -18
  2. package/adapters/web-source.lock +1314 -0
  3. package/dist/api/audit.d.ts +5 -0
  4. package/dist/api/audit.d.ts.map +1 -1
  5. package/dist/api/audit.js +20 -0
  6. package/dist/api/audit.js.map +1 -1
  7. package/dist/api/auth.d.ts.map +1 -1
  8. package/dist/api/auth.js +3 -0
  9. package/dist/api/auth.js.map +1 -1
  10. package/dist/api/chat-context.js +1 -1
  11. package/dist/api/chat-history.d.ts +3 -0
  12. package/dist/api/chat-history.d.ts.map +1 -1
  13. package/dist/api/chat-history.js +6 -1
  14. package/dist/api/chat-history.js.map +1 -1
  15. package/dist/api/chat-jobs.d.ts +192 -0
  16. package/dist/api/chat-jobs.d.ts.map +1 -0
  17. package/dist/api/chat-jobs.js +929 -0
  18. package/dist/api/chat-jobs.js.map +1 -0
  19. package/dist/api/chat-proposals.d.ts +323 -7
  20. package/dist/api/chat-proposals.d.ts.map +1 -1
  21. package/dist/api/chat-proposals.js +1581 -40
  22. package/dist/api/chat-proposals.js.map +1 -1
  23. package/dist/api/chat-requirements.d.ts +54 -0
  24. package/dist/api/chat-requirements.d.ts.map +1 -0
  25. package/dist/api/chat-requirements.js +282 -0
  26. package/dist/api/chat-requirements.js.map +1 -0
  27. package/dist/api/chat-scope.d.ts +56 -0
  28. package/dist/api/chat-scope.d.ts.map +1 -1
  29. package/dist/api/chat-scope.js +175 -5
  30. package/dist/api/chat-scope.js.map +1 -1
  31. package/dist/api/chat-transcripts.d.ts +7 -0
  32. package/dist/api/chat-transcripts.d.ts.map +1 -1
  33. package/dist/api/chat-transcripts.js +17 -1
  34. package/dist/api/chat-transcripts.js.map +1 -1
  35. package/dist/api/delivery-assurance.d.ts.map +1 -1
  36. package/dist/api/delivery-assurance.js +5 -2
  37. package/dist/api/delivery-assurance.js.map +1 -1
  38. package/dist/api/delivery-index.d.ts +109 -5
  39. package/dist/api/delivery-index.d.ts.map +1 -1
  40. package/dist/api/delivery-index.js +199 -7
  41. package/dist/api/delivery-index.js.map +1 -1
  42. package/dist/api/mcp.d.ts +7 -2
  43. package/dist/api/mcp.d.ts.map +1 -1
  44. package/dist/api/mcp.js +1 -1
  45. package/dist/api/mcp.js.map +1 -1
  46. package/dist/api/needs.d.ts.map +1 -1
  47. package/dist/api/needs.js +19 -1
  48. package/dist/api/needs.js.map +1 -1
  49. package/dist/api/product.d.ts +87 -3
  50. package/dist/api/product.d.ts.map +1 -1
  51. package/dist/api/product.js +155 -68
  52. package/dist/api/product.js.map +1 -1
  53. package/dist/api/proposal-theme.d.ts +23 -0
  54. package/dist/api/proposal-theme.d.ts.map +1 -0
  55. package/dist/api/proposal-theme.js +30 -0
  56. package/dist/api/proposal-theme.js.map +1 -0
  57. package/dist/api/recording.d.ts +127 -10
  58. package/dist/api/recording.d.ts.map +1 -1
  59. package/dist/api/recording.js +320 -68
  60. package/dist/api/recording.js.map +1 -1
  61. package/dist/api/repo-input.d.ts +55 -0
  62. package/dist/api/repo-input.d.ts.map +1 -0
  63. package/dist/api/repo-input.js +113 -0
  64. package/dist/api/repo-input.js.map +1 -0
  65. package/dist/api/requirements.d.ts +75 -0
  66. package/dist/api/requirements.d.ts.map +1 -1
  67. package/dist/api/requirements.js +97 -9
  68. package/dist/api/requirements.js.map +1 -1
  69. package/dist/api/review-change.d.ts +64 -0
  70. package/dist/api/review-change.d.ts.map +1 -0
  71. package/dist/api/review-change.js +214 -0
  72. package/dist/api/review-change.js.map +1 -0
  73. package/dist/api/roster-standing.d.ts +4 -0
  74. package/dist/api/roster-standing.d.ts.map +1 -1
  75. package/dist/api/roster-standing.js +43 -10
  76. package/dist/api/roster-standing.js.map +1 -1
  77. package/dist/api/routes.d.ts +138 -12
  78. package/dist/api/routes.d.ts.map +1 -1
  79. package/dist/api/routes.js +1496 -301
  80. package/dist/api/routes.js.map +1 -1
  81. package/dist/api/run-documents.d.ts +97 -0
  82. package/dist/api/run-documents.d.ts.map +1 -0
  83. package/dist/api/run-documents.js +458 -0
  84. package/dist/api/run-documents.js.map +1 -0
  85. package/dist/api/run-sources.d.ts +51 -0
  86. package/dist/api/run-sources.d.ts.map +1 -0
  87. package/dist/api/run-sources.js +133 -0
  88. package/dist/api/run-sources.js.map +1 -0
  89. package/dist/api/run-timing-index.d.ts +12 -1
  90. package/dist/api/run-timing-index.d.ts.map +1 -1
  91. package/dist/api/run-timing-index.js +35 -0
  92. package/dist/api/run-timing-index.js.map +1 -1
  93. package/dist/api/runtime-state.d.ts +41 -0
  94. package/dist/api/runtime-state.d.ts.map +1 -0
  95. package/dist/api/runtime-state.js +75 -0
  96. package/dist/api/runtime-state.js.map +1 -0
  97. package/dist/api/seat-container-login.d.ts +51 -0
  98. package/dist/api/seat-container-login.d.ts.map +1 -1
  99. package/dist/api/seat-container-login.js +317 -1
  100. package/dist/api/seat-container-login.js.map +1 -1
  101. package/dist/api/seat-images.d.ts.map +1 -1
  102. package/dist/api/seat-images.js +7 -0
  103. package/dist/api/seat-images.js.map +1 -1
  104. package/dist/api/server.d.ts +7 -0
  105. package/dist/api/server.d.ts.map +1 -1
  106. package/dist/api/server.js +207 -26
  107. package/dist/api/server.js.map +1 -1
  108. package/dist/api/skills.d.ts +8 -0
  109. package/dist/api/skills.d.ts.map +1 -1
  110. package/dist/api/skills.js +21 -0
  111. package/dist/api/skills.js.map +1 -1
  112. package/dist/api/system-snapshot.d.ts +3 -2
  113. package/dist/api/system-snapshot.d.ts.map +1 -1
  114. package/dist/api/system-snapshot.js +19 -6
  115. package/dist/api/system-snapshot.js.map +1 -1
  116. package/dist/api/testing.d.ts +3 -3
  117. package/dist/api/ui-text.d.ts +45 -0
  118. package/dist/api/ui-text.d.ts.map +1 -0
  119. package/dist/api/ui-text.js +188 -0
  120. package/dist/api/ui-text.js.map +1 -0
  121. package/dist/apps/actions/card.d.ts +62 -0
  122. package/dist/apps/actions/card.d.ts.map +1 -0
  123. package/dist/apps/actions/card.js +111 -0
  124. package/dist/apps/actions/card.js.map +1 -0
  125. package/dist/apps/actions/write-path.d.ts.map +1 -1
  126. package/dist/apps/actions/write-path.js +26 -77
  127. package/dist/apps/actions/write-path.js.map +1 -1
  128. package/dist/apps/exec/sources.d.ts.map +1 -1
  129. package/dist/apps/exec/sources.js +3 -0
  130. package/dist/apps/exec/sources.js.map +1 -1
  131. package/dist/apps/exec/texts.d.ts +1 -1
  132. package/dist/apps/publish/artifacts.d.ts +18 -0
  133. package/dist/apps/publish/artifacts.d.ts.map +1 -0
  134. package/dist/apps/publish/artifacts.js +87 -0
  135. package/dist/apps/publish/artifacts.js.map +1 -0
  136. package/dist/apps/publish/check.d.ts +103 -0
  137. package/dist/apps/publish/check.d.ts.map +1 -0
  138. package/dist/apps/publish/check.js +235 -0
  139. package/dist/apps/publish/check.js.map +1 -0
  140. package/dist/apps/publish/image.d.ts +2 -0
  141. package/dist/apps/publish/image.d.ts.map +1 -1
  142. package/dist/apps/publish/image.js +2 -1
  143. package/dist/apps/publish/image.js.map +1 -1
  144. package/dist/apps/publish/render.d.ts +71 -0
  145. package/dist/apps/publish/render.d.ts.map +1 -0
  146. package/dist/apps/publish/render.js +122 -0
  147. package/dist/apps/publish/render.js.map +1 -0
  148. package/dist/apps/publish/run.d.ts +35 -0
  149. package/dist/apps/publish/run.d.ts.map +1 -0
  150. package/dist/apps/publish/run.js +127 -0
  151. package/dist/apps/publish/run.js.map +1 -0
  152. package/dist/apps/routes.d.ts +54 -2
  153. package/dist/apps/routes.d.ts.map +1 -1
  154. package/dist/apps/routes.js +124 -7
  155. package/dist/apps/routes.js.map +1 -1
  156. package/dist/apps/spec.d.ts +8 -8
  157. package/dist/apps/store.d.ts +84 -5
  158. package/dist/apps/store.d.ts.map +1 -1
  159. package/dist/apps/store.js +191 -4
  160. package/dist/apps/store.js.map +1 -1
  161. package/dist/apps/turns.d.ts +19 -1
  162. package/dist/apps/turns.d.ts.map +1 -1
  163. package/dist/apps/turns.js +60 -2
  164. package/dist/apps/turns.js.map +1 -1
  165. package/dist/apps/views.d.ts +5 -1
  166. package/dist/apps/views.d.ts.map +1 -1
  167. package/dist/apps/views.js +18 -7
  168. package/dist/apps/views.js.map +1 -1
  169. package/dist/apps-server/Dockerfile +25 -0
  170. package/dist/apps-server/runners/sqlite-runner.mjs +110 -0
  171. package/dist/apps-server/server/lib/bundle/server.mjs +92523 -0
  172. package/dist/apps-server/server/node_modules/@pgsql/types/LICENSE +22 -0
  173. package/dist/apps-server/server/node_modules/@pgsql/types/README.md +106 -0
  174. package/dist/apps-server/server/node_modules/@pgsql/types/enums.d.ts +76 -0
  175. package/dist/apps-server/server/node_modules/@pgsql/types/enums.js +2 -0
  176. package/dist/apps-server/server/node_modules/@pgsql/types/esm/enums.js +1 -0
  177. package/dist/apps-server/server/node_modules/@pgsql/types/esm/index.js +2 -0
  178. package/dist/apps-server/server/node_modules/@pgsql/types/esm/types.js +1 -0
  179. package/dist/apps-server/server/node_modules/@pgsql/types/index.d.ts +2 -0
  180. package/dist/apps-server/server/node_modules/@pgsql/types/index.js +18 -0
  181. package/dist/apps-server/server/node_modules/@pgsql/types/package.json +36 -0
  182. package/dist/apps-server/server/node_modules/@pgsql/types/types.d.ts +2488 -0
  183. package/dist/apps-server/server/node_modules/@pgsql/types/types.js +2 -0
  184. package/dist/apps-server/server/node_modules/libpg-query/LICENSE +22 -0
  185. package/dist/apps-server/server/node_modules/libpg-query/README.md +275 -0
  186. package/dist/apps-server/server/node_modules/libpg-query/package.json +58 -0
  187. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.cjs +369 -0
  188. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.d.ts +48 -0
  189. package/dist/apps-server/server/node_modules/libpg-query/wasm/index.js +344 -0
  190. package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.js +2 -0
  191. package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.wasm +0 -0
  192. package/dist/apps-server/server/shim/host.css +22 -0
  193. package/dist/apps-server/server/shim/host.js +1 -0
  194. package/dist/cli/apps-check.d.ts +18 -0
  195. package/dist/cli/apps-check.d.ts.map +1 -1
  196. package/dist/cli/apps-check.js +179 -5
  197. package/dist/cli/apps-check.js.map +1 -1
  198. package/dist/cli/apps-produce.d.ts +9 -0
  199. package/dist/cli/apps-produce.d.ts.map +1 -0
  200. package/dist/cli/apps-produce.js +27 -0
  201. package/dist/cli/apps-produce.js.map +1 -0
  202. package/dist/cli/index.d.ts.map +1 -1
  203. package/dist/cli/index.js +15 -3
  204. package/dist/cli/index.js.map +1 -1
  205. package/dist/cli/insights-facts.d.ts +17 -0
  206. package/dist/cli/insights-facts.d.ts.map +1 -0
  207. package/dist/cli/insights-facts.js +56 -0
  208. package/dist/cli/insights-facts.js.map +1 -0
  209. package/dist/core/adapter.d.ts +85 -16
  210. package/dist/core/adapter.d.ts.map +1 -1
  211. package/dist/core/adapter.js +274 -54
  212. package/dist/core/adapter.js.map +1 -1
  213. package/dist/core/builtin-catalog.d.ts.map +1 -1
  214. package/dist/core/builtin-catalog.js +2 -0
  215. package/dist/core/builtin-catalog.js.map +1 -1
  216. package/dist/core/deliver-text.d.ts +42 -6
  217. package/dist/core/deliver-text.d.ts.map +1 -1
  218. package/dist/core/deliver-text.js +204 -27
  219. package/dist/core/deliver-text.js.map +1 -1
  220. package/dist/core/deliver.d.ts.map +1 -1
  221. package/dist/core/deliver.js +28 -7
  222. package/dist/core/deliver.js.map +1 -1
  223. package/dist/core/engine-roster.d.ts.map +1 -1
  224. package/dist/core/engine-roster.js +1 -0
  225. package/dist/core/engine-roster.js.map +1 -1
  226. package/dist/core/estate-mcp-client.d.ts +3 -2
  227. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  228. package/dist/core/estate-mcp-client.js +3 -2
  229. package/dist/core/estate-mcp-client.js.map +1 -1
  230. package/dist/core/qe-acceptance-setting.d.ts.map +1 -1
  231. package/dist/core/qe-acceptance-setting.js +6 -0
  232. package/dist/core/qe-acceptance-setting.js.map +1 -1
  233. package/dist/core/run-identity.d.ts.map +1 -1
  234. package/dist/core/run-identity.js +3 -0
  235. package/dist/core/run-identity.js.map +1 -1
  236. package/dist/core/types.d.ts +5 -0
  237. package/dist/core/types.d.ts.map +1 -1
  238. package/dist/core/types.js.map +1 -1
  239. package/dist/editors/conformance-runtime.d.ts +107 -0
  240. package/dist/editors/conformance-runtime.d.ts.map +1 -1
  241. package/dist/editors/conformance-runtime.js +268 -13
  242. package/dist/editors/conformance-runtime.js.map +1 -1
  243. package/dist/editors/csp.d.ts +2 -2
  244. package/dist/editors/csp.d.ts.map +1 -1
  245. package/dist/editors/csp.js +4 -2
  246. package/dist/editors/csp.js.map +1 -1
  247. package/dist/editors/pack-install.d.ts +28 -13
  248. package/dist/editors/pack-install.d.ts.map +1 -1
  249. package/dist/editors/pack-install.js +96 -48
  250. package/dist/editors/pack-install.js.map +1 -1
  251. package/dist/editors/registry.d.ts +111 -8
  252. package/dist/editors/registry.d.ts.map +1 -1
  253. package/dist/editors/registry.js +183 -7
  254. package/dist/editors/registry.js.map +1 -1
  255. package/dist/editors/routes.d.ts +66 -13
  256. package/dist/editors/routes.d.ts.map +1 -1
  257. package/dist/editors/routes.js +277 -44
  258. package/dist/editors/routes.js.map +1 -1
  259. package/dist/evals/replay.d.ts +6 -0
  260. package/dist/evals/replay.d.ts.map +1 -1
  261. package/dist/evals/replay.js +24 -1
  262. package/dist/evals/replay.js.map +1 -1
  263. package/dist/evals/routes.d.ts.map +1 -1
  264. package/dist/evals/routes.js +17 -2
  265. package/dist/evals/routes.js.map +1 -1
  266. package/dist/evals/runner.d.ts.map +1 -1
  267. package/dist/evals/runner.js +5 -0
  268. package/dist/evals/runner.js.map +1 -1
  269. package/dist/evals/shape-corrections.d.ts +146 -0
  270. package/dist/evals/shape-corrections.d.ts.map +1 -0
  271. package/dist/evals/shape-corrections.js +394 -0
  272. package/dist/evals/shape-corrections.js.map +1 -0
  273. package/dist/evals/shape.d.ts +145 -0
  274. package/dist/evals/shape.d.ts.map +1 -0
  275. package/dist/evals/shape.js +376 -0
  276. package/dist/evals/shape.js.map +1 -0
  277. package/dist/evals/types.d.ts +2 -2
  278. package/dist/evals/types.d.ts.map +1 -1
  279. package/dist/evals/types.js +2 -1
  280. package/dist/evals/types.js.map +1 -1
  281. package/dist/insights/analyze.d.ts +14 -1
  282. package/dist/insights/analyze.d.ts.map +1 -1
  283. package/dist/insights/analyze.js +35 -8
  284. package/dist/insights/analyze.js.map +1 -1
  285. package/dist/insights/cost.d.ts +123 -0
  286. package/dist/insights/cost.d.ts.map +1 -0
  287. package/dist/insights/cost.js +221 -0
  288. package/dist/insights/cost.js.map +1 -0
  289. package/dist/insights/review-service.d.ts +20 -1
  290. package/dist/insights/review-service.d.ts.map +1 -1
  291. package/dist/insights/review-service.js +50 -25
  292. package/dist/insights/review-service.js.map +1 -1
  293. package/dist/insights/routes.d.ts +29 -0
  294. package/dist/insights/routes.d.ts.map +1 -1
  295. package/dist/insights/routes.js +62 -0
  296. package/dist/insights/routes.js.map +1 -1
  297. package/dist/insights/run-facts.d.ts +16 -0
  298. package/dist/insights/run-facts.d.ts.map +1 -1
  299. package/dist/insights/run-facts.js +26 -3
  300. package/dist/insights/run-facts.js.map +1 -1
  301. package/dist/interactive/bridge-pool.d.ts +11 -2
  302. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  303. package/dist/interactive/bridge-pool.js +10 -1
  304. package/dist/interactive/bridge-pool.js.map +1 -1
  305. package/dist/interactive/chat-events.d.ts +74 -1
  306. package/dist/interactive/chat-events.d.ts.map +1 -1
  307. package/dist/interactive/chat-events.js +338 -6
  308. package/dist/interactive/chat-events.js.map +1 -1
  309. package/dist/interactive/doc-binding.d.ts +15 -0
  310. package/dist/interactive/doc-binding.d.ts.map +1 -1
  311. package/dist/interactive/doc-binding.js +4 -0
  312. package/dist/interactive/doc-binding.js.map +1 -1
  313. package/dist/interactive/doc-checks-routes.d.ts +34 -1
  314. package/dist/interactive/doc-checks-routes.d.ts.map +1 -1
  315. package/dist/interactive/doc-checks-routes.js +84 -0
  316. package/dist/interactive/doc-checks-routes.js.map +1 -1
  317. package/dist/interactive/draft-events.d.ts +7 -0
  318. package/dist/interactive/draft-events.d.ts.map +1 -1
  319. package/dist/interactive/draft-events.js +38 -6
  320. package/dist/interactive/draft-events.js.map +1 -1
  321. package/dist/interactive/draft-skill.d.ts +76 -6
  322. package/dist/interactive/draft-skill.d.ts.map +1 -1
  323. package/dist/interactive/draft-skill.js +219 -17
  324. package/dist/interactive/draft-skill.js.map +1 -1
  325. package/dist/interactive/edit-events.d.ts.map +1 -1
  326. package/dist/interactive/edit-events.js +4 -2
  327. package/dist/interactive/edit-events.js.map +1 -1
  328. package/dist/interactive/landing-guard.d.ts +47 -0
  329. package/dist/interactive/landing-guard.d.ts.map +1 -0
  330. package/dist/interactive/landing-guard.js +43 -0
  331. package/dist/interactive/landing-guard.js.map +1 -0
  332. package/dist/interactive/landing-record.d.ts +68 -0
  333. package/dist/interactive/landing-record.d.ts.map +1 -0
  334. package/dist/interactive/landing-record.js +154 -0
  335. package/dist/interactive/landing-record.js.map +1 -0
  336. package/dist/interactive/proposal-create.d.ts +3 -1
  337. package/dist/interactive/proposal-create.d.ts.map +1 -1
  338. package/dist/interactive/proposal-create.js +14 -2
  339. package/dist/interactive/proposal-create.js.map +1 -1
  340. package/dist/interactive/proposal-refine.d.ts +48 -0
  341. package/dist/interactive/proposal-refine.d.ts.map +1 -0
  342. package/dist/interactive/proposal-refine.js +99 -0
  343. package/dist/interactive/proposal-refine.js.map +1 -0
  344. package/dist/interactive/protected-edits.d.ts +67 -0
  345. package/dist/interactive/protected-edits.d.ts.map +1 -0
  346. package/dist/interactive/protected-edits.js +160 -0
  347. package/dist/interactive/protected-edits.js.map +1 -0
  348. package/dist/interactive/proxy-routes.js +2 -2
  349. package/dist/interactive/review-events.js +1 -1
  350. package/dist/interactive/run-units.d.ts +1 -1
  351. package/dist/interactive/run-units.d.ts.map +1 -1
  352. package/dist/interactive/run-units.js +8 -2
  353. package/dist/interactive/run-units.js.map +1 -1
  354. package/dist/interactive/source-packet.d.ts +66 -1
  355. package/dist/interactive/source-packet.d.ts.map +1 -1
  356. package/dist/interactive/source-packet.js +309 -60
  357. package/dist/interactive/source-packet.js.map +1 -1
  358. package/dist/interactive/theme-events.js +1 -1
  359. package/dist/knowledge/adapters/web/egress.d.ts +99 -0
  360. package/dist/knowledge/adapters/web/egress.d.ts.map +1 -0
  361. package/dist/knowledge/adapters/web/egress.js +330 -0
  362. package/dist/knowledge/adapters/web/egress.js.map +1 -0
  363. package/dist/knowledge/adapters/web/engine.d.ts +54 -0
  364. package/dist/knowledge/adapters/web/engine.d.ts.map +1 -0
  365. package/dist/knowledge/adapters/web/engine.js +101 -0
  366. package/dist/knowledge/adapters/web/engine.js.map +1 -0
  367. package/dist/knowledge/adapters/web/fetch.d.ts +131 -0
  368. package/dist/knowledge/adapters/web/fetch.d.ts.map +1 -0
  369. package/dist/knowledge/adapters/web/fetch.js +325 -0
  370. package/dist/knowledge/adapters/web/fetch.js.map +1 -0
  371. package/dist/knowledge/adapters/web/gate-web.d.ts +182 -0
  372. package/dist/knowledge/adapters/web/gate-web.d.ts.map +1 -0
  373. package/dist/knowledge/adapters/web/gate-web.js +496 -0
  374. package/dist/knowledge/adapters/web/gate-web.js.map +1 -0
  375. package/dist/knowledge/adapters/web/routes.d.ts +36 -0
  376. package/dist/knowledge/adapters/web/routes.d.ts.map +1 -0
  377. package/dist/knowledge/adapters/web/routes.js +99 -0
  378. package/dist/knowledge/adapters/web/routes.js.map +1 -0
  379. package/dist/knowledge/adapters/web/searxng.d.ts +89 -0
  380. package/dist/knowledge/adapters/web/searxng.d.ts.map +1 -0
  381. package/dist/knowledge/adapters/web/searxng.js +274 -0
  382. package/dist/knowledge/adapters/web/searxng.js.map +1 -0
  383. package/dist/knowledge/adapters/web/source.d.ts +65 -0
  384. package/dist/knowledge/adapters/web/source.d.ts.map +1 -0
  385. package/dist/knowledge/adapters/web/source.js +192 -0
  386. package/dist/knowledge/adapters/web/source.js.map +1 -0
  387. package/dist/knowledge/gate/gate.d.ts +22 -0
  388. package/dist/knowledge/gate/gate.d.ts.map +1 -1
  389. package/dist/knowledge/gate/gate.js +62 -1
  390. package/dist/knowledge/gate/gate.js.map +1 -1
  391. package/dist/knowledge/gate/sources.d.ts +2 -0
  392. package/dist/knowledge/gate/sources.d.ts.map +1 -1
  393. package/dist/knowledge/gate/sources.js +5 -2
  394. package/dist/knowledge/gate/sources.js.map +1 -1
  395. package/dist/knowledge/package.d.ts +7 -0
  396. package/dist/knowledge/package.d.ts.map +1 -1
  397. package/dist/knowledge/package.js +15 -1
  398. package/dist/knowledge/package.js.map +1 -1
  399. package/dist/knowledge/trackers/actions.js +1 -1
  400. package/dist/knowledge/trackers/actions.js.map +1 -1
  401. package/dist/knowledge/trackers/bindings.d.ts +3 -3
  402. package/dist/knowledge/trackers/bindings.d.ts.map +1 -1
  403. package/dist/knowledge/trackers/bindings.js +36 -23
  404. package/dist/knowledge/trackers/bindings.js.map +1 -1
  405. package/dist/knowledge/trackers/routes.js +1 -1
  406. package/dist/knowledge/trackers/routes.js.map +1 -1
  407. package/dist/learnings/service.d.ts.map +1 -1
  408. package/dist/learnings/service.js +2 -0
  409. package/dist/learnings/service.js.map +1 -1
  410. package/dist/mcp/broker.d.ts +8 -0
  411. package/dist/mcp/broker.d.ts.map +1 -1
  412. package/dist/mcp/broker.js +48 -3
  413. package/dist/mcp/broker.js.map +1 -1
  414. package/dist/mcp/estate-relay.d.ts +43 -1
  415. package/dist/mcp/estate-relay.d.ts.map +1 -1
  416. package/dist/mcp/estate-relay.js +38 -2
  417. package/dist/mcp/estate-relay.js.map +1 -1
  418. package/dist/mcp/registry.d.ts +6 -0
  419. package/dist/mcp/registry.d.ts.map +1 -1
  420. package/dist/mcp/registry.js +42 -3
  421. package/dist/mcp/registry.js.map +1 -1
  422. package/dist/mcp/run-fence.d.ts +57 -0
  423. package/dist/mcp/run-fence.d.ts.map +1 -0
  424. package/dist/mcp/run-fence.js +86 -0
  425. package/dist/mcp/run-fence.js.map +1 -0
  426. package/dist/mcp/tool-list.d.ts +5 -0
  427. package/dist/mcp/tool-list.d.ts.map +1 -1
  428. package/dist/mcp/tool-list.js +7 -3
  429. package/dist/mcp/tool-list.js.map +1 -1
  430. package/dist/presets/routes.d.ts.map +1 -1
  431. package/dist/presets/routes.js +6 -0
  432. package/dist/presets/routes.js.map +1 -1
  433. package/dist/projects/routes.d.ts +1 -1
  434. package/dist/projects/state-home-preflight.d.ts.map +1 -1
  435. package/dist/projects/state-home-preflight.js +2 -0
  436. package/dist/projects/state-home-preflight.js.map +1 -1
  437. package/dist/setup/tool-path.d.ts +16 -0
  438. package/dist/setup/tool-path.d.ts.map +1 -0
  439. package/dist/setup/tool-path.js +66 -0
  440. package/dist/setup/tool-path.js.map +1 -0
  441. package/dist/skills/plugin-source.d.ts +42 -88
  442. package/dist/skills/plugin-source.d.ts.map +1 -1
  443. package/dist/skills/plugin-source.js +140 -100
  444. package/dist/skills/plugin-source.js.map +1 -1
  445. package/dist/skills/runtime.d.ts.map +1 -1
  446. package/dist/skills/runtime.js +15 -7
  447. package/dist/skills/runtime.js.map +1 -1
  448. package/dist/skills/store.d.ts.map +1 -1
  449. package/dist/skills/store.js +25 -14
  450. package/dist/skills/store.js.map +1 -1
  451. package/dist/skills/usage.d.ts +238 -0
  452. package/dist/skills/usage.d.ts.map +1 -0
  453. package/dist/skills/usage.js +789 -0
  454. package/dist/skills/usage.js.map +1 -0
  455. package/dist/skills/venv.d.ts +18 -2
  456. package/dist/skills/venv.d.ts.map +1 -1
  457. package/dist/skills/venv.js +2 -2
  458. package/dist/skills/venv.js.map +1 -1
  459. package/dist/sources/routes.d.ts +3 -1
  460. package/dist/sources/routes.d.ts.map +1 -1
  461. package/dist/sources/routes.js +11 -0
  462. package/dist/sources/routes.js.map +1 -1
  463. package/dist/standing-orders/parse.d.ts +19 -0
  464. package/dist/standing-orders/parse.d.ts.map +1 -1
  465. package/dist/standing-orders/parse.js +61 -18
  466. package/dist/standing-orders/parse.js.map +1 -1
  467. package/dist/studio/apps-standalone/fixture.html +12 -0
  468. package/dist/studio/apps-standalone/fixture.js +10 -0
  469. package/dist/studio/apps-standalone/runtime.css +139 -0
  470. package/dist/studio/apps-standalone/runtime.js +1 -0
  471. package/dist/studio/assets/{KnowledgeGraph-Cpm46tEp.js → KnowledgeGraph-AtkRlS3c.js} +1 -1
  472. package/dist/studio/assets/index-CdbCAs7s.css +32 -0
  473. package/dist/studio/assets/index-DU_8o4uq.js +1104 -0
  474. package/dist/studio/editors/wicked-apps/editor.json +1 -1
  475. package/dist/studio/editors/wicked-apps/index.html +2 -2
  476. package/dist/studio/editors/wicked-deck/editor.json +1 -1
  477. package/dist/studio/editors/wicked-deck/index.html +14 -1
  478. package/dist/studio/editors/wicked-doc/editor.json +1 -1
  479. package/dist/studio/editors/wicked-doc/index.html +1 -1
  480. package/dist/studio/editors/wicked-insights/editor.json +1 -1
  481. package/dist/studio/editors/wicked-insights/index.html +1 -1
  482. package/dist/studio/editors/wicked-page/editor.json +10 -1
  483. package/dist/studio/editors/wicked-page/index.html +2 -2
  484. package/dist/studio/editors/wicked-video/editor.json +7 -2
  485. package/dist/studio/editors/wicked-video/index.html +14 -11
  486. package/dist/studio/index.html +2 -2
  487. package/dist/studio/testid-inventory.json +2069 -242
  488. package/dist/team/routes.d.ts +11 -1
  489. package/dist/team/routes.d.ts.map +1 -1
  490. package/dist/team/routes.js +27 -0
  491. package/dist/team/routes.js.map +1 -1
  492. package/dist/workflow-catalog/build-v2.d.ts +94 -0
  493. package/dist/workflow-catalog/build-v2.d.ts.map +1 -0
  494. package/dist/workflow-catalog/build-v2.js +551 -0
  495. package/dist/workflow-catalog/build-v2.js.map +1 -0
  496. package/dist/workflow-catalog/catalog-data-v2.d.ts +12 -0
  497. package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -0
  498. package/dist/workflow-catalog/catalog-data-v2.js +2787 -0
  499. package/dist/workflow-catalog/catalog-data-v2.js.map +1 -0
  500. package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
  501. package/dist/workflow-catalog/catalog-data.js +2 -20
  502. package/dist/workflow-catalog/catalog-data.js.map +1 -1
  503. package/dist/workflow-catalog/detect-service.d.ts +95 -0
  504. package/dist/workflow-catalog/detect-service.d.ts.map +1 -0
  505. package/dist/workflow-catalog/detect-service.js +239 -0
  506. package/dist/workflow-catalog/detect-service.js.map +1 -0
  507. package/dist/workflow-catalog/detect.d.ts +213 -0
  508. package/dist/workflow-catalog/detect.d.ts.map +1 -0
  509. package/dist/workflow-catalog/detect.js +653 -0
  510. package/dist/workflow-catalog/detect.js.map +1 -0
  511. package/dist/workflow-catalog/seeds-v2.d.ts +91 -0
  512. package/dist/workflow-catalog/seeds-v2.d.ts.map +1 -0
  513. package/dist/workflow-catalog/seeds-v2.js +2 -0
  514. package/dist/workflow-catalog/seeds-v2.js.map +1 -0
  515. package/dist/workflow-catalog/shape.d.ts +99 -0
  516. package/dist/workflow-catalog/shape.d.ts.map +1 -0
  517. package/dist/workflow-catalog/shape.js +103 -0
  518. package/dist/workflow-catalog/shape.js.map +1 -0
  519. package/dist/working-doc/bridge-backend.js +2 -2
  520. package/dist/working-doc/event-lines.d.ts +67 -2
  521. package/dist/working-doc/event-lines.d.ts.map +1 -1
  522. package/dist/working-doc/event-lines.js +155 -8
  523. package/dist/working-doc/event-lines.js.map +1 -1
  524. package/dist/working-doc/notes-index.d.ts +35 -0
  525. package/dist/working-doc/notes-index.d.ts.map +1 -0
  526. package/dist/working-doc/notes-index.js +82 -0
  527. package/dist/working-doc/notes-index.js.map +1 -0
  528. package/dist/working-doc/routes.js +4 -4
  529. package/dist/working-doc/sections.js +2 -2
  530. package/dist/working-doc/service.d.ts +260 -21
  531. package/dist/working-doc/service.d.ts.map +1 -1
  532. package/dist/working-doc/service.js +791 -90
  533. package/dist/working-doc/service.js.map +1 -1
  534. package/dist/working-doc/store.d.ts +50 -1
  535. package/dist/working-doc/store.d.ts.map +1 -1
  536. package/dist/working-doc/store.js +4 -1
  537. package/dist/working-doc/store.js.map +1 -1
  538. package/endpoint-manifest.json +219 -5
  539. package/evals/corpora/shape-corrections-v1.json +594 -0
  540. package/evals/corpora/shape-corrections-v1.seat-fixture.json +186 -0
  541. package/evals/corpora/shape-v1.json +2113 -0
  542. package/evals/corpora/shape-v1.seat-fixture.json +1800 -0
  543. package/package.json +31 -8
  544. package/scripts/apps-render.py +226 -0
  545. package/workflows/detect-shape.json +29 -0
  546. package/dist/studio/assets/index-BRBwWQMH.css +0 -32
  547. package/dist/studio/assets/index-CVrWDGRP.js +0 -1097
@@ -0,0 +1,789 @@
1
+ /**
2
+ * Skill usage (operator 2026-11-08: "we should be recording skills usage - that way we know which ones we can turn off
3
+ * over time"). The engine reads each seat's own tool stream and reports, per unit attempt (a workflow step or a chat
4
+ * turn):
5
+ *
6
+ * skillsSnapshotHanded the generation and the names the seat's lever delivered (`lever`, `skills`)
7
+ * skillUsed `directed` (the directive named it), `opened` (the seat loaded it), `browsed` (one command
8
+ * named files from more than three skills: looked over, not used) or `ran` (a garden script,
9
+ * named `scripts/<rel>`, never attributed by core)
10
+ *
11
+ * The run's own event log is the record. This is crew's rollup of it, beside the catalog the operator will turn skills
12
+ * off in: one JSON file in the state home (`daemon-skill-usage.json`, the `daemon-` prefix the state-home fence
13
+ * classifies), written atomically (`writeFileAtomic`) and debounced. A file that does not validate in full starts empty
14
+ * and never fails the boot.
15
+ *
16
+ * Every frame is validated before it changes anything (bounded identifiers, integer ordinals, a numeric generation
17
+ * token, a `scripts/<rel>` script) and every retained set is bounded: daily counts per (skill, CLI, signal, origin) kept
18
+ * {@link DAILY_KEEP_DAYS} days; per (skill, CLI) the newest handoff, and per (skill, CLI, signal) the newest use and the
19
+ * highest generation it was used in; at most {@link KEYS_MAX} of each.
20
+ *
21
+ * A `ran` is credited to a skill only through the generation's own files: the handed skills whose files name the
22
+ * script ({@link scriptIndexOf}). One owner is credited; several are narrowed to the ones the same attempt opened or was
23
+ * directed to; anything else (a shared script like `scripts/_run.py`) is counted for the script alone. Never a naming
24
+ * guess. A skill is counted once per attempt and signal, however many of its scripts ran.
25
+ *
26
+ * "Used" = opened, or a ran credited to the skill. Directed without an open is its own column (the seat was told and
27
+ * did not load it); browsed is counted and is not use. "Unused since N" is said only of a skill handed since N to a CLI
28
+ * whose use can be seen on this daemon's floor ({@link observable}): copilot never, opencode and agy only on the
29
+ * container floor.
30
+ */
31
+ import { lstatSync, readdirSync, readFileSync, statSync } from 'node:fs';
32
+ import { join } from 'node:path';
33
+ import { crewStateHome } from '../projects/state-home.js';
34
+ import { writeFileAtomic } from './tree.js';
35
+ export const SKILL_USAGE_FILENAME = 'daemon-skill-usage.json';
36
+ /** Daily buckets kept: today and the 89 days before it — the report's 90-day window exactly. */
37
+ export const DAILY_KEEP_DAYS = 90;
38
+ /** Live attempts whose signals are held for attribution; the oldest is dropped past this. */
39
+ export const ATTEMPTS_HELD = 2000;
40
+ /** Distinct keys kept in each retained map (`last`, `handedLast`, `scriptLast`, `introduced`). */
41
+ export const KEYS_MAX = 20_000;
42
+ /** A file larger than this is not read (it starts empty). */
43
+ export const FILE_MAX_BYTES = 32 * 1024 * 1024;
44
+ export const FLUSH_DEBOUNCE_MS = 5000;
45
+ /** Generations whose script index is held. */
46
+ const INDEX_CACHE = 4;
47
+ /** One generation's index walk: files read, bytes read, directory depth. */
48
+ const INDEX_FILES_MAX = 4000;
49
+ const INDEX_BYTES_MAX = 16 * 1024 * 1024;
50
+ const FILE_READ_MAX = 512 * 1024;
51
+ const INDEX_DEPTH_MAX = 8;
52
+ /** Names one attempt's handoff / context may hold. */
53
+ const ATTEMPT_NAMES_MAX = 4000;
54
+ const DAY_MS = 86_400_000;
55
+ const SIGNALS = ['directed', 'opened', 'browsed', 'ran'];
56
+ const ORIGINS = ['run', 'chat', 'member'];
57
+ const SKILL_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
58
+ const CLI_RE = /^[A-Za-z0-9][A-Za-z0-9._#:-]{0,63}$/;
59
+ const SCRIPT_RE = /^scripts\/[A-Za-z0-9_][A-Za-z0-9_./-]{0,199}$/;
60
+ const GEN_RE = /^\d{1,12}$/;
61
+ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
62
+ /** A real calendar day (`2026-99-99` is not). */
63
+ const isDay = (d) => DAY_RE.test(d) && !Number.isNaN(Date.parse(`${d}T00:00:00Z`)) && new Date(`${d}T00:00:00Z`).toISOString().slice(0, 10) === d;
64
+ const validScript = (s) => SCRIPT_RE.test(s) && !s.split('/').some((c) => c === '..' || c === '.' || c === '');
65
+ /** What each CLI's stream lets the engine see (core `skill_use`). */
66
+ export const OBSERVABLE = {
67
+ claude: { signals: ['opened', 'browsed', 'ran'], note: null },
68
+ codex: { signals: ['opened', 'browsed', 'ran'], note: 'a $name mention codex injects itself is not seen (the engine never uses one)' },
69
+ pi: { signals: ['opened', 'browsed', 'ran'], note: null },
70
+ opencode: { signals: ['opened', 'browsed', 'ran'], note: 'seen on the container floor only; on the host floor its stream is text' },
71
+ agy: { signals: ['opened', 'browsed', 'ran'], note: 'seen on the container floor only; handed no skills (no lever), so its reads and script runs are what is seen' },
72
+ copilot: { signals: [], note: 'not observable: its stream is text only, so only what it was handed is recorded' },
73
+ };
74
+ /** CLIs whose structured stream is read only on the container floor. */
75
+ const CONTAINER_ONLY = new Set(['opencode', 'agy']);
76
+ /** The CLI family of a seat key (`codex`, `codex-2`, `codex#2` → `codex`). */
77
+ export function cliFamily(cli) {
78
+ const k = cli.toLowerCase();
79
+ return Object.keys(OBSERVABLE).find((f) => k === f || k.startsWith(`${f}-`) || k.startsWith(`${f}_`) || k.startsWith(`${f}#`)) ?? k;
80
+ }
81
+ /** The daemon's seat floor (`WICKED_SEAT_FLOOR`, set at boot: `container` unless the operator chose `host`). */
82
+ export function seatFloor(env = process.env) {
83
+ return env['WICKED_SEAT_FLOOR'] === 'host' ? 'host' : 'container';
84
+ }
85
+ /** Whether a CLI's use can be seen on `floor`. */
86
+ export function observable(cli, floor = seatFloor()) {
87
+ const family = cliFamily(cli);
88
+ if (!Object.hasOwn(OBSERVABLE, family) || (OBSERVABLE[family]?.signals.length ?? 0) === 0)
89
+ return false;
90
+ return !(floor === 'host' && CONTAINER_ONLY.has(family));
91
+ }
92
+ /** A dictionary with no prototype: a key named `constructor` or `__proto__` is just a key. */
93
+ function dict() {
94
+ return Object.create(null);
95
+ }
96
+ function emptyFile() {
97
+ return { version: 2, recordingSince: null, daily: dict(), last: dict(), handedLast: dict(), scriptDaily: dict(), scriptLast: dict(), introduced: dict() };
98
+ }
99
+ const isObj = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
100
+ const isCount = (v) => typeof v === 'number' && Number.isSafeInteger(v) && v >= 0;
101
+ const isTime = (v) => typeof v === 'number' && Number.isFinite(v) && v >= 0;
102
+ const isGen = (v) => v === null || (typeof v === 'number' && Number.isSafeInteger(v) && v >= 0);
103
+ /** Every key and value checked; anything off and the whole file is refused. */
104
+ function parseFile(text) {
105
+ const raw = JSON.parse(text);
106
+ const bad = () => {
107
+ throw new Error('skill usage file does not validate');
108
+ };
109
+ if (!isObj(raw) || raw['version'] !== 2)
110
+ bad();
111
+ const r = raw;
112
+ const f = emptyFile();
113
+ const rs = r['recordingSince'];
114
+ if (rs !== null && rs !== undefined) {
115
+ if (!isObj(rs) || !isTime(rs['at']) || !isGen(rs['gen'] ?? null))
116
+ bad();
117
+ f.recordingSince = { gen: rs['gen'] ?? null, at: rs['at'] };
118
+ }
119
+ const days = (v, out, key) => {
120
+ if (v === undefined)
121
+ return;
122
+ if (!isObj(v))
123
+ bad();
124
+ for (const [day, bucket] of Object.entries(v)) {
125
+ if (!isDay(day) || !isObj(bucket))
126
+ bad();
127
+ const b = dict();
128
+ for (const [k, n] of Object.entries(bucket)) {
129
+ if (!key(k) || !isCount(n))
130
+ bad();
131
+ b[k] = n;
132
+ }
133
+ out[day] = b;
134
+ }
135
+ };
136
+ const usageKey = (k) => {
137
+ const [s, c, sig, o, ...rest] = k.split('|');
138
+ return rest.length === 0 && SKILL_RE.test(s ?? '') && CLI_RE.test(c ?? '') && SIGNALS.includes(sig) && ORIGINS.includes(o);
139
+ };
140
+ const scriptKey = (k) => {
141
+ const [s, c, ...rest] = k.split('|');
142
+ return rest.length === 0 && validScript(s ?? '') && CLI_RE.test(c ?? '');
143
+ };
144
+ days(r['daily'], f.daily, usageKey);
145
+ days(r['scriptDaily'], f.scriptDaily, scriptKey);
146
+ const map = (v, key, val) => {
147
+ const out = dict();
148
+ if (v === undefined)
149
+ return out;
150
+ if (!isObj(v) || Object.keys(v).length > KEYS_MAX)
151
+ bad();
152
+ for (const [k, x] of Object.entries(v)) {
153
+ if (!key(k) || !isObj(x))
154
+ bad();
155
+ out[k] = val(x);
156
+ }
157
+ return out;
158
+ };
159
+ f.last = map(r['last'], (k) => {
160
+ const [s, c, sig, ...rest] = k.split('|');
161
+ return rest.length === 0 && SKILL_RE.test(s ?? '') && CLI_RE.test(c ?? '') && SIGNALS.includes(sig);
162
+ }, (x) => {
163
+ if (!isTime(x['at']) || !isGen(x['gen']) || !isGen(x['maxGen']) || typeof x['unknownGen'] !== 'boolean' || !ORIGINS.includes(x['origin']))
164
+ bad();
165
+ return { at: x['at'], gen: x['gen'], maxGen: x['maxGen'], unknownGen: x['unknownGen'], origin: x['origin'] };
166
+ });
167
+ f.handedLast = map(r['handedLast'], (k) => {
168
+ const [s, c, ...rest] = k.split('|');
169
+ return rest.length === 0 && SKILL_RE.test(s ?? '') && CLI_RE.test(c ?? '');
170
+ }, (x) => {
171
+ if (!isCount(x['gen']) || !isTime(x['at']) || typeof x['seen'] !== 'boolean')
172
+ bad();
173
+ return { gen: x['gen'], at: x['at'], seen: x['seen'] };
174
+ });
175
+ f.scriptLast = map(r['scriptLast'], validScript, (x) => {
176
+ const owners = x['owners'];
177
+ if (!isTime(x['at']) || !isGen(x['gen']) || !Array.isArray(owners) || owners.length > 200 || !owners.every((o) => typeof o === 'string' && SKILL_RE.test(o)))
178
+ bad();
179
+ return { at: x['at'], gen: x['gen'], owners: owners };
180
+ });
181
+ f.introduced = map(r['introduced'], (k) => SKILL_RE.test(k), (x) => {
182
+ if (!isCount(x['gen']) || typeof x['seeded'] !== 'boolean')
183
+ bad();
184
+ return { gen: x['gen'], seeded: x['seeded'] };
185
+ });
186
+ return f;
187
+ }
188
+ /** A core generation token (`"000042"`) as a number; `null` for a live-cache fallback or anything else. */
189
+ export function genNumber(gen) {
190
+ if (typeof gen === 'number' && Number.isSafeInteger(gen) && gen >= 0)
191
+ return gen;
192
+ if (typeof gen !== 'string' || !GEN_RE.test(gen))
193
+ return null;
194
+ return Number.parseInt(gen, 10);
195
+ }
196
+ export function dayOf(ms) {
197
+ return new Date(ms).toISOString().slice(0, 10);
198
+ }
199
+ /** A real directory (never through a symlink at its last component). */
200
+ function isRealDir(p) {
201
+ try {
202
+ return lstatSync(p).isDirectory();
203
+ }
204
+ catch {
205
+ return false;
206
+ }
207
+ }
208
+ function readRows(snapshotDir) {
209
+ try {
210
+ const file = join(snapshotDir, 'snapshot.json');
211
+ const st = lstatSync(file);
212
+ if (!st.isFile() || st.size > FILE_READ_MAX * 8)
213
+ return null;
214
+ const raw = JSON.parse(readFileSync(file, 'utf8'));
215
+ if (!isObj(raw) || !Array.isArray(raw['skills']))
216
+ return null;
217
+ const rows = [];
218
+ for (const r of raw['skills']) {
219
+ if (!isObj(r) || typeof r['name'] !== 'string' || typeof r['dir'] !== 'string' || !SKILL_RE.test(r['name']))
220
+ continue;
221
+ const segs = r['dir'].split('/');
222
+ if (segs[0] !== 'skills' || segs.length < 2 || segs.slice(1).some((s) => s === '' || s === '.' || s === '..' || s.includes('\\')))
223
+ continue;
224
+ rows.push({ name: r['name'], segs: segs.slice(1) });
225
+ }
226
+ return rows;
227
+ }
228
+ catch {
229
+ return null;
230
+ }
231
+ }
232
+ const SCRIPT_REF = /scripts\/[A-Za-z0-9_][A-Za-z0-9_./-]*/g;
233
+ /**
234
+ * `scripts/<rel>` → the skills whose OWN files (a nested skill's subtree is its own) name it and which the generation
235
+ * actually carries. Read from the immutable snapshot, once per generation, within a fixed budget (files, bytes,
236
+ * depth); symlinks are never followed.
237
+ */
238
+ export function scriptIndexOf(snapshotDir) {
239
+ return scriptIndexWithCoverage(snapshotDir).owners;
240
+ }
241
+ /** {@link scriptIndexOf}, and whether the walk read every file (no budget, depth or read failure cut it). */
242
+ export function scriptIndexWithCoverage(snapshotDir) {
243
+ const out = new Map();
244
+ let complete = true;
245
+ if (!isRealDir(snapshotDir))
246
+ return { owners: new Map(), complete: false };
247
+ const rows = readRows(snapshotDir) ?? [];
248
+ const dirs = new Set(rows.map((r) => r.segs.join('/')));
249
+ let files = 0;
250
+ let bytes = 0;
251
+ const exists = new Map();
252
+ for (const row of rows) {
253
+ const stack = [
254
+ { path: join(snapshotDir, 'skills', ...row.segs), rel: row.segs.join('/'), depth: 0 },
255
+ ];
256
+ while (stack.length > 0) {
257
+ const d = stack.pop();
258
+ let entries;
259
+ try {
260
+ entries = readdirSync(d.path, { withFileTypes: true });
261
+ }
262
+ catch {
263
+ complete = false;
264
+ continue;
265
+ }
266
+ for (const e of entries) {
267
+ if (files >= INDEX_FILES_MAX || bytes >= INDEX_BYTES_MAX) {
268
+ complete = false;
269
+ break;
270
+ }
271
+ const rel = `${d.rel}/${e.name}`;
272
+ if (e.isDirectory()) {
273
+ if (dirs.has(rel))
274
+ continue;
275
+ if (d.depth < INDEX_DEPTH_MAX)
276
+ stack.push({ path: join(d.path, e.name), rel, depth: d.depth + 1 });
277
+ else
278
+ complete = false;
279
+ continue;
280
+ }
281
+ if (!e.isFile())
282
+ continue;
283
+ files += 1;
284
+ let text;
285
+ try {
286
+ const p = join(d.path, e.name);
287
+ const size = statSync(p).size;
288
+ if (size > FILE_READ_MAX) {
289
+ complete = false;
290
+ continue;
291
+ }
292
+ bytes += size;
293
+ text = readFileSync(p, 'utf8');
294
+ }
295
+ catch {
296
+ continue;
297
+ }
298
+ for (const m of text.matchAll(SCRIPT_REF)) {
299
+ const script = m[0].replace(/[./-]+$/, '');
300
+ if (!validScript(script))
301
+ continue;
302
+ let ok = exists.get(script);
303
+ if (ok === undefined) {
304
+ try {
305
+ ok = lstatSync(join(snapshotDir, ...script.split('/'))).isFile();
306
+ }
307
+ catch {
308
+ ok = false;
309
+ }
310
+ exists.set(script, ok);
311
+ }
312
+ if (!ok)
313
+ continue;
314
+ const set = out.get(script) ?? new Set();
315
+ set.add(row.name);
316
+ out.set(script, set);
317
+ }
318
+ }
319
+ }
320
+ }
321
+ return { owners: new Map([...out].map(([k, v]) => [k, [...v].sort()])), complete };
322
+ }
323
+ export function defaultSkillUsagePath(env = process.env) {
324
+ return env['WICKED_CREW_SKILL_USAGE'] ?? join(crewStateHome(), SKILL_USAGE_FILENAME);
325
+ }
326
+ function frameOf(event) {
327
+ const e = event;
328
+ if (e.type !== 'skillsSnapshotHanded' && e.type !== 'skillUsed')
329
+ return null;
330
+ const session = e.session;
331
+ const cli = e['cli'];
332
+ const ord = e.ord;
333
+ const attempt = e['attempt'];
334
+ if (typeof session !== 'string' || session.length === 0 || session.length > 200)
335
+ return null;
336
+ if (typeof cli !== 'string' || !CLI_RE.test(cli) || cli === 'tool')
337
+ return null;
338
+ if (!isCount(ord) || !isCount(attempt))
339
+ return null;
340
+ // A generation is a numeric token or an explicit null (a live-cache fallback); anything else is refused.
341
+ if (e['gen'] !== null && !(typeof e['gen'] === 'string' && GEN_RE.test(e['gen'])))
342
+ return null;
343
+ const genToken = typeof e['gen'] === 'string' ? e['gen'] : null;
344
+ const gen = genNumber(genToken);
345
+ const key = `${session}|${ord}|${attempt}`;
346
+ if (e.type === 'skillsSnapshotHanded') {
347
+ const raw = Array.isArray(e['skills']) ? e['skills'].slice(0, ATTEMPT_NAMES_MAX) : [];
348
+ const skills = raw.filter((s) => typeof s === 'string' && SKILL_RE.test(s));
349
+ return { kind: 'handed', key, session, cli, gen, genToken, skills };
350
+ }
351
+ const signal = e['signal'];
352
+ if (typeof signal !== 'string' || !SIGNALS.includes(signal))
353
+ return null;
354
+ if (signal === 'ran') {
355
+ const script = e['script'];
356
+ if (typeof script !== 'string' || !validScript(script))
357
+ return null;
358
+ return { kind: 'used', key, session, cli, gen, genToken, signal: 'ran', skill: null, script };
359
+ }
360
+ const skill = e['skill'];
361
+ if (typeof skill !== 'string' || !SKILL_RE.test(skill))
362
+ return null;
363
+ return { kind: 'used', key, session, cli, gen, genToken, signal: signal, skill, script: null };
364
+ }
365
+ export class SkillUsageRecorder {
366
+ path;
367
+ now;
368
+ snapshotsDir;
369
+ chatOf;
370
+ floor;
371
+ debounce;
372
+ log;
373
+ file;
374
+ attempts = new Map();
375
+ scriptIndexes = new Map();
376
+ genSeen = new Set();
377
+ timer = null;
378
+ dirty = false;
379
+ /** Running sizes of the retained maps (no `Object.keys` scan per frame). */
380
+ sizes = { last: 0, handedLast: 0, scriptLast: 0, introduced: 0 };
381
+ /** Every (script, CLI) pair in the daily script buckets. */
382
+ scriptPairs = new Set();
383
+ constructor(opts = {}) {
384
+ this.path = opts.path ?? defaultSkillUsagePath();
385
+ this.now = opts.now ?? Date.now;
386
+ this.snapshotsDir = opts.snapshotsDir ?? (() => null);
387
+ this.chatOf = opts.chatOf ?? (() => undefined);
388
+ this.floor = opts.floor ?? (() => seatFloor());
389
+ this.debounce = opts.debounce ?? true;
390
+ this.log = opts.log ?? (() => undefined);
391
+ this.file = emptyFile();
392
+ try {
393
+ const st = statSync(this.path);
394
+ if (st.isFile() && st.size <= FILE_MAX_BYTES)
395
+ this.file = parseFile(readFileSync(this.path, 'utf8'));
396
+ }
397
+ catch (err) {
398
+ if (err.code !== 'ENOENT')
399
+ this.log(`[skills] skill usage file not read, starting empty: ${err instanceof Error ? err.message : String(err)}`);
400
+ }
401
+ this.sizes.last = Object.keys(this.file.last).length;
402
+ this.sizes.handedLast = Object.keys(this.file.handedLast).length;
403
+ this.sizes.scriptLast = Object.keys(this.file.scriptLast).length;
404
+ this.sizes.introduced = Object.keys(this.file.introduced).length;
405
+ for (const bucket of Object.values(this.file.scriptDaily))
406
+ for (const k of Object.keys(bucket))
407
+ this.scriptPairs.add(k);
408
+ }
409
+ /** The rollup as it stands (tests, the rebuild). */
410
+ snapshot() {
411
+ return JSON.parse(JSON.stringify(this.file));
412
+ }
413
+ /** Fold one engine frame. Anything that is not a valid usage frame is ignored; nothing here throws. */
414
+ ingest(event) {
415
+ try {
416
+ this.fold(event);
417
+ }
418
+ catch (err) {
419
+ this.log(`[skills] skill usage frame not folded: ${err instanceof Error ? err.message : String(err)}`);
420
+ }
421
+ }
422
+ fold(event) {
423
+ const f = frameOf(event);
424
+ if (f === null)
425
+ return;
426
+ const at = this.now();
427
+ if (this.file.recordingSince === null)
428
+ this.file.recordingSince = { gen: f.gen, at };
429
+ else if (this.file.recordingSince.gen === null && f.gen !== null)
430
+ this.file.recordingSince.gen = f.gen;
431
+ if (f.gen !== null)
432
+ this.noteGeneration(f.gen);
433
+ const att = this.attempt(f.key, f.genToken);
434
+ if (f.kind === 'handed') {
435
+ att.handed = new Set(f.skills);
436
+ if (f.gen !== null) {
437
+ for (const skill of f.skills) {
438
+ const k = `${skill}|${f.cli}`;
439
+ const h = this.file.handedLast[k];
440
+ const seen = observable(f.cli, this.floor());
441
+ if (h === undefined) {
442
+ if (this.sizes.handedLast >= KEYS_MAX)
443
+ continue;
444
+ this.sizes.handedLast += 1;
445
+ this.file.handedLast[k] = { gen: f.gen, at, seen };
446
+ }
447
+ else if (f.gen > h.gen) {
448
+ // The newest generation wins.
449
+ this.file.handedLast[k] = { gen: f.gen, at, seen };
450
+ }
451
+ else if (f.gen === h.gen) {
452
+ // Within one generation an unseen handoff stays unseen.
453
+ h.at = at;
454
+ h.seen = h.seen && seen;
455
+ }
456
+ }
457
+ }
458
+ this.changed();
459
+ return;
460
+ }
461
+ const origin = this.originOf(f.session);
462
+ if (f.signal === 'ran') {
463
+ const script = f.script;
464
+ // Resolved in THIS frame's generation (a relaunch may run on a newer one).
465
+ const { owners, complete } = this.ownersOf(f.genToken ?? att.gen, script, att.handed);
466
+ const narrowed = owners.filter((o) => att.context.has(o));
467
+ // One owner is credited only when the index saw every file; else only what the attempt opened or was told.
468
+ const credited = owners.length === 1 && complete ? owners : narrowed;
469
+ if (credited.length === 1)
470
+ this.count(att, credited[0], f.cli, 'ran', origin, f.gen, at);
471
+ else if (this.once(att, `script|${script}`))
472
+ this.countScript(script, owners, f.cli, f.gen, at);
473
+ this.changed();
474
+ return;
475
+ }
476
+ const skill = f.skill;
477
+ if ((f.signal === 'opened' || f.signal === 'directed') && att.context.size < ATTEMPT_NAMES_MAX)
478
+ att.context.add(skill);
479
+ this.count(att, skill, f.cli, f.signal, origin, f.gen, at);
480
+ this.changed();
481
+ }
482
+ originOf(session) {
483
+ if (session.startsWith('member-'))
484
+ return 'member';
485
+ return this.chatOf(session) !== undefined ? 'chat' : 'run';
486
+ }
487
+ attempt(key, gen) {
488
+ let a = this.attempts.get(key);
489
+ if (a === undefined) {
490
+ a = { gen, handed: null, context: new Set(), counted: new Set() };
491
+ this.attempts.set(key, a);
492
+ if (this.attempts.size > ATTEMPTS_HELD)
493
+ this.attempts.delete(this.attempts.keys().next().value);
494
+ }
495
+ else if (a.gen === null && gen !== null)
496
+ a.gen = gen;
497
+ return a;
498
+ }
499
+ /** First time this attempt records `key`; a saturated attempt records nothing more. */
500
+ once(att, key) {
501
+ if (att.counted.has(key) || att.counted.size >= ATTEMPT_NAMES_MAX)
502
+ return false;
503
+ att.counted.add(key);
504
+ return true;
505
+ }
506
+ /** The handed skills whose files name `script` in generation `gen` (a validated numeric token), and whether the
507
+ * index read every file of that generation. */
508
+ ownersOf(gen, script, handed) {
509
+ if (gen === null || !GEN_RE.test(gen))
510
+ return { owners: [], complete: false };
511
+ let index = this.scriptIndexes.get(gen);
512
+ if (index === undefined) {
513
+ // The snapshots dir itself must be a real directory, as `noteGeneration` requires.
514
+ const dir = this.snapshotsDir();
515
+ index = dir === null || !isRealDir(dir) ? { owners: new Map(), complete: false } : scriptIndexWithCoverage(join(dir, gen));
516
+ this.scriptIndexes.set(gen, index);
517
+ if (this.scriptIndexes.size > INDEX_CACHE)
518
+ this.scriptIndexes.delete(this.scriptIndexes.keys().next().value);
519
+ }
520
+ const owners = index.owners.get(script) ?? [];
521
+ return { owners: handed === null ? owners : owners.filter((o) => handed.has(o)), complete: index.complete };
522
+ }
523
+ count(att, skill, cli, signal, origin, gen, at) {
524
+ const lk = `${skill}|${cli}|${signal}`;
525
+ const prev = this.file.last[lk];
526
+ if (prev === undefined && this.sizes.last >= KEYS_MAX)
527
+ return;
528
+ if (prev === undefined)
529
+ this.sizes.last += 1;
530
+ // One attempt counts a skill once per signal, however many of its scripts ran; its newest use and highest
531
+ // generation are kept whatever the count does.
532
+ if (this.once(att, `${signal}|${skill}`)) {
533
+ const bucket = (this.file.daily[dayOf(at)] ??= dict());
534
+ const k = `${skill}|${cli}|${signal}|${origin}`;
535
+ bucket[k] = (bucket[k] ?? 0) + 1;
536
+ }
537
+ this.file.last[lk] = {
538
+ at,
539
+ gen,
540
+ maxGen: gen === null ? (prev?.maxGen ?? null) : Math.max(gen, prev?.maxGen ?? gen),
541
+ unknownGen: gen === null || (prev?.unknownGen ?? false),
542
+ origin,
543
+ };
544
+ }
545
+ countScript(script, owners, cli, gen, at) {
546
+ const k = `${script}|${cli}`;
547
+ // Bounded per (script, CLI): the daily buckets are keyed by the pair, not the script alone.
548
+ if (!this.scriptPairs.has(k)) {
549
+ if (this.scriptPairs.size >= KEYS_MAX)
550
+ return;
551
+ this.scriptPairs.add(k);
552
+ }
553
+ if (this.file.scriptLast[script] === undefined && this.sizes.scriptLast >= KEYS_MAX)
554
+ return;
555
+ if (this.file.scriptLast[script] === undefined)
556
+ this.sizes.scriptLast += 1;
557
+ const bucket = (this.file.scriptDaily[dayOf(at)] ??= dict());
558
+ bucket[k] = (bucket[k] ?? 0) + 1;
559
+ this.file.scriptLast[script] = { at, gen, owners: owners.slice(0, 200) };
560
+ }
561
+ /**
562
+ * Record which skills generation `gen` carries (from its `snapshot.json`): a name seen for the first time was
563
+ * introduced there. The first time anything is noted, every generation still on disk is read oldest first, and the
564
+ * names already in the oldest one are marked `seeded` (they may be older than it). Never throws.
565
+ */
566
+ noteGeneration(gen) {
567
+ if (this.genSeen.has(gen))
568
+ return;
569
+ const dir = this.snapshotsDir();
570
+ if (dir === null || !isRealDir(dir))
571
+ return;
572
+ let names;
573
+ try {
574
+ names = new Map(readdirSync(dir)
575
+ .filter((n) => GEN_RE.test(n))
576
+ .map((n) => [genNumber(n), n]));
577
+ }
578
+ catch {
579
+ return;
580
+ }
581
+ if (Object.keys(this.file.introduced).length === 0) {
582
+ const gens = [...names.keys()].sort((a, b) => a - b);
583
+ const oldest = gens[0];
584
+ for (const g of gens) {
585
+ this.introduce(join(dir, names.get(g)), g, g === oldest);
586
+ this.genSeen.add(g);
587
+ }
588
+ }
589
+ const name = names.get(gen);
590
+ if (name === undefined)
591
+ return;
592
+ this.introduce(join(dir, name), gen, false);
593
+ this.genSeen.add(gen);
594
+ if (this.genSeen.size > 10_000)
595
+ this.genSeen.clear();
596
+ this.changed();
597
+ }
598
+ introduce(snapshotDir, gen, seeded) {
599
+ if (!isRealDir(snapshotDir))
600
+ return;
601
+ for (const row of readRows(snapshotDir) ?? []) {
602
+ if (this.file.introduced[row.name] !== undefined)
603
+ continue;
604
+ if (this.sizes.introduced >= KEYS_MAX)
605
+ return;
606
+ this.sizes.introduced += 1;
607
+ this.file.introduced[row.name] = { gen, seeded };
608
+ }
609
+ }
610
+ changed() {
611
+ this.dirty = true;
612
+ if (!this.debounce) {
613
+ this.flush();
614
+ return;
615
+ }
616
+ if (this.timer !== null)
617
+ return;
618
+ this.timer = setTimeout(() => {
619
+ this.timer = null;
620
+ this.flush();
621
+ }, FLUSH_DEBOUNCE_MS);
622
+ this.timer.unref?.();
623
+ }
624
+ /** Prune and write now (the debounce, the daemon's close). */
625
+ flush() {
626
+ if (this.timer !== null) {
627
+ clearTimeout(this.timer);
628
+ this.timer = null;
629
+ }
630
+ if (!this.dirty)
631
+ return;
632
+ this.dirty = false;
633
+ this.prune();
634
+ try {
635
+ writeFileAtomic(this.path, JSON.stringify(this.file));
636
+ }
637
+ catch (err) {
638
+ // A failed write costs the rollup's freshness on disk, never a run; the next change retries.
639
+ this.dirty = true;
640
+ this.log(`[skills] skill usage not written: ${err instanceof Error ? err.message : String(err)}`);
641
+ }
642
+ }
643
+ /** The first day the windows and the file keep: today and the {@link DAILY_KEEP_DAYS} − 1 days before it. */
644
+ firstKeptDay() {
645
+ return dayOf(this.now() - (DAILY_KEEP_DAYS - 1) * DAY_MS);
646
+ }
647
+ prune() {
648
+ const cutoff = this.firstKeptDay();
649
+ for (const day of Object.keys(this.file.daily))
650
+ if (day < cutoff)
651
+ delete this.file.daily[day];
652
+ for (const day of Object.keys(this.file.scriptDaily))
653
+ if (day < cutoff)
654
+ delete this.file.scriptDaily[day];
655
+ this.scriptPairs.clear();
656
+ for (const bucket of Object.values(this.file.scriptDaily))
657
+ for (const k of Object.keys(bucket))
658
+ this.scriptPairs.add(k);
659
+ }
660
+ /**
661
+ * The rollup for `GET /skills/usage`: per skill, last used, uses in the last 30 / 90 days per CLI and signal, and
662
+ * whether it was handed since `sinceGen` (default: when recording began) to a CLI whose use can be seen and not used
663
+ * since on any. `catalog` is the manifest's skills (enabled or not); a skill seen in usage or handoffs but no longer
664
+ * in the catalog is still listed (`enabled: null`).
665
+ */
666
+ report(opts) {
667
+ const now = this.now();
668
+ const d30 = dayOf(now - 29 * DAY_MS);
669
+ const d90 = this.firstKeptDay();
670
+ const floor = this.floor();
671
+ const recordedFrom = this.file.recordingSince?.gen ?? null;
672
+ let sinceGen = opts.sinceGen ?? recordedFrom;
673
+ let clamped = false;
674
+ if (sinceGen !== null && recordedFrom !== null && sinceGen < recordedFrom) {
675
+ sinceGen = recordedFrom;
676
+ clamped = true;
677
+ }
678
+ const enabled = new Map(opts.catalog.map((c) => [c.name, c.enabled]));
679
+ const rows = new Map();
680
+ const rowOf = (name) => {
681
+ let row = rows.get(name);
682
+ if (row === undefined) {
683
+ row = {
684
+ name,
685
+ enabled: enabled.get(name) ?? null,
686
+ introduced: this.file.introduced[name] ?? null,
687
+ byCli: dict(),
688
+ lastUsed: null,
689
+ unusedSince: { all: false, byCli: [], notObservable: false },
690
+ };
691
+ rows.set(name, row);
692
+ }
693
+ return row;
694
+ };
695
+ const cliOf = (row, cli) => (row.byCli[cli] ??= {
696
+ handedLastGen: null,
697
+ directed: { d30: 0, d90: 0, lastAt: null, lastGen: null },
698
+ opened: { d30: 0, d90: 0, lastAt: null, lastGen: null },
699
+ browsed: { d30: 0, d90: 0, lastAt: null, lastGen: null },
700
+ ran: { d30: 0, d90: 0, lastAt: null, lastGen: null },
701
+ });
702
+ for (const c of opts.catalog)
703
+ rowOf(c.name);
704
+ const today = dayOf(now);
705
+ for (const [day, bucket] of Object.entries(this.file.daily)) {
706
+ if (day < d90 || day > today)
707
+ continue;
708
+ for (const [k, n] of Object.entries(bucket)) {
709
+ const [skill, cli, signal] = k.split('|');
710
+ const c = cliOf(rowOf(skill), cli)[signal];
711
+ c.d90 += n;
712
+ if (day >= d30)
713
+ c.d30 += n;
714
+ }
715
+ }
716
+ // Used since N, per skill and CLI: the highest generation it was used in, or a use that cannot be placed.
717
+ const usedSince = new Map();
718
+ for (const [k, last] of Object.entries(this.file.last)) {
719
+ const [skill, cli, signal] = k.split('|');
720
+ const row = rowOf(skill);
721
+ const c = cliOf(row, cli)[signal];
722
+ c.lastAt = last.at;
723
+ c.lastGen = last.gen;
724
+ if (signal !== 'opened' && signal !== 'ran')
725
+ continue;
726
+ if (row.lastUsed === null || last.at > row.lastUsed.at)
727
+ row.lastUsed = { at: last.at, gen: last.gen, cli };
728
+ if (last.unknownGen || sinceGen === null || (last.maxGen !== null && last.maxGen >= sinceGen)) {
729
+ const set = usedSince.get(skill) ?? new Set();
730
+ set.add(cli);
731
+ usedSince.set(skill, set);
732
+ }
733
+ }
734
+ // Handed since N, per CLI, and whether that handoff's use could be seen.
735
+ const handedSince = new Map();
736
+ const unseen = new Set();
737
+ for (const [k, h] of Object.entries(this.file.handedLast)) {
738
+ const [skill, cli] = k.split('|');
739
+ const cell = cliOf(rowOf(skill), cli);
740
+ cell.handedLastGen = h.gen;
741
+ if (sinceGen !== null && h.gen < sinceGen)
742
+ continue;
743
+ if (!h.seen)
744
+ unseen.add(k);
745
+ const set = handedSince.get(skill) ?? new Set();
746
+ set.add(cli);
747
+ handedSince.set(skill, set);
748
+ }
749
+ for (const row of rows.values()) {
750
+ const clis = [...(handedSince.get(row.name) ?? [])].sort();
751
+ const seen = clis.filter((c) => observable(c, floor) && !unseen.has(`${row.name}|${c}`));
752
+ const used = usedSince.get(row.name) ?? new Set();
753
+ row.unusedSince = {
754
+ all: seen.length > 0 && used.size === 0,
755
+ byCli: seen.filter((c) => !used.has(c)),
756
+ notObservable: clis.length > 0 && seen.length === 0,
757
+ };
758
+ }
759
+ const scripts = new Map();
760
+ for (const [day, bucket] of Object.entries(this.file.scriptDaily)) {
761
+ if (day < d90 || day > today)
762
+ continue;
763
+ for (const [k, n] of Object.entries(bucket)) {
764
+ const script = k.slice(0, k.lastIndexOf('|'));
765
+ const last = this.file.scriptLast[script];
766
+ const s = scripts.get(script) ?? { script, owners: last?.owners ?? [], d30: 0, d90: 0, lastAt: last?.at ?? null };
767
+ s.d90 += n;
768
+ if (day >= d30)
769
+ s.d30 += n;
770
+ scripts.set(script, s);
771
+ }
772
+ }
773
+ const observableNow = {};
774
+ for (const [family, o] of Object.entries(OBSERVABLE)) {
775
+ observableNow[family] = observable(family, floor) ? o : { signals: [], note: o.note };
776
+ }
777
+ const toPlain = (row) => ({ ...row, byCli: { ...row.byCli } });
778
+ return {
779
+ currentGen: opts.currentGen,
780
+ recordingSince: this.file.recordingSince,
781
+ sinceGen,
782
+ sinceGenClamped: clamped,
783
+ observable: observableNow,
784
+ skills: [...rows.values()].sort((a, b) => a.name.localeCompare(b.name)).map(toPlain),
785
+ scripts: [...scripts.values()].sort((a, b) => b.d90 - a.d90 || a.script.localeCompare(b.script)),
786
+ };
787
+ }
788
+ }
789
+ //# sourceMappingURL=usage.js.map