@orchagent/cli 0.3.74 → 0.3.75
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/pull.js +26 -21
- package/dist/commands/run.js +1 -1
- package/package.json +1 -1
package/dist/commands/pull.js
CHANGED
|
@@ -310,7 +310,7 @@ async function downloadBundle(config, org, agent, version, agentId) {
|
|
|
310
310
|
}
|
|
311
311
|
async function unzipBundle(zipPath, destDir) {
|
|
312
312
|
return new Promise((resolve, reject) => {
|
|
313
|
-
const proc = (0, child_process_1.spawn)('unzip', ['-q', zipPath, '-d', destDir], {
|
|
313
|
+
const proc = (0, child_process_1.spawn)('unzip', ['-o', '-q', zipPath, '-d', destDir], {
|
|
314
314
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
315
315
|
});
|
|
316
316
|
let stderr = '';
|
|
@@ -397,26 +397,12 @@ Examples:
|
|
|
397
397
|
const filesWritten = [];
|
|
398
398
|
const warnings = [];
|
|
399
399
|
let bundleExtracted = false;
|
|
400
|
-
//
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
//
|
|
405
|
-
|
|
406
|
-
await promises_1.default.writeFile(path_1.default.join(outputDir, 'prompt.md'), data.prompt);
|
|
407
|
-
filesWritten.push('prompt.md');
|
|
408
|
-
}
|
|
409
|
-
// Write schema.json (if schemas exist)
|
|
410
|
-
if (data.input_schema || data.output_schema) {
|
|
411
|
-
const schema = {};
|
|
412
|
-
if (data.input_schema)
|
|
413
|
-
schema.input = data.input_schema;
|
|
414
|
-
if (data.output_schema)
|
|
415
|
-
schema.output = data.output_schema;
|
|
416
|
-
await promises_1.default.writeFile(path_1.default.join(outputDir, 'schema.json'), JSON.stringify(schema, null, 2) + '\n');
|
|
417
|
-
filesWritten.push('schema.json');
|
|
418
|
-
}
|
|
419
|
-
// Bundle download for code_runtime agents
|
|
400
|
+
// Extract bundle FIRST for code_runtime agents.
|
|
401
|
+
// Metadata files (orchagent.json, schema.json) are written AFTER so they
|
|
402
|
+
// always take precedence over anything the bundle may contain. This also
|
|
403
|
+
// avoids the interactive overwrite prompt that `unzip` issues when a file
|
|
404
|
+
// already exists on disk — in non-interactive shells the prompt causes EOF
|
|
405
|
+
// and exit-code 1.
|
|
420
406
|
if (engine === 'code_runtime' && data.has_bundle) {
|
|
421
407
|
write('Downloading code bundle...\n');
|
|
422
408
|
const bundle = await downloadBundle(config, org, data.name, data.version, data.agentId);
|
|
@@ -441,6 +427,25 @@ Examples:
|
|
|
441
427
|
else if (engine === 'code_runtime' && !data.has_bundle) {
|
|
442
428
|
warnings.push('No downloadable bundle available for this version.');
|
|
443
429
|
}
|
|
430
|
+
// Write orchagent.json (after bundle extraction so it always wins)
|
|
431
|
+
const manifest = buildManifest(data);
|
|
432
|
+
await promises_1.default.writeFile(path_1.default.join(outputDir, 'orchagent.json'), JSON.stringify(manifest, null, 2) + '\n');
|
|
433
|
+
filesWritten.push('orchagent.json');
|
|
434
|
+
// Write prompt.md (for prompt-driven engines)
|
|
435
|
+
if (data.prompt && (engine === 'direct_llm' || engine === 'managed_loop')) {
|
|
436
|
+
await promises_1.default.writeFile(path_1.default.join(outputDir, 'prompt.md'), data.prompt);
|
|
437
|
+
filesWritten.push('prompt.md');
|
|
438
|
+
}
|
|
439
|
+
// Write schema.json (if schemas exist)
|
|
440
|
+
if (data.input_schema || data.output_schema) {
|
|
441
|
+
const schema = {};
|
|
442
|
+
if (data.input_schema)
|
|
443
|
+
schema.input = data.input_schema;
|
|
444
|
+
if (data.output_schema)
|
|
445
|
+
schema.output = data.output_schema;
|
|
446
|
+
await promises_1.default.writeFile(path_1.default.join(outputDir, 'schema.json'), JSON.stringify(schema, null, 2) + '\n');
|
|
447
|
+
filesWritten.push('schema.json');
|
|
448
|
+
}
|
|
444
449
|
// Track analytics
|
|
445
450
|
await (0, analytics_1.track)('cli_pull', {
|
|
446
451
|
org,
|
package/dist/commands/run.js
CHANGED
|
@@ -1002,7 +1002,7 @@ async function executeTool(agentData, args) {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
async function unzipBundle(zipPath, destDir) {
|
|
1004
1004
|
return new Promise((resolve, reject) => {
|
|
1005
|
-
const proc = (0, child_process_1.spawn)('unzip', ['-q', zipPath, '-d', destDir], {
|
|
1005
|
+
const proc = (0, child_process_1.spawn)('unzip', ['-o', '-q', zipPath, '-d', destDir], {
|
|
1006
1006
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
1007
1007
|
});
|
|
1008
1008
|
let stderr = '';
|
package/package.json
CHANGED