@ryanfw/prompt-orchestration-pipeline 0.17.5 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/README.md +42 -10
  2. package/package.json +23 -18
  3. package/src/api/index.ts +61 -0
  4. package/src/api/validators/json.ts +67 -0
  5. package/src/cli/__tests__/analyze-task.test.ts +51 -0
  6. package/src/cli/__tests__/constants.test.ts +33 -0
  7. package/src/cli/__tests__/index.test.ts +386 -0
  8. package/src/cli/__tests__/self-reexec.test.ts +26 -0
  9. package/src/cli/__tests__/types.test.ts +56 -0
  10. package/src/cli/__tests__/update-pipeline-json.test.ts +67 -0
  11. package/src/cli/analyze-task.ts +33 -0
  12. package/src/cli/constants.ts +33 -0
  13. package/src/cli/index.ts +505 -0
  14. package/src/cli/self-reexec.ts +25 -0
  15. package/src/cli/types.ts +29 -0
  16. package/src/cli/update-pipeline-json.ts +33 -0
  17. package/src/config/__tests__/log-events.test.ts +162 -0
  18. package/src/config/__tests__/models.test.ts +317 -0
  19. package/src/config/__tests__/paths.test.ts +121 -0
  20. package/src/config/__tests__/statuses.test.ts +191 -0
  21. package/src/config/index.ts +4 -0
  22. package/src/config/log-events.ts +74 -0
  23. package/src/config/models.ts +475 -0
  24. package/src/config/paths.ts +54 -0
  25. package/src/config/statuses.ts +93 -0
  26. package/src/core/__tests__/batch-runner.test.ts +431 -0
  27. package/src/core/__tests__/config.test.ts +121 -0
  28. package/src/core/__tests__/environment.test.ts +68 -0
  29. package/src/core/__tests__/file-io.test.ts +38 -0
  30. package/src/core/__tests__/logger.test.ts +72 -0
  31. package/src/core/__tests__/module-loader.test.ts +46 -0
  32. package/src/core/__tests__/retry.test.ts +119 -0
  33. package/src/core/__tests__/task-runner.test.ts +59 -0
  34. package/src/core/__tests__/validation.test.ts +87 -0
  35. package/src/core/batch-runner.ts +221 -0
  36. package/src/core/config.ts +423 -0
  37. package/src/core/environment.ts +77 -0
  38. package/src/core/file-io.ts +354 -0
  39. package/src/core/lifecycle-policy.ts +52 -0
  40. package/src/core/logger.ts +147 -0
  41. package/src/core/module-loader.ts +60 -0
  42. package/src/core/orchestrator.ts +399 -0
  43. package/src/core/pipeline-runner.ts +570 -0
  44. package/src/core/progress.ts +33 -0
  45. package/src/core/retry.ts +52 -0
  46. package/src/core/status-initializer.ts +69 -0
  47. package/src/core/status-writer.ts +388 -0
  48. package/src/core/symlink-bridge.ts +45 -0
  49. package/src/core/symlink-utils.ts +78 -0
  50. package/src/core/task-runner.ts +830 -0
  51. package/src/core/validation.ts +110 -0
  52. package/src/index.ts +1 -0
  53. package/src/jsdom.d.ts +11 -0
  54. package/src/llm/__tests__/index.test.ts +642 -0
  55. package/src/llm/index.ts +534 -0
  56. package/src/providers/__tests__/anthropic.test.ts +236 -0
  57. package/src/providers/__tests__/base.test.ts +321 -0
  58. package/src/providers/__tests__/claude-code.test.ts +214 -0
  59. package/src/providers/__tests__/deepseek.test.ts +338 -0
  60. package/src/providers/__tests__/gemini.test.ts +365 -0
  61. package/src/providers/__tests__/moonshot.test.ts +363 -0
  62. package/src/providers/__tests__/openai.test.ts +331 -0
  63. package/src/providers/__tests__/types.test.ts +93 -0
  64. package/src/providers/__tests__/zhipu.test.ts +371 -0
  65. package/src/providers/anthropic.ts +157 -0
  66. package/src/providers/base.ts +219 -0
  67. package/src/providers/claude-code.ts +123 -0
  68. package/src/providers/deepseek.ts +291 -0
  69. package/src/providers/gemini.ts +229 -0
  70. package/src/providers/moonshot.ts +180 -0
  71. package/src/providers/openai.ts +272 -0
  72. package/src/providers/types.ts +285 -0
  73. package/src/providers/zhipu.ts +207 -0
  74. package/src/react-dom-client.d.ts +10 -0
  75. package/src/react-syntax-highlighter.d.ts +14 -0
  76. package/src/task-analysis/__tests__/enrichers-analysis-writer.test.ts +86 -0
  77. package/src/task-analysis/__tests__/enrichers-artifact-resolver.test.ts +124 -0
  78. package/src/task-analysis/__tests__/enrichers-schema-deducer.test.ts +146 -0
  79. package/src/task-analysis/__tests__/enrichers-schema-writer.test.ts +169 -0
  80. package/src/task-analysis/__tests__/extractors-artifacts.test.ts +133 -0
  81. package/src/task-analysis/__tests__/extractors-llm-calls.test.ts +46 -0
  82. package/src/task-analysis/__tests__/extractors-stages.test.ts +52 -0
  83. package/src/task-analysis/__tests__/index.test.ts +143 -0
  84. package/src/task-analysis/__tests__/parser.test.ts +41 -0
  85. package/src/task-analysis/__tests__/types.test.ts +165 -0
  86. package/src/task-analysis/__tests__/utils-ast.test.ts +82 -0
  87. package/src/task-analysis/enrichers/analysis-writer.ts +75 -0
  88. package/src/task-analysis/enrichers/artifact-resolver.ts +89 -0
  89. package/src/task-analysis/enrichers/schema-deducer.ts +95 -0
  90. package/src/task-analysis/enrichers/schema-writer.ts +68 -0
  91. package/src/task-analysis/extractors/artifacts.ts +143 -0
  92. package/src/task-analysis/extractors/llm-calls.ts +117 -0
  93. package/src/task-analysis/extractors/stages.ts +45 -0
  94. package/src/task-analysis/index.ts +40 -0
  95. package/src/task-analysis/parser.ts +20 -0
  96. package/src/task-analysis/types.ts +83 -0
  97. package/src/task-analysis/utils/ast.ts +45 -0
  98. package/src/ui/client/__tests__/api-errors.test.ts +41 -0
  99. package/src/ui/client/__tests__/api.test.ts +62 -0
  100. package/src/ui/client/__tests__/bootstrap.test.ts +106 -0
  101. package/src/ui/client/__tests__/job-adapter.test.ts +133 -0
  102. package/src/ui/client/__tests__/main.test.tsx +32 -0
  103. package/src/ui/client/__tests__/sse-fetch.test.ts +95 -0
  104. package/src/ui/client/__tests__/time-store.test.ts +138 -0
  105. package/src/ui/client/__tests__/types.test.ts +64 -0
  106. package/src/ui/client/__tests__/useAnalysisProgress.test.ts +36 -0
  107. package/src/ui/client/__tests__/useJobDetailWithUpdates.test.ts +74 -0
  108. package/src/ui/client/__tests__/useJobList.test.ts +40 -0
  109. package/src/ui/client/__tests__/useJobListWithUpdates.test.ts +67 -0
  110. package/src/ui/client/adapters/job-adapter.ts +200 -0
  111. package/src/ui/client/api.ts +172 -0
  112. package/src/ui/client/bootstrap.ts +56 -0
  113. package/src/ui/client/hooks/useAnalysisProgress.ts +108 -0
  114. package/src/ui/client/hooks/useJobDetailWithUpdates.ts +227 -0
  115. package/src/ui/client/hooks/useJobList.ts +75 -0
  116. package/src/ui/client/hooks/useJobListWithUpdates.ts +191 -0
  117. package/src/ui/client/index.css +52 -99
  118. package/src/ui/client/index.html +2 -2
  119. package/src/ui/client/main.tsx +51 -0
  120. package/src/ui/client/sse-fetch.ts +97 -0
  121. package/src/ui/client/time-store.ts +103 -0
  122. package/src/ui/client/types.ts +199 -0
  123. package/src/ui/components/AddPipelineSidebar.tsx +105 -0
  124. package/src/ui/components/AnalysisProgressTray.tsx +56 -0
  125. package/src/ui/components/DAGGrid.tsx +410 -0
  126. package/src/ui/components/JobCard.tsx +34 -0
  127. package/src/ui/components/JobDetail.tsx +69 -0
  128. package/src/ui/components/JobTable.tsx +116 -0
  129. package/src/ui/components/Layout.tsx +124 -0
  130. package/src/ui/components/LiveText.tsx +29 -0
  131. package/src/ui/components/MarkdownRenderer.tsx +80 -0
  132. package/src/ui/components/PageSubheader.tsx +38 -0
  133. package/src/ui/components/PipelineDAGGrid.tsx +52 -0
  134. package/src/ui/components/PipelineTypeTaskSidebar.tsx +49 -0
  135. package/src/ui/components/SchemaPreviewPanel.tsx +56 -0
  136. package/src/ui/components/StageTimeline.tsx +31 -0
  137. package/src/ui/components/TaskAnalysisDisplay.tsx +111 -0
  138. package/src/ui/components/TaskCreationSidebar.tsx +187 -0
  139. package/src/ui/components/TaskDetailSidebar.tsx +96 -0
  140. package/src/ui/components/TaskFilePane.tsx +143 -0
  141. package/src/ui/components/TimerText.tsx +28 -0
  142. package/src/ui/components/UploadSeed.tsx +100 -0
  143. package/src/ui/components/__tests__/AddPipelineSidebar.test.tsx +45 -0
  144. package/src/ui/components/__tests__/DAGGrid.test.tsx +119 -0
  145. package/src/ui/components/__tests__/JobTable.test.tsx +45 -0
  146. package/src/ui/components/__tests__/LiveText.test.tsx +15 -0
  147. package/src/ui/components/__tests__/MarkdownRenderer.test.tsx +32 -0
  148. package/src/ui/components/__tests__/StageTimeline.test.tsx +39 -0
  149. package/src/ui/components/__tests__/TimerText.test.tsx +15 -0
  150. package/src/ui/components/__tests__/UploadSeed.test.tsx +68 -0
  151. package/src/ui/components/__tests__/dag-shared.test.ts +119 -0
  152. package/src/ui/components/__tests__/test-dom.ts +65 -0
  153. package/src/ui/components/__tests__/types.test.ts +56 -0
  154. package/src/ui/components/dag-shared.ts +120 -0
  155. package/src/ui/components/onboarding/EmptyState.tsx +23 -0
  156. package/src/ui/components/onboarding/HintBanner.tsx +55 -0
  157. package/src/ui/components/onboarding/HotspotBeacon.tsx +12 -0
  158. package/src/ui/components/onboarding/OnboardingChecklist.tsx +95 -0
  159. package/src/ui/components/onboarding/SetupStepper.tsx +64 -0
  160. package/src/ui/components/onboarding/SuccessState.tsx +22 -0
  161. package/src/ui/components/onboarding/WelcomeModal.tsx +90 -0
  162. package/src/ui/components/onboarding/index.ts +7 -0
  163. package/src/ui/components/types.ts +221 -0
  164. package/src/ui/components/ui/Badge.tsx +34 -0
  165. package/src/ui/components/ui/Button.tsx +63 -0
  166. package/src/ui/components/ui/Card.tsx +37 -0
  167. package/src/ui/components/ui/CopyableCode.tsx +85 -0
  168. package/src/ui/components/ui/Logo.tsx +18 -0
  169. package/src/ui/components/ui/Progress.tsx +32 -0
  170. package/src/ui/components/ui/RestartJobModal.tsx +87 -0
  171. package/src/ui/components/ui/Separator.tsx +8 -0
  172. package/src/ui/components/ui/Sidebar.tsx +78 -0
  173. package/src/ui/components/ui/StopJobModal.tsx +78 -0
  174. package/src/ui/components/ui/Toast.tsx +80 -0
  175. package/src/ui/components/ui/__tests__/Badge.test.tsx +21 -0
  176. package/src/ui/components/ui/__tests__/Button.test.tsx +21 -0
  177. package/src/ui/components/ui/__tests__/CopyableCode.test.tsx +28 -0
  178. package/src/ui/components/ui/__tests__/Progress.test.tsx +20 -0
  179. package/src/ui/components/ui/__tests__/RestartJobModal.test.tsx +35 -0
  180. package/src/ui/components/ui/__tests__/Sidebar.test.tsx +31 -0
  181. package/src/ui/components/ui/__tests__/StopJobModal.test.tsx +52 -0
  182. package/src/ui/components/ui/__tests__/Toast.test.tsx +35 -0
  183. package/src/ui/dist/assets/{index-BidlfsSr.js → index-bRQpD9rj.js} +47459 -55387
  184. package/src/ui/dist/assets/{index-BidlfsSr.js.map → index-bRQpD9rj.js.map} +1 -1
  185. package/src/ui/dist/assets/style-DA1Ma4YS.css +2 -0
  186. package/src/ui/dist/index.html +3 -3
  187. package/src/ui/embedded-assets.js +12 -0
  188. package/src/ui/pages/Code.tsx +692 -0
  189. package/src/ui/pages/PipelineDetail.tsx +99 -0
  190. package/src/ui/pages/PipelineList.tsx +78 -0
  191. package/src/ui/pages/PipelineTypeDetail.tsx +94 -0
  192. package/src/ui/pages/PromptPipelineDashboard.tsx +70 -0
  193. package/src/ui/pages/__tests__/PromptPipelineDashboard.test.tsx +71 -0
  194. package/src/ui/pages/__tests__/pages.test.tsx +182 -0
  195. package/src/ui/server/__tests__/config-bridge-node.test.ts +54 -0
  196. package/src/ui/server/__tests__/config-bridge.test.ts +41 -0
  197. package/src/ui/server/__tests__/file-endpoints.test.ts +130 -0
  198. package/src/ui/server/__tests__/file-reader.test.ts +69 -0
  199. package/src/ui/server/__tests__/index.test.ts +36 -0
  200. package/src/ui/server/__tests__/job-index.test.ts +39 -0
  201. package/src/ui/server/__tests__/job-reader.test.ts +61 -0
  202. package/src/ui/server/__tests__/job-scanner.test.ts +44 -0
  203. package/src/ui/server/__tests__/router.test.ts +41 -0
  204. package/src/ui/server/__tests__/sse-broadcast.test.ts +32 -0
  205. package/src/ui/server/__tests__/sse-enhancer.test.ts +56 -0
  206. package/src/ui/server/__tests__/sse-registry.test.ts +90 -0
  207. package/src/ui/server/__tests__/utils.test.ts +62 -0
  208. package/src/ui/server/__tests__/zip-utils.test.ts +23 -0
  209. package/src/ui/server/config-bridge-node.ts +119 -0
  210. package/src/ui/server/config-bridge.ts +65 -0
  211. package/src/ui/server/embedded-assets.ts +7 -0
  212. package/src/ui/server/endpoints/create-pipeline-endpoint.ts +52 -0
  213. package/src/ui/server/endpoints/file-endpoints.ts +86 -0
  214. package/src/ui/server/endpoints/job-control-endpoints.ts +211 -0
  215. package/src/ui/server/endpoints/job-endpoints.ts +45 -0
  216. package/src/ui/server/endpoints/pipeline-analysis-endpoint.ts +46 -0
  217. package/src/ui/server/endpoints/pipeline-artifacts-endpoint.ts +8 -0
  218. package/src/ui/server/endpoints/pipeline-type-detail-endpoint.ts +26 -0
  219. package/src/ui/server/endpoints/pipelines-endpoint.ts +25 -0
  220. package/src/ui/server/endpoints/schema-file-endpoint.ts +12 -0
  221. package/src/ui/server/endpoints/sse-endpoints.ts +24 -0
  222. package/src/ui/server/endpoints/state-endpoint.ts +11 -0
  223. package/src/ui/server/endpoints/task-analysis-endpoint.ts +12 -0
  224. package/src/ui/server/endpoints/task-creation-endpoint.ts +12 -0
  225. package/src/ui/server/endpoints/task-save-endpoint.ts +16 -0
  226. package/src/ui/server/endpoints/upload-endpoints.ts +64 -0
  227. package/src/ui/server/file-reader.ts +131 -0
  228. package/src/ui/server/index.ts +148 -0
  229. package/src/ui/server/job-index.ts +100 -0
  230. package/src/ui/server/job-reader.ts +82 -0
  231. package/src/ui/server/job-scanner.ts +57 -0
  232. package/src/ui/server/router.ts +115 -0
  233. package/src/ui/server/sse-broadcast.ts +40 -0
  234. package/src/ui/server/sse-enhancer.ts +61 -0
  235. package/src/ui/server/sse-registry.ts +141 -0
  236. package/src/ui/server/utils/http-utils.ts +90 -0
  237. package/src/ui/server/utils/mime-types.ts +58 -0
  238. package/src/ui/server/utils/slug.ts +27 -0
  239. package/src/ui/server/zip-utils.ts +22 -0
  240. package/src/ui/state/__tests__/analysis-lock.test.ts +36 -0
  241. package/src/ui/state/__tests__/change-tracker.test.ts +61 -0
  242. package/src/ui/state/__tests__/index.test.ts +29 -0
  243. package/src/ui/state/__tests__/job-change-detector.test.ts +32 -0
  244. package/src/ui/state/__tests__/mention-parser.test.ts +18 -0
  245. package/src/ui/state/__tests__/schema-loader.test.ts +68 -0
  246. package/src/ui/state/__tests__/snapshot.test.ts +84 -0
  247. package/src/ui/state/__tests__/sse-stream.test.ts +57 -0
  248. package/src/ui/state/__tests__/task-reviewer.test.ts +48 -0
  249. package/src/ui/state/__tests__/types.test.ts +103 -0
  250. package/src/ui/state/__tests__/watcher.test.ts +135 -0
  251. package/src/ui/state/analysis-lock.ts +37 -0
  252. package/src/ui/state/change-tracker.ts +59 -0
  253. package/src/ui/state/index.ts +12 -0
  254. package/src/ui/state/job-change-detector.ts +47 -0
  255. package/src/ui/state/mention-parser.ts +16 -0
  256. package/src/ui/state/schema-loader.ts +61 -0
  257. package/src/ui/state/snapshot.ts +165 -0
  258. package/src/ui/state/sse-stream.ts +63 -0
  259. package/src/ui/state/task-reviewer.ts +26 -0
  260. package/src/ui/state/transformers/__tests__/list-transformer.test.ts +91 -0
  261. package/src/ui/state/transformers/__tests__/status-transformer.test.ts +79 -0
  262. package/src/ui/state/transformers/list-transformer.ts +187 -0
  263. package/src/ui/state/transformers/status-transformer.ts +193 -0
  264. package/src/ui/state/types.ts +231 -0
  265. package/src/ui/state/watcher.ts +178 -0
  266. package/src/utils/dag.ts +35 -0
  267. package/src/utils/duration.ts +10 -0
  268. package/src/utils/formatters.ts +11 -0
  269. package/src/utils/geometry-equality.ts +28 -0
  270. package/src/utils/jobs.ts +6 -0
  271. package/src/utils/task-files.ts +15 -0
  272. package/src/utils/time-utils.ts +18 -0
  273. package/src/utils/ui.tsx +21 -0
  274. package/src/api/files.js +0 -48
  275. package/src/api/index.js +0 -353
  276. package/src/api/validators/json.js +0 -46
  277. package/src/api/validators/seed.js +0 -140
  278. package/src/cli/analyze-task.js +0 -51
  279. package/src/cli/index.js +0 -493
  280. package/src/cli/run-orchestrator.js +0 -39
  281. package/src/cli/update-pipeline-json.js +0 -47
  282. package/src/components/AddPipelineSidebar.jsx +0 -144
  283. package/src/components/AnalysisProgressTray.jsx +0 -87
  284. package/src/components/DAGGrid.jsx +0 -868
  285. package/src/components/JobCard.jsx +0 -98
  286. package/src/components/JobDetail.jsx +0 -173
  287. package/src/components/JobTable.jsx +0 -252
  288. package/src/components/Layout.jsx +0 -244
  289. package/src/components/LiveText.jsx +0 -47
  290. package/src/components/MarkdownRenderer.jsx +0 -149
  291. package/src/components/PageSubheader.jsx +0 -75
  292. package/src/components/PipelineDAGGrid.jsx +0 -404
  293. package/src/components/PipelineTypeTaskSidebar.jsx +0 -96
  294. package/src/components/SchemaPreviewPanel.jsx +0 -97
  295. package/src/components/StageTimeline.jsx +0 -36
  296. package/src/components/TaskAnalysisDisplay.jsx +0 -227
  297. package/src/components/TaskCreationSidebar.jsx +0 -598
  298. package/src/components/TaskDetailSidebar.jsx +0 -242
  299. package/src/components/TaskFilePane.jsx +0 -625
  300. package/src/components/TimerText.jsx +0 -82
  301. package/src/components/UploadSeed.jsx +0 -169
  302. package/src/components/ui/CopyableCode.jsx +0 -110
  303. package/src/components/ui/Logo.jsx +0 -16
  304. package/src/components/ui/RestartJobModal.jsx +0 -174
  305. package/src/components/ui/StopJobModal.jsx +0 -183
  306. package/src/components/ui/badge.jsx +0 -20
  307. package/src/components/ui/button.jsx +0 -75
  308. package/src/components/ui/card.jsx +0 -20
  309. package/src/components/ui/focus-styles.css +0 -60
  310. package/src/components/ui/progress.jsx +0 -26
  311. package/src/components/ui/separator.jsx +0 -6
  312. package/src/components/ui/sidebar.jsx +0 -118
  313. package/src/components/ui/toast.jsx +0 -138
  314. package/src/config/log-events.js +0 -77
  315. package/src/config/models.js +0 -443
  316. package/src/config/paths.js +0 -99
  317. package/src/config/statuses.js +0 -119
  318. package/src/core/batch-runner.js +0 -277
  319. package/src/core/config.js +0 -583
  320. package/src/core/environment.js +0 -56
  321. package/src/core/file-io.js +0 -418
  322. package/src/core/lifecycle-policy.js +0 -62
  323. package/src/core/logger.js +0 -219
  324. package/src/core/module-loader.js +0 -171
  325. package/src/core/orchestrator.js +0 -433
  326. package/src/core/pipeline-runner.js +0 -510
  327. package/src/core/progress.js +0 -66
  328. package/src/core/retry.js +0 -83
  329. package/src/core/status-initializer.js +0 -155
  330. package/src/core/status-writer.js +0 -641
  331. package/src/core/symlink-bridge.js +0 -55
  332. package/src/core/symlink-utils.js +0 -282
  333. package/src/core/task-runner.js +0 -928
  334. package/src/core/validation.js +0 -236
  335. package/src/llm/README.md +0 -454
  336. package/src/llm/index.js +0 -1013
  337. package/src/pages/Code.jsx +0 -823
  338. package/src/pages/PipelineDetail.jsx +0 -302
  339. package/src/pages/PipelineList.jsx +0 -214
  340. package/src/pages/PipelineTypeDetail.jsx +0 -234
  341. package/src/pages/PromptPipelineDashboard.jsx +0 -169
  342. package/src/providers/anthropic.js +0 -138
  343. package/src/providers/base.js +0 -167
  344. package/src/providers/claude-code.js +0 -156
  345. package/src/providers/deepseek.js +0 -178
  346. package/src/providers/gemini.js +0 -230
  347. package/src/providers/moonshot.js +0 -198
  348. package/src/providers/openai.js +0 -275
  349. package/src/providers/zhipu.js +0 -161
  350. package/src/task-analysis/enrichers/analysis-writer.js +0 -94
  351. package/src/task-analysis/enrichers/artifact-resolver.js +0 -98
  352. package/src/task-analysis/enrichers/schema-deducer.js +0 -151
  353. package/src/task-analysis/enrichers/schema-writer.js +0 -74
  354. package/src/task-analysis/extractors/artifacts.js +0 -181
  355. package/src/task-analysis/extractors/llm-calls.js +0 -176
  356. package/src/task-analysis/extractors/stages.js +0 -51
  357. package/src/task-analysis/index.js +0 -105
  358. package/src/task-analysis/parser.js +0 -28
  359. package/src/task-analysis/utils/ast.js +0 -43
  360. package/src/ui/README.md +0 -86
  361. package/src/ui/client/adapters/job-adapter.js +0 -351
  362. package/src/ui/client/api.js +0 -362
  363. package/src/ui/client/bootstrap.js +0 -120
  364. package/src/ui/client/hooks/useAnalysisProgress.js +0 -145
  365. package/src/ui/client/hooks/useJobDetailWithUpdates.js +0 -597
  366. package/src/ui/client/hooks/useJobList.js +0 -63
  367. package/src/ui/client/hooks/useJobListWithUpdates.js +0 -335
  368. package/src/ui/client/main.jsx +0 -47
  369. package/src/ui/client/sse-fetch.js +0 -120
  370. package/src/ui/client/time-store.js +0 -161
  371. package/src/ui/config-bridge.js +0 -140
  372. package/src/ui/config-bridge.node.js +0 -301
  373. package/src/ui/dist/app.js +0 -262
  374. package/src/ui/dist/assets/style-CdV-vuS0.css +0 -180
  375. package/src/ui/dist/favicon.svg +0 -12
  376. package/src/ui/endpoints/create-pipeline-endpoint.js +0 -194
  377. package/src/ui/endpoints/file-endpoints.js +0 -330
  378. package/src/ui/endpoints/job-control-endpoints.js +0 -1038
  379. package/src/ui/endpoints/job-endpoints.js +0 -362
  380. package/src/ui/endpoints/pipeline-analysis-endpoint.js +0 -305
  381. package/src/ui/endpoints/pipeline-artifacts-endpoint.js +0 -109
  382. package/src/ui/endpoints/pipeline-type-detail-endpoint.js +0 -181
  383. package/src/ui/endpoints/pipelines-endpoint.js +0 -133
  384. package/src/ui/endpoints/schema-file-endpoint.js +0 -105
  385. package/src/ui/endpoints/sse-endpoints.js +0 -223
  386. package/src/ui/endpoints/state-endpoint.js +0 -85
  387. package/src/ui/endpoints/task-analysis-endpoint.js +0 -104
  388. package/src/ui/endpoints/task-creation-endpoint.js +0 -155
  389. package/src/ui/endpoints/task-save-endpoint.js +0 -154
  390. package/src/ui/endpoints/upload-endpoints.js +0 -406
  391. package/src/ui/express-app.js +0 -231
  392. package/src/ui/file-reader.js +0 -216
  393. package/src/ui/job-change-detector.js +0 -83
  394. package/src/ui/job-index.js +0 -231
  395. package/src/ui/job-reader.js +0 -167
  396. package/src/ui/job-scanner.js +0 -188
  397. package/src/ui/lib/analysis-lock.js +0 -67
  398. package/src/ui/lib/mention-parser.js +0 -24
  399. package/src/ui/lib/schema-loader.js +0 -69
  400. package/src/ui/lib/sse.js +0 -30
  401. package/src/ui/lib/task-reviewer.js +0 -51
  402. package/src/ui/public/app.js +0 -262
  403. package/src/ui/public/favicon.svg +0 -12
  404. package/src/ui/server.js +0 -300
  405. package/src/ui/sse-broadcast.js +0 -93
  406. package/src/ui/sse-enhancer.js +0 -148
  407. package/src/ui/sse.js +0 -204
  408. package/src/ui/state-snapshot.js +0 -252
  409. package/src/ui/state.js +0 -67
  410. package/src/ui/transformers/list-transformer.js +0 -367
  411. package/src/ui/transformers/status-transformer.js +0 -294
  412. package/src/ui/utils/http-utils.js +0 -139
  413. package/src/ui/utils/mime-types.js +0 -196
  414. package/src/ui/utils/slug.js +0 -31
  415. package/src/ui/vite.config.js +0 -22
  416. package/src/ui/watcher.js +0 -179
  417. package/src/ui/zip-utils.js +0 -103
  418. package/src/utils/dag.js +0 -105
  419. package/src/utils/duration.js +0 -120
  420. package/src/utils/formatters.js +0 -27
  421. package/src/utils/geometry-equality.js +0 -83
  422. package/src/utils/id-generator.js +0 -30
  423. package/src/utils/jobs.js +0 -46
  424. package/src/utils/pipelines.js +0 -48
  425. package/src/utils/task-files.js +0 -271
  426. package/src/utils/time-utils.js +0 -40
  427. package/src/utils/token-cost-calculator.js +0 -294
  428. package/src/utils/ui.jsx +0 -74
