@cutleryapp/agent 1.0.7 → 1.0.9
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/cli.js +18 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -417,7 +417,24 @@ function runConnect(opts) {
|
|
|
417
417
|
}
|
|
418
418
|
if (message.type === "registered") {
|
|
419
419
|
registered = true;
|
|
420
|
-
|
|
420
|
+
// Render the resolved plan / cap / utilisation when the server
|
|
421
|
+
// provides them (added in server.ts >= today). Older servers send
|
|
422
|
+
// only { type, agentName, timestamp } — the optional chains below
|
|
423
|
+
// make the line gracefully degrade to the previous one-liner.
|
|
424
|
+
const planName = message?.plan?.name;
|
|
425
|
+
const cap = typeof message?.cap === "number" ? message.cap : null;
|
|
426
|
+
const used = typeof message?.used === "number" ? message.used : null;
|
|
427
|
+
if (planName && cap !== null && used !== null) {
|
|
428
|
+
const fraction = cap === -1 ? "∞ agents allowed" : `${used}/${cap} agents used`;
|
|
429
|
+
log(chalk_1.default.green(`✓ Registration confirmed by server`) +
|
|
430
|
+
chalk_1.default.gray(` · ${planName} plan · ${fraction}`));
|
|
431
|
+
if (cap !== -1 && used >= cap) {
|
|
432
|
+
log(chalk_1.default.yellow(` ⚠ You're at your plan's concurrent-agent cap. Disconnect another agent or upgrade at ${message.upgradeUrl ?? "/pricing"}.`));
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
log(chalk_1.default.green(`✓ Registration confirmed by server`));
|
|
437
|
+
}
|
|
421
438
|
opts.onRegistered?.();
|
|
422
439
|
}
|
|
423
440
|
else if (message.type === "evicted") {
|