@ryanfw/prompt-orchestration-pipeline 0.5.0 → 0.7.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 (67) hide show
  1. package/README.md +1 -2
  2. package/package.json +1 -2
  3. package/src/api/validators/json.js +39 -0
  4. package/src/components/DAGGrid.jsx +392 -303
  5. package/src/components/JobCard.jsx +14 -12
  6. package/src/components/JobDetail.jsx +54 -51
  7. package/src/components/JobTable.jsx +72 -23
  8. package/src/components/Layout.jsx +145 -42
  9. package/src/components/LiveText.jsx +47 -0
  10. package/src/components/PageSubheader.jsx +75 -0
  11. package/src/components/TaskDetailSidebar.jsx +216 -0
  12. package/src/components/TimerText.jsx +82 -0
  13. package/src/components/UploadSeed.jsx +0 -70
  14. package/src/components/ui/Logo.jsx +16 -0
  15. package/src/components/ui/RestartJobModal.jsx +140 -0
  16. package/src/components/ui/toast.jsx +138 -0
  17. package/src/config/models.js +322 -0
  18. package/src/config/statuses.js +119 -0
  19. package/src/core/config.js +4 -34
  20. package/src/core/file-io.js +13 -28
  21. package/src/core/module-loader.js +54 -40
  22. package/src/core/pipeline-runner.js +65 -26
  23. package/src/core/status-writer.js +213 -58
  24. package/src/core/symlink-bridge.js +57 -0
  25. package/src/core/symlink-utils.js +94 -0
  26. package/src/core/task-runner.js +321 -437
  27. package/src/llm/index.js +258 -86
  28. package/src/pages/Code.jsx +351 -0
  29. package/src/pages/PipelineDetail.jsx +124 -15
  30. package/src/pages/PromptPipelineDashboard.jsx +20 -88
  31. package/src/providers/anthropic.js +83 -69
  32. package/src/providers/base.js +52 -0
  33. package/src/providers/deepseek.js +20 -21
  34. package/src/providers/gemini.js +226 -0
  35. package/src/providers/openai.js +36 -106
  36. package/src/providers/zhipu.js +136 -0
  37. package/src/ui/client/adapters/job-adapter.js +42 -28
  38. package/src/ui/client/api.js +134 -0
  39. package/src/ui/client/hooks/useJobDetailWithUpdates.js +65 -179
  40. package/src/ui/client/index.css +15 -0
  41. package/src/ui/client/index.html +2 -1
  42. package/src/ui/client/main.jsx +19 -14
  43. package/src/ui/client/time-store.js +161 -0
  44. package/src/ui/config-bridge.js +15 -24
  45. package/src/ui/config-bridge.node.js +15 -24
  46. package/src/ui/dist/assets/{index-CxcrauYR.js → index-DqkbzXZ1.js} +2132 -1086
  47. package/src/ui/dist/assets/style-DBF9NQGk.css +62 -0
  48. package/src/ui/dist/index.html +4 -3
  49. package/src/ui/job-reader.js +0 -108
  50. package/src/ui/public/favicon.svg +12 -0
  51. package/src/ui/server.js +252 -0
  52. package/src/ui/sse-enhancer.js +0 -1
  53. package/src/ui/transformers/list-transformer.js +32 -12
  54. package/src/ui/transformers/status-transformer.js +29 -42
  55. package/src/utils/dag.js +8 -4
  56. package/src/utils/duration.js +13 -19
  57. package/src/utils/formatters.js +27 -0
  58. package/src/utils/geometry-equality.js +83 -0
  59. package/src/utils/pipelines.js +5 -1
  60. package/src/utils/time-utils.js +40 -0
  61. package/src/utils/token-cost-calculator.js +294 -0
  62. package/src/utils/ui.jsx +18 -20
  63. package/src/components/ui/select.jsx +0 -27
  64. package/src/lib/utils.js +0 -6
  65. package/src/ui/client/hooks/useTicker.js +0 -26
  66. package/src/ui/config-bridge.browser.js +0 -149
  67. package/src/ui/dist/assets/style-D6K_oQ12.css +0 -62
