@orchagent/cli 0.3.108 → 0.3.109
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/dist/commands/publish.js +22 -0
- package/package.json +1 -1
package/dist/commands/publish.js
CHANGED
|
@@ -851,6 +851,26 @@ function registerPublishCommand(program) {
|
|
|
851
851
|
validationErrors.push('timeout_seconds must be a positive integer');
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
+
// Validate model_tasks: "default" key required, all values non-empty strings
|
|
855
|
+
if (manifest.model_tasks !== undefined) {
|
|
856
|
+
if (typeof manifest.model_tasks !== 'object' || manifest.model_tasks === null || Array.isArray(manifest.model_tasks)) {
|
|
857
|
+
validationErrors.push('model_tasks must be an object mapping task names to model IDs');
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
const tasks = manifest.model_tasks;
|
|
861
|
+
if (!tasks.default) {
|
|
862
|
+
validationErrors.push('model_tasks must include a "default" key');
|
|
863
|
+
}
|
|
864
|
+
for (const [taskName, modelId] of Object.entries(tasks)) {
|
|
865
|
+
if (typeof modelId !== 'string' || modelId.trim() === '') {
|
|
866
|
+
validationErrors.push(`model_tasks.${taskName} must be a non-empty string (model ID)`);
|
|
867
|
+
}
|
|
868
|
+
if (!/^[a-z0-9_]+$/.test(taskName)) {
|
|
869
|
+
validationErrors.push(`model_tasks key "${taskName}" must contain only lowercase letters, numbers, and underscores`);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
854
874
|
// Warn about deprecated prompt field
|
|
855
875
|
if (manifest.prompt) {
|
|
856
876
|
process.stderr.write(chalk_1.default.yellow('Warning: "prompt" field in orchagent.json is ignored. Use prompt.md file instead.\n'));
|
|
@@ -1351,6 +1371,8 @@ function registerPublishCommand(program) {
|
|
|
1351
1371
|
allow_local_download: options.localDownload !== false,
|
|
1352
1372
|
// Environment pinning
|
|
1353
1373
|
environment: manifest.environment,
|
|
1374
|
+
// Per-task model assignment
|
|
1375
|
+
model_tasks: manifest.model_tasks,
|
|
1354
1376
|
}, workspaceId);
|
|
1355
1377
|
}
|
|
1356
1378
|
catch (err) {
|
package/package.json
CHANGED