@skillsmith/core 0.12.1 → 0.12.3

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 (398) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/README.md +2 -2
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/src/api/client.d.ts +5 -3
  5. package/dist/src/api/client.d.ts.map +1 -1
  6. package/dist/src/api/client.js +23 -33
  7. package/dist/src/api/client.js.map +1 -1
  8. package/dist/src/api/client.registry-sync.d.ts +28 -0
  9. package/dist/src/api/client.registry-sync.d.ts.map +1 -0
  10. package/dist/src/api/client.registry-sync.js +36 -0
  11. package/dist/src/api/client.registry-sync.js.map +1 -0
  12. package/dist/src/api/client.test.js +185 -0
  13. package/dist/src/api/client.test.js.map +1 -1
  14. package/dist/src/api/client.toSkill.d.ts +16 -0
  15. package/dist/src/api/client.toSkill.d.ts.map +1 -0
  16. package/dist/src/api/client.toSkill.js +46 -0
  17. package/dist/src/api/client.toSkill.js.map +1 -0
  18. package/dist/src/api/client.types.d.ts +22 -0
  19. package/dist/src/api/client.types.d.ts.map +1 -1
  20. package/dist/src/api/index.d.ts +1 -1
  21. package/dist/src/api/index.d.ts.map +1 -1
  22. package/dist/src/api/index.js.map +1 -1
  23. package/dist/src/api/schemas.d.ts +28 -0
  24. package/dist/src/api/schemas.d.ts.map +1 -1
  25. package/dist/src/api/schemas.js +13 -0
  26. package/dist/src/api/schemas.js.map +1 -1
  27. package/dist/src/audit/remote-audit.d.ts +85 -0
  28. package/dist/src/audit/remote-audit.d.ts.map +1 -1
  29. package/dist/src/audit/remote-audit.js +126 -3
  30. package/dist/src/audit/remote-audit.js.map +1 -1
  31. package/dist/src/audit/remote-audit.test.js +217 -1
  32. package/dist/src/audit/remote-audit.test.js.map +1 -1
  33. package/dist/src/config/index.d.ts +1 -0
  34. package/dist/src/config/index.d.ts.map +1 -1
  35. package/dist/src/config/index.js.map +1 -1
  36. package/dist/src/db/migration-runner.d.ts.map +1 -1
  37. package/dist/src/db/migration-runner.js +6 -0
  38. package/dist/src/db/migration-runner.js.map +1 -1
  39. package/dist/src/db/migrations/v18-skill-versions-real-content-hash.d.ts +36 -0
  40. package/dist/src/db/migrations/v18-skill-versions-real-content-hash.d.ts.map +1 -0
  41. package/dist/src/db/migrations/v18-skill-versions-real-content-hash.js +38 -0
  42. package/dist/src/db/migrations/v18-skill-versions-real-content-hash.js.map +1 -0
  43. package/dist/src/db/schema.d.ts +1 -1
  44. package/dist/src/db/schema.d.ts.map +1 -1
  45. package/dist/src/db/schema.js +3 -1
  46. package/dist/src/db/schema.js.map +1 -1
  47. package/dist/src/exports/services.d.ts +3 -7
  48. package/dist/src/exports/services.d.ts.map +1 -1
  49. package/dist/src/exports/services.install.d.ts +18 -0
  50. package/dist/src/exports/services.install.d.ts.map +1 -0
  51. package/dist/src/exports/services.install.js +62 -0
  52. package/dist/src/exports/services.install.js.map +1 -0
  53. package/dist/src/exports/services.js +12 -32
  54. package/dist/src/exports/services.js.map +1 -1
  55. package/dist/src/exports/types.d.ts +1 -1
  56. package/dist/src/exports/types.d.ts.map +1 -1
  57. package/dist/src/index.d.ts +6 -5
  58. package/dist/src/index.d.ts.map +1 -1
  59. package/dist/src/index.js +9 -4
  60. package/dist/src/index.js.map +1 -1
  61. package/dist/src/install/agent-config-merge.json.d.ts +5 -4
  62. package/dist/src/install/agent-config-merge.json.d.ts.map +1 -1
  63. package/dist/src/install/agent-config-merge.json.js +10 -9
  64. package/dist/src/install/agent-config-merge.json.js.map +1 -1
  65. package/dist/src/install/agent-config-merge.types.d.ts +11 -1
  66. package/dist/src/install/agent-config-merge.types.d.ts.map +1 -1
  67. package/dist/src/install/agent-config-merge.types.js.map +1 -1
  68. package/dist/src/install/agent-harness-targets.d.ts +30 -2
  69. package/dist/src/install/agent-harness-targets.d.ts.map +1 -1
  70. package/dist/src/install/agent-harness-targets.js +17 -0
  71. package/dist/src/install/agent-harness-targets.js.map +1 -1
  72. package/dist/src/install/agent-manifest-path-guard.d.ts +28 -3
  73. package/dist/src/install/agent-manifest-path-guard.d.ts.map +1 -1
  74. package/dist/src/install/agent-manifest-path-guard.js +59 -3
  75. package/dist/src/install/agent-manifest-path-guard.js.map +1 -1
  76. package/dist/src/install/agent-manifest-path-guard.test.js +27 -1
  77. package/dist/src/install/agent-manifest-path-guard.test.js.map +1 -1
  78. package/dist/src/install/agent-pack-installer.antigravity-mcp.d.ts +74 -0
  79. package/dist/src/install/agent-pack-installer.antigravity-mcp.d.ts.map +1 -0
  80. package/dist/src/install/agent-pack-installer.antigravity-mcp.js +106 -0
  81. package/dist/src/install/agent-pack-installer.antigravity-mcp.js.map +1 -0
  82. package/dist/src/install/agent-pack-installer.antigravity-mcp.test.d.ts +2 -0
  83. package/dist/src/install/agent-pack-installer.antigravity-mcp.test.d.ts.map +1 -0
  84. package/dist/src/install/agent-pack-installer.antigravity-mcp.test.js +157 -0
  85. package/dist/src/install/agent-pack-installer.antigravity-mcp.test.js.map +1 -0
  86. package/dist/src/install/agent-pack-installer.cursor-mcp.d.ts +53 -0
  87. package/dist/src/install/agent-pack-installer.cursor-mcp.d.ts.map +1 -0
  88. package/dist/src/install/agent-pack-installer.cursor-mcp.js +207 -0
  89. package/dist/src/install/agent-pack-installer.cursor-mcp.js.map +1 -0
  90. package/dist/src/install/agent-pack-installer.cursor-mcp.test.d.ts +2 -0
  91. package/dist/src/install/agent-pack-installer.cursor-mcp.test.d.ts.map +1 -0
  92. package/dist/src/install/agent-pack-installer.cursor-mcp.test.js +285 -0
  93. package/dist/src/install/agent-pack-installer.cursor-mcp.test.js.map +1 -0
  94. package/dist/src/install/agent-pack-installer.d.ts +8 -0
  95. package/dist/src/install/agent-pack-installer.d.ts.map +1 -1
  96. package/dist/src/install/agent-pack-installer.entry.d.ts +120 -3
  97. package/dist/src/install/agent-pack-installer.entry.d.ts.map +1 -1
  98. package/dist/src/install/agent-pack-installer.entry.js +166 -3
  99. package/dist/src/install/agent-pack-installer.entry.js.map +1 -1
  100. package/dist/src/install/agent-pack-installer.js +97 -3
  101. package/dist/src/install/agent-pack-installer.js.map +1 -1
  102. package/dist/src/install/agent-pack-installer.types.d.ts +27 -0
  103. package/dist/src/install/agent-pack-installer.types.d.ts.map +1 -1
  104. package/dist/src/install/agent-pack-installer.types.js +6 -0
  105. package/dist/src/install/agent-pack-installer.types.js.map +1 -1
  106. package/dist/src/install/agent-pack-installer.workspace-scope.test.d.ts +2 -0
  107. package/dist/src/install/agent-pack-installer.workspace-scope.test.d.ts.map +1 -0
  108. package/dist/src/install/agent-pack-installer.workspace-scope.test.js +148 -0
  109. package/dist/src/install/agent-pack-installer.workspace-scope.test.js.map +1 -0
  110. package/dist/src/install/agent-pack-uninstaller.d.ts +18 -7
  111. package/dist/src/install/agent-pack-uninstaller.d.ts.map +1 -1
  112. package/dist/src/install/agent-pack-uninstaller.js +59 -9
  113. package/dist/src/install/agent-pack-uninstaller.js.map +1 -1
  114. package/dist/src/install/agent-pack-uninstaller.test.js +74 -1
  115. package/dist/src/install/agent-pack-uninstaller.test.js.map +1 -1
  116. package/dist/src/install/fan-out.d.ts.map +1 -1
  117. package/dist/src/install/fan-out.js +6 -0
  118. package/dist/src/install/fan-out.js.map +1 -1
  119. package/dist/src/install/index.d.ts +2 -0
  120. package/dist/src/install/index.d.ts.map +1 -1
  121. package/dist/src/install/index.js +2 -0
  122. package/dist/src/install/index.js.map +1 -1
  123. package/dist/src/install/workspace-scope.d.ts +207 -0
  124. package/dist/src/install/workspace-scope.d.ts.map +1 -0
  125. package/dist/src/install/workspace-scope.js +275 -0
  126. package/dist/src/install/workspace-scope.js.map +1 -0
  127. package/dist/src/install/workspace-scope.test.d.ts +2 -0
  128. package/dist/src/install/workspace-scope.test.d.ts.map +1 -0
  129. package/dist/src/install/workspace-scope.test.js +378 -0
  130. package/dist/src/install/workspace-scope.test.js.map +1 -0
  131. package/dist/src/scripts/__tests__/scan-imported-skills.test.js +9 -1
  132. package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
  133. package/dist/src/scripts/scan-imported-skills.d.ts +7 -1
  134. package/dist/src/scripts/scan-imported-skills.d.ts.map +1 -1
  135. package/dist/src/scripts/scan-imported-skills.js +15 -2
  136. package/dist/src/scripts/scan-imported-skills.js.map +1 -1
  137. package/dist/src/scripts/skill-scanner/allowlist.d.ts +10 -0
  138. package/dist/src/scripts/skill-scanner/allowlist.d.ts.map +1 -1
  139. package/dist/src/scripts/skill-scanner/allowlist.js +10 -0
  140. package/dist/src/scripts/skill-scanner/allowlist.js.map +1 -1
  141. package/dist/src/scripts/skill-scanner/index.d.ts +8 -0
  142. package/dist/src/scripts/skill-scanner/index.d.ts.map +1 -1
  143. package/dist/src/scripts/skill-scanner/index.js +13 -5
  144. package/dist/src/scripts/skill-scanner/index.js.map +1 -1
  145. package/dist/src/scripts/skill-scanner/trust-scorer.d.ts.map +1 -1
  146. package/dist/src/scripts/skill-scanner/trust-scorer.js +6 -0
  147. package/dist/src/scripts/skill-scanner/trust-scorer.js.map +1 -1
  148. package/dist/src/security/__tests__/pathValidation.test.js +30 -1
  149. package/dist/src/security/__tests__/pathValidation.test.js.map +1 -1
  150. package/dist/src/security/scanner/SecurityScanner.action-context.d.ts +15 -0
  151. package/dist/src/security/scanner/SecurityScanner.action-context.d.ts.map +1 -0
  152. package/dist/src/security/scanner/SecurityScanner.action-context.js +209 -0
  153. package/dist/src/security/scanner/SecurityScanner.action-context.js.map +1 -0
  154. package/dist/src/security/scanner/SecurityScanner.d.ts +25 -0
  155. package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -1
  156. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts +40 -1
  157. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -1
  158. package/dist/src/security/scanner/SecurityScanner.helpers.js +88 -51
  159. package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -1
  160. package/dist/src/security/scanner/SecurityScanner.js +39 -6
  161. package/dist/src/security/scanner/SecurityScanner.js.map +1 -1
  162. package/dist/src/security/scanner/SecurityScanner.pii.d.ts +30 -0
  163. package/dist/src/security/scanner/SecurityScanner.pii.d.ts.map +1 -1
  164. package/dist/src/security/scanner/SecurityScanner.pii.js +8 -1
  165. package/dist/src/security/scanner/SecurityScanner.pii.js.map +1 -1
  166. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts +60 -0
  167. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts.map +1 -0
  168. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js +228 -0
  169. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js.map +1 -0
  170. package/dist/src/security/scanner/SecurityScanner.scanners.d.ts.map +1 -1
  171. package/dist/src/security/scanner/SecurityScanner.scanners.js +35 -5
  172. package/dist/src/security/scanner/SecurityScanner.scanners.js.map +1 -1
  173. package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts +49 -0
  174. package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts.map +1 -0
  175. package/dist/src/security/scanner/SecurityScanner.value-gate.js +134 -0
  176. package/dist/src/security/scanner/SecurityScanner.value-gate.js.map +1 -0
  177. package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts +55 -0
  178. package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts.map +1 -0
  179. package/dist/src/security/scanner/SecurityScanner.weak-passwords.js +313 -0
  180. package/dist/src/security/scanner/SecurityScanner.weak-passwords.js.map +1 -0
  181. package/dist/src/security/scanner/patterns.d.ts +16 -6
  182. package/dist/src/security/scanner/patterns.d.ts.map +1 -1
  183. package/dist/src/security/scanner/patterns.js +25 -61
  184. package/dist/src/security/scanner/patterns.js.map +1 -1
  185. package/dist/src/security/scanner/patterns.sensitive-path.d.ts +45 -0
  186. package/dist/src/security/scanner/patterns.sensitive-path.d.ts.map +1 -0
  187. package/dist/src/security/scanner/patterns.sensitive-path.js +137 -0
  188. package/dist/src/security/scanner/patterns.sensitive-path.js.map +1 -0
  189. package/dist/src/security/scanner/regex-utils.d.ts +31 -17
  190. package/dist/src/security/scanner/regex-utils.d.ts.map +1 -1
  191. package/dist/src/security/scanner/regex-utils.js +31 -17
  192. package/dist/src/security/scanner/regex-utils.js.map +1 -1
  193. package/dist/src/security/scanner/types.d.ts +9 -0
  194. package/dist/src/security/scanner/types.d.ts.map +1 -1
  195. package/dist/src/services/SubagentGenerator.client-profiles.d.ts +258 -0
  196. package/dist/src/services/SubagentGenerator.client-profiles.d.ts.map +1 -0
  197. package/dist/src/services/SubagentGenerator.client-profiles.js +260 -0
  198. package/dist/src/services/SubagentGenerator.client-profiles.js.map +1 -0
  199. package/dist/src/services/SubagentGenerator.d.ts +19 -41
  200. package/dist/src/services/SubagentGenerator.d.ts.map +1 -1
  201. package/dist/src/services/SubagentGenerator.helpers.d.ts +64 -0
  202. package/dist/src/services/SubagentGenerator.helpers.d.ts.map +1 -0
  203. package/dist/src/services/SubagentGenerator.helpers.js +228 -0
  204. package/dist/src/services/SubagentGenerator.helpers.js.map +1 -0
  205. package/dist/src/services/SubagentGenerator.js +66 -208
  206. package/dist/src/services/SubagentGenerator.js.map +1 -1
  207. package/dist/src/services/SubagentGenerator.types.d.ts +45 -0
  208. package/dist/src/services/SubagentGenerator.types.d.ts.map +1 -0
  209. package/dist/src/services/SubagentGenerator.types.js +14 -0
  210. package/dist/src/services/SubagentGenerator.types.js.map +1 -0
  211. package/dist/src/services/TransformationService.d.ts +18 -61
  212. package/dist/src/services/TransformationService.d.ts.map +1 -1
  213. package/dist/src/services/TransformationService.js +29 -17
  214. package/dist/src/services/TransformationService.js.map +1 -1
  215. package/dist/src/services/TransformationService.types.d.ts +74 -0
  216. package/dist/src/services/TransformationService.types.d.ts.map +1 -0
  217. package/dist/src/services/TransformationService.types.js +8 -0
  218. package/dist/src/services/TransformationService.types.js.map +1 -0
  219. package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.d.ts +5 -0
  220. package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.d.ts.map +1 -0
  221. package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.js +72 -0
  222. package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.js.map +1 -0
  223. package/dist/src/services/__tests__/SubagentGenerator.helpers.test.d.ts +2 -0
  224. package/dist/src/services/__tests__/SubagentGenerator.helpers.test.d.ts.map +1 -0
  225. package/dist/src/services/__tests__/SubagentGenerator.helpers.test.js +61 -0
  226. package/dist/src/services/__tests__/SubagentGenerator.helpers.test.js.map +1 -0
  227. package/dist/src/services/__tests__/SubagentGenerator.test.js +155 -0
  228. package/dist/src/services/__tests__/SubagentGenerator.test.js.map +1 -1
  229. package/dist/src/services/__tests__/TransformationService.test.js +48 -0
  230. package/dist/src/services/__tests__/TransformationService.test.js.map +1 -1
  231. package/dist/src/services/agent-pack/agent-pack.test.js +1 -0
  232. package/dist/src/services/agent-pack/agent-pack.test.js.map +1 -1
  233. package/dist/src/services/agent-pack/prompt-source.d.ts +1 -1
  234. package/dist/src/services/agent-pack/prompt-source.d.ts.map +1 -1
  235. package/dist/src/services/agent-pack/prompt-source.js +10 -3
  236. package/dist/src/services/agent-pack/prompt-source.js.map +1 -1
  237. package/dist/src/services/agent-pack/types.d.ts +26 -2
  238. package/dist/src/services/agent-pack/types.d.ts.map +1 -1
  239. package/dist/src/services/agent-pack/types.js +13 -0
  240. package/dist/src/services/agent-pack/types.js.map +1 -1
  241. package/dist/src/services/agent-tool-profile.d.ts.map +1 -1
  242. package/dist/src/services/agent-tool-profile.js +7 -0
  243. package/dist/src/services/agent-tool-profile.js.map +1 -1
  244. package/dist/src/services/agent-tool-profile.test.js +2 -2
  245. package/dist/src/services/skill-content-comparison.d.ts +71 -0
  246. package/dist/src/services/skill-content-comparison.d.ts.map +1 -0
  247. package/dist/src/services/skill-content-comparison.js +90 -0
  248. package/dist/src/services/skill-content-comparison.js.map +1 -0
  249. package/dist/src/services/skill-content-comparison.test.d.ts +6 -0
  250. package/dist/src/services/skill-content-comparison.test.d.ts.map +1 -0
  251. package/dist/src/services/skill-content-comparison.test.js +83 -0
  252. package/dist/src/services/skill-content-comparison.test.js.map +1 -0
  253. package/dist/src/services/skill-identity-classification.d.ts +202 -0
  254. package/dist/src/services/skill-identity-classification.d.ts.map +1 -0
  255. package/dist/src/services/skill-identity-classification.js +295 -0
  256. package/dist/src/services/skill-identity-classification.js.map +1 -0
  257. package/dist/src/services/skill-identity-classification.test.d.ts +6 -0
  258. package/dist/src/services/skill-identity-classification.test.d.ts.map +1 -0
  259. package/dist/src/services/skill-identity-classification.test.js +314 -0
  260. package/dist/src/services/skill-identity-classification.test.js.map +1 -0
  261. package/dist/src/services/skill-installation.content.d.ts.map +1 -1
  262. package/dist/src/services/skill-installation.content.js +6 -1
  263. package/dist/src/services/skill-installation.content.js.map +1 -1
  264. package/dist/src/services/skill-installation.helpers.d.ts +8 -15
  265. package/dist/src/services/skill-installation.helpers.d.ts.map +1 -1
  266. package/dist/src/services/skill-installation.helpers.js +11 -105
  267. package/dist/src/services/skill-installation.helpers.js.map +1 -1
  268. package/dist/src/services/skill-installation.helpers.test.js +106 -1
  269. package/dist/src/services/skill-installation.helpers.test.js.map +1 -1
  270. package/dist/src/services/skill-installation.service.js +1 -1
  271. package/dist/src/services/skill-installation.service.js.map +1 -1
  272. package/dist/src/services/skill-installation.types.d.ts +33 -0
  273. package/dist/src/services/skill-installation.types.d.ts.map +1 -1
  274. package/dist/src/services/skill-installation.types.js.map +1 -1
  275. package/dist/src/services/skill-installation.uninstall.d.ts +84 -0
  276. package/dist/src/services/skill-installation.uninstall.d.ts.map +1 -0
  277. package/dist/src/services/skill-installation.uninstall.js +252 -0
  278. package/dist/src/services/skill-installation.uninstall.js.map +1 -0
  279. package/dist/src/services/skill-manifest.d.ts +41 -0
  280. package/dist/src/services/skill-manifest.d.ts.map +1 -1
  281. package/dist/src/services/skill-manifest.js +93 -0
  282. package/dist/src/services/skill-manifest.js.map +1 -1
  283. package/dist/src/services/skill-manifest.test.js +27 -0
  284. package/dist/src/services/skill-manifest.test.js.map +1 -1
  285. package/dist/src/sync/SyncEngine.d.ts.map +1 -1
  286. package/dist/src/sync/SyncEngine.js +69 -77
  287. package/dist/src/sync/SyncEngine.js.map +1 -1
  288. package/dist/src/telemetry/agent-marker.d.ts +8 -0
  289. package/dist/src/telemetry/agent-marker.d.ts.map +1 -1
  290. package/dist/src/telemetry/agent-marker.js +7 -0
  291. package/dist/src/telemetry/agent-marker.js.map +1 -1
  292. package/dist/src/telemetry/agent-marker.test.js +7 -1
  293. package/dist/src/telemetry/agent-marker.test.js.map +1 -1
  294. package/dist/src/telemetry/index.d.ts +1 -1
  295. package/dist/src/telemetry/index.d.ts.map +1 -1
  296. package/dist/src/telemetry/index.js +1 -1
  297. package/dist/src/telemetry/index.js.map +1 -1
  298. package/dist/src/telemetry/wrap.d.ts +6 -0
  299. package/dist/src/telemetry/wrap.d.ts.map +1 -1
  300. package/dist/src/telemetry/wrap.js +65 -10
  301. package/dist/src/telemetry/wrap.js.map +1 -1
  302. package/dist/src/telemetry/wrap.test.js +81 -1
  303. package/dist/src/telemetry/wrap.test.js.map +1 -1
  304. package/dist/src/telemetry/wrap.tool-call-sink.test.d.ts +26 -0
  305. package/dist/src/telemetry/wrap.tool-call-sink.test.d.ts.map +1 -0
  306. package/dist/src/telemetry/wrap.tool-call-sink.test.js +162 -0
  307. package/dist/src/telemetry/wrap.tool-call-sink.test.js.map +1 -0
  308. package/dist/src/types/skill.d.ts +9 -1
  309. package/dist/src/types/skill.d.ts.map +1 -1
  310. package/dist/src/utils/index.d.ts +2 -1
  311. package/dist/src/utils/index.d.ts.map +1 -1
  312. package/dist/src/utils/index.js +3 -1
  313. package/dist/src/utils/index.js.map +1 -1
  314. package/dist/src/utils/skill-name.d.ts +19 -0
  315. package/dist/src/utils/skill-name.d.ts.map +1 -0
  316. package/dist/src/utils/skill-name.js +26 -0
  317. package/dist/src/utils/skill-name.js.map +1 -0
  318. package/dist/src/utils/skill-name.test.d.ts +2 -0
  319. package/dist/src/utils/skill-name.test.d.ts.map +1 -0
  320. package/dist/src/utils/skill-name.test.js +34 -0
  321. package/dist/src/utils/skill-name.test.js.map +1 -0
  322. package/dist/src/utils/version-check.d.ts +61 -0
  323. package/dist/src/utils/version-check.d.ts.map +1 -1
  324. package/dist/src/utils/version-check.js +78 -1
  325. package/dist/src/utils/version-check.js.map +1 -1
  326. package/dist/src/utils/version-check.test.js +130 -1
  327. package/dist/src/utils/version-check.test.js.map +1 -1
  328. package/dist/tests/db/migration-runner-race.test.js +19 -9
  329. package/dist/tests/db/migration-runner-race.test.js.map +1 -1
  330. package/dist/tests/install/fan-out.test.js +27 -0
  331. package/dist/tests/install/fan-out.test.js.map +1 -1
  332. package/dist/tests/security/ContinuousSecurity.performance.test.js +12 -7
  333. package/dist/tests/security/ContinuousSecurity.performance.test.js.map +1 -1
  334. package/dist/tests/security/ContinuousSecurity.test.js +14 -2
  335. package/dist/tests/security/ContinuousSecurity.test.js.map +1 -1
  336. package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts +10 -12
  337. package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts.map +1 -1
  338. package/dist/tests/security/ai-defence-multiline-promotion.test.js +26 -33
  339. package/dist/tests/security/ai-defence-multiline-promotion.test.js.map +1 -1
  340. package/dist/tests/security/nested-instruction-long-attribute.test.js +20 -10
  341. package/dist/tests/security/nested-instruction-long-attribute.test.js.map +1 -1
  342. package/dist/tests/security/scanner-evidence-tiers.test.js +15 -0
  343. package/dist/tests/security/scanner-evidence-tiers.test.js.map +1 -1
  344. package/dist/tests/security/scanner-multiline-cap.test.d.ts +21 -0
  345. package/dist/tests/security/scanner-multiline-cap.test.d.ts.map +1 -0
  346. package/dist/tests/security/scanner-multiline-cap.test.js +152 -0
  347. package/dist/tests/security/scanner-multiline-cap.test.js.map +1 -0
  348. package/dist/tests/security/scanner-regression-guard.test.js +37 -0
  349. package/dist/tests/security/scanner-regression-guard.test.js.map +1 -1
  350. package/dist/tests/security/scanner-witness-sw1.test.d.ts +32 -0
  351. package/dist/tests/security/scanner-witness-sw1.test.d.ts.map +1 -0
  352. package/dist/tests/security/scanner-witness-sw1.test.js +255 -0
  353. package/dist/tests/security/scanner-witness-sw1.test.js.map +1 -0
  354. package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts +2 -0
  355. package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts.map +1 -0
  356. package/dist/tests/security/sensitive-path-adversarial-review.test.js +193 -0
  357. package/dist/tests/security/sensitive-path-adversarial-review.test.js.map +1 -0
  358. package/dist/tests/security/sensitive-path-fp.test.js +248 -0
  359. package/dist/tests/security/sensitive-path-fp.test.js.map +1 -1
  360. package/dist/tests/security/smi5879-corroboration.core.test.js +44 -0
  361. package/dist/tests/security/smi5879-corroboration.core.test.js.map +1 -1
  362. package/dist/tests/security/weak-password-lexicon.test.d.ts +18 -0
  363. package/dist/tests/security/weak-password-lexicon.test.d.ts.map +1 -0
  364. package/dist/tests/security/weak-password-lexicon.test.js +122 -0
  365. package/dist/tests/security/weak-password-lexicon.test.js.map +1 -0
  366. package/dist/tests/skill-scanner/allowlist.test.js +58 -4
  367. package/dist/tests/skill-scanner/allowlist.test.js.map +1 -1
  368. package/dist/tests/skill-scanner/categorizer.test.d.ts +2 -0
  369. package/dist/tests/skill-scanner/categorizer.test.d.ts.map +1 -0
  370. package/dist/tests/skill-scanner/categorizer.test.js +71 -0
  371. package/dist/tests/skill-scanner/categorizer.test.js.map +1 -0
  372. package/dist/tests/skill-scanner/cli-guard.test.d.ts +23 -0
  373. package/dist/tests/skill-scanner/cli-guard.test.d.ts.map +1 -0
  374. package/dist/tests/skill-scanner/cli-guard.test.js +71 -0
  375. package/dist/tests/skill-scanner/cli-guard.test.js.map +1 -0
  376. package/dist/tests/sync/SyncEngine.abort.test.js +15 -11
  377. package/dist/tests/sync/SyncEngine.abort.test.js.map +1 -1
  378. package/dist/tests/sync/SyncEngine.status.test.js +1 -1
  379. package/dist/tests/sync/SyncEngine.status.test.js.map +1 -1
  380. package/dist/tests/sync/SyncEngine.test.d.ts +11 -2
  381. package/dist/tests/sync/SyncEngine.test.d.ts.map +1 -1
  382. package/dist/tests/sync/SyncEngine.test.js +164 -13
  383. package/dist/tests/sync/SyncEngine.test.js.map +1 -1
  384. package/dist/tests/unit/migrations/migration-v18.test.d.ts +16 -0
  385. package/dist/tests/unit/migrations/migration-v18.test.d.ts.map +1 -0
  386. package/dist/tests/unit/migrations/migration-v18.test.js +192 -0
  387. package/dist/tests/unit/migrations/migration-v18.test.js.map +1 -0
  388. package/dist/tests/unit/services/skill-installation.content.test.js +101 -1
  389. package/dist/tests/unit/services/skill-installation.content.test.js.map +1 -1
  390. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts +29 -0
  391. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts.map +1 -0
  392. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js +200 -0
  393. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js.map +1 -0
  394. package/dist/tests/unit/services/skill-installation.service.test.js +9 -8
  395. package/dist/tests/unit/services/skill-installation.service.test.js.map +1 -1
  396. package/dist/tests/unit/sync-engine.source-aware.test.js +5 -5
  397. package/dist/tests/unit/sync-engine.source-aware.test.js.map +1 -1
  398. package/package.json +7 -2
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Security Scanner Patterns — the `sensitive_path` family
3
+ * @module @skillsmith/core/security/scanner/patterns.sensitive-path
4
+ *
5
+ * SMI-5207: extracted from patterns.ts, which sat 18 lines under the repo's
6
+ * 500-line pre-commit gate (scripts/check-file-length.mjs) before this wave —
7
+ * not enough headroom for the 12 hoisted pattern consts plus the two new
8
+ * severity-gate classification sets below (~42 lines). Same
9
+ * move-the-family-then-re-export convention already used twice in patterns.ts
10
+ * (patterns.jailbreak.ts, SMI-5876; patterns.exec.ts, SMI-6033 Wave 4).
11
+ *
12
+ * Every symbol here is re-exported unchanged from patterns.ts, so every
13
+ * existing import path keeps working AND reference identity is preserved —
14
+ * load-bearing, because scanSensitivePaths() classifies patterns by reference
15
+ * (`pattern === ENV_PATH_PATTERN`, `VALUE_GATED_KEYWORD_PATTERNS.has(pattern)`,
16
+ * and now `PATH_FORM_PATTERNS.has(pattern)` /
17
+ * `VALUE_GATED_ASSIGNMENT_PATTERNS.has(pattern)`).
18
+ *
19
+ * NOTE: a change to SENSITIVE_PATH_PATTERNS or to the severity classification
20
+ * below requires bumping SCANNER_RULESET_VERSION in patterns.ts — see that
21
+ * constant's own doc comment.
22
+ */
23
+ // Sensitive file path patterns
24
+ // SMI-4396 Wave 2: bare-keyword variants (credentials, secrets?, password) tightened
25
+ // to require assignment/path/file-extension context. Without this tuning,
26
+ // documentation keywords in SKILL.md frontmatter and prose (1Password integration
27
+ // guides, security-research skill domain vocabulary) tripped HIGH severity.
28
+ //
29
+ // SMI-5359 Wave 4 — FP-narrowing for two over-firing entries (severity policy lives
30
+ // in scanSensitivePaths so the array length / regression-guard baseline is unchanged):
31
+ // MF-1: bare /api[_-]?key/i & /auth[_-]?token/i fired HIGH on ANY substring —
32
+ // benign prose ("set your api_key in the dashboard"), `export API_KEY=$1`, and
33
+ // `apiKey: <YOUR_KEY>` placeholders. They are now VALUE-GATED: HIGH only when the
34
+ // line assigns a real (non-placeholder, sufficiently-entropic) secret. The
35
+ // value-BEARING leak is already caught at PII (PII_PATTERNS[0/2]); the
36
+ // credential-in-an-outbound-curl exfil is caught by DATA_EXFILTRATION_PATTERNS
37
+ // (the `$API_KEY`-in-a-fetched-URL pattern added there). See
38
+ // VALUE_GATED_KEYWORD_PATTERNS.
39
+ // MF-2: lone /\.env/i fired HIGH on every `.env` mention AND on the benign committed
40
+ // family (.envrc, .env.example/.sample/.template/.schema/.dist). ENV_PATH_PATTERN
41
+ // negative-lookaheads exclude that family; scanSensitivePaths downgrades a LONE
42
+ // `.env` to MEDIUM and keeps HIGH when it co-occurs with a read/exfil verb or
43
+ // shell pipe/redirect (`cat .env | curl ...`).
44
+ //
45
+ // SMI-5207 — the remaining 12 entries got the same treatment the two MF-1 keywords
46
+ // and the MF-2 `.env` entry already had: severity is now context-gated rather than
47
+ // unconditionally HIGH. MF-3 covers the 9 path-form entries (action verb or shell
48
+ // operator within +/-1 line), MF-4 the 3 keyword-assignment entries (HIGH unless the
49
+ // assigned value positively reads as prose). Both gates live in
50
+ // SecurityScanner.scanners.ts; this module only supplies the classification.
51
+ // MF-2: `.env` as a real env-file reference. Excludes `.envrc` (direnv config) and the
52
+ // committed placeholder family (.env.example/.sample/.template/.schema/.dist). The
53
+ // `(?![A-Za-z])` guard also drops the `.environment`/`.envision` English-word FP while
54
+ // still matching real variants like `.env`, `.env.local`, `.env.production`.
55
+ export const ENV_PATH_PATTERN = /\.env(?![A-Za-z])(?!\.(?:example|sample|template|schema|dist))/i;
56
+ // MF-1: bare credential keywords — value-gated in scanSensitivePaths, never standalone HIGH.
57
+ const API_KEY_KEYWORD = /api[_-]?key/i;
58
+ const AUTH_TOKEN_KEYWORD = /auth[_-]?token/i;
59
+ // SMI-5207: the 12 non-`.env` entries are hoisted from inline array literals to named
60
+ // consts so scanSensitivePaths can classify each by severity gate BY REFERENCE. The
61
+ // array's contents, order, and length (15) are unchanged — the regression-guard floor
62
+ // (scanner-regression-guard.test.ts) still holds.
63
+ // Contextual credentials: filename or assignment, not bare prose
64
+ const CREDENTIALS_FILE_PATTERN = /credentials\.(?:json|ya?ml|env|toml|txt)/i;
65
+ const CREDENTIALS_ASSIGN_PATTERN = /credentials\s*[:=]/i;
66
+ // Contextual secrets: assignment or path, not bare word
67
+ const SECRETS_ASSIGN_PATTERN = /\bsecrets?\s*[:=]/i;
68
+ const SECRETS_PATH_PATTERN = /\bsecrets?\/[a-z0-9_.-]+/i;
69
+ const PEM_PATTERN = /\.pem$/i;
70
+ const KEY_FILE_PATTERN = /\.key$/i;
71
+ const CRT_PATTERN = /\.crt$/i;
72
+ // Contextual password: assignment or URL (postgres://user:pass@host) only
73
+ const PASSWORD_ASSIGN_PATTERN = /password\s*[:=]/i;
74
+ const SSH_DIR_PATTERN = /~\/\.ssh/i;
75
+ const AWS_DIR_PATTERN = /~\/\.aws/i;
76
+ const CONFIG_DIR_PATTERN = /~\/\.config/i;
77
+ // SMI-4396 Wave 2: explicit system-file paths. Added so that tightening
78
+ // bare /credentials/i and /password/i into assignment-context variants
79
+ // doesn't drop coverage of obvious sensitive references like /etc/passwd.
80
+ const ETC_SYSTEM_FILE_PATTERN = /\/etc\/(?:passwd|shadow|sudoers|hosts)\b/i;
81
+ export const SENSITIVE_PATH_PATTERNS = [
82
+ ENV_PATH_PATTERN,
83
+ CREDENTIALS_FILE_PATTERN,
84
+ CREDENTIALS_ASSIGN_PATTERN,
85
+ SECRETS_ASSIGN_PATTERN,
86
+ SECRETS_PATH_PATTERN,
87
+ PEM_PATTERN,
88
+ KEY_FILE_PATTERN,
89
+ CRT_PATTERN,
90
+ PASSWORD_ASSIGN_PATTERN,
91
+ API_KEY_KEYWORD,
92
+ AUTH_TOKEN_KEYWORD,
93
+ SSH_DIR_PATTERN,
94
+ AWS_DIR_PATTERN,
95
+ CONFIG_DIR_PATTERN,
96
+ ETC_SYSTEM_FILE_PATTERN,
97
+ ];
98
+ // MF-1: the two bare-keyword patterns above emit HIGH only when accompanied by a real
99
+ // assigned secret value; scanSensitivePaths suppresses an otherwise-bare match.
100
+ export const VALUE_GATED_KEYWORD_PATTERNS = new Set([
101
+ API_KEY_KEYWORD,
102
+ AUTH_TOKEN_KEYWORD,
103
+ ]);
104
+ /**
105
+ * SMI-5207 (MF-3): the 9 path/filename-form entries. HIGH only when an action
106
+ * verb or shell operator appears within +/-1 line of the match; otherwise
107
+ * MEDIUM — a bare path *mention* is the common case, so evidence is required
108
+ * to escalate. See scanSensitivePaths' hasPathActionContext().
109
+ */
110
+ export const PATH_FORM_PATTERNS = new Set([
111
+ CREDENTIALS_FILE_PATTERN,
112
+ SECRETS_PATH_PATTERN,
113
+ PEM_PATTERN,
114
+ KEY_FILE_PATTERN,
115
+ CRT_PATTERN,
116
+ SSH_DIR_PATTERN,
117
+ AWS_DIR_PATTERN,
118
+ CONFIG_DIR_PATTERN,
119
+ ETC_SYSTEM_FILE_PATTERN,
120
+ ]);
121
+ /**
122
+ * SMI-5207 (MF-4): the 3 keyword-assignment entries. HIGH BY DEFAULT —
123
+ * `keyword: value` is a syntactic credential-assignment shape, rare in
124
+ * innocent prose — downgraded to MEDIUM only on positive prose evidence about
125
+ * the assigned value. See scanSensitivePaths' assignmentHasRealValue().
126
+ *
127
+ * Partition check (guarded by a dedicated test): 1 (ENV) + 9 (PATH_FORM) +
128
+ * 3 (ASSIGNMENT) + 2 (VALUE_GATED_KEYWORD) = 15, total and disjoint. An
129
+ * unclassified future pattern falls through to scanSensitivePaths' fail-CLOSED
130
+ * `else` branch and stays HIGH.
131
+ */
132
+ export const VALUE_GATED_ASSIGNMENT_PATTERNS = new Set([
133
+ CREDENTIALS_ASSIGN_PATTERN,
134
+ SECRETS_ASSIGN_PATTERN,
135
+ PASSWORD_ASSIGN_PATTERN,
136
+ ]);
137
+ //# sourceMappingURL=patterns.sensitive-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns.sensitive-path.js","sourceRoot":"","sources":["../../../../src/security/scanner/patterns.sensitive-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+BAA+B;AAC/B,qFAAqF;AACrF,0EAA0E;AAC1E,kFAAkF;AAClF,4EAA4E;AAC5E,EAAE;AACF,oFAAoF;AACpF,uFAAuF;AACvF,gFAAgF;AAChF,mFAAmF;AACnF,sFAAsF;AACtF,+EAA+E;AAC/E,2EAA2E;AAC3E,mFAAmF;AACnF,iEAAiE;AACjE,oCAAoC;AACpC,uFAAuF;AACvF,sFAAsF;AACtF,oFAAoF;AACpF,kFAAkF;AAClF,mDAAmD;AACnD,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,kFAAkF;AAClF,qFAAqF;AACrF,gEAAgE;AAChE,6EAA6E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M,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,wBAAwB;IACxB,oBAAoB;IACpB,WAAW;IACX,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,uBAAuB;CACxB,CAAC,CAAA;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAwB,IAAI,GAAG,CAAC;IAC1E,0BAA0B;IAC1B,sBAAsB;IACtB,uBAAuB;CACxB,CAAC,CAAA"}
@@ -11,25 +11,39 @@
11
11
  */