@@ -1,149 +0,0 @@
1
- /**
2
- * Browser-specific configuration bridge for UI helpers.
3
- * Contains only browser-safe utilities (no Node APIs).
4
- */
5
-
6
- /**
7
- * Global constants and contracts for project data display system
8
- * @namespace Constants
9
- */
10
- export const Constants = {
11
- /**
12
- * Job ID validation regex
13
- * @type {RegExp}
14
- */
15
- JOB_ID_REGEX: /^[A-Za-z0-9-_]+$/,
16
-
17
- /**
18
- * Valid task states
19
- * @type {string[]}
20
- */
21
- TASK_STATES: ["pending", "running", "done", "failed"],
22
-
23
- /**
24
- * Valid job locations
25
- * @type {string[]}
26
- */
27
- JOB_LOCATIONS: ["current", "complete"],
28
-
29
- /**
30
- * Status sort order (descending priority)
31
- * @type {string[]}
32
- */
33
- STATUS_ORDER: ["running", "failed", "pending", "complete"],
34
-
35
- /**
36
- * File size limits for reading
37
- * @type {Object}
38
- */
39
- FILE_LIMITS: {
40
- MAX_FILE_SIZE: 5 * 1024 * 1024, // 5MB
41
- },
42
-
43
- /**
44
- * Retry configuration for atomic reads
45
- * @type {Object}
46
- */
47
- RETRY_CONFIG: {
48
- MAX_ATTEMPTS: 3,
49
- DELAY_MS: 1000,
50
- },
51
-
52
- /**
53
- * SSE debounce configuration
54
- * @type {Object}
55
- */
56
- SSE_CONFIG: {
57
- DEBOUNCE_MS: 200,
58
- },
59
-
60
- /**
61
- * Error codes for structured error responses
62
- * @type {Object}
63
- */
64
- ERROR_CODES: {
65
- NOT_FOUND: "not_found",
66
- INVALID_JSON: "invalid_json",
67
- FS_ERROR: "fs_error",
68
- JOB_NOT_FOUND: "job_not_found",
69
- BAD_REQUEST: "bad_request",
70
- },
71
- };
72
-
73
- /**
74
- * Validates a job ID against the global contract
75
- * @param {string} jobId - Job ID to validate
76
- * @returns {boolean} True if valid
77
- */
78
- export function validateJobId(jobId) {
79
- return Constants.JOB_ID_REGEX.test(jobId);
80
- }
81
-
82
- /**
83
- * Validates a task state against the global contract
84
- * @param {string} state - Task state to validate
85
- * @returns {boolean} True if valid
86
- */
87
- export function validateTaskState(state) {
88
- return Constants.TASK_STATES.includes(state);
89
- }
90
-
91
- /**
92
- * Gets the status sort priority for a job status
93
- * @param {string} status - Job status
94
- * @returns {number} Sort priority (lower number = higher priority)
95
- */
96
- export function getStatusPriority(status) {
97
- const index = Constants.STATUS_ORDER.indexOf(status);
98
- return index === -1 ? Constants.STATUS_ORDER.length : index;
99
- }
100
-
101
- /**
102
- * Determines job status based on task states
103
- * @param {Object} tasks - Tasks object from tasks-status.json
104
- * @returns {string} Job status
105
- */
106
- export function determineJobStatus(tasks = {}) {
107
- const taskEntries = Object.entries(tasks);
108
-
109
- if (taskEntries.length === 0) {
110
- return "pending";
111
- }
112
-
113
- const taskStates = taskEntries.map(([_, task]) => task.state);
114
-
115
- if (taskStates.includes("failed")) {
116
- return "failed";
117
- }
118
-
119
- if (taskStates.includes("running")) {
120
- return "running";
121
- }
122
-
123
- if (taskStates.every((state) => state === "done")) {
124
- return "complete";
125
- }
126
-
127
- return "pending";
128
- }
129
-
130
- /**
131
- * Creates a structured error response
132
- * @param {string} code - Error code
133
- * @param {string} message - Error message
134
- * @param {string} [path] - Optional file path
135
- * @returns {Object} Structured error object
136
- */
137
- export function createErrorResponse(code, message, path = null) {
138
- const error = {
139
- ok: false,
140
- code,
141
- message,
142
- };
143
-
144
- if (path) {
145
- error.path = path;
146
- }
147
-
148
- return error;
149
- }