@hasna/skills 0.1.26 → 0.1.29

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 (491) hide show
  1. package/LICENSE +1 -10
  2. package/README.md +141 -39
  3. package/bin/index.js +30122 -27575
  4. package/bin/mcp.js +22112 -18593
  5. package/dist/cli/cli.test-utils.d.ts +15 -0
  6. package/dist/cli/commands/auth.d.ts +2 -0
  7. package/dist/cli/commands/install.d.ts +1 -1
  8. package/dist/cli/commands/runtime-mcp.d.ts +4 -0
  9. package/dist/index.d.ts +9 -4
  10. package/dist/index.js +11607 -597
  11. package/dist/lib/auth-store.d.ts +13 -0
  12. package/dist/lib/installer.d.ts +58 -55
  13. package/dist/lib/mcp-contracts.d.ts +86 -0
  14. package/dist/lib/project-state.d.ts +43 -0
  15. package/dist/lib/registry-data/business-marketing.d.ts +2 -0
  16. package/dist/lib/registry-data/communication.d.ts +2 -0
  17. package/dist/lib/registry-data/content-generation.d.ts +2 -0
  18. package/dist/lib/registry-data/data-analysis.d.ts +2 -0
  19. package/dist/lib/registry-data/design-branding.d.ts +2 -0
  20. package/dist/lib/registry-data/development-tools.d.ts +2 -0
  21. package/dist/lib/registry-data/education-learning.d.ts +2 -0
  22. package/dist/lib/registry-data/event-management.d.ts +2 -0
  23. package/dist/lib/registry-data/finance-compliance.d.ts +2 -0
  24. package/dist/lib/registry-data/health-wellness.d.ts +2 -0
  25. package/dist/lib/registry-data/index.d.ts +2 -0
  26. package/dist/lib/registry-data/media-processing.d.ts +2 -0
  27. package/dist/lib/registry-data/productivity-organization.d.ts +2 -0
  28. package/dist/lib/registry-data/project-management.d.ts +2 -0
  29. package/dist/lib/registry-data/research-writing.d.ts +2 -0
  30. package/dist/lib/registry-data/science-academic.d.ts +2 -0
  31. package/dist/lib/registry-data/travel-lifestyle.d.ts +2 -0
  32. package/dist/lib/registry-data/web-browser.d.ts +2 -0
  33. package/dist/lib/registry-types.d.ts +27 -0
  34. package/dist/lib/registry.d.ts +6 -18
  35. package/dist/lib/remote-registry.d.ts +3 -0
  36. package/dist/lib/run-state.d.ts +60 -0
  37. package/dist/lib/skill-aliases.d.ts +17 -0
  38. package/dist/lib/skillinfo.d.ts +5 -1
  39. package/dist/mcp/discovery-tools.d.ts +2 -0
  40. package/dist/mcp/helpers.d.ts +26 -0
  41. package/dist/mcp/http.d.ts +10 -0
  42. package/dist/mcp/index.d.ts +3 -2
  43. package/dist/mcp/operation-tools.d.ts +2 -0
  44. package/dist/mcp/resource-meta-tools.d.ts +2 -0
  45. package/dist/mcp/schedule-tools.d.ts +2 -0
  46. package/dist/mcp/server.d.ts +4 -0
  47. package/dist/types/api.d.ts +7 -4
  48. package/package.json +23 -10
  49. package/skills/_common/http-client.ts +1 -1
  50. package/skills/_common/index.ts +2 -3
  51. package/skills/_common/install.sh +5 -110
  52. package/skills/_common/installer.ts +31 -282
  53. package/skills/_common/skill-install.ts +14 -181
  54. package/skills/ad-creative-pack/SKILL.md +45 -0
  55. package/skills/ad-creative-pack/package.json +14 -0
  56. package/skills/advanced-math/package.json +3 -1
  57. package/skills/advanced-math/src/calculators.ts +118 -0
  58. package/skills/advanced-math/src/cli.ts +130 -0
  59. package/skills/advanced-math/src/conversion.ts +90 -0
  60. package/skills/advanced-math/src/finance.ts +75 -0
  61. package/skills/advanced-math/src/formatting.ts +95 -0
  62. package/skills/advanced-math/src/index.ts +24 -702
  63. package/skills/advanced-math/src/runtime.ts +49 -0
  64. package/skills/advanced-math/src/symbolic.ts +110 -0
  65. package/skills/advanced-math/src/types.ts +36 -0
  66. package/skills/analyze-data/SKILL.md +2 -2
  67. package/skills/analyze-data/src/analysis.ts +401 -0
  68. package/skills/analyze-data/src/cli.ts +66 -0
  69. package/skills/analyze-data/src/formatters.ts +235 -0
  70. package/skills/analyze-data/src/index.ts +6 -1027
  71. package/skills/analyze-data/src/logger.ts +36 -0
  72. package/skills/analyze-data/src/parsers.ts +57 -0
  73. package/skills/analyze-data/src/stats.ts +151 -0
  74. package/skills/analyze-data/src/types.ts +85 -0
  75. package/skills/api-docs-portal/SKILL.md +46 -0
  76. package/skills/api-docs-portal/package.json +9 -0
  77. package/skills/api-test-suite/src/index.ts +13 -0
  78. package/skills/apidocs/package.json +1 -1
  79. package/skills/apidocs/src/index.ts +3 -0
  80. package/skills/audio/package.json +2 -3
  81. package/skills/audio-cleanup-lab/SKILL.md +2 -2
  82. package/skills/audio-extract/CLAUDE.md +1 -1
  83. package/skills/audio-transcript-pack/SKILL.md +43 -0
  84. package/skills/audio-transcript-pack/package.json +10 -0
  85. package/skills/blog-article/CLAUDE.md +12 -0
  86. package/skills/blog-article/SKILL.md +45 -0
  87. package/skills/{create-blog-article → blog-article}/package.json +3 -3
  88. package/skills/brand-kit/SKILL.md +45 -0
  89. package/skills/brand-kit/package.json +14 -0
  90. package/skills/brand-photo-shoot/SKILL.md +28 -0
  91. package/skills/brand-photo-shoot/package.json +10 -0
  92. package/skills/brand-style-guide/SKILL.md +2 -2
  93. package/skills/brand-style-guide/src/index.ts +0 -0
  94. package/skills/budget-variance-analyzer/SKILL.md +2 -2
  95. package/skills/businessactivity/package.json +1 -1
  96. package/skills/businessactivity/src/index.ts +3 -0
  97. package/skills/calendar-events/src/ai-parser.ts +103 -0
  98. package/skills/calendar-events/src/api.ts +157 -0
  99. package/skills/calendar-events/src/auth.ts +22 -0
  100. package/skills/calendar-events/src/config.ts +6 -0
  101. package/skills/calendar-events/src/format.ts +96 -0
  102. package/skills/calendar-events/src/help.ts +54 -0
  103. package/skills/calendar-events/src/index.ts +21 -524
  104. package/skills/calendar-events/src/logger.ts +34 -0
  105. package/skills/calendar-events/src/types.ts +67 -0
  106. package/skills/compress-video/SKILL.md +2 -2
  107. package/skills/consolelog/package.json +1 -1
  108. package/skills/consolelog/src/index.ts +3 -0
  109. package/skills/contract-review-report/SKILL.md +43 -0
  110. package/skills/contract-review-report/package.json +10 -0
  111. package/skills/convert/SKILL.md +2 -3
  112. package/skills/customer-feedback-report/SKILL.md +44 -0
  113. package/skills/customer-feedback-report/package.json +10 -0
  114. package/skills/dashboard-builder/package.json +3 -1
  115. package/skills/database-explorer/package.json +3 -1
  116. package/skills/deepresearch/README.md +4 -13
  117. package/skills/deploy/src/http-client.ts +1 -1
  118. package/skills/diff-viewer/package.json +4 -1
  119. package/skills/doc-generate/package.json +0 -1
  120. package/skills/doc-generate/src/ai.ts +50 -0
  121. package/skills/doc-generate/src/cli.ts +203 -0
  122. package/skills/doc-generate/src/dependencies.ts +44 -0
  123. package/skills/doc-generate/src/document-builder.ts +299 -0
  124. package/skills/doc-generate/src/index.ts +40 -764
  125. package/skills/doc-generate/src/markdown-parser.ts +125 -0
  126. package/skills/doc-generate/src/types.ts +68 -0
  127. package/skills/domainpurchase/SKILL.md +1 -1
  128. package/skills/domainpurchase/package.json +1 -1
  129. package/skills/domainpurchase/src/index.ts +3 -0
  130. package/skills/domainsearch/SKILL.md +1 -1
  131. package/skills/domainsearch/package.json +1 -1
  132. package/skills/domainsearch/src/index.ts +3 -0
  133. package/skills/email-sequence/SKILL.md +44 -0
  134. package/skills/email-sequence/package.json +14 -0
  135. package/skills/excel/CLAUDE.md +2 -2
  136. package/skills/experiment-power-calculator/package.json +3 -1
  137. package/skills/extract-invoice/src/cli.ts +97 -0
  138. package/skills/extract-invoice/src/extractor.ts +170 -0
  139. package/skills/extract-invoice/src/file-utils.ts +46 -0
  140. package/skills/extract-invoice/src/formatters.ts +144 -0
  141. package/skills/extract-invoice/src/index.ts +44 -629
  142. package/skills/extract-invoice/src/runtime.ts +46 -0
  143. package/skills/extract-invoice/src/types.ts +88 -0
  144. package/skills/folder-tree/package.json +3 -1
  145. package/skills/form-filler/package.json +3 -1
  146. package/skills/generate-api-client/package.json +3 -1
  147. package/skills/generate-api-client/src/generator.ts +47 -0
  148. package/skills/generate-api-client/src/index.ts +3 -777
  149. package/skills/generate-api-client/src/logger.ts +34 -0
  150. package/skills/generate-api-client/src/python-generator.ts +245 -0
  151. package/skills/generate-api-client/src/spec-loader.ts +48 -0
  152. package/skills/generate-api-client/src/type-mappers.ts +79 -0
  153. package/skills/generate-api-client/src/types.ts +76 -0
  154. package/skills/generate-api-client/src/typescript-generator.ts +247 -0
  155. package/skills/generate-book-cover/package.json +3 -1
  156. package/skills/generate-dockerfile/src/cli.ts +78 -0
  157. package/skills/generate-dockerfile/src/dockerfile-templates.ts +392 -0
  158. package/skills/generate-dockerfile/src/index.ts +12 -790
  159. package/skills/generate-dockerfile/src/logger.ts +30 -0
  160. package/skills/generate-dockerfile/src/project-detection.ts +68 -0
  161. package/skills/generate-dockerfile/src/support-files.ts +171 -0
  162. package/skills/generate-dockerfile/src/types.ts +29 -0
  163. package/skills/generate-documentation/src/ai.ts +131 -0
  164. package/skills/generate-documentation/src/cli.ts +71 -0
  165. package/skills/generate-documentation/src/code-parser.ts +300 -0
  166. package/skills/generate-documentation/src/file-processing.ts +182 -0
  167. package/skills/generate-documentation/src/index.ts +13 -753
  168. package/skills/generate-documentation/src/runtime.ts +35 -0
  169. package/skills/generate-documentation/src/types.ts +30 -0
  170. package/skills/generate-env/package.json +3 -1
  171. package/skills/generate-env/src/cli.ts +85 -0
  172. package/skills/generate-env/src/detection.ts +161 -0
  173. package/skills/generate-env/src/env-data.ts +66 -0
  174. package/skills/generate-env/src/generators.ts +240 -0
  175. package/skills/generate-env/src/index.ts +76 -676
  176. package/skills/generate-env/src/runtime.ts +30 -0
  177. package/skills/generate-env/src/types.ts +32 -0
  178. package/skills/generate-favicon/package.json +3 -1
  179. package/skills/generate-mock-data/package.json +3 -1
  180. package/skills/generate-mock-data/src/ai.ts +102 -0
  181. package/skills/generate-mock-data/src/formatters.ts +84 -0
  182. package/skills/generate-mock-data/src/generator.ts +377 -0
  183. package/skills/generate-mock-data/src/index.ts +15 -716
  184. package/skills/generate-mock-data/src/logger.ts +37 -0
  185. package/skills/generate-mock-data/src/presets.ts +110 -0
  186. package/skills/generate-mock-data/src/types.ts +21 -0
  187. package/skills/generate-pr-description/src/ai.ts +144 -0
  188. package/skills/generate-pr-description/src/cli.ts +80 -0
  189. package/skills/generate-pr-description/src/clipboard.ts +30 -0
  190. package/skills/generate-pr-description/src/formatters.ts +231 -0
  191. package/skills/generate-pr-description/src/git.ts +153 -0
  192. package/skills/generate-pr-description/src/index.ts +21 -714
  193. package/skills/generate-pr-description/src/types.ts +49 -0
  194. package/skills/generate-presentation/src/ai-clients.ts +61 -0
  195. package/skills/generate-presentation/src/cli.ts +126 -0
  196. package/skills/generate-presentation/src/index.ts +3 -751
  197. package/skills/generate-presentation/src/logger.ts +67 -0
  198. package/skills/generate-presentation/src/presentation-generator.ts +425 -0
  199. package/skills/generate-presentation/src/runtime.ts +6 -0
  200. package/skills/generate-presentation/src/security.ts +12 -0
  201. package/skills/generate-presentation/src/types.ts +28 -0
  202. package/skills/generate-qrcode/package.json +4 -1
  203. package/skills/generate-regex/package.json +3 -1
  204. package/skills/generate-resume/src/cli.ts +157 -0
  205. package/skills/generate-resume/src/index.ts +13 -917
  206. package/skills/generate-resume/src/parsers.ts +95 -0
  207. package/skills/generate-resume/src/renderers.ts +538 -0
  208. package/skills/generate-resume/src/security.ts +39 -0
  209. package/skills/generate-resume/src/types.ts +86 -0
  210. package/skills/generate-social-posts/src/ai.ts +88 -0
  211. package/skills/generate-social-posts/src/cli.ts +118 -0
  212. package/skills/generate-social-posts/src/exporters.ts +126 -0
  213. package/skills/generate-social-posts/src/generator.ts +130 -0
  214. package/skills/generate-social-posts/src/index.ts +19 -709
  215. package/skills/generate-social-posts/src/platforms.ts +39 -0
  216. package/skills/generate-social-posts/src/runtime.ts +34 -0
  217. package/skills/generate-social-posts/src/source.ts +116 -0
  218. package/skills/generate-social-posts/src/types.ts +58 -0
  219. package/skills/gif-maker/package.json +4 -1
  220. package/skills/github-manager/package.json +3 -1
  221. package/skills/gmail/CLAUDE.md +1 -1
  222. package/skills/highlight-reel-generator/src/index.ts +19 -0
  223. package/skills/hook/src/commands/create.ts +20 -845
  224. package/skills/hook/src/templates/root.ts +196 -0
  225. package/skills/hook/src/templates/source.ts +647 -0
  226. package/skills/http-server/package.json +3 -1
  227. package/skills/icon-pack/README.md +28 -0
  228. package/skills/icon-pack/SKILL.md +23 -0
  229. package/skills/icon-pack/package.json +29 -0
  230. package/skills/{audio → icon-pack}/tsconfig.json +10 -12
  231. package/skills/image/package.json +1 -2
  232. package/skills/implementation-agent/package.json +3 -1
  233. package/skills/implementation-agent/src/ai-generation.ts +225 -0
  234. package/skills/implementation-agent/src/index.ts +3 -960
  235. package/skills/implementation-agent/src/minimist.d.ts +15 -0
  236. package/skills/implementation-agent/src/templates.ts +686 -0
  237. package/skills/implementation-agent/src/types.ts +53 -0
  238. package/skills/implementation-plan/package.json +3 -1
  239. package/skills/implementation-todo/package.json +3 -1
  240. package/skills/invoice/package.json +1 -1
  241. package/skills/invoice/src/index.ts +3 -0
  242. package/skills/invoice-reconciliation/SKILL.md +42 -0
  243. package/skills/invoice-reconciliation/package.json +10 -0
  244. package/skills/landing-page-pack/SKILL.md +47 -0
  245. package/skills/landing-page-pack/package.json +14 -0
  246. package/skills/latex-table-generator/package.json +3 -1
  247. package/skills/logo-design/SKILL.md +25 -44
  248. package/skills/logo-design/package.json +3 -15
  249. package/skills/lorem-generator/package.json +3 -1
  250. package/skills/lorem-generator/src/index.ts +13 -0
  251. package/skills/managehook/package.json +1 -1
  252. package/skills/managehook/src/index.ts +3 -0
  253. package/skills/managemcp/package.json +1 -1
  254. package/skills/managemcp/src/index.ts +3 -0
  255. package/skills/manageskill/package.json +1 -1
  256. package/skills/manageskill/src/index.ts +3 -0
  257. package/skills/markdown-validator/package.json +3 -1
  258. package/skills/markdown-validator/src/index.ts +1 -4
  259. package/skills/market-research-report/SKILL.md +41 -0
  260. package/skills/market-research-report/package.json +10 -0
  261. package/skills/mcp-builder/package.json +4 -1
  262. package/skills/mcp-builder/src/ai-descriptions.ts +37 -0
  263. package/skills/mcp-builder/src/generators.ts +513 -0
  264. package/skills/mcp-builder/src/index.ts +7 -908
  265. package/skills/mcp-builder/src/minimist.d.ts +15 -0
  266. package/skills/mcp-builder/src/naming.ts +12 -0
  267. package/skills/mcp-builder/src/options.ts +170 -0
  268. package/skills/mcp-builder/src/templates.ts +149 -0
  269. package/skills/mcp-builder/src/types.ts +42 -0
  270. package/skills/meeting-pack/SKILL.md +43 -0
  271. package/skills/meeting-pack/package.json +10 -0
  272. package/skills/merge-pdfs/package.json +5 -1
  273. package/skills/migration-plan-pack/SKILL.md +45 -0
  274. package/skills/migration-plan-pack/package.json +10 -0
  275. package/skills/music/package.json +2 -3
  276. package/skills/music-album/SKILL.md +37 -0
  277. package/skills/music-album/package.json +10 -0
  278. package/skills/notion-manager/package.json +3 -1
  279. package/skills/npmpublish/CLAUDE.md +5 -8
  280. package/skills/npmpublish/README.md +5 -26
  281. package/skills/npmpublish/src/index.ts +9 -147
  282. package/skills/one-page-website/SKILL.md +46 -0
  283. package/skills/one-page-website/package.json +10 -0
  284. package/skills/one-page-website/tsconfig.json +8 -0
  285. package/skills/pdf-generate/src/cli.ts +162 -0
  286. package/skills/pdf-generate/src/html.ts +84 -0
  287. package/skills/pdf-generate/src/index.ts +11 -800
  288. package/skills/pdf-generate/src/markdown.ts +27 -0
  289. package/skills/pdf-generate/src/pdf-writer.ts +78 -0
  290. package/skills/pdf-generate/src/runtime.ts +34 -0
  291. package/skills/pdf-generate/src/security.ts +37 -0
  292. package/skills/pdf-generate/src/templates.ts +311 -0
  293. package/skills/pdf-generate/src/types.ts +28 -0
  294. package/skills/pdf-read/SKILL.md +10 -10
  295. package/skills/pdf-to-dataset/SKILL.md +45 -0
  296. package/skills/pdf-to-dataset/package.json +10 -0
  297. package/skills/pdf-to-markdown/SKILL.md +49 -0
  298. package/skills/pdf-to-markdown/package.json +10 -0
  299. package/skills/pdf-to-markdown/tsconfig.json +10 -0
  300. package/skills/performance-audit-report/SKILL.md +42 -0
  301. package/skills/performance-audit-report/package.json +10 -0
  302. package/skills/persona-based-adwriter/src/index.ts +19 -0
  303. package/skills/photo-album/SKILL.md +29 -0
  304. package/skills/photo-album/package.json +9 -0
  305. package/skills/photo-album/tsconfig.json +4 -0
  306. package/skills/pitch-deck/SKILL.md +43 -0
  307. package/skills/pitch-deck/package.json +9 -0
  308. package/skills/playlist-maker/SKILL.md +33 -0
  309. package/skills/playlist-maker/package.json +9 -0
  310. package/skills/playlist-maker/tsconfig.json +4 -0
  311. package/skills/product-mockup/SKILL.md +45 -0
  312. package/skills/product-mockup/package.json +3 -20
  313. package/skills/product-mockup/tsconfig.json +3 -5
  314. package/skills/project-retro-companion/src/index.ts +19 -0
  315. package/skills/proposal-pack/SKILL.md +45 -0
  316. package/skills/proposal-pack/package.json +10 -0
  317. package/skills/read-pdf/SKILL.md +5 -4
  318. package/skills/repo-onboarding-report/SKILL.md +42 -0
  319. package/skills/repo-onboarding-report/package.json +10 -0
  320. package/skills/sales-call-recapper/src/index.ts +20 -0
  321. package/skills/salescopy/package.json +1 -1
  322. package/skills/salescopy/src/index.ts +3 -0
  323. package/skills/scaffold-project/src/ai-detect.ts +136 -0
  324. package/skills/scaffold-project/src/file-generators.ts +292 -0
  325. package/skills/scaffold-project/src/index.ts +8 -991
  326. package/skills/scaffold-project/src/project-config.ts +338 -0
  327. package/skills/scaffold-project/src/templates.ts +173 -0
  328. package/skills/scaffold-project/src/types.ts +58 -0
  329. package/skills/scientific-figure-check/package.json +3 -1
  330. package/skills/sdk-generator/SKILL.md +45 -0
  331. package/skills/sdk-generator/package.json +10 -0
  332. package/skills/sdk-generator/tsconfig.json +8 -0
  333. package/skills/security-audit/src/index.ts +25 -6
  334. package/skills/security-audit-report/SKILL.md +40 -0
  335. package/skills/security-audit-report/package.json +10 -0
  336. package/skills/seo-content-pack/SKILL.md +44 -0
  337. package/skills/seo-content-pack/package.json +9 -0
  338. package/skills/short-video-pack/SKILL.md +30 -0
  339. package/skills/short-video-pack/package.json +10 -0
  340. package/skills/slack-assistant/package.json +3 -1
  341. package/skills/slide-deck-generator/SKILL.md +44 -0
  342. package/skills/slide-deck-generator/package.json +10 -0
  343. package/skills/sms/package.json +1 -1
  344. package/skills/sms/src/index.ts +15 -0
  345. package/skills/social-content-calendar/SKILL.md +45 -0
  346. package/skills/social-content-calendar/package.json +14 -0
  347. package/skills/split-pdf/package.json +4 -1
  348. package/skills/subtitle/package.json +2 -1
  349. package/skills/subtitle/src/index.ts +3 -0
  350. package/skills/terraform-generator/package.json +3 -1
  351. package/skills/test-suite-generator/SKILL.md +41 -0
  352. package/skills/test-suite-generator/package.json +10 -0
  353. package/skills/timesheet/package.json +1 -1
  354. package/skills/timesheet/src/index.ts +3 -0
  355. package/skills/transcript/SKILL.md +1 -8
  356. package/skills/validate-config/package.json +3 -1
  357. package/skills/video/package.json +6 -4
  358. package/skills/video-downloader/package.json +3 -1
  359. package/skills/video-highlight-pack/SKILL.md +44 -0
  360. package/skills/video-highlight-pack/package.json +10 -0
  361. package/skills/voiceover-jingle-pack/SKILL.md +28 -0
  362. package/skills/voiceover-jingle-pack/package.json +10 -0
  363. package/skills/watermark/package.json +6 -1
  364. package/skills/webcrawling/package.json +2 -1
  365. package/skills/write/SKILL.md +6 -6
  366. package/dist/server/serve.d.ts +0 -11
  367. package/skills/apidocs/.claude/settings.json +0 -5
  368. package/skills/audio/.env.example +0 -14
  369. package/skills/audio/QUICKSTART.md +0 -158
  370. package/skills/audio/README.md +0 -256
  371. package/skills/audio/src/index-local.ts +0 -206
  372. package/skills/audio/src/index.ts +0 -95
  373. package/skills/audio/src/providers/elevenlabs.ts +0 -115
  374. package/skills/audio/src/providers/google.ts +0 -116
  375. package/skills/audio/src/providers/minimax.ts +0 -83
  376. package/skills/audio/src/providers/openai.ts +0 -115
  377. package/skills/audio/src/types.ts +0 -79
  378. package/skills/audiobook-chapter-proofer/CLAUDE.md +0 -19
  379. package/skills/audiobook-chapter-proofer/package.json +0 -27
  380. package/skills/audiobook-chapter-proofer/src/index.ts +0 -285
  381. package/skills/browse/src/client.ts +0 -373
  382. package/skills/browse/src/index-local.ts +0 -430
  383. package/skills/browse/src/index.ts +0 -110
  384. package/skills/browse/src/sse-server.ts +0 -919
  385. package/skills/browse/src/types.ts +0 -104
  386. package/skills/consolelog/src/server/index.ts +0 -508
  387. package/skills/create-blog-article/CLAUDE.md +0 -19
  388. package/skills/create-blog-article/src/index.ts +0 -745
  389. package/skills/create-blog-article/tsconfig.json +0 -10
  390. package/skills/deepresearch/src/agents/query-generator.ts +0 -91
  391. package/skills/deepresearch/src/agents/synthesizer.ts +0 -111
  392. package/skills/deepresearch/src/index.ts +0 -224
  393. package/skills/deepresearch/src/research.ts +0 -166
  394. package/skills/deepresearch/src/services/anthropic.ts +0 -69
  395. package/skills/deepresearch/src/services/exa.ts +0 -108
  396. package/skills/deepresearch/src/services/firecrawl.ts +0 -88
  397. package/skills/deepresearch/src/services/openai.ts +0 -81
  398. package/skills/deepresearch/src/types.ts +0 -76
  399. package/skills/deepresearch/src/utils/file.ts +0 -111
  400. package/skills/deepresearch/src/utils/logger.ts +0 -84
  401. package/skills/domainpurchase/src/server/index.ts +0 -332
  402. package/skills/domainsearch/src/server/index.ts +0 -229
  403. package/skills/e2bswarm/README.md +0 -135
  404. package/skills/e2bswarm/SKILL.md +0 -118
  405. package/skills/e2bswarm/examples/tasks-example.json +0 -38
  406. package/skills/e2bswarm/package.json +0 -59
  407. package/skills/e2bswarm/src/commands/collect.ts +0 -135
  408. package/skills/e2bswarm/src/commands/install.ts +0 -164
  409. package/skills/e2bswarm/src/commands/kill.ts +0 -62
  410. package/skills/e2bswarm/src/commands/spawn.ts +0 -134
  411. package/skills/e2bswarm/src/commands/status.ts +0 -90
  412. package/skills/e2bswarm/src/commands/sync.ts +0 -208
  413. package/skills/e2bswarm/src/index.ts +0 -121
  414. package/skills/e2bswarm/src/lib/config.ts +0 -75
  415. package/skills/e2bswarm/src/lib/e2b.ts +0 -490
  416. package/skills/e2bswarm/src/lib/github.ts +0 -253
  417. package/skills/e2bswarm/src/lib/logger.ts +0 -41
  418. package/skills/e2bswarm/src/lib/paths.ts +0 -75
  419. package/skills/e2bswarm/src/lib/tasks.ts +0 -320
  420. package/skills/e2bswarm/src/types/index.ts +0 -107
  421. package/skills/e2bswarm/templates/codebox/e2b.Dockerfile +0 -38
  422. package/skills/e2bswarm/templates/codebox/e2b.toml +0 -3
  423. package/skills/e2bswarm/templates/setup.sh +0 -21
  424. package/skills/e2bswarm/tsconfig.json +0 -19
  425. package/skills/generate-book-cover/src/index.ts +0 -694
  426. package/skills/image/src/index-local.ts +0 -206
  427. package/skills/image/src/index.ts +0 -96
  428. package/skills/image/src/providers/google.ts +0 -79
  429. package/skills/image/src/providers/minimax.ts +0 -94
  430. package/skills/image/src/providers/openai.ts +0 -80
  431. package/skills/image/src/providers/xai.ts +0 -73
  432. package/skills/image/src/types.ts +0 -37
  433. package/skills/logo-design/CLAUDE.md +0 -30
  434. package/skills/logo-design/src/index.ts +0 -322
  435. package/skills/managehook/src/server/index.ts +0 -108
  436. package/skills/managemcp/src/server/index.ts +0 -108
  437. package/skills/manageskill/src/server/index.ts +0 -108
  438. package/skills/music/CLAUDE.md +0 -9
  439. package/skills/music/src/index.ts +0 -94
  440. package/skills/music/tsconfig.json +0 -10
  441. package/skills/pdf-read/src/index.ts +0 -320
  442. package/skills/product-mockup/CLAUDE.md +0 -19
  443. package/skills/product-mockup/src/index.ts +0 -290
  444. package/skills/read-pdf/src/index.ts +0 -388
  445. package/skills/remove-background/src/index.ts +0 -405
  446. package/skills/scaffold-project/my-app/.env.example +0 -2
  447. package/skills/scaffold-project/my-app/README.md +0 -72
  448. package/skills/scaffold-project/my-app/package.json +0 -29
  449. package/skills/scaffold-project/my-app/src/index.ts +0 -23
  450. package/skills/scaffold-project/my-app/tsconfig.json +0 -33
  451. package/skills/sound-effects/SKILL.md +0 -34
  452. package/skills/sound-effects/package.json +0 -21
  453. package/skills/sound-effects/src/index.ts +0 -172
  454. package/skills/sound-effects/tsconfig.json +0 -8
  455. package/skills/transcript/src/chunker.ts +0 -215
  456. package/skills/transcript/src/formatter.ts +0 -134
  457. package/skills/transcript/src/index-local.ts +0 -226
  458. package/skills/transcript/src/index.ts +0 -110
  459. package/skills/transcript/src/providers/elevenlabs.ts +0 -133
  460. package/skills/transcript/src/providers/gemini.ts +0 -192
  461. package/skills/transcript/src/providers/index.ts +0 -54
  462. package/skills/transcript/src/providers/openai.ts +0 -203
  463. package/skills/transcript/src/types.ts +0 -106
  464. package/skills/video/.env.example +0 -14
  465. package/skills/video/EXAMPLES.md +0 -266
  466. package/skills/video/LICENSE +0 -192
  467. package/skills/video/README.md +0 -174
  468. package/skills/video/src/cli.ts +0 -155
  469. package/skills/video/src/index-local.ts +0 -148
  470. package/skills/video/src/index.ts +0 -96
  471. package/skills/video/src/providers/google-veo.ts +0 -126
  472. package/skills/video/src/providers/index.ts +0 -22
  473. package/skills/video/src/providers/minimax.ts +0 -100
  474. package/skills/video/src/providers/openai-sora.ts +0 -164
  475. package/skills/video/src/providers/runway.ts +0 -159
  476. package/skills/video/src/types.ts +0 -35
  477. package/skills/video/tsconfig.json +0 -22
  478. package/skills/voiceover-casting-assistant/CLAUDE.md +0 -19
  479. package/skills/voiceover-casting-assistant/package.json +0 -27
  480. package/skills/voiceover-casting-assistant/src/index.ts +0 -255
  481. package/skills/voiceover-casting-assistant/tsconfig.json +0 -10
  482. package/skills/webcrawling/src/commands/config.ts +0 -34
  483. package/skills/webcrawling/src/commands/crawl.ts +0 -33
  484. package/skills/webcrawling/src/commands/scrape.ts +0 -32
  485. package/skills/webcrawling/src/commands/sessions.ts +0 -42
  486. package/skills/webcrawling/src/lib/crawler.ts +0 -174
  487. package/skills/webcrawling/src/lib/storage.ts +0 -130
  488. package/skills/webcrawling/src/types/index.ts +0 -45
  489. package/skills/webcrawling/src/utils/logger.ts +0 -30
  490. package/skills/webcrawling/src/utils/paths.ts +0 -28
  491. /package/skills/{audiobook-chapter-proofer → blog-article}/tsconfig.json +0 -0
