@indigoai-us/hq-cli 5.345.214 → 5.345.215-beta.0

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 (103) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/command-catalog.generated.d.ts +134 -7
  3. package/dist/command-catalog.generated.js +168 -7
  4. package/dist/commands/agents.d.ts +51 -1
  5. package/dist/commands/agents.js +154 -2
  6. package/dist/commands/bot-jobs.d.ts +2 -15
  7. package/dist/commands/bot-jobs.js +2 -94
  8. package/dist/commands/bot-runtime.d.ts +46 -5
  9. package/dist/commands/bot-runtime.js +228 -18
  10. package/dist/commands/bot.d.ts +16 -9
  11. package/dist/commands/bot.js +169 -51
  12. package/dist/commands/cloud.d.ts +66 -13
  13. package/dist/commands/cloud.js +120 -39
  14. package/dist/commands/company-restore.d.ts +23 -0
  15. package/dist/commands/company-restore.js +128 -0
  16. package/dist/commands/company.js +2 -0
  17. package/dist/commands/integrations-connect.d.ts +10 -3
  18. package/dist/commands/integrations-connect.js +87 -13
  19. package/dist/commands/lanes.js +26 -9
  20. package/dist/commands/sources.js +6 -0
  21. package/dist/commands/storage-offload.d.ts +12 -0
  22. package/dist/commands/storage-offload.js +41 -3
  23. package/dist/commands/sync-mode.js +5 -0
  24. package/dist/commands/whoami.js +4 -0
  25. package/dist/lib/bot/config.d.ts +1 -0
  26. package/dist/lib/bot/config.js +10 -0
  27. package/dist/lib/bot/eventbridge-cron.d.ts +22 -0
  28. package/dist/lib/bot/eventbridge-cron.js +104 -0
  29. package/dist/lib/bot/fleet-local.d.ts +33 -1
  30. package/dist/lib/bot/fleet-local.js +215 -31
  31. package/dist/lib/bot/fleet-python.d.ts +3 -0
  32. package/dist/lib/bot/fleet-python.js +34 -4
  33. package/dist/lib/bot/fleet-runtime-sources.d.ts +15 -0
  34. package/dist/lib/bot/fleet-runtime-sources.js +30 -0
  35. package/dist/lib/bot/legacy-provider-login.d.ts +8 -0
  36. package/dist/lib/bot/legacy-provider-login.js +19 -2
  37. package/dist/lib/bot/prompt.js +1 -1
  38. package/dist/lib/bot/readiness.d.ts +8 -0
  39. package/dist/lib/bot/readiness.js +17 -3
  40. package/dist/lib/bot/runtime-auth.d.ts +30 -0
  41. package/dist/lib/bot/runtime-auth.js +94 -3
  42. package/dist/lib/bot/status.d.ts +2 -0
  43. package/dist/lib/capacity/collectors/grok-refresh.d.ts +80 -0
  44. package/dist/lib/capacity/collectors/grok-refresh.js +189 -0
  45. package/dist/lib/capacity/collectors/grok.d.ts +5 -0
  46. package/dist/lib/capacity/collectors/grok.js +56 -5
  47. package/dist/lib/daemon/catalog.js +11 -1
  48. package/dist/lib/db/sqlite-binding.d.ts +1 -0
  49. package/dist/lib/db/sqlite-binding.js +1 -1
  50. package/dist/lib/delivery/artifacts.d.ts +99 -0
  51. package/dist/lib/delivery/artifacts.js +548 -0
  52. package/dist/lib/delivery/backup.d.ts +78 -0
  53. package/dist/lib/delivery/backup.js +343 -0
  54. package/dist/lib/delivery/cache.d.ts +29 -0
  55. package/dist/lib/delivery/cache.js +33 -0
  56. package/dist/lib/delivery/contracts.d.ts +142 -0
  57. package/dist/lib/delivery/contracts.js +289 -0
  58. package/dist/lib/delivery/credentials.d.ts +54 -0
  59. package/dist/lib/delivery/credentials.js +119 -0
  60. package/dist/lib/delivery/enrollment.d.ts +142 -0
  61. package/dist/lib/delivery/enrollment.js +382 -0
  62. package/dist/lib/delivery/identity.d.ts +25 -0
  63. package/dist/lib/delivery/identity.js +82 -0
  64. package/dist/lib/delivery/inbox.d.ts +116 -0
  65. package/dist/lib/delivery/inbox.js +260 -0
  66. package/dist/lib/delivery/migrations.d.ts +139 -0
  67. package/dist/lib/delivery/migrations.js +623 -0
  68. package/dist/lib/delivery/mqtt-adapter.d.ts +50 -0
  69. package/dist/lib/delivery/mqtt-adapter.js +242 -0
  70. package/dist/lib/delivery/mqtt.d.ts +61 -0
  71. package/dist/lib/delivery/mqtt.js +112 -0
  72. package/dist/lib/delivery/outbox.d.ts +95 -0
  73. package/dist/lib/delivery/outbox.js +187 -0
  74. package/dist/lib/delivery/provenance.d.ts +129 -0
  75. package/dist/lib/delivery/provenance.js +93 -0
  76. package/dist/lib/delivery/reconciler.d.ts +151 -0
  77. package/dist/lib/delivery/reconciler.js +492 -0
  78. package/dist/lib/delivery/restore.d.ts +35 -0
  79. package/dist/lib/delivery/restore.js +134 -0
  80. package/dist/lib/delivery/store.d.ts +161 -0
  81. package/dist/lib/delivery/store.js +940 -0
  82. package/dist/lib/delivery/workers/macos-job-helper.d.ts +103 -0
  83. package/dist/lib/delivery/workers/macos-job-helper.js +927 -0
  84. package/dist/lib/delivery/workers/macos.d.ts +176 -0
  85. package/dist/lib/delivery/workers/macos.js +901 -0
  86. package/dist/lib/delivery/workers/windows-boundary.d.ts +453 -0
  87. package/dist/lib/delivery/workers/windows-boundary.js +693 -0
  88. package/dist/lib/delivery/workers/windows-job-helper.d.ts +35 -0
  89. package/dist/lib/delivery/workers/windows-job-helper.js +264 -0
  90. package/dist/lib/delivery/workers/windows.d.ts +241 -0
  91. package/dist/lib/delivery/workers/windows.js +608 -0
  92. package/dist/lib/install/provider-wrappers.d.ts +2 -0
  93. package/dist/lib/install/provider-wrappers.js +68 -3
  94. package/dist/utils/cognito-callback-port.d.ts +14 -0
  95. package/dist/utils/cognito-callback-port.js +24 -0
  96. package/dist/utils/cognito-session.js +3 -3
  97. package/dist/utils/deleted-company-notice.d.ts +59 -0
  98. package/dist/utils/deleted-company-notice.js +156 -0
  99. package/dist/utils/login-browser.d.ts +1 -1
  100. package/dist/utils/login-browser.js +7 -5
  101. package/dist/utils/resident-package-preload.js +30 -15
  102. package/dist/utils/vault-api.js +7 -0
  103. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.345.215-beta.0] — 2026-11-11
