@skillsmith/core 0.4.0 → 0.4.2

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 (612) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/src/analysis/CodebaseAnalyzer.d.ts.map +1 -1
  3. package/dist/src/analysis/CodebaseAnalyzer.js.map +1 -1
  4. package/dist/src/analysis/adapters/__tests__/python.test.js.map +1 -1
  5. package/dist/src/analysis/adapters/java-parsers.d.ts +64 -0
  6. package/dist/src/analysis/adapters/java-parsers.d.ts.map +1 -0
  7. package/dist/src/analysis/adapters/java-parsers.js +114 -0
  8. package/dist/src/analysis/adapters/java-parsers.js.map +1 -0
  9. package/dist/src/analysis/adapters/java.d.ts +1 -51
  10. package/dist/src/analysis/adapters/java.d.ts.map +1 -1
  11. package/dist/src/analysis/adapters/java.js +94 -205
  12. package/dist/src/analysis/adapters/java.js.map +1 -1
  13. package/dist/src/analysis/adapters/python-frameworks.d.ts +21 -0
  14. package/dist/src/analysis/adapters/python-frameworks.d.ts.map +1 -0
  15. package/dist/src/analysis/adapters/python-frameworks.js +86 -0
  16. package/dist/src/analysis/adapters/python-frameworks.js.map +1 -0
  17. package/dist/src/analysis/adapters/python.d.ts +0 -50
  18. package/dist/src/analysis/adapters/python.d.ts.map +1 -1
  19. package/dist/src/analysis/adapters/python.js +5 -120
  20. package/dist/src/analysis/adapters/python.js.map +1 -1
  21. package/dist/src/analysis/adapters/rust-parsers.d.ts +33 -0
  22. package/dist/src/analysis/adapters/rust-parsers.d.ts.map +1 -0
  23. package/dist/src/analysis/adapters/rust-parsers.js +94 -0
  24. package/dist/src/analysis/adapters/rust-parsers.js.map +1 -0
  25. package/dist/src/analysis/adapters/rust.d.ts +1 -43
  26. package/dist/src/analysis/adapters/rust.d.ts.map +1 -1
  27. package/dist/src/analysis/adapters/rust.js +74 -173
  28. package/dist/src/analysis/adapters/rust.js.map +1 -1
  29. package/dist/src/analysis/language-detector.d.ts +4 -20
  30. package/dist/src/analysis/language-detector.d.ts.map +1 -1
  31. package/dist/src/analysis/language-detector.js +2 -399
  32. package/dist/src/analysis/language-detector.js.map +1 -1
  33. package/dist/src/analysis/language-detector.patterns.d.ts +17 -0
  34. package/dist/src/analysis/language-detector.patterns.d.ts.map +1 -0
  35. package/dist/src/analysis/language-detector.patterns.js +413 -0
  36. package/dist/src/analysis/language-detector.patterns.js.map +1 -0
  37. package/dist/src/analysis/language-detector.types.d.ts +48 -0
  38. package/dist/src/analysis/language-detector.types.d.ts.map +1 -0
  39. package/dist/src/analysis/language-detector.types.js +6 -0
  40. package/dist/src/analysis/language-detector.types.js.map +1 -0
  41. package/dist/src/analysis/metrics.d.ts +22 -219
  42. package/dist/src/analysis/metrics.d.ts.map +1 -1
  43. package/dist/src/analysis/metrics.implementations.d.ts +39 -0
  44. package/dist/src/analysis/metrics.implementations.d.ts.map +1 -0
  45. package/dist/src/analysis/metrics.implementations.js +114 -0
  46. package/dist/src/analysis/metrics.implementations.js.map +1 -0
  47. package/dist/src/analysis/metrics.js +21 -224
  48. package/dist/src/analysis/metrics.js.map +1 -1
  49. package/dist/src/analysis/metrics.types.d.ts +79 -0
  50. package/dist/src/analysis/metrics.types.d.ts.map +1 -0
  51. package/dist/src/analysis/metrics.types.js +6 -0
  52. package/dist/src/analysis/metrics.types.js.map +1 -0
  53. package/dist/src/analysis/worker-pool.d.ts +25 -52
  54. package/dist/src/analysis/worker-pool.d.ts.map +1 -1
  55. package/dist/src/analysis/worker-pool.js +29 -181
  56. package/dist/src/analysis/worker-pool.js.map +1 -1
  57. package/dist/src/analysis/worker-types.d.ts +64 -0
  58. package/dist/src/analysis/worker-types.d.ts.map +1 -0
  59. package/dist/src/analysis/worker-types.js +11 -0
  60. package/dist/src/analysis/worker-types.js.map +1 -0
  61. package/dist/src/analysis/worker-utils.d.ts +49 -0
  62. package/dist/src/analysis/worker-utils.d.ts.map +1 -0
  63. package/dist/src/analysis/worker-utils.js +206 -0
  64. package/dist/src/analysis/worker-utils.js.map +1 -0
  65. package/dist/src/analytics/AnalyticsRepository.d.ts +1 -5
  66. package/dist/src/analytics/AnalyticsRepository.d.ts.map +1 -1
  67. package/dist/src/analytics/AnalyticsRepository.helpers.d.ts +28 -0
  68. package/dist/src/analytics/AnalyticsRepository.helpers.d.ts.map +1 -0
  69. package/dist/src/analytics/AnalyticsRepository.helpers.js +90 -0
  70. package/dist/src/analytics/AnalyticsRepository.helpers.js.map +1 -0
  71. package/dist/src/analytics/AnalyticsRepository.js +16 -129
  72. package/dist/src/analytics/AnalyticsRepository.js.map +1 -1
  73. package/dist/src/analytics/AnalyticsRepository.types.d.ts +82 -0
  74. package/dist/src/analytics/AnalyticsRepository.types.d.ts.map +1 -0
  75. package/dist/src/analytics/AnalyticsRepository.types.js +8 -0
  76. package/dist/src/analytics/AnalyticsRepository.types.js.map +1 -0
  77. package/dist/src/analytics/ROIDashboardService.js +4 -2
  78. package/dist/src/analytics/ROIDashboardService.js.map +1 -1
  79. package/dist/src/api/cache.d.ts.map +1 -1
  80. package/dist/src/api/cache.js.map +1 -1
  81. package/dist/src/api/client.d.ts +6 -121
  82. package/dist/src/api/client.d.ts.map +1 -1
  83. package/dist/src/api/client.js +29 -129
  84. package/dist/src/api/client.js.map +1 -1
  85. package/dist/src/api/schemas.d.ts +122 -0
  86. package/dist/src/api/schemas.d.ts.map +1 -0
  87. package/dist/src/api/schemas.js +71 -0
  88. package/dist/src/api/schemas.js.map +1 -0
  89. package/dist/src/api/types.d.ts +1 -1
  90. package/dist/src/api/types.d.ts.map +1 -1
  91. package/dist/src/api/utils.d.ts +35 -0
  92. package/dist/src/api/utils.d.ts.map +1 -0
  93. package/dist/src/api/utils.js +86 -0
  94. package/dist/src/api/utils.js.map +1 -0
  95. package/dist/src/benchmarks/BenchmarkRunner.d.ts.map +1 -1
  96. package/dist/src/benchmarks/BenchmarkRunner.js +1 -1
  97. package/dist/src/benchmarks/BenchmarkRunner.js.map +1 -1
  98. package/dist/src/billing/BillingService.d.ts +15 -53
  99. package/dist/src/billing/BillingService.d.ts.map +1 -1
  100. package/dist/src/billing/BillingService.helpers.d.ts +15 -0
  101. package/dist/src/billing/BillingService.helpers.d.ts.map +1 -0
  102. package/dist/src/billing/BillingService.helpers.js +45 -0
  103. package/dist/src/billing/BillingService.helpers.js.map +1 -0
  104. package/dist/src/billing/BillingService.js +49 -179
  105. package/dist/src/billing/BillingService.js.map +1 -1
  106. package/dist/src/billing/BillingService.types.d.ts +52 -0
  107. package/dist/src/billing/BillingService.types.d.ts.map +1 -0
  108. package/dist/src/billing/BillingService.types.js +6 -0
  109. package/dist/src/billing/BillingService.types.js.map +1 -0
  110. package/dist/src/billing/GDPRComplianceService.d.ts +2 -97
  111. package/dist/src/billing/GDPRComplianceService.d.ts.map +1 -1
  112. package/dist/src/billing/GDPRComplianceService.js.map +1 -1
  113. package/dist/src/billing/StripeClient.d.ts +6 -64
  114. package/dist/src/billing/StripeClient.d.ts.map +1 -1
  115. package/dist/src/billing/StripeClient.js +14 -71
  116. package/dist/src/billing/StripeClient.js.map +1 -1
  117. package/dist/src/billing/StripeReconciliationJob.d.ts +2 -47
  118. package/dist/src/billing/StripeReconciliationJob.d.ts.map +1 -1
  119. package/dist/src/billing/StripeReconciliationJob.js +1 -41
  120. package/dist/src/billing/StripeReconciliationJob.js.map +1 -1
  121. package/dist/src/billing/StripeWebhookHandler.d.ts +3 -46
  122. package/dist/src/billing/StripeWebhookHandler.d.ts.map +1 -1
  123. package/dist/src/billing/StripeWebhookHandler.js +14 -261
  124. package/dist/src/billing/StripeWebhookHandler.js.map +1 -1
  125. package/dist/src/billing/gdpr-types.d.ts +103 -0
  126. package/dist/src/billing/gdpr-types.d.ts.map +1 -0
  127. package/dist/src/billing/gdpr-types.js +7 -0
  128. package/dist/src/billing/gdpr-types.js.map +1 -0
  129. package/dist/src/billing/reconciliation-helpers.d.ts +16 -0
  130. package/dist/src/billing/reconciliation-helpers.d.ts.map +1 -0
  131. package/dist/src/billing/reconciliation-helpers.js +53 -0
  132. package/dist/src/billing/reconciliation-helpers.js.map +1 -0
  133. package/dist/src/billing/reconciliation-types.d.ts +71 -0
  134. package/dist/src/billing/reconciliation-types.d.ts.map +1 -0
  135. package/dist/src/billing/reconciliation-types.js +7 -0
  136. package/dist/src/billing/reconciliation-types.js.map +1 -0
  137. package/dist/src/billing/stripe-client-types.d.ts +45 -0
  138. package/dist/src/billing/stripe-client-types.d.ts.map +1 -0
  139. package/dist/src/billing/stripe-client-types.js +7 -0
  140. package/dist/src/billing/stripe-client-types.js.map +1 -0
  141. package/dist/src/billing/stripe-helpers.d.ts +17 -0
  142. package/dist/src/billing/stripe-helpers.d.ts.map +1 -0
  143. package/dist/src/billing/stripe-helpers.js +50 -0
  144. package/dist/src/billing/stripe-helpers.js.map +1 -0
  145. package/dist/src/billing/webhook-handlers.d.ts +56 -0
  146. package/dist/src/billing/webhook-handlers.d.ts.map +1 -0
  147. package/dist/src/billing/webhook-handlers.js +303 -0
  148. package/dist/src/billing/webhook-handlers.js.map +1 -0
  149. package/dist/src/billing/webhook-types.d.ts +42 -0
  150. package/dist/src/billing/webhook-types.d.ts.map +1 -0
  151. package/dist/src/billing/webhook-types.js +7 -0
  152. package/dist/src/billing/webhook-types.js.map +1 -0
  153. package/dist/src/config/index.d.ts +118 -0
  154. package/dist/src/config/index.d.ts.map +1 -0
  155. package/dist/src/config/index.js +172 -0
  156. package/dist/src/config/index.js.map +1 -0
  157. package/dist/src/db/migration-types.d.ts +101 -0
  158. package/dist/src/db/migration-types.d.ts.map +1 -0
  159. package/dist/src/db/migration-types.js +6 -0
  160. package/dist/src/db/migration-types.js.map +1 -0
  161. package/dist/src/db/migration.d.ts +32 -0
  162. package/dist/src/db/migration.d.ts.map +1 -0
  163. package/dist/src/db/migration.js +239 -0
  164. package/dist/src/db/migration.js.map +1 -0
  165. package/dist/src/db/schema.d.ts +2 -2
  166. package/dist/src/db/schema.d.ts.map +1 -1
  167. package/dist/src/db/schema.js +23 -1
  168. package/dist/src/db/schema.js.map +1 -1
  169. package/dist/src/embeddings/embedding-types.d.ts +44 -0
  170. package/dist/src/embeddings/embedding-types.d.ts.map +1 -0
  171. package/dist/src/embeddings/embedding-types.js +6 -0
  172. package/dist/src/embeddings/embedding-types.js.map +1 -0
  173. package/dist/src/embeddings/embedding-utils.d.ts +42 -0
  174. package/dist/src/embeddings/embedding-utils.d.ts.map +1 -0
  175. package/dist/src/embeddings/embedding-utils.js +121 -0
  176. package/dist/src/embeddings/embedding-utils.js.map +1 -0
  177. package/dist/src/embeddings/hnsw-store.d.ts +8 -518
  178. package/dist/src/embeddings/hnsw-store.d.ts.map +1 -1
  179. package/dist/src/embeddings/hnsw-store.helpers.d.ts +83 -0
  180. package/dist/src/embeddings/hnsw-store.helpers.d.ts.map +1 -0
  181. package/dist/src/embeddings/hnsw-store.helpers.js +147 -0
  182. package/dist/src/embeddings/hnsw-store.helpers.js.map +1 -0
  183. package/dist/src/embeddings/hnsw-store.js +66 -517
  184. package/dist/src/embeddings/hnsw-store.js.map +1 -1
  185. package/dist/src/embeddings/hnsw-store.types.d.ts +154 -0
  186. package/dist/src/embeddings/hnsw-store.types.d.ts.map +1 -0
  187. package/dist/src/embeddings/hnsw-store.types.js +26 -0
  188. package/dist/src/embeddings/hnsw-store.types.js.map +1 -0
  189. package/dist/src/embeddings/index.d.ts +36 -112
  190. package/dist/src/embeddings/index.d.ts.map +1 -1
  191. package/dist/src/embeddings/index.js +37 -210
  192. package/dist/src/embeddings/index.js.map +1 -1
  193. package/dist/src/errors.d.ts.map +1 -1
  194. package/dist/src/errors.js +1 -1
  195. package/dist/src/errors.js.map +1 -1
  196. package/dist/src/exports/repositories.d.ts +18 -0
  197. package/dist/src/exports/repositories.d.ts.map +1 -0
  198. package/dist/src/exports/repositories.js +30 -0
  199. package/dist/src/exports/repositories.js.map +1 -0
  200. package/dist/src/exports/services.d.ts +30 -0
  201. package/dist/src/exports/services.d.ts.map +1 -0
  202. package/dist/src/exports/services.js +70 -0
  203. package/dist/src/exports/services.js.map +1 -0
  204. package/dist/src/exports/types.d.ts +21 -0
  205. package/dist/src/exports/types.d.ts.map +1 -0
  206. package/dist/src/exports/types.js +12 -0
  207. package/dist/src/exports/types.js.map +1 -0
  208. package/dist/src/index.d.ts +10 -47
  209. package/dist/src/index.d.ts.map +1 -1
  210. package/dist/src/index.js +31 -48
  211. package/dist/src/index.js.map +1 -1
  212. package/dist/src/indexer/GitHubIndexer.d.ts.map +1 -1
  213. package/dist/src/indexer/GitHubIndexer.js +17 -4
  214. package/dist/src/indexer/GitHubIndexer.js.map +1 -1
  215. package/dist/src/indexer/SwarmIndexer.d.ts.map +1 -1
  216. package/dist/src/indexer/SwarmIndexer.js +1 -1
  217. package/dist/src/indexer/SwarmIndexer.js.map +1 -1
  218. package/dist/src/learning/PatternStore.d.ts +6 -426
  219. package/dist/src/learning/PatternStore.d.ts.map +1 -1
  220. package/dist/src/learning/PatternStore.helpers.d.ts +88 -0
  221. package/dist/src/learning/PatternStore.helpers.d.ts.map +1 -0
  222. package/dist/src/learning/PatternStore.helpers.js +286 -0
  223. package/dist/src/learning/PatternStore.helpers.js.map +1 -0
  224. package/dist/src/learning/PatternStore.js +52 -598
  225. package/dist/src/learning/PatternStore.js.map +1 -1
  226. package/dist/src/learning/PatternStore.queries.d.ts +83 -0
  227. package/dist/src/learning/PatternStore.queries.d.ts.map +1 -0
  228. package/dist/src/learning/PatternStore.queries.js +189 -0
  229. package/dist/src/learning/PatternStore.queries.js.map +1 -0
  230. package/dist/src/learning/PatternStore.types.d.ts +308 -0
  231. package/dist/src/learning/PatternStore.types.d.ts.map +1 -0
  232. package/dist/src/learning/PatternStore.types.js +44 -0
  233. package/dist/src/learning/PatternStore.types.js.map +1 -0
  234. package/dist/src/learning/ReasoningBankIntegration.d.ts +5 -345
  235. package/dist/src/learning/ReasoningBankIntegration.d.ts.map +1 -1
  236. package/dist/src/learning/ReasoningBankIntegration.helpers.d.ts +49 -0
  237. package/dist/src/learning/ReasoningBankIntegration.helpers.d.ts.map +1 -0
  238. package/dist/src/learning/ReasoningBankIntegration.helpers.js +180 -0
  239. package/dist/src/learning/ReasoningBankIntegration.helpers.js.map +1 -0
  240. package/dist/src/learning/ReasoningBankIntegration.js +21 -390
  241. package/dist/src/learning/ReasoningBankIntegration.js.map +1 -1
  242. package/dist/src/learning/ReasoningBankIntegration.types.d.ts +167 -0
  243. package/dist/src/learning/ReasoningBankIntegration.types.d.ts.map +1 -0
  244. package/dist/src/learning/ReasoningBankIntegration.types.js +51 -0
  245. package/dist/src/learning/ReasoningBankIntegration.types.js.map +1 -0
  246. package/dist/src/learning/interfaces.d.ts.map +1 -1
  247. package/dist/src/pipeline/DailyIndexPipeline.d.ts +4 -176
  248. package/dist/src/pipeline/DailyIndexPipeline.d.ts.map +1 -1
  249. package/dist/src/pipeline/DailyIndexPipeline.js +9 -83
  250. package/dist/src/pipeline/DailyIndexPipeline.js.map +1 -1
  251. package/dist/src/pipeline/pipeline-types.d.ts +132 -0
  252. package/dist/src/pipeline/pipeline-types.d.ts.map +1 -0
  253. package/dist/src/pipeline/pipeline-types.js +6 -0
  254. package/dist/src/pipeline/pipeline-types.js.map +1 -0
  255. package/dist/src/repositories/IndexerRepository.d.ts +1 -0
  256. package/dist/src/repositories/IndexerRepository.d.ts.map +1 -1
  257. package/dist/src/repositories/IndexerRepository.js +6 -0
  258. package/dist/src/repositories/IndexerRepository.js.map +1 -1
  259. package/dist/src/repositories/SkillRepository.d.ts.map +1 -1
  260. package/dist/src/repositories/SkillRepository.js +20 -5
  261. package/dist/src/repositories/SkillRepository.js.map +1 -1
  262. package/dist/src/routing/SONARouter.d.ts +3 -101
  263. package/dist/src/routing/SONARouter.d.ts.map +1 -1
  264. package/dist/src/routing/SONARouter.helpers.d.ts +112 -0
  265. package/dist/src/routing/SONARouter.helpers.d.ts.map +1 -0
  266. package/dist/src/routing/SONARouter.helpers.js +184 -0
  267. package/dist/src/routing/SONARouter.helpers.js.map +1 -0
  268. package/dist/src/routing/SONARouter.js +16 -318
  269. package/dist/src/routing/SONARouter.js.map +1 -1
  270. package/dist/src/routing/expert-types.d.ts +109 -0
  271. package/dist/src/routing/expert-types.d.ts.map +1 -0
  272. package/dist/src/routing/expert-types.js +162 -0
  273. package/dist/src/routing/expert-types.js.map +1 -0
  274. package/dist/src/routing/request-types.d.ts +113 -0
  275. package/dist/src/routing/request-types.d.ts.map +1 -0
  276. package/dist/src/routing/request-types.js +9 -0
  277. package/dist/src/routing/request-types.js.map +1 -0
  278. package/dist/src/routing/types.d.ts +5 -207
  279. package/dist/src/routing/types.d.ts.map +1 -1
  280. package/dist/src/routing/types.js +3 -153
  281. package/dist/src/routing/types.js.map +1 -1
  282. package/dist/src/scripts/github-import/github-auth.d.ts +17 -0
  283. package/dist/src/scripts/github-import/github-auth.d.ts.map +1 -0
  284. package/dist/src/scripts/github-import/github-auth.js +201 -0
  285. package/dist/src/scripts/github-import/github-auth.js.map +1 -0
  286. package/dist/src/scripts/github-import/github-client.d.ts +5 -5
  287. package/dist/src/scripts/github-import/github-client.d.ts.map +1 -1
  288. package/dist/src/scripts/github-import/github-client.js +5 -204
  289. package/dist/src/scripts/github-import/github-client.js.map +1 -1
  290. package/dist/src/scripts/ingest-lenny-skills.d.ts +40 -0
  291. package/dist/src/scripts/ingest-lenny-skills.d.ts.map +1 -0
  292. package/dist/src/scripts/ingest-lenny-skills.js +346 -0
  293. package/dist/src/scripts/ingest-lenny-skills.js.map +1 -0
  294. package/dist/src/scripts/merge-skills.d.ts +5 -27
  295. package/dist/src/scripts/merge-skills.d.ts.map +1 -1
  296. package/dist/src/scripts/merge-skills.js +4 -144
  297. package/dist/src/scripts/merge-skills.js.map +1 -1
  298. package/dist/src/scripts/merge-types.d.ts +72 -0
  299. package/dist/src/scripts/merge-types.d.ts.map +1 -0
  300. package/dist/src/scripts/merge-types.js +7 -0
  301. package/dist/src/scripts/merge-types.js.map +1 -0
  302. package/dist/src/scripts/merge-utils.d.ts +23 -0
  303. package/dist/src/scripts/merge-utils.d.ts.map +1 -0
  304. package/dist/src/scripts/merge-utils.js +150 -0
  305. package/dist/src/scripts/merge-utils.js.map +1 -0
  306. package/dist/src/scripts/review-categories.d.ts +41 -0
  307. package/dist/src/scripts/review-categories.d.ts.map +1 -0
  308. package/dist/src/scripts/review-categories.js +316 -0
  309. package/dist/src/scripts/review-categories.js.map +1 -0
  310. package/dist/src/scripts/review-lenny-skills.d.ts +26 -0
  311. package/dist/src/scripts/review-lenny-skills.d.ts.map +1 -0
  312. package/dist/src/scripts/review-lenny-skills.js +215 -0
  313. package/dist/src/scripts/review-lenny-skills.js.map +1 -0
  314. package/dist/src/scripts/sync-to-supabase.d.ts +10 -0
  315. package/dist/src/scripts/sync-to-supabase.d.ts.map +1 -0
  316. package/dist/src/scripts/sync-to-supabase.js +93 -0
  317. package/dist/src/scripts/sync-to-supabase.js.map +1 -0
  318. package/dist/src/security/AuditLogger.d.ts +4 -75
  319. package/dist/src/security/AuditLogger.d.ts.map +1 -1
  320. package/dist/src/security/AuditLogger.js +3 -12
  321. package/dist/src/security/AuditLogger.js.map +1 -1
  322. package/dist/src/security/__tests__/pathValidation.test.js.map +1 -1
  323. package/dist/src/security/audit-types.d.ts +96 -0
  324. package/dist/src/security/audit-types.d.ts.map +1 -0
  325. package/dist/src/security/audit-types.js +15 -0
  326. package/dist/src/security/audit-types.js.map +1 -0
  327. package/dist/src/security/sanitization.d.ts +1 -85
  328. package/dist/src/security/sanitization.d.ts.map +1 -1
  329. package/dist/src/security/sanitization.js +2 -133
  330. package/dist/src/security/sanitization.js.map +1 -1
  331. package/dist/src/security/scanner/SecurityScanner.d.ts +12 -88
  332. package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -1
  333. package/dist/src/security/scanner/SecurityScanner.formatters.d.ts +49 -0
  334. package/dist/src/security/scanner/SecurityScanner.formatters.d.ts.map +1 -0
  335. package/dist/src/security/scanner/SecurityScanner.formatters.js +139 -0
  336. package/dist/src/security/scanner/SecurityScanner.formatters.js.map +1 -0
  337. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts +40 -0
  338. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -0
  339. package/dist/src/security/scanner/SecurityScanner.helpers.js +142 -0
  340. package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -0
  341. package/dist/src/security/scanner/SecurityScanner.js +26 -255
  342. package/dist/src/security/scanner/SecurityScanner.js.map +1 -1
  343. package/dist/src/security/stripe-validators.d.ts +92 -0
  344. package/dist/src/security/stripe-validators.d.ts.map +1 -0
  345. package/dist/src/security/stripe-validators.js +139 -0
  346. package/dist/src/security/stripe-validators.js.map +1 -0
  347. package/dist/src/services/SearchService.d.ts +5 -29
  348. package/dist/src/services/SearchService.d.ts.map +1 -1
  349. package/dist/src/services/SearchService.helpers.d.ts +42 -0
  350. package/dist/src/services/SearchService.helpers.d.ts.map +1 -0
  351. package/dist/src/services/SearchService.helpers.js +128 -0
  352. package/dist/src/services/SearchService.helpers.js.map +1 -0
  353. package/dist/src/services/SearchService.js +142 -128
  354. package/dist/src/services/SearchService.js.map +1 -1
  355. package/dist/src/services/SearchService.types.d.ts +53 -0
  356. package/dist/src/services/SearchService.types.d.ts.map +1 -0
  357. package/dist/src/services/SearchService.types.js +7 -0
  358. package/dist/src/services/SearchService.types.js.map +1 -0
  359. package/dist/src/services/SkillAnalyzer.d.ts +37 -0
  360. package/dist/src/services/SkillAnalyzer.d.ts.map +1 -0
  361. package/dist/src/services/SkillAnalyzer.helpers.d.ts +103 -0
  362. package/dist/src/services/SkillAnalyzer.helpers.d.ts.map +1 -0
  363. package/dist/src/services/SkillAnalyzer.helpers.js +237 -0
  364. package/dist/src/services/SkillAnalyzer.helpers.js.map +1 -0
  365. package/dist/src/services/SkillAnalyzer.js +270 -0
  366. package/dist/src/services/SkillAnalyzer.js.map +1 -0
  367. package/dist/src/services/SkillAnalyzer.types.d.ts +110 -0
  368. package/dist/src/services/SkillAnalyzer.types.d.ts.map +1 -0
  369. package/dist/src/services/SkillAnalyzer.types.js +9 -0
  370. package/dist/src/services/SkillAnalyzer.types.js.map +1 -0
  371. package/dist/src/services/SkillDecomposer.d.ts +37 -0
  372. package/dist/src/services/SkillDecomposer.d.ts.map +1 -0
  373. package/dist/src/services/SkillDecomposer.helpers.d.ts +75 -0
  374. package/dist/src/services/SkillDecomposer.helpers.d.ts.map +1 -0
  375. package/dist/src/services/SkillDecomposer.helpers.js +277 -0
  376. package/dist/src/services/SkillDecomposer.helpers.js.map +1 -0
  377. package/dist/src/services/SkillDecomposer.js +116 -0
  378. package/dist/src/services/SkillDecomposer.js.map +1 -0
  379. package/dist/src/services/SkillDecomposer.types.d.ts +104 -0
  380. package/dist/src/services/SkillDecomposer.types.d.ts.map +1 -0
  381. package/dist/src/services/SkillDecomposer.types.js +9 -0
  382. package/dist/src/services/SkillDecomposer.types.js.map +1 -0
  383. package/dist/src/services/SubagentGenerator.d.ts +77 -0
  384. package/dist/src/services/SubagentGenerator.d.ts.map +1 -0
  385. package/dist/src/services/SubagentGenerator.js +352 -0
  386. package/dist/src/services/SubagentGenerator.js.map +1 -0
  387. package/dist/src/services/TaskRunner.d.ts +227 -0
  388. package/dist/src/services/TaskRunner.d.ts.map +1 -0
  389. package/dist/src/services/TaskRunner.js +423 -0
  390. package/dist/src/services/TaskRunner.js.map +1 -0
  391. package/dist/src/services/TransformationService.d.ts +167 -0
  392. package/dist/src/services/TransformationService.d.ts.map +1 -0
  393. package/dist/src/services/TransformationService.js +315 -0
  394. package/dist/src/services/TransformationService.js.map +1 -0
  395. package/dist/src/services/__tests__/SkillAnalyzer.test.d.ts +6 -0
  396. package/dist/src/services/__tests__/SkillAnalyzer.test.d.ts.map +1 -0
  397. package/dist/src/services/__tests__/SkillAnalyzer.test.js +177 -0
  398. package/dist/src/services/__tests__/SkillAnalyzer.test.js.map +1 -0
  399. package/dist/src/services/__tests__/SkillDecomposer.test.d.ts +6 -0
  400. package/dist/src/services/__tests__/SkillDecomposer.test.d.ts.map +1 -0
  401. package/dist/src/services/__tests__/SkillDecomposer.test.js +235 -0
  402. package/dist/src/services/__tests__/SkillDecomposer.test.js.map +1 -0
  403. package/dist/src/services/__tests__/SubagentGenerator.test.d.ts +6 -0
  404. package/dist/src/services/__tests__/SubagentGenerator.test.d.ts.map +1 -0
  405. package/dist/src/services/__tests__/SubagentGenerator.test.js +174 -0
  406. package/dist/src/services/__tests__/SubagentGenerator.test.js.map +1 -0
  407. package/dist/src/services/__tests__/TaskRunner.test.d.ts +7 -0
  408. package/dist/src/services/__tests__/TaskRunner.test.d.ts.map +1 -0
  409. package/dist/src/services/__tests__/TaskRunner.test.js +316 -0
  410. package/dist/src/services/__tests__/TaskRunner.test.js.map +1 -0
  411. package/dist/src/services/__tests__/TransformationService.test.d.ts +6 -0
  412. package/dist/src/services/__tests__/TransformationService.test.d.ts.map +1 -0
  413. package/dist/src/services/__tests__/TransformationService.test.js +244 -0
  414. package/dist/src/services/__tests__/TransformationService.test.js.map +1 -0
  415. package/dist/src/session/SessionContext.js +1 -1
  416. package/dist/src/session/SessionContext.js.map +1 -1
  417. package/dist/src/session/SessionManager.d.ts +3 -67
  418. package/dist/src/session/SessionManager.d.ts.map +1 -1
  419. package/dist/src/session/SessionManager.helpers.d.ts +68 -0
  420. package/dist/src/session/SessionManager.helpers.d.ts.map +1 -0
  421. package/dist/src/session/SessionManager.helpers.js +152 -0
  422. package/dist/src/session/SessionManager.helpers.js.map +1 -0
  423. package/dist/src/session/SessionManager.js +58 -163
  424. package/dist/src/session/SessionManager.js.map +1 -1
  425. package/dist/src/session/SessionManager.types.d.ts +88 -0
  426. package/dist/src/session/SessionManager.types.d.ts.map +1 -0
  427. package/dist/src/session/SessionManager.types.js +27 -0
  428. package/dist/src/session/SessionManager.types.js.map +1 -0
  429. package/dist/src/session/SessionRecovery.d.ts.map +1 -1
  430. package/dist/src/session/SessionRecovery.js +3 -2
  431. package/dist/src/session/SessionRecovery.js.map +1 -1
  432. package/dist/src/sources/RawUrlSourceAdapter.js.map +1 -1
  433. package/dist/src/sources/SourceAdapterRegistry.js +1 -1
  434. package/dist/src/sources/SourceAdapterRegistry.js.map +1 -1
  435. package/dist/src/telemetry/metric-helpers.d.ts +47 -0
  436. package/dist/src/telemetry/metric-helpers.d.ts.map +1 -0
  437. package/dist/src/telemetry/metric-helpers.js +96 -0
  438. package/dist/src/telemetry/metric-helpers.js.map +1 -0
  439. package/dist/src/telemetry/metric-types.d.ts +73 -0
  440. package/dist/src/telemetry/metric-types.d.ts.map +1 -0
  441. package/dist/src/telemetry/metric-types.js +9 -0
  442. package/dist/src/telemetry/metric-types.js.map +1 -0
  443. package/dist/src/telemetry/metrics.d.ts +8 -119
  444. package/dist/src/telemetry/metrics.d.ts.map +1 -1
  445. package/dist/src/telemetry/metrics.js +20 -193
  446. package/dist/src/telemetry/metrics.js.map +1 -1
  447. package/dist/src/telemetry/span-utils.d.ts +30 -0
  448. package/dist/src/telemetry/span-utils.d.ts.map +1 -0
  449. package/dist/src/telemetry/span-utils.js +62 -0
  450. package/dist/src/telemetry/span-utils.js.map +1 -0
  451. package/dist/src/telemetry/tracer-types.d.ts +91 -0
  452. package/dist/src/telemetry/tracer-types.d.ts.map +1 -0
  453. package/dist/src/telemetry/tracer-types.js +6 -0
  454. package/dist/src/telemetry/tracer-types.js.map +1 -0
  455. package/dist/src/telemetry/tracer.d.ts +5 -122
  456. package/dist/src/telemetry/tracer.d.ts.map +1 -1
  457. package/dist/src/telemetry/tracer.js +24 -170
  458. package/dist/src/telemetry/tracer.js.map +1 -1
  459. package/dist/src/testing/MultiLLMProvider.d.ts +17 -293
  460. package/dist/src/testing/MultiLLMProvider.d.ts.map +1 -1
  461. package/dist/src/testing/MultiLLMProvider.helpers.d.ts +54 -0
  462. package/dist/src/testing/MultiLLMProvider.helpers.d.ts.map +1 -0
  463. package/dist/src/testing/MultiLLMProvider.helpers.js +126 -0
  464. package/dist/src/testing/MultiLLMProvider.helpers.js.map +1 -0
  465. package/dist/src/testing/MultiLLMProvider.js +50 -323
  466. package/dist/src/testing/MultiLLMProvider.js.map +1 -1
  467. package/dist/src/testing/MultiLLMProvider.types.d.ts +253 -0
  468. package/dist/src/testing/MultiLLMProvider.types.d.ts.map +1 -0
  469. package/dist/src/testing/MultiLLMProvider.types.js +111 -0
  470. package/dist/src/testing/MultiLLMProvider.types.js.map +1 -0
  471. package/dist/src/triggers/TriggerDetector.d.ts +6 -142
  472. package/dist/src/triggers/TriggerDetector.d.ts.map +1 -1
  473. package/dist/src/triggers/TriggerDetector.js +15 -247
  474. package/dist/src/triggers/TriggerDetector.js.map +1 -1
  475. package/dist/src/triggers/__tests__/TriggerDetector.test.js +1 -1
  476. package/dist/src/triggers/__tests__/TriggerDetector.test.js.map +1 -1
  477. package/dist/src/triggers/trigger-constants.d.ts +22 -0
  478. package/dist/src/triggers/trigger-constants.d.ts.map +1 -0
  479. package/dist/src/triggers/trigger-constants.js +185 -0
  480. package/dist/src/triggers/trigger-constants.js.map +1 -0
  481. package/dist/src/triggers/trigger-types.d.ts +90 -0
  482. package/dist/src/triggers/trigger-types.d.ts.map +1 -0
  483. package/dist/src/triggers/trigger-types.js +6 -0
  484. package/dist/src/triggers/trigger-types.js.map +1 -0
  485. package/dist/src/types/skill.d.ts +33 -1
  486. package/dist/src/types/skill.d.ts.map +1 -1
  487. package/dist/src/types/skill.js +11 -1
  488. package/dist/src/types/skill.js.map +1 -1
  489. package/dist/src/types.d.ts +28 -2
  490. package/dist/src/types.d.ts.map +1 -1
  491. package/dist/src/types.js +1 -0
  492. package/dist/src/types.js.map +1 -1
  493. package/dist/src/utils/retry.js +2 -2
  494. package/dist/src/utils/retry.js.map +1 -1
  495. package/dist/src/validation/index.d.ts +5 -105
  496. package/dist/src/validation/index.d.ts.map +1 -1
  497. package/dist/src/validation/index.js +9 -421
  498. package/dist/src/validation/index.js.map +1 -1
  499. package/dist/src/validation/input-validators.d.ts +68 -0
  500. package/dist/src/validation/input-validators.d.ts.map +1 -0
  501. package/dist/src/validation/input-validators.js +126 -0
  502. package/dist/src/validation/input-validators.js.map +1 -0
  503. package/dist/src/validation/path-validators.d.ts +23 -0
  504. package/dist/src/validation/path-validators.d.ts.map +1 -0
  505. package/dist/src/validation/path-validators.js +47 -0
  506. package/dist/src/validation/path-validators.js.map +1 -0
  507. package/dist/src/validation/url-validators.d.ts +55 -0
  508. package/dist/src/validation/url-validators.d.ts.map +1 -0
  509. package/dist/src/validation/url-validators.js +267 -0
  510. package/dist/src/validation/url-validators.js.map +1 -0
  511. package/dist/src/validation/validation-error.d.ts +14 -0
  512. package/dist/src/validation/validation-error.d.ts.map +1 -0
  513. package/dist/src/validation/validation-error.js +19 -0
  514. package/dist/src/validation/validation-error.js.map +1 -0
  515. package/dist/src/webhooks/WebhookHandler.d.ts.map +1 -1
  516. package/dist/src/webhooks/WebhookHandler.js.map +1 -1
  517. package/dist/src/webhooks/WebhookPayload.d.ts +4 -215
  518. package/dist/src/webhooks/WebhookPayload.d.ts.map +1 -1
  519. package/dist/src/webhooks/WebhookPayload.js +1 -122
  520. package/dist/src/webhooks/WebhookPayload.js.map +1 -1
  521. package/dist/src/webhooks/WebhookQueue.d.ts +2 -140
  522. package/dist/src/webhooks/WebhookQueue.d.ts.map +1 -1
  523. package/dist/src/webhooks/WebhookQueue.js +4 -11
  524. package/dist/src/webhooks/WebhookQueue.js.map +1 -1
  525. package/dist/src/webhooks/WebhookQueue.types.d.ts +149 -0
  526. package/dist/src/webhooks/WebhookQueue.types.d.ts.map +1 -0
  527. package/dist/src/webhooks/WebhookQueue.types.js +10 -0
  528. package/dist/src/webhooks/WebhookQueue.types.js.map +1 -0
  529. package/dist/src/webhooks/WebhookQueue.utils.d.ts +44 -0
  530. package/dist/src/webhooks/WebhookQueue.utils.d.ts.map +1 -0
  531. package/dist/src/webhooks/WebhookQueue.utils.js +58 -0
  532. package/dist/src/webhooks/WebhookQueue.utils.js.map +1 -0
  533. package/dist/src/webhooks/webhook-schemas.d.ts +213 -0
  534. package/dist/src/webhooks/webhook-schemas.d.ts.map +1 -0
  535. package/dist/src/webhooks/webhook-schemas.js +132 -0
  536. package/dist/src/webhooks/webhook-schemas.js.map +1 -0
  537. package/dist/src/webhooks/webhook-types.d.ts +222 -0
  538. package/dist/src/webhooks/webhook-types.d.ts.map +1 -0
  539. package/dist/src/webhooks/webhook-types.js +10 -0
  540. package/dist/src/webhooks/webhook-types.js.map +1 -0
  541. package/dist/tests/Analytics.integration.test.js +2 -2
  542. package/dist/tests/Analytics.integration.test.js.map +1 -1
  543. package/dist/tests/AnalyticsRepository.test.js +3 -5
  544. package/dist/tests/AnalyticsRepository.test.js.map +1 -1
  545. package/dist/tests/AnalyticsStorage.test.js.map +1 -1
  546. package/dist/tests/ApiPartialResponses.test.d.ts +12 -0
  547. package/dist/tests/ApiPartialResponses.test.d.ts.map +1 -0
  548. package/dist/tests/ApiPartialResponses.test.js +202 -0
  549. package/dist/tests/ApiPartialResponses.test.js.map +1 -0
  550. package/dist/tests/AuditLogger.test.js.map +1 -1
  551. package/dist/tests/BenchmarkRunner.test.js +6 -6
  552. package/dist/tests/BenchmarkRunner.test.js.map +1 -1
  553. package/dist/tests/CacheSecurity.test.js.map +1 -1
  554. package/dist/tests/CodebaseAnalyzer.test.js.map +1 -1
  555. package/dist/tests/DailyIndexPipeline.test.js.map +1 -1
  556. package/dist/tests/EmbeddingService.test.js.map +1 -1
  557. package/dist/tests/GitHubIndexer.test.js +4 -3
  558. package/dist/tests/GitHubIndexer.test.js.map +1 -1
  559. package/dist/tests/MemoryProfiler.test.js +3 -3
  560. package/dist/tests/MemoryProfiler.test.js.map +1 -1
  561. package/dist/tests/QualityScorer.test.js.map +1 -1
  562. package/dist/tests/RateLimiter.test.js.map +1 -1
  563. package/dist/tests/ScraperAdapters.test.js.map +1 -1
  564. package/dist/tests/SecurityScanner.test.js +4 -4
  565. package/dist/tests/SecurityScanner.test.js.map +1 -1
  566. package/dist/tests/SessionManager.security.test.js +1 -1
  567. package/dist/tests/SessionManager.security.test.js.map +1 -1
  568. package/dist/tests/SessionManager.test.js +4 -4
  569. package/dist/tests/SessionManager.test.js.map +1 -1
  570. package/dist/tests/SwarmIndexer.test.js +1 -1
  571. package/dist/tests/SwarmIndexer.test.js.map +1 -1
  572. package/dist/tests/TieredCache.test.js +2 -11
  573. package/dist/tests/TieredCache.test.js.map +1 -1
  574. package/dist/tests/WebhookHandler.test.js.map +1 -1
  575. package/dist/tests/fixtures/api-responses/index.d.ts +119 -0
  576. package/dist/tests/fixtures/api-responses/index.d.ts.map +1 -0
  577. package/dist/tests/fixtures/api-responses/index.js +419 -0
  578. package/dist/tests/fixtures/api-responses/index.js.map +1 -0
  579. package/dist/tests/integration/neural/neural-fixtures.d.ts +19 -0
  580. package/dist/tests/integration/neural/neural-fixtures.d.ts.map +1 -0
  581. package/dist/tests/integration/neural/neural-fixtures.js +49 -0
  582. package/dist/tests/integration/neural/neural-fixtures.js.map +1 -0
  583. package/dist/tests/integration/neural/neural-mocks-privacy.d.ts +78 -0
  584. package/dist/tests/integration/neural/neural-mocks-privacy.d.ts.map +1 -0
  585. package/dist/tests/integration/neural/neural-mocks-privacy.js +146 -0
  586. package/dist/tests/integration/neural/neural-mocks-privacy.js.map +1 -0
  587. package/dist/tests/integration/neural/neural-mocks.d.ts +90 -0
  588. package/dist/tests/integration/neural/neural-mocks.d.ts.map +1 -0
  589. package/dist/tests/integration/neural/neural-mocks.js +288 -0
  590. package/dist/tests/integration/neural/neural-mocks.js.map +1 -0
  591. package/dist/tests/integration/neural/neural-test-utils.d.ts +27 -0
  592. package/dist/tests/integration/neural/neural-test-utils.d.ts.map +1 -0
  593. package/dist/tests/integration/neural/neural-test-utils.js +35 -0
  594. package/dist/tests/integration/neural/neural-test-utils.js.map +1 -0
  595. package/dist/tests/integration/neural/setup.d.ts +6 -165
  596. package/dist/tests/integration/neural/setup.d.ts.map +1 -1
  597. package/dist/tests/integration/neural/setup.js +9 -477
  598. package/dist/tests/integration/neural/setup.js.map +1 -1
  599. package/dist/tests/logger.test.js +1 -1
  600. package/dist/tests/logger.test.js.map +1 -1
  601. package/dist/tests/performance/LargeScalePerformance.test.js +1 -1
  602. package/dist/tests/performance/LargeScalePerformance.test.js.map +1 -1
  603. package/dist/tests/sanitization.test.js.map +1 -1
  604. package/dist/tests/session/SessionManager.helpers.test.d.ts +8 -0
  605. package/dist/tests/session/SessionManager.helpers.test.d.ts.map +1 -0
  606. package/dist/tests/session/SessionManager.helpers.test.js +105 -0
  607. package/dist/tests/session/SessionManager.helpers.test.js.map +1 -0
  608. package/dist/tests/sources.test.js.map +1 -1
  609. package/dist/tests/webhooks/WebhookHandler.idempotency.test.js +1 -1
  610. package/dist/tests/webhooks/WebhookHandler.idempotency.test.js.map +1 -1
  611. package/dist/tests/webhooks/WebhookPayload.security.test.js.map +1 -1
  612. package/package.json +11 -11