@@ -5,723 +5,22 @@
5
5
  */
6
6
 
7
7
  import { parseArgs } from "util";
8
- import { mkdirSync, appendFileSync, existsSync, readFileSync } from "fs";
9
- import { join, dirname, extname } from "path";
10
- import { randomUUID } from "crypto";
11
- import OpenAI from "openai";
12
-
13
- // Types
14
- type Preset = "users" | "products" | "orders" | "companies" | "articles" | "reviews" | "events" | "transactions";
15
- type OutputFormat = "json" | "csv" | "sql" | "typescript";
16
- type Locale = "en-US" | "de-DE" | "ja-JP" | "fr-FR" | "es-ES" | "pt-BR" | "it-IT" | "nl-NL" | "sv-SE" | "pl-PL";
17
-
18
- interface GenerateOptions {
19
- preset?: Preset;
20
- count: number;
21
- schema?: string;
22
- format: OutputFormat;
23
- locale: Locale;
24
- seed?: string;
25
- realistic: boolean;
26
- output?: string;
27
- table: string;
28
- }
29
-
30
- interface SchemaField {
31
- [key: string]: string;
32
- }
33
-
34
- // Constants
35
- const SKILL_NAME = "generate-mock-data";
36
- const SESSION_ID = randomUUID().slice(0, 8);
37
-
38
- // Use SKILLS_OUTPUT_DIR from CLI if available, otherwise fall back to cwd
39
- const SKILLS_OUTPUT_DIR = process.env.SKILLS_OUTPUT_DIR || join(process.cwd(), ".skills");
40
- const EXPORTS_DIR = join(SKILLS_OUTPUT_DIR, "exports", SKILL_NAME);
41
- const LOGS_DIR = join(SKILLS_OUTPUT_DIR, "logs", SKILL_NAME);
42
-
43
- // Session timestamp for log filename
44
- const SESSION_TIMESTAMP = new Date().toISOString().replace(/[:.]/g, "_").replace(/-/g, "_").slice(0, 19).toLowerCase();
45
-
46
- // Ensure directories exist
47
- function ensureDir(dir: string) {
48
- if (!existsSync(dir)) {
49
- mkdirSync(dir, { recursive: true });
50
- }
51
- }
52
-
53
- // Logger
54
- function log(message: string, level: "info" | "error" | "success" = "info") {
55
- const timestamp = new Date().toISOString();
56
- const logFile = join(LOGS_DIR, `log_${SESSION_TIMESTAMP}_${SESSION_ID}.log`);
57
-
58
- ensureDir(LOGS_DIR);
59
-
60
- const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}\n`;
61
- appendFileSync(logFile, logEntry);
62
-
63
- const prefix = level === "error" ? "❌" : level === "success" ? "✅" : "ℹ️";
64
- console.log(`${prefix} ${message}`);
65
- }
66
-
67
- // Preset schemas
68
- const PRESET_SCHEMAS: Record<Preset, SchemaField> = {
69
- users: {
70
- id: "uuid",
71
- firstName: "firstName",
72
- lastName: "lastName",
73
- email: "email",
74
- phone: "phone",
75
- dateOfBirth: "date",
76
- username: "username",
77
- avatarUrl: "avatarUrl",
78
- address: "address",
79
- city: "city",
80
- state: "state",
81
- zipCode: "zipCode",
82
- country: "country",
83
- },
84
- products: {
85
- id: "uuid",
86
- name: "productName",
87
- description: "paragraph",
88
- price: "price",
89
- category: "category",
90
- sku: "sku",
91
- stock: "number",
92
- brand: "company",
93
- imageUrl: "imageUrl",
94
- rating: "rating",
95
- },
96
- orders: {
97
- orderId: "uuid",
98
- customerId: "uuid",
99
- customerName: "name",
100
- customerEmail: "email",
101
- orderDate: "date",
102
- items: "orderItems",
103
- subtotal: "price",
104
- tax: "price",
105
- shipping: "price",
106
- total: "price",
107
- status: "orderStatus",
108
- trackingNumber: "trackingNumber",
109
- },
110
- companies: {
111
- id: "uuid",
112
- name: "company",
113
- industry: "industry",
114
- employees: "number",
115
- foundedYear: "year",
116
- revenue: "price",
117
- website: "url",
118
- description: "paragraph",
119
- logoUrl: "imageUrl",
120
- address: "address",
121
- city: "city",
122
- country: "country",
123
- },
124
- articles: {
125
- id: "uuid",
126
- title: "title",
127
- author: "name",
128
- content: "paragraph",
129
- excerpt: "sentence",
130
- publishedDate: "date",
131
- tags: "tags",
132
- category: "category",
133
- readingTime: "number",
134
- viewCount: "number",
135
- imageUrl: "imageUrl",
136
- },
137
- reviews: {
138
- id: "uuid",
139
- reviewerName: "name",
140
- rating: "rating",
141
- title: "sentence",
142
- text: "paragraph",
143
- date: "date",
144
- verifiedPurchase: "boolean",
145
- helpfulCount: "number",
146
- productId: "uuid",
147
- },
148
- events: {
149
- id: "uuid",
150
- name: "title",
151
- description: "paragraph",
152
- startDate: "date",
153
- endDate: "date",
154
- location: "address",
155
- organizer: "name",
156
- category: "category",
157
- attendees: "number",
158
- ticketPrice: "price",
159
- status: "eventStatus",
160
- },
161
- transactions: {
162
- transactionId: "uuid",
163
- amount: "price",
164
- currency: "currency",
165
- type: "transactionType",
166
- date: "date",
167
- description: "sentence",
168
- fromAccount: "accountNumber",
169
- toAccount: "accountNumber",
170
- status: "transactionStatus",
171
- balance: "price",
172
- },
173
- };
174
-
175
- // Seeded random number generator
176
- class SeededRandom {
177
- private seed: number;
178
-
179
- constructor(seed: string) {
180
- this.seed = this.hashCode(seed);
181
- }
182
-
183
- private hashCode(str: string): number {
184
- let hash = 0;
185
- for (let i = 0; i < str.length; i++) {
186
- const char = str.charCodeAt(i);
187
- hash = ((hash << 5) - hash) + char;
188
- hash = hash & hash;
189
- }
190
- return Math.abs(hash);
191
- }
192
-
193
- next(): number {
194
- this.seed = (this.seed * 9301 + 49297) % 233280;
195
- return this.seed / 233280;
196
- }
197
-
198
- nextInt(min: number, max: number): number {
199
- return Math.floor(this.next() * (max - min + 1)) + min;
200
- }
201
-
202
- choice<T>(array: T[]): T {
203
- return array[this.nextInt(0, array.length - 1)];
204
- }
205
- }
206
-
207
- // Built-in data generators
208
- class DataGenerator {
209
- private random: SeededRandom | null;
210
- private locale: Locale;
211
-
212
- constructor(seed?: string, locale: Locale = "en-US") {
213
- this.random = seed ? new SeededRandom(seed) : null;
214
- this.locale = locale;
215
- }
216
-
217
- private rand(): number {
218
- return this.random ? this.random.next() : Math.random();
219
- }
220
-
221
- private randInt(min: number, max: number): number {
222
- return this.random ? this.random.nextInt(min, max) : Math.floor(Math.random() * (max - min + 1)) + min;
223
- }
224
-
225
- private choice<T>(array: T[]): T {
226
- return this.random ? this.random.choice(array) : array[Math.floor(Math.random() * array.length)];
227
- }
228
-
229
- // Locale-specific data
230
- private getFirstNames(): string[] {
231
- const names: Record<string, string[]> = {
232
- "en-US": ["James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph", "Thomas", "Christopher", "Mary", "Patricia", "Jennifer", "Linda", "Elizabeth", "Barbara", "Susan", "Jessica", "Sarah", "Karen"],
233
- "de-DE": ["Lukas", "Leon", "Tim", "Paul", "Felix", "Jonas", "Maximilian", "Luis", "Ben", "Noah", "Emma", "Mia", "Hannah", "Sofia", "Anna", "Lena", "Lea", "Marie", "Lina", "Emily"],
234
- "ja-JP": ["Haruto", "Sota", "Yuto", "Yuki", "Kaito", "Takumi", "Riku", "Sora", "Hinata", "Yui", "Hina", "Sakura", "Yuna", "Aoi", "Miyu", "Rin", "Mei", "Mio", "Nanami", "Riko"],
235
- "fr-FR": ["Gabriel", "Louis", "Raphael", "Arthur", "Lucas", "Jules", "Adam", "Hugo", "Nathan", "Tom", "Emma", "Louise", "Alice", "Chloe", "Lea", "Manon", "Rose", "Jade", "Clara", "Anna"],
236
- "es-ES": ["Lucas", "Hugo", "Martin", "Mateo", "Leo", "Daniel", "Alejandro", "Pablo", "Manuel", "Adrian", "Lucia", "Maria", "Sofia", "Julia", "Paula", "Emma", "Martina", "Valeria", "Olivia", "Sara"],
237
- };
238
- return names[this.locale] || names["en-US"];
239
- }
240
-
241
- private getLastNames(): string[] {
242
- const names: Record<string, string[]> = {
243
- "en-US": ["Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez", "Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin"],
244
- "de-DE": ["Müller", "Schmidt", "Schneider", "Fischer", "Weber", "Meyer", "Wagner", "Becker", "Schulz", "Hoffmann", "Schäfer", "Koch", "Bauer", "Richter", "Klein", "Wolf", "Schröder", "Neumann", "Schwarz", "Zimmermann"],
245
- "ja-JP": ["Sato", "Suzuki", "Takahashi", "Tanaka", "Watanabe", "Ito", "Yamamoto", "Nakamura", "Kobayashi", "Kato", "Yoshida", "Yamada", "Sasaki", "Yamaguchi", "Saito", "Matsumoto", "Inoue", "Kimura", "Hayashi", "Shimizu"],
246
- "fr-FR": ["Martin", "Bernard", "Dubois", "Thomas", "Robert", "Richard", "Petit", "Durand", "Leroy", "Moreau", "Simon", "Laurent", "Lefebvre", "Michel", "Garcia", "David", "Bertrand", "Roux", "Vincent", "Fournier"],
247
- "es-ES": ["García", "Rodríguez", "González", "Fernández", "López", "Martínez", "Sánchez", "Pérez", "Gómez", "Martín", "Jiménez", "Ruiz", "Hernández", "Díaz", "Moreno", "Muñoz", "Álvarez", "Romero", "Alonso", "Gutiérrez"],
248
- };
249
- return names[this.locale] || names["en-US"];
250
- }
251
-
252
- private getCities(): string[] {
253
- const cities: Record<string, string[]> = {
254
- "en-US": ["New York", "Los Angeles", "Chicago", "Houston", "Phoenix", "Philadelphia", "San Antonio", "San Diego", "Dallas", "San Jose"],
255
- "de-DE": ["Berlin", "Hamburg", "München", "Köln", "Frankfurt", "Stuttgart", "Düsseldorf", "Dortmund", "Essen", "Leipzig"],
256
- "ja-JP": ["Tokyo", "Osaka", "Nagoya", "Sapporo", "Fukuoka", "Kobe", "Kyoto", "Yokohama", "Kawasaki", "Saitama"],
257
- "fr-FR": ["Paris", "Marseille", "Lyon", "Toulouse", "Nice", "Nantes", "Strasbourg", "Montpellier", "Bordeaux", "Lille"],
258
- "es-ES": ["Madrid", "Barcelona", "Valencia", "Sevilla", "Zaragoza", "Málaga", "Murcia", "Palma", "Las Palmas", "Bilbao"],
259
- };
260
- return cities[this.locale] || cities["en-US"];
261
- }
262
-
263
- private getCountries(): string[] {
264
- const countries: Record<string, string[]> = {
265
- "en-US": ["United States", "Canada", "United Kingdom", "Australia", "New Zealand"],
266
- "de-DE": ["Deutschland", "Österreich", "Schweiz", "Luxemburg", "Belgien"],
267
- "ja-JP": ["日本", "アメリカ", "中国", "韓国", "オーストラリア"],
268
- "fr-FR": ["France", "Belgique", "Suisse", "Canada", "Luxembourg"],
269
- "es-ES": ["España", "México", "Argentina", "Colombia", "Chile"],
270
- };
271
- return countries[this.locale] || countries["en-US"];
272
- }
273
-
274
- uuid(): string {
275
- return randomUUID();
276
- }
277
-
278
- string(length: number = 10): string {
279
- const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
280
- let result = "";
281
- for (let i = 0; i < length; i++) {
282
- result += chars.charAt(this.randInt(0, chars.length - 1));
283
- }
284
- return result;
285
- }
286
-
287
- number(min: number = 0, max: number = 1000): number {
288
- return this.randInt(min, max);
289
- }
290
-
291
- boolean(): boolean {
292
- return this.rand() > 0.5;
293
- }
294
-
295
- email(firstName?: string, lastName?: string): string {
296
- const first = firstName || this.firstName();
297
- const last = lastName || this.lastName();
298
- const domains = ["gmail.com", "yahoo.com", "outlook.com", "hotmail.com", "example.com"];
299
- return `${first.toLowerCase()}.${last.toLowerCase()}@${this.choice(domains)}`;
300
- }
301
-
302
- phone(): string {
303
- const formats: Record<string, () => string> = {
304
- "en-US": () => `+1-${this.randInt(200, 999)}-${this.randInt(200, 999)}-${this.randInt(1000, 9999)}`,
305
- "de-DE": () => `+49-${this.randInt(30, 89)}-${this.randInt(10000000, 99999999)}`,
306
- "ja-JP": () => `+81-${this.randInt(3, 9)}-${this.randInt(1000, 9999)}-${this.randInt(1000, 9999)}`,
307
- "fr-FR": () => `+33-${this.randInt(1, 9)}-${this.randInt(10, 99)}-${this.randInt(10, 99)}-${this.randInt(10, 99)}-${this.randInt(10, 99)}`,
308
- "es-ES": () => `+34-${this.randInt(600, 799)}-${this.randInt(100, 999)}-${this.randInt(100, 999)}`,
309
- };
310
- const format = formats[this.locale] || formats["en-US"];
311
- return format();
312
- }
313
-
314
- url(): string {
315
- const protocols = ["https://"];
316
- const domains = ["example.com", "test.com", "demo.com", "sample.org", "mock.io"];
317
- return `${this.choice(protocols)}${this.choice(domains)}`;
318
- }
319
-
320
- date(): string {
321
- const start = new Date(2020, 0, 1).getTime();
322
- const end = new Date().getTime();
323
- const randomTime = start + this.rand() * (end - start);
324
- return new Date(randomTime).toISOString();
325
- }
326
-
327
- firstName(): string {
328
- return this.choice(this.getFirstNames());
329
- }
330
-
331
- lastName(): string {
332
- return this.choice(this.getLastNames());
333
- }
334
-
335
- name(): string {
336
- return `${this.firstName()} ${this.lastName()}`;
337
- }
338
-
339
- username(): string {
340
- return `${this.firstName().toLowerCase()}${this.randInt(100, 9999)}`;
341
- }
342
-
343
- address(): string {
344
- return `${this.randInt(1, 9999)} ${this.choice(["Main", "Oak", "Pine", "Maple", "Cedar", "Elm", "Park", "Washington"])} ${this.choice(["St", "Ave", "Rd", "Blvd", "Dr", "Ln", "Way"])}`;
345
- }
346
-
347
- city(): string {
348
- return this.choice(this.getCities());
349
- }
350
-
351
- state(): string {
352
- const states = ["CA", "TX", "FL", "NY", "PA", "IL", "OH", "GA", "NC", "MI"];
353
- return this.choice(states);
354
- }
355
-
356
- zipCode(): string {
357
- return this.randInt(10000, 99999).toString();
358
- }
359
-
360
- country(): string {
361
- return this.choice(this.getCountries());
362
- }
363
-
364
- company(): string {
365
- const prefixes = ["Tech", "Global", "Digital", "Smart", "Dynamic", "Advanced", "Premier"];
366
- const suffixes = ["Solutions", "Systems", "Corp", "Industries", "Group", "Enterprises", "Technologies"];
367
- return `${this.choice(prefixes)} ${this.choice(suffixes)}`;
368
- }
369
-
370
- price(): string {
371
- return (this.randInt(100, 999999) / 100).toFixed(2);
372
- }
373
-
374
- paragraph(): string {
375
- const words = ["lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit", "sed", "do", "eiusmod", "tempor", "incididunt", "ut", "labore", "et", "dolore", "magna", "aliqua"];
376
- const length = this.randInt(20, 50);
377
- let paragraph = "";
378
- for (let i = 0; i < length; i++) {
379
- paragraph += this.choice(words) + " ";
380
- }
381
- return paragraph.trim().charAt(0).toUpperCase() + paragraph.trim().slice(1) + ".";
382
- }
383
-
384
- sentence(): string {
385
- const words = ["lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
386
- const length = this.randInt(5, 12);
387
- let sentence = "";
388
- for (let i = 0; i < length; i++) {
389
- sentence += this.choice(words) + " ";
390
- }
391
- return sentence.trim().charAt(0).toUpperCase() + sentence.trim().slice(1) + ".";
392
- }
393
-
394
- productName(): string {
395
- const adjectives = ["Premium", "Deluxe", "Professional", "Advanced", "Ultimate", "Essential", "Classic"];
396
- const products = ["Laptop", "Phone", "Tablet", "Monitor", "Keyboard", "Mouse", "Headphones", "Speaker", "Camera", "Watch"];
397
- return `${this.choice(adjectives)} ${this.choice(products)}`;
398
- }
399
-
400
- category(): string {
401
- return this.choice(["Electronics", "Clothing", "Food", "Books", "Sports", "Home", "Garden", "Toys", "Automotive", "Health"]);
402
- }
403
-
404
- sku(): string {
405
- return `SKU-${this.randInt(10000, 99999)}`;
406
- }
407
-
408
- imageUrl(): string {
409
- return `https://picsum.photos/seed/${this.randInt(1, 1000)}/800/600`;
410
- }
411
-
412
- avatarUrl(): string {
413
- return `https://i.pravatar.cc/300?u=${this.randInt(1, 10000)}`;
414
- }
415
-
416
- rating(): number {
417
- return this.randInt(1, 5);
418
- }
419
-
420
- orderItems(): string {
421
- const count = this.randInt(1, 5);
422
- const items = [];
423
- for (let i = 0; i < count; i++) {
424
- items.push(`${this.productName()} (qty: ${this.randInt(1, 3)})`);
425
- }
426
- return items.join(", ");
427
- }
428
-
429
- orderStatus(): string {
430
- return this.choice(["pending", "processing", "shipped", "delivered", "cancelled"]);
431
- }
432
-
433
- trackingNumber(): string {
434
- return `TRK${this.randInt(100000000, 999999999)}`;
435
- }
436
-
437
- industry(): string {
438
- return this.choice(["Technology", "Healthcare", "Finance", "Retail", "Manufacturing", "Education", "Entertainment", "Hospitality", "Transportation", "Energy"]);
439
- }
440
-
441
- year(): number {
442
- return this.randInt(1990, 2024);
443
- }
444
-
445
- title(): string {
446
- const words = ["How to", "The Best", "Top 10", "Guide to", "Understanding", "Introduction to", "Mastering", "Essential"];
447
- const topics = ["Technology", "Business", "Marketing", "Design", "Programming", "Leadership", "Innovation", "Strategy"];
448
- return `${this.choice(words)} ${this.choice(topics)}`;
449
- }
450
-
451
- tags(): string {
452
- const allTags = ["technology", "business", "marketing", "design", "development", "productivity", "innovation", "strategy", "leadership", "education"];
453
- const count = this.randInt(2, 5);
454
- const selected = [];
455
- for (let i = 0; i < count; i++) {
456
- selected.push(this.choice(allTags));
457
- }
458
- return selected.join(", ");
459
- }
460
-
461
- eventStatus(): string {
462
- return this.choice(["upcoming", "ongoing", "completed", "cancelled"]);
463
- }
464
-
465
- currency(): string {
466
- return this.choice(["USD", "EUR", "GBP", "JPY", "CAD", "AUD"]);
467
- }
468
-
469
- transactionType(): string {
470
- return this.choice(["debit", "credit", "transfer", "payment", "refund"]);
471
- }
472
-
473
- accountNumber(): string {
474
- return `${this.randInt(1000, 9999)}-${this.randInt(1000, 9999)}-${this.randInt(1000, 9999)}`;
475
- }
476
-
477
- transactionStatus(): string {
478
- return this.choice(["pending", "completed", "failed", "cancelled"]);
479
- }
480
-
481
- generateField(fieldType: string): any {
482
- switch (fieldType) {
483
- case "string": return this.string();
484
- case "number": return this.number();
485
- case "boolean": return this.boolean();
486
- case "email": return this.email();
487
- case "phone": return this.phone();
488
- case "url": return this.url();
489
- case "date": return this.date();
490
- case "uuid": return this.uuid();
491
- case "name": return this.name();
492
- case "firstName": return this.firstName();
493
- case "lastName": return this.lastName();
494
- case "username": return this.username();
495
- case "address": return this.address();
496
- case "city": return this.city();
497
- case "state": return this.state();
498
- case "zipCode": return this.zipCode();
499
- case "country": return this.country();
500
- case "company": return this.company();
501
- case "price": return this.price();
502
- case "paragraph": return this.paragraph();
503
- case "sentence": return this.sentence();
504
- case "productName": return this.productName();
505
- case "category": return this.category();
506
- case "sku": return this.sku();
507
- case "imageUrl": return this.imageUrl();
508
- case "avatarUrl": return this.avatarUrl();
509
- case "rating": return this.rating();
510
- case "orderItems": return this.orderItems();
511
- case "orderStatus": return this.orderStatus();
512
- case "trackingNumber": return this.trackingNumber();
513
- case "industry": return this.industry();
514
- case "year": return this.year();
515
- case "title": return this.title();
516
- case "tags": return this.tags();
517
- case "eventStatus": return this.eventStatus();
518
- case "currency": return this.currency();
519
- case "transactionType": return this.transactionType();
520
- case "accountNumber": return this.accountNumber();
521
- case "transactionStatus": return this.transactionStatus();
522
- default: return this.string();
523
- }
524
- }
525
- }
526
-
527
- // Generate data using built-in generators
528
- async function generateDataBuiltin(
529
- schema: SchemaField,
530
- count: number,
531
- seed?: string,
532
- locale: Locale = "en-US"
533
- ): Promise<any[]> {
534
- const generator = new DataGenerator(seed, locale);
535
- const data = [];
536
-
537
- for (let i = 0; i < count; i++) {
538
- const record: any = {};
539
- for (const [field, type] of Object.entries(schema)) {
540
- record[field] = generator.generateField(type);
541
- }
542
- data.push(record);
543
- }
544
-
545
- return data;
546
- }
547
-
548
- // Generate data using AI (OpenAI GPT-4o-mini)
549
- async function generateDataAI(
550
- schema: SchemaField,
551
- count: number,
552
- locale: Locale = "en-US"
553
- ): Promise<any[]> {
554
- const apiKey = process.env.OPENAI_API_KEY;
555
- if (!apiKey) {
556
- throw new Error("OPENAI_API_KEY environment variable is required for AI mode");
557
- }
558
-
559
- const openai = new OpenAI({ apiKey });
560
-
561
- log(`Generating ${count} records using AI (GPT-4o-mini)...`);
562
-
563
- const schemaDescription = Object.entries(schema)
564
- .map(([field, type]) => `- ${field}: ${type}`)
565
- .join("\n");
566
-
567
- const prompt = `Generate ${count} realistic mock data records as a JSON array.
568
-
569
- Schema:
570
- ${schemaDescription}
571
-
572
- Requirements:
573
- - Return ONLY a valid JSON array of objects
574
- - Each object must have all fields from the schema
575
- - Data should be realistic and diverse
576
- - Use ${locale} locale for localized data (names, addresses, phone numbers)
577
- - No explanations, just the JSON array
578
-
579
- Example format:
580
- [
581
- { "field1": "value1", "field2": "value2" },
582
- { "field1": "value3", "field2": "value4" }
583
- ]`;
584
-
585
- try {
586
- // Split into batches if count > 50 to avoid token limits
587
- const batchSize = Math.min(count, 50);
588
- const batches = Math.ceil(count / batchSize);
589
- const allData: any[] = [];
590
-
591
- for (let batch = 0; batch < batches; batch++) {
592
- const currentBatchSize = Math.min(batchSize, count - allData.length);
593
-
594
- log(`Generating batch ${batch + 1}/${batches} (${currentBatchSize} records)...`);
595
-
596
- const batchPrompt = prompt.replace(`Generate ${count}`, `Generate ${currentBatchSize}`);
597
-
598
- const completion = await openai.chat.completions.create({
599
- model: "gpt-4o-mini",
600
- messages: [
601
- {
602
- role: "system",
603
- content: "You are a data generator that returns only valid JSON arrays. No explanations, no markdown, just JSON.",
604
- },
605
- {
606
- role: "user",
607
- content: batchPrompt,
608
- },
609
- ],
610
- temperature: 0.8,
611
- });
612
-
613
- const content = completion.choices[0].message.content || "[]";
614
-
615
- // Clean up response (remove markdown code blocks if present)
616
- const cleanContent = content
617
- .replace(/```json\n?/g, "")
618
- .replace(/```\n?/g, "")
619
- .trim();
620
-
621
- const batchData = JSON.parse(cleanContent);
622
-
623
- if (!Array.isArray(batchData)) {
624
- throw new Error("AI response is not a JSON array");
625
- }
626
-
627
- allData.push(...batchData);
628
-
629
- // Log cost estimate
630
- const inputTokens = completion.usage?.prompt_tokens || 0;
631
- const outputTokens = completion.usage?.completion_tokens || 0;
632
- const cost = (inputTokens * 0.00015 / 1000) + (outputTokens * 0.0006 / 1000);
633
- log(`Batch ${batch + 1} cost: $${cost.toFixed(4)}`);
634
- }
635
-
636
- return allData.slice(0, count);
637
- } catch (error) {
638
- if (error instanceof Error) {
639
- throw new Error(`AI generation failed: ${error.message}`);
640
- }
641
- throw error;
642
- }
643
- }
644
-
645
- // Format data as JSON
646
- function formatJSON(data: any[]): string {
647
- return JSON.stringify(data, null, 2);
648
- }
649
-
650
- // Format data as CSV
651
- function formatCSV(data: any[]): string {
652
- if (data.length === 0) return "";
653
-
654
- const headers = Object.keys(data[0]);
655
- const rows = data.map(record =>
656
- headers.map(header => {
657
- const value = record[header];
658
- // Escape quotes and wrap in quotes if contains comma or quote
659
- if (typeof value === "string" && (value.includes(",") || value.includes('"') || value.includes("\n"))) {
660
- return `"${value.replace(/"/g, '""')}"`;
661
- }
662
- return value;
663
- }).join(",")
664
- );
665
-
666
- return [headers.join(","), ...rows].join("\n");
667
- }
668
-
669
- // Format data as SQL INSERT statements
670
- function formatSQL(data: any[], tableName: string): string {
671
- if (data.length === 0) return "";
672
-
673
- const fields = Object.keys(data[0]);
674
- const fieldList = fields.join(", ");
675
-
676
- const values = data.map(record =>
677
- `(${fields.map(field => {
678
- const value = record[field];
679
- if (value === null || value === undefined) {
680
- return "NULL";
681
- }
682
- if (typeof value === "string") {
683
- return `'${value.replace(/'/g, "''")}'`;
684
- }
685
- if (typeof value === "boolean") {
686
- return value ? "TRUE" : "FALSE";
687
- }
688
- return value;
689
- }).join(", ")})`
690
- );
691
-
692
- return `INSERT INTO ${tableName} (${fieldList}) VALUES\n${values.join(",\n")};`;
693
- }
694
-
695
- // Format data as TypeScript
696
- function formatTypeScript(data: any[]): string {
697
- if (data.length === 0) return "";
698
-
699
- // Generate interface from first record
700
- const sample = data[0];
701
- const interfaceFields = Object.entries(sample)
702
- .map(([key, value]) => {
703
- let type = typeof value;
704
- if (type === "object" && value === null) {
705
- type = "any";
706
- }
707
- return ` ${key}: ${type};`;
708
- })
709
- .join("\n");
710
-
711
- const interfaceCode = `interface MockData {\n${interfaceFields}\n}`;
712
- const dataCode = `export const mockData: MockData[] = ${JSON.stringify(data, null, 2)};`;
713
-
714
- return `${interfaceCode}\n\n${dataCode}`;
715
- }
716
-
717
- // Generate output filename
718
- function generateOutputFilename(format: OutputFormat): string {
719
- const timestamp = new Date().toISOString().replace(/[:.]/g, "_").replace(/-/g, "_").slice(0, 19).toLowerCase();
720
- const extension = format === "typescript" ? "ts" : format;
721
- return join(EXPORTS_DIR, `mock_data_${timestamp}.${extension}`);
722
- }
8
+ import { existsSync, readFileSync } from "fs";
9
+ import { dirname, join } from "path";
10
+
11
+ import { generateDataAI } from "./ai";
12
+ import {
13
+ formatCSV,
14
+ formatJSON,
15
+ formatSQL,
16
+ formatTypeScript,
17
+ generateOutputFilename,
18
+ } from "./formatters";
19
+ import { generateDataBuiltin } from "./generator";
20
+ import { ensureDir, log, LOGS_DIR, SESSION_ID, SESSION_TIMESTAMP } from "./logger";
21
+ import { PRESET_SCHEMAS } from "./presets";
22
+ import type { Locale, OutputFormat, Preset, SchemaField } from "./types";
723
23
 
724
- // Main function
725
24
  async function main() {
726
25
  const { values, positionals } = parseArgs({
727
26
  args: Bun.argv.slice(2),