package/README.md CHANGED
@@ -104,34 +104,66 @@ flowchart LR
104
104
 
105
105
  ## Getting Started
106
106
 
107
- ### 1. Install
108
- Add the orchestrator as a dependency in your Node.js project:
107
+ Choose one runtime path:
108
+ - **Bun CLI path**: for Bun-based projects (`bunx pipeline-orchestrator ...`).
109
+ - **Standalone binary path**: download a prebuilt release binary, no Bun runtime required.
110
+
111
+ ### 1A. Install for Bun projects
112
+ Add the orchestrator as a dependency:
109
113
  ```bash
110
- npm install @ryan-fw/prompt-orchestration-pipeline
114
+ bun add @ryanfw/prompt-orchestration-pipeline
115
+ ```
116
+
117
+ ### 1B. Install standalone binary (no Bun required)
118
+ Download a release asset from:
119
+ `https://github.com/ryan-mahoney/prompt-orchestration-pipeline/releases`
120
+
121
+ Available assets:
122
+ - `pipeline-orchestrator-linux-x64`
123
+ - `pipeline-orchestrator-macos-x64`
124
+ - `pipeline-orchestrator-macos-arm64`
125
+ - `pipeline-orchestrator-windows-x64.exe`
126
+
127
+ Linux/macOS example:
128
+ ```bash
129
+ curl -L -o pipeline-orchestrator \
130
+ https://github.com/ryan-mahoney/prompt-orchestration-pipeline/releases/latest/download/pipeline-orchestrator-macos-arm64
131
+ chmod +x pipeline-orchestrator
111
132
  ```