12
12
  export declare const MAX_LINE_LENGTH_FOR_REGEX = 10000;
13
13
  /**
14
- * SMI-5881: Cap for the FULL-CONTENT (multiline "pass 1") regex scan, in
15
- * UTF-16 code units (JavaScript `string.length` — NOT bytes/code points; see
16
- * SecurityScanner.ts's content-length finding message).
14
+ * SMI-5879 (design §3.4): Cap for the FULL-CONTENT (multiline "pass 1") regex
15
+ * scan, in UTF-16 code units (JavaScript `string.length` — NOT bytes/code
16
+ * points; see SecurityScanner.ts's content-length finding message).
17
17
  *
18
- * Equal to MAX_LINE_LENGTH_FOR_REGEX today (both 10_000) but declared
19
- * separately because the two caps protect different scan passes (per-line vs
20
- * whole-document) and may need to diverge later. This is a ReDoS budget
21
- * input, not a free parameter — raising it requires first proving
22
- * AD_CRLF_INJECTION-class patterns stay linear at the new size. Measured
23
- * (SMI-5881): the fixed AD_CRLF_INJECTION pattern is already ~4x slower per
24
- * doubling of input size on some adversarial inputs at sizes past this cap,
25
- * extrapolating to unacceptable latency well before 1,000,000 so this cap
26
- * is NOT raised as part of SMI-5881 even though larger trust tiers allow a
27
- * much bigger `maxContentLength`. See SecurityScanner.ts's
28
- * `effectiveMultilineLimit` (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX,
29
- * maxContentLength)`) for how this interacts with the per-tier content-length
30
- * ceiling.
18
+ * SMI-5881 set this equal to MAX_LINE_LENGTH_FOR_REGEX (10,000) and declined
19
+ * to raise it, citing a doubling-based extrapolation from smaller inputs that
20
+ * projected "unacceptable latency well before 1,000,000" for
21
+ * AD_CRLF_INJECTION-class patterns. SMI-5879 independently re-measured
22
+ * directly at 1,000,000 (not extrapolated) across the 7 ported multiline
23
+ * patterns (AD_CRLF_INJECTION, AD_ROLE_MARKER_BARE, AD_HTML_COMMENT_VERB/NOUN,
24
+ * AD_DELIMITER_BARE, AD_AN2_ROLE_BODY_NEXT_LINE, JB_JS3A/JS3B) against
25
+ * per-pattern adversarial near-miss shapes (not just the CRLF-pair shape
26
+ * SMI-5881 used) and found linear scaling with a worst case of ~56ms at
27
+ * 1,000,000 chars (AD_HTML_COMMENT_NOUN, "repeated HTML-comment-open"
28
+ * near-miss) — confirmed still linear (not superlinear) up to 4,000,000
29
+ * chars (~145ms), comfortably under the section 7.3 250ms per-case budget.
30
+ * The prior extrapolation does not hold empirically at this exact size; the
31
+ * measured worst case has real headroom, just less than the ~78x this
32
+ * design doc's own (unverified) claim asserted. Raising this cap closes the
33
+ * 10 KB pass-1 truncation blind spot (design §3.4) — the edge's own
34
+ * MAX_SKILL_CONTENT_SIZE is 1,000,000 bytes, so pass 1 previously saw only
35
+ * the first 1% of a large SKILL.md.
36
+ *
37
+ * Still declared separately from MAX_LINE_LENGTH_FOR_REGEX because the two
38
+ * caps protect different scan passes (per-line vs whole-document) and may
39
+ * need to diverge again. See SecurityScanner.ts's `effectiveMultilineLimit`
40
+ * (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX, maxContentLength)`) for how this
41
+ * interacts with the per-tier content-length ceiling — a trust tier with a
42
+ * SMALLER configured `maxContentLength` still tightens the effective limit
43
+ * below this cap; none currently need MORE than this cap for the multiline
44
+ * pass specifically.
31
45
  */