@@ -0,0 +1,37 @@
1
+ /**
2
+ * SMI-1788: SkillDecomposer - Decompose large skills into sub-skills
3
+ *
4
+ * Transforms skills >500 lines into a main SKILL.md + sub-skills structure
5
+ * following the Skillsmith optimization standard:
6
+ * - Main SKILL.md: <500 lines, contains header + navigation + core content
7
+ * - Sub-skills: Extracted sections loaded on-demand
8
+ *
9
+ * Part of the Skillsmith Optimization Layer for transforming
10
+ * community skills into more performant versions.
11
+ */
12
+ import type { SkillAnalysis } from './SkillAnalyzer.js';
13
+ export type { DecompositionResult, DecomposedSkill, SubSkill, DecompositionStats, SkillMetadata, DecomposerOptions, } from './SkillDecomposer.types.js';
14
+ import type { DecompositionResult, DecomposerOptions } from './SkillDecomposer.types.js';
15
+ export { DEFAULT_EXTRACT_KEYWORDS, sanitizeFilename } from './SkillDecomposer.helpers.js';
16
+ /**
17
+ * Decompose a skill into main + sub-skills based on analysis
18
+ *
19
+ * @param content - The original SKILL.md content
20
+ * @param analysis - Analysis from SkillAnalyzer
21
+ * @param options - Decomposition options
22
+ * @returns Decomposition result with main skill and sub-skills
23
+ */
24
+ export declare function decomposeSkill(content: string, analysis: SkillAnalysis, options?: DecomposerOptions): DecompositionResult;
25
+ /**
26
+ * Parallelize sequential Task() calls in skill content
27
+ *
28
+ * @param content - The skill content
29
+ * @returns Content with Task() calls batched for parallel execution
30
+ */
31
+ export declare function parallelizeTaskCalls(content: string): string;
32
+ declare const _default: {
33
+ decomposeSkill: typeof decomposeSkill;
34
+ parallelizeTaskCalls: typeof parallelizeTaskCalls;
35
+ };
36
+ export default _default;
37
+ //# sourceMappingURL=SkillDecomposer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillDecomposer.d.ts","sourceRoot":"","sources":["../../../src/services/SkillDecomposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGvD,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAexF,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEzF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,mBAAmB,CA6BrB;AAoCD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2C5D;;;;;AAED,wBAAuD"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * SMI-1788: SkillDecomposer Helpers
3
+ *
4
+ * Helper functions and constants for skill decomposition.
5
+ */
6
+ import type { DecomposerOptions, ResolvedDecomposerOptions, SkillMetadata, ParsedSection, SubSkill, DecomposedSkill, DecompositionStats } from './SkillDecomposer.types.js';
7
+ import type { ExtractableSection } from './SkillAnalyzer.types.js';
8
+ /**
9
+ * Default keywords that indicate a section should be extracted as a sub-skill.
10
+ * These are used when no custom extractKeywords are provided.
11
+ */
12
+ export declare const DEFAULT_EXTRACT_KEYWORDS: string[];
13
+ /**
14
+ * Default decomposer options
15
+ */
16
+ export declare const DEFAULT_OPTIONS: ResolvedDecomposerOptions;
17
+ /**
18
+ * Merge user options with defaults
19
+ */
20
+ export declare function resolveOptions(options?: DecomposerOptions): ResolvedDecomposerOptions;
21
+ /**
22
+ * Parse skill content into metadata, frontmatter, and sections
23
+ */
24
+ export declare function parseSkillContent(content: string): {
25
+ metadata: SkillMetadata;
26
+ frontmatter: string;
27
+ sections: ParsedSection[];
28
+ };
29
+ /**
30
+ * Determine which sections should be extracted as sub-skills
31
+ */
32
+ export declare function determineSectionsToExtract(sections: ParsedSection[], extractableSections: ExtractableSection[], opts: ResolvedDecomposerOptions): ParsedSection[];
33
+ /**
34
+ * SMI-1794: Sanitize and validate filename for sub-skill
35
+ * Prevents path traversal and invalid characters
36
+ */
37
+ export declare function sanitizeFilename(name: string): string;
38
+ /**
39
+ * Generate a filename for a sub-skill
40
+ * SMI-1794: Uses sanitized filename to prevent security issues
41
+ */
42
+ export declare function generateSubSkillFilename(sectionTitle: string): string;
43
+ /**
44
+ * Format sub-skill content with proper header
45
+ */
46
+ export declare function formatSubSkillContent(section: ParsedSection, skillName: string): string;
47
+ /**
48
+ * Create sub-skills from extracted sections
49
+ */
50
+ export declare function createSubSkills(sections: ParsedSection[], skillName: string): SubSkill[];
51
+ /**
52
+ * Generate navigation section linking to sub-skills
53
+ */
54
+ export declare function generateSubSkillNavigation(subSkills: SubSkill[]): string;
55
+ /**
56
+ * Generate attribution footer
57
+ */
58
+ export declare function generateAttribution(): string;
59
+ /**
60
+ * Add attribution to content without decomposition
61
+ */
62
+ export declare function addAttributionToContent(content: string): string;
63
+ /**
64
+ * Create the main skill content with remaining sections
65
+ */
66
+ export declare function createMainSkill(frontmatter: string, allSections: ParsedSection[], extractedSections: ParsedSection[], subSkills: SubSkill[], opts: ResolvedDecomposerOptions): DecomposedSkill;
67
+ /**
68
+ * Calculate decomposition statistics
69
+ */
70
+ export declare function calculateStats(originalContent: string, mainSkill: DecomposedSkill, subSkills: SubSkill[]): DecompositionStats;
71
+ /**
72
+ * Format multiple Task() calls as a batched operation
73
+ */
74
+ export declare function formatBatchedTasks(tasks: string[]): string[];
75
+ //# sourceMappingURL=SkillDecomposer.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillDecomposer.helpers.d.ts","sourceRoot":"","sources":["../../../src/services/SkillDecomposer.helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,eAAe,EACf,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAElE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,UASpC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,yBAM7B,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,yBAAyB,CAErF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAClD,QAAQ,EAAE,aAAa,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B,CAuEA;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,aAAa,EAAE,EACzB,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,IAAI,EAAE,yBAAyB,GAC9B,aAAa,EAAE,CAiCjB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASrD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGrE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CASvF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,CAyBxF;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAUxE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,aAAa,EAAE,EAC5B,iBAAiB,EAAE,aAAa,EAAE,EAClC,SAAS,EAAE,QAAQ,EAAE,EACrB,IAAI,EAAE,yBAAyB,GAC9B,eAAe,CA2BjB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,eAAe,EAC1B,SAAS,EAAE,QAAQ,EAAE,GACpB,kBAAkB,CAkBpB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAO5D"}
@@ -0,0 +1,277 @@
1
+ /**
2
+ * SMI-1788: SkillDecomposer Helpers
3
+ *
4
+ * Helper functions and constants for skill decomposition.
5
+ */
6
+ /**
7
+ * Default keywords that indicate a section should be extracted as a sub-skill.
8
+ * These are used when no custom extractKeywords are provided.
9
+ */
10
+ export const DEFAULT_EXTRACT_KEYWORDS = [
11
+ 'api',
12
+ 'reference',
13
+ 'example',
14
+ 'usage',
15
+ 'advanced',
16
+ 'configuration',
17
+ 'troubleshoot',
18
+ 'appendix',
19
+ ];
20
+ /**
21
+ * Default decomposer options
22
+ */
23
+ export const DEFAULT_OPTIONS = {
24
+ maxMainSkillLines: 400,
25
+ minExtractableLines: 50,
26
+ addNavigation: true,
27
+ addAttribution: true,
28
+ extractKeywords: DEFAULT_EXTRACT_KEYWORDS,
29
+ };
30
+ /**
31
+ * Merge user options with defaults
32
+ */
33
+ export function resolveOptions(options) {
34
+ return { ...DEFAULT_OPTIONS, ...options };
35
+ }
36
+ /**
37
+ * Parse skill content into metadata, frontmatter, and sections
38
+ */
39
+ export function parseSkillContent(content) {
40
+ const lines = content.split('\n');
41
+ let frontmatter = '';
42
+ let contentStart = 0;
43
+ const metadata = {};
44
+ // Extract frontmatter
45
+ if (lines[0]?.trim() === '---') {
46
+ let frontmatterEnd = -1;
47
+ for (let i = 1; i < lines.length; i++) {
48
+ if (lines[i]?.trim() === '---') {
49
+ frontmatterEnd = i;
50
+ break;
51
+ }
52
+ }
53
+ if (frontmatterEnd > 0) {
54
+ frontmatter = lines.slice(0, frontmatterEnd + 1).join('\n');
55
+ contentStart = frontmatterEnd + 1;
56
+ // Parse metadata from frontmatter
57
+ const yamlContent = lines.slice(1, frontmatterEnd).join('\n');
58
+ const nameMatch = yamlContent.match(/^name:\s*(.+)$/m);
59
+ const descMatch = yamlContent.match(/^description:\s*(.+)$/m);
60
+ if (nameMatch)
61
+ metadata.name = nameMatch[1].trim();
62
+ if (descMatch)
63
+ metadata.description = descMatch[1].trim();
64
+ }
65
+ }
66
+ // Parse sections
67
+ const sections = [];
68
+ let currentSection = null;
69
+ for (let i = contentStart; i < lines.length; i++) {
70
+ const line = lines[i];
71
+ const headerMatch = line.match(/^(#{1,3})\s+(.+)$/);
72
+ if (headerMatch) {
73
+ // Save previous section
74
+ if (currentSection) {
75
+ sections.push(currentSection);
76
+ }
77
+ currentSection = {
78
+ level: headerMatch[1].length,
79
+ title: headerMatch[2].trim(),
80
+ startLine: i,
81
+ lines: [line],
82
+ };
83
+ }
84
+ else if (currentSection) {
85
+ currentSection.lines.push(line);
86
+ }
87
+ else {
88
+ // Content before first header
89
+ if (!sections.length && line.trim()) {
90
+ currentSection = {
91
+ level: 0,
92
+ title: '_preamble',
93
+ startLine: i,
94
+ lines: [line],
95
+ };
96
+ }
97
+ }
98
+ }
99
+ // Save last section
100
+ if (currentSection) {
101
+ sections.push(currentSection);
102
+ }
103
+ return { metadata, frontmatter, sections };
104
+ }
105
+ /**
106
+ * Determine which sections should be extracted as sub-skills
107
+ */
108
+ export function determineSectionsToExtract(sections, extractableSections, opts) {
109
+ const toExtract = [];
110
+ // Create a map of section names from analysis for quick lookup
111
+ const extractableNames = new Set(extractableSections.map((s) => s.name.toLowerCase()));
112
+ // Use configurable keywords (defaults provided via DEFAULT_OPTIONS)
113
+ const keywords = opts.extractKeywords ?? DEFAULT_EXTRACT_KEYWORDS;
114
+ for (const section of sections) {
115
+ const lineCount = section.lines.length;
116
+ const titleLower = section.title.toLowerCase();
117
+ // Skip preamble and very short sections
118
+ if (section.title === '_preamble' || lineCount < opts.minExtractableLines) {
119
+ continue;
120
+ }
121
+ // Extract if:
122
+ // 1. In analysis extractable list
123
+ // 2. Has extract keyword in title
124
+ // 3. Is a large section (>100 lines)
125
+ const shouldExtract = extractableNames.has(titleLower) ||
126
+ keywords.some((kw) => titleLower.includes(kw)) ||
127
+ lineCount > 100;
128
+ if (shouldExtract) {
129
+ toExtract.push(section);
130
+ }
131
+ }
132
+ return toExtract;
133
+ }
134
+ /**
135
+ * SMI-1794: Sanitize and validate filename for sub-skill
136
+ * Prevents path traversal and invalid characters
137
+ */
138
+ export function sanitizeFilename(name) {
139
+ return (name
140
+ .toLowerCase()
141
+ .replace(/[^a-z0-9-_]/g, '-') // Only allow alphanumeric, dash, underscore
142
+ .replace(/-+/g, '-') // Collapse multiple dashes
143
+ .replace(/^-|-$/g, '') // Remove leading/trailing dashes
144
+ .slice(0, 64) || 'sub-skill'); // Limit length, provide default
145
+ }
146
+ /**
147
+ * Generate a filename for a sub-skill
148
+ * SMI-1794: Uses sanitized filename to prevent security issues
149
+ */
150
+ export function generateSubSkillFilename(sectionTitle) {
151
+ const slug = sanitizeFilename(sectionTitle);
152
+ return `${slug}.md`;
153
+ }
154
+ /**
155
+ * Format sub-skill content with proper header
156
+ */
157
+ export function formatSubSkillContent(section, skillName) {
158
+ const header = `---
159
+ parent_skill: ${skillName}
160
+ section: ${section.title}
161
+ ---
162
+
163
+ `;
164
+ return header + section.lines.join('\n');
165
+ }
166
+ /**
167
+ * Create sub-skills from extracted sections
168
+ */
169
+ export function createSubSkills(sections, skillName) {
170
+ return sections.map((section) => {
171
+ const filename = generateSubSkillFilename(section.title);
172
+ const content = formatSubSkillContent(section, skillName);
173
+ // Determine extraction reason
174
+ const titleLower = section.title.toLowerCase();
175
+ let reason = 'Large section suitable for on-demand loading';
176
+ if (titleLower.includes('api') || titleLower.includes('reference')) {
177
+ reason = 'API reference loaded on-demand to reduce initial context';
178
+ }
179
+ else if (titleLower.includes('example') || titleLower.includes('usage')) {
180
+ reason = 'Examples progressively disclosed when needed';
181
+ }
182
+ else if (titleLower.includes('advanced') || titleLower.includes('configuration')) {
183
+ reason = 'Advanced content loaded only when required';
184
+ }
185
+ return {
186
+ filename,
187
+ sectionName: section.title,
188
+ content,
189
+ lineCount: content.split('\n').length,
190
+ extractionReason: reason,
191
+ };
192
+ });
193
+ }
194
+ /**
195
+ * Generate navigation section linking to sub-skills
196
+ */
197
+ export function generateSubSkillNavigation(subSkills) {
198
+ const links = subSkills.map((s) => `- [${s.sectionName}](./${s.filename})`).join('\n');
199
+ return `## Additional Resources
200
+
201
+ The following sections are available as sub-skills for on-demand loading:
202
+
203
+ ${links}
204
+
205
+ *Load these sections only when needed to optimize context usage.*`;
206
+ }
207
+ /**
208
+ * Generate attribution footer
209
+ */
210
+ export function generateAttribution() {
211
+ return `---
212
+
213
+ *Optimized by Skillsmith - Token usage reduced through intelligent decomposition*`;
214
+ }
215
+ /**
216
+ * Add attribution to content without decomposition
217
+ */
218
+ export function addAttributionToContent(content) {
219
+ return content.trimEnd() + '\n\n' + generateAttribution();
220
+ }
221
+ /**
222
+ * Create the main skill content with remaining sections
223
+ */
224
+ export function createMainSkill(frontmatter, allSections, extractedSections, subSkills, opts) {
225
+ const extractedTitles = new Set(extractedSections.map((s) => s.title));
226
+ // Build main content from non-extracted sections
227
+ const remainingSections = allSections.filter((s) => !extractedTitles.has(s.title));
228
+ let mainContent = remainingSections.map((s) => s.lines.join('\n')).join('\n\n');
229
+ // Add navigation to sub-skills if enabled
230
+ if (opts.addNavigation && subSkills.length > 0) {
231
+ const nav = generateSubSkillNavigation(subSkills);
232
+ mainContent = mainContent + '\n\n' + nav;
233
+ }
234
+ // Add attribution if enabled
235
+ if (opts.addAttribution) {
236
+ mainContent = mainContent + '\n\n' + generateAttribution();
237
+ }
238
+ // Combine frontmatter and content
239
+ const finalContent = frontmatter ? frontmatter + '\n\n' + mainContent : mainContent;
240
+ return {
241
+ filename: 'SKILL.md',
242
+ content: finalContent.trim(),
243
+ lineCount: finalContent.split('\n').length,
244
+ subSkillRefs: subSkills.map((s) => s.filename),
245
+ };
246
+ }
247
+ /**
248
+ * Calculate decomposition statistics
249
+ */
250
+ export function calculateStats(originalContent, mainSkill, subSkills) {
251
+ const originalLines = originalContent.split('\n').length;
252
+ const mainSkillLines = mainSkill.lineCount;
253
+ const subSkillLines = subSkills.reduce((sum, s) => sum + s.lineCount, 0);
254
+ // Estimate token reduction
255
+ // Main skill is always loaded; sub-skills are loaded on-demand
256
+ // Assume 50% of sub-skill content would have been needed on average
257
+ const effectiveReduction = subSkillLines * 0.5;
258
+ const tokenReductionPercent = Math.round((effectiveReduction / originalLines) * 100);
259
+ return {
260
+ originalLines,
261
+ mainSkillLines,
262
+ subSkillLines,
263
+ subSkillCount: subSkills.length,
264
+ tokenReductionPercent,
265
+ };
266
+ }
267
+ /**
268
+ * Format multiple Task() calls as a batched operation
269
+ */
270
+ export function formatBatchedTasks(tasks) {
271
+ if (tasks.length < 2) {
272
+ return tasks;
273
+ }
274
+ // Add comment about batching
275
+ return ['// Batched for parallel execution (Skillsmith optimization)', ...tasks];
276
+ }
277
+ //# sourceMappingURL=SkillDecomposer.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillDecomposer.helpers.js","sourceRoot":"","sources":["../../../src/services/SkillDecomposer.helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,KAAK;IACL,WAAW;IACX,SAAS;IACT,OAAO;IACP,UAAU;IACV,eAAe;IACf,cAAc;IACd,UAAU;CACX,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,iBAAiB,EAAE,GAAG;IACtB,mBAAmB,EAAE,EAAE;IACvB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,wBAAwB;CAC1C,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAA2B;IACxD,OAAO,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAA;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAK/C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,WAAW,GAAG,EAAE,CAAA;IACpB,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,MAAM,QAAQ,GAAkB,EAAE,CAAA;IAElC,sBAAsB;IACtB,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;QAC/B,IAAI,cAAc,GAAG,CAAC,CAAC,CAAA;QACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;gBAC/B,cAAc,GAAG,CAAC,CAAA;gB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EAAE,CAAC;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,6BAA6B;IAC7B,OAAO,CAAC,6DAA6D,EAAE,GAAG,KAAK,CAAC,CAAA;AAClF,CAAC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * SMI-1788: SkillDecomposer - Decompose large skills into sub-skills
3
+ *
4
+ * Transforms skills >500 lines into a main SKILL.md + sub-skills structure
5
+ * following the Skillsmith optimization standard:
6
+ * - Main SKILL.md: <500 lines, contains header + navigation + core content
7
+ * - Sub-skills: Extracted sections loaded on-demand
8
+ *
9
+ * Part of the Skillsmith Optimization Layer for transforming
10
+ * community skills into more performant versions.
11
+ */
12
+ import { resolveOptions, parseSkillContent, determineSectionsToExtract, createSubSkills, createMainSkill, calculateStats, addAttributionToContent, formatBatchedTasks, } from './SkillDecomposer.helpers.js';
13
+ // Re-export helpers for testing and advanced usage
14
+ export { DEFAULT_EXTRACT_KEYWORDS, sanitizeFilename } from './SkillDecomposer.helpers.js';
15
+ /**
16
+ * Decompose a skill into main + sub-skills based on analysis
17
+ *
18
+ * @param content - The original SKILL.md content
19
+ * @param analysis - Analysis from SkillAnalyzer
20
+ * @param options - Decomposition options
21
+ * @returns Decomposition result with main skill and sub-skills
22
+ */
23
+ export function decomposeSkill(content, analysis, options) {
24
+ const opts = resolveOptions(options);
25
+ // If skill doesn't need decomposition, return as-is with attribution
26
+ if (!analysis.shouldTransform || analysis.lineCount <= opts.maxMainSkillLines) {
27
+ return createNonDecomposedResult(content, analysis, opts);
28
+ }
29
+ // Parse the skill content
30
+ const { metadata, sections, frontmatter } = parseSkillContent(content);
31
+ // Determine which sections to extract
32
+ const sectionsToExtract = determineSectionsToExtract(sections, analysis.extractableSections, opts);
33
+ // Create sub-skills from extracted sections
34
+ const subSkills = createSubSkills(sectionsToExtract, metadata.name || 'skill');
35
+ // Create the main skill with remaining content
36
+ const mainSkill = createMainSkill(frontmatter, sections, sectionsToExtract, subSkills, opts);
37
+ // Calculate statistics
38
+ const stats = calculateStats(content, mainSkill, subSkills);
39
+ return {
40
+ mainSkill,
41
+ subSkills,
42
+ wasDecomposed: true,
43
+ stats,
44
+ };
45
+ }
46
+ /**
47
+ * Create result for skills that don't need decomposition
48
+ */
49
+ function createNonDecomposedResult(content, analysis, opts) {
50
+ let finalContent = content;
51
+ // Add attribution if enabled
52
+ if (opts.addAttribution && !content.includes('Optimized by Skillsmith')) {
53
+ finalContent = addAttributionToContent(content);
54
+ }
55
+ return {
56
+ mainSkill: {
57
+ filename: 'SKILL.md',
58
+ content: finalContent,
59
+ lineCount: finalContent.split('\n').length,
60
+ subSkillRefs: [],
61
+ },
62
+ subSkills: [],
63
+ wasDecomposed: false,
64
+ stats: {
65
+ originalLines: analysis.lineCount,
66
+ mainSkillLines: finalContent.split('\n').length,
67
+ subSkillLines: 0,
68
+ subSkillCount: 0,
69
+ tokenReductionPercent: 0,
70
+ },
71
+ };
72
+ }
73
+ /**
74
+ * Parallelize sequential Task() calls in skill content
75
+ *
76
+ * @param content - The skill content
77
+ * @returns Content with Task() calls batched for parallel execution
78
+ */
79
+ export function parallelizeTaskCalls(content) {
80
+ const lines = content.split('\n');
81
+ const result = [];
82
+ const taskBuffer = [];
83
+ let inCodeBlock = false;
84
+ for (let i = 0; i < lines.length; i++) {
85
+ const line = lines[i];
86
+ // Track code blocks
87
+ if (line.trim().startsWith('```')) {
88
+ inCodeBlock = !inCodeBlock;
89
+ // Flush task buffer before code blocks
90
+ if (taskBuffer.length > 0) {
91
+ result.push(...formatBatchedTasks(taskBuffer));
92
+ taskBuffer.length = 0;
93
+ }
94
+ result.push(line);
95
+ continue;
96
+ }
97
+ // In code blocks, look for sequential Task() calls
98
+ if (inCodeBlock && line.includes('Task(')) {
99
+ taskBuffer.push(line);
100
+ continue;
101
+ }
102
+ // Flush task buffer when we hit a non-Task line in code block
103
+ if (inCodeBlock && taskBuffer.length > 0 && !line.includes('Task(')) {
104
+ result.push(...formatBatchedTasks(taskBuffer));
105
+ taskBuffer.length = 0;
106
+ }
107
+ result.push(line);
108
+ }
109
+ // Flush any remaining tasks
110
+ if (taskBuffer.length > 0) {
111
+ result.push(...formatBatchedTasks(taskBuffer));
112
+ }
113
+ return result.join('\n');
114
+ }
115
+ export default { decomposeSkill, parallelizeTaskCalls };
116
+ //# sourceMappingURL=SkillDecomposer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillDecomposer.js","sourceRoot":"","sources":["../../../src/services/SkillDecomposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,8BAA8B,CAAA;AAErC,mDAAmD;AACnD,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAEzF;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,QAAuB,EACvB,OAA2B;IAE3B,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;IAEpC,qEAAqE;IACrE,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC9E,OAAO,yBAAyB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC3D,CAAC;IAED,0BAA0B;IAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAEtE,sCAAsC;IACtC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;IAElG,4CAA4C;IAC5C,MAAM,SAAS,GAAG,eAAe,CAAC,iBAAiB,EAAE,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,CAAA;IAE9E,+CA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AC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC;AAED,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAA"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * SMI-1788: SkillDecomposer Types
3
+ *
4
+ * Type definitions for skill decomposition into sub-skills.
5
+ * Used by the Skillsmith Optimization Layer for transforming
6
+ * large skills into more performant versions.
7
+ */
8
+ /**
9
+ * Result of skill decomposition
10
+ */
11
+ export interface DecompositionResult {
12
+ /** The optimized main SKILL.md content */
13
+ mainSkill: DecomposedSkill;
14
+ /** Extracted sub-skills */
15
+ subSkills: SubSkill[];
16
+ /** Whether decomposition was applied */
17
+ wasDecomposed: boolean;
18
+ /** Statistics about the decomposition */
19
+ stats: DecompositionStats;
20
+ }
21
+ /**
22
+ * The main skill after decomposition
23
+ */
24
+ export interface DecomposedSkill {
25
+ /** Filename (always SKILL.md) */
26
+ filename: string;
27
+ /** The optimized content */
28
+ content: string;
29
+ /** Line count after optimization */
30
+ lineCount: number;
31
+ /** References to sub-skills */
32
+ subSkillRefs: string[];
33
+ }
34
+ /**
35
+ * An extracted sub-skill
36
+ */
37
+ export interface SubSkill {
38
+ /** Filename (e.g., api.md, examples.md) */
39
+ filename: string;
40
+ /** Original section name */
41
+ sectionName: string;
42
+ /** The extracted content */
43
+ content: string;
44
+ /** Line count */
45
+ lineCount: number;
46
+ /** Why this section was extracted */
47
+ extractionReason: string;
48
+ }
49
+ /**
50
+ * Statistics about the decomposition
51
+ */
52
+ export interface DecompositionStats {
53
+ /** Original line count */
54
+ originalLines: number;
55
+ /** Main skill line count after decomposition */
56
+ mainSkillLines: number;
57
+ /** Total lines in sub-skills */
58
+ subSkillLines: number;
59
+ /** Number of sub-skills created */
60
+ subSkillCount: number;
61
+ /** Estimated token reduction percentage */
62
+ tokenReductionPercent: number;
63
+ }
64
+ /**
65
+ * Metadata extracted from SKILL.md frontmatter
66
+ */
67
+ export interface SkillMetadata {
68
+ name?: string;
69
+ description?: string;
70
+ [key: string]: string | undefined;
71
+ }
72
+ /**
73
+ * Configuration for decomposition behavior
74
+ */
75
+ export interface DecomposerOptions {
76
+ /** Maximum lines for main skill (default: 400) */
77
+ maxMainSkillLines?: number;
78
+ /** Minimum lines for a section to be extracted (default: 50) */
79
+ minExtractableLines?: number;
80
+ /** Whether to add navigation links to main skill (default: true) */
81
+ addNavigation?: boolean;
82
+ /** Whether to add "Optimized by Skillsmith" attribution (default: true) */
83
+ addAttribution?: boolean;
84
+ /**
85
+ * Keywords that indicate a section should be extracted as a sub-skill.
86
+ * Sections with titles containing these keywords will be candidates for extraction.
87
+ * @default ['api', 'reference', 'example', 'usage', 'advanced', 'configuration', 'troubleshoot', 'appendix']
88
+ */
89
+ extractKeywords?: string[];
90
+ }
91
+ /**
92
+ * Parsed section from skill content (internal)
93
+ */
94
+ export interface ParsedSection {
95
+ level: number;
96
+ title: string;
97
+ startLine: number;
98
+ lines: string[];
99
+ }
100
+ /**
101
+ * Resolved decomposer options with all required fields
102
+ */
103
+ export type ResolvedDecomposerOptions = Required<DecomposerOptions>;
104
+ //# sourceMappingURL=SkillDecomposer.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillDecomposer.types.d.ts","sourceRoot":"","sources":["../../../src/services/SkillDecomposer.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,SAAS,EAAE,eAAe,CAAA;IAE1B,2BAA2B;IAC3B,SAAS,EAAE,QAAQ,EAAE,CAAA;IAErB,wCAAwC;IACxC,aAAa,EAAE,OAAO,CAAA;IAEtB,yCAAyC;IACzC,KAAK,EAAE,kBAAkB,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAEhB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,oCAAoC;IACpC,SAAS,EAAE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ACjB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * SMI-1788: SkillDecomposer Types
3
+ *
4
+ * Type definitions for skill decomposition into sub-skills.
5
+ * Used by the Skillsmith Optimization Layer for transforming
6
+ * large skills into more performant versions.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=SkillDecomposer.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillDecomposer.types.js","sourceRoot":"","sources":["../../../src/services/SkillDecomposer.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}