@orchagent/cli 0.3.46 → 0.3.48

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.
@@ -41,7 +41,6 @@ const chalk_1 = __importDefault(require("chalk"));
41
41
  const config_1 = require("../lib/config");
42
42
  const api_1 = require("../lib/api");
43
43
  const output_1 = require("../lib/output");
44
- const pricing_1 = require("../lib/pricing");
45
44
  function registerAgentsCommand(program) {
46
45
  program
47
46
  .command('agents')
@@ -65,15 +64,12 @@ function registerAgentsCommand(program) {
65
64
  : 'No agents published yet.\n\nPublish an agent: orch publish\n');
66
65
  return;
67
66
  }
68
- // Print table with pricing
69
67
  const Table = (await Promise.resolve().then(() => __importStar(require('cli-table3')))).default;
70
68
  const table = new Table({
71
69
  head: [
72
70
  chalk_1.default.bold('Agent'),
73
71
  chalk_1.default.bold('Version'),
74
72
  chalk_1.default.bold('Type'),
75
- chalk_1.default.bold('Stars'),
76
- chalk_1.default.bold('Price'),
77
73
  chalk_1.default.bold('Description'),
78
74
  ],
79
75
  });
@@ -81,15 +77,12 @@ function registerAgentsCommand(program) {
81
77
  const name = agent.name;
82
78
  const version = agent.version;
83
79
  const type = agent.type || 'tool';
84
- const stars = agent.stars_count ?? 0;
85
- const price = (0, pricing_1.formatPrice)(agent);
86
- const coloredPrice = (0, pricing_1.isPaidAgent)(agent) ? chalk_1.default.yellow(price) : chalk_1.default.green(price);
87
80
  const desc = agent.description
88
81
  ? agent.description.length > 60
89
82
  ? agent.description.slice(0, 57) + '...'
90
83
  : agent.description
91
84
  : '-';
92
- table.push([name, version, type, stars.toString(), coloredPrice, desc]);
85
+ table.push([name, version, type, desc]);
93
86
  });
94
87
  process.stdout.write(`${table.toString()}\n`);
95
88
  process.stdout.write(`\nTotal: ${filteredAgents.length} agent${filteredAgents.length === 1 ? '' : 's'}\n`);
@@ -14,7 +14,7 @@ const output_1 = require("../lib/output");
14
14
  function registerBillingCommand(program) {
15
15
  const billing = program
16
16
  .command('billing')
17
- .description('Manage prepaid credits for calling paid agents');
17
+ .description('Manage platform credits and usage');
18
18
  // orch billing balance
19
19
  billing
20
20
  .command('balance')
@@ -3,21 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerCallCommand = registerCallCommand;
4
4
  /**
5
5
  * Deprecated: The 'call' command has been merged into 'run'.
6
- * Cloud execution is now the default behavior of 'orch run'.
6
+ * Cloud execution is now the default behavior of 'orchagent run'.
7
7
  * This file provides a thin alias that prints a deprecation notice and exits.
8
8
  */
9
9
  function registerCallCommand(program) {
10
10
  program
11
11
  .command('call')
12
- .description('Deprecated: use "orch run" instead')
12
+ .description('Deprecated: use "orchagent run" instead')
13
13
  .allowUnknownOption()
14
14
  .allowExcessArguments()
15
15
  .action(() => {
16
16
  process.stderr.write(`The 'call' command has been merged into 'run'.\n\n` +
17
- `Cloud execution is now the default behavior of 'orch run':\n` +
18
- ` orch run <agent> --data '{...}' # runs on server (cloud)\n` +
19
- ` orch run <agent> --local --data '...' # runs locally\n\n` +
20
- `Replace 'orch call' with 'orch run' in your commands.\n`);
17
+ `Cloud execution is now the default behavior of 'orchagent run':\n` +
18
+ ` orchagent run <agent> --data '{...}' # runs on server (cloud)\n` +
19
+ ` orchagent run <agent> --local --data '...' # runs locally\n\n` +
20
+ `Replace 'orchagent call' with 'orchagent run' in your commands.\n`);
21
21
  process.exit(1);
22
22
  });
23
23
  }
@@ -40,7 +40,7 @@ Examples:
40
40
  const ref = (0, agent_ref_1.parseAgentRef)(agent);
41
41
  const config = await (0, config_1.getResolvedConfig)();
42
42
  if (!config.apiKey) {
43
- throw new errors_1.CliError('Not logged in. Run `orch login` first.');
43
+ throw new errors_1.CliError('Not logged in. Run `orchagent login` first.');
44
44
  }
45
45
  process.stdout.write('Finding agent...\n');
46
46
  // Find the agent by name, filtering by org if provided