32
- export declare const MAX_CONTENT_LENGTH_FOR_REGEX = 10000;
46
+ export declare const MAX_CONTENT_LENGTH_FOR_REGEX = 1000000;
33
47
  /**
34
48
  * SMI-882: Safe regex test with length limit
35
49
  * Applies input length limit before regex matching to prevent ReDoS attacks.
@@ -1 +1 @@
1
- {"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B,QAA4B,CAAA;AAErE;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,gBAAgB,GAAG,IAAI,CAIzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAIT"}
1
+ {"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,4BAA4B,UAAY,CAAA;AAErD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,gBAAgB,GAAG,IAAI,CAIzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAIT"}
@@ -11,25 +11,39 @@
11
11
  */
12
12
  export const MAX_LINE_LENGTH_FOR_REGEX = 10000;
13
13
  /**
14
- * SMI-5881: Cap for the FULL-CONTENT (multiline "pass 1") regex scan, in
15
- * UTF-16 code units (JavaScript `string.length` — NOT bytes/code points; see
16
- * SecurityScanner.ts's content-length finding message).
14
+ * SMI-5879 (design §3.4): Cap for the FULL-CONTENT (multiline "pass 1") regex
15
+ * scan, in UTF-16 code units (JavaScript `string.length` — NOT bytes/code
16
+ * points; see SecurityScanner.ts's content-length finding message).
17
17
  *
18
- * Equal to MAX_LINE_LENGTH_FOR_REGEX today (both 10_000) but declared
19
- * separately because the two caps protect different scan passes (per-line vs
20
- * whole-document) and may need to diverge later. This is a ReDoS budget
21
- * input, not a free parameter — raising it requires first proving
22
- * AD_CRLF_INJECTION-class patterns stay linear at the new size. Measured
23
- * (SMI-5881): the fixed AD_CRLF_INJECTION pattern is already ~4x slower per
24
- * doubling of input size on some adversarial inputs at sizes past this cap,
25
- * extrapolating to unacceptable latency well before 1,000,000 so this cap
26
- * is NOT raised as part of SMI-5881 even though larger trust tiers allow a
27
- * much bigger `maxContentLength`. See SecurityScanner.ts's
28
- * `effectiveMultilineLimit` (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX,
29
- * maxContentLength)`) for how this interacts with the per-tier content-length
30
- * ceiling.
18
+ * SMI-5881 set this equal to MAX_LINE_LENGTH_FOR_REGEX (10,000) and declined
19
+ * to raise it, citing a doubling-based extrapolation from smaller inputs that
20
+ * projected "unacceptable latency well before 1,000,000" for
21
+ * AD_CRLF_INJECTION-class patterns. SMI-5879 independently re-measured
22
+ * directly at 1,000,000 (not extrapolated) across the 7 ported multiline
23
+ * patterns (AD_CRLF_INJECTION, AD_ROLE_MARKER_BARE, AD_HTML_COMMENT_VERB/NOUN,
24
+ * AD_DELIMITER_BARE, AD_AN2_ROLE_BODY_NEXT_LINE, JB_JS3A/JS3B) against
25
+ * per-pattern adversarial near-miss shapes (not just the CRLF-pair shape
26
+ * SMI-5881 used) and found linear scaling with a worst case of ~56ms at
27
+ * 1,000,000 chars (AD_HTML_COMMENT_NOUN, "repeated HTML-comment-open"
28
+ * near-miss) — confirmed still linear (not superlinear) up to 4,000,000
29
+ * chars (~145ms), comfortably under the section 7.3 250ms per-case budget.
30
+ * The prior extrapolation does not hold empirically at this exact size; the
31
+ * measured worst case has real headroom, just less than the ~78x this
32
+ * design doc's own (unverified) claim asserted. Raising this cap closes the
33
+ * 10 KB pass-1 truncation blind spot (design §3.4) — the edge's own
34
+ * MAX_SKILL_CONTENT_SIZE is 1,000,000 bytes, so pass 1 previously saw only
35
+ * the first 1% of a large SKILL.md.
36
+ *
37
+ * Still declared separately from MAX_LINE_LENGTH_FOR_REGEX because the two
38
+ * caps protect different scan passes (per-line vs whole-document) and may
39
+ * need to diverge again. See SecurityScanner.ts's `effectiveMultilineLimit`
40
+ * (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX, maxContentLength)`) for how this
41
+ * interacts with the per-tier content-length ceiling — a trust tier with a
42
+ * SMALLER configured `maxContentLength` still tightens the effective limit
43
+ * below this cap; none currently need MORE than this cap for the multiline
44
+ * pass specifically.
31
45
  */
