@orchagent/cli 0.3.42 → 0.3.44

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.
@@ -46,10 +46,10 @@ const SCHEMA_TEMPLATE = `{
46
46
  }
47
47
  `;
48
48
  const CODE_TEMPLATE_PY = `"""
49
- orchagent code agent entrypoint.
49
+ orchagent tool entrypoint.
50
50
 
51
51
  Reads JSON input from stdin, processes it, and writes JSON output to stdout.
52
- This is the standard orchagent code agent protocol.
52
+ This is the standard orchagent tool protocol.
53
53
 
54
54
  Usage:
55
55
  echo '{"input": "hello"}' | python main.py
@@ -82,35 +82,35 @@ if __name__ == "__main__":
82
82
  main()
83
83
  `;
84
84
  function readmeTemplate(agentName, type) {
85
- const callExample = type === 'code'
86
- ? `orchagent call ${agentName} input-file.txt`
87
- : `orchagent call ${agentName} --data '{"${type === 'agentic' ? 'task' : 'input'}": "Hello world"}'`;
88
- const runExample = type === 'code'
89
- ? `orchagent run ${agentName} --input '{"file_path": "src/app.py"}'`
90
- : `orchagent run ${agentName} --input '{"${type === 'agentic' ? 'task' : 'input'}": "Hello world"}'`;
85
+ const cloudExample = type === 'tool'
86
+ ? `orchagent run ${agentName} input-file.txt`
87
+ : `orchagent run ${agentName} --data '{"${type === 'agent' ? 'task' : 'input'}": "Hello world"}'`;
88
+ const localExample = type === 'tool'
89
+ ? `orchagent run ${agentName} --local --data '{"file_path": "src/app.py"}'`
90
+ : `orchagent run ${agentName} --local --data '{"${type === 'agent' ? 'task' : 'input'}": "Hello world"}'`;
91
91
  return `# ${agentName}
92
92
 
93
93
  A brief description of what this agent does.
94
94
 
95
95
  ## Usage
96
96
 
97
- ### Server execution
97
+ ### Cloud execution (default)
98
98
 
99
99
  \`\`\`sh
100
- ${callExample}
100
+ ${cloudExample}
101
101
  \`\`\`
102
102
 
103
103
  ### Local execution
104
104
 
105
105
  \`\`\`sh
106
- ${runExample}
106
+ ${localExample}
107
107
  \`\`\`
108
108
 
109
109
  ## Input
110
110
 
111
111
  | Field | Type | Description |
112
112
  |-------|------|-------------|
113
- | \`${type === 'agentic' ? 'task' : 'input'}\` | string | ${type === 'agentic' ? 'The task to perform' : 'The input to process'} |
113
+ | \`${type === 'agent' ? 'task' : 'input'}\` | string | ${type === 'agent' ? 'The task to perform' : 'The input to process'} |
114
114
 
115
115
  ## Output
116
116
 
@@ -119,10 +119,10 @@ ${runExample}
119
119
  | \`result\` | string | The agent's response |
120
120
  `;
121
121
  }