112
133
 
113
134
  ### 2. Initialize Structure
114
- Scaffold the required `pipeline-config` and `pipeline-data` directories:
135
+ Use one of:
115
136
  ```bash
116
- npx pipeline-orchestrator init --root ./pipelines
137
+ # Bun path
138
+ bunx pipeline-orchestrator init --root ./pipelines
139
+
140
+ # Standalone binary path
141
+ ./pipeline-orchestrator init --root ./pipelines
117
142
  ```
118
143
 
119
- ### 3. Configure Scripts
120
- Add the following to your `package.json` for easy access:
144
+ ### 3. Configure Scripts (Bun path)
145
+ For Bun projects, add:
121
146
  ```json
122
147
  {
123
148
  "scripts": {
124
- "pipeline": "npx pipeline-orchestrator start --root pipelines --port 3010"
149
+ "pipeline": "bunx pipeline-orchestrator start --root pipelines --port 3010"
125
150
  }
126
151
  }
127
152
  ```
128
153
 
129
154
  ### 4. Start the System
155
+ Use one of:
130
156
  ```bash
131
- npm run pipeline
157
+ # Bun path
158
+ bun run pipeline
159
+
160
+ # Standalone binary path
161
+ ./pipeline-orchestrator start --root pipelines --port 3010
132
162
  ```
133
163
  This starts the file watcher and the web dashboard at `http://localhost:3010`.
134
164
 
165
+ > Note: `npx pipeline-orchestrator ...` requires Bun to be installed because the npm bin entry runs through a Bun shebang.
166
+
135
167
  ### 5. Run a Job
136
168
  Drop a JSON file into `pipelines/pipeline-data/pending/`:
137
169
  ```json
@@ -142,4 +174,4 @@ Drop a JSON file into `pipelines/pipeline-data/pending/`:
142
174
  }
143
175
  ```
144
176
 
145
- The Orchestrator will pick it up, move it to `current/`, and start processing.
177
+ The Orchestrator will pick it up, move it to `current/`, and start processing.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ryanfw/prompt-orchestration-pipeline",
3
- "version": "0.17.5",
3
+ "version": "1.0.3",
4
4
  "description": "A Prompt-orchestration pipeline (POP) is a framework for building, running, and experimenting with complex chains of LLM tasks.",
5
5
  "type": "module",
6
- "main": "src/ui/server.js",
6
+ "main": "src/ui/server/index.ts",
7
7
  "bin": {
8
- "pipeline-orchestrator": "src/cli/index.js"
8
+ "pipeline-orchestrator": "src/cli/index.ts"
9
9
  },
10
10
  "files": [
11
11
  "src",
@@ -21,20 +21,24 @@
21
21
  "access": "public"
22
22
  },
23
23
  "scripts": {
24
- "analyze": "node src/cli/index.js analyze",
25
- "deduce-schemas": "node scripts/deduce-schemas.js",
26
- "test": "vitest run --config ./vite.config.js --root .",
24
+ "analyze": "bun src/cli/index.ts analyze",
25
+ "build:bin": "bun run ui:build && bun build --compile src/cli/index.ts",
26
+ "build:bin:local": "bun run build:bin --outfile=dist/pipeline-orchestrator",
27
+ "deduce-schemas": "bun scripts/deduce-schemas.js",
28
+ "test": "bash scripts/test.sh",
27
29
  "lint": "eslint . --ext .js,.jsx",
28
- "backend": "NODE_ENV=development nodemon src/ui/server.js",
29
- "ui": "NODE_ENV=development nodemon src/ui/server.js",
30
+ "backend": "NODE_ENV=development bun --watch src/ui/server/index.ts",
31
+ "ui": "NODE_ENV=development bun --watch src/ui/server/index.ts",
30
32
  "ui:dev": "vite",
31
- "ui:build": "vite build",
32
- "prepack": "npm run ui:build",
33
- "ui:prod": "node src/ui/server.js",
34
- "demo:ui": "NODE_ENV=production PO_ROOT=demo node src/ui/server.js",
35
- "demo:orchestrator": "PO_ROOT=demo NODE_ENV=production node -e \"import('./src/core/orchestrator.js').then(m => m.startOrchestrator({ dataDir: process.env.PO_ROOT || 'demo' })).catch(err => { console.error(err); process.exit(1) })\"",
36
- "demo:all": "NODE_ENV=development PO_ROOT=demo npm run ui:build && concurrently \"npm:demo:ui\" \"npm:demo:orchestrator\" --kill-others-on-fail",
37
- "demo:prod": "npm run ui:build && NODE_ENV=production PO_ROOT=demo node src/ui/server.js"
33
+ "ui:build": "vite build && bun run generate:embedded-assets",
34
+ "prepack": "bun run ui:build",
35
+ "ui:prod": "bun src/ui/server/index.ts",
36
+ "demo:ui": "NODE_ENV=production PO_ROOT=demo bun src/ui/server/index.ts",
37
+ "demo:orchestrator": "PO_ROOT=demo NODE_ENV=production bun -e \"import('./src/core/orchestrator.ts').then(m => m.startOrchestrator({ dataDir: process.env.PO_ROOT || 'demo' })).catch(err => { console.error(err); process.exit(1) })\"",
38
+ "demo:all": "NODE_ENV=development PO_ROOT=demo bun run ui:build && concurrently \"bun:demo:ui\" \"bun:demo:orchestrator\" --kill-others-on-fail",
39
+ "demo:prod": "bun run ui:build && NODE_ENV=production PO_ROOT=demo bun src/ui/server/index.ts",
40
+ "generate:embedded-assets": "bun scripts/generate-embedded-assets.js",
41
+ "typecheck": "tsc --noEmit"
38
42
  },