32
- export const MAX_CONTENT_LENGTH_FOR_REGEX = MAX_LINE_LENGTH_FOR_REGEX;
46
+ export const MAX_CONTENT_LENGTH_FOR_REGEX = 1_000_000;
33
47
  /**
34
48
  * SMI-882: Safe regex test with length limit
35
49
  * Applies input length limit before regex matching to prevent ReDoS attacks.
@@ -1 +1 @@
1
- {"version":3,"file":"regex-utils.js","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAyB,CAAA;AAErE;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAA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C,CAAC,KAAK,CAAA;IAC9E,OAAO,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC"}
@@ -117,6 +117,15 @@ export interface ScanReport {
117
117
  riskScore: number;
118
118
  /** Breakdown of risk score by category */
119
119
  riskBreakdown: RiskScoreBreakdown;
120
+ /**
121
+ * SMI-5879 (design §3.3.6): true when the jailbreak or ai_defence multiline
122
+ * pass hit its per-pattern iteration ceiling before exhausting matches on a
123
+ * pathological same-line-repetition input. NOT provably score-neutral — the
124
+ * write path must treat this scan as authoritative for RAISING a verdict
125
+ * only, never for lowering an existing quarantine. Absent/undefined is
126
+ * equivalent to `false` (not truncated) for gating purposes.
127
+ */
128
+ multilineTruncated?: boolean;
120
129
  }
