@indigoai-us/hq-cli 5.345.219 → 5.345.221
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 +170 -0
- package/dist/command-catalog.generated.d.ts +169 -3
- package/dist/command-catalog.generated.js +206 -3
- package/dist/commands/auth.js +4 -1
- package/dist/commands/bot-runtime.d.ts +18 -5
- package/dist/commands/bot-runtime.js +29 -12
- package/dist/commands/bot.d.ts +85 -0
- package/dist/commands/bot.js +245 -16
- package/dist/commands/cloud.d.ts +16 -0
- package/dist/commands/cloud.js +112 -102
- package/dist/commands/core-checkpoint-native.d.ts +13 -0
- package/dist/commands/core-checkpoint-native.js +167 -52
- package/dist/commands/core-hook-registration-plan.js +5 -4
- package/dist/commands/core-stop-autosave.d.ts +21 -0
- package/dist/commands/core-stop-autosave.js +300 -0
- package/dist/commands/core.js +2 -0
- package/dist/commands/daemon.d.ts +5 -0
- package/dist/commands/daemon.js +52 -9
- package/dist/commands/doctor-usage.d.ts +5 -0
- package/dist/commands/doctor-usage.js +25 -0
- package/dist/commands/env.d.ts +49 -4
- package/dist/commands/env.js +355 -5
- package/dist/commands/integrations.js +84 -3
- package/dist/commands/lanes-shared.d.ts +3 -0
- package/dist/commands/lanes.d.ts +3 -0
- package/dist/commands/lanes.js +87 -3
- package/dist/commands/packs.js +23 -0
- package/dist/commands/pkg-update.d.ts +6 -0
- package/dist/commands/pkg-update.js +15 -7
- package/dist/commands/run.js +55 -45
- package/dist/commands/sources.js +4 -3
- package/dist/commands/sync-core.d.ts +1 -0
- package/dist/commands/sync-core.js +77 -3
- package/dist/commands/whoami.js +96 -80
- package/dist/lib/bot/config.d.ts +17 -0
- package/dist/lib/bot/config.js +13 -0
- package/dist/lib/bot/fleet-cron.js +29 -4
- package/dist/lib/bot/fleet-local.d.ts +30 -2
- package/dist/lib/bot/fleet-local.js +60 -1
- package/dist/lib/bot/grok-login-scope.d.ts +36 -0
- package/dist/lib/bot/grok-login-scope.js +93 -0
- package/dist/lib/bot/inflight.d.ts +9 -0
- package/dist/lib/bot/jobs/hot-signal-sync.d.ts +51 -0
- package/dist/lib/bot/jobs/hot-signal-sync.js +90 -9
- package/dist/lib/bot/legacy-provider-login.d.ts +32 -9
- package/dist/lib/bot/legacy-provider-login.js +28 -22
- package/dist/lib/bot/run.d.ts +29 -5
- package/dist/lib/bot/run.js +203 -1
- package/dist/lib/bot/runtime-sign-in-check.js +6 -1
- package/dist/lib/bot/runtime-sign-in.d.ts +2 -0
- package/dist/lib/bot/signals-try-now.d.ts +76 -0
- package/dist/lib/bot/signals-try-now.js +111 -0
- package/dist/lib/capacity/collectors/claude-oauth.d.ts +22 -3
- package/dist/lib/capacity/collectors/claude-oauth.js +78 -22
- package/dist/lib/capacity/scheduler.d.ts +8 -0
- package/dist/lib/capacity/scheduler.js +5 -2
- package/dist/lib/core-utils/sentry-report.js +2 -0
- package/dist/lib/daemon/machine-checks.d.ts +22 -1
- package/dist/lib/daemon/machine-checks.js +54 -12
- package/dist/lib/daemon/run.js +71 -8
- package/dist/lib/daemon/runtime-notifications.d.ts +7 -0
- package/dist/lib/daemon/runtime-notifications.js +50 -0
- package/dist/lib/daemon/stop-autosave-lock.d.ts +19 -0
- package/dist/lib/daemon/stop-autosave-lock.js +166 -0
- package/dist/lib/daemon/stop-autosave.d.ts +28 -0
- package/dist/lib/daemon/stop-autosave.js +111 -0
- package/dist/lib/daemon/stop-diagnostics.d.ts +11 -0
- package/dist/lib/daemon/stop-diagnostics.js +136 -0
- package/dist/lib/daemon/stop-job-executor.d.ts +19 -0
- package/dist/lib/daemon/stop-job-executor.js +126 -0
- package/dist/lib/daemon/stop-jobs.d.ts +93 -0
- package/dist/lib/daemon/stop-jobs.js +599 -0
- package/dist/lib/doctor/checks/fleet-hook-core.d.ts +9 -1
- package/dist/lib/doctor/checks/fleet-hook-core.js +39 -15
- package/dist/lib/doctor/checks/host-core.js +1 -1
- package/dist/lib/environment/access-probes.d.ts +234 -0
- package/dist/lib/environment/access-probes.js +918 -0
- package/dist/lib/environment/profile.d.ts +15 -2
- package/dist/lib/environment/profile.js +55 -20
- package/dist/lib/environment/rfc3339.d.ts +8 -0
- package/dist/lib/environment/rfc3339.js +26 -0
- package/dist/lib/environment/work-requirements.d.ts +169 -0
- package/dist/lib/environment/work-requirements.js +389 -0
- package/dist/lib/hook-engine/coverage.d.ts +137 -7
- package/dist/lib/hook-engine/coverage.js +1424 -4
- package/dist/lib/hook-engine/fleet-registration.d.ts +17 -5
- package/dist/lib/hook-engine/fleet-registration.js +53 -17
- package/dist/lib/hook-engine/git-stop-config.json +513 -0
- package/dist/lib/hook-engine/native-stop-compatibility.json +311 -0
- package/dist/lib/hook-engine/reconcile.js +2 -2
- package/dist/lib/hot-channels/alert.d.ts +10 -1
- package/dist/lib/hot-channels/alert.js +38 -8
- package/dist/lib/hot-channels/signals-claude-login.d.ts +53 -0
- package/dist/lib/hot-channels/signals-claude-login.js +96 -0
- package/dist/lib/hot-channels/signals-pass.d.ts +143 -17
- package/dist/lib/hot-channels/signals-pass.js +324 -17
- package/dist/lib/hot-channels/signals-runtime.d.ts +30 -0
- package/dist/lib/hot-channels/signals-runtime.js +82 -0
- package/dist/lib/install/hook-target.js +1 -1
- package/dist/lib/lanes/host-capacity.d.ts +26 -2
- package/dist/lib/lanes/host-capacity.js +17 -2
- package/dist/lib/lanes/host-compute.d.ts +90 -0
- package/dist/lib/lanes/host-compute.js +185 -0
- package/dist/lib/lanes/index.d.ts +2 -0
- package/dist/lib/lanes/index.js +1 -0
- package/dist/lib/lanes/reconcile.js +22 -1
- package/dist/lib/lanes/resource-usage.d.ts +155 -0
- package/dist/lib/lanes/resource-usage.js +589 -0
- package/dist/lib/lanes/run-size.d.ts +46 -0
- package/dist/lib/lanes/run-size.js +197 -0
- package/dist/lib/lanes/store.js +27 -0
- package/dist/lib/lanes/throttle.d.ts +36 -1
- package/dist/lib/lanes/throttle.js +47 -10
- package/dist/lib/lanes/types.d.ts +40 -0
- package/dist/lib/lanes/types.js +2 -2
- package/dist/lib/lanes/watcher.js +13 -4
- package/dist/lib/lanes/worker-process.d.ts +25 -2
- package/dist/lib/lanes/worker-process.js +71 -19
- package/dist/lib/placement/match.d.ts +192 -0
- package/dist/lib/placement/match.js +667 -0
- package/dist/lib/safe-store.d.ts +14 -0
- package/dist/lib/safe-store.js +77 -4
- package/dist/lib/search-index/index.d.ts +88 -4
- package/dist/lib/search-index/index.js +299 -25
- package/dist/lib/search-index/max-doc-bytes.d.ts +17 -6
- package/dist/lib/search-index/max-doc-bytes.js +48 -23
- package/dist/lib/signals/codex-lockdown.d.ts +79 -0
- package/dist/lib/signals/codex-lockdown.js +271 -0
- package/dist/lib/signals/codex-login.d.ts +37 -0
- package/dist/lib/signals/codex-login.js +83 -0
- package/dist/lib/signals/engine.d.ts +28 -0
- package/dist/lib/signals/engine.js +77 -0
- package/dist/lib/signals/reply.d.ts +48 -0
- package/dist/lib/signals/reply.js +94 -12
- package/dist/lib/signals/run-record.js +6 -1
- package/dist/lib/signals/settings.d.ts +5 -0
- package/dist/lib/signals/settings.js +2 -0
- package/dist/lib/signals/steps/adapters.js +6 -0
- package/dist/lib/signals/steps/extract.d.ts +135 -12
- package/dist/lib/signals/steps/extract.js +416 -84
- package/dist/lib/signals/steps/types.d.ts +21 -0
- package/dist/lib/sync-core/engine-home.d.ts +41 -2
- package/dist/lib/sync-core/engine-home.js +132 -19
- package/dist/lib/sync-core/reconcile.js +1 -1
- package/dist/lib/sync-core/release-compare.d.ts +7 -0
- package/dist/lib/sync-core/release-compare.js +16 -0
- package/dist/lib/sync-core/release.d.ts +2 -1
- package/dist/lib/sync-core/release.js +2 -10
- package/dist/lib/sync-core/rollout-state.d.ts +2 -1
- package/dist/lib/sync-core/rollout-state.js +5 -2
- package/dist/lib/sync-core/vault-uid.d.ts +2 -0
- package/dist/lib/sync-core/vault-uid.js +4 -0
- package/dist/run/schema-env-overrides.d.ts +24 -0
- package/dist/run/schema-env-overrides.js +72 -0
- package/dist/schemas/hq-work-requirements.v1.schema.json +145 -0
- package/dist/utils/auth-session-check.d.ts +16 -0
- package/dist/utils/auth-session-check.js +16 -0
- package/dist/utils/client-health-contract.d.ts +6 -0
- package/dist/utils/client-health-contract.js +13 -0
- package/dist/utils/client-health.d.ts +7 -0
- package/dist/utils/client-health.js +22 -1
- package/dist/utils/command-usage.d.ts +40 -0
- package/dist/utils/command-usage.js +61 -0
- package/dist/utils/duplicate-command-usage.d.ts +72 -0
- package/dist/utils/duplicate-command-usage.js +125 -0
- package/dist/utils/host-registration.d.ts +1 -1
- package/dist/utils/host-registration.js +6 -1
- package/dist/utils/resident-package-preload.js +4 -0
- package/dist/utils/sentry-fingerprint.js +9 -0
- package/dist/utils/windows-bash.d.ts +2 -0
- package/dist/utils/windows-bash.js +2 -1
- package/package.json +15 -10
- package/scripts/bench-core-compare.mjs +313 -0
- package/scripts/bench-core.mjs +399 -12
- package/scripts/check-function-manifest.mjs +121 -7
- package/dist/commands/__fixtures__/access-vault.d.ts +0 -95
- package/dist/commands/__fixtures__/access-vault.js +0 -166
- package/dist/commands/__fixtures__/make-tar.d.ts +0 -38
- package/dist/commands/__fixtures__/make-tar.js +0 -102
- package/dist/commands/secrets-public-types.test-d.d.ts +0 -2
- package/dist/commands/secrets-public-types.test-d.js +0 -18
- package/dist/lib/decisions/fixtures/us001.d.ts +0 -137
- package/dist/lib/decisions/fixtures/us001.js +0 -21
- package/dist/lib/doctor/__testing__/fake-hq-tree.d.ts +0 -226
- package/dist/lib/doctor/__testing__/fake-hq-tree.js +0 -408
- package/dist/lib/doctor/__testing__/run-doctor.d.ts +0 -8
- package/dist/lib/doctor/__testing__/run-doctor.js +0 -69
- package/dist/lib/fingerprint/fixtures.d.ts +0 -19
- package/dist/lib/fingerprint/fixtures.js +0 -61
- package/dist/lib/hot-channels/adapters/__fixtures__/dummy.d.ts +0 -33
- package/dist/lib/hot-channels/adapters/__fixtures__/dummy.js +0 -53
- package/dist/lib/hot-channels/adapters/__fixtures__/meeting-providers.d.ts +0 -38
- package/dist/lib/hot-channels/adapters/__fixtures__/meeting-providers.js +0 -64
- package/dist/lib/mesh/live/daemon/mqtt-events.test-d.d.ts +0 -2
- package/dist/lib/mesh/live/daemon/mqtt-events.test-d.js +0 -10
- package/dist/lib/test-utils/isolated-flag-company-context.d.ts +0 -3
- package/dist/lib/test-utils/isolated-flag-company-context.js +0 -18
- package/scripts/hook-engine-manifest.mjs +0 -22
- package/scripts/mesh-daemon-if-stale.mjs +0 -20
package/dist/commands/bot.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { withLocalJobs } from "../lib/bot/local-jobs.js";
|
|
2
2
|
import { clearFleetMoveRecords, fleetMoveHoldPath, fleetMoveRecentlyFailed, holdReportDue, legacyConversionDecision, legacyHoldFailureReport, legacyHoldNotice, legacyHoldNotifiesOwner, legacyMoveState, ownerHoldNoticeDue, readFleetMoveFailure, readFleetMoveHold, writeFleetMoveFailure, writeFleetMoveHold, } from "../lib/bot/legacy-convert.js";
|
|
3
|
-
import { legacyProviderLoginProbe } from "../lib/bot/legacy-provider-login.js";
|
|
3
|
+
import { legacyProviderLoginProbe, newBotLoginScope } from "../lib/bot/legacy-provider-login.js";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { CLI_VERSION } from "../cli-version.js";
|
|
6
|
+
import { BOT_SIGNALS_RUNTIME_SETTINGS, signalsPassRuntime } from "../lib/bot/config.js";
|
|
6
7
|
import { runSignals } from "../lib/signals/engine.js";
|
|
7
8
|
// The main bot's runtime, the same one the signals engine's extract step uses.
|
|
8
|
-
import { defaultResolveBotRuntime } from "../lib/signals/steps/extract.js";
|
|
9
9
|
import { BOT_SIGNALS_ENGINE_JOB_FLAG, signalsEngineForJob } from "../lib/bot/signals-engine-flag.js";
|
|
10
10
|
import { resolveProcessFlagGate } from "../lib/flag-registry.js";
|
|
11
|
-
import { currentHotSignalSyncCompany, readActiveCompanySlug, registerHotSignalSyncOnStart, runHotSignalSyncJob } from "../lib/bot/jobs/hot-signal-sync.js";
|
|
12
|
-
import { createClaudeSignalsPass } from "../lib/hot-channels/signals-pass.js";
|
|
11
|
+
import { currentHotSignalSyncCompany, hasScheduledBriefJob, hotSignalSyncJobCompanies, readActiveCompanySlug, registerHotSignalSyncOnStart, runHotSignalSyncJob } from "../lib/bot/jobs/hot-signal-sync.js";
|
|
12
|
+
import { CLAUDE_SIGN_IN_STEPS, CODEX_SIGN_IN_STEPS, codexBotSignalsOptInCommand, createClaudeSignalsPass } from "../lib/hot-channels/signals-pass.js";
|
|
13
|
+
import { executiveSignalsRuntimeOptions, signalsPassCodexLogin } from "../lib/hot-channels/signals-runtime.js";
|
|
14
|
+
import { checkClaudeLoginNow, readSignalsClaudeLogin, recordSignalsPassClaudeLogin } from "../lib/hot-channels/signals-claude-login.js";
|
|
13
15
|
import { machineTimeZone } from "../lib/bot/job-run.js";
|
|
14
16
|
import { runCompanyHotChannelSync } from "./sources.js";
|
|
15
17
|
import { OwnerContextCache, lookupOwnerContext } from "../lib/bot/owner-context.js";
|
|
@@ -81,7 +83,7 @@ import { clearPendingSwitch, recoverPendingSwitchSafely, writePendingSwitch } fr
|
|
|
81
83
|
import { classifyRuntimeFailure, isRuntimeUsageLimit, runtimeFailureReason, usageLimitResetsAt } from "../lib/bot/runtime-failure.js";
|
|
82
84
|
import { PROBE_DEFAULT_TIMEOUT_MS, probeBotRuntime } from "../lib/bot/probe.js";
|
|
83
85
|
import { BOT_LOGIN_RUNTIMES, botAuthEnv, botRuntimeAuth, capacityAccountHome, defaultSpawnBrowserSignIn, describeBotAuth, formatBotAuth, isBotLoginRuntime, restoreBotSessions, setAsideBotSessions, discardHeldBotLogin, holdPreviousBotLogin, restoreHeldBotLogin, signInBotRuntime, signOutBotRuntime, withRuntimeAuth, } from "../lib/bot/runtime-auth.js";
|
|
84
|
-
import { BotApi, BotApiError, BOT_RESTORE_DEFAULTS, buildBotLocalConfig, describeBotLocalConfig, orphanBotRunMessage, parseBotLocalConfig, removeOrphanBotDaemon, botDaemonStatus, botDir, botCredsPath, botLogPath, botsRoot, botTokenStateDir, botWorkerRelDir, buildBotDaemonPaths, createBotLogger, deleteBotCreds, installBotDaemon, repairBotDaemonIfStale, healBotDaemonNodeFromJob, introDmText, isBotMemoryMode, botLocalMemoryDir, botMemoryMode, resolveBotMemoryDir, validateBotIntro, validateBotDisplayName, validateBotKickoff, validateBotEffort, validateBotModel, effectiveBotEffort, BOT_EFFORT_LEVELS, DEFAULT_BOT_EFFORT, BOT_MEMORY_MODES, BOT_KINDS, isBotKind, effectiveBotKind, effectiveBotCompanies, normalizeBotCompanies, SETUP_BOT_WORKER_ID, isBotRuntimeId, botRuntimeFromBrainName, localNameForRemoteBot, remoteBotRunnability, isPidAlive, listBotWorkerOptions, patchBotConfig, readBotConfig, readBotCredsIdentity, readBotStatus, patchBotStatus, runtimeCrashSinceStart, resolveBotWorker, runBot, runtimeFor, scaffoldBotMemory, scaffoldBotWorker, startBotDaemon, stopBotDaemon, uninstallBotDaemon, validateBotName, writeBotConfig, writeBotCreds, BOT_RUNTIMES, BOT_INTRO_MAX_CHARS, BOT_DISPLAY_NAME_MAX_CHARS, BOT_KICKOFF_MAX_CHARS, detectBotPlatform, withBotLock, localBotRole, remoteBotRole, remoteBotDisplayName, personFacingName, writeCloudDisplayName, setupSlugFor, ASSISTANT_ROLE, HQ_FLEET_RUNTIME_ENGINE_ID, HQ_FLEET_LOCAL_RELEASE, authenticateFleetLocalBot, bootstrapFleetLocalBot, buildSystemPrompt, controlFleetBot as controlFleetLocalBot, ensureFleetBotDaemon, FleetDaemonStoppedError, fleetBotUnitId, fleetBotsManagedByDaemon, fleetLocalGatewayPid, fleetLocalProfileNeedsAdoption, fleetLocalServiceInstalled, fleetProviderForRuntime, importFleetLocalMachineCredential, importFleetLocalProviderLogin, fleetProviderNeedsSignIn, fleetOwnerCompanies, refreshFleetLocalInstructions, fleetLocalPromotionRuntime, installPinnedFleetLocalDistribution, installTargetFleetLocalDistribution, resolveFleetLocalPointerTarget, resolveFleetLocalTargetRelease, fleetLocalProfileDir, fleetProfileOwnerCompanies, fleetLocalChannels, readFleetLocalGatewayState, readFleetLocalIntroSentAt, readFleetLocalSignInNeeded, readPromptSources, removeFleetLocalBot, } from "../lib/bot/index.js";
|
|
86
|
+
import { BotApi, BotApiError, BOT_RESTORE_DEFAULTS, buildBotLocalConfig, describeBotLocalConfig, orphanBotRunMessage, parseBotLocalConfig, removeOrphanBotDaemon, botDaemonStatus, botDir, botCredsPath, botLogPath, botsRoot, botTokenStateDir, botWorkerRelDir, buildBotDaemonPaths, createBotLogger, deleteBotCreds, installBotDaemon, repairBotDaemonIfStale, healBotDaemonNodeFromJob, introDmText, isBotMemoryMode, botLocalMemoryDir, botMemoryMode, resolveBotMemoryDir, validateBotIntro, validateBotDisplayName, validateBotKickoff, validateBotEffort, validateBotModel, effectiveBotEffort, BOT_EFFORT_LEVELS, DEFAULT_BOT_EFFORT, BOT_MEMORY_MODES, BOT_KINDS, isBotKind, effectiveBotKind, effectiveBotCompanies, normalizeBotCompanies, SETUP_BOT_WORKER_ID, isBotRuntimeId, botRuntimeFromBrainName, localNameForRemoteBot, remoteBotRunnability, isPidAlive, listBotWorkerOptions, patchBotConfig, readBotConfig, readBotCredsIdentity, readBotStatus, patchBotStatus, runtimeCrashSinceStart, resolveBotWorker, runBot, runtimeFor, scaffoldBotMemory, scaffoldBotWorker, startBotDaemon, stopBotDaemon, uninstallBotDaemon, validateBotName, writeBotConfig, writeBotCreds, BOT_RUNTIMES, BOT_INTRO_MAX_CHARS, BOT_DISPLAY_NAME_MAX_CHARS, BOT_KICKOFF_MAX_CHARS, detectBotPlatform, withBotLock, localBotRole, remoteBotRole, remoteBotDisplayName, personFacingName, writeCloudDisplayName, setupSlugFor, ASSISTANT_ROLE, HQ_FLEET_RUNTIME_ENGINE_ID, HQ_FLEET_LOCAL_RELEASE, authenticateFleetLocalBot, bootstrapFleetLocalBot, buildSystemPrompt, controlFleetBot as controlFleetLocalBot, ensureFleetBotDaemon, FleetDaemonStoppedError, fleetBotUnitId, fleetBotsManagedByDaemon, fleetLocalGatewayPid, fleetLocalProfileNeedsAdoption, fleetLocalServiceInstalled, fleetProviderForRuntime, importFleetLocalMachineCredential, importFleetLocalProviderLogin, fleetAuthUsesXaiOauthLogin, xaiOauthLoginHeldBack, xaiOauthLoginRefusal, fleetProviderNeedsSignIn, fleetOwnerCompanies, refreshFleetLocalInstructions, fleetLocalPromotionRuntime, installPinnedFleetLocalDistribution, installTargetFleetLocalDistribution, resolveFleetLocalPointerTarget, resolveFleetLocalTargetRelease, fleetLocalProfileDir, fleetProfileOwnerCompanies, fleetLocalChannels, readFleetLocalGatewayState, readFleetLocalIntroSentAt, readFleetLocalSignInNeeded, readPromptSources, removeFleetLocalBot, } from "../lib/bot/index.js";
|
|
85
87
|
import { gatedInteractiveLogin } from "../utils/interactive-caller.js";
|
|
86
88
|
import { brainSignInStatus, fleetInstallProgressReporter, fleetRuntimeStatus, runBotAuthStatus, runBotRuntimeInstall, runBotRuntimeStatus, runBotSignIn } from "./bot-runtime.js";
|
|
87
89
|
import { ensureFleetRuntimeInstalled } from "../lib/bot/fleet-local.js";
|
|
@@ -510,6 +512,139 @@ export function runtimeSignedIn(status, processAlive) {
|
|
|
510
512
|
return false;
|
|
511
513
|
return status.runtimeSignInCheck?.signedIn ?? null;
|
|
512
514
|
}
|
|
515
|
+
/** The live check `hq bot status` / `list` run once per call. Tests replace it. */
|
|
516
|
+
export const signalsClaudeSeams = {
|
|
517
|
+
check: () => checkClaudeLoginNow(),
|
|
518
|
+
};
|
|
519
|
+
/**
|
|
520
|
+
* `signalsClaudeSignIn` for a row, for a bot with the hot-signal-sync job:
|
|
521
|
+
* the live check when given and it answered, the last signals pass's record
|
|
522
|
+
* as secondary context and as the fallback. Never runs `claude` itself.
|
|
523
|
+
*/
|
|
524
|
+
export function signalsClaudeSignInFor(dir, fleet, record = readSignalsClaudeLogin(), live = null) {
|
|
525
|
+
const companies = hotSignalSyncJobCompanies(dir, { fleet });
|
|
526
|
+
if (companies.length === 0)
|
|
527
|
+
return null;
|
|
528
|
+
// Signals take their runtime from the Executive bot, as the pass does
|
|
529
|
+
// (signals-runtime.ts). When that is a Codex bot that opted in, no Claude
|
|
530
|
+
// Code login is needed; the Codex line stands in (signalsCodexRuntimeLine).
|
|
531
|
+
const executiveBot = resolveExecutiveBot();
|
|
532
|
+
const source = executiveBot?.config ?? null;
|
|
533
|
+
const executiveDir = executiveBot?.dir ?? null;
|
|
534
|
+
if (signalsPassRuntime(source) === "codex")
|
|
535
|
+
return null;
|
|
536
|
+
const signedOutSince = record && !record.signedIn ? (record.signedOutSince ?? record.checkedAt) : null;
|
|
537
|
+
const liveAnswer = live && live.signedIn !== null ? live.signedIn : null;
|
|
538
|
+
const signedIn = liveAnswer ?? record?.signedIn ?? null;
|
|
539
|
+
const basis = liveAnswer !== null ? "live" : record ? "last-signals-pass" : "none";
|
|
540
|
+
const queuedDocsHint = liveAnswer === true && record?.signedIn === false
|
|
541
|
+
? `queued documents run at the next sync, or run ${companies.map((c) => `\`hq sources sync --company ${c}\``).join(" or ")} now`
|
|
542
|
+
: null;
|
|
543
|
+
return {
|
|
544
|
+
companies,
|
|
545
|
+
signedIn,
|
|
546
|
+
basis,
|
|
547
|
+
liveCheck: live,
|
|
548
|
+
lastSignalsPass: record ? { signedIn: record.signedIn, checkedAt: record.checkedAt, signedOutSince } : null,
|
|
549
|
+
checkedAt: record?.checkedAt ?? null,
|
|
550
|
+
source: record?.source ?? null,
|
|
551
|
+
signedOutSince,
|
|
552
|
+
queuedDocsHint,
|
|
553
|
+
// A Codex Executive bot's owner hears about switching signals to that bot
|
|
554
|
+
// first, with the Claude sign-in as the alternative. `command` stays the
|
|
555
|
+
// Claude sign-in command it always was, for readers of the JSON.
|
|
556
|
+
// The switch is offered only when the Executive bot qualifies (a Codex bot
|
|
557
|
+
// with its own Codex login, not on the Fleet runtime: signalsCodexLogin);
|
|
558
|
+
// the Claude sign-in comes first, as the fix that works now.
|
|
559
|
+
fix: source && executiveDir && signalsPassCodexLogin(executiveDir, source).ok
|
|
560
|
+
? `${CLAUDE_SIGN_IN_STEPS} Or run signals on ${source.name}'s own Codex: \`${codexBotSignalsOptInCommand(source.name)}\`.`
|
|
561
|
+
: CLAUDE_SIGN_IN_STEPS,
|
|
562
|
+
command: signInCommand("claude"),
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Run the live check once for this status call, only when some row has the
|
|
567
|
+
* signals job, and fill it into those rows. Never throws: a failed check
|
|
568
|
+
* leaves the rows on the last signals pass's record and says so.
|
|
569
|
+
*/
|
|
570
|
+
async function decorateSignalsClaudeLive(rows) {
|
|
571
|
+
const targets = rows.filter((row) => row.signalsClaudeSignIn !== null);
|
|
572
|
+
if (targets.length === 0)
|
|
573
|
+
return;
|
|
574
|
+
let live;
|
|
575
|
+
try {
|
|
576
|
+
live = await signalsClaudeSeams.check();
|
|
577
|
+
}
|
|
578
|
+
catch (err) {
|
|
579
|
+
live = { signedIn: null, checkedAt: new Date().toISOString(), error: err instanceof Error ? err.message : String(err) };
|
|
580
|
+
}
|
|
581
|
+
const record = readSignalsClaudeLogin();
|
|
582
|
+
for (const row of targets) {
|
|
583
|
+
row.signalsClaudeSignIn = signalsClaudeSignInFor(row.dir, row.engine === HQ_FLEET_RUNTIME_ENGINE_ID, record, live);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
/** The status lines for the Claude Code login signals needs: the answer first, the last signals pass as context. */
|
|
587
|
+
export function signalsClaudeSignInLines(s) {
|
|
588
|
+
const forWhat = `(hot-channel signals for ${s.companies.join(", ")})`;
|
|
589
|
+
const state = s.signedIn === true
|
|
590
|
+
? chalk.green("Claude Code signed in")
|
|
591
|
+
: s.signedIn === false
|
|
592
|
+
? chalk.yellow("Claude Code signed out")
|
|
593
|
+
: chalk.gray("Claude Code sign-in unknown");
|
|
594
|
+
const how = s.basis === "live"
|
|
595
|
+
? "checked now"
|
|
596
|
+
: s.liveCheck?.error
|
|
597
|
+
? `live check failed (${s.liveCheck.error}); from the last signals pass`
|
|
598
|
+
: s.basis === "last-signals-pass"
|
|
599
|
+
? "from the last signals pass"
|
|
600
|
+
: "not checked";
|
|
601
|
+
const lines = [`${state} ${forWhat} ${chalk.dim(how)}${s.signedIn === false ? ` - ${s.fix}` : ""}`];
|
|
602
|
+
const last = s.lastSignalsPass;
|
|
603
|
+
if (last) {
|
|
604
|
+
lines.push(chalk.dim(`signals last saw Claude Code ${last.signedIn ? "signed in" : "signed out"} at ${last.checkedAt}${!last.signedIn && last.signedOutSince && last.signedOutSince !== last.checkedAt ? ` (since ${last.signedOutSince})` : ""}`));
|
|
605
|
+
}
|
|
606
|
+
if (s.queuedDocsHint)
|
|
607
|
+
lines.push(s.queuedDocsHint);
|
|
608
|
+
return lines;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* The tool the signals pass runs on for a bot with the hot-signal-sync job
|
|
612
|
+
* (null without the job): the Executive bot's choice, as in the pass.
|
|
613
|
+
*/
|
|
614
|
+
export function signalsRuntimeFor(dir, fleet) {
|
|
615
|
+
if (hotSignalSyncJobCompanies(dir, { fleet }).length === 0)
|
|
616
|
+
return null;
|
|
617
|
+
return signalsPassRuntime(resolveExecutiveBot()?.config ?? null);
|
|
618
|
+
}
|
|
619
|
+
/** The Codex login the pass uses when signals run on Codex (signalsCodexLogin), else null. */
|
|
620
|
+
export function signalsCodexHomeFor(dir, fleet) {
|
|
621
|
+
if (signalsRuntimeFor(dir, fleet) !== "codex")
|
|
622
|
+
return null;
|
|
623
|
+
const executive = resolveExecutiveBot();
|
|
624
|
+
if (!executive)
|
|
625
|
+
return null;
|
|
626
|
+
const login = signalsPassCodexLogin(executive.dir, executive.config);
|
|
627
|
+
return login.ok && "codexHome" in login ? login.codexHome : null;
|
|
628
|
+
}
|
|
629
|
+
/** Why the Executive bot's Codex login cannot run signals, when signals are set to run on it; else null. */
|
|
630
|
+
export function signalsCodexRefusalFor(dir, fleet) {
|
|
631
|
+
if (signalsRuntimeFor(dir, fleet) !== "codex")
|
|
632
|
+
return null;
|
|
633
|
+
const executive = resolveExecutiveBot();
|
|
634
|
+
if (!executive)
|
|
635
|
+
return null;
|
|
636
|
+
const login = signalsPassCodexLogin(executive.dir, executive.config);
|
|
637
|
+
return login.ok ? null : login.reason;
|
|
638
|
+
}
|
|
639
|
+
/** The status line for a bot whose signals run on its own Codex: the bot's own sign-in answer. */
|
|
640
|
+
export function signalsCodexRuntimeLine(companies, runtimeSignedIn) {
|
|
641
|
+
const forWhat = `(hot-channel signals for ${companies.join(", ")}, on the bot's own runtime)`;
|
|
642
|
+
if (runtimeSignedIn === true)
|
|
643
|
+
return `${chalk.green("Codex signed in")} ${forWhat}`;
|
|
644
|
+
if (runtimeSignedIn === false)
|
|
645
|
+
return `${chalk.yellow("Codex signed out")} ${forWhat} - ${CODEX_SIGN_IN_STEPS}`;
|
|
646
|
+
return `${chalk.gray("Codex sign-in unknown")} ${forWhat} ${chalk.dim("the running bot checks it")}`;
|
|
647
|
+
}
|
|
513
648
|
/**
|
|
514
649
|
* `brainUsage` for a row. A model-CLI bot records it itself (status.brainUsage);
|
|
515
650
|
* a Fleet bot's last failure carries the runtime's `brain_usage`, and an older
|
|
@@ -635,6 +770,9 @@ function rowFor(name, opts = {}) {
|
|
|
635
770
|
...(fleet && config.fleetAuthPending === true ? { needsSignIn: true, authCommand: fleetAuthCommand(name, config) } : {}),
|
|
636
771
|
...(fleet && config.fleetServiceInstallPending === true ? { needsSignIn: false, serviceInstallPending: true } : {}),
|
|
637
772
|
signInCommand: fleet ? fleetAuthCommand(name, config) : signInCommand(config.runtime),
|
|
773
|
+
signalsClaudeSignIn: signalsClaudeSignInFor(dir, fleet),
|
|
774
|
+
signalsRuntime: signalsRuntimeFor(dir, fleet),
|
|
775
|
+
signalsCodexHome: signalsCodexHomeFor(dir, fleet),
|
|
638
776
|
brainSignIn: brainSignInFor(name, config, status, legacy),
|
|
639
777
|
brainUsage: brainUsageFor(config, status),
|
|
640
778
|
...(legacy ? { legacy: legacyStatusJson(legacy) } : {}),
|
|
@@ -1156,6 +1294,8 @@ export const botCreateSeams = {
|
|
|
1156
1294
|
importBrainLogin: (agentUid, runtime) => {
|
|
1157
1295
|
importFleetLocalProviderLogin(agentUid, runtime);
|
|
1158
1296
|
},
|
|
1297
|
+
/** The same question the helper call asks itself: would a Grok account sign-in for this bot copy a login it may not share? */
|
|
1298
|
+
grokSiblingLogin: (config) => xaiOauthLoginHeldBack(config.agentUid),
|
|
1159
1299
|
runtimeStatus: fleetRuntimeStatus,
|
|
1160
1300
|
installRuntime: ensureFleetRuntimeInstalled,
|
|
1161
1301
|
waitForReady: waitForGatewayReady,
|
|
@@ -1666,7 +1806,7 @@ async function runBotCreateLocked(name, opts) {
|
|
|
1666
1806
|
const steps = createSetupStepReporter(opts.json ? (opts.progress ? "json" : "silent") : "text");
|
|
1667
1807
|
const fleetTarget = await resolveFleetLocalTargetRelease();
|
|
1668
1808
|
const brainLogin = fleetProviderNeedsSignIn(fleetProvider)
|
|
1669
|
-
? await botCreateSeams.brainSignIn(runtime === "grok" ? "grok" : "chatgpt", { target: async () => fleetTarget })
|
|
1809
|
+
? await botCreateSeams.brainSignIn(runtime === "grok" ? "grok" : "chatgpt", { target: async () => fleetTarget, scope: newBotLoginScope(kind, companies) })
|
|
1670
1810
|
: null;
|
|
1671
1811
|
const fleetAuthPending = brainLogin !== null && !brainLogin.signedIn;
|
|
1672
1812
|
if (opts.start !== false && brainLogin?.signedIn === true)
|
|
@@ -1928,6 +2068,7 @@ async function runBotCreateLocked(name, opts) {
|
|
|
1928
2068
|
effort: null,
|
|
1929
2069
|
provider: fleetProvider.id,
|
|
1930
2070
|
needsSignIn: fleetAuthPending,
|
|
2071
|
+
...(fleetAuthPending && brainLogin?.blocked ? { signInBlocked: brainLogin.blocked } : {}),
|
|
1931
2072
|
...(fleetAuthPending ? { authCommand: fleetAuthCommand(name, config) } : {}),
|
|
1932
2073
|
};
|
|
1933
2074
|
if (!opts.json) {
|
|
@@ -1940,7 +2081,11 @@ async function runBotCreateLocked(name, opts) {
|
|
|
1940
2081
|
console.log(chalk.dim(` memory: ${scaffold.memoryDir} (${memoryMode})`));
|
|
1941
2082
|
console.log(chalk.dim(` state: ${dir}`));
|
|
1942
2083
|
console.log(chalk.dim(` profile: ${fleetProfile}`));
|
|
1943
|
-
if (fleetAuthPending) {
|
|
2084
|
+
if (fleetAuthPending && brainLogin?.blocked) {
|
|
2085
|
+
console.log(chalk.yellow(` no Grok sign-in was reused: ${brainLogin.blocked}.`));
|
|
2086
|
+
console.log(chalk.yellow(` sign it in with an xAI API key before it can answer: hq bot auth ${name} --provider grok --api-key (reads the key from stdin: paste it and press Ctrl-D, or pipe it in)`));
|
|
2087
|
+
}
|
|
2088
|
+
else if (fleetAuthPending) {
|
|
1944
2089
|
console.log(chalk.yellow(` sign it in before it can answer: hq bot auth ${name} --provider ${runtime === "grok" ? "grok" : "chatgpt"}`));
|
|
1945
2090
|
}
|
|
1946
2091
|
if (daemonStopped)
|
|
@@ -2102,18 +2247,26 @@ async function runBotResident(nameArg) {
|
|
|
2102
2247
|
// the first sync starts in the background right after the job is created.
|
|
2103
2248
|
// US-006: a fired job runs the signals engine (garden -> adapters ->
|
|
2104
2249
|
// extract -> garden -> upload) and replies in the storyboarded format.
|
|
2105
|
-
const
|
|
2106
|
-
// The engine is gated default-off (cli.bot-signals-engine-job); with the
|
|
2107
|
-
// flag off the job runs the hot-channel sync alone, as before US-006.
|
|
2108
|
-
signalsEngineForJob(runSignals).then((signals) => runHotSignalSyncJob({
|
|
2250
|
+
const hotSignalSyncJob = (input, signals) => runHotSignalSyncJob({
|
|
2109
2251
|
...input,
|
|
2110
2252
|
hqRoot: config.hqRoot,
|
|
2111
2253
|
timeZone: input.timeZone ?? machineTimeZone(),
|
|
2254
|
+
// This local bot replies in the owner's HQ DM, which the desktop app
|
|
2255
|
+
// shows: the reply links today's brief with hq-desktop://brief (US-023).
|
|
2256
|
+
desktopLinks: true,
|
|
2257
|
+
// Read per run, so a brief job added or removed since start counts.
|
|
2258
|
+
briefJobScheduled: hasScheduledBriefJob(dir),
|
|
2112
2259
|
...(signals ? { signals } : {}),
|
|
2113
2260
|
sync: (syncInput) => runCompanyHotChannelSync({ hqRoot: config.hqRoot, ...syncInput }),
|
|
2114
2261
|
// A new pass per run: the login preflight and the 20-document cap are per run.
|
|
2115
|
-
|
|
2116
|
-
|
|
2262
|
+
// The runtime comes from the Executive bot, as on main for the wording
|
|
2263
|
+
// (defaultResolveBotRuntime) and as in `hq sources sync`: Claude Code
|
|
2264
|
+
// unless that bot is a Codex bot with signalsRuntime "bot".
|
|
2265
|
+
signalsPass: createClaudeSignalsPass({ hqRoot: config.hqRoot, company: input.company, ...executiveSignalsRuntimeOptions(), onClaudeLogin: recordSignalsPassClaudeLogin }),
|
|
2266
|
+
});
|
|
2267
|
+
// The engine is gated default-off (cli.bot-signals-engine-job); with the
|
|
2268
|
+
// flag off the job runs the hot-channel sync alone, as before US-006.
|
|
2269
|
+
const runHotSignalSync = (input) => signalsEngineForJob(runSignals).then((signals) => hotSignalSyncJob(input, signals));
|
|
2117
2270
|
// Prefer the Executive bot for daily hot-channel sync. Other personal bots
|
|
2118
2271
|
// keep their company covered until the Executive has a replacement job.
|
|
2119
2272
|
// Identity only (never the executive.enabled opt-in); with no personal bot
|
|
@@ -2137,6 +2290,15 @@ async function runBotResident(nameArg) {
|
|
|
2137
2290
|
runtime: runtimeFor(config.runtime),
|
|
2138
2291
|
ownerContext: () => owner.get(),
|
|
2139
2292
|
hotSignalSync: (input) => runHotSignalSync(input),
|
|
2293
|
+
// US-006 AC9: the member's "Try now" runs the same entry point as the job,
|
|
2294
|
+
// as `--trigger chat --force`, behind the same cli.bot-signals-engine-job
|
|
2295
|
+
// flag. Flag off: null, and the message goes to the model as before.
|
|
2296
|
+
signalsTryNow: async () => {
|
|
2297
|
+
const signals = await signalsEngineForJob(runSignals);
|
|
2298
|
+
if (!signals)
|
|
2299
|
+
return null;
|
|
2300
|
+
return (input) => hotSignalSyncJob({ ...input, catchUp: false, tryNow: true }, signals);
|
|
2301
|
+
},
|
|
2140
2302
|
// US-005: decision picks in the owner DM, with the bot's own machine token
|
|
2141
2303
|
// (never the owner's login).
|
|
2142
2304
|
decisions: new DecisionsClient(token),
|
|
@@ -2190,6 +2352,7 @@ async function runBotList(opts) {
|
|
|
2190
2352
|
const executiveBot = resolveExecutiveBot();
|
|
2191
2353
|
const rows = listBotNames(botsRoot()).map((n) => rowFor(n, { executiveBot }));
|
|
2192
2354
|
await decorateOnline(rows);
|
|
2355
|
+
await decorateSignalsClaudeLive(rows);
|
|
2193
2356
|
if (opts.json) {
|
|
2194
2357
|
console.log(JSON.stringify({
|
|
2195
2358
|
bots: rows,
|
|
@@ -2306,6 +2469,7 @@ async function runBotStatus(nameArg, opts) {
|
|
|
2306
2469
|
const legacy = fleet ? null : legacyMoveState(dir, config, legacyConvertSeams.providerLogin(dir, config));
|
|
2307
2470
|
const row = rowFor(name, { legacy });
|
|
2308
2471
|
await decorateOnline([row]);
|
|
2472
|
+
await decorateSignalsClaudeLive([row]);
|
|
2309
2473
|
const status = readBotStatus(dir);
|
|
2310
2474
|
const creds = readBotCredsIdentity(dir);
|
|
2311
2475
|
const channels = fleet ? fleetLocalChannels(readFleetLocalGatewayState(config.agentUid), row.processAlive) : null;
|
|
@@ -2338,6 +2502,17 @@ async function runBotStatus(nameArg, opts) {
|
|
|
2338
2502
|
console.log(` readiness: ${row.readiness === "ready" ? chalk.green(`ready${row.readyAt ? ` since ${row.readyAt}` : ""}`) : row.readiness === "offline" ? chalk.gray("offline") : chalk.yellow(row.readiness)}`);
|
|
2339
2503
|
if (row.needsSignIn)
|
|
2340
2504
|
console.log(` sign-in: required (${row.authCommand})`);
|
|
2505
|
+
if (row.signalsClaudeSignIn) {
|
|
2506
|
+
signalsClaudeSignInLines(row.signalsClaudeSignIn).forEach((line, i) => console.log(` ${i === 0 ? "signals: " : " "}${line}`));
|
|
2507
|
+
}
|
|
2508
|
+
else if (row.signalsRuntime === "codex") {
|
|
2509
|
+
// The Executive bot's own check answers for its Codex; for any other bot it is not known here.
|
|
2510
|
+
const own = resolveExecutiveBot()?.name === name;
|
|
2511
|
+
const refusal = signalsCodexRefusalFor(dir, fleet);
|
|
2512
|
+
console.log(refusal
|
|
2513
|
+
? ` signals: ${chalk.yellow("set to run on Codex, but that login cannot be used")} - ${refusal}. Signals fail until it is fixed, or run \`hq bot set ${resolveExecutiveBot()?.name ?? name} --signals-runtime claude\`.`
|
|
2514
|
+
: ` signals: ${signalsCodexRuntimeLine(hotSignalSyncJobCompanies(dir, { fleet }), own ? row.runtimeSignedIn : null)}`);
|
|
2515
|
+
}
|
|
2341
2516
|
if (row.brainUsage.state === "exhausted") {
|
|
2342
2517
|
console.log(` usage: ${chalk.yellow(`out of usage${row.brainUsage.resetsAt ? `, resets ${row.brainUsage.resetsAt}` : ""}`)} — switch account: hq bot switch-account ${name} --runtime <claude|codex|grok>`);
|
|
2343
2518
|
}
|
|
@@ -2749,8 +2924,21 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2749
2924
|
const { name, dir, config } = requireBot(nameArg);
|
|
2750
2925
|
if (hasPromotionHold(dir))
|
|
2751
2926
|
throw new Error("This bot is held for cloud promotion. Continue its promotion before changing local settings or lifecycle.");
|
|
2752
|
-
if (opts.runtime === undefined && opts.account === undefined && opts.model === undefined && opts.effort === undefined && opts.displayName === undefined) {
|
|
2753
|
-
throw Object.assign(new Error("Nothing to change: pass --runtime <runtime>, --account <id|default>, --model <id|default>, --effort <level|default> and/or --
|
|
2927
|
+
if (opts.runtime === undefined && opts.account === undefined && opts.model === undefined && opts.effort === undefined && opts.displayName === undefined && opts.signalsRuntime === undefined) {
|
|
2928
|
+
throw Object.assign(new Error("Nothing to change: pass --runtime <runtime>, --account <id|default>, --model <id|default>, --effort <level|default>, --display-name <name> and/or --signals-runtime <bot|claude>."), { expected: true });
|
|
2929
|
+
}
|
|
2930
|
+
const signalsRuntime = opts.signalsRuntime !== undefined ? validateSignalsRuntimeSetting(config.runtime, opts.signalsRuntime) : undefined;
|
|
2931
|
+
if (signalsRuntime === "bot") {
|
|
2932
|
+
// The pass reads the opt-in from the Executive bot only (signals-runtime.ts),
|
|
2933
|
+
// and uses the login signalsCodexLogin names, which must exist.
|
|
2934
|
+
const login = signalsPassCodexLogin(dir, config);
|
|
2935
|
+
if (!login.ok)
|
|
2936
|
+
throw Object.assign(new Error(`Signals cannot run on ${name}'s Codex: ${login.reason}`), { expected: true });
|
|
2937
|
+
const executive = resolveExecutiveBot();
|
|
2938
|
+
if (executive?.name !== name) {
|
|
2939
|
+
throw Object.assign(new Error(`Signals take their runtime from the Executive bot${executive ? ` (${executive.name})` : ""}. ` +
|
|
2940
|
+
`Make ${name} the Executive bot with \`hq bot eb ${name}\` first, or set this on the Executive bot.`), { expected: true });
|
|
2941
|
+
}
|
|
2754
2942
|
}
|
|
2755
2943
|
if (opts.runtime !== undefined && !isBotRuntimeId(opts.runtime)) {
|
|
2756
2944
|
throw Object.assign(new Error(`--runtime must be one of ${BOT_RUNTIMES.join(", ")}`), { expected: true });
|
|
@@ -2760,6 +2948,9 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2760
2948
|
if ((switching || opts.account !== undefined) && opts.displayName !== undefined) {
|
|
2761
2949
|
throw Object.assign(new Error("Change --display-name on its own, not together with --runtime or --account."), { expected: true });
|
|
2762
2950
|
}
|
|
2951
|
+
if ((switching || opts.account !== undefined) && signalsRuntime !== undefined) {
|
|
2952
|
+
throw Object.assign(new Error("Change --signals-runtime on its own, not together with --runtime or --account."), { expected: true });
|
|
2953
|
+
}
|
|
2763
2954
|
let runtimeAuth = config.runtimeAuth;
|
|
2764
2955
|
if (opts.account !== undefined) {
|
|
2765
2956
|
const id = opts.account.trim();
|
|
@@ -2782,6 +2973,9 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2782
2973
|
patch.model = validateBotModel(opts.model) || undefined;
|
|
2783
2974
|
if (opts.effort !== undefined)
|
|
2784
2975
|
patch.effort = validateBotEffort(config.runtime, opts.effort) || undefined;
|
|
2976
|
+
// "claude" is the default, so it is stored as no key at all.
|
|
2977
|
+
if (signalsRuntime !== undefined)
|
|
2978
|
+
patch.signalsRuntime = signalsRuntime === "bot" ? "bot" : undefined;
|
|
2785
2979
|
const displayName = opts.displayName !== undefined ? validateBotDisplayName(opts.displayName) : undefined;
|
|
2786
2980
|
let nameSaved = null;
|
|
2787
2981
|
if (displayName !== undefined) {
|
|
@@ -2798,7 +2992,7 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2798
2992
|
patch.displayName = displayName;
|
|
2799
2993
|
}
|
|
2800
2994
|
const next = patchBotConfig(dir, patch);
|
|
2801
|
-
createBotLogger(dir)("info", `settings: model=${next.model ?? "default"} effort=${effectiveBotEffort(next)}${next.effort ? "" : " (default)"}${displayName !== undefined ? ` name="${displayName}"` : ""}`);
|
|
2995
|
+
createBotLogger(dir)("info", `settings: model=${next.model ?? "default"} effort=${effectiveBotEffort(next)}${next.effort ? "" : " (default)"}${displayName !== undefined ? ` name="${displayName}"` : ""}${signalsRuntime !== undefined ? ` signals=${signalsPassRuntime(next)}` : ""}`);
|
|
2802
2996
|
const status = readBotStatus(dir);
|
|
2803
2997
|
let running = !!status && isPidAlive(status.pid) && status.state === "running";
|
|
2804
2998
|
let restarted = false;
|
|
@@ -2821,6 +3015,7 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2821
3015
|
effortIsDefault: !next.effort,
|
|
2822
3016
|
effortLevels: BOT_EFFORT_LEVELS[config.runtime],
|
|
2823
3017
|
displayName: next.displayName ?? null,
|
|
3018
|
+
signalsRuntime: signalsPassRuntime(next),
|
|
2824
3019
|
role: localBotRole(next),
|
|
2825
3020
|
nameSaved,
|
|
2826
3021
|
running,
|
|
@@ -2837,6 +3032,11 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2837
3032
|
if (opts.model !== undefined || opts.effort !== undefined) {
|
|
2838
3033
|
console.log(chalk.green(`${name} now thinks with ${result.model ?? "the default model"} at ${result.effort} effort (from its next message).`));
|
|
2839
3034
|
}
|
|
3035
|
+
if (signalsRuntime !== undefined) {
|
|
3036
|
+
console.log(chalk.green(signalsPassRuntime(next) === "codex"
|
|
3037
|
+
? `${name}'s hot-channel signals now run on its own Codex (from the next sync).`
|
|
3038
|
+
: `${name}'s hot-channel signals run on Claude Code (from the next sync).`));
|
|
3039
|
+
}
|
|
2840
3040
|
if (displayName !== undefined) {
|
|
2841
3041
|
const where = nameSaved === "local-only" ? " (kept on this computer; HQ does not take names yet)" : "";
|
|
2842
3042
|
const how = restarted
|
|
@@ -2849,6 +3049,23 @@ async function runBotSetLocked(nameArg, opts, deps = {}) {
|
|
|
2849
3049
|
console.log(chalk.green(`${name} is now called ${displayName}`) + chalk.dim(`${where}${how}`));
|
|
2850
3050
|
}
|
|
2851
3051
|
}
|
|
3052
|
+
/**
|
|
3053
|
+
* `--signals-runtime`: "bot" only for a Codex bot (a Claude bot already runs
|
|
3054
|
+
* signals on Claude Code, and Grok has no isolated signals call yet);
|
|
3055
|
+
* "claude" for any bot.
|
|
3056
|
+
*/
|
|
3057
|
+
export function validateSignalsRuntimeSetting(runtime, value) {
|
|
3058
|
+
const v = value.trim().toLowerCase();
|
|
3059
|
+
if (!BOT_SIGNALS_RUNTIME_SETTINGS.includes(v)) {
|
|
3060
|
+
throw Object.assign(new Error(`--signals-runtime must be one of ${BOT_SIGNALS_RUNTIME_SETTINGS.join(", ")}`), { expected: true });
|
|
3061
|
+
}
|
|
3062
|
+
if (v === "bot" && runtime !== "codex") {
|
|
3063
|
+
throw Object.assign(new Error(runtime === "claude"
|
|
3064
|
+
? "This bot runs on Claude Code, so its signals already run on its own runtime. Nothing to change."
|
|
3065
|
+
: `--signals-runtime bot is only for Codex bots; this bot runs on ${runtime}, so its signals stay on Claude Code.`), { expected: true });
|
|
3066
|
+
}
|
|
3067
|
+
return v;
|
|
3068
|
+
}
|
|
2852
3069
|
/**
|
|
2853
3070
|
* `hq bot set --runtime/--account`: probe the new setup first (nothing changes
|
|
2854
3071
|
* when it cannot answer), stop a running bot, back up bot.json and set the
|
|
@@ -3266,6 +3483,13 @@ export async function runBotAuth(nameArg, opts) {
|
|
|
3266
3483
|
if (opts.apiKey && !apiKey) {
|
|
3267
3484
|
throw Object.assign(new Error("No API key was received on stdin."), { expected: true });
|
|
3268
3485
|
}
|
|
3486
|
+
// Decided on the provider the name resolves to (grok, xai, xai-oauth, any case), before the profile
|
|
3487
|
+
// install and the stop below. authenticateFleetLocalBot asks again right before the helper call.
|
|
3488
|
+
if (fleetAuthUsesXaiOauthLogin(opts.provider, apiKey)) {
|
|
3489
|
+
const held = botCreateSeams.grokSiblingLogin(b.config);
|
|
3490
|
+
if (held.blocked)
|
|
3491
|
+
throw Object.assign(new Error(xaiOauthLoginRefusal(held, { name: b.name })), { expected: true });
|
|
3492
|
+
}
|
|
3269
3493
|
if (!apiKey && botRuntimeFromBrainName(opts.provider) === "claude" && !botCreateSeams.claudeLogin().signedIn) {
|
|
3270
3494
|
const reason = `Claude Code is not signed in on this computer, so ${b.name} cannot answer.`;
|
|
3271
3495
|
const brainSignIn = { provider: "claude", needed: true, reason, command: "claude /login" };
|
|
@@ -4105,12 +4329,16 @@ export function registerBotCommand(program) {
|
|
|
4105
4329
|
.command("auth-status")
|
|
4106
4330
|
.description("Say whether a bot created now with this brain starts without a sign-in step, reusing a login already on this computer")
|
|
4107
4331
|
.requiredOption("--provider <provider>", "Brain: claude, codex (or chatgpt) or grok")
|
|
4332
|
+
.option("--kind <kind>", "The bot the answer is for: personal (default) or company")
|
|
4333
|
+
.option("--company <slug>", "The company of a company bot (repeatable); a Grok login is reused only within one company", collectRepeated, [])
|
|
4108
4334
|
.option("--json", "Print machine-readable JSON: { provider, signedIn, source }")
|
|
4109
4335
|
.action((opts) => wrap(async () => { await runBotAuthStatus(opts); })());
|
|
4110
4336
|
bot
|
|
4111
4337
|
.command("sign-in")
|
|
4112
4338
|
.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")
|
|
4113
4339
|
.requiredOption("--provider <provider>", "Brain: codex (or chatgpt) or grok")
|
|
4340
|
+
.option("--kind <kind>", "The bot the sign-in is for: personal (default) or company")
|
|
4341
|
+
.option("--company <slug>", "The company of a company bot (repeatable)", collectRepeated, [])
|
|
4114
4342
|
.option("--json", "Print one JSON line per event (device code, messages) and a final result")
|
|
4115
4343
|
.option("--no-browser", "Use the CLI's device-code login instead of its browser login")
|
|
4116
4344
|
.action((opts) => wrap(async () => { await runBotSignIn(opts); })());
|
|
@@ -4139,6 +4367,7 @@ export function registerBotCommand(program) {
|
|
|
4139
4367
|
.option("--model <model>", "Model id for the runtime CLI, or default for the CLI's own default")
|
|
4140
4368
|
.option("--display-name <name>", `The name people see for the bot in HQ (up to ${BOT_DISPLAY_NAME_MAX_CHARS} chars). The handle stays <name>`)
|
|
4141
4369
|
.option("--effort <level>", `Thinking level (claude ${BOT_EFFORT_LEVELS.claude.join("|")}; codex ${BOT_EFFORT_LEVELS.codex.join("|")}; grok ${BOT_EFFORT_LEVELS.grok.join("|")}), or default (${DEFAULT_BOT_EFFORT})`)
|
|
4370
|
+
.option("--signals-runtime <bot|claude>", "Where hot-channel signals run: bot (the Executive Codex bot's own Codex) or claude (Claude Code, the default). Set on the Executive bot; local to this computer, from the next sync")
|
|
4142
4371
|
.option("--json", "Print machine-readable JSON")
|
|
4143
4372
|
.action((name, opts) => wrap(() => runBotSet(name, opts))());
|
|
4144
4373
|
bot
|
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* hq sync push [paths...] — broadcast local file(s) to the vault
|
|
12
12
|
* hq sync pull — pull all permitted files from the vault
|
|
13
13
|
* hq sync status — show local journal summary
|
|
14
|
+
* (also `hq daemon sync status --local`)
|
|
14
15
|
*/
|
|
15
16
|
import { Command } from "commander";
|
|
16
17
|
import { type ConflictStrategy, type EntityContext, type MembershipSyncConfig, type SyncMode, type PullScope, type ExplicitGrant, type ShareOptions, type VaultServiceConfig } from "@indigoai-us/hq-cloud";
|
|
@@ -692,6 +693,21 @@ export declare function nowPushLegRefused(input: {
|
|
|
692
693
|
uploadFailedCount: number;
|
|
693
694
|
identityHeldCount: number;
|
|
694
695
|
}): boolean;
|
|
696
|
+
/** Options shared by `hq sync status` and `hq daemon sync status --local`. */
|
|
697
|
+
export interface SyncJournalStatusOptions {
|
|
698
|
+
/** HQ root given on the command line; undefined means the default root (not checked). */
|
|
699
|
+
hqRoot?: string;
|
|
700
|
+
company?: string;
|
|
701
|
+
all?: boolean;
|
|
702
|
+
json?: boolean;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* The local sync-journal summary printed by `hq sync status` and
|
|
706
|
+
* `hq daemon sync status --local`: per-scope summaries plus the read-only and
|
|
707
|
+
* server-owned local-only lists, as text or (`json`) the full JSON. Exits the
|
|
708
|
+
* process with status 1 on an error, after printing "✗ Status failed:".
|
|
709
|
+
*/
|
|
710
|
+
export declare function runSyncJournalStatus(options: SyncJournalStatusOptions): void;
|
|
695
711
|
/**
|
|
696
712
|
* Human-friendly label for a journal slug in `hq sync status`. The
|
|
697
713
|
* personal-vault fanout slot and the legacy `companies/personal` company both
|