llm-content-creator 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/README.md +309 -0
  2. package/dist/application/workflow/SyncExecutor.d.ts +75 -0
  3. package/dist/application/workflow/SyncExecutor.d.ts.map +1 -0
  4. package/dist/application/workflow/SyncExecutor.js +370 -0
  5. package/dist/application/workflow/SyncExecutor.js.map +1 -0
  6. package/dist/application/workflow/types.d.ts +46 -0
  7. package/dist/application/workflow/types.d.ts.map +1 -0
  8. package/dist/application/workflow/types.js +7 -0
  9. package/dist/application/workflow/types.js.map +1 -0
  10. package/dist/config/index.d.ts +173 -0
  11. package/dist/config/index.d.ts.map +1 -0
  12. package/dist/config/index.js +288 -0
  13. package/dist/config/index.js.map +1 -0
  14. package/dist/domain/entities/QualityCheck.d.ts +181 -0
  15. package/dist/domain/entities/QualityCheck.d.ts.map +1 -0
  16. package/dist/domain/entities/QualityCheck.js +39 -0
  17. package/dist/domain/entities/QualityCheck.js.map +1 -0
  18. package/dist/domain/entities/Result.d.ts +103 -0
  19. package/dist/domain/entities/Result.d.ts.map +1 -0
  20. package/dist/domain/entities/Result.js +15 -0
  21. package/dist/domain/entities/Result.js.map +1 -0
  22. package/dist/domain/entities/Task.d.ts +130 -0
  23. package/dist/domain/entities/Task.d.ts.map +1 -0
  24. package/dist/domain/entities/Task.js +64 -0
  25. package/dist/domain/entities/Task.js.map +1 -0
  26. package/dist/domain/entities/TaskStep.d.ts +160 -0
  27. package/dist/domain/entities/TaskStep.d.ts.map +1 -0
  28. package/dist/domain/entities/TaskStep.js +30 -0
  29. package/dist/domain/entities/TaskStep.js.map +1 -0
  30. package/dist/domain/entities/TokenUsage.d.ts +70 -0
  31. package/dist/domain/entities/TokenUsage.d.ts.map +1 -0
  32. package/dist/domain/entities/TokenUsage.js +42 -0
  33. package/dist/domain/entities/TokenUsage.js.map +1 -0
  34. package/dist/domain/entities/index.d.ts +11 -0
  35. package/dist/domain/entities/index.d.ts.map +1 -0
  36. package/dist/domain/entities/index.js +16 -0
  37. package/dist/domain/entities/index.js.map +1 -0
  38. package/dist/domain/repositories/QualityCheckRepository.d.ts +49 -0
  39. package/dist/domain/repositories/QualityCheckRepository.d.ts.map +1 -0
  40. package/dist/domain/repositories/QualityCheckRepository.js +5 -0
  41. package/dist/domain/repositories/QualityCheckRepository.js.map +1 -0
  42. package/dist/domain/repositories/ResultRepository.d.ts +43 -0
  43. package/dist/domain/repositories/ResultRepository.d.ts.map +1 -0
  44. package/dist/domain/repositories/ResultRepository.js +5 -0
  45. package/dist/domain/repositories/ResultRepository.js.map +1 -0
  46. package/dist/domain/repositories/TaskRepository.d.ts +240 -0
  47. package/dist/domain/repositories/TaskRepository.d.ts.map +1 -0
  48. package/dist/domain/repositories/TaskRepository.js +7 -0
  49. package/dist/domain/repositories/TaskRepository.js.map +1 -0
  50. package/dist/domain/workflow/CheckpointManager.d.ts +94 -0
  51. package/dist/domain/workflow/CheckpointManager.d.ts.map +1 -0
  52. package/dist/domain/workflow/CheckpointManager.js +224 -0
  53. package/dist/domain/workflow/CheckpointManager.js.map +1 -0
  54. package/dist/domain/workflow/ContentCreatorGraph.d.ts +17 -0
  55. package/dist/domain/workflow/ContentCreatorGraph.d.ts.map +1 -0
  56. package/dist/domain/workflow/ContentCreatorGraph.js +381 -0
  57. package/dist/domain/workflow/ContentCreatorGraph.js.map +1 -0
  58. package/dist/domain/workflow/State.d.ts +172 -0
  59. package/dist/domain/workflow/State.d.ts.map +1 -0
  60. package/dist/domain/workflow/State.js +184 -0
  61. package/dist/domain/workflow/State.js.map +1 -0
  62. package/dist/domain/workflow/index.d.ts +11 -0
  63. package/dist/domain/workflow/index.d.ts.map +1 -0
  64. package/dist/domain/workflow/index.js +15 -0
  65. package/dist/domain/workflow/index.js.map +1 -0
  66. package/dist/domain/workflow/nodes/BaseNode.d.ts +134 -0
  67. package/dist/domain/workflow/nodes/BaseNode.d.ts.map +1 -0
  68. package/dist/domain/workflow/nodes/BaseNode.js +253 -0
  69. package/dist/domain/workflow/nodes/BaseNode.js.map +1 -0
  70. package/dist/domain/workflow/nodes/CheckImageNode.d.ts +43 -0
  71. package/dist/domain/workflow/nodes/CheckImageNode.d.ts.map +1 -0
  72. package/dist/domain/workflow/nodes/CheckImageNode.js +254 -0
  73. package/dist/domain/workflow/nodes/CheckImageNode.js.map +1 -0
  74. package/dist/domain/workflow/nodes/CheckTextNode.d.ts +66 -0
  75. package/dist/domain/workflow/nodes/CheckTextNode.d.ts.map +1 -0
  76. package/dist/domain/workflow/nodes/CheckTextNode.js +530 -0
  77. package/dist/domain/workflow/nodes/CheckTextNode.js.map +1 -0
  78. package/dist/domain/workflow/nodes/GenerateImageNode.d.ts +44 -0
  79. package/dist/domain/workflow/nodes/GenerateImageNode.d.ts.map +1 -0
  80. package/dist/domain/workflow/nodes/GenerateImageNode.js +272 -0
  81. package/dist/domain/workflow/nodes/GenerateImageNode.js.map +1 -0
  82. package/dist/domain/workflow/nodes/OrganizeNode.d.ts +49 -0
  83. package/dist/domain/workflow/nodes/OrganizeNode.d.ts.map +1 -0
  84. package/dist/domain/workflow/nodes/OrganizeNode.js +241 -0
  85. package/dist/domain/workflow/nodes/OrganizeNode.js.map +1 -0
  86. package/dist/domain/workflow/nodes/SearchNode.d.ts +48 -0
  87. package/dist/domain/workflow/nodes/SearchNode.d.ts.map +1 -0
  88. package/dist/domain/workflow/nodes/SearchNode.js +151 -0
  89. package/dist/domain/workflow/nodes/SearchNode.js.map +1 -0
  90. package/dist/domain/workflow/nodes/WriteNode.d.ts +68 -0
  91. package/dist/domain/workflow/nodes/WriteNode.d.ts.map +1 -0
  92. package/dist/domain/workflow/nodes/WriteNode.js +431 -0
  93. package/dist/domain/workflow/nodes/WriteNode.js.map +1 -0
  94. package/dist/domain/workflow/nodes/config/index.js +287 -0
  95. package/dist/domain/workflow/nodes/domain/entities/Task.js +68 -0
  96. package/dist/domain/workflow/nodes/domain/workflow/State.js +200 -0
  97. package/dist/domain/workflow/nodes/domain/workflow/nodes/BaseNode.js +328 -0
  98. package/dist/domain/workflow/nodes/domain/workflow/nodes/CheckTextNode.js +500 -0
  99. package/dist/domain/workflow/nodes/index.d.ts +13 -0
  100. package/dist/domain/workflow/nodes/index.d.ts.map +1 -0
  101. package/dist/domain/workflow/nodes/index.js +13 -0
  102. package/dist/domain/workflow/nodes/index.js.map +1 -0
  103. package/dist/domain/workflow/nodes/infrastructure/logging/logger.js +275 -0
  104. package/dist/domain/workflow/nodes/services/llm/EnhancedLLMService.js +559 -0
  105. package/dist/index.d.ts +24 -0
  106. package/dist/index.d.ts.map +1 -0
  107. package/dist/index.js +34 -0
  108. package/dist/index.js.map +1 -0
  109. package/dist/infrastructure/cache/CacheService.d.ts +139 -0
  110. package/dist/infrastructure/cache/CacheService.d.ts.map +1 -0
  111. package/dist/infrastructure/cache/CacheService.js +419 -0
  112. package/dist/infrastructure/cache/CacheService.js.map +1 -0
  113. package/dist/infrastructure/cache/index.d.ts +5 -0
  114. package/dist/infrastructure/cache/index.d.ts.map +1 -0
  115. package/dist/infrastructure/cache/index.js +6 -0
  116. package/dist/infrastructure/cache/index.js.map +1 -0
  117. package/dist/infrastructure/database/BaseRepository.d.ts +98 -0
  118. package/dist/infrastructure/database/BaseRepository.d.ts.map +1 -0
  119. package/dist/infrastructure/database/BaseRepository.js +178 -0
  120. package/dist/infrastructure/database/BaseRepository.js.map +1 -0
  121. package/dist/infrastructure/database/MemoryTaskRepository.d.ts +77 -0
  122. package/dist/infrastructure/database/MemoryTaskRepository.d.ts.map +1 -0
  123. package/dist/infrastructure/database/MemoryTaskRepository.js +309 -0
  124. package/dist/infrastructure/database/MemoryTaskRepository.js.map +1 -0
  125. package/dist/infrastructure/database/PostgresQualityCheckRepository.d.ts +36 -0
  126. package/dist/infrastructure/database/PostgresQualityCheckRepository.d.ts.map +1 -0
  127. package/dist/infrastructure/database/PostgresQualityCheckRepository.js +89 -0
  128. package/dist/infrastructure/database/PostgresQualityCheckRepository.js.map +1 -0
  129. package/dist/infrastructure/database/PostgresTaskRepository.d.ts +94 -0
  130. package/dist/infrastructure/database/PostgresTaskRepository.d.ts.map +1 -0
  131. package/dist/infrastructure/database/PostgresTaskRepository.js +364 -0
  132. package/dist/infrastructure/database/PostgresTaskRepository.js.map +1 -0
  133. package/dist/infrastructure/database/ResultRepository.d.ts +41 -0
  134. package/dist/infrastructure/database/ResultRepository.d.ts.map +1 -0
  135. package/dist/infrastructure/database/ResultRepository.js +86 -0
  136. package/dist/infrastructure/database/ResultRepository.js.map +1 -0
  137. package/dist/infrastructure/database/SQLiteTaskRepository.d.ts +101 -0
  138. package/dist/infrastructure/database/SQLiteTaskRepository.d.ts.map +1 -0
  139. package/dist/infrastructure/database/SQLiteTaskRepository.js +548 -0
  140. package/dist/infrastructure/database/SQLiteTaskRepository.js.map +1 -0
  141. package/dist/infrastructure/database/index.d.ts +32 -0
  142. package/dist/infrastructure/database/index.d.ts.map +1 -0
  143. package/dist/infrastructure/database/index.js +72 -0
  144. package/dist/infrastructure/database/index.js.map +1 -0
  145. package/dist/infrastructure/logging/logger.d.ts +69 -0
  146. package/dist/infrastructure/logging/logger.d.ts.map +1 -0
  147. package/dist/infrastructure/logging/logger.js +169 -0
  148. package/dist/infrastructure/logging/logger.js.map +1 -0
  149. package/dist/infrastructure/monitoring/LoggingService.d.ts +109 -0
  150. package/dist/infrastructure/monitoring/LoggingService.d.ts.map +1 -0
  151. package/dist/infrastructure/monitoring/LoggingService.js +198 -0
  152. package/dist/infrastructure/monitoring/LoggingService.js.map +1 -0
  153. package/dist/infrastructure/monitoring/MetricsService.d.ts +112 -0
  154. package/dist/infrastructure/monitoring/MetricsService.d.ts.map +1 -0
  155. package/dist/infrastructure/monitoring/MetricsService.js +362 -0
  156. package/dist/infrastructure/monitoring/MetricsService.js.map +1 -0
  157. package/dist/infrastructure/monitoring/SentryService.d.ts +108 -0
  158. package/dist/infrastructure/monitoring/SentryService.d.ts.map +1 -0
  159. package/dist/infrastructure/monitoring/SentryService.js +282 -0
  160. package/dist/infrastructure/monitoring/SentryService.js.map +1 -0
  161. package/dist/infrastructure/monitoring/index.d.ts +7 -0
  162. package/dist/infrastructure/monitoring/index.d.ts.map +1 -0
  163. package/dist/infrastructure/monitoring/index.js +10 -0
  164. package/dist/infrastructure/monitoring/index.js.map +1 -0
  165. package/dist/infrastructure/queue/TaskQueue.d.ts +110 -0
  166. package/dist/infrastructure/queue/TaskQueue.d.ts.map +1 -0
  167. package/dist/infrastructure/queue/TaskQueue.js +363 -0
  168. package/dist/infrastructure/queue/TaskQueue.js.map +1 -0
  169. package/dist/infrastructure/queue/index.d.ts +5 -0
  170. package/dist/infrastructure/queue/index.d.ts.map +1 -0
  171. package/dist/infrastructure/queue/index.js +5 -0
  172. package/dist/infrastructure/queue/index.js.map +1 -0
  173. package/dist/infrastructure/redis/connection.d.ts +61 -0
  174. package/dist/infrastructure/redis/connection.d.ts.map +1 -0
  175. package/dist/infrastructure/redis/connection.js +184 -0
  176. package/dist/infrastructure/redis/connection.js.map +1 -0
  177. package/dist/infrastructure/redis/index.d.ts +5 -0
  178. package/dist/infrastructure/redis/index.d.ts.map +1 -0
  179. package/dist/infrastructure/redis/index.js +5 -0
  180. package/dist/infrastructure/redis/index.js.map +1 -0
  181. package/dist/infrastructure/security/ApiKeyService.d.ts +103 -0
  182. package/dist/infrastructure/security/ApiKeyService.d.ts.map +1 -0
  183. package/dist/infrastructure/security/ApiKeyService.js +250 -0
  184. package/dist/infrastructure/security/ApiKeyService.js.map +1 -0
  185. package/dist/infrastructure/security/QuotaService.d.ts +87 -0
  186. package/dist/infrastructure/security/QuotaService.d.ts.map +1 -0
  187. package/dist/infrastructure/security/QuotaService.js +303 -0
  188. package/dist/infrastructure/security/QuotaService.js.map +1 -0
  189. package/dist/infrastructure/security/RateLimiter.d.ts +104 -0
  190. package/dist/infrastructure/security/RateLimiter.d.ts.map +1 -0
  191. package/dist/infrastructure/security/RateLimiter.js +331 -0
  192. package/dist/infrastructure/security/RateLimiter.js.map +1 -0
  193. package/dist/infrastructure/security/index.d.ts +7 -0
  194. package/dist/infrastructure/security/index.d.ts.map +1 -0
  195. package/dist/infrastructure/security/index.js +10 -0
  196. package/dist/infrastructure/security/index.js.map +1 -0
  197. package/dist/monitoring/index.d.ts +5 -0
  198. package/dist/monitoring/index.d.ts.map +1 -0
  199. package/dist/monitoring/index.js +5 -0
  200. package/dist/monitoring/index.js.map +1 -0
  201. package/dist/monitoring/server.d.ts +14 -0
  202. package/dist/monitoring/server.d.ts.map +1 -0
  203. package/dist/monitoring/server.js +99 -0
  204. package/dist/monitoring/server.js.map +1 -0
  205. package/dist/presentation/cli/commands/cancel.d.ts +8 -0
  206. package/dist/presentation/cli/commands/cancel.d.ts.map +1 -0
  207. package/dist/presentation/cli/commands/cancel.js +57 -0
  208. package/dist/presentation/cli/commands/cancel.js.map +1 -0
  209. package/dist/presentation/cli/commands/create.d.ts +8 -0
  210. package/dist/presentation/cli/commands/create.d.ts.map +1 -0
  211. package/dist/presentation/cli/commands/create.js +368 -0
  212. package/dist/presentation/cli/commands/create.js.map +1 -0
  213. package/dist/presentation/cli/commands/result.d.ts +8 -0
  214. package/dist/presentation/cli/commands/result.d.ts.map +1 -0
  215. package/dist/presentation/cli/commands/result.js +121 -0
  216. package/dist/presentation/cli/commands/result.js.map +1 -0
  217. package/dist/presentation/cli/commands/status.d.ts +8 -0
  218. package/dist/presentation/cli/commands/status.d.ts.map +1 -0
  219. package/dist/presentation/cli/commands/status.js +92 -0
  220. package/dist/presentation/cli/commands/status.js.map +1 -0
  221. package/dist/presentation/cli/index.d.ts +8 -0
  222. package/dist/presentation/cli/index.d.ts.map +1 -0
  223. package/dist/presentation/cli/index.js +32 -0
  224. package/dist/presentation/cli/index.js.map +1 -0
  225. package/dist/presentation/cli/utils/cleanup.d.ts +14 -0
  226. package/dist/presentation/cli/utils/cleanup.d.ts.map +1 -0
  227. package/dist/presentation/cli/utils/cleanup.js +62 -0
  228. package/dist/presentation/cli/utils/cleanup.js.map +1 -0
  229. package/dist/presentation/cli/utils/formatter.d.ts +28 -0
  230. package/dist/presentation/cli/utils/formatter.d.ts.map +1 -0
  231. package/dist/presentation/cli/utils/formatter.js +68 -0
  232. package/dist/presentation/cli/utils/formatter.js.map +1 -0
  233. package/dist/presentation/cli.d.ts +7 -0
  234. package/dist/presentation/cli.d.ts.map +1 -0
  235. package/dist/presentation/cli.js +8 -0
  236. package/dist/presentation/cli.js.map +1 -0
  237. package/dist/presentation/monitor-cli.d.ts +8 -0
  238. package/dist/presentation/monitor-cli.d.ts.map +1 -0
  239. package/dist/presentation/monitor-cli.js +44 -0
  240. package/dist/presentation/monitor-cli.js.map +1 -0
  241. package/dist/presentation/worker-cli.d.ts +8 -0
  242. package/dist/presentation/worker-cli.d.ts.map +1 -0
  243. package/dist/presentation/worker-cli.js +51 -0
  244. package/dist/presentation/worker-cli.js.map +1 -0
  245. package/dist/schedulers/TaskScheduler.d.ts +99 -0
  246. package/dist/schedulers/TaskScheduler.d.ts.map +1 -0
  247. package/dist/schedulers/TaskScheduler.js +233 -0
  248. package/dist/schedulers/TaskScheduler.js.map +1 -0
  249. package/dist/schedulers/index.d.ts +5 -0
  250. package/dist/schedulers/index.d.ts.map +1 -0
  251. package/dist/schedulers/index.js +5 -0
  252. package/dist/schedulers/index.js.map +1 -0
  253. package/dist/services/image/ImageService.d.ts +68 -0
  254. package/dist/services/image/ImageService.d.ts.map +1 -0
  255. package/dist/services/image/ImageService.js +166 -0
  256. package/dist/services/image/ImageService.js.map +1 -0
  257. package/dist/services/index.d.ts +8 -0
  258. package/dist/services/index.d.ts.map +1 -0
  259. package/dist/services/index.js +12 -0
  260. package/dist/services/index.js.map +1 -0
  261. package/dist/services/llm/EnhancedLLMService.d.ts +148 -0
  262. package/dist/services/llm/EnhancedLLMService.d.ts.map +1 -0
  263. package/dist/services/llm/EnhancedLLMService.js +425 -0
  264. package/dist/services/llm/EnhancedLLMService.js.map +1 -0
  265. package/dist/services/llm/LLMService.d.ts +103 -0
  266. package/dist/services/llm/LLMService.d.ts.map +1 -0
  267. package/dist/services/llm/LLMService.js +212 -0
  268. package/dist/services/llm/LLMService.js.map +1 -0
  269. package/dist/services/quality/HardRuleChecker.d.ts +143 -0
  270. package/dist/services/quality/HardRuleChecker.d.ts.map +1 -0
  271. package/dist/services/quality/HardRuleChecker.js +353 -0
  272. package/dist/services/quality/HardRuleChecker.js.map +1 -0
  273. package/dist/services/quality/LLMEvaluator.d.ts +105 -0
  274. package/dist/services/quality/LLMEvaluator.d.ts.map +1 -0
  275. package/dist/services/quality/LLMEvaluator.js +312 -0
  276. package/dist/services/quality/LLMEvaluator.js.map +1 -0
  277. package/dist/services/quality/QualityCheckService.d.ts +112 -0
  278. package/dist/services/quality/QualityCheckService.d.ts.map +1 -0
  279. package/dist/services/quality/QualityCheckService.js +342 -0
  280. package/dist/services/quality/QualityCheckService.js.map +1 -0
  281. package/dist/services/quality/QualityService.d.ts +75 -0
  282. package/dist/services/quality/QualityService.d.ts.map +1 -0
  283. package/dist/services/quality/QualityService.js +360 -0
  284. package/dist/services/quality/QualityService.js.map +1 -0
  285. package/dist/services/quality/index.d.ts +7 -0
  286. package/dist/services/quality/index.d.ts.map +1 -0
  287. package/dist/services/quality/index.js +10 -0
  288. package/dist/services/quality/index.js.map +1 -0
  289. package/dist/services/search/SearchService.d.ts +79 -0
  290. package/dist/services/search/SearchService.d.ts.map +1 -0
  291. package/dist/services/search/SearchService.js +193 -0
  292. package/dist/services/search/SearchService.js.map +1 -0
  293. package/dist/workers/TaskWorker.d.ts +61 -0
  294. package/dist/workers/TaskWorker.d.ts.map +1 -0
  295. package/dist/workers/TaskWorker.js +256 -0
  296. package/dist/workers/TaskWorker.js.map +1 -0
  297. package/dist/workers/index.d.ts +5 -0
  298. package/dist/workers/index.d.ts.map +1 -0
  299. package/dist/workers/index.js +5 -0
  300. package/dist/workers/index.js.map +1 -0
  301. package/docs/DOCUMENTATION-ANALYSIS.md +190 -0
  302. package/docs/README.md +145 -0
  303. package/docs/SOURCE-CODE-ANALYSIS.md +1107 -0
  304. package/docs/architecture-complete.md +5524 -0
  305. package/docs/archive/implementation/implementation-analysis/README.md +244 -0
  306. package/docs/archive/implementation/implementation-analysis/implementation-analysis-context.md +483 -0
  307. package/docs/archive/implementation/implementation-analysis/implementation-analysis-plan.md +1242 -0
  308. package/docs/archive/implementation/implementation-analysis/implementation-analysis-tasks.md +777 -0
  309. package/docs/archive/phases/phase-1/phase-1-completion-summary.md +284 -0
  310. package/docs/archive/phases/phase-1/phase-1-implementation-guide.md +1380 -0
  311. package/docs/archive/phases/phase-2/phase-2a/phase-2a-completion-summary.md +443 -0
  312. package/docs/archive/phases/phase-2/phase-2b/phase-2b-completion-report.md +430 -0
  313. package/docs/archive/phases/phase-2/phase-2b/phase-2b-completion-summary.md +592 -0
  314. package/docs/archive/phases/phase-2/phase-2b/phase-2b-final-summary.md +371 -0
  315. package/docs/archive/phases/phase-2/phase-2b/phase-2b-preparation-complete.md +343 -0
  316. package/docs/archive/phases/phase-2/phase-2b/phase-2b-preparation.md +945 -0
  317. package/docs/archive/phases/phase-2/phase-2b/phase-2b-progress-update.md +366 -0
  318. package/docs/archive/phases/phase-3/phase-3-completion-summary.md +354 -0
  319. package/docs/archive/phases/phase-3/phase-3-development-plan.md +878 -0
  320. package/docs/archive/phases/phase-3/phase-3-quick-start.md +324 -0
  321. package/docs/archive/phases/phase-4/phase-4-completion-summary.md +708 -0
  322. package/docs/archive/phases/phase-4/phase-4-development-plan.md +740 -0
  323. package/docs/archive/phases/phase-4/phase-4-quick-start.md +632 -0
  324. package/docs/archive/phases/phase-4/phase-4-session-3-security-testing.md +484 -0
  325. package/docs/archive/phases/phase-4/phase-4-session-4-unit-tests.md +550 -0
  326. package/docs/archive/phases/phase-4/phase-4-session-5-security-tests.md +564 -0
  327. package/docs/archive/phases/phase-4/phase-4-session-6-cache-integration.md +456 -0
  328. package/docs/archive/phases/phase-4/phase-4-session-7-test-fixes.md +348 -0
  329. package/docs/archive/phases/phase-4/phase-4-session-8-taskqueue-fixes.md +323 -0
  330. package/docs/archive/phases/phase-4/phase-4-session-summary-continued.md +373 -0
  331. package/docs/archive/phases/phase-4/phase-4-session-summary.md +595 -0
  332. package/docs/archive/reports/progress-reports/PHASE_0_PROGRESS.md +242 -0
  333. package/docs/archive/reports/progress-reports/PHASE_0_SUMMARY.md +262 -0
  334. package/docs/archive/reports/progress-reports/PHASE_1_2_ISSUES.md +399 -0
  335. package/docs/archive/reports/progress-reports/PHASE_1_PROGRESS.md +388 -0
  336. package/docs/archive/reports/progress-reports/PHASE_3_PREPARATION.md +574 -0
  337. package/docs/archive/reports/progress-reports/current-progress-update.md +294 -0
  338. package/docs/archive/reports/progress-reports/final-summary.md +215 -0
  339. package/docs/archive/reports/progress-reports/implementation-summary.md +287 -0
  340. package/docs/archive/reports/progress-reports/project-progress-report.md +440 -0
  341. package/docs/archive/reports/progress-reports/project-progress.md +386 -0
  342. package/docs/archive/reports/test-reports/TEST-COVERAGE-REPORT.md +441 -0
  343. package/docs/archive/reports/test-reports/e2e-test-report.md +293 -0
  344. package/docs/archive/reports/test-reports/final-test-report.md +367 -0
  345. package/docs/archive/reports/test-reports/real-env-test-report.md +391 -0
  346. package/docs/archive/reports/test-reports/test-completion-summary.md +356 -0
  347. package/docs/archive/reports/test-reports/test-report.md +371 -0
  348. package/docs/archive/sessions/session-2-summary.md +429 -0
  349. package/docs/archive/sessions/session-3-summary.md +395 -0
  350. package/docs/archive/sessions/session-summary.md +370 -0
  351. package/docs/config-system-update.md +239 -0
  352. package/docs/database-refactoring-PLAN.md +199 -0
  353. package/docs/database-refactoring-SUMMARY.md +384 -0
  354. package/docs/quality-check-architecture.md +1030 -0
  355. package/docs/quick-start.md +388 -0
  356. package/docs/references/bullmq-quick-reference.md +525 -0
  357. package/docs/references/monitoring-optimization-guide.md +871 -0
  358. package/docs/references/performance-optimization-guide.md +933 -0
  359. package/docs/storage-guide.md +612 -0
  360. package/docs/test-implementation-PLAN.md +223 -0
  361. package/docs/test-implementation-SUMMARY.md +194 -0
  362. package/docs/user-guide.md +719 -0
  363. package/docs/workflow-architecture.md +549 -0
  364. package/package.json +126 -0
  365. package/src/application/workflow/SyncExecutor.ts +444 -0
  366. package/src/application/workflow/types.ts +57 -0
  367. package/src/config/index.ts +352 -0
  368. package/src/domain/entities/QualityCheck.ts +202 -0
  369. package/src/domain/entities/Result.ts +130 -0
  370. package/src/domain/entities/Task.ts +178 -0
  371. package/src/domain/entities/TaskStep.ts +188 -0
  372. package/src/domain/entities/TokenUsage.ts +119 -0
  373. package/src/domain/entities/index.ts +20 -0
  374. package/src/domain/repositories/QualityCheckRepository.ts +52 -0
  375. package/src/domain/repositories/ResultRepository.ts +47 -0
  376. package/src/domain/repositories/TaskRepository.ts +271 -0
  377. package/src/domain/workflow/CheckpointManager.ts +283 -0
  378. package/src/domain/workflow/ContentCreatorGraph.ts +446 -0
  379. package/src/domain/workflow/State.ts +321 -0
  380. package/src/domain/workflow/index.ts +18 -0
  381. package/src/domain/workflow/nodes/BaseNode.ts +325 -0
  382. package/src/domain/workflow/nodes/CheckImageNode.ts +325 -0
  383. package/src/domain/workflow/nodes/CheckTextNode.ts +709 -0
  384. package/src/domain/workflow/nodes/GenerateImageNode.ts +342 -0
  385. package/src/domain/workflow/nodes/OrganizeNode.ts +304 -0
  386. package/src/domain/workflow/nodes/SearchNode.ts +192 -0
  387. package/src/domain/workflow/nodes/WriteNode.ts +505 -0
  388. package/src/domain/workflow/nodes/index.ts +13 -0
  389. package/src/index.ts +43 -0
  390. package/src/infrastructure/cache/CacheService.ts +483 -0
  391. package/src/infrastructure/cache/index.ts +6 -0
  392. package/src/infrastructure/database/BaseRepository.ts +214 -0
  393. package/src/infrastructure/database/MemoryTaskRepository.ts +377 -0
  394. package/src/infrastructure/database/PostgresQualityCheckRepository.ts +115 -0
  395. package/src/infrastructure/database/PostgresTaskRepository.ts +424 -0
  396. package/src/infrastructure/database/ResultRepository.ts +113 -0
  397. package/src/infrastructure/database/SQLiteTaskRepository.ts +651 -0
  398. package/src/infrastructure/database/index.ts +83 -0
  399. package/src/infrastructure/logging/logger.ts +231 -0
  400. package/src/infrastructure/monitoring/LoggingService.ts +292 -0
  401. package/src/infrastructure/monitoring/MetricsService.ts +468 -0
  402. package/src/infrastructure/monitoring/SentryService.ts +345 -0
  403. package/src/infrastructure/monitoring/index.ts +12 -0
  404. package/src/infrastructure/queue/TaskQueue.ts +429 -0
  405. package/src/infrastructure/queue/index.ts +5 -0
  406. package/src/infrastructure/redis/connection.ts +215 -0
  407. package/src/infrastructure/redis/index.ts +5 -0
  408. package/src/infrastructure/security/ApiKeyService.ts +340 -0
  409. package/src/infrastructure/security/QuotaService.ts +411 -0
  410. package/src/infrastructure/security/RateLimiter.ts +417 -0
  411. package/src/infrastructure/security/index.ts +12 -0
  412. package/src/monitoring/index.ts +5 -0
  413. package/src/monitoring/server.ts +109 -0
  414. package/src/presentation/cli/commands/cancel.ts +64 -0
  415. package/src/presentation/cli/commands/create.ts +400 -0
  416. package/src/presentation/cli/commands/result.ts +136 -0
  417. package/src/presentation/cli/commands/status.ts +102 -0
  418. package/src/presentation/cli/index.ts +39 -0
  419. package/src/presentation/cli/utils/cleanup.ts +65 -0
  420. package/src/presentation/cli/utils/formatter.ts +74 -0
  421. package/src/presentation/cli.ts +8 -0
  422. package/src/presentation/monitor-cli.ts +52 -0
  423. package/src/presentation/worker-cli.ts +62 -0
  424. package/src/schedulers/TaskScheduler.ts +314 -0
  425. package/src/schedulers/index.ts +11 -0
  426. package/src/services/image/ImageService.ts +221 -0
  427. package/src/services/index.ts +15 -0
  428. package/src/services/llm/EnhancedLLMService.ts +596 -0
  429. package/src/services/llm/LLMService.ts +310 -0
  430. package/src/services/quality/HardRuleChecker.ts +509 -0
  431. package/src/services/quality/LLMEvaluator.ts +400 -0
  432. package/src/services/quality/QualityCheckService.ts +473 -0
  433. package/src/services/quality/QualityService.ts +445 -0
  434. package/src/services/quality/index.ts +12 -0
  435. package/src/services/search/SearchService.ts +266 -0
  436. package/src/types/global.d.ts +17 -0
  437. package/src/workers/TaskWorker.ts +320 -0
  438. package/src/workers/index.ts +5 -0
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Task 领域模型
3
+ *
4
+ * 表示一个内容创作任务
5
+ */
6
+ /**
7
+ * 任务状态
8
+ */
9
+ export declare enum TaskStatus {
10
+ PENDING = "pending",// 待处理
11
+ RUNNING = "running",// 运行中
12
+ WAITING = "waiting",// 等待中(等待人工审核)
13
+ COMPLETED = "completed",// 已完成
14
+ FAILED = "failed",// 失败
15
+ CANCELLED = "cancelled"
16
+ }
17
+ /**
18
+ * 任务类型
19
+ */
20
+ export declare enum TaskType {
21
+ ARTICLE = "article",// 文章
22
+ SOCIAL_MEDIA = "social_media",// 社交媒体内容
23
+ MARKETING = "marketing",// 营销文案
24
+ OTHER = "other"
25
+ }
26
+ /**
27
+ * 任务优先级
28
+ */
29
+ export declare enum TaskPriority {
30
+ LOW = 1,
31
+ NORMAL = 2,
32
+ HIGH = 3,
33
+ URGENT = 4
34
+ }
35
+ /**
36
+ * 执行模式
37
+ */
38
+ export declare enum ExecutionMode {
39
+ SYNC = "sync",// 同步执行
40
+ ASYNC = "async"
41
+ }
42
+ /**
43
+ * 任务实体
44
+ */
45
+ export interface Task {
46
+ id: string;
47
+ taskId: string;
48
+ type?: TaskType;
49
+ status: TaskStatus;
50
+ priority: TaskPriority;
51
+ mode: ExecutionMode;
52
+ topic: string;
53
+ requirements: string;
54
+ targetAudience: string;
55
+ keywords?: string[];
56
+ tone?: string;
57
+ hardConstraints?: {
58
+ minWords?: number;
59
+ maxWords?: number;
60
+ keywords?: string[];
61
+ };
62
+ userId?: string;
63
+ estimatedTokens?: number;
64
+ maxTokens?: number;
65
+ currentStep?: string;
66
+ workerId?: string;
67
+ assignedWorkerId?: string;
68
+ textRetryCount: number;
69
+ imageRetryCount: number;
70
+ version: number;
71
+ createdAt: Date;
72
+ updatedAt: Date;
73
+ startedAt?: Date;
74
+ completedAt?: Date;
75
+ deletedAt?: Date;
76
+ claimedAt?: Date;
77
+ errorMessage?: string;
78
+ stateSnapshot?: object;
79
+ idempotencyKey?: string;
80
+ steps?: TaskStep[];
81
+ results?: Result[];
82
+ }
83
+ /**
84
+ * 任务创建参数
85
+ */
86
+ export interface CreateTaskParams {
87
+ mode: ExecutionMode;
88
+ topic: string;
89
+ requirements: string;
90
+ targetAudience: string;
91
+ type?: TaskType;
92
+ keywords?: string[];
93
+ tone?: string;
94
+ priority?: TaskPriority;
95
+ maxTokens?: number;
96
+ userId?: string;
97
+ hardConstraints?: {
98
+ minWords?: number;
99
+ maxWords?: number;
100
+ keywords?: string[];
101
+ };
102
+ idempotencyKey?: string;
103
+ }
104
+ /**
105
+ * 任务更新参数
106
+ */
107
+ export interface UpdateTaskParams {
108
+ status?: TaskStatus;
109
+ currentStep?: string;
110
+ workerId?: string;
111
+ assignedWorkerId?: string;
112
+ claimedAt?: Date;
113
+ startedAt?: Date;
114
+ completedAt?: Date;
115
+ estimatedTokens?: number;
116
+ errorMessage?: string;
117
+ stateSnapshot?: object;
118
+ version: number;
119
+ }
120
+ import type { TaskStep } from './TaskStep.js';
121
+ import type { Result } from './Result.js';
122
+ /**
123
+ * 任务状态转换
124
+ */
125
+ export declare const TaskStatusTransitions: Record<TaskStatus, TaskStatus[]>;
126
+ /**
127
+ * 检查状态转换是否合法
128
+ */
129
+ export declare function isValidStatusTransition(currentStatus: TaskStatus, newStatus: TaskStatus): boolean;
130
+ //# sourceMappingURL=Task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,UAAU;IACpB,OAAO,YAAY,CAAY,MAAM;IACrC,OAAO,YAAY,CAAY,MAAM;IACrC,OAAO,YAAY,CAAY,cAAc;IAC7C,SAAS,cAAc,CAAQ,MAAM;IACrC,M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SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,CAOlE,CAAC;AAEF;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,UAAU,EACzB,SAAS,EAAE,UAAU,GACpB,OAAO,CAGT"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Task 领域模型
3
+ *
4
+ * 表示一个内容创作任务
5
+ */
6
+ /**
7
+ * 任务状态
8
+ */
9
+ export var TaskStatus;
10
+ (function (TaskStatus) {
11
+ TaskStatus["PENDING"] = "pending";
12
+ TaskStatus["RUNNING"] = "running";
13
+ TaskStatus["WAITING"] = "waiting";
14
+ TaskStatus["COMPLETED"] = "completed";
15
+ TaskStatus["FAILED"] = "failed";
16
+ TaskStatus["CANCELLED"] = "cancelled";
17
+ })(TaskStatus || (TaskStatus = {}));
18
+ /**
19
+ * 任务类型
20
+ */
21
+ export var TaskType;
22
+ (function (TaskType) {
23
+ TaskType["ARTICLE"] = "article";
24
+ TaskType["SOCIAL_MEDIA"] = "social_media";
25
+ TaskType["MARKETING"] = "marketing";
26
+ TaskType["OTHER"] = "other";
27
+ })(TaskType || (TaskType = {}));
28
+ /**
29
+ * 任务优先级
30
+ */
31
+ export var TaskPriority;
32
+ (function (TaskPriority) {
33
+ TaskPriority[TaskPriority["LOW"] = 1] = "LOW";
34
+ TaskPriority[TaskPriority["NORMAL"] = 2] = "NORMAL";
35
+ TaskPriority[TaskPriority["HIGH"] = 3] = "HIGH";
36
+ TaskPriority[TaskPriority["URGENT"] = 4] = "URGENT";
37
+ })(TaskPriority || (TaskPriority = {}));
38
+ /**
39
+ * 执行模式
40
+ */
41
+ export var ExecutionMode;
42
+ (function (ExecutionMode) {
43
+ ExecutionMode["SYNC"] = "sync";
44
+ ExecutionMode["ASYNC"] = "async";
45
+ })(ExecutionMode || (ExecutionMode = {}));
46
+ /**
47
+ * 任务状态转换
48
+ */
49
+ export const TaskStatusTransitions = {
50
+ [TaskStatus.PENDING]: [TaskStatus.RUNNING, TaskStatus.CANCELLED],
51
+ [TaskStatus.RUNNING]: [TaskStatus.WAITING, TaskStatus.COMPLETED, TaskStatus.FAILED, TaskStatus.CANCELLED],
52
+ [TaskStatus.WAITING]: [TaskStatus.RUNNING, TaskStatus.COMPLETED, TaskStatus.FAILED, TaskStatus.CANCELLED],
53
+ [TaskStatus.COMPLETED]: [], // 终态,不可转换
54
+ [TaskStatus.FAILED]: [], // 终态,不可转换
55
+ [TaskStatus.CANCELLED]: [], // 终态,不可转换
56
+ };
57
+ /**
58
+ * 检查状态转换是否合法
59
+ */
60
+ export function isValidStatusTransition(currentStatus, newStatus) {
61
+ const allowedTransitions = TaskStatusTransitions[currentStatus];
62
+ return allowedTransitions.includes(newStatus);
63
+ }
64
+ //# sourceMappingURL=Task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/domain/entities/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;AACzB,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB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AAS,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * TaskStep 领域模型
3
+ *
4
+ * 表示任务的一个执行步骤
5
+ */
6
+ import { TaskStatus } from './Task.js';
7
+ /**
8
+ * 步骤类型
9
+ */
10
+ export declare enum StepType {
11
+ SEARCH = "search",// 搜索选题
12
+ ORGANIZE = "organize",// 整理资料
13
+ WRITE = "write",// 撰写内容
14
+ CHECK_TEXT = "check_text",// 文本质量检查
15
+ GEN_IMAGE = "gen_image",// 生成配图
16
+ CHECK_IMAGE = "check_image"
17
+ }
18
+ /**
19
+ * 步骤输入定义
20
+ */
21
+ export interface StepInput {
22
+ [key: string]: any;
23
+ }
24
+ /**
25
+ * 搜索步骤输入
26
+ */
27
+ export interface SearchStepInput extends StepInput {
28
+ topic: string;
29
+ requirements: string;
30
+ targetAudience: string;
31
+ keywords?: string[];
32
+ }
33
+ /**
34
+ * 整理步骤输入
35
+ */
36
+ export interface OrganizeStepInput extends StepInput {
37
+ searchResults: any[];
38
+ requirements: string;
39
+ }
40
+ /**
41
+ * 撰写步骤输入
42
+ */
43
+ export interface WriteStepInput extends StepInput {
44
+ organizedContent: any;
45
+ topic: string;
46
+ targetAudience: string;
47
+ tone?: string;
48
+ maxTokens?: number;
49
+ }
50
+ /**
51
+ * 文本检查步骤输入
52
+ */
53
+ export interface CheckTextStepInput extends StepInput {
54
+ text: string;
55
+ requirements: string;
56
+ }
57
+ /**
58
+ * 生成图片步骤输入
59
+ */
60
+ export interface GenImageStepInput extends StepInput {
61
+ text: string;
62
+ requirements: string;
63
+ }
64
+ /**
65
+ * 图片检查步骤输入
66
+ */
67
+ export interface CheckImageStepInput extends StepInput {
68
+ imageUrl: string;
69
+ requirements: string;
70
+ }
71
+ /**
72
+ * 步骤输出定义
73
+ */
74
+ export interface StepOutput {
75
+ [key: string]: any;
76
+ }
77
+ /**
78
+ * 搜索步骤输出
79
+ */
80
+ export interface SearchStepOutput extends StepOutput {
81
+ results: any[];
82
+ summary: string;
83
+ }
84
+ /**
85
+ * 整理步骤输出
86
+ */
87
+ export interface OrganizeStepOutput extends StepOutput {
88
+ organized: any;
89
+ outline: string;
90
+ }
91
+ /**
92
+ * 撰写步骤输出
93
+ */
94
+ export interface WriteStepOutput extends StepOutput {
95
+ text: string;
96
+ tokenCount: number;
97
+ }
98
+ /**
99
+ * 检查步骤输出
100
+ */
101
+ export interface CheckStepOutput extends StepOutput {
102
+ passed: boolean;
103
+ score?: number;
104
+ reason?: string;
105
+ details?: any;
106
+ }
107
+ /**
108
+ * 步骤状态
109
+ */
110
+ export declare enum StepStatus {
111
+ PENDING = "pending",
112
+ RUNNING = "running",
113
+ COMPLETED = "completed",
114
+ FAILED = "failed",
115
+ SKIPPED = "skipped"
116
+ }
117
+ /**
118
+ * 任务步骤实体
119
+ */
120
+ export interface TaskStep {
121
+ id: number;
122
+ taskId: string;
123
+ stepType: StepType;
124
+ status: StepStatus;
125
+ attempt: number;
126
+ inputData?: object;
127
+ outputData?: object;
128
+ input?: StepInput;
129
+ output?: StepOutput;
130
+ errorMessage?: string;
131
+ error?: string;
132
+ retryCount?: number;
133
+ createdAt: Date;
134
+ startedAt?: Date;
135
+ completedAt?: Date;
136
+ durationMs?: number;
137
+ duration?: number;
138
+ workerId?: string;
139
+ }
140
+ /**
141
+ * 创建步骤参数
142
+ */
143
+ export interface CreateStepParams {
144
+ taskId: string;
145
+ stepType: StepType;
146
+ input: StepInput;
147
+ workerId?: string;
148
+ }
149
+ /**
150
+ * 更新步骤参数
151
+ */
152
+ export interface UpdateStepParams {
153
+ status?: TaskStatus;
154
+ output?: StepOutput;
155
+ error?: string;
156
+ startedAt?: Date;
157
+ completedAt?: Date;
158
+ duration?: number;
159
+ }
160
+ //# sourceMappingURL=TaskStep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskStep.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/TaskStep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAA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CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * TaskStep 领域模型
3
+ *
4
+ * 表示任务的一个执行步骤
5
+ */
6
+ import { TaskStatus } from './Task.js';
7
+ /**
8
+ * 步骤类型
9
+ */
10
+ export var StepType;
11
+ (function (StepType) {
12
+ StepType["SEARCH"] = "search";
13
+ StepType["ORGANIZE"] = "organize";
14
+ StepType["WRITE"] = "write";
15
+ StepType["CHECK_TEXT"] = "check_text";
16
+ StepType["GEN_IMAGE"] = "gen_image";
17
+ StepType["CHECK_IMAGE"] = "check_image";
18
+ })(StepType || (StepType = {}));
19
+ /**
20
+ * 步骤状态
21
+ */
22
+ export var StepStatus;
23
+ (function (StepStatus) {
24
+ StepStatus["PENDING"] = "pending";
25
+ StepStatus["RUNNING"] = "running";
26
+ StepStatus["COMPLETED"] = "completed";
27
+ StepStatus["FAILED"] = "failed";
28
+ StepStatus["SKIPPED"] = "skipped";
29
+ })(StepStatus || (StepStatus = {}));
30
+ //# sourceMappingURL=TaskStep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskStep.js","sourceRoot":"","sources":["../../../src/domain/entities/TaskStep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,iCAAqB,CAAA;IACrB,2BAAe,CAAA;IACf,qCAAyB,CAAA;IACzB,mCAAuB,CAAA;IACvB,uCAA2B,CAAA;AAC7B,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AAuGD;;GAEG;AACH,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;AACrB,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * TokenUsage 领域模型
3
+ *
4
+ * 表示 API Token 使用记录和成本统计
5
+ */
6
+ /**
7
+ * Token 使用记录实体
8
+ */
9
+ export interface TokenUsage {
10
+ id: number;
11
+ taskId: string;
12
+ traceId: string;
13
+ stepName: string;
14
+ apiName: string;
15
+ modelName: string;
16
+ tokensIn: number;
17
+ tokensOut: number;
18
+ totalTokens: number;
19
+ costPer1kTokensIn: number;
20
+ costPer1kTokensOut: number;
21
+ totalCost: number;
22
+ metadata?: TokenUsageMetadata;
23
+ createdAt: Date;
24
+ }
25
+ /**
26
+ * Token 使用元数据
27
+ */
28
+ export interface TokenUsageMetadata {
29
+ temperature?: number;
30
+ maxTokens?: number;
31
+ duration?: number;
32
+ [key: string]: any;
33
+ }
34
+ /**
35
+ * 创建 Token 使用记录参数
36
+ */
37
+ export interface CreateTokenUsageParams {
38
+ taskId: string;
39
+ traceId: string;
40
+ stepName: string;
41
+ apiName: string;
42
+ modelName: string;
43
+ tokensIn: number;
44
+ tokensOut: number;
45
+ costPer1kTokensIn: number;
46
+ costPer1kTokensOut: number;
47
+ metadata?: TokenUsageMetadata;
48
+ }
49
+ /**
50
+ * Token 成本配置
51
+ */
52
+ export interface TokenCostConfig {
53
+ apiName: string;
54
+ modelName: string;
55
+ costPer1kTokensIn: number;
56
+ costPer1kTokensOut: number;
57
+ }
58
+ /**
59
+ * 常用 API 成本配置(单位:元/1k tokens)
60
+ */
61
+ export declare const TOKEN_COST_CONFIGS: Record<string, TokenCostConfig[]>;
62
+ /**
63
+ * 计算 Token 成本
64
+ */
65
+ export declare function calculateTokenCost(tokensIn: number, tokensOut: number, costPer1kTokensIn: number, costPer1kTokensOut: number): number;
66
+ /**
67
+ * 获取 API 成本配置
68
+ */
69
+ export declare function getTokenCostConfig(apiName: string, modelName: string): TokenCostConfig | undefined;
70
+ //# sourceMappingURL=TokenUsage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenUsage.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/TokenUsage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IAEzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAGlB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAGpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAG9B,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAiBhE,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,EACzB,kBAAkB,EAAE,MAAM,GACzB,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,eAAe,GAAG,SAAS,CAG7B"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * TokenUsage 领域模型
3
+ *
4
+ * 表示 API Token 使用记录和成本统计
5
+ */
6
+ /**
7
+ * 常用 API 成本配置(单位:元/1k tokens)
8
+ */
9
+ export const TOKEN_COST_CONFIGS = {
10
+ deepseek: [
11
+ {
12
+ apiName: 'deepseek',
13
+ modelName: 'deepseek-chat',
14
+ costPer1kTokensIn: 0.001, // ¥0.001/1k tokens
15
+ costPer1kTokensOut: 0.002, // ¥0.002/1k tokens
16
+ },
17
+ ],
18
+ doubao: [
19
+ {
20
+ apiName: 'doubao',
21
+ modelName: 'doubao-v1',
22
+ costPer1kTokensIn: 0.008,
23
+ costPer1kTokensOut: 0.008,
24
+ },
25
+ ],
26
+ };
27
+ /**
28
+ * 计算 Token 成本
29
+ */
30
+ export function calculateTokenCost(tokensIn, tokensOut, costPer1kTokensIn, costPer1kTokensOut) {
31
+ const costIn = (tokensIn / 1000) * costPer1kTokensIn;
32
+ const costOut = (tokensOut / 1000) * costPer1kTokensOut;
33
+ return Number((costIn + costOut).toFixed(6));
34
+ }
35
+ /**
36
+ * 获取 API 成本配置
37
+ */
38
+ export function getTokenCostConfig(apiName, modelName) {
39
+ const configs = TOKEN_COST_CONFIGS[apiName];
40
+ return configs?.find(config => config.modelName === modelName);
41
+ }
42
+ //# sourceMappingURL=TokenUsage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenUsage.js","sourceRoot":"","sources":["../../../src/domain/entities/TokenUsage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsC;IACnE,QAAQ,EAAE;QACR;YACE,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,eAAe;YAC1B,iBAAiB,EAAE,KAAK,EAAG,mBAAmB;YAC9C,kBAAkB,EAAE,KAAK,EAAE,mBAAmB;SAC/C;KACF;IACD,MAAM,EAAE;QACN;YACE,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,WAAW;YACtB,iBAAiB,EAAE,KAAK;YACxB,kBAAkB,EAAE,KAAK;SAC1B;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAgB,EAChB,SAAiB,EACjB,iBAAyB,EACzB,kBAA0B;IAE1B,MAAM,MAAM,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,iBAAiB,CAAC;IACrD,MAAM,OAAO,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,kBAAkB,CAAC;IACxD,OAAO,MAAM,CAAC,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAe,EACf,SAAiB;IAEjB,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 领域实体导出
3
+ *
4
+ * 统一导出所有领域模型
5
+ */
6
+ export * from './Task.js';
7
+ export * from './TaskStep.js';
8
+ export * from './Result.js';
9
+ export * from './QualityCheck.js';
10
+ export * from './TokenUsage.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,WAAW,CAAC;AAG1B,cAAc,eAAe,CAAC;AAG9B,cAAc,aAAa,CAAC;AAG5B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 领域实体导出
3
+ *
4
+ * 统一导出所有领域模型
5
+ */
6
+ // Task 实体 - 包含基础的 Task、TaskStep、Result、QualityCheck 接口
7
+ export * from './Task.js';
8
+ // TaskStep 实体 - 包含详细的步骤类型和输入输出定义
9
+ export * from './TaskStep.js';
10
+ // Result 实体 - 包含详细的结果类型和元数据定义
11
+ export * from './Result.js';
12
+ // QualityCheck 实体 - 包含详细的质量检查类型和检查结果定义
13
+ export * from './QualityCheck.js';
14
+ // TokenUsage 实体
15
+ export * from './TokenUsage.js';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AACvD,cAAc,WAAW,CAAC;AAE1B,iCAAiC;AACjC,cAAc,eAAe,CAAC;AAE9B,8BAA8B;AAC9B,cAAc,aAAa,CAAC;AAE5B,uCAAuC;AACvC,cAAc,mBAAmB,CAAC;AAElC,gBAAgB;AAChB,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Quality Check Repository 接口
3
+ */
4
+ /**
5
+ * 创建质量检查记录参数
6
+ */
7
+ export interface CreateQualityCheckParams {
8
+ taskId: string;
9
+ checkType: 'text' | 'image';
10
+ score: number;
11
+ passed: boolean;
12
+ hardConstraintsPassed: boolean;
13
+ details: Record<string, any>;
14
+ fixSuggestions?: string[];
15
+ rubricVersion?: string;
16
+ modelName?: string;
17
+ promptHash?: string;
18
+ }
19
+ /**
20
+ * 质量检查记录
21
+ */
22
+ export interface QualityCheckRecord {
23
+ id: number;
24
+ taskId: string;
25
+ checkType: 'text' | 'image';
26
+ score: number;
27
+ passed: boolean;
28
+ hardConstraintsPassed: boolean;
29
+ details: Record<string, any>;
30
+ fixSuggestions: string[] | null;
31
+ rubricVersion: string | null;
32
+ modelName: string | null;
33
+ promptHash: string | null;
34
+ createdAt: Date;
35
+ }
36
+ /**
37
+ * Quality Check Repository 接口
38
+ */
39
+ export interface IQualityCheckRepository {
40
+ /**
41
+ * 创建质量检查记录
42
+ */
43
+ create(params: CreateQualityCheckParams): Promise<void>;
44
+ /**
45
+ * 根据任务 ID 查询质量检查
46
+ */
47
+ findByTaskId(taskId: string): Promise<QualityCheckRecord[]>;
48
+ }
49
+ //# sourceMappingURL=QualityCheckRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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CAAC;CAC7D"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Quality Check Repository 接口
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=QualityCheckRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QualityCheckRepository.js","sourceRoot":"","sources":["../../../src/domain/repositories/QualityCheckRepository.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Result Repository 接口
3
+ */
4
+ /**
5
+ * 创建结果参数
6
+ */
7
+ export interface CreateResultParams {
8
+ taskId: string;
9
+ resultType: 'article' | 'image' | 'text';
10
+ content?: string;
11
+ filePath?: string;
12
+ metadata?: Record<string, any>;
13
+ }
14
+ /**
15
+ * 结果记录
16
+ */
17
+ export interface ResultRecord {
18
+ id: number;
19
+ taskId: string;
20
+ resultType: 'article' | 'image' | 'text';
21
+ content: string | null;
22
+ filePath: string | null;
23
+ metadata: Record<string, any> | null;
24
+ createdAt: Date;
25
+ }
26
+ /**
27
+ * Result Repository 接口
28
+ */
29
+ export interface IResultRepository {
30
+ /**
31
+ * 创建结果记录
32
+ */
33
+ create(params: CreateResultParams): Promise<void>;
34
+ /**
35
+ * 根据任务 ID 查询结果
36
+ */
37
+ findByTaskId(taskId: string): Promise<ResultRecord[]>;
38
+ /**
39
+ * 删除任务的所有结果
40
+ */
41
+ deleteByTaskId(taskId: string): Promise<void>;
42
+ }
43
+ //# sourceMappingURL=ResultRepository.d.ts.map