121
130
  /**
122
131
  * Verdict returned by comparing two scans of the SAME skill to detect a
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,GACtB,YAAY,GACZ,MAAM,GACN,KAAK,GACL,gBAAgB,GAChB,sBAAsB,GACtB,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,CAAA;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,iBAAiB,C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ACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,SAAS,EAAE,IAAI,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,aAAa,EAAE,kBAAkB,CAAA;CAClC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;IAC5C,8EAA8E;IAC9E,WAAW,EAAE,eAAe,EAAE,CAAA;IAC9B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAA;IACjB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;CACpD"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,GACtB,YAAY,GACZ,MAAM,GACN,KAAK,GACL,gBAAgB,GAChB,sBAAsB,GACtB,WAAW,GACX,mBAAmB,GACnB,iBAAi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a,CAAC,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;CACpD"}
@@ -0,0 +1,258 @@
1
+ /**
2
+ * SMI-6276 (Wave 6 Step 1): per-client generation profile for companion
3
+ * subagent files (`SubagentGenerator.ts`).
4
+ *
5
+ * `SubagentGenerator.generateSubagentContent()` predates multi-client support
6
+ * entirely — it always emitted Claude-native tool names (`Read, Write, Bash,
7
+ * WebFetch, Grep, Glob, WebSearch`) plus a `model: <haiku|sonnet|opus>`
8
+ * frontmatter field, for every client `COMPANION_AGENT_TARGETS`
9
+ * (`../install/paths.ts`) writes a companion-agent file for — including
10
+ * clients whose own agent-definition format doesn't have a `tools:` or
11
+ * `model:` concept, has one with entirely different value semantics, or (a
12
+ * real, spec-documented failure mode for AntiGravity specifically — see
13
+ * below) can HANG the subagent process on an unmapped tool name.
14
+ *
15
+ * This module is the exhaustive per-client answer, keyed on `ClientId`
16
+ * (matching `COMPANION_AGENT_TARGETS`'s own key set, not the narrower
17
+ * `HarnessId` — every `ClientId` gets a companion-agent file written
18
+ * somewhere per `COMPANION_AGENT_TARGETS`, so every one needs a content
19
+ * decision here too). For each client:
20
+ *
21
+ * 1. Which frontmatter fields it accepts (`includeSkillsField`,
22
+ * `toolsPolicy`, `modelPolicy`, `extraFrontmatterLines`).
23
+ * 2. Its tool-identifier vocabulary and value SHAPE — `'claude-native'`
24
+ * (Skillsmith's internal tool names ARE that client's own names, emitted
25
+ * as a comma-separated scalar, no translation needed), `'mapped-array'`
26
+ * (the client has its OWN, confirmed-different tool vocabulary AND
27
+ * expects a YAML array rather than a scalar — translate through
28
+ * `toolNameMap`, silently drop any internal name with no confirmed
29
+ * mapping, and omit the field entirely if nothing maps), or `'omit'`
30
+ * (vocabulary not independently verified at all — never emit the field
31
+ * rather than guess a wrong value).
32
+ * 3. Its model-selection policy — `'claude-enum'` (accepts Claude's
33
+ * `haiku|sonnet|opus` values directly) or `'omit'` (either no `model:`
34
+ * concept at all, or one with value semantics that don't line up with
35
+ * Skillsmith's internal enum — including a DIFFERENT PROVIDER's own
36
+ * model-tier vocabulary, which is a family swap, not just a renaming).
37
+ *
38
+ * Confidence levels (style follows `../install/agent-harness-targets.ts`'s
39
+ * own header — HIGH/MEDIUM/LOW per client, dated citation, never asserted
40
+ * past what the citation actually supports):
41
+ *
42
+ * - **claude-code** — HIGH. Claude Code's own native subagent format
43
+ * (`.claude/agents/*.md`): `name`, `description`, `tools` (comma-separated
44
+ * Claude tool names), `model`. This is this repo's pre-existing behavior
45
+ * (unchanged by this wave) and matches `renderClaudeShim()`
46
+ * (`agent-pack/shims.ts`), which uses the identical `name`/`description`/
47
+ * `tools` frontmatter shape for the fixed named-agent shim.
48
+ * - **cursor** — HIGH, verified live against cursor.com/docs/subagents
49
+ * (fetched 2026-08-30): "Cursor recognizes subagent files across multiple
50
+ * directory formats: `.cursor/agents/` (Cursor format), `.claude/agents/`
51
+ * (Claude compatibility), `.codex/agents/` (Codex compatibility)."
52
+ * `COMPANION_AGENT_TARGETS.cursor` resolves to the SAME path as
53
+ * `claude-code` (`~/.claude/agents/<name>-specialist.md` — see that
54
+ * table's own comment: "Cursor 2.4+ reads `.claude/agents/` natively — no
55
+ * separate shim file"), so the file this generator actually writes for
56
+ * `--client cursor` is read by Cursor through that Claude-compatibility
57
+ * path and must carry genuine Claude-format frontmatter — this profile
58
+ * mirrors `claude-code`'s exactly (same object, not a coincidental
59
+ * duplicate). Cursor's OWN native `.cursor/agents/*.md` format is verified
60
+ * DIFFERENT (fields: `name`, `description`, `model` — values `inherit`,
61
+ * `fast`, or a hardcoded model ID, NOT Claude's `haiku|sonnet|opus` enum —
62
+ * `readonly`, `is_background`; explicitly NO `tools` field: "Subagents
63
+ * inherit all tools from the parent, including MCP tools from configured
64
+ * servers") but Skillsmith never writes to that native directory (no
65
+ * `.cursor/agents/` entry exists in `COMPANION_AGENT_TARGETS`), so that
66
+ * narrower native schema does not govern the file this generator produces.
67
+ * - **antigravity** — HIGH for the schema itself, verified live against
68
+ * `antigravity.google/docs/subagents/` (fetched 2026-08-30, cross-checked
69
+ * by an independent WebSearch and by Wayback snapshots bracketing
70
+ * 2026-08-06 through 2026-08-16 — see
71
+ * `docs/internal/implementation/smi-6276-subagent-true-antigravity-repro.md`
72
+ * for the full investigation, filed for the separate `subagent: true`
73
+ * question but covering this same schema). **Correction of SMI-5982's
74
+ * original sourcing**: that wave cited
75
+ * `antigravity.google/docs/cli/commands/agents` (the CLI `/agents` TUI
76
+ * command reference, whose example happens to show only `name`+
77
+ * `description`) as if it were the full schema. The real, richer schema
78
+ * lives at `/docs/subagents`: `name`, `description` (both required),
79
+ * `tools` (`string[]`, default `[]` — a YAML ARRAY, not a scalar, of
80
+ * AntiGravity's OWN tool names, e.g. `view_file`, `replace_file_content`,
81
+ * `grep_search`, `run_command` — confirmed DIFFERENT from Skillsmith's
82
+ * Claude-style names), `mainAgent`/`subagent` (booleans, both default
83
+ * `true` — the `subagent: true` question is Step 2's separate scope, not
84
+ * touched here), `model` (`inherit|flash|pro`, default `inherit` — NOT
85
+ * Claude's `haiku|sonnet|opus`), `commandExecutionPolicy`, `mcpServers`,
86
+ * `skills`/`plugins` (skill PATHS like `skills/my-helper-skill` — a
87
+ * DIFFERENT concept from Skillsmith's own `skills: <bare-name>` extension
88
+ * field below, not reused here for that reason).
89
+ *
90
+ * MEDIUM for the specific tool-name MAPPING used here: the docs page only
91
+ * gives 4 example tool names (not a complete enumeration), so
92
+ * `toolNameMap` below covers only those 4, mapped by clear name
93
+ * correspondence (`view_file`→Read, `replace_file_content`→Write/Edit,
94
+ * `grep_search`→Grep, `run_command`→Bash); Skillsmith's `Glob`, `WebFetch`,
95
+ * and `WebSearch` have no confirmed AntiGravity equivalent and are
96
+ * silently dropped, never guessed. This is deliberately a `'mapped-array'`
97
+ * policy rather than `'omit'`, unlike every other unverified-vocabulary
98
+ * client in this table: AntiGravity's own schema documents `tools`
99
+ * defaulting to `[]` (empty) when omitted — the OPPOSITE of Cursor's
100
+ * "inherits from parent" or Copilot's "all tools available" defaults — so
101
+ * omitting the field here would ship a companion subagent with literally
102
+ * ZERO tool access, not a harmlessly-permissive default. A confidently-cited
103
+ * partial mapping is more correct than that, and strictly safer than
104
+ * guessing at unconfirmed names: the same docs page's own "Known Issue
105
+ * (Tool Validation)" warns that "specifying an unmapped or misspelled tool
106
+ * name in the `tools` list may cause the subagent process to hang during
107
+ * execution" — every name emitted here is a name AntiGravity's own docs
108
+ * use as a worked example, never an invented one.
109
+ *
110
+ * `model:` is OMITTED for AntiGravity, not mapped — deliberately, not for
111
+ * lack of trying. AntiGravity's `flash`/`pro` are Gemini model tiers;
112
+ * Skillsmith's `haiku`/`sonnet`/`opus` are Claude model tiers. These are
113
+ * two DIFFERENT model families from two different vendors, not two
114
+ * spellings of the same capability scale — `haiku→flash` and `opus→pro`
115
+ * are plausible analogies, but `sonnet` (Skillsmith's own default "for
116
+ * balanced workloads", `determineModel()`) has no principled third rung to
117
+ * land on in a 2-tier scale, and no official source equates any Claude
118
+ * tier to any Gemini tier. Omitting the field uses AntiGravity's own
119
+ * documented default (`inherit` — defer to whatever tier the invoking
120
+ * session already uses), which is a real, working, spec-sanctioned value,
121
+ * not an absence of a decision.
122
+ * - **copilot** — MEDIUM, verified live against GitHub's own docs
123
+ * (docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/create-custom-agents,
124
+ * fetched 2026-08-30): `.agent.md` frontmatter DOES support a `tools` list
125
+ * (documented examples: `"read"`, `"edit"`, `"search"`) and a `model`
126
+ * field. NOT verified: a full mapping from Skillsmith's own 8-tool
127
+ * vocabulary (`Read`/`Write`/`Edit`/`Bash`/`Grep`/`Glob`/`WebFetch`/
128
+ * `WebSearch`) onto Copilot's identifier set — only 2-3 of the 8 have a
129
+ * plausible lowercase counterpart in the documented examples, with no
130
+ * confirmed equivalents for `Bash`/`Grep`/`Glob`/`WebFetch` specifically.
131
+ * Unlike AntiGravity, Copilot's own docs confirm omission is SAFE here —
132
+ * "Omitting tools grants access to all available tools — the default is
133
+ * permissive" — so, per this wave's fallback rule, omit `tools:` rather
134
+ * than emit a guessed-wrong partial mapping; the omission doesn't cripple
135
+ * the subagent the way it would for AntiGravity. `model:` is likewise
136
+ * omitted — its value format (Copilot's own model catalog IDs) has no
137
+ * confirmed correspondence to Skillsmith's internal `haiku|sonnet|opus`
138
+ * abstraction.
139
+ * - **opencode** — MEDIUM, verified live against opencode.ai/v2/docs/agents/
140
+ * (fetched 2026-08-30): confirmed frontmatter fields `description`, `mode`
141
+ * (`primary|subagent|all`), `model` (`provider/model#variant` format — NOT
142
+ * Claude's `haiku|sonnet|opus` enum), `color`, `steps`, `permissions`. This
143
+ * repo's own `renderOpenCodeShim()` (`agent-pack/shims.ts`) already
144
+ * documents the load-bearing fact this profile reuses: "OpenCode's
145
+ * frontmatter `tools` field is a permission map, not a plain list; setting
146
+ * it wrong would restrict tools rather than reference them" — same
147
+ * precedent applied here, omitting `tools:` rather than writing a
148
+ * Claude-shaped value into a boolean-permission-map field (a different,
149
+ * harder mapping problem than AntiGravity's plain array — not attempted in
150
+ * this wave). `mode: subagent` IS included (HIGH confidence for this one
151
+ * line specifically — mirrors the already-shipped `renderOpenCodeShim()`
152
+ * verbatim). `model:` omitted — no confirmed mapping from Skillsmith's
153
+ * internal enum to OpenCode's `provider/model` format.
154
+ * - **windsurf** — LOW. No independently confirmed per-subagent-file
155
+ * frontmatter schema for tool/model restriction was found; Windsurf's
156
+ * Cascade agent runtime is additionally documented as being retired (EOL
157
+ * 2026-07-01, superseded by Devin Local). Omit `tools:` and `model:`,
158
+ * matching this table's existing conservative default for windsurf
159
+ * (`COMPANION_AGENT_TARGETS.windsurf`'s own comment: "No
160
+ * `AGENT_SHIM_TARGETS` entry exists for windsurf ... defaults to today's
161
+ * actual behavior" — that comment covers the file PATH only; this module
162
+ * makes the equivalent conservative call for the file's CONTENT).
163
+ * - **agents** — LOW. This `ClientId` is the generic cross-agent /
164
+ * `AGENTS.md` convention (also Codex's install target — "Codex: reads
165
+ * ONLY `~/.agents/skills`", `../install/paths.ts`'s own header comment).
166
+ * The `AGENTS.md` standard itself has no required fields and no YAML
167
+ * frontmatter for its single project-instructions file (openai/codex's own
168
+ * `AGENTS.md`; agents.md spec) — there is no confirmed per-agent-definition
169
+ * file schema with tool/model fields for this identifier at all. Omit
170
+ * `tools:` and `model:`.
171
+ * - **hermes** — LOW. Hermes's own documented frontmatter
172
+ * (hermes-agent.nousresearch.com/docs/) is for SKILL files (`name`,
173
+ * `description`, `version`, `author`, `platforms`), not a separate
174
+ * subagent-definition schema with tool/model restriction fields. Omit
175
+ * `tools:` and `model:`.
176
+ * - **grok** — LOW. Grok Build (docs.x.ai/build/overview,
177
+ * github.com/xai-org/grok-build) confirms agent frontmatter EXISTS
178
+ * ("Subagents can declare their own `mcpServers` in agent frontmatter") but
179
+ * no built-in tool-identifier vocabulary or Claude-comparable model enum is
180
+ * documented. Omit `tools:` and `model:`.
181
+ *
182
+ * @see docs/internal/implementation/cursor-antigravity-tier-parity-plan.md (Wave 6 Step 1)
183
+ * @see docs/internal/implementation/smi-6276-subagent-true-antigravity-repro.md (AntiGravity schema source-of-truth)
184
+ */
185
+ import { type ClientId } from '../install/paths.js';
186
+ /**
187
+ * `'claude-native'` — Skillsmith's internal tool names (`Read`, `Write`,
188
+ * `Edit`, `Bash`, `Grep`, `Glob`, `WebFetch`, `WebSearch`) ARE this client's
189
+ * own tool-identifier vocabulary; emit `tools:` as a plain comma-separated
190
+ * scalar list, no translation needed.
191
+ *
192
+ * `'mapped-array'` — this client has its OWN, confirmed-different tool
193
+ * vocabulary AND expects `tools:` as a YAML array (not a scalar). Translate
194
+ * through the profile's `toolNameMap`; any internal name with no confirmed
195
+ * entry is silently dropped (never guessed), and the field is omitted
196
+ * entirely if the mapped result is empty.
197
+ *
198
+ * `'omit'` — this client's tool vocabulary (or its `tools:` field's VALUE
199
+ * shape) has not been independently verified to accept Skillsmith's internal
200
+ * names as-is, and omitting the field is either safe (permissive default,
201
+ * e.g. Copilot) or the only defensible choice given no evidence at all.
202
+ * Never emit a guessed-wrong value.
203
+ */
204
+ export type SubagentToolsPolicy = 'claude-native' | 'mapped-array' | 'omit';
205
+ /**
206
+ * `'claude-enum'` — this client accepts a `model:` field whose values are
207
+ * (or are compatible with) Skillsmith's internal `haiku|sonnet|opus` enum.
208
+ *
209
+ * `'omit'` — either no `model:` concept exists for this client, or its
210
+ * value semantics (a hardcoded model ID, a `provider/model` string, a
211
+ * different vendor's own model-tier vocabulary, an `inherit`/`fast`
212
+ * keyword, etc.) don't correspond to Skillsmith's internal enum. Omit the
213
+ * field rather than emit a value the client would reject, silently ignore,
214
+ * or (worse) apply as a real but wrong model selection.
215
+ */
216
+ export type SubagentModelPolicy = 'claude-enum' | 'omit';
217
+ /** Per-client shape of the generated companion-subagent file's frontmatter. */
218
+ export interface SubagentGenerationProfile {
219
+ /** How well-evidenced this profile's fields are (see module header). */
220
+ confidence: 'HIGH' | 'MEDIUM' | 'LOW';
221
+ /** One-line pointer to the citation backing this profile (see module header for the full text). */
222
+ citation: string;
223
+ /**
224
+ * Whether to emit Skillsmith's own `skills: <skill-name>` extension field
225
+ * (a Skillsmith convention — a bare skill name — not any external
226
+ * harness's own field of the same name, e.g. AntiGravity's `skills:`
227
+ * expects PATHS and is a different concept) — kept true only for clients
228
+ * this generator has always emitted it for.
229
+ */
230
+ includeSkillsField: boolean;
231
+ toolsPolicy: SubagentToolsPolicy;
232
+ /**
233
+ * Skillsmith-internal tool name -> this client's own tool identifier.
234
+ * Only present (and only meaningful) when `toolsPolicy === 'mapped-array'`.
235
+ * An internal name with no entry here is silently dropped, never guessed.
236
+ */
237
+ toolNameMap?: Readonly<Record<string, string>>;
238
+ modelPolicy: SubagentModelPolicy;
239
+ /**
240
+ * Static frontmatter lines specific to this client, appended after
241
+ * `tools:` (when present) and before `model:` (when present). Empty for
242
+ * every client except OpenCode's `mode: subagent`.
243
+ */
244
+ extraFrontmatterLines: readonly string[];
245
+ }
246
+ export declare const SUBAGENT_CLIENT_PROFILES: Readonly<Record<ClientId, SubagentGenerationProfile>>;
247
+ /** Resolve the per-client generation profile for `client` (default: canonical / claude-code). */
248
+ export declare function getSubagentGenerationProfile(client?: ClientId): SubagentGenerationProfile;
249
+ /**
250
+ * Translate Skillsmith-internal tool names through `profile.toolNameMap`,
251
+ * dropping any name with no confirmed entry and de-duplicating the result
252
+ * (two internal names can map to the same client tool, e.g. AntiGravity's
253
+ * `Write`/`Edit` -> `replace_file_content`). Returns `[]` when nothing maps
254
+ * — callers must omit the `tools:` field entirely in that case, not emit an
255
+ * empty array, per this module's own fallback philosophy.
256
+ */
257
+ export declare function mapToolNames(tools: readonly string[], profile: SubagentGenerationProfile): string[];
258
+ //# sourceMappingURL=SubagentGenerator.client-profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubagentGenerator.client-profiles.d.ts","sourceRoot":"","sources":["../../../src/services/SubagentGenerator.client-profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuLG;AAEH,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,cAAc,GAAG,MAAM,CAAA;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,MAAM,CAAA;AAExD,+EAA+E;AAC/E,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACrC,mGAAmG;IACnG,Q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