@indigoai-us/hq-cli 5.113.0 → 5.113.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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.113.1] — 2026-09-15
6
+
7
+ ### Fixed
8
+
9
+ - A bot can create a bot for its owner. `hq bot` commands (create, list, rm,
10
+ promote) always act as the signed-in person, even when a bot runs them; they
11
+ used the bot's own identity, which can own no bot, so the setup bot told
12
+ people to open a terminal to create their first bot.
13
+
5
14
  ## [5.113.0] — 2026-09-15
6
15
 
7
16
  ### Added
@@ -27,7 +27,7 @@ import * as fs from "node:fs";
27
27
  import * as path from "node:path";
28
28
  import * as readline from "node:readline";
29
29
  import { DEFAULT_COGNITO, ensureCognitoToken, resolveDefaultHqRoot, } from "../utils/cognito-session.js";
30
- import { resolveVaultCredential } from "../utils/resolve-vault-credential.js";
30
+ import { peekHqApiKey } from "../utils/resolve-vault-credential.js";
31
31
  import { resolveCallerPersonUid } from "../utils/vault-api.js";
32
32
  import { resolveHqBinary } from "../lib/mesh/live/daemon/install.js";
33
33
  import { BotApi, BotApiError, botDaemonStatus, botDir, botCredsPath, botLogPath, botsRoot, botTokenStateDir, botWorkerRelDir, buildBotDaemonPaths, createBotLogger, deleteBotCreds, installBotDaemon, introDmText, isBotMemoryMode, botLocalMemoryDir, botMemoryMode, resolveBotMemoryDir, validateBotIntro, validateBotKickoff, validateBotEffort, validateBotModel, effectiveBotEffort, BOT_EFFORT_LEVELS, DEFAULT_BOT_EFFORT, BOT_MEMORY_MODES, isBotRuntimeId, isPidAlive, listBotWorkerOptions, patchBotConfig, readBotConfig, readBotCredsIdentity, readBotStatus, resolveBotWorker, runBot, runtimeFor, scaffoldBotMemory, scaffoldBotWorker, startBotDaemon, stopBotDaemon, uninstallBotDaemon, validateBotName, writeBotConfig, writeBotCreds, BOT_RUNTIMES, BOT_INTRO_MAX_CHARS, BOT_KICKOFF_MAX_CHARS, } from "../lib/bot/index.js";
@@ -88,15 +88,18 @@ export function botTokenSupplier(dir) {
88
88
  return () => ensureCognitoToken({ tokenSource: "machine", interactive: false });
89
89
  }
90
90
  async function ownerToken(interactive = process.stdin.isTTY === true) {
91
- // Under the desktop app (no TTY) never open a browser login; the app owns
92
- // sign-in and shares the same cached session file.
93
- const cred = await resolveVaultCredential({ interactive });
94
- if (cred.kind !== "cognito") {
91
+ if (peekHqApiKey()) {
95
92
  throw Object.assign(new Error("hq bot needs your HQ login session (HQ_API_KEY is not supported here). Run `hq login`."), {
96
93
  expected: true,
97
94
  });
98
95
  }
99
- return cred.token;
96
+ // Bots belong to a person, so `hq bot` always acts as the signed-in person,
97
+ // even when a bot runs it: a bot's own process exports its machine
98
+ // credentials, and a machine identity can own no bot ("No person entity
99
+ // found"), which left a setup bot unable to create its owner's first bot.
100
+ // Under the desktop app (no TTY) never open a browser login; the app owns
101
+ // sign-in and shares the same cached session file.
102
+ return ensureCognitoToken({ tokenSource: "person", interactive });
100
103
  }
101
104
  function rowFor(name, opts = {}) {
102
105
  const dir = botDir(name);
@@ -253,6 +253,7 @@ export function buildSystemPrompt(input) {
253
253
  `Their HQ folder is ${input.hqRoot}; it is your working directory, so its files, skills, and \`hq\` commands are available directly.\n` +
254
254
  `\`hq\` commands you run authenticate as you, the bot (${input.agentUid}), not as your owner: \`hq whoami\`, membership and company lookups describe the bot, ` +
255
255
  `and a bot usually belongs to no company. Never use them to say who your owner is or which companies they belong to. ` +
256
+ `The exception is \`hq bot\` (create, list, rm, promote): it always acts as your owner, so you can create a bot for them when they ask; its owner is your owner. ` +
256
257
  `Direct messages from your owner start with an "Owner context" block checked with your owner's own sign-in; that is the only source for your owner's companies. ` +
257
258
  `If it says the check failed, say you could not check; never say your owner has no company unless that block says so. ` +
258
259
  `Room messages do not carry it: in a room, never state which companies your owner belongs to.\n` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.113.0",
3
+ "version": "5.113.1",
4
4
  "description": "HQ by Indigo management CLI \u2014 modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {