@ryanfw/prompt-orchestration-pipeline 0.11.0 → 0.13.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 (83) hide show
  1. package/package.json +11 -1
  2. package/src/cli/analyze-task.js +51 -0
  3. package/src/cli/index.js +8 -0
  4. package/src/components/AddPipelineSidebar.jsx +144 -0
  5. package/src/components/AnalysisProgressTray.jsx +87 -0
  6. package/src/components/DAGGrid.jsx +157 -47
  7. package/src/components/JobTable.jsx +4 -3
  8. package/src/components/Layout.jsx +142 -139
  9. package/src/components/MarkdownRenderer.jsx +149 -0
  10. package/src/components/PipelineDAGGrid.jsx +404 -0
  11. package/src/components/PipelineTypeTaskSidebar.jsx +96 -0
  12. package/src/components/SchemaPreviewPanel.jsx +97 -0
  13. package/src/components/StageTimeline.jsx +36 -0
  14. package/src/components/TaskAnalysisDisplay.jsx +227 -0
  15. package/src/components/TaskCreationSidebar.jsx +447 -0
  16. package/src/components/TaskDetailSidebar.jsx +119 -117
  17. package/src/components/TaskFilePane.jsx +94 -39
  18. package/src/components/ui/RestartJobModal.jsx +26 -6
  19. package/src/components/ui/StopJobModal.jsx +183 -0
  20. package/src/components/ui/button.jsx +59 -27
  21. package/src/components/ui/sidebar.jsx +118 -0
  22. package/src/config/models.js +99 -67
  23. package/src/core/config.js +11 -4
  24. package/src/core/lifecycle-policy.js +62 -0
  25. package/src/core/pipeline-runner.js +312 -217
  26. package/src/core/status-writer.js +84 -0
  27. package/src/llm/index.js +129 -9
  28. package/src/pages/Code.jsx +8 -1
  29. package/src/pages/PipelineDetail.jsx +84 -2
  30. package/src/pages/PipelineList.jsx +214 -0
  31. package/src/pages/PipelineTypeDetail.jsx +234 -0
  32. package/src/pages/PromptPipelineDashboard.jsx +10 -11
  33. package/src/providers/deepseek.js +76 -16
  34. package/src/providers/openai.js +61 -34
  35. package/src/task-analysis/enrichers/analysis-writer.js +62 -0
  36. package/src/task-analysis/enrichers/schema-deducer.js +145 -0
  37. package/src/task-analysis/enrichers/schema-writer.js +74 -0
  38. package/src/task-analysis/extractors/artifacts.js +137 -0
  39. package/src/task-analysis/extractors/llm-calls.js +176 -0
  40. package/src/task-analysis/extractors/stages.js +51 -0
  41. package/src/task-analysis/index.js +103 -0
  42. package/src/task-analysis/parser.js +28 -0
  43. package/src/task-analysis/utils/ast.js +43 -0
  44. package/src/ui/client/adapters/job-adapter.js +60 -0
  45. package/src/ui/client/api.js +233 -8
  46. package/src/ui/client/hooks/useAnalysisProgress.js +145 -0
  47. package/src/ui/client/hooks/useJobList.js +14 -1
  48. package/src/ui/client/index.css +64 -0
  49. package/src/ui/client/main.jsx +4 -0
  50. package/src/ui/client/sse-fetch.js +120 -0
  51. package/src/ui/dist/app.js +262 -0
  52. package/src/ui/dist/assets/index-cjHV9mYW.js +82578 -0
  53. package/src/ui/dist/assets/index-cjHV9mYW.js.map +1 -0
  54. package/src/ui/dist/assets/style-CoM9SoQF.css +180 -0
  55. package/src/ui/dist/favicon.svg +12 -0
  56. package/src/ui/dist/index.html +2 -2
  57. package/src/ui/endpoints/create-pipeline-endpoint.js +194 -0
  58. package/src/ui/endpoints/file-endpoints.js +330 -0
  59. package/src/ui/endpoints/job-control-endpoints.js +1001 -0
  60. package/src/ui/endpoints/job-endpoints.js +62 -0
  61. package/src/ui/endpoints/pipeline-analysis-endpoint.js +246 -0
  62. package/src/ui/endpoints/pipeline-type-detail-endpoint.js +181 -0
  63. package/src/ui/endpoints/pipelines-endpoint.js +133 -0
  64. package/src/ui/endpoints/schema-file-endpoint.js +105 -0
  65. package/src/ui/endpoints/sse-endpoints.js +223 -0
  66. package/src/ui/endpoints/state-endpoint.js +85 -0
  67. package/src/ui/endpoints/task-analysis-endpoint.js +104 -0
  68. package/src/ui/endpoints/task-creation-endpoint.js +114 -0
  69. package/src/ui/endpoints/task-save-endpoint.js +101 -0
  70. package/src/ui/endpoints/upload-endpoints.js +406 -0
  71. package/src/ui/express-app.js +227 -0
  72. package/src/ui/lib/analysis-lock.js +67 -0
  73. package/src/ui/lib/sse.js +30 -0
  74. package/src/ui/server.js +42 -1880
  75. package/src/ui/sse-broadcast.js +93 -0
  76. package/src/ui/utils/http-utils.js +139 -0
  77. package/src/ui/utils/mime-types.js +196 -0
  78. package/src/ui/utils/slug.js +31 -0
  79. package/src/ui/vite.config.js +22 -0
  80. package/src/ui/watcher.js +28 -2
  81. package/src/utils/jobs.js +39 -0
  82. package/src/ui/dist/assets/index-DeDzq-Kk.js +0 -23863
  83. package/src/ui/dist/assets/style-aBtD_Yrs.css +0 -62