39
43
  "dependencies": {
40
44
  "@babel/parser": "^7.28.5",
@@ -47,12 +51,12 @@
47
51
  "@radix-ui/themes": "^3.2.1",
48
52
  "ajv": "^8.17.1",
49
53
  "ajv-formats": "^3.0.1",
50
- "better-sqlite3": "^11.7.0",
51
54
  "chokidar": "^3.5.3",
52
55
  "commander": "^14.0.2",
53
56
  "dotenv": "^17.2.3",
54
57
  "express": "^4.19.2",
55
58
  "fflate": "^0.8.2",
59
+ "highlight.js": "^11.11.1",
56
60
  "lucide-react": "^0.544.0",
57
61
  "openai": "^5.23.1",
58
62
  "p-limit": "^6.1.0",
@@ -72,6 +76,7 @@
72
76
  "@testing-library/jest-dom": "^6.9.1",
73
77
  "@testing-library/react": "^16.3.0",
74
78
  "@testing-library/user-event": "^14.6.1",
79
+ "@types/bun": "^1.3.9",
75
80
  "@vitejs/plugin-react": "^5.0.4",
76
81
  "@vitest/coverage-v8": "^3.2.4",
77
82
  "concurrently": "^9.2.1",
@@ -80,14 +85,14 @@
80
85
  "eslint-plugin-react-hooks": "^6.1.1",
81
86
  "eslint-plugin-react-refresh": "^0.4.23",
82
87
  "jsdom": "^27.0.0",
83
- "nodemon": "^3.1.10",
84
88
  "prettier": "^3.6.2",
85
89
  "tailwindcss": "^4.1.14",
90
+ "typescript": "^5.9.3",
86
91
  "vite": "^7.1.9",
87
92
  "vitest": "^3.2.4"
88
93
  },