122
- const AGENTIC_MANIFEST_TEMPLATE = `{
122
+ const AGENT_MANIFEST_TEMPLATE = `{
123
123
  "name": "my-agent",
124
- "description": "An agentic AI agent with tool use",
125
- "type": "agentic",
124
+ "description": "An AI agent with tool use",
125
+ "type": "agent",
126
126
  "supported_providers": ["anthropic"],
127
127
  "max_turns": 25,
128
128
  "custom_tools": [
@@ -134,7 +134,7 @@ const AGENTIC_MANIFEST_TEMPLATE = `{
134
134
  ]
135
135
  }
136
136
  `;
137
- const AGENTIC_PROMPT_TEMPLATE = `You are a helpful AI agent with access to a sandboxed environment.
137
+ const AGENT_PROMPT_TEMPLATE = `You are a helpful AI agent with access to a sandboxed environment.
138
138
 
139
139
  Given the input, complete the task using the available tools:
140
140
  - Use bash to run commands
@@ -146,7 +146,7 @@ Input: The caller's input will be provided as JSON.
146
146
 
147
147
  Work step by step, verify your results, and submit the final output.
148
148
  `;
149
- const AGENTIC_SCHEMA_TEMPLATE = `{
149
+ const AGENT_SCHEMA_TEMPLATE = `{
150
150
  "input": {
151
151
  "type": "object",
152
152
  "properties": {
@@ -188,7 +188,7 @@ function registerInitCommand(program) {
188
188
  .command('init')
189
189
  .description('Initialize a new agent project')
190
190
  .argument('[name]', 'Agent name (default: current directory name)')
191
- .option('--type <type>', 'Type: prompt, code, agentic, or skill (default: prompt)', 'prompt')
191
+ .option('--type <type>', 'Type: prompt, tool, agent, or skill (default: prompt)', 'prompt')
192
192
  .action(async (name, options) => {
193
193
  const cwd = process.cwd();
194
194
  // When a name is provided, create a subdirectory for the project
@@ -242,20 +242,20 @@ function registerInitCommand(program) {
242
242
  }
243
243
  }
244
244
  // Create manifest and type-specific files
245
- if (options.type === 'agentic') {
246
- const manifest = JSON.parse(AGENTIC_MANIFEST_TEMPLATE);
245
+ if (options.type === 'agent') {
246
+ const manifest = JSON.parse(AGENT_MANIFEST_TEMPLATE);
247
247
  manifest.name = agentName;
248
248
  await promises_1.default.writeFile(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
249
- await promises_1.default.writeFile(promptPath, AGENTIC_PROMPT_TEMPLATE);
250
- await promises_1.default.writeFile(schemaPath, AGENTIC_SCHEMA_TEMPLATE);
249
+ await promises_1.default.writeFile(promptPath, AGENT_PROMPT_TEMPLATE);
250
+ await promises_1.default.writeFile(schemaPath, AGENT_SCHEMA_TEMPLATE);
251
251
  }
252
252
  else {
253
253
  const manifest = JSON.parse(MANIFEST_TEMPLATE);
254
254
  manifest.name = agentName;
255
- manifest.type = ['code', 'skill'].includes(options.type) ? options.type : 'prompt';
255
+ manifest.type = ['tool', 'skill'].includes(options.type) ? options.type : 'prompt';
256
256
  await promises_1.default.writeFile(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
257
- // Create prompt template (for prompt-based agents) or entrypoint (for code agents)
258
- if (options.type === 'code') {
257
+ // Create prompt template (for prompt-based agents) or entrypoint (for tool agents)
258
+ if (options.type === 'tool') {
259
259
  const entrypointPath = path_1.default.join(targetDir, 'main.py');
260
260
  await promises_1.default.writeFile(entrypointPath, CODE_TEMPLATE_PY);
261
261
  }
@@ -272,7 +272,7 @@ function registerInitCommand(program) {
272
272
  process.stdout.write(`\nFiles created:\n`);
273
273
  const prefix = name ? name + '/' : '';
274
274
  process.stdout.write(` ${prefix}orchagent.json - Agent configuration\n`);
275
- if (options.type === 'code') {
275
+ if (options.type === 'tool') {
276
276
  process.stdout.write(` ${prefix}main.py - Agent entrypoint (stdin/stdout JSON)\n`);
277
277
  }
278
278
  else {
@@ -281,7 +281,7 @@ function registerInitCommand(program) {
281
281
  process.stdout.write(` ${prefix}schema.json - Input/output schemas\n`);
282
282
  process.stdout.write(` ${prefix}README.md - Agent documentation\n`);
283
283
  process.stdout.write(`\nNext steps:\n`);
284
- if (options.type === 'agentic') {
284
+ if (options.type === 'agent') {
285
285
  const stepNum = name ? 2 : 1;
286
286
  if (name) {
287
287
  process.stdout.write(` 1. cd ${name}\n`);
@@ -291,7 +291,7 @@ function registerInitCommand(program) {
291
291
  process.stdout.write(` ${stepNum + 2}. Edit schema.json with your input/output schemas\n`);
292
292
  process.stdout.write(` ${stepNum + 3}. Run: orchagent publish\n`);
293
293
  }
294
- else if (options.type !== 'code') {
294
+ else if (options.type !== 'tool') {
295
295
  const stepNum = name ? 2 : 1;
296
296
  if (name) {
297
297
  process.stdout.write(` 1. cd ${name}\n`);
@@ -76,14 +76,14 @@ async function downloadAgentWithFallback(config, org, name, version) {
76
76
  // Non-owner - block with helpful message
77
77
  const price = (0, pricing_1.formatPrice)(publicMeta);
78
78
  throw new errors_1.CliError(`This agent is paid (${price}) and runs on server only.\n\n` +
79
- `Use: orch call ${org}/${name}@${version} --input '{...}'`);
79
+ `Use: orch run ${org}/${name}@${version} --data '{...}'`);
80
80
  }
81
81
  }
82
82
  else {
83
83
  // Not authenticated - block
84
84
  const price = (0, pricing_1.formatPrice)(publicMeta);
85
85
  throw new errors_1.CliError(`This agent is paid (${price}) and runs on server only.\n\n` +
86
- `Use: orch call ${org}/${name}@${version} --input '{...}'`);
86
+ `Use: orch run ${org}/${name}@${version} --data '{...}'`);
87
87
  }
88
88
  }
89
89
  // Check if download is disabled (server-only agent)
@@ -115,7 +115,7 @@ async function downloadAgentWithFallback(config, org, name, version) {
115
115
  }
116
116
  }
117
117
  throw new errors_1.CliError(`This agent is server-only and cannot be downloaded.\n\n` +
118
- `Use: orch call ${org}/${name}@${version} --input '{...}'`);
118
+ `Use: orch run ${org}/${name}@${version} --data '{...}'`);
119
119
  }
120
120
  // Free agent - proceed normally with public data
121
121
  if (publicMeta) {
@@ -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 call' to execute paid agents.
164
+ Use 'orch run' to execute paid agents.
165
165
  `)
166
166
  .action(async (agentArg, options) => {
167
167
  const jsonMode = options.json === true;
@@ -13,7 +13,7 @@ function registerPricingCommand(program) {
13
13
  .command('pricing <agent> <mode>')
14
14
  .description('Set pricing for your agent (free or per-call in USD)')
15
15
  .option('--local-download', 'Allow users to download and run locally')
16
- .option('--no-local-download', 'Restrict to server-only (orch call)')
16
+ .option('--no-local-download', 'Restrict to server-only (cloud execution)')
17
17
  .action(async (agentRef, mode, options) => {
18
18
  const resolved = await (0, config_1.getResolvedConfig)();
19
19
  // Parse agent reference
@@ -317,7 +317,7 @@ function registerPublishCommand(program) {
317
317
  `These must be nested under a "manifest" key. Example:\n\n` +
318
318
  ` {\n` +
319
319
  ` "name": "${manifest.name}",\n` +
320
- ` "type": "${manifest.type || 'code'}",\n` +
320
+ ` "type": "${manifest.type || 'tool'}",\n` +
321
321
  ` "manifest": {\n` +
322
322
  ` "manifest_version": 1,\n` +
323
323
  ` "dependencies": [...],\n` +
@@ -328,16 +328,16 @@ function registerPublishCommand(program) {
328
328
  ` }\n\n` +
329
329
  `See docs/manifest.md for details.`);
330
330
  }
331
- // Read prompt (for prompt-based, agentic, and skill agents)
331
+ // Read prompt (for prompt-based, agent, and skill agents)
332
332
  let prompt;
333
- if (manifest.type === 'prompt' || manifest.type === 'skill' || manifest.type === 'agentic') {
333
+ if (manifest.type === 'prompt' || manifest.type === 'skill' || manifest.type === 'agent') {
334
334
  const promptPath = path_1.default.join(cwd, 'prompt.md');
335
335
  try {
336
336
  prompt = await promises_1.default.readFile(promptPath, 'utf-8');
337
337
  }
338
338
  catch (err) {
339
339
  if (err.code === 'ENOENT') {
340
- const agentTypeName = manifest.type === 'skill' ? 'skill' : manifest.type === 'agentic' ? 'agentic agent' : 'prompt-based agent';
340
+ const agentTypeName = manifest.type === 'skill' ? 'skill' : manifest.type === 'agent' ? 'agent' : 'prompt-based agent';
341
341
  throw new errors_1.CliError(`No prompt.md found for ${agentTypeName}.\n\n` +
342
342
  'Create a prompt.md file in the current directory with your prompt template.\n' +
343
343
  'See: https://orchagent.io/docs/publishing');
@@ -345,8 +345,8 @@ function registerPublishCommand(program) {
345
345
  throw err;
346
346
  }
347
347
  }
348
- // For agentic agents, validate custom_tools and build manifest
349
- if (manifest.type === 'agentic') {
348
+ // For agent type, validate custom_tools and build manifest
349
+ if (manifest.type === 'agent') {
350
350
  // Validate custom_tools format
351
351
  if (manifest.custom_tools) {
352
352
  const reservedNames = new Set(['bash', 'read_file', 'write_file', 'list_files', 'submit_result']);
@@ -372,18 +372,18 @@ function registerPublishCommand(program) {
372
372
  throw new errors_1.CliError('max_turns must be a number between 1 and 50');
373
373
  }
374
374
  }
375
- // Store agentic config in manifest field
376
- const agenticManifest = {
375
+ // Store agent config in manifest field
376
+ const agentManifest = {
377
377
  ...(manifest.manifest || {}),
378
378
  };
379
379
  if (manifest.custom_tools) {
380
- agenticManifest.custom_tools = manifest.custom_tools;
380
+ agentManifest.custom_tools = manifest.custom_tools;
381
381
  }
382
382
  if (manifest.max_turns) {
383
- agenticManifest.max_turns = manifest.max_turns;
383
+ agentManifest.max_turns = manifest.max_turns;
384
384
  }
385
- manifest.manifest = agenticManifest;
386
- // Agentic agents default to anthropic provider
385
+ manifest.manifest = agentManifest;
386
+ // Agent type defaults to anthropic provider
387
387
  if (!manifest.supported_providers) {
388
388
  manifest.supported_providers = ['anthropic'];
389
389
  }
@@ -407,7 +407,7 @@ function registerPublishCommand(program) {
407
407
  }
408
408
  }
409
409
  // For prompt/skill agents, derive input schema from template variables if needed
410
- // (Agentic agents use schema.json directly — no template variable derivation)
410
+ // (Agent type uses schema.json directly — no template variable derivation)
411
411
  if (prompt && (manifest.type === 'prompt' || manifest.type === 'skill')) {
412
412
  const templateVars = extractTemplateVariables(prompt);
413
413
  if (templateVars.length > 0) {
@@ -434,13 +434,13 @@ function registerPublishCommand(program) {
434
434
  }
435
435
  }
436
436
  }
437
- // For code-based agents, either --url is required OR we bundle the code
438
- // For agentic agents, use internal placeholder (no user code, platform handles execution)
437
+ // For tool-based agents, either --url is required OR we bundle the code
438
+ // For agent type, use internal placeholder (no user code, platform handles execution)
439
439
  let agentUrl = options.url;
440
440
  let shouldUploadBundle = false;
441
- if (manifest.type === 'agentic') {
442
- // Agentic agents don't need a URL or code bundle
443
- agentUrl = agentUrl || 'https://agentic-agent.internal';
441
+ if (manifest.type === 'agent') {
442
+ // Agent type doesn't need a URL or code bundle
443
+ agentUrl = agentUrl || 'https://agent.internal';
444
444
  // But they can include a Dockerfile for custom environments
445
445
  if (options.docker) {
446
446
  const dockerfilePath = path_1.default.join(cwd, 'Dockerfile');
@@ -454,27 +454,27 @@ function registerPublishCommand(program) {
454
454
  }
455
455
  }
456
456
  }
457
- else if (manifest.type === 'code' && !options.url) {
457
+ else if (manifest.type === 'tool' && !options.url) {
458
458
  // Check if this looks like a Python or JS project that can be bundled
459
459
  const entrypoint = manifest.entrypoint || await (0, bundle_1.detectEntrypoint)(cwd);
460
460
  if (entrypoint) {
461
- // This is a hosted code agent - we'll bundle and upload
461
+ // This is a hosted tool - we'll bundle and upload
462
462
  shouldUploadBundle = true;
463
463
  // Set a placeholder URL that tells the gateway to use sandbox execution
464
- agentUrl = 'https://code-agent.internal';
465
- process.stdout.write(`Detected code project with entrypoint: ${entrypoint}\n`);
464
+ agentUrl = 'https://tool.internal';
465
+ process.stdout.write(`Detected tool project with entrypoint: ${entrypoint}\n`);
466
466
  }
467
467
  else {
468
- throw new errors_1.CliError('Code agent requires either --url <url> or an entry point file (main.py, app.py, index.js, etc.)');
468
+ throw new errors_1.CliError('Tool requires either --url <url> or an entry point file (main.py, app.py, index.js, etc.)');
469
469
  }
470
470
  }
471
471
  // Get org info
472
472
  const org = await (0, api_1.getOrg)(config);
473
473
  // Default to 'any' provider if not specified
474
474
  const supportedProviders = manifest.supported_providers || ['any'];
475
- // Detect SDK compatibility for code agents
475
+ // Detect SDK compatibility for tool agents
476
476
  let sdkCompatible = false;
477
- if (manifest.type === 'code') {
477
+ if (manifest.type === 'tool') {
478
478
  sdkCompatible = await detectSdkCompatible(cwd);
479
479
  if (sdkCompatible && !options.dryRun) {
480
480
  process.stdout.write(`SDK detected - agent will be marked as Local Ready\n`);
@@ -502,8 +502,8 @@ function registerPublishCommand(program) {
502
502
  process.stderr.write(` ✓ Input schema derived from template variables: ${vars.join(', ')}\n`);
503
503
  }
504
504
  }
505
- else if (manifest.type === 'agentic') {
506
- // Agentic agent validations
505
+ else if (manifest.type === 'agent') {
506
+ // Agent type validations
507
507
  const promptBytes = prompt ? Buffer.byteLength(prompt, 'utf-8') : 0;
508
508
  process.stderr.write(` ✓ prompt.md found (${promptBytes.toLocaleString()} bytes)\n`);
509
509
  if (schemaFromFile) {
@@ -514,8 +514,8 @@ function registerPublishCommand(program) {
514
514
  process.stderr.write(` ✓ Custom tools: ${customToolCount}\n`);
515
515
  process.stderr.write(` ✓ Max turns: ${manifest.max_turns || 25}\n`);
516
516
  }
517
- else if (manifest.type === 'code') {
518
- // Code agent validations
517
+ else if (manifest.type === 'tool') {
518
+ // Tool agent validations
519
519
  const entrypoint = manifest.entrypoint || await (0, bundle_1.detectEntrypoint)(cwd);
520
520
  process.stderr.write(` ✓ Entrypoint: ${entrypoint}\n`);
521
521
  if (sdkCompatible) {
@@ -523,7 +523,7 @@ function registerPublishCommand(program) {
523
523
  }
524
524
  }
525
525
  process.stderr.write(` ✓ Authentication valid (org: ${org.slug})\n`);
526
- // For code agents with bundles, show bundle preview
526
+ // For tools with bundles, show bundle preview
527
527
  if (shouldUploadBundle) {
528
528
  const bundlePreview = await (0, bundle_1.previewBundle)(cwd, {
529
529
  entrypoint: manifest.entrypoint,
@@ -577,7 +577,7 @@ function registerPublishCommand(program) {
577
577
  is_public: options.public ? true : false,
578
578
  supported_providers: supportedProviders,
579
579
  default_models: manifest.default_models,
580
- // Local run fields for code agents
580
+ // Local run fields for tool agents
581
581
  source_url: manifest.source_url,
582
582
  pip_package: manifest.pip_package,
583
583
  run_command: manifest.run_command,
@@ -595,7 +595,7 @@ function registerPublishCommand(program) {
595
595
  }
596
596
  const assignedVersion = result.agent?.version || 'v1';
597
597
  const agentId = result.agent?.id;
598
- // Upload code bundle if this is a hosted code agent or agentic agent with --docker
598
+ // Upload code bundle if this is a hosted tool agent or agent type with --docker
599
599
  if (shouldUploadBundle && agentId) {
600
600
  process.stdout.write(`\nBundling code...\n`);
601
601
  const tempDir = await promises_1.default.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'orchagent-bundle-'));
@@ -614,8 +614,8 @@ function registerPublishCommand(program) {
614
614
  throw new errors_1.CliError('--docker flag specified but no Dockerfile found in project directory');
615
615
  }
616
616
  }
617
- // For agentic agents, also include requirements.txt if present
618
- if (manifest.type === 'agentic') {
617
+ // For agent type, also include requirements.txt if present
618
+ if (manifest.type === 'agent') {
619
619
  const reqPath = path_1.default.join(cwd, 'requirements.txt');
620
620
  try {
621
621
  await promises_1.default.access(reqPath);
@@ -627,10 +627,10 @@ function registerPublishCommand(program) {
627
627
  }
628
628
  }
629
629
  const bundleResult = await (0, bundle_1.createCodeBundle)(cwd, bundlePath, {
630
- entrypoint: manifest.type === 'agentic' ? undefined : manifest.entrypoint,
630
+ entrypoint: manifest.type === 'agent' ? undefined : manifest.entrypoint,
631
631
  exclude: manifest.bundle?.exclude,
632
632
  include: includePatterns.length > 0 ? includePatterns : undefined,
633
- skipEntrypointCheck: manifest.type === 'agentic',
633
+ skipEntrypointCheck: manifest.type === 'agent',
634
634
  });
635
635
  process.stdout.write(` Created bundle: ${bundleResult.fileCount} files, ${(bundleResult.sizeBytes / 1024).toFixed(1)}KB\n`);
636
636
  // Validate bundle size