6
+ - `hq login`, `hq auth login` and the automatic browser sign-in now show the provider's account chooser, so a person with several Google accounts picks one instead of being signed in with whichever the browser used last. Set `HQ_COGNITO_PROMPT=` (empty) to turn this off. Token refresh is unchanged.
7
+ - When a company you belonged to was deleted, `hq whoami`, `hq sources entities`, `hq sync mode --show` and the "No active company memberships found" error now say so on stderr, with the date and how to get it back.
8
+ - New `hq company restore <company>` restores a company you deleted in the last 30 days, by name, slug or company ID. A restored company comes back without its paid plan. `--json` prints the result as JSON.
9
+ - `hq agents jobs update <agent> <jobId>` (alias `edit`) edits a hosted agent's scheduled job in place: `--prompt` or `--prompt-file`, `--name`, `--cron` (five-field or `cron(...)`/`rate(...)`) or `--at` with a required `--tz`, `--context` / `--clear-context`, `--script-file` / `--clear-script`. Only the options passed change; the job keeps its id and paused/active status, and the change applies from its next run. Owners and admins of the agent's company can use it, the same as pause, resume and cancel. `hq agents jobs delete` is now an alias of `cancel`, which removes a job for good whether it is active or paused. Paused jobs do not count toward an agent's 25 active-job limit. Needs the hq-pro-agents job edit route; an older server answers with a clear "cannot edit jobs yet" line.
10
+ - `hq bot switch-account <name> --runtime <claude|codex> --sign-in` signs the bot in with a login of its own first. It runs a browser sign-in into the bot's own folder (`~/.hq/bots/<name>/auth/<runtime>`), the same login `hq bot login` makes, with no terminal needed. Your own Claude Code or Codex sign-in, and every other bot's login, stay as they are. The desktop app's Switch account uses it.
11
+ - `hq bot switch-account --sign-in` keeps the bot's previous own login until the new browser sign-in finishes. It is not signed out first. A failed, cancelled, or killed sign-in puts that login back; the next attempt does not delete it.
12
+ - `hq integrations connect --client-secret-stdin` (and `--token-stdin`) now print a one-line prompt to stderr and read with input hidden when stdin is a terminal, so the command no longer looks frozen while it waits for the secret. Piped input is unchanged and prints nothing extra (feedback_86a49a5c).
13
+ - `hq integrations connect --auth-header` now applies the same header-name rule as hq-pro: at most 64 characters, and not a header HQ refuses to put a key in (Host, Content-Length, Expect, Content-Encoding, WWW-Authenticate, Cookie, Set-Cookie, Forwarded, Via, X-Real-IP, True-Client-IP, CF-Connecting-IP, X-Original-URL, hop-by-hop headers, HTTP2-Settings, Proxy-Authorization, Proxy-Authenticate, the headers HQ's MCP client sets itself, and any Proxy-* or X-Forwarded-* header). Authorization is still allowed. A pasted key with an inner space is now refused before sending, as hq-pro refuses it for a Bearer or custom-header key. Before, both were sent and came back as a 400 from hq-pro. (feedback_950d8abe)
14
+ - `/capacity` no longer shows Grok as signed out after its six-hour sign-in token lapses. When the stored token has expired and no `grok` process is running, HQ renews it with the stored refresh token and writes it back to `~/.grok/auth.json`. A token that cannot be renewed shows as expired, and a revoked sign-in shows as "signed out: sign-in revoked".
15
+ - `hq lanes create --provider claude --outpost primary` from a machine that is not an Outpost now reads that Outpost's Claude account snapshot and can create the lane there. The capacity probe for that explicit target waits the single-lane pickup interval. A local-target create still does not call `primary`.
16
+ - Setting up the HQ Fleet Runtime is faster. The private Python is now installed while the runtime downloads instead of after it, and its install no longer freezes the progress bar. On a Mac whose bots run under hq daemon, `hq bot create` asks the daemon to start the new bot before it registers the bot's scheduled jobs, so the bot boots while they are registered.
17
+ - When an HQ Fleet Local release bundles the runtime's Python packages for this platform, the bundle downloads with the runtime, is checked against the signed release manifest, and the runtime environment is installed from it offline instead of from PyPI. A bundle that fails its hash check stops the install with an error. A release with no bundle, or a bundle uv cannot install on this computer, uses the PyPI install as before.
18
+ - A new ChatGPT or Grok bot starts the same way as a Claude bot. When this computer already has a Codex CLI login, a Grok CLI login, or another Fleet bot's Grok login, `hq bot create` imports it without a browser before the start step, asks hq daemon to start the bot with the same request, and reports the same setup steps, with `needsSignIn: false`. Only a computer with no reusable login still gets a bot that waits for `hq bot auth`.
19
+ - `hq bot auth-status --provider <claude|chatgpt|grok> --json` prints `{ provider, signedIn, source, ok }` and changes nothing on disk. `signedIn` is true exactly when `hq bot create` with that brain needs no sign-in step; if create then cannot import that login, it fails with a plain message instead of asking for a sign-in. An unknown brain prints `{ ok: false, reason: "unknown-provider" }` and exits 1.
20
+ - `hq bot sign-in --provider <chatgpt|grok> --json` signs this computer in through the brain's own CLI before any bot exists: `codex login` or `grok login --oauth`, or their device-code login with `--no-browser`, whose code it prints as `{"event":"auth","phase":"device-code","verificationUri","userCode"}`. It ends with `{ ok, provider, signedIn, source }`, and on SIGTERM stops the CLI and ends with `reason: "cancelled"`. A later create reuses the login.
21
+ - `hq bot create`, `hq bot auth-status` and `hq bot sign-in` accept the same brain names: `claude`, `codex` or `chatgpt` (the same brain), and `grok`, in any case. `auth-status` and `sign-in` still answer with `provider: "chatgpt"` for that brain.
22
+ - `hq bot create` and `hq bot list` now count a Fleet bot (runtime 0.4.30 or newer) as ready only when its gateway reports running and ready and the bot's `status.json` for the same process also says `ready: true`. Create no longer reports ready about a second before `status.json` does, which made the app show Ready and then Starting again.
23
+ - `hq bot create --json` reports `greeting: { sent, sentAt }`: whether the new bot's first message is already on HQ, read from the time the runtime sent it. For Fleet bots, `hq bot list --json` rows fall back to the same time for `introSentAt`.
24
+ - `hq bot auth <name> --provider claude` on a Fleet bot first checks the Claude Code login on this computer. When it is signed out, it changes nothing and exits 1 with `{ ok: false, provider: "claude", signedIn: false, brainSignIn }`. A successful `hq bot auth --json` now also reports `signedIn: true` and `retried`; `retried` stays false until the runtime can answer the messages it held during the sign-out.
25
+ - For a Fleet bot whose brain is signed out, `hq bot list --json` reports `runtimeSignIn: { state: "signed-out", runtime, since }` (the tool name: claude, codex or grok) and a `brainSignIn`, read from the runtime's `state/sign-in-needed.json` marker. `hq bot auth` leaves such a running bot alone instead of restarting it, because the bot re-checks its login every 5 s and answers the waiting message itself. It waits up to 20 s for the marker to clear and reports `reloaded: true`, `restarted: false` and `retried: true` once it has.
26
+ - A Fleet bot's persona now tells it to look up its owner's companies with the hq_companies_list tool, because `hq whoami` does not list companies.
27
+ - The native `block-hq-glob` port now also answers hq-core-staging's normalizing guard (sha256 925bba9f), which denies a Glob of `<hq>/./`, `<hq>//`, `<hq>/core/..` and other spellings of the HQ root. The engine keeps the hq-core 16.0.46 guard pinned and answers it with its own string comparison, choosing by script hash. The normalizing pin takes effect only once hq-core-staging ships that script.
28
+ - Adds the HQ Native delivery library under `src/lib/delivery` with its tests. It is not connected to any `hq` command, daemon unit or startup path yet, so nothing changes for users. It contains the delivery contracts, a crash-safe store with versioned migrations and a single-controller lock, attempt reconciliation, worker enrollment and tenant-scoped identity, per-job credential planning, an MQTT outbox and inbox for notifications, a contained macOS worker launcher, signed artifact provenance with promotion, and verified backup and restore with authority transfer. The Windows worker launcher is included and fails closed: it refuses every job unless a boundary service is supplied to it, and this release supplies none. `src/lib/db/sqlite-binding.ts` now exports `isNativeBindingError`, and the delivery tests run as their own vitest project, two files at a time.
29
+ - Expired Claude tokens on the capacity card renew again on desktops where `hq daemon` runs the mesh service. That service started in the home folder and received the HQ folder only as a `--hq-root` flag, so the capacity collector's lane and account checks (`hq runners list --json`, `hq runners accounts list --json`) exited with `hq_root_unresolved`, the refresh gate failed closed on every collect, and every Claude account stayed "Token expired". The mesh unit now sets `HQ_ROOT`, as the standalone mesh LaunchAgent did before the move under `hq daemon`.
30
+ - `hq storage offload --current` matches the companies folder by exact case again. On a case-sensitive disk (Linux, Outposts), files under a personal `COMPANIES/<slug>/` folder were treated as that company's files since #2475, and `hq storage fetch` could not restore them; they are now personal files. On a case-insensitive disk (macOS), a companies folder spelled with other letter case on disk is still treated as the companies folder.
31
+ - The HQ Anywhere `claude` and `codex` wrappers in `~/.hq/bin` no longer loop with another tool's wrapper. Typing `claude` in a cmux workspace started cmux's wrapper, which ran HQ's wrapper, which picked cmux's wrapper again from PATH, at about 230 new processes a minute. HQ's wrapper now runs the next `claude` after itself on PATH (never another HQ wrapper), so cmux's wrapper and your own wrappers still run, each once. When that next one is a shell script, the wrapper sets `HQ_ANYWHERE_CLAUDE_WRAPPER_ACTIVE` (`HQ_ANYWHERE_CODEX_WRAPPER_ACTIVE` for codex). If a wrapper runs HQ's wrapper again while that variable is set, HQ's wrapper runs the real executable directly (the first `claude` on PATH that is not a shell script, then `~/.local/bin/claude` and `~/.claude/local/node_modules/.bin/claude`), or stops with exit 127 and a message that every `claude` on PATH is a wrapper. The sign-in check follows the same rule. Run `hq install --global` again to refresh an installed wrapper (feedback ed078ef7).
32
+ - `hq sync status` now takes `--all` to list every local-only file instead of the first 20 per company, and `--json` to print the full status (scope summaries and every local-only list, uncapped) as JSON. The default output is unchanged except that the truncation line now reads "... and N more (use --all to list every file)" (feedback_f29d004a).
33
+
5
34
  ## [5.345.214] — 2026-11-10
6
35
  - `hq agent inbox done` and the `hq_inbox_done` MCP tool now confirm completion before recording it. An id is written to `done-ids.json` only after the server confirms its ack. Until then it is kept in `~/.hq-agent/inbox/ack-pending.json`, which is written before the first ack is sent, so a failed ack or a killed process leaves a record. While it is there, the item stays listed by `hq agent inbox` and `hq_inbox_read` with `ackPending: true`, is marked in the kit wake notice's new `ackPending` list, and is retried by the next inbox read or `done` call. A permanent refusal (HTTP 400, 403 or 404) is not retried: the id moves to `ack-failed.json`, is listed once with `ackFailed` and the reason, and then drops out. A refusal that `done` reports in its own output is not listed again. One listing shows at most 100 of them. `hq_inbox_read` (as `ackFailedMore`) and `hq agent inbox` say how many more wait for the next call. `ack-failed.json` holds at most 5000 records: past that the oldest ones not shown yet are dropped, and the next listing gives their number (`ackFailedDropped`). Refusals are recorded in one write per batch, and an unreadable `ack-failed.json` is moved aside as `ack-failed.json.corrupt-<time>` instead of being overwritten. A 401 (a token problem) and a 409 are not permanent: those ids stay in `ack-pending.json` and are retried. Each ack is bounded and retried once on a transient failure (a lock-held token mint, a 5xx, 408/425/429, a timeout or a dropped connection). A whole batch is bounded by `HQ_AGENT_INBOX_ACK_DEADLINE_MS` (default 60 s), and a read, including its ack retry, returns within 45 s, which stays under the usual 60 s MCP tool timeout. The handled-state files are updated under the inbox lock, so the MCP server and a CLI call cannot drop each other's update. `done` exits 3 when a requested ack is not confirmed and 1 for an invalid id. `--json` (new) and `hq_inbox_done` report `complete`, `ackPending`, `ackFailed`, `ackFailures` and a structured `ackFailureDetails`. `ackFailures` uses the strings `hq_inbox_done` always returned, now one per id: `"<id> (<status>)"` or `"ack skipped: <id>: <message>"`. `marked` now counts only ids whose ack was confirmed, so it can be 0 when acks fail. Before this change, an id was marked done before its ack, so a failed ack hid the item locally while the server kept it pending. Ids already hidden that way before this release stay hidden, because nothing recorded them; the server still lists them as pending. Rerunning `done` is safe because the server ack is idempotent (feedback 3e376c49).
7
36
  - `hq integrations connect <domain>` for an app that will not register HQ automatically (for example `shopify.com`) now prints the callback URL to register and the full `--mcp-url … --client-id … --client-secret-stdin` command, with the endpoint taken from the app's blueprint. Only an MCP surface is used for `--mcp-url`; a blueprint that lists only REST or GraphQL APIs falls back to the console. It used to open the generic Integrations page, which has no control, callback URL or credential form for an app the catalog does not list. With `--json`, every sign-in handoff now prints one JSON line on stdout, told apart by `setup`: `sign-in-link` (`authorizationUrl`), `own-oauth-app` (`callbackUrl`, `command`) or `console` (`url`, `serverAddress`). The console handoff used to print nothing on stdout. `hq integrations connect --help` lists the shapes. (feedback_3013b98e)
@@ -992,6 +992,14 @@ export declare const COMMAND_CATALOG: readonly [{
992
992
  readonly flags: "--company <slug>";
993
993
  readonly description: "Show only this company's journal (company slug)";
994
994
  readonly hidden: false;
995
+ }, {
996
+ readonly flags: "--all";
997
+ readonly description: "List every local-only file instead of the first 20 per company";
998
+ readonly hidden: false;
999
+ }, {
1000
+ readonly flags: "--json";
1001
+ readonly description: "Print the full status as JSON (every list uncapped) instead of text";
1002
+ readonly hidden: false;
995
1003
  }];
996
1004
  readonly subcommands: readonly [];
997
1005
  }, {
@@ -7294,6 +7302,27 @@ export declare const COMMAND_CATALOG: readonly [{
7294
7302
  }];
7295
7303
  readonly options: readonly [];
7296
7304
  readonly subcommands: readonly [];
7305
+ }, {
7306
+ readonly name: "restore";
7307
+ readonly description: "Restore a company you deleted in the last 30 days (name, slug or company ID)";
7308
+ readonly aliases: readonly [];
7309
+ readonly hidden: false;
7310
+ readonly helpOption: true;
7311
+ readonly helpCommand: false;
7312
+ readonly usage: "[options] <company>";
7313
+ readonly helpText: readonly [];
7314
+ readonly arguments: readonly [{
7315
+ readonly name: "company";
7316
+ readonly required: true;
7317
+ readonly variadic: false;
7318
+ readonly description: "";
7319
+ }];
7320
+ readonly options: readonly [{
7321
+ readonly flags: "--json";
7322
+ readonly description: "Print the result as JSON";
7323
+ readonly hidden: false;
7324
+ }];
7325
+ readonly subcommands: readonly [];
7297
7326
  }, {
7298
7327
  readonly name: "settings";
7299
7328
  readonly description: "Per-company settings (owner-only)";
@@ -7901,7 +7930,7 @@ export declare const COMMAND_CATALOG: readonly [{
7901
7930
  readonly subcommands: readonly [];
7902
7931
  }, {
7903
7932
  readonly name: "jobs";
7904
- readonly description: "List, pause, resume, or cancel an agent's scheduled jobs";
7933
+ readonly description: "List, edit, pause, resume, or delete an agent's scheduled jobs";
7905
7934
  readonly aliases: readonly [];
7906
7935
  readonly hidden: false;
7907
7936
  readonly helpOption: true;
@@ -7987,10 +8016,80 @@ export declare const COMMAND_CATALOG: readonly [{
7987
8016
  readonly hidden: false;
7988
8017
  }];
7989
8018
  readonly subcommands: readonly [];
8019
+ }, {
8020
+ readonly name: "update";
8021
+ readonly description: "Edit a job in place (instructions, schedule, name). Only the options you pass change; the job keeps its id and status, and the change applies from the next run.";
8022
+ readonly aliases: readonly ["edit"];
8023
+ readonly hidden: false;
8024
+ readonly helpOption: true;
8025
+ readonly helpCommand: false;
8026
+ readonly usage: "[options] <agentUid> <jobId>";
8027
+ readonly helpText: readonly [];
8028
+ readonly arguments: readonly [{
8029
+ readonly name: "agentUid";
8030
+ readonly required: true;
8031
+ readonly variadic: false;
8032
+ readonly description: "";
8033
+ }, {
8034
+ readonly name: "jobId";
8035
+ readonly required: true;
8036
+ readonly variadic: false;
8037
+ readonly description: "";
8038
+ }];
8039
+ readonly options: readonly [{
8040
+ readonly flags: "--company <slug>";
8041
+ readonly description: "Company slug (to resolve an agent by name/slug)";
8042
+ readonly hidden: false;
8043
+ }, {
8044
+ readonly flags: "--prompt <text>";
8045
+ readonly description: "New instructions";
8046
+ readonly hidden: false;
8047
+ }, {
8048
+ readonly flags: "--prompt-file <path>";
8049
+ readonly description: "Read the new instructions from a file";
8050
+ readonly hidden: false;
8051
+ }, {
8052
+ readonly flags: "--name <label>";
8053
+ readonly description: "Short label for the job";
8054
+ readonly hidden: false;
8055
+ }, {
8056
+ readonly flags: "--cron <expr>";
8057
+ readonly description: "New recurring schedule: \"0 9 * * 1-5\" or cron(...)/rate(...)";
8058
+ readonly hidden: false;
8059
+ }, {
8060
+ readonly flags: "--at <iso8601>";
8061
+ readonly description: "New one-time run instant";
8062
+ readonly hidden: false;
8063
+ }, {
8064
+ readonly flags: "--tz <IANA>";
8065
+ readonly description: "Timezone for --cron/--at (required with them)";
8066
+ readonly hidden: false;
8067
+ }, {
8068
+ readonly flags: "--context <json>";
8069
+ readonly description: "Replace the JSON context handed to the agent at run time";
8070
+ readonly hidden: false;
8071
+ }, {
8072
+ readonly flags: "--clear-context";
8073
+ readonly description: "Remove the job's context";
8074
+ readonly hidden: false;
8075
+ }, {
8076
+ readonly flags: "--script-file <path>";
8077
+ readonly description: "Replace the precondition script with this file";
8078
+ readonly hidden: false;
8079
+ }, {
8080
+ readonly flags: "--clear-script";
8081
+ readonly description: "Remove the job's precondition script";
8082
+ readonly hidden: false;
8083
+ }, {
8084
+ readonly flags: "--json";
8085
+ readonly description: "Emit raw JSON";
8086
+ readonly hidden: false;
8087
+ }];
8088
+ readonly subcommands: readonly [];
7990
8089
  }, {
7991
8090
  readonly name: "cancel";
7992
- readonly description: "Cancel a job and delete its schedule";
7993
- readonly aliases: readonly [];
8091
+ readonly description: "Delete a job for good (active or paused) and its schedule";
8092
+ readonly aliases: readonly ["delete"];
7994
8093
  readonly hidden: false;
7995
8094
  readonly helpOption: true;
7996
8095
  readonly helpCommand: false;
@@ -19575,7 +19674,7 @@ export declare const COMMAND_CATALOG: readonly [{
19575
19674
  readonly hidden: false;
19576
19675
  }, {
19577
19676
  readonly flags: "--provider <provider>";
19578
- readonly description: "HQ Fleet provider: claude|codex|grok (default claude)";
19677
+ readonly description: "HQ Fleet provider: claude|codex|grok, or chatgpt for codex (default claude)";
19579
19678
  readonly hidden: false;
19580
19679
  }, {
19581
19680
  readonly flags: "--hq-fleet-runtime";
@@ -19903,7 +20002,7 @@ export declare const COMMAND_CATALOG: readonly [{
19903
20002
  readonly subcommands: readonly [];
19904
20003
  }, {
19905
20004
  readonly name: "auth-status";
19906
- readonly description: "Say whether a Fleet bot created now would need its own ChatGPT or Grok sign-in, or reuse a login already on this computer";
20005
+ readonly description: "Say whether a bot created now with this brain starts without a sign-in step, reusing a login already on this computer";
19907
20006
  readonly aliases: readonly [];
19908
20007
  readonly hidden: false;
19909
20008
  readonly helpOption: true;
@@ -19913,11 +20012,35 @@ export declare const COMMAND_CATALOG: readonly [{
19913
20012
  readonly arguments: readonly [];
19914
20013
  readonly options: readonly [{
19915
20014
  readonly flags: "--provider <provider>";
19916
- readonly description: "Provider: chatgpt or grok";
20015
+ readonly description: "Brain: claude, codex (or chatgpt) or grok";
19917
20016
  readonly hidden: false;
19918
20017
  }, {
19919
20018
  readonly flags: "--json";
19920
- readonly description: "Print machine-readable JSON: { signedIn }";
20019
+ readonly description: "Print machine-readable JSON: { provider, signedIn, source }";
20020
+ readonly hidden: false;
20021
+ }];
20022
+ readonly subcommands: readonly [];
20023
+ }, {
20024
+ readonly name: "sign-in";
20025
+ readonly description: "Sign this computer in to ChatGPT or Grok through its own CLI, so new bots with that brain start without a sign-in step";
20026
+ readonly aliases: readonly [];
20027
+ readonly hidden: false;
20028
+ readonly helpOption: true;
20029
+ readonly helpCommand: false;
20030
+ readonly usage: "[options]";
20031
+ readonly helpText: readonly [];
20032
+ readonly arguments: readonly [];
20033
+ readonly options: readonly [{
20034
+ readonly flags: "--provider <provider>";
20035
+ readonly description: "Brain: codex (or chatgpt) or grok";
20036
+ readonly hidden: false;
20037
+ }, {
20038
+ readonly flags: "--json";
20039
+ readonly description: "Print one JSON line per event (device code, messages) and a final result";
20040
+ readonly hidden: false;
20041
+ }, {
20042
+ readonly flags: "--no-browser";
20043
+ readonly description: "Use the CLI's device-code login instead of its browser login";
19921
20044
  readonly hidden: false;
19922
20045
  }];
19923
20046
  readonly subcommands: readonly [];
@@ -20053,6 +20176,10 @@ export declare const COMMAND_CATALOG: readonly [{
20053
20176
  readonly flags: "--runtime <runtime>";
20054
20177
  readonly description: "claude|codex|grok";
20055
20178
  readonly hidden: false;
20179
+ }, {
20180
+ readonly flags: "--sign-in";
20181
+ readonly description: "Sign the bot in with a login of its own first (claude, codex): a browser sign-in for this bot only; your own sign-in is not touched";
20182
+ readonly hidden: false;
20056
20183
  }, {
20057
20184
  readonly flags: "--json";
20058
20185
  readonly description: "Print machine-readable JSON";
@@ -1187,6 +1187,16 @@ export const COMMAND_CATALOG = [
1187
1187
  "flags": "--company <slug>",
1188
1188
  "description": "Show only this company's journal (company slug)",
1189
1189
  "hidden": false
1190
+ },
1191
+ {
1192
+ "flags": "--all",
1193
+ "description": "List every local-only file instead of the first 20 per company",
1194
+ "hidden": false
1195
+ },
1196
+ {
1197
+ "flags": "--json",
1198
+ "description": "Print the full status as JSON (every list uncapped) instead of text",
1199
+ "hidden": false
1190
1200
  }
1191
1201
  ],
1192
1202
  "subcommands": []
@@ -8891,6 +8901,32 @@ export const COMMAND_CATALOG = [
8891
8901
  "options": [],
8892
8902
  "subcommands": []
8893
8903
  },
8904
+ {
8905
+ "name": "restore",
8906
+ "description": "Restore a company you deleted in the last 30 days (name, slug or company ID)",
8907
+ "aliases": [],
8908
+ "hidden": false,
8909
+ "helpOption": true,
8910
+ "helpCommand": false,
8911
+ "usage": "[options] <company>",
8912
+ "helpText": [],
8913
+ "arguments": [
8914
+ {
8915
+ "name": "company",
8916
+ "required": true,
8917
+ "variadic": false,
8918
+ "description": ""
8919
+ }
8920
+ ],
8921
+ "options": [
8922
+ {
8923
+ "flags": "--json",
8924
+ "description": "Print the result as JSON",
8925
+ "hidden": false
8926
+ }
8927
+ ],
8928
+ "subcommands": []
8929
+ },
8894
8930
  {
8895
8931
  "name": "settings",
8896
8932
  "description": "Per-company settings (owner-only)",
@@ -9654,7 +9690,7 @@ export const COMMAND_CATALOG = [
9654
9690
  },
9655
9691
  {
9656
9692
  "name": "jobs",
9657
- "description": "List, pause, resume, or cancel an agent's scheduled jobs",
9693
+ "description": "List, edit, pause, resume, or delete an agent's scheduled jobs",
9658
9694
  "aliases": [],
9659
9695
  "hidden": false,
9660
9696
  "helpOption": true,
@@ -9759,10 +9795,101 @@ export const COMMAND_CATALOG = [
9759
9795
  ],
9760
9796
  "subcommands": []
9761
9797
  },
9798
+ {
9799
+ "name": "update",
9800
+ "description": "Edit a job in place (instructions, schedule, name). Only the options you pass change; the job keeps its id and status, and the change applies from the next run.",
9801
+ "aliases": [
9802
+ "edit"
9803
+ ],
9804
+ "hidden": false,
9805
+ "helpOption": true,
9806
+ "helpCommand": false,
9807
+ "usage": "[options] <agentUid> <jobId>",
9808
+ "helpText": [],
9809
+ "arguments": [
9810
+ {
9811
+ "name": "agentUid",
9812
+ "required": true,
9813
+ "variadic": false,
9814
+ "description": ""
9815
+ },
9816
+ {
9817
+ "name": "jobId",
9818
+ "required": true,
9819
+ "variadic": false,
9820
+ "description": ""
9821
+ }
9822
+ ],
9823
+ "options": [
9824
+ {
9825
+ "flags": "--company <slug>",
9826
+ "description": "Company slug (to resolve an agent by name/slug)",
9827
+ "hidden": false
9828
+ },
9829
+ {
9830
+ "flags": "--prompt <text>",
9831
+ "description": "New instructions",
9832
+ "hidden": false
9833
+ },
9834
+ {
9835
+ "flags": "--prompt-file <path>",
9836
+ "description": "Read the new instructions from a file",
9837
+ "hidden": false
9838
+ },
9839
+ {
9840
+ "flags": "--name <label>",
9841
+ "description": "Short label for the job",
9842
+ "hidden": false
9843
+ },
9844
+ {
9845
+ "flags": "--cron <expr>",
9846
+ "description": "New recurring schedule: \"0 9 * * 1-5\" or cron(...)/rate(...)",
9847
+ "hidden": false
9848
+ },
9849
+ {
9850
+ "flags": "--at <iso8601>",
9851
+ "description": "New one-time run instant",
9852
+ "hidden": false
9853
+ },
9854
+ {
9855
+ "flags": "--tz <IANA>",
9856
+ "description": "Timezone for --cron/--at (required with them)",
9857
+ "hidden": false
9858
+ },
9859
+ {
9860
+ "flags": "--context <json>",
9861
+ "description": "Replace the JSON context handed to the agent at run time",
9862
+ "hidden": false
9863
+ },
9864
+ {
9865
+ "flags": "--clear-context",
9866
+ "description": "Remove the job's context",
9867
+ "hidden": false
9868
+ },
9869
+ {
9870
+ "flags": "--script-file <path>",
9871
+ "description": "Replace the precondition script with this file",
9872
+ "hidden": false
9873
+ },
9874
+ {
9875
+ "flags": "--clear-script",
9876
+ "description": "Remove the job's precondition script",
9877
+ "hidden": false
9878
+ },
9879
+ {
9880
+ "flags": "--json",
9881
+ "description": "Emit raw JSON",
9882
+ "hidden": false
9883
+ }
9884
+ ],
9885
+ "subcommands": []
9886
+ },
9762
9887
  {
9763
9888
  "name": "cancel",
9764
- "description": "Cancel a job and delete its schedule",
9765
- "aliases": [],
9889
+ "description": "Delete a job for good (active or paused) and its schedule",
9890
+ "aliases": [
9891
+ "delete"
9892
+ ],
9766
9893
  "hidden": false,
9767
9894
  "helpOption": true,
9768
9895
  "helpCommand": false,
@@ -23871,7 +23998,7 @@ export const COMMAND_CATALOG = [
23871
23998
  },
23872
23999
  {
23873
24000
  "flags": "--provider <provider>",
23874
- "description": "HQ Fleet provider: claude|codex|grok (default claude)",
24001
+ "description": "HQ Fleet provider: claude|codex|grok, or chatgpt for codex (default claude)",
23875
24002
  "hidden": false
23876
24003
  },
23877
24004
  {
@@ -24276,7 +24403,7 @@ export const COMMAND_CATALOG = [
24276
24403
  },
24277
24404
  {
24278
24405
  "name": "auth-status",
24279
- "description": "Say whether a Fleet bot created now would need its own ChatGPT or Grok sign-in, or reuse a login already on this computer",
24406
+ "description": "Say whether a bot created now with this brain starts without a sign-in step, reusing a login already on this computer",
24280
24407
  "aliases": [],
24281
24408
  "hidden": false,
24282
24409
  "helpOption": true,
@@ -24287,12 +24414,41 @@ export const COMMAND_CATALOG = [
24287
24414
  "options": [
24288
24415
  {
24289
24416
  "flags": "--provider <provider>",
24290
- "description": "Provider: chatgpt or grok",
24417
+ "description": "Brain: claude, codex (or chatgpt) or grok",
24291
24418
  "hidden": false
24292
24419
  },
24293
24420
  {
24294
24421
  "flags": "--json",
24295
- "description": "Print machine-readable JSON: { signedIn }",
24422
+ "description": "Print machine-readable JSON: { provider, signedIn, source }",
24423
+ "hidden": false
24424
+ }
24425
+ ],
24426
+ "subcommands": []
24427
+ },
24428
+ {
24429
+ "name": "sign-in",
24430
+ "description": "Sign this computer in to ChatGPT or Grok through its own CLI, so new bots with that brain start without a sign-in step",
24431
+ "aliases": [],
24432
+ "hidden": false,
24433
+ "helpOption": true,
24434
+ "helpCommand": false,
24435
+ "usage": "[options]",
24436
+ "helpText": [],
24437
+ "arguments": [],
24438
+ "options": [
24439
+ {
24440
+ "flags": "--provider <provider>",
24441
+ "description": "Brain: codex (or chatgpt) or grok",
24442
+ "hidden": false
24443
+ },
24444
+ {
24445
+ "flags": "--json",
24446
+ "description": "Print one JSON line per event (device code, messages) and a final result",
24447
+ "hidden": false
24448
+ },
24449
+ {
24450
+ "flags": "--no-browser",
24451
+ "description": "Use the CLI's device-code login instead of its browser login",
24296
24452
  "hidden": false
24297
24453
  }
24298
24454
  ],
@@ -24460,6 +24616,11 @@ export const COMMAND_CATALOG = [
24460
24616
  "description": "claude|codex|grok",
24461
24617
  "hidden": false
24462
24618
  },
24619
+ {
24620
+ "flags": "--sign-in",
24621
+ "description": "Sign the bot in with a login of its own first (claude, codex): a browser sign-in for this bot only; your own sign-in is not touched",
24622
+ "hidden": false
24623
+ },
24463
24624
  {
24464
24625
  "flags": "--json",
24465
24626
  "description": "Print machine-readable JSON",
@@ -369,6 +369,56 @@ export declare function listAgentJobs(token: string, agentUid: string): Promise<
369
369
  export declare function pauseAgentJob(token: string, agentUid: string, jobId: string): Promise<PauseJobResult>;
370
370
  export declare function resumeAgentJob(token: string, agentUid: string, jobId: string): Promise<ResumeJobResult>;
371
371
  export declare function cancelAgentJob(token: string, agentUid: string, jobId: string): Promise<CancelJobResult>;
372
+ /** In-place edit body for `POST /v1/agents/{uid}/jobs/{jobId}/update`. */
373
+ export interface JobUpdateBody {
374
+ name?: string;
375
+ prompt?: string;
376
+ context?: Record<string, unknown> | null;
377
+ script?: string | null;
378
+ schedule?: {
379
+ kind: "recurring";
380
+ cron: string;
381
+ timezone: string;
382
+ } | {
383
+ kind: "once";
384
+ at: string;
385
+ timezone: string;
386
+ };
387
+ }
388
+ export interface UpdateJobResult {
389
+ job: {
390
+ jobId: string;
391
+ } & Record<string, unknown>;
392
+ changed: string[];
393
+ appliesFrom?: string;
394
+ /** Set when the edit saved but the new schedule has not reached the scheduler yet. */
395
+ warning?: string;
396
+ }
397
+ export declare function updateAgentJob(token: string, agentUid: string, jobId: string, body: JobUpdateBody): Promise<UpdateJobResult>;
398
+ export interface JobUpdateOptions {
399
+ name?: string;
400
+ prompt?: string;
401
+ cron?: string;
402
+ at?: string;
403
+ tz?: string;
404
+ context?: string;
405
+ clearContext?: boolean;
406
+ script?: string;
407
+ clearScript?: boolean;
408
+ }
409
+ /**
410
+ * Build the edit body from `hq agents jobs update` flags. Pure: file reads
411
+ * (`--prompt-file`, `--script-file`) happen before this is called. Throws a
412
+ * plain Error with operator copy on a bad combination.
413
+ *
414
+ * `--cron` takes the stored six-field `cron(...)`/`rate(...)` form verbatim
415
+ * or a standard five-field expression, translated with the same rules local
416
+ * bot jobs use. A schedule change needs an explicit `--tz`: defaulting to
417
+ * the operator's machine zone would silently move a job that runs in another
418
+ * zone. `--tz` on its own is refused.
419
+ */
420
+ export declare function buildJobUpdateBody(opts: JobUpdateOptions, translateCron: (expr: string) => string): JobUpdateBody;
421
+ export declare function formatUpdateResult(result: UpdateJobResult): string;
372
422
  /**
373
423
  * Map a jobs-control HTTP error to a single operator-facing line. Pure so the
374
424
  * status/code → copy mapping is unit-tested without a process exit.
@@ -378,7 +428,7 @@ export declare function cancelAgentJob(token: string, agentUid: string, jobId: s
378
428
  * the agent is cross-company) must print a clear message and exit non-zero,
379
429
  * never throw a stack trace.
380
430
  */
381
- export declare function formatJobsHttpError(err: AgentsHttpError, jobId?: string, action?: "resume"): string;
431
+ export declare function formatJobsHttpError(err: AgentsHttpError, jobId?: string, action?: "resume" | "update"): string;
382
432
  /** Stable padEnd table: jobId, scheduleState, rate, lastRunOutcome, status. */
383
433
  export declare function formatJobsTable(jobs: AgentJobView[]): string;
384
434
  export declare function formatPauseResult(result: PauseJobResult): string;