89
94
  "engines": {
90
- "node": ">=20.0.0"
95
+ "bun": ">=1.1.0"
91
96
  },
92
97
  "keywords": [
93
98
  "llm",
@@ -0,0 +1,61 @@
1
+ /** Result of a successful job submission. */
2
+ export interface SubmitSuccessResult {
3
+ success: true;
4
+ jobId: string;
5
+ jobName: string;
6
+ }
7
+
8
+ /** Result of a failed job submission. */
9
+ export interface SubmitFailureResult {
10
+ success: false;
11
+ message: string;
12
+ }
13
+
14
+ export type SubmitResult = SubmitSuccessResult | SubmitFailureResult;
15
+
16
+ /** Options for submitJobWithValidation. */
17
+ export interface SubmitJobOptions {
18
+ dataDir: string;
19
+ seedObject: unknown;
20
+ }
21
+
22
+ /** Job status record returned by getStatus. */
23
+ export interface JobStatusRecord {
24
+ jobId: string;
25
+ jobName: string;
26
+ pipeline: string;
27
+ state: string;
28
+ createdAt: string;
29
+ [key: string]: unknown;
30
+ }
31
+
32
+ /** Orchestrator construction options. */
33
+ export interface OrchestratorOptions {
34
+ autoStart: boolean;
35
+ }
36
+
37
+ /**
38
+ * Validates and submits a job to the pipeline data directory.
39
+ * Stub implementation — to be replaced when api module is fully migrated.
40
+ */
41
+ export async function submitJobWithValidation(
42
+ _opts: SubmitJobOptions
43
+ ): Promise<SubmitResult> {
44
+ throw new Error("submitJobWithValidation: not yet implemented");
45
+ }
46
+
47
+ /**
48
+ * Pipeline orchestrator class for status/job management.
49
+ * Stub implementation — to be replaced when api module is fully migrated.
50
+ */
51
+ export class PipelineOrchestrator {
52
+ constructor(_opts: OrchestratorOptions) {}
53
+
54
+ async getStatus(_jobName: string): Promise<JobStatusRecord> {
55
+ throw new Error("PipelineOrchestrator.getStatus: not yet implemented");
56
+ }
57
+
58
+ async listJobs(): Promise<JobStatusRecord[]> {
59
+ throw new Error("PipelineOrchestrator.listJobs: not yet implemented");
60
+ }
61
+ }
@@ -0,0 +1,67 @@
1
+ import Ajv from "ajv";
2
+ import addFormats from "ajv-formats";
3
+
4
+ const ajv = new Ajv({ allErrors: true, strict: false });
5
+ addFormats(ajv);
6
+
7
+ export interface SchemaValidationResult {
8
+ valid: boolean;
9
+ errors?: Array<{
10
+ instancePath: string;
11
+ schemaPath: string;
12
+ keyword: string;
13
+ params: Record<string, unknown>;
14
+ message?: string;
15
+ }>;
16
+ }
17
+
18
+ export const validateWithSchema = (
19
+ schema: unknown,
20
+ data: unknown,
21
+ ): SchemaValidationResult => {
22
+ let parsedData = data;
23
+
24
+ if (typeof data === "string") {
25
+ try {
26
+ parsedData = JSON.parse(data);
27
+ } catch {
28
+ return {
29
+ valid: false,
30
+ errors: [
31
+ {
32
+ instancePath: "",
33
+ schemaPath: "#/type",
34
+ keyword: "type",
35
+ params: { type: "object" },
36
+ message: "must be a valid JSON object (string parsing failed)",
37
+ },
38
+ ],
39
+ };
40
+ }
41
+ }
42
+
43
+ const schemaObj = schema as Record<string, unknown>;
44
+ let validateFunction = schemaObj.$id
45
+ ? ajv.getSchema(schemaObj.$id as string)
46
+ : null;
47
+ if (!validateFunction) {
48
+ validateFunction = ajv.compile(schemaObj);
49
+ }
50
+
51
+ const isValid = validateFunction(parsedData);
52
+
53
+ if (isValid) {
54
+ return { valid: true };
55
+ }
56
+
57
+ return {
58
+ valid: false,
59
+ errors: validateFunction.errors?.map((e) => ({
60
+ instancePath: e.instancePath ?? "",
61
+ schemaPath: e.schemaPath ?? "",
62
+ keyword: e.keyword ?? "",
63
+ params: (e.params as Record<string, unknown>) ?? {},
64
+ message: e.message,
65
+ })),
66
+ };
67
+ };
@@ -0,0 +1,51 @@
1
+ import { describe, it, expect, beforeEach, afterEach, spyOn } from "bun:test";
2
+ import { mkdtemp, rm, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+
6
+ describe("analyzeTaskFile", () => {
7
+ let tmpDir: string;
8
+ let exitSpy: ReturnType<typeof spyOn>;
9
+ let stdoutSpy: ReturnType<typeof spyOn>;
10
+
11
+ beforeEach(async () => {
12
+ tmpDir = await mkdtemp(join(tmpdir(), "analyze-task-test-"));
13
+ exitSpy = spyOn(process, "exit").mockImplementation((() => {
14
+ throw new Error("process.exit called");
15
+ }) as never);
16
+ stdoutSpy = spyOn(process.stdout, "write").mockImplementation((() => true) as never);
17
+ });
18
+
19
+ afterEach(async () => {
20
+ await rm(tmpDir, { recursive: true, force: true });
21
+ exitSpy.mockRestore();
22
+ stdoutSpy.mockRestore();
23
+ });
24
+
25
+ it("outputs JSON result for a valid task file", async () => {
26
+ const taskFile = join(tmpDir, "task.ts");
27
+ await writeFile(
28
+ taskFile,
29
+ 'export async function ingestion({ io, llm }) { await io.readArtifact("seed.json"); await llm.openai.complete({ prompt: "json" }); }',
30
+ );
31
+
32
+ const { analyzeTaskFile } = await import("../analyze-task.ts");
33
+ await analyzeTaskFile(taskFile);
34
+
35
+ expect(stdoutSpy).toHaveBeenCalledTimes(1);
36
+ const written = (stdoutSpy.mock.calls[0] as [string])[0];
37
+ const parsed = JSON.parse(written);
38
+ expect(parsed.taskFilePath).toBe(taskFile);
39
+ expect(parsed.stages).toEqual([{ name: "ingestion", order: 1, isAsync: true }]);
40
+ expect(parsed.artifacts.reads).toEqual([{ fileName: "seed.json", stage: "ingestion", required: true }]);
41
+ expect(parsed.models).toEqual([{ provider: "openai", method: "complete", stage: "ingestion" }]);
42
+ });
43
+
44
+ it("calls process.exit(1) for a non-existent file", async () => {
45
+ const { analyzeTaskFile } = await import("../analyze-task.ts");
46
+ await expect(analyzeTaskFile(join(tmpDir, "does-not-exist.ts"))).rejects.toThrow(
47
+ "process.exit called"
48
+ );
49
+ expect(exitSpy).toHaveBeenCalledWith(1);
50
+ });
51
+ });
@@ -0,0 +1,33 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { KEBAB_CASE_REGEX, STAGE_NAMES, getStagePurpose } from "../constants";
3
+
4
+ describe("STAGE_NAMES", () => {
5
+ it("has exactly 11 entries", () => {
6
+ expect(STAGE_NAMES).toHaveLength(11);
7
+ });
8
+
9
+ it("starts with ingestion and ends with integration", () => {
10
+ expect(STAGE_NAMES[0]).toBe("ingestion");
11
+ expect(STAGE_NAMES[10]).toBe("integration");
12
+ });
13
+ });
14
+
15
+ describe("getStagePurpose", () => {
16
+ it("returns a non-empty string for a known stage", () => {
17
+ expect(getStagePurpose("ingestion").length).toBeGreaterThan(0);
18
+ });
19
+
20
+ it("returns an empty string for an unknown stage", () => {
21
+ expect(getStagePurpose("unknown")).toBe("");
22
+ });
23
+ });
24
+
25
+ describe("KEBAB_CASE_REGEX", () => {
26
+ it("matches valid kebab-case slugs", () => {
27
+ expect(KEBAB_CASE_REGEX.test("valid-slug")).toBe(true);
28
+ });
29
+
30
+ it("rejects slugs with uppercase or underscores", () => {
31
+ expect(KEBAB_CASE_REGEX.test("Invalid_Slug")).toBe(false);
32
+ });
33
+ });