a2acalling 0.6.40 → 0.6.42

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.
Files changed (2) hide show
  1. package/bin/cli.js +20 -5
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -71,6 +71,13 @@ function getConvStore() {
71
71
 
72
72
  const store = new TokenStore();
73
73
 
74
+ // Commands that should hard-fail with a clear error when not onboarded,
75
+ // rather than falling through to the interactive quickstart flow.
76
+ // These are outbound operations often invoked by agents/automation.
77
+ const ONBOARDING_HARD_FAIL = new Set([
78
+ 'call', 'ping', 'status'
79
+ ]);
80
+
74
81
  // ── enforceOnboarding ────────────────────────────────────────────────────
75
82
  // If onboarding is incomplete or the config is missing/invalid, run the
76
83
  // full quickstart flow inline — verbose, with direct stdio. The agent sees
@@ -89,6 +96,14 @@ function enforceOnboarding(command) {
89
96
  }
90
97
 
91
98
  if (!isOnboarded()) {
99
+ // For outbound commands (call, ping, status), fail immediately with
100
+ // a clear error instead of dumping onboarding prompts. This prevents
101
+ // calling agents from receiving walls of setup instructions.
102
+ if (ONBOARDING_HARD_FAIL.has(command)) {
103
+ console.error('❌ Onboarding not complete. Run `a2a quickstart` first to set up your agent.');
104
+ process.exit(1);
105
+ }
106
+
92
107
  // Run the full quickstart flow inline — verbose output, direct stdio.
93
108
  // This replaces the original command; after onboarding the agent can
94
109
  // re-run their intended command.
@@ -1245,7 +1260,7 @@ a2a add "${inviteUrl}" "${ownerText || 'friend'}" && a2a call "${ownerText || 'f
1245
1260
 
1246
1261
  if (!target || !message) {
1247
1262
  console.error('Usage: a2a call <contact_or_url> <message>');
1248
- console.error(' --multi Enable multi-turn conversation');
1263
+ console.error(' --single Single-turn call (one message, one response)');
1249
1264
  console.error(' --min-turns N Minimum turns before close (default: 8)');
1250
1265
  console.error(' --max-turns N Maximum turns (default: 25)');
1251
1266
  process.exit(1);
@@ -1262,10 +1277,10 @@ a2a add "${inviteUrl}" "${ownerText || 'friend'}" && a2a call "${ownerText || 'f
1262
1277
  }
1263
1278
  }
1264
1279
 
1265
- const multi = Boolean(args.flags.multi);
1280
+ const single = Boolean(args.flags.single);
1266
1281
  const callerName = args.flags.name || 'CLI User';
1267
1282
 
1268
- if (multi) {
1283
+ if (!single) {
1269
1284
  // Multi-turn conversation via ConversationDriver
1270
1285
  const { ConversationDriver } = require('../src/lib/conversation-driver');
1271
1286
  const { createRuntimeAdapter } = require('../src/lib/runtime-adapter');
@@ -2292,8 +2307,8 @@ Conversations:
2292
2307
  conversations end <id> End and summarize conversation
2293
2308
 
2294
2309
  Calling:
2295
- call <contact|url> <msg> Call a contact (or invite URL)
2296
- --multi Enable multi-turn conversation
2310
+ call <contact|url> <msg> Call a contact (multi-turn by default)
2311
+ --single Single-turn call (one message, one response)
2297
2312
  --min-turns N Minimum turns before close (default: 8)
2298
2313
  --max-turns N Maximum turns (default: 25)
2299
2314
  ping <url> Check if agent is reachable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "a2acalling",
3
- "version": "0.6.40",
3
+ "version": "0.6.42",
4
4
  "description": "Agent-to-agent calling for OpenClaw - A2A agent communication",
5
5
  "main": "src/index.js",
6
6
  "bin": {