@orchagent/cli 0.2.16 → 0.2.18
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/index.js +2 -0
- package/dist/commands/info.js +2 -12
- package/dist/commands/publish.js +11 -8
- package/dist/commands/tree.js +81 -0
- package/dist/lib/agent-ref.js +13 -0
- package/package.json +1 -1
package/dist/commands/index.js
CHANGED
|
@@ -19,6 +19,7 @@ const github_1 = require("./github");
|
|
|
19
19
|
const doctor_1 = require("./doctor");
|
|
20
20
|
const status_1 = require("./status");
|
|
21
21
|
const workspace_1 = require("./workspace");
|
|
22
|
+
const tree_1 = require("./tree");
|
|
22
23
|
function registerCommands(program) {
|
|
23
24
|
(0, login_1.registerLoginCommand)(program);
|
|
24
25
|
(0, whoami_1.registerWhoamiCommand)(program);
|
|
@@ -38,4 +39,5 @@ function registerCommands(program) {
|
|
|
38
39
|
(0, doctor_1.registerDoctorCommand)(program);
|
|
39
40
|
(0, status_1.registerStatusCommand)(program);
|
|
40
41
|
(0, workspace_1.registerWorkspaceCommand)(program);
|
|
42
|
+
(0, tree_1.registerTreeCommand)(program);
|
|
41
43
|
}
|
package/dist/commands/info.js
CHANGED
|
@@ -3,17 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerInfoCommand = registerInfoCommand;
|
|
4
4
|
const config_1 = require("../lib/config");
|
|
5
5
|
const api_1 = require("../lib/api");
|
|
6
|
-
const
|
|
7
|
-
const DEFAULT_VERSION = 'latest';
|
|
8
|
-
function parseAgentRef(value) {
|
|
9
|
-
const [ref, versionPart] = value.split('@');
|
|
10
|
-
const version = versionPart?.trim() || DEFAULT_VERSION;
|
|
11
|
-
const segments = ref.split('/');
|
|
12
|
-
if (segments.length === 2) {
|
|
13
|
-
return { org: segments[0], agent: segments[1], version };
|
|
14
|
-
}
|
|
15
|
-
throw new errors_1.CliError('Invalid agent reference. Use org/agent format (e.g., joe/leak-finder)');
|
|
16
|
-
}
|
|
6
|
+
const agent_ref_1 = require("../lib/agent-ref");
|
|
17
7
|
function formatSchema(schema, indent = ' ') {
|
|
18
8
|
const lines = [];
|
|
19
9
|
const props = schema.properties || {};
|
|
@@ -112,7 +102,7 @@ function registerInfoCommand(program) {
|
|
|
112
102
|
.option('--json', 'Output as JSON')
|
|
113
103
|
.action(async (agentArg, options) => {
|
|
114
104
|
const config = await (0, config_1.getResolvedConfig)();
|
|
115
|
-
const { org, agent, version } = parseAgentRef(agentArg);
|
|
105
|
+
const { org, agent, version } = (0, agent_ref_1.parseAgentRef)(agentArg);
|
|
116
106
|
// Fetch agent metadata
|
|
117
107
|
const agentData = await downloadAgentWithFallback(config, org, agent, version);
|
|
118
108
|
if (options.json) {
|
package/dist/commands/publish.js
CHANGED
|
@@ -65,11 +65,14 @@ function registerPublishCommand(program) {
|
|
|
65
65
|
.command('publish')
|
|
66
66
|
.description('Publish agent or skill from local files')
|
|
67
67
|
.option('--url <url>', 'Agent URL (for code-based agents)')
|
|
68
|
-
.option('--public', 'Make agent public
|
|
69
|
-
.option('--private', 'Make agent private')
|
|
68
|
+
.option('--public', 'Make agent public')
|
|
69
|
+
.option('--private', 'Make agent private (deprecated: now the default)')
|
|
70
70
|
.option('--profile <name>', 'Use API key from named profile')
|
|
71
71
|
.option('--dry-run', 'Show what would be published without making changes')
|
|
72
72
|
.action(async (options) => {
|
|
73
|
+
if (options.private) {
|
|
74
|
+
process.stderr.write('Warning: --private is deprecated (private is now the default). You can safely remove it.\n');
|
|
75
|
+
}
|
|
73
76
|
const config = await (0, config_1.getResolvedConfig)({}, options.profile);
|
|
74
77
|
const cwd = process.cwd();
|
|
75
78
|
// Check for SKILL.md first (skills take precedence)
|
|
@@ -94,7 +97,7 @@ function registerPublishCommand(program) {
|
|
|
94
97
|
process.stderr.write(` Name: ${skillData.frontmatter.name}\n`);
|
|
95
98
|
process.stderr.write(` Type: skill\n`);
|
|
96
99
|
process.stderr.write(` Version: ${versionInfo}\n`);
|
|
97
|
-
process.stderr.write(` Visibility: ${options.
|
|
100
|
+
process.stderr.write(` Visibility: ${options.public ? 'public' : 'private'}\n`);
|
|
98
101
|
process.stderr.write(` Providers: any\n`);
|
|
99
102
|
process.stderr.write(`\nWould publish: ${preview.org_slug}/${skillData.frontmatter.name}@${preview.next_version}\n`);
|
|
100
103
|
process.stderr.write(`API endpoint: POST ${config.apiUrl}/${preview.org_slug}/${skillData.frontmatter.name}/${preview.next_version}/run\n\n`);
|
|
@@ -106,13 +109,13 @@ function registerPublishCommand(program) {
|
|
|
106
109
|
type: 'skill',
|
|
107
110
|
description: skillData.frontmatter.description,
|
|
108
111
|
prompt: skillData.body,
|
|
109
|
-
is_public: options.
|
|
112
|
+
is_public: options.public ? true : false,
|
|
110
113
|
supported_providers: ['any'],
|
|
111
114
|
});
|
|
112
115
|
const skillVersion = skillResult.agent?.version || 'v1';
|
|
113
116
|
await (0, analytics_1.track)('cli_publish', { agent_type: 'skill' });
|
|
114
117
|
process.stdout.write(`\nPublished skill: ${org.slug}/${skillData.frontmatter.name}@${skillVersion}\n`);
|
|
115
|
-
process.stdout.write(`Public: ${options.
|
|
118
|
+
process.stdout.write(`Public: ${options.public ? 'yes' : 'no'}\n`);
|
|
116
119
|
return;
|
|
117
120
|
}
|
|
118
121
|
// Read manifest
|
|
@@ -237,7 +240,7 @@ function registerPublishCommand(program) {
|
|
|
237
240
|
process.stderr.write(` Name: ${manifest.name}\n`);
|
|
238
241
|
process.stderr.write(` Type: ${manifest.type}${shouldUploadBundle ? ' (hosted)' : ''}\n`);
|
|
239
242
|
process.stderr.write(` Version: ${versionInfo}\n`);
|
|
240
|
-
process.stderr.write(` Visibility: ${options.
|
|
243
|
+
process.stderr.write(` Visibility: ${options.public ? 'public' : 'private'}\n`);
|
|
241
244
|
process.stderr.write(` Providers: ${supportedProviders.join(', ')}\n`);
|
|
242
245
|
process.stderr.write(`\nWould publish: ${preview.org_slug}/${manifest.name}@${preview.next_version}\n`);
|
|
243
246
|
if (shouldUploadBundle) {
|
|
@@ -262,7 +265,7 @@ function registerPublishCommand(program) {
|
|
|
262
265
|
input_schema: inputSchema,
|
|
263
266
|
output_schema: outputSchema,
|
|
264
267
|
tags: manifest.tags,
|
|
265
|
-
is_public: options.
|
|
268
|
+
is_public: options.public ? true : false,
|
|
266
269
|
supported_providers: supportedProviders,
|
|
267
270
|
default_models: manifest.default_models,
|
|
268
271
|
// Local run fields for code agents
|
|
@@ -307,7 +310,7 @@ function registerPublishCommand(program) {
|
|
|
307
310
|
process.stdout.write(`\nPublished agent: ${org.slug}/${manifest.name}@${assignedVersion}\n`);
|
|
308
311
|
process.stdout.write(`Type: ${manifest.type}${shouldUploadBundle ? ' (hosted)' : ''}\n`);
|
|
309
312
|
process.stdout.write(`Providers: ${supportedProviders.join(', ')}\n`);
|
|
310
|
-
process.stdout.write(`Public: ${options.
|
|
313
|
+
process.stdout.write(`Public: ${options.public ? 'yes' : 'no'}\n`);
|
|
311
314
|
if (result.service_key) {
|
|
312
315
|
process.stdout.write(`\nService key (save this - shown only once):\n`);
|
|
313
316
|
process.stdout.write(` ${result.service_key}\n`);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerTreeCommand = registerTreeCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const config_1 = require("../lib/config");
|
|
9
|
+
const api_1 = require("../lib/api");
|
|
10
|
+
const agent_ref_1 = require("../lib/agent-ref");
|
|
11
|
+
const errors_1 = require("../lib/errors");
|
|
12
|
+
function registerTreeCommand(program) {
|
|
13
|
+
program
|
|
14
|
+
.command('tree <agent>')
|
|
15
|
+
.description('Show dependency tree for an agent')
|
|
16
|
+
.option('--json', 'Output as JSON')
|
|
17
|
+
.option('--no-color', 'Disable colored output')
|
|
18
|
+
.action(async (agentArg, options) => {
|
|
19
|
+
const config = await (0, config_1.getResolvedConfig)();
|
|
20
|
+
if (!config.apiKey) {
|
|
21
|
+
throw new errors_1.CliError('Authentication required. Run: orch login');
|
|
22
|
+
}
|
|
23
|
+
const { org, agent, version } = (0, agent_ref_1.parseAgentRef)(agentArg);
|
|
24
|
+
const tree = await (0, api_1.request)(config, 'GET', `/agents/${org}/${agent}/${version}/tree`);
|
|
25
|
+
if (options.json) {
|
|
26
|
+
console.log(JSON.stringify(tree, null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const useColor = options.color !== false;
|
|
30
|
+
console.log();
|
|
31
|
+
console.log(formatTree(tree, useColor));
|
|
32
|
+
console.log();
|
|
33
|
+
console.log(`Summary: ${tree.summary.total_agents} agents, ` +
|
|
34
|
+
`${tree.summary.total_skills} skills, ` +
|
|
35
|
+
`max depth ${tree.summary.max_depth}`);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function formatTree(tree, useColor) {
|
|
39
|
+
const lines = [];
|
|
40
|
+
const rootNode = {
|
|
41
|
+
agent: tree.agent,
|
|
42
|
+
accessible: true,
|
|
43
|
+
type: tree.type,
|
|
44
|
+
skills: tree.skills,
|
|
45
|
+
skills_locked: tree.skills_locked,
|
|
46
|
+
dependencies: tree.dependencies,
|
|
47
|
+
};
|
|
48
|
+
formatNode(rootNode, '', true, true, lines, useColor);
|
|
49
|
+
return lines.join('\n');
|
|
50
|
+
}
|
|
51
|
+
function formatNode(node, prefix, isLast, isRoot, lines, useColor) {
|
|
52
|
+
const connector = isRoot ? '' : isLast ? '└── ' : '├── ';
|
|
53
|
+
const childPrefix = isRoot ? '' : prefix + (isLast ? ' ' : '│ ');
|
|
54
|
+
// Format agent line
|
|
55
|
+
let agentStr = node.agent;
|
|
56
|
+
if (!node.accessible) {
|
|
57
|
+
agentStr = useColor ? chalk_1.default.dim(agentStr) : `(${agentStr})`;
|
|
58
|
+
}
|
|
59
|
+
if (node.skills_locked && useColor) {
|
|
60
|
+
agentStr = agentStr + chalk_1.default.yellow(' 🔒');
|
|
61
|
+
}
|
|
62
|
+
lines.push(prefix + connector + agentStr);
|
|
63
|
+
// Format skills
|
|
64
|
+
const allChildren = [
|
|
65
|
+
...node.skills.map(s => ({ type: 'skill', value: s })),
|
|
66
|
+
...node.dependencies.map(d => ({ type: 'dep', value: d })),
|
|
67
|
+
];
|
|
68
|
+
allChildren.forEach((child, idx) => {
|
|
69
|
+
const isLastChild = idx === allChildren.length - 1;
|
|
70
|
+
const childConnector = isLastChild ? '└── ' : '├── ';
|
|
71
|
+
if (child.type === 'skill') {
|
|
72
|
+
const skillStr = useColor
|
|
73
|
+
? chalk_1.default.magenta(child.value) + chalk_1.default.dim(' (skill)')
|
|
74
|
+
: `${child.value} (skill)`;
|
|
75
|
+
lines.push(childPrefix + childConnector + skillStr);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
formatNode(child.value, childPrefix, isLastChild, false, lines, useColor);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAgentRef = parseAgentRef;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
function parseAgentRef(value, defaultVersion = 'latest') {
|
|
6
|
+
const [ref, versionPart] = value.split('@');
|
|
7
|
+
const version = versionPart?.trim() || defaultVersion;
|
|
8
|
+
const segments = ref.split('/');
|
|
9
|
+
if (segments.length === 2) {
|
|
10
|
+
return { org: segments[0], agent: segments[1], version };
|
|
11
|
+
}
|
|
12
|
+
throw new errors_1.CliError('Invalid agent reference. Use org/agent[@version] format');
|
|
13
|
+
}
|