@indigoai-us/hq-cli 5.247.0 → 5.247.1
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/CHANGELOG.md +6 -0
- package/dist/commands/bot.js +10 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/commands/bot.js
CHANGED
|
@@ -521,11 +521,17 @@ export async function runBotCreate(nameArg, opts) {
|
|
|
521
521
|
if (matches.length > 1) {
|
|
522
522
|
throw Object.assign(new Error(`You own more than one bot called "${name}": ${matches.map((bot) => bot.agentUid).join(", ")}. Name the one you mean by its id.`), { expected: true });
|
|
523
523
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
524
|
+
const setupSlug = `${RESERVED_SETUP_BOT_NAME}-${owner.slice(-8).toLowerCase()}`;
|
|
525
|
+
const slugMatches = mine.filter((bot) => (bot.slug ?? "").trim().toLowerCase() === setupSlug);
|
|
526
|
+
if (slugMatches.length > 1) {
|
|
527
|
+
throw Object.assign(new Error(`HQ returned more than one agent with the setup slug "${setupSlug}". The CLI cannot safely choose one; ask your HQ admin to inspect the duplicate records.`), { expected: true });
|
|
528
|
+
}
|
|
529
|
+
if (slugMatches.length === 0)
|
|
528
530
|
return false;
|
|
531
|
+
const remote = slugMatches[0];
|
|
532
|
+
if (!isReservedSetupBotRecord(remote, owner)) {
|
|
533
|
+
throw Object.assign(new Error(`HQ lists an agent with the setup slug "${setupSlug}", but its record does not identify it as your setup bot. The CLI cannot safely adopt it; check it with your HQ admin before retrying.`), { expected: true });
|
|
534
|
+
}
|
|
529
535
|
const { result, config } = await adoptRemoteBot({
|
|
530
536
|
bot: remote,
|
|
531
537
|
name,
|