a2acalling 0.6.41 → 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.
- package/bin/cli.js +15 -0
- 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.
|