@orchagent/cli 0.3.80 → 0.3.81
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 +15 -0
- package/package.json +1 -1
package/dist/commands/publish.js
CHANGED
|
@@ -524,6 +524,21 @@ function registerPublishCommand(program) {
|
|
|
524
524
|
if (!manifest.name) {
|
|
525
525
|
throw new errors_1.CliError('orchagent.json must have name');
|
|
526
526
|
}
|
|
527
|
+
// Validate agent name format (must match gateway rules)
|
|
528
|
+
const agentNameRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
529
|
+
const agentName = manifest.name;
|
|
530
|
+
if (agentName.length < 2 || agentName.length > 50) {
|
|
531
|
+
throw new errors_1.CliError('Agent name must be 2-50 characters');
|
|
532
|
+
}
|
|
533
|
+
if (agentName !== agentName.toLowerCase()) {
|
|
534
|
+
throw new errors_1.CliError('Agent name must be lowercase');
|
|
535
|
+
}
|
|
536
|
+
if (agentName.length > 1 && !agentNameRegex.test(agentName)) {
|
|
537
|
+
throw new errors_1.CliError('Agent name must contain only lowercase letters, numbers, and hyphens, and must start/end with a letter or number');
|
|
538
|
+
}
|
|
539
|
+
if (agentName.includes('--')) {
|
|
540
|
+
throw new errors_1.CliError('Agent name must not contain consecutive hyphens');
|
|
541
|
+
}
|
|
527
542
|
const { canonicalType, rawType } = canonicalizeManifestType(manifest.type);
|
|
528
543
|
const runMode = normalizeRunMode(manifest.run_mode);
|
|
529
544
|
const executionEngine = inferExecutionEngineFromManifest(manifest, rawType);
|
package/package.json
CHANGED