@@ -39,9 +39,12 @@ function resolveWithBase(rootDir, maybePath) {
39
39
  }
40
40
 
41
41
  function normalizeRegistryEntry(slug, entry, rootDir) {
42
+ // Support both pipelinePath (legacy) and pipelineJsonPath fields
42
43
  const pipelineJsonPath = entry?.pipelineJsonPath
43
44
  ? resolveWithBase(rootDir, entry.pipelineJsonPath)
44
- : undefined;
45
+ : entry?.pipelinePath
46
+ ? resolveWithBase(rootDir, entry.pipelinePath)
47
+ : undefined;
45
48
 
46
49
  const configDir = entry?.configDir
47
50
  ? resolveWithBase(rootDir, entry.configDir)
@@ -515,9 +518,13 @@ export function getConfig() {
515
518
  Object.keys(currentConfig.pipelines).length === 0
516
519
  ) {
517
520
  const repoRoot = resolveRepoRoot(currentConfig);
518
- throw new Error(
519
- `No pipelines are registered. Create pipeline-config/registry.json in ${repoRoot} to register pipelines.`
520
- );
521
+ // In test environment, we might start without pipelines and add them later
522
+ // so we just warn instead of throwing, or handle it gracefully
523
+ if (process.env.NODE_ENV !== "test") {
524
+ throw new Error(
525
+ `No pipelines are registered. Create pipeline-config/registry.json in ${repoRoot} to register pipelines.`
526
+ );
527
+ }
521
528
  }
522
529
  }
523
530
  return currentConfig;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Static Lifecycle Policy - Pure decision engine for task transitions
3
+ *
4
+ * This module implements centralized lifecycle rules without configuration
5
+ * or runtime toggles, following the principle of explicit failure.
6
+ */
7
+
8
+ /**
9
+ * Decide if a task transition is allowed based on static lifecycle rules
10
+ * @param {Object} params - Decision parameters
11
+ * @param {string} params.op - Operation: "start" | "restart"
12
+ * @param {string} params.taskState - Current task state
13
+ * @param {boolean} params.dependenciesReady - Whether all upstream dependencies are satisfied
14
+ * @returns {Object} Decision result - { ok: true } | { ok: false, code: "unsupported_lifecycle", reason: "dependencies"|"policy" }
15
+ */
16
+ export function decideTransition({ op, taskState, dependenciesReady }) {
17
+ // Validate inputs early - let it crash on invalid data
18
+ if (typeof op !== "string" || !["start", "restart"].includes(op)) {
19
+ throw new Error(`Invalid operation: ${op}. Must be "start" or "restart"`);
20
+ }
21
+
22
+ if (typeof taskState !== "string") {
23
+ throw new Error(`Invalid taskState: ${taskState}. Must be a string`);
24
+ }
25
+
26
+ if (typeof dependenciesReady !== "boolean") {
27
+ throw new Error(
28
+ `Invalid dependenciesReady: ${dependenciesReady}. Must be boolean`
29
+ );
30
+ }
31
+
32
+ // Handle start operation
33
+ if (op === "start") {
34
+ if (!dependenciesReady) {
35
+ return Object.freeze({
36
+ ok: false,
37
+ code: "unsupported_lifecycle",
38
+ reason: "dependencies",
39
+ });
40
+ }
41
+ return Object.freeze({ ok: true });
42
+ }
43
+
44
+ // Handle restart operation
45
+ if (op === "restart") {
46
+ if (taskState === "completed") {
47
+ return Object.freeze({ ok: true });
48
+ }
49
+ return Object.freeze({
50
+ ok: false,
51
+ code: "unsupported_lifecycle",
52
+ reason: "policy",
53
+ });
54
+ }
55
+
56
+ // This should never be reached due to input validation
57
+ return Object.freeze({
58
+ ok: false,
59
+ code: "unsupported_lifecycle",
60
+ reason: "policy",
61
+ });
62
+ }