@ryanfw/prompt-orchestration-pipeline 0.16.3 → 0.17.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.
- package/package.json +1 -1
- package/src/config/models.js +91 -2
- package/src/core/orchestrator.js +28 -56
- package/src/core/pipeline-runner.js +51 -1
- package/src/core/task-runner.js +17 -7
- package/src/llm/index.js +207 -1
- package/src/pages/Code.jsx +201 -2
- package/src/providers/anthropic.js +3 -2
- package/src/providers/base.js +19 -0
- package/src/providers/claude-code.js +156 -0
- package/src/providers/deepseek.js +3 -2
- package/src/providers/moonshot.js +218 -0
- package/src/ui/dist/assets/{index-DI_nRqVI.js → index-xx8otyG0.js} +142 -1
- package/src/ui/dist/assets/{index-DI_nRqVI.js.map → index-xx8otyG0.js.map} +1 -1
- package/src/ui/dist/index.html +1 -1
- package/src/ui/endpoints/task-save-endpoint.js +47 -12
package/src/ui/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
/>
|
|
12
12
|
<title>Prompt Pipeline Dashboard</title>
|
|
13
13
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-xx8otyG0.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/style-CVd3RRU2.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
@@ -76,27 +76,62 @@ export async function handleTaskSave(req, res) {
|
|
|
76
76
|
const indexPath = taskRegistryPath;
|
|
77
77
|
let indexContent = await fs.readFile(indexPath, "utf8");
|
|
78
78
|
|
|
79
|
-
// Check if task name already exists in the index
|
|
80
|
-
const taskNamePattern = new RegExp(`^\\s
|
|
79
|
+
// Check if task name already exists in the index (handles both quoted and unquoted)
|
|
80
|
+
const taskNamePattern = new RegExp(`^\\s*"?${taskName}"?\\s*:`, "m");
|
|
81
81
|
if (taskNamePattern.test(indexContent)) {
|
|
82
82
|
return sendJson(res, 400, {
|
|
83
83
|
error: `Task "${taskName}" already exists in the registry`,
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
//
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
// Detect module format: ESM (export default {) or CommonJS (module.exports = {)
|
|
88
|
+
const esmPattern = /export\s+default\s+\{/;
|
|
89
|
+
const cjsPattern = /module\.exports\s*=\s*\{/;
|
|
90
|
+
const cjsTasksPattern = /module\.exports\s*=\s*\{\s*tasks\s*:\s*\{/;
|
|
91
|
+
|
|
92
|
+
let insertPosition;
|
|
93
|
+
let exportMatch;
|
|
94
|
+
let isNestedCjs = false;
|
|
95
|
+
|
|
96
|
+
if (esmPattern.test(indexContent)) {
|
|
97
|
+
// ESM format: export default { ... }
|
|
98
|
+
exportMatch = indexContent.match(esmPattern);
|
|
99
|
+
insertPosition = indexContent.indexOf("\n", exportMatch.index) + 1;
|
|
100
|
+
} else if (cjsTasksPattern.test(indexContent)) {
|
|
101
|
+
// CommonJS with nested tasks: module.exports = { tasks: { ... } }
|
|
102
|
+
exportMatch = indexContent.match(cjsTasksPattern);
|
|
103
|
+
insertPosition = exportMatch.index + exportMatch[0].length;
|
|
104
|
+
isNestedCjs = true;
|
|
105
|
+
} else if (cjsPattern.test(indexContent)) {
|
|
106
|
+
// CommonJS flat: module.exports = { ... }
|
|
107
|
+
exportMatch = indexContent.match(cjsPattern);
|
|
108
|
+
insertPosition = indexContent.indexOf("\n", exportMatch.index) + 1;
|
|
109
|
+
} else {
|
|
92
110
|
return sendJson(res, 500, {
|
|
93
|
-
error:
|
|
111
|
+
error:
|
|
112
|
+
"Failed to find export pattern in index.js (expected 'export default {' or 'module.exports = {')",
|
|
94
113
|
});
|
|
95
114
|
}
|
|
96
115
|
|
|
97
|
-
// Insert new task entry after the
|
|
98
|
-
|
|
99
|
-
|
|
116
|
+
// Insert new task entry after the opening brace line
|
|
117
|
+
// For nested CommonJS, check if we need to add newline to expand single-line format
|
|
118
|
+
let newEntry;
|
|
119
|
+
if (isNestedCjs) {
|
|
120
|
+
// Check if the tasks object already spans multiple lines
|
|
121
|
+
// (i.e., has whitespace and a newline after "tasks: {")
|
|
122
|
+
const remainingContent = indexContent.slice(insertPosition);
|
|
123
|
+
const whitespaceMatch = remainingContent.match(/^\s*\n/);
|
|
124
|
+
if (whitespaceMatch) {
|
|
125
|
+
// Multi-line format: skip whitespace and newline, insert at next position
|
|
126
|
+
insertPosition += whitespaceMatch[0].length;
|
|
127
|
+
newEntry = ` ${taskName}: "./${filename}",\n`;
|
|
128
|
+
} else {
|
|
129
|
+
// Single-line format: add newline to expand it
|
|
130
|
+
newEntry = `\n ${taskName}: "./${filename}",\n`;
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
newEntry = ` ${taskName}: "./${filename}",\n`;
|
|
134
|
+
}
|
|
100
135
|
|
|
101
136
|
indexContent =
|
|
102
137
|
indexContent.slice(0, insertPosition) +
|
|
@@ -116,4 +151,4 @@ export async function handleTaskSave(req, res) {
|
|
|
116
151
|
error: error.message || "Failed to create task",
|
|
117
152
|
});
|
|
118
153
|
}
|
|
119
|
-
}
|
|
154
|
+
}
|