@@ -85,7 +85,7 @@ async function listEnvs(config, options) {
85
85
  const result = await (0, api_1.listEnvironments)(config, workspaceId);
86
86
  if (result.environments.length === 0) {
87
87
  console.log(chalk_1.default.gray('No environments found.'));
88
- console.log(chalk_1.default.gray('Use `orch env create` to create one, or include a Dockerfile in your agent bundle.'));
88
+ console.log(chalk_1.default.gray('Use `orchagent env create` to create one, or include a Dockerfile in your agent bundle.'));
89
89
  return;
90
90
  }
91
91
  const table = new cli_table3_1.default({
@@ -167,7 +167,7 @@ async function createEnv(config, options) {
167
167
  console.log(chalk_1.default.green('Environment created, build started.'));
168
168
  console.log(`Environment ID: ${result.environment.id}`);
169
169
  console.log();
170
- console.log(chalk_1.default.gray(`Check build status: orch env status ${result.environment.id}`));
170
+ console.log(chalk_1.default.gray(`Check build status: orchagent env status ${result.environment.id}`));
171
171
  }
172
172
  await (0, analytics_1.track)('env_create', {
173
173
  environment_id: result.environment.id,
@@ -7,9 +7,6 @@ const agents_1 = require("./agents");
7
7
  const init_1 = require("./init");
8
8
  const publish_1 = require("./publish");
9
9
  const whoami_1 = require("./whoami");
10
- const star_1 = require("./star");
11
- const fork_1 = require("./fork");
12
- const search_1 = require("./search");
13
10
  const keys_1 = require("./keys");
14
11
  const run_1 = require("./run");
15
12
  const info_1 = require("./info");
@@ -30,8 +27,6 @@ const list_1 = require("./list");
30
27
  const test_1 = require("./test");
31
28
  const security_1 = require("./security");
32
29
  const billing_1 = require("./billing");
33
- const seller_1 = require("./seller");
34
- const pricing_1 = require("./pricing");
35
30
  function registerCommands(program) {
36
31
  (0, login_1.registerLoginCommand)(program);
37
32
  (0, whoami_1.registerWhoamiCommand)(program);
@@ -41,9 +36,6 @@ function registerCommands(program) {
41
36
  (0, run_1.registerRunCommand)(program);
42
37
  (0, info_1.registerInfoCommand)(program);
43
38
  (0, agents_1.registerAgentsCommand)(program);
44
- (0, search_1.registerSearchCommand)(program);
45
- (0, star_1.registerStarCommand)(program);
46
- (0, fork_1.registerForkCommand)(program);
47
39
  (0, keys_1.registerKeysCommand)(program);
48
40
  (0, skill_1.registerSkillCommand)(program);
49
41
  (0, delete_1.registerDeleteCommand)(program);
@@ -62,6 +54,4 @@ function registerCommands(program) {
62
54
  (0, test_1.registerTestCommand)(program);
63
55
  (0, security_1.registerSecurityCommand)(program);
64
56
  (0, billing_1.registerBillingCommand)(program);
65
- (0, seller_1.registerSellerCommand)(program);
66
- (0, pricing_1.registerPricingCommand)(program);
67
57
  }
@@ -161,7 +161,7 @@ function registerInstallCommand(program) {
161
161
  .option('--json', 'Output result as JSON (for automation/tooling)')
162
162
  .addHelpText('after', `
163
163
  Note: Paid agents cannot be installed locally - they run on server only.
164
- Use 'orch run' to execute paid agents.
164
+ Use 'orchagent run' to execute paid agents.
165
165
  `)
166
166
  .action(async (agentArg, options) => {
167
167
  const jsonMode = options.json === true;
@@ -68,7 +68,7 @@ function registerListCommand(program) {
68
68
  }
69
69
  // Warn about orphaned entries if any exist
70
70
  if (orphaned.length > 0) {
71
- process.stdout.write(`\nWarning: ${orphaned.length} tracked installation(s) have missing files. Run 'orch list --verify' to clean up.\n`);
71
+ process.stdout.write(`\nWarning: ${orphaned.length} tracked installation(s) have missing files. Run 'orchagent list --verify' to clean up.\n`);
72
72
  }
73
73
  });
74
74
  }
@@ -172,8 +172,6 @@ function registerPublishCommand(program) {
172
172
  .option('--skills <skills>', 'Default skills (comma-separated, e.g., org/skill@v1,org/other@v1)')
173
173
  .option('--skills-locked', 'Lock default skills (callers cannot override via headers)')
174
174
  .option('--docker', 'Include Dockerfile for custom environment (builds E2B template)')
175
- .option('--price <amount>', 'Set price per call in USD (e.g., 0.50 for $0.50/call)')
176
- .option('--pricing-mode <mode>', 'Pricing mode: free or per_call (default: free)')
177
175
  .option('--local-download', 'Allow users to download and run locally (default: server-only)')
178
176
  .action(async (options) => {
179
177
  if (options.private) {
@@ -245,46 +243,12 @@ function registerPublishCommand(program) {
245
243
  });
246
244
  const skillVersion = skillResult.agent?.version || 'v1';
247
245
  const skillAgentId = skillResult.agent?.id;
248
- // Handle pricing for skills
249
- if (skillAgentId && (options.price || options.pricingMode)) {
250
- let pricingMode = 'free';
251
- let pricePerCallCents;
252
- if (options.price) {
253
- const priceFloat = parseFloat(options.price);
254
- if (isNaN(priceFloat) || priceFloat < 0) {
255
- throw new errors_1.CliError('Price must be a positive number', errors_1.ExitCodes.INVALID_INPUT);
256
- }
257
- if (priceFloat === 0) {
258
- pricingMode = 'free';
259
- }
260
- else if (priceFloat < 0.01) {
261
- throw new errors_1.CliError('Price must be at least $0.01 USD', errors_1.ExitCodes.INVALID_INPUT);
262
- }
263
- else {
264
- pricingMode = 'per_call';
265
- pricePerCallCents = Math.round(priceFloat * 100);
266
- }
267
- }
268
- else if (options.pricingMode) {
269
- pricingMode = options.pricingMode === 'per_call' ? 'per_call' : 'free';
270
- }
271
- // Set pricing
272
- if (pricingMode === 'per_call' && !pricePerCallCents) {
273
- throw new errors_1.CliError('--price required when using per_call mode', errors_1.ExitCodes.INVALID_INPUT);
274
- }
275
- await (0, api_1.setAgentPricing)(config, skillAgentId, pricingMode, pricePerCallCents);
276
- }
277
246
  await (0, analytics_1.track)('cli_publish', { agent_type: 'skill', multi_file: hasMultipleFiles });
278
247
  process.stdout.write(`\nPublished skill: ${org.slug}/${skillData.frontmatter.name}@${skillVersion}\n`);
279
248
  if (hasMultipleFiles) {
280
249
  process.stdout.write(`Files: ${skillFiles.length} files included\n`);
281
250
  }
282
251
  process.stdout.write(`Public: ${options.public ? 'yes' : 'no'}\n`);
283
- // Show pricing info
284
- if (options.price && parseFloat(options.price) > 0) {
285
- const price = parseFloat(options.price);
286
- process.stdout.write(`Pricing: $${price.toFixed(2)} USD per call\n`);
287
- }
288
252
  process.stdout.write(`\nView analytics and usage: https://orchagent.io/dashboard\n`);
289
253
  }
290
254
  catch (err) {
@@ -657,7 +621,7 @@ function registerPublishCommand(program) {
657
621
  if (uploadResult.environment_source === 'dockerfile_new') {
658
622
  process.stdout.write(` ${chalk_1.default.cyan('Custom environment detected (Dockerfile)')}\n`);
659
623
  process.stdout.write(` ${chalk_1.default.yellow('Environment building...')} Agent will be ready when build completes.\n`);
660
- process.stdout.write(` ${chalk_1.default.gray(`Check status: orch env status ${uploadResult.environment_id}`)}\n`);
624
+ process.stdout.write(` ${chalk_1.default.gray(`Check status: orchagent env status ${uploadResult.environment_id}`)}\n`);
661
625
  }
662
626
  else if (uploadResult.environment_source === 'dockerfile_reused') {
663
627
  process.stdout.write(` ${chalk_1.default.green('Custom environment (reusing existing build)')}\n`);
@@ -672,45 +636,11 @@ function registerPublishCommand(program) {
672
636
  await promises_1.default.rm(tempDir, { recursive: true, force: true });
673
637
  }
674
638
  }
675
- // Handle pricing for agents
676
- if (agentId && (options.price || options.pricingMode)) {
677
- let pricingMode = 'free';
678
- let pricePerCallCents;
679
- if (options.price) {
680
- const priceFloat = parseFloat(options.price);
681
- if (isNaN(priceFloat) || priceFloat < 0) {
682
- throw new errors_1.CliError('Price must be a positive number', errors_1.ExitCodes.INVALID_INPUT);
683
- }
684
- if (priceFloat === 0) {
685
- pricingMode = 'free';
686
- }
687
- else if (priceFloat < 0.01) {
688
- throw new errors_1.CliError('Price must be at least $0.01 USD', errors_1.ExitCodes.INVALID_INPUT);
689
- }
690
- else {
691
- pricingMode = 'per_call';
692
- pricePerCallCents = Math.round(priceFloat * 100);
693
- }
694
- }
695
- else if (options.pricingMode) {
696
- pricingMode = options.pricingMode === 'per_call' ? 'per_call' : 'free';
697
- }
698
- // Set pricing
699
- if (pricingMode === 'per_call' && !pricePerCallCents) {
700
- throw new errors_1.CliError('--price required when using per_call mode', errors_1.ExitCodes.INVALID_INPUT);
701
- }
702
- await (0, api_1.setAgentPricing)(config, agentId, pricingMode, pricePerCallCents);
703
- }
704
639
  await (0, analytics_1.track)('cli_publish', { agent_type: manifest.type, hosted: shouldUploadBundle });
705
640
  process.stdout.write(`\nPublished agent: ${org.slug}/${manifest.name}@${assignedVersion}\n`);
706
641
  process.stdout.write(`Type: ${manifest.type}${shouldUploadBundle ? ' (hosted)' : ''}\n`);
707
642
  process.stdout.write(`Providers: ${supportedProviders.join(', ')}\n`);
708
643
  process.stdout.write(`Public: ${options.public ? 'yes' : 'no'}\n`);
709
- // Show pricing info
710
- if (options.price && parseFloat(options.price) > 0) {
711
- const price = parseFloat(options.price);
712
- process.stdout.write(`Pricing: $${price.toFixed(2)} USD per call\n`);
713
- }
714
644
  if (result.service_key) {
715
645
  process.stdout.write(`\nService key (save this - shown only once):\n`);
716
646
  process.stdout.write(` ${result.service_key}\n`);
@@ -107,7 +107,7 @@ function warnIfLocalPathReference(jsonBody) {
107
107
  process.stderr.write(`Warning: Your payload contains a local path reference ('${pathKey}').\n` +
108
108
  `Remote agents cannot access your local filesystem. The path will be interpreted\n` +
109
109
  `by the server, not your local machine.\n\n` +
110
- `Tip: Use 'orch run <agent> --local' to execute locally with filesystem access.\n\n`);
110
+ `Tip: Use 'orchagent run <agent> --local' to execute locally with filesystem access.\n\n`);
111
111
  }
112
112
  }
113
113
  catch {
@@ -193,7 +193,7 @@ async function downloadSkillWithFallback(config, org, skill, version) {
193
193
  }
194
194
  }
195
195
  throw new errors_1.CliError(`This skill is server-only and cannot be downloaded.\n\n` +
196
- `Skills are loaded automatically during server execution via 'orch run'.`);
196
+ `Skills are loaded automatically during server execution via 'orchagent run'.`);
197
197
  }
198
198
  // Free skill or public metadata available - proceed with normal download
199
199
  if (skillMeta) {
@@ -207,11 +207,11 @@ async function downloadSkillWithFallback(config, org, skill, version) {
207
207
  if (payload?.error?.code === 'PAID_AGENT_SERVER_ONLY') {
208
208
  const price = payload.error.price_per_call_cents || 0;
209
209
  throw new errors_1.CliError(`This skill costs $${(price / 100).toFixed(2)}/call and runs on server only.\n\n` +
210
- `Use: orch run ${org}/${skill}@${version} --data '{...}'`);
210
+ `Use: orchagent run ${org}/${skill}@${version} --data '{...}'`);
211
211
  }
212
212
  if (payload?.error?.code === 'DOWNLOAD_DISABLED') {
213
213
  throw new errors_1.CliError(`This skill is server-only and cannot be downloaded.\n\n` +
214
- `Skills are loaded automatically during server execution via 'orch run'.`);
214
+ `Skills are loaded automatically during server execution via 'orchagent run'.`);
215
215
  }
216
216
  }
217
217
  throw err;
@@ -42,7 +42,7 @@ function registerUpdateCommand(program) {
42
42
  const resolved = await (0, config_1.getResolvedConfig)();
43
43
  const installed = await (0, installed_1.getInstalled)();
44
44
  if (installed.length === 0) {
45
- process.stdout.write('No agents installed. Use "orch install <agent>" to install agents.\n');
45
+ process.stdout.write('No agents installed. Use "orchagent install <agent>" to install agents.\n');
46
46
  return;
47
47
  }
48
48
  // Filter to specific agent if provided
@@ -195,7 +195,7 @@ function registerUpdateCommand(program) {
195
195
  if (skippedMissing > 0) {
196
196
  process.stdout.write(`${skippedMissing} agent(s) have missing files.\n`);
197
197
  }
198
- process.stdout.write('Run "orch update" without --check to apply updates.\n');
198
+ process.stdout.write('Run "orchagent update" without --check to apply updates.\n');
199
199
  }
200
200
  else {
201
201
  process.stdout.write(`Applied ${updatesApplied} update(s).\n`);
package/dist/lib/api.js CHANGED
@@ -40,15 +40,9 @@ exports.request = request;
40
40
  exports.publicRequest = publicRequest;
41
41
  exports.getOrg = getOrg;
42
42
  exports.updateOrg = updateOrg;
43
- exports.listPublicAgents = listPublicAgents;
44
43
  exports.getPublicAgent = getPublicAgent;
45
44
  exports.listMyAgents = listMyAgents;
46
45
  exports.createAgent = createAgent;
47
- exports.starAgent = starAgent;
48
- exports.unstarAgent = unstarAgent;
49
- exports.forkAgent = forkAgent;
50
- exports.searchAgents = searchAgents;
51
- exports.searchMyAgents = searchMyAgents;
52
46
  exports.fetchLlmKeys = fetchLlmKeys;
53
47
  exports.downloadCodeBundle = downloadCodeBundle;
54
48
  exports.uploadCodeBundle = uploadCodeBundle;
@@ -67,11 +61,6 @@ exports.deleteEnvironment = deleteEnvironment;
67
61
  exports.setWorkspaceDefaultEnvironment = setWorkspaceDefaultEnvironment;
68
62
  exports.getCreditsBalance = getCreditsBalance;
69
63
  exports.createCreditCheckout = createCreditCheckout;
70
- exports.getSellerStatus = getSellerStatus;
71
- exports.createSellerOnboarding = createSellerOnboarding;
72
- exports.getSellerDashboardLink = getSellerDashboardLink;
73
- exports.getSellerEarnings = getSellerEarnings;
74
- exports.setAgentPricing = setAgentPricing;
75
64
  const errors_1 = require("./errors");
76
65
  const DEFAULT_TIMEOUT_MS = 15000;
77
66
  const CALL_TIMEOUT_MS = 120000; // 2 minutes for agent calls (can take time)
@@ -234,21 +223,9 @@ async function updateOrg(config, payload) {
234
223
  headers: { 'Content-Type': 'application/json' },
235
224
  });
236
225
  }
237
- async function listPublicAgents(config, options) {
238
- const params = new URLSearchParams();
239
- if (options?.sort)
240
- params.append('sort', options.sort);
241
- if (options?.tags?.length)
242
- params.append('tags', options.tags.join(','));
243
- if (options?.type)
244
- params.append('type', options.type);
245
- const queryStr = params.toString();
246
- return publicRequest(config, `/public/agents${queryStr ? `?${queryStr}` : ''}`);
247
- }
248
226
  async function getPublicAgent(config, org, agent, version) {
249
227
  return publicRequest(config, `/public/agents/${org}/${agent}/${version}`);
250
228
  }
251
- // GitHub-like features
252
229
  async function listMyAgents(config) {
253
230
  return request(config, 'GET', '/agents');
254
231
  }
@@ -258,85 +235,6 @@ async function createAgent(config, data) {
258
235
  headers: { 'Content-Type': 'application/json' },
259
236
  });
260
237
  }
261
- async function starAgent(config, agentId) {
262
- return request(config, 'POST', `/agents/${agentId}/star`);
263
- }
264
- async function unstarAgent(config, agentId) {
265
- await request(config, 'DELETE', `/agents/${agentId}/star`);
266
- }
267
- async function forkAgent(config, agentId) {
268
- return request(config, 'POST', `/agents/${agentId}/fork`);
269
- }
270
- async function searchAgents(config, query, options) {
271
- const params = new URLSearchParams();
272
- if (query)
273
- params.append('search', query);
274
- if (options?.sort)
275
- params.append('sort', options.sort);
276
- if (options?.tags?.length)
277
- params.append('tags', options.tags.join(','));
278
- if (options?.type)
279
- params.append('type', options.type);
280
- const queryStr = params.toString();
281
- return publicRequest(config, `/public/agents${queryStr ? `?${queryStr}` : ''}`);
282
- }
283
- /**
284
- * Search within the authenticated user's own agents (public and private).
285
- * Uses the authenticated /agents endpoint with client-side filtering.
286
- */
287
- async function searchMyAgents(config, query, options) {
288
- let agents = await listMyAgents(config);
289
- // Deduplicate: keep only latest version per agent name
290
- const latestByName = new Map();
291
- for (const agent of agents) {
292
- const existing = latestByName.get(agent.name);
293
- if (!existing || new Date(agent.created_at) > new Date(existing.created_at)) {
294
- latestByName.set(agent.name, agent);
295
- }
296
- }
297
- agents = Array.from(latestByName.values());
298
- // Apply type filter
299
- if (options?.type) {
300
- const typeFilter = options.type;
301
- if (typeFilter === 'agents') {
302
- agents = agents.filter(a => a.type === 'prompt' || a.type === 'tool');
303
- }
304
- else if (typeFilter === 'skills' || typeFilter === 'skill') {
305
- agents = agents.filter(a => a.type === 'skill');
306
- }
307
- else if (typeFilter === 'tool' || typeFilter === 'prompt') {
308
- agents = agents.filter(a => a.type === typeFilter);
309
- }
310
- }
311
- // Apply search filter (match against name and description)
312
- if (query) {
313
- const words = query.toLowerCase().replace(/-/g, ' ').split(/\s+/);
314
- agents = agents.filter(a => {
315
- const name = (a.name || '').toLowerCase().replace(/-/g, ' ');
316
- const desc = (a.description || '').toLowerCase();
317
- return words.every(w => name.includes(w) || desc.includes(w));
318
- });
319
- }
320
- // Map Agent to PublicAgent-compatible objects
321
- const org = await getOrg(config);
322
- return agents.map(a => ({
323
- id: a.id,
324
- org_name: org.name || org.slug || 'unknown',
325
- org_slug: a.org_slug || org.slug || 'unknown',
326
- name: a.name,
327
- version: a.version,
328
- type: a.type,
329
- description: a.description,
330
- stars_count: a.stars_count ?? 0,
331
- tags: a.tags ?? [],
332
- default_endpoint: a.default_endpoint || 'analyze',
333
- created_at: a.created_at,
334
- supported_providers: a.supported_providers ?? ['any'],
335
- is_public: a.is_public,
336
- pricing_mode: a.pricing_mode,
337
- price_per_call_cents: a.price_per_call_cents,
338
- }));
339
- }
340
238
  async function fetchLlmKeys(config) {
341
239
  const result = await request(config, 'GET', '/llm-keys/export');
342
240
  return result.keys;
@@ -532,28 +430,3 @@ async function createCreditCheckout(config, amountCents) {
532
430
  headers: { 'Content-Type': 'application/json' },
533
431
  });
534
432
  }
535
- async function getSellerStatus(config) {
536
- return request(config, 'GET', '/sellers/status');
537
- }
538
- async function createSellerOnboarding(config, country) {
539
- return request(config, 'POST', '/sellers/onboard', {
540
- body: JSON.stringify({ country }),
541
- headers: { 'Content-Type': 'application/json' },
542
- });
543
- }
544
- async function getSellerDashboardLink(config) {
545
- return request(config, 'POST', '/sellers/dashboard-link');
546
- }
547
- async function getSellerEarnings(config) {
548
- return request(config, 'GET', '/billing/earnings');
549
- }
550
- async function setAgentPricing(config, agentId, pricingMode, pricePerCallCents, allowLocalDownload) {
551
- return request(config, 'PUT', `/agents/${agentId}/pricing`, {
552
- body: JSON.stringify({
553
- pricing_mode: pricingMode,
554
- price_per_call_cents: pricePerCallCents,
555
- allow_local_download: allowLocalDownload,
556
- }),
557
- headers: { 'Content-Type': 'application/json' },
558
- });
559
- }
@@ -35,7 +35,7 @@ async function checkApiKeyPresent() {
35
35
  name: 'api_key_present',
36
36
  status: 'error',
37
37
  message: 'No API key configured',
38
- fix: 'Run `orch login` or set ORCHAGENT_API_KEY environment variable',
38
+ fix: 'Run `orchagent login` or set ORCHAGENT_API_KEY environment variable',
39
39
  details: { configured: false },
40
40
  };
41
41
  }
@@ -75,7 +75,7 @@ async function checkApiKeyValid() {
75
75
  name: 'api_key_valid',
76
76
  status: 'error',
77
77
  message: 'API key is invalid or expired',
78
- fix: 'Run `orch login` to get a new key',
78
+ fix: 'Run `orchagent login` to get a new key',
79
79
  details: { error: err.message, status: err.status },
80
80
  };
81
81
  }
@@ -31,7 +31,7 @@ async function checkConfigExists() {
31
31
  name: 'config_exists',
32
32
  status: 'warning',
33
33
  message: 'Config file not found',
34
- fix: 'Run `orch login` to create config',
34
+ fix: 'Run `orchagent login` to create config',
35
35
  details: { path: CONFIG_PATH, exists: false },
36
36
  };
37
37
  }
@@ -128,7 +128,7 @@ async function runLlmChecks(options) {
128
128
  if (configuredCount === 0) {
129
129
  summaryStatus = 'warning';
130
130
  summaryMessage = 'No LLM providers configured';
131
- summaryFix = firstUnconfigured ? `Run: orch keys add ${firstUnconfigured.providerId}` : undefined;
131
+ summaryFix = firstUnconfigured ? `Run: orchagent keys add ${firstUnconfigured.providerId}` : undefined;
132
132
  }
133
133
  else {
134
134
  summaryStatus = 'success';
@@ -136,7 +136,7 @@ async function runLlmChecks(options) {
136
136
  configuredCount < 2
137
137
  ? 'Tip: Multiple providers enable automatic rate limit fallback.'
138
138
  : `${configuredCount} providers configured`;
139
- summaryFix = firstUnconfigured ? `Run: orch keys add ${firstUnconfigured.providerId}` : undefined;
139
+ summaryFix = firstUnconfigured ? `Run: orchagent keys add ${firstUnconfigured.providerId}` : undefined;
140
140
  }
141
141
  results.push({
142
142
  category: 'llm',
@@ -1,61 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.printJson = printJson;
7
- exports.printAgentsTable = printAgentsTable;
8
- const cli_table3_1 = __importDefault(require("cli-table3"));
9
- const chalk_1 = __importDefault(require("chalk"));
10
- const pricing_1 = require("./pricing");
11
4
  function printJson(value) {
12
5
  process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
13
6
  }
14
- function printAgentsTable(agents, options) {
15
- const head = [
16
- chalk_1.default.bold('Agent'),
17
- chalk_1.default.bold('Type'),
18
- ...(options?.showVisibility ? [chalk_1.default.bold('Visibility')] : []),
19
- chalk_1.default.bold('Providers'),
20
- chalk_1.default.bold('Stars'),
21
- chalk_1.default.bold('Price'),
22
- chalk_1.default.bold('Description'),
23
- ];
24
- const table = new cli_table3_1.default({ head });
25
- agents.forEach((agent) => {
26
- const fullName = `${agent.org_slug}/${agent.name}`;
27
- const type = agent.type || 'tool';
28
- const providers = formatProviders(agent.supported_providers);
29
- const stars = agent.stars_count ?? 0;
30
- const price = (0, pricing_1.formatPrice)(agent);
31
- const priceColored = (0, pricing_1.isPaidAgent)(agent) ? chalk_1.default.yellow(price) : chalk_1.default.green(price);
32
- const desc = agent.description
33
- ? agent.description.length > 60
34
- ? agent.description.slice(0, 57) + '...'
35
- : agent.description
36
- : '-';
37
- const visibility = agent.is_public === false
38
- ? chalk_1.default.yellow('private')
39
- : chalk_1.default.green('public');
40
- const row = [fullName, type];
41
- if (options?.showVisibility)
42
- row.push(visibility);
43
- row.push(providers, stars.toString(), priceColored, desc);
44
- table.push(row);
45
- });
46
- process.stdout.write(`${table.toString()}\n`);
47
- }
48
- function formatProviders(providers) {
49
- if (!providers || providers.length === 0 || providers.includes('any')) {
50
- return chalk_1.default.green('any');
51
- }
52
- return providers.map(p => {
53
- if (p === 'openai')
54
- return chalk_1.default.cyan('openai');
55
- if (p === 'anthropic')
56
- return chalk_1.default.magenta('anthropic');
57
- if (p === 'gemini')
58
- return chalk_1.default.yellow('gemini');
59
- return p;
60
- }).join(', ');
61
- }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchagent/cli",
3
- "version": "0.3.46",
4
- "description": "Command-line interface for the orchagent AI agent marketplace",
3
+ "version": "0.3.48",
4
+ "description": "Command-line interface for orchagent — deploy and run AI agents for your team",
5
5
  "license": "MIT",
6
6
  "author": "orchagent <hello@orchagent.io>",
7
7
  "homepage": "https://orchagent.io",
@@ -25,7 +25,6 @@
25
25
  "node": ">=18"
26
26
  },
27
27
  "bin": {
28
- "orchagent": "dist/index.js",
29
28
  "orch": "dist/index.js"
30
29
  },
31
30
  "files": [
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerForkCommand = registerForkCommand;
4
- const config_1 = require("../lib/config");
5
- const api_1 = require("../lib/api");
6
- const errors_1 = require("../lib/errors");
7
- const analytics_1 = require("../lib/analytics");
8
- function parseAgentRef(ref) {
9
- // Format: org/agent/version or org/agent (defaults to v1)
10
- const parts = ref.split('/');
11
- if (parts.length < 2 || parts.length > 3) {
12
- throw new errors_1.CliError('Invalid agent reference. Use: org/agent or org/agent/version');
13
- }
14
- return {
15
- org: parts[0],
16
- name: parts[1],
17
- version: parts[2] || 'v1',
18
- };
19
- }
20
- function registerForkCommand(program) {
21
- program
22
- .command('fork')
23
- .description('Fork an agent to your account')
24
- .argument('<agent>', 'Agent reference (org/name or org/name/version)')
25
- .action(async (agent) => {
26
- const config = await (0, config_1.getResolvedConfig)();
27
- const { org, name, version } = parseAgentRef(agent);
28
- // Get the agent to get its ID
29
- const agentInfo = await (0, api_1.getPublicAgent)(config, org, name, version);
30
- // Fork it
31
- const result = await (0, api_1.forkAgent)(config, agentInfo.id);
32
- // Get our org info
33
- const myOrg = await (0, api_1.getOrg)(config);
34
- await (0, analytics_1.track)('cli_fork', { agent: `${org}/${name}/${version}` });
35
- process.stdout.write(`Forked ${org}/${name}/${version} to your account\n`);
36
- process.stdout.write(`\nYour forked agent: ${myOrg.slug}/${name}/v1\n`);
37
- process.stdout.write(`\nNext steps:\n`);
38
- process.stdout.write(` 1. Run: orchagent install ${myOrg.slug}/${name}\n`);
39
- process.stdout.write(` 2. Edit the prompt and schemas locally\n`);
40
- process.stdout.write(` 3. Run: orchagent publish\n`);
41
- });
42
- }
@@ -1,93 +0,0 @@
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.registerPricingCommand = registerPricingCommand;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const config_1 = require("../lib/config");
9
- const api_1 = require("../lib/api");
10
- const errors_1 = require("../lib/errors");
11
- function registerPricingCommand(program) {
12
- program
13
- .command('pricing <agent> <mode>')
14
- .description('Set pricing for your agent (free or per-call in USD)')
15
- .option('--local-download', 'Allow users to download and run locally')
16
- .option('--no-local-download', 'Restrict to server-only (cloud execution)')
17
- .action(async (agentRef, mode, options) => {
18
- const resolved = await (0, config_1.getResolvedConfig)();
19
- // Parse agent reference
20
- const [orgOrAgent, maybeName] = agentRef.split('/');
21
- let org;
22
- let agentName;
23
- if (maybeName) {
24
- // Format: org/agent
25
- org = orgOrAgent;
26
- agentName = maybeName;
27
- }
28
- else {
29
- // Format: agent (use default org)
30
- const userOrg = await (0, api_1.getOrg)(resolved);
31
- org = userOrg.slug;
32
- agentName = orgOrAgent;
33
- }
34
- // Look up agent ID
35
- const myAgents = await (0, api_1.listMyAgents)(resolved);
36
- const agent = myAgents.find(a => a.org_slug === org && a.name === agentName);
37
- if (!agent) {
38
- throw new errors_1.CliError(`Agent '${org}/${agentName}' not found in your agents.\n\n` +
39
- `List your agents: orch agents`, errors_1.ExitCodes.NOT_FOUND);
40
- }
41
- // Parse pricing mode
42
- let pricingMode;
43
- let pricePerCallCents;
44
- if (mode === 'free' || mode === '0') {
45
- pricingMode = 'free';
46
- pricePerCallCents = undefined;
47
- }
48
- else {
49
- // Parse as dollar amount
50
- const priceFloat = parseFloat(mode);
51
- if (isNaN(priceFloat)) {
52
- throw new errors_1.CliError(`Invalid pricing mode: ${mode}\n\n` +
53
- `Use "free" or a dollar amount (e.g., "0.50" for $0.50 USD)`, errors_1.ExitCodes.INVALID_INPUT);
54
- }
55
- if (priceFloat < 0.01) {
56
- throw new errors_1.CliError('Price must be at least $0.01 USD', errors_1.ExitCodes.INVALID_INPUT);
57
- }
58
- pricingMode = 'per_call';
59
- pricePerCallCents = Math.round(priceFloat * 100);
60
- }
61
- // Determine allow_local_download value
62
- let allowLocalDownload;
63
- if (pricingMode === 'per_call') {
64
- // Paid agents are always server-only
65
- allowLocalDownload = false;
66
- if (options.localDownload) {
67
- process.stderr.write(chalk_1.default.yellow('Note: Paid agents are always server-only. --local-download ignored.\n'));
68
- }
69
- }
70
- else if (options.localDownload !== undefined) {
71
- allowLocalDownload = options.localDownload;
72
- }
73
- // Set pricing
74
- await (0, api_1.setAgentPricing)(resolved, agent.id, pricingMode, pricePerCallCents, allowLocalDownload);
75
- // Show confirmation
76
- process.stdout.write(chalk_1.default.green('✓ Pricing updated\n'));
77
- process.stdout.write(`Agent: ${org}/${agentName}\n`);
78
- if (pricingMode === 'free') {
79
- process.stdout.write(`Mode: FREE\n`);
80
- if (allowLocalDownload === true) {
81
- process.stdout.write(`Local download: enabled\n`);
82
- }
83
- else if (allowLocalDownload === false) {
84
- process.stdout.write(`Local download: disabled (server-only)\n`);
85
- }
86
- }
87
- else {
88
- process.stdout.write(`Mode: Pay per call\n`);
89
- process.stdout.write(`Price: $${(pricePerCallCents / 100).toFixed(2)} USD per call\n`);
90
- process.stdout.write(`Local download: disabled (paid agents are server-only)\n`);
91
- }
92
- });
93
- }
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerSearchCommand = registerSearchCommand;
4
- const config_1 = require("../lib/config");
5
- const api_1 = require("../lib/api");
6
- const output_1 = require("../lib/output");
7
- const analytics_1 = require("../lib/analytics");
8
- const pricing_1 = require("../lib/pricing");
9
- const DEFAULT_LIMIT = 20;
10
- function registerSearchCommand(program) {
11
- program
12
- .command('search')
13
- .description('Search for agents and skills')
14
- .argument('[query]', 'Search query (required unless using --popular or --recent)')
15
- .option('--popular', 'Show top agents/skills by stars')
16
- .option('--recent', 'Show most recently published')
17
- .option('--mine', 'Show only your own agents (including private)')
18
- .option('--type <type>', 'Filter by type: agents, skills, code, prompt, skill, all (default: all)', 'all')
19
- .option('--tags <tags>', 'Filter by tags (comma-separated, e.g., security,devops)')
20
- .option('--limit <n>', `Max results (default: ${DEFAULT_LIMIT})`, String(DEFAULT_LIMIT))
21
- .option('--free', 'Show only free agents')
22
- .option('--paid', 'Show only paid agents')
23
- .option('--json', 'Output raw JSON')
24
- .addHelpText('after', `
25
- Pricing Filters:
26
- --free Show only free agents
27
- --paid Show only paid agents
28
-
29
- Tag Filters:
30
- --tags security,devops Show agents matching any of these tags
31
-
32
- Ownership Filters:
33
- --mine Show your own agents (public and private). Requires login.
34
- `)
35
- .action(async (query, options) => {
36
- const config = await (0, config_1.getResolvedConfig)();
37
- const limit = parseInt(options.limit, 10) || DEFAULT_LIMIT;
38
- // Map type filter for API (null means no filter)
39
- const typeFilter = options.type === 'all' ? undefined : options.type;
40
- const sort = options.popular ? 'stars' : options.recent ? 'recent' : undefined;
41
- const tags = options.tags ? options.tags.split(',').map(t => t.trim()).filter(Boolean) : undefined;
42
- let agents;
43
- if (options.mine) {
44
- // --mine: search within user's own agents (public + private)
45
- if (!config.apiKey) {
46
- process.stderr.write('Error: --mine requires authentication. Run `orchagent login` first.\n');
47
- process.exitCode = 1;
48
- return;
49
- }
50
- agents = await (0, api_1.searchMyAgents)(config, query, { sort, type: typeFilter });
51
- await (0, analytics_1.track)('cli_search', { query, type: options.type, mine: true });
52
- }
53
- else {
54
- // Default to popular when no args
55
- if (!query && !options.popular && !options.recent) {
56
- options.popular = true;
57
- }
58
- if (query) {
59
- agents = await (0, api_1.searchAgents)(config, query, { sort, tags, type: typeFilter });
60
- await (0, analytics_1.track)('cli_search', { query, type: options.type, tags: options.tags });
61
- }
62
- else {
63
- agents = await (0, api_1.listPublicAgents)(config, { sort, tags, type: typeFilter });
64
- await (0, analytics_1.track)('cli_search', { mode: options.popular ? 'popular' : 'recent', type: options.type, tags: options.tags });
65
- }
66
- }
67
- // Filter by pricing if requested
68
- if (options.free) {
69
- agents = agents.filter(a => !(0, pricing_1.isPaidAgent)(a));
70
- }
71
- if (options.paid) {
72
- agents = agents.filter(a => (0, pricing_1.isPaidAgent)(a));
73
- }
74
- // Sort results
75
- if (options.popular || (!query && !options.recent && !options.mine)) {
76
- agents.sort((a, b) => (b.stars_count ?? 0) - (a.stars_count ?? 0));
77
- }
78
- else if (options.recent) {
79
- agents.sort((a, b) => (b.created_at ?? '').localeCompare(a.created_at ?? ''));
80
- }
81
- // Apply limit
82
- agents = agents.slice(0, limit);
83
- if (options.json) {
84
- (0, output_1.printJson)(agents);
85
- return;
86
- }
87
- if (agents.length === 0) {
88
- if (options.mine) {
89
- process.stdout.write(query
90
- ? `No agents found matching "${query}" in your account.\n`
91
- : 'You have no published agents yet.\n');
92
- process.stdout.write('\nTip: Run "orchagent init" to create your first agent.\n');
93
- }
94
- else {
95
- process.stdout.write(query ? 'No results found matching your search.\n' : 'No public agents found.\n');
96
- process.stdout.write('\nView all agents at: https://orchagent.io/explore\n');
97
- }
98
- return;
99
- }
100
- (0, output_1.printAgentsTable)(agents, { showVisibility: options.mine });
101
- if (agents.length === limit) {
102
- process.stdout.write(`\nShowing top ${limit} results. Use --limit <n> for more.\n`);
103
- }
104
- if (options.mine) {
105
- process.stdout.write('\nTip: Run "orchagent info <agent>" to see details, or "orchagent delete <agent>" to remove.\n');
106
- }
107
- else {
108
- process.stdout.write('\nTip: Run "orchagent info <agent>" to see input schema and details.\n');
109
- }
110
- });
111
- }
@@ -1,142 +0,0 @@
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.registerSellerCommand = registerSellerCommand;
7
- const cli_table3_1 = __importDefault(require("cli-table3"));
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const open_1 = __importDefault(require("open"));
10
- const config_1 = require("../lib/config");
11
- const api_1 = require("../lib/api");
12
- const api_2 = require("../lib/api");
13
- const errors_1 = require("../lib/errors");
14
- const output_1 = require("../lib/output");
15
- function registerSellerCommand(program) {
16
- const seller = program
17
- .command('seller')
18
- .description('Manage monetization account for your agents');
19
- // orch seller onboard
20
- seller
21
- .command('onboard')
22
- .description('Start Stripe monetization onboarding process')
23
- .option('--country <code>', 'Country code (default: GB)', 'GB')
24
- .action(async (options) => {
25
- const resolved = await (0, config_1.getResolvedConfig)();
26
- const country = options.country || 'GB';
27
- // Create onboarding session
28
- const response = await (0, api_1.createSellerOnboarding)(resolved, country);
29
- // Open in browser
30
- process.stdout.write(`\nOpening Stripe onboarding...\n`);
31
- process.stdout.write(`Country: ${country}\n\n`);
32
- await (0, open_1.default)(response.onboarding_url);
33
- process.stdout.write(chalk_1.default.gray(`If browser doesn't open, visit:\n${response.onboarding_url}\n`));
34
- });
35
- // orch seller status
36
- seller
37
- .command('status')
38
- .description('Check monetization account status')
39
- .option('--json', 'Output as JSON')
40
- .action(async (options) => {
41
- const resolved = await (0, config_1.getResolvedConfig)();
42
- const status = await (0, api_1.getSellerStatus)(resolved);
43
- if (options.json) {
44
- (0, output_1.printJson)(status);
45
- return;
46
- }
47
- // Display status
48
- if (!status.onboarded) {
49
- process.stdout.write(chalk_1.default.yellow('\nNot onboarded\n\n'));
50
- process.stdout.write('Enable monetization: orch seller onboard\n');
51
- return;
52
- }
53
- process.stdout.write(chalk_1.default.green('\n✓ Onboarded\n\n'));
54
- if (status.charges_enabled !== undefined) {
55
- const chargesStatus = status.charges_enabled ? chalk_1.default.green('✓ Enabled') : chalk_1.default.yellow('⚠ Disabled');
56
- process.stdout.write(`Charges: ${chargesStatus}\n`);
57
- }
58
- if (status.payouts_enabled !== undefined) {
59
- const payoutsStatus = status.payouts_enabled ? chalk_1.default.green('✓ Enabled') : chalk_1.default.yellow('⚠ Disabled');
60
- process.stdout.write(`Payouts: ${payoutsStatus}\n`);
61
- }
62
- if (!status.charges_enabled || !status.payouts_enabled) {
63
- process.stdout.write(chalk_1.default.gray('\nComplete setup: orch seller dashboard\n'));
64
- }
65
- });
66
- // orch seller dashboard
67
- seller
68
- .command('dashboard')
69
- .description('Open Stripe Express dashboard')
70
- .action(async () => {
71
- const resolved = await (0, config_1.getResolvedConfig)();
72
- try {
73
- const response = await (0, api_1.getSellerDashboardLink)(resolved);
74
- // Open in browser
75
- process.stdout.write('\nOpening Stripe dashboard...\n\n');
76
- await (0, open_1.default)(response.dashboard_url);
77
- process.stdout.write(chalk_1.default.gray(`If browser doesn't open, visit:\n${response.dashboard_url}\n`));
78
- }
79
- catch (err) {
80
- if (err instanceof api_2.ApiError && (err.status === 404 || err.status === 403)) {
81
- process.stdout.write(chalk_1.default.yellow('\nNo monetization account found\n\n'));
82
- process.stdout.write('Complete onboarding: orch seller onboard\n');
83
- process.exit(errors_1.ExitCodes.NOT_FOUND);
84
- }
85
- throw err;
86
- }
87
- });
88
- // orch seller earnings
89
- seller
90
- .command('earnings')
91
- .description('Show earnings from your agents')
92
- .option('--json', 'Output as JSON')
93
- .action(async (options) => {
94
- const resolved = await (0, config_1.getResolvedConfig)();
95
- const earnings = await (0, api_1.getSellerEarnings)(resolved);
96
- if (options.json) {
97
- (0, output_1.printJson)(earnings);
98
- return;
99
- }
100
- // Show total earnings
101
- const total = earnings.total_earnings_cents / 100;
102
- process.stdout.write(chalk_1.default.bold(`\nTotal Earnings: ${chalk_1.default.green(`$${total.toFixed(2)} USD`)}\n\n`));
103
- // Show earnings by agent
104
- if (earnings.by_agent && earnings.by_agent.length > 0) {
105
- process.stdout.write(chalk_1.default.bold('Earnings by Agent:\n'));
106
- const table = new cli_table3_1.default({
107
- head: [
108
- chalk_1.default.bold('Agent'),
109
- chalk_1.default.bold('Calls'),
110
- chalk_1.default.bold('Earnings'),
111
- ],
112
- });
113
- earnings.by_agent.forEach((item) => {
114
- const earningsStr = `$${(item.earnings_cents / 100).toFixed(2)}`;
115
- table.push([item.agent_name, item.calls.toString(), earningsStr]);
116
- });
117
- process.stdout.write(`${table.toString()}\n\n`);
118
- }
119
- // Show recent transactions
120
- if (earnings.recent_transactions && earnings.recent_transactions.length > 0) {
121
- process.stdout.write(chalk_1.default.bold('Recent Transactions:\n'));
122
- const table = new cli_table3_1.default({
123
- head: [
124
- chalk_1.default.bold('Date'),
125
- chalk_1.default.bold('Agent'),
126
- chalk_1.default.bold('Sale'),
127
- chalk_1.default.bold('Your Cut'),
128
- chalk_1.default.bold('Fee'),
129
- ],
130
- });
131
- earnings.recent_transactions.forEach((tx) => {
132
- const date = new Date(tx.created_at).toLocaleDateString();
133
- const sale = `$${(tx.sale_amount_cents / 100).toFixed(2)}`;
134
- const cut = `$${(tx.earnings_cents / 100).toFixed(2)}`;
135
- const fee = `$${(tx.fee_cents / 100).toFixed(2)}`;
136
- table.push([date, tx.agent_name, sale, cut, fee]);
137
- });
138
- process.stdout.write(`${table.toString()}\n\n`);
139
- }
140
- process.stdout.write(chalk_1.default.gray('Manage payouts: orch seller dashboard\n'));
141
- });
142
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerStarCommand = registerStarCommand;
4
- const config_1 = require("../lib/config");
5
- const api_1 = require("../lib/api");
6
- const errors_1 = require("../lib/errors");
7
- const analytics_1 = require("../lib/analytics");
8
- function parseAgentRef(ref) {
9
- // Format: org/agent/version or org/agent (defaults to v1)
10
- const parts = ref.split('/');
11
- if (parts.length < 2 || parts.length > 3) {
12
- throw new errors_1.CliError('Invalid agent reference. Use: org/agent or org/agent/version');
13
- }
14
- return {
15
- org: parts[0],
16
- name: parts[1],
17
- version: parts[2] || 'v1',
18
- };
19
- }
20
- function registerStarCommand(program) {
21
- program
22
- .command('star')
23
- .description('Star an agent')
24
- .argument('<agent>', 'Agent reference (org/name or org/name/version)')
25
- .option('--remove', 'Remove star instead of adding')
26
- .action(async (agent, options) => {
27
- const config = await (0, config_1.getResolvedConfig)();
28
- const { org, name, version } = parseAgentRef(agent);
29
- // Get the agent to get its ID
30
- const agentInfo = await (0, api_1.getPublicAgent)(config, org, name, version);
31
- if (options.remove) {
32
- await (0, api_1.unstarAgent)(config, agentInfo.id);
33
- process.stdout.write(`Removed star from ${org}/${name}/${version}\n`);
34
- }
35
- else {
36
- const result = await (0, api_1.starAgent)(config, agentInfo.id);
37
- if (result.starred) {
38
- await (0, analytics_1.track)('cli_star', { agent: `${org}/${name}/${version}` });
39
- process.stdout.write(`Starred ${org}/${name}/${version}\n`);
40
- }
41
- else {
42
- // Already starred — toggle off
43
- await (0, api_1.unstarAgent)(config, agentInfo.id);
44
- process.stdout.write(`Unstarred ${org}/${name}/${version}\n`);
45
- }
46
- }
47
- });
48
- }