@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
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dispatcher": [
|
|
3
|
+
"HQ_MASTER_CHILD_TIMEOUT"
|
|
4
|
+
],
|
|
5
|
+
"gitEnvironmentAllowlist": [
|
|
6
|
+
"GIT_EDITOR",
|
|
7
|
+
"GIT_PAGER",
|
|
8
|
+
"GIT_ASKPASS",
|
|
9
|
+
"GIT_TERMINAL_PROMPT"
|
|
10
|
+
],
|
|
11
|
+
"gitConfigSections": [
|
|
12
|
+
"format",
|
|
13
|
+
"pretty",
|
|
14
|
+
"i18n"
|
|
15
|
+
],
|
|
16
|
+
"gitConfigKeys": [
|
|
17
|
+
"core.abbrev",
|
|
18
|
+
"core.repositoryformatversion",
|
|
19
|
+
"core.usereplacerefs",
|
|
20
|
+
"extensions.objectformat"
|
|
21
|
+
],
|
|
22
|
+
"gitConfigBooleans": [
|
|
23
|
+
"extensions.worktreeconfig"
|
|
24
|
+
],
|
|
25
|
+
"gitSystemConfigs": [
|
|
26
|
+
"/etc/gitconfig",
|
|
27
|
+
"/usr/local/etc/gitconfig",
|
|
28
|
+
"/opt/homebrew/etc/gitconfig",
|
|
29
|
+
"/opt/local/etc/gitconfig",
|
|
30
|
+
"/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig",
|
|
31
|
+
"/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig"
|
|
32
|
+
],
|
|
33
|
+
"gitEnvironmentConfigs": {
|
|
34
|
+
"DEVELOPER_DIR": [
|
|
35
|
+
"usr/share/git-core/gitconfig",
|
|
36
|
+
"Contents/Developer/usr/share/git-core/gitconfig"
|
|
37
|
+
],
|
|
38
|
+
"PROGRAMDATA": [
|
|
39
|
+
"Git/config"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"gitDeveloperDirLink": "/var/db/xcode_select_link",
|
|
43
|
+
"gitAppleShim": "/usr/bin/git",
|
|
44
|
+
"gitPrefixConfigs": [
|
|
45
|
+
"etc/gitconfig",
|
|
46
|
+
"share/git-core/gitconfig"
|
|
47
|
+
],
|
|
48
|
+
"registry": {
|
|
49
|
+
"observe-patterns": 30,
|
|
50
|
+
"hq-autocommit-bash-sweep": 30,
|
|
51
|
+
"checkpoint-stop-gate": 30,
|
|
52
|
+
"capture-estimates": 30,
|
|
53
|
+
"enforce-capability-link-render": 30,
|
|
54
|
+
"enforce-final-message-link-placement": 30,
|
|
55
|
+
"enforce-humanize-before-send": 30,
|
|
56
|
+
"lanes-senior-monitor-stop-gate": 30,
|
|
57
|
+
"conduct-lanes-link-deliver": 5
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
".claude/hooks/observe-patterns.sh": [
|
|
61
|
+
"f2d442586a1d09ddd79cb259253a773192fc17763d7cc6c1b586a86d4d7df787"
|
|
62
|
+
],
|
|
63
|
+
".claude/hooks/hq-autocommit-bash-sweep.sh": [
|
|
64
|
+
"01b9669c41dcdb438295aea52545ec9306b8ed8c83c30c7560798bdc06b50aed"
|
|
65
|
+
],
|
|
66
|
+
".claude/hooks/checkpoint-stop-gate.sh": [
|
|
67
|
+
"1fc121ad2d0d3acfd13c8daee9215013d9a01bd1856aa716154739f18506c3ce"
|
|
68
|
+
],
|
|
69
|
+
".claude/hooks/capture-estimates.sh": [
|
|
70
|
+
"915f6ccd632e284b861b2e683e63fbe68153a96c7142dbc8b6c158f6bd72cef8"
|
|
71
|
+
],
|
|
72
|
+
".claude/hooks/enforce-capability-link-render.sh": [
|
|
73
|
+
"14a3c4821e5187719beeeb3d1e583185e1cbc12d81633fc97a72dbafc425e54a"
|
|
74
|
+
],
|
|
75
|
+
".claude/hooks/enforce-final-message-link-placement.sh": [
|
|
76
|
+
"48d27e0cd7ef9230355c1e249b841aeb372766e5f919ce30f658e821f2dc6a18"
|
|
77
|
+
],
|
|
78
|
+
".claude/hooks/enforce-humanize-before-send.sh": [
|
|
79
|
+
"af967704bca886acf3c2e6c54ee86ec776385f8da89c8603d79398744abd0e44"
|
|
80
|
+
],
|
|
81
|
+
".claude/hooks/lanes-senior-monitor-stop-gate.sh": [
|
|
82
|
+
"c34e55aa10cf2c768943711a6a3cd89a69c7d5947050cb0f4cebb1289b55f671",
|
|
83
|
+
"03d8896cac9756c84f8fb8e5d51af9ee26bac3e6e024795bb0d10c2823c01208"
|
|
84
|
+
],
|
|
85
|
+
".claude/hooks/conduct-lanes-link-deliver.sh": [
|
|
86
|
+
"b1124363238ba405a0efd4bca08b4601430a596614037fbd30bf92b2e6bf8465"
|
|
87
|
+
],
|
|
88
|
+
"core/hooks/Stop/40-auto-acl-share-suggestion.sh": [
|
|
89
|
+
"286246caa6234ab2f449c1af987b4956b3afd0349ac310429ebd50fbaf594ab9"
|
|
90
|
+
],
|
|
91
|
+
"core/hooks/Stop/50-after-turn-suggestions.sh": [
|
|
92
|
+
"e9398ea6abc5ed2c8ad010f5135ea3e37d7f244f9d506d8e0f426d29358c6773"
|
|
93
|
+
],
|
|
94
|
+
"core/hooks/Stop/70-work-mesh-turn-end.sh": [
|
|
95
|
+
"1b37183a94a46152c9592d6821f323203438e09ed59956d6239880bb73f896db"
|
|
96
|
+
],
|
|
97
|
+
".claude/hooks/hq-autocommit-bash-flag.cjs": [
|
|
98
|
+
"419c65157c0167473ace808bacc7cb5902afa4336f8281f7e7f9c228d74a77a4"
|
|
99
|
+
],
|
|
100
|
+
".claude/hooks/hq-autocommit-failure-context-flag.cjs": [
|
|
101
|
+
"9e6fa4930830624fd588241b24315f6e6b5f3ae6778e8f61020bf237490ac30c"
|
|
102
|
+
],
|
|
103
|
+
".claude/hooks/hq-autocommit.sh": [
|
|
104
|
+
"f7c01bc6de7f79e51eedc9806a7c903fdf0947e540ba226d1b37fc3667919304"
|
|
105
|
+
],
|
|
106
|
+
".claude/hooks/lib/parse-estimates.pl": [
|
|
107
|
+
"absent"
|
|
108
|
+
],
|
|
109
|
+
".claude/skills/_shared/journal.sh": [
|
|
110
|
+
"e7ae5c522075b8535672fc2c8642c220282aa5cd91a19accc1072aff304be63e"
|
|
111
|
+
],
|
|
112
|
+
".codex/hooks/codex-explicit-path-flag.cjs": [
|
|
113
|
+
"85e3c00b1f879bfc695c32714129d00554674bce7a139c4386d07f01a63ef83f"
|
|
114
|
+
],
|
|
115
|
+
"core/hooks/SessionStart/35-work-mesh-session-start.sh": [
|
|
116
|
+
"865e5855c72c5ac0d503efbbc095a2d2835396418a12b20fa0ce3bd2f66d8d27",
|
|
117
|
+
"1653dd9f939b6bce651fb81a9619db6441ff56d3916bc05714424008719408be"
|
|
118
|
+
],
|
|
119
|
+
"core/scripts/board-project-id.sh": [
|
|
120
|
+
"b3c80668460c556267b06a0869e41e0088963ba2a709ac459d14bb8bd08252a7"
|
|
121
|
+
],
|
|
122
|
+
"core/scripts/conduct-runner-resolve.sh": [
|
|
123
|
+
"1510f360bb6773206fb2bd2d07091c15c1018ee1910f992e60fa7df6d49c845b",
|
|
124
|
+
"absent"
|
|
125
|
+
],
|
|
126
|
+
"core/scripts/hook-lib.sh": [
|
|
127
|
+
"89899ae7720f0bdde5cd8e014c614a6aa1796f4b79f23194e397d33b9c7e0bf2",
|
|
128
|
+
"4c98cd6f07d4090c062d980b0d85b0084635efdcd4a09afc05cf77287a74b28d",
|
|
129
|
+
"be7ca74b2524afba56fefd530bf46cbd1dd39a4c181b6a64c87e124b29bdebe7",
|
|
130
|
+
"b971dae4a2b82bfa5b31782e54717115abaf052457fb1a546893d04cae43adbb",
|
|
131
|
+
"df3d8ddc15a0c179227c9ba7f855c040973fcee249673156d08b2e2ff2c850b8",
|
|
132
|
+
"49c337ceccf0a2d7c2a64f6b1de8c3c4d1da507bc5d7afcd01ed292e1f25abf7"
|
|
133
|
+
],
|
|
134
|
+
"core/scripts/hook-stop-async-drain.sh": [
|
|
135
|
+
"d7be9aa17c42bd96ba6f9d929240e06d9c057471347374de40ea4be3560da4f5"
|
|
136
|
+
],
|
|
137
|
+
"core/scripts/hq-anywhere-runtime-flag.cjs": [
|
|
138
|
+
"8a484cef83d383b440462798ac13e26d132e10bbe509b47e0eb1a3d0db76b2b4"
|
|
139
|
+
],
|
|
140
|
+
"core/scripts/hq-detach.sh": [
|
|
141
|
+
"10de31d5d6c9dde06585445274d08b467e4d7a0741375b17cfd2f856ecd57be2"
|
|
142
|
+
],
|
|
143
|
+
"core/scripts/hq-hidden-run.sh": [
|
|
144
|
+
"13843967ff68810919f4966af17e68c1a74974874957a3aeab281cd2481dc73a"
|
|
145
|
+
],
|
|
146
|
+
"core/scripts/hq-session.sh": [
|
|
147
|
+
"db701162f71b53fd2188974d2f46c58250593dde1252d65b36e6d02b9a765fe7",
|
|
148
|
+
"a0dd3e603c201150e6f2bf4de9f2d01c822978dcf40b3ed03a547a8f070da2de",
|
|
149
|
+
"e686c5a5a477d2640c4056122223d1cbf85e71c5dce965776c15dfee86232c6b"
|
|
150
|
+
],
|
|
151
|
+
"core/scripts/hqd-hook-flag-cache-lib.sh": [
|
|
152
|
+
"061d264460408e9eaf43fdf0fdde662c906a9a7dacb4e7a591e684bca28c138a"
|
|
153
|
+
],
|
|
154
|
+
"core/scripts/lib/epochrealtime.sh": [
|
|
155
|
+
"4c9205520dba31533c95eea145f6068ba626885c342c2aa1f232a7237d046cdf",
|
|
156
|
+
"absent"
|
|
157
|
+
],
|
|
158
|
+
"core/scripts/lib/hook-stop-async.sh": [
|
|
159
|
+
"fe89218c3f92413cff36e82a937eed5e548e712644d8228b34d59c7f459917ad",
|
|
160
|
+
"730b008b81b360923f82785467f3a3b6592be6610ee3b909e446b242543ab3bc"
|
|
161
|
+
],
|
|
162
|
+
"core/scripts/lib/perl-child-locale.sh": [
|
|
163
|
+
"18e6b9d0e22874eea00ecc868b4dcfebbc3bb42434d8d0c81b20baec1194df2e"
|
|
164
|
+
],
|
|
165
|
+
"core/scripts/lib/provider-adapter-version.sh": [
|
|
166
|
+
"45a8252fbe0012cbca64839248aa4bc45c80c96d2d544154c3321acbbe8ac5c9"
|
|
167
|
+
],
|
|
168
|
+
"core/scripts/lib/resolve-hq-bin.sh": [
|
|
169
|
+
"96efe7a40703885581012f0cc2b84d8ca339b59c8374fed88adf6a258235ad8c",
|
|
170
|
+
"fd3bc136b31087391657f91b09d24b493f8cb671b13fc604fb02066896520af1"
|
|
171
|
+
],
|
|
172
|
+
"core/scripts/lib/session-auto-bind.sh": [
|
|
173
|
+
"b8da1a401473dceb610c2b63aaf93dda3cf304fe507091817dd19b152a0346ac",
|
|
174
|
+
"38e95508a7e2bed70c0b33015a7a2f704ae0e3a465d9192d7532074a2bcdf1d0",
|
|
175
|
+
"89c0273ad7bac4bda2b114ca5f02c38229343a5418bad92f641e400c2883b4e0"
|
|
176
|
+
],
|
|
177
|
+
"core/scripts/lib/session-id.sh": [
|
|
178
|
+
"5178dfed9387cf5924bb71d5cdded37f445fd7b496e6037e81c43af0e7831d5b"
|
|
179
|
+
],
|
|
180
|
+
"core/scripts/lib/session-scope-capability.sh": [
|
|
181
|
+
"388ffef43cfe05810c38ce377245d0d86f415b4009b21a008bca8897be0c9ead"
|
|
182
|
+
],
|
|
183
|
+
"core/scripts/lib/transcript-tail.sh": [
|
|
184
|
+
"73eadafdd8e7c375bd12383947ac73c43e7dfe79b29e6553da1cb5b2746bb217"
|
|
185
|
+
],
|
|
186
|
+
"core/scripts/lib/work-mesh-enqueue.sh": [
|
|
187
|
+
"ac44fc8f68dbe7311811e0e97bba2b1e53b3aa856856db566635a135c6319451",
|
|
188
|
+
"db440318b8933b7c436c7b7172adffc9e8fd00c92f0e1745ed5da76871accbe7"
|
|
189
|
+
],
|
|
190
|
+
"core/scripts/lib/work-mesh-live-hook.sh": [
|
|
191
|
+
"25dc6d35877366ae91532a28a64d380aee054a8c571df88ed0b741aef29cf34e"
|
|
192
|
+
],
|
|
193
|
+
"core/scripts/lib/work-mesh-live-rebind.sh": [
|
|
194
|
+
"d351bf68103b7f8514d96a945bdeb6c371d9d7ba289347c368a34fea36fd4ad9"
|
|
195
|
+
],
|
|
196
|
+
"core/scripts/register-project.sh": [
|
|
197
|
+
"fdce833824a8e387a50f0dd3020f5c5c0535af6372242e391ab99518d2fa5fc4",
|
|
198
|
+
"b65670de9a5aa063f88694fb1cf44239725f0e71bd6245972aa093ef31f09114"
|
|
199
|
+
],
|
|
200
|
+
"core/scripts/share-suggestion-state.sh": [
|
|
201
|
+
"d2a8ba30f7650b89f0ed221f840ef2c8e731b9df35d57e0f4576feadad6f7597"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"dependencies": {
|
|
205
|
+
".claude/hooks/hq-autocommit-bash-sweep.sh": [
|
|
206
|
+
".claude/hooks/hq-autocommit-bash-flag.cjs",
|
|
207
|
+
".claude/hooks/hq-autocommit.sh",
|
|
208
|
+
"core/scripts/lib/hook-stop-async.sh"
|
|
209
|
+
],
|
|
210
|
+
".claude/hooks/checkpoint-stop-gate.sh": [
|
|
211
|
+
"core/scripts/hq-hidden-run.sh"
|
|
212
|
+
],
|
|
213
|
+
".claude/hooks/capture-estimates.sh": [
|
|
214
|
+
".claude/hooks/lib/parse-estimates.pl",
|
|
215
|
+
"core/scripts/lib/transcript-tail.sh"
|
|
216
|
+
],
|
|
217
|
+
".claude/hooks/enforce-capability-link-render.sh": [
|
|
218
|
+
"core/scripts/hook-lib.sh",
|
|
219
|
+
"core/scripts/lib/transcript-tail.sh"
|
|
220
|
+
],
|
|
221
|
+
".claude/hooks/enforce-final-message-link-placement.sh": [
|
|
222
|
+
"core/scripts/hook-lib.sh",
|
|
223
|
+
"core/scripts/lib/transcript-tail.sh"
|
|
224
|
+
],
|
|
225
|
+
".claude/hooks/enforce-humanize-before-send.sh": [
|
|
226
|
+
"core/scripts/hook-lib.sh",
|
|
227
|
+
"core/scripts/lib/transcript-tail.sh"
|
|
228
|
+
],
|
|
229
|
+
".claude/hooks/lanes-senior-monitor-stop-gate.sh": [
|
|
230
|
+
"core/scripts/conduct-runner-resolve.sh",
|
|
231
|
+
"core/scripts/lib/perl-child-locale.sh",
|
|
232
|
+
"core/scripts/lib/resolve-hq-bin.sh"
|
|
233
|
+
],
|
|
234
|
+
".claude/hooks/conduct-lanes-link-deliver.sh": [
|
|
235
|
+
"core/scripts/lib/perl-child-locale.sh"
|
|
236
|
+
],
|
|
237
|
+
"core/hooks/Stop/40-auto-acl-share-suggestion.sh": [
|
|
238
|
+
"core/scripts/share-suggestion-state.sh"
|
|
239
|
+
],
|
|
240
|
+
"core/hooks/Stop/50-after-turn-suggestions.sh": [
|
|
241
|
+
".claude/skills/_shared/journal.sh",
|
|
242
|
+
"core/scripts/lib/transcript-tail.sh",
|
|
243
|
+
"core/scripts/share-suggestion-state.sh"
|
|
244
|
+
],
|
|
245
|
+
"core/hooks/Stop/70-work-mesh-turn-end.sh": [
|
|
246
|
+
"core/scripts/lib/hook-stop-async.sh",
|
|
247
|
+
"core/scripts/lib/work-mesh-enqueue.sh"
|
|
248
|
+
],
|
|
249
|
+
".claude/hooks/hq-autocommit.sh": [
|
|
250
|
+
".claude/hooks/hq-autocommit-failure-context-flag.cjs"
|
|
251
|
+
],
|
|
252
|
+
".claude/hooks/hq-autocommit-bash-flag.cjs": [
|
|
253
|
+
"core/scripts/hq-session.sh"
|
|
254
|
+
],
|
|
255
|
+
".codex/hooks/codex-explicit-path-flag.cjs": [
|
|
256
|
+
"core/scripts/hq-session.sh"
|
|
257
|
+
],
|
|
258
|
+
"core/hooks/SessionStart/35-work-mesh-session-start.sh": [
|
|
259
|
+
"core/scripts/lib/session-auto-bind.sh",
|
|
260
|
+
"core/scripts/lib/session-scope-capability.sh",
|
|
261
|
+
"core/scripts/lib/work-mesh-enqueue.sh",
|
|
262
|
+
"core/scripts/lib/work-mesh-live-rebind.sh",
|
|
263
|
+
"core/scripts/register-project.sh"
|
|
264
|
+
],
|
|
265
|
+
"core/scripts/conduct-runner-resolve.sh": [
|
|
266
|
+
"core/scripts/hq-session.sh"
|
|
267
|
+
],
|
|
268
|
+
"core/scripts/hook-lib.sh": [
|
|
269
|
+
"core/scripts/lib/session-id.sh"
|
|
270
|
+
],
|
|
271
|
+
"core/scripts/hook-stop-async-drain.sh": [
|
|
272
|
+
"core/scripts/lib/hook-stop-async.sh"
|
|
273
|
+
],
|
|
274
|
+
"core/scripts/hq-hidden-run.sh": [
|
|
275
|
+
"core/scripts/hq-detach.sh"
|
|
276
|
+
],
|
|
277
|
+
"core/scripts/hq-session.sh": [
|
|
278
|
+
"core/hooks/SessionStart/35-work-mesh-session-start.sh",
|
|
279
|
+
"core/scripts/lib/session-id.sh",
|
|
280
|
+
"core/scripts/lib/session-scope-capability.sh",
|
|
281
|
+
"core/scripts/lib/work-mesh-enqueue.sh",
|
|
282
|
+
"core/scripts/lib/work-mesh-live-hook.sh",
|
|
283
|
+
"core/scripts/lib/work-mesh-live-rebind.sh"
|
|
284
|
+
],
|
|
285
|
+
"core/scripts/hqd-hook-flag-cache-lib.sh": [
|
|
286
|
+
"core/scripts/hq-anywhere-runtime-flag.cjs"
|
|
287
|
+
],
|
|
288
|
+
"core/scripts/lib/hook-stop-async.sh": [
|
|
289
|
+
"core/scripts/hook-stop-async-drain.sh",
|
|
290
|
+
"core/scripts/hq-detach.sh",
|
|
291
|
+
"core/scripts/hq-hidden-run.sh",
|
|
292
|
+
"core/scripts/lib/epochrealtime.sh"
|
|
293
|
+
],
|
|
294
|
+
"core/scripts/lib/session-scope-capability.sh": [
|
|
295
|
+
".codex/hooks/codex-explicit-path-flag.cjs",
|
|
296
|
+
"core/scripts/hqd-hook-flag-cache-lib.sh"
|
|
297
|
+
],
|
|
298
|
+
"core/scripts/lib/work-mesh-enqueue.sh": [
|
|
299
|
+
"core/scripts/lib/epochrealtime.sh"
|
|
300
|
+
],
|
|
301
|
+
"core/scripts/lib/work-mesh-live-hook.sh": [
|
|
302
|
+
"core/scripts/lib/provider-adapter-version.sh",
|
|
303
|
+
"core/scripts/lib/session-id.sh",
|
|
304
|
+
"core/scripts/lib/work-mesh-enqueue.sh"
|
|
305
|
+
],
|
|
306
|
+
"core/scripts/register-project.sh": [
|
|
307
|
+
"core/scripts/board-project-id.sh",
|
|
308
|
+
"core/scripts/hq-session.sh"
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
}
|
|
@@ -134,8 +134,8 @@ export function reconcileHookRegistrations(root, home = homedir(), env = process
|
|
|
134
134
|
// the switch. A failure to set up the new core is one warning and the
|
|
135
135
|
// flag-off path.
|
|
136
136
|
const coreNext = coreNextTargetOrWarn(home, env);
|
|
137
|
-
const claudeNext = forHost(coreNext, root, 'claude');
|
|
138
|
-
const codexNext = forHost(coreNext, root, 'codex');
|
|
137
|
+
const claudeNext = forHost(coreNext, root, 'claude', env);
|
|
138
|
+
const codexNext = forHost(coreNext, root, 'codex', env);
|
|
139
139
|
const launcher = registrationEngine(home, env);
|
|
140
140
|
const native = coreNext ?? (launcher ? { engine: launcher } : null);
|
|
141
141
|
const ours = (entry) => isNativeEntry(entry, root) || isCoreNextEntry(entry, root);
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { RunLedgerEntry } from "./ledger.js";
|
|
17
17
|
import type { OnDemandSyncDeps } from "./run.js";
|
|
18
|
+
/** Pass failures that mean the tool signals run on (Claude Code, or a Codex bot's Codex) is signed out or missing on this computer. */
|
|
19
|
+
export declare const SIGNED_OUT_SIGNALS_CODES: ReadonlySet<string>;
|
|
20
|
+
/** A failed ledger line whose pass found its tool signed out. */
|
|
21
|
+
export declare function isSignedOutSignalsFailure(entry: Pick<RunLedgerEntry, "status" | "error">): boolean;
|
|
18
22
|
export declare const SIGNALS_HEALTH_RULE: string;
|
|
19
23
|
/** One alert per adapter and connection per hour. */
|
|
20
24
|
export declare const SIGNALS_ALERT_DEDUPE_MS: number;
|
|
@@ -25,11 +29,16 @@ export declare const SIGNALS_ALERT_CHANNEL_FIELD = "signals_alert_channel";
|
|
|
25
29
|
export declare const SLACK_POST_TOOL = "slack.messages.post";
|
|
26
30
|
/**
|
|
27
31
|
* Ledger lines that landed sources and either generated no signals, whatever
|
|
28
|
-
* their status, or failed partway after generating some.
|
|
32
|
+
* their status, or failed partway after generating some. A line whose pass
|
|
33
|
+
* failed because Claude Code is signed out counts too when it landed nothing:
|
|
34
|
+
* the pass only checks the login when queued documents are waiting, so that
|
|
35
|
+
* run had backlog it could not process, and the owner must hear about it.
|
|
29
36
|
*/
|
|
30
37
|
export declare function findSignalsFailures(entries: readonly RunLedgerEntry[]): RunLedgerEntry[];
|
|
31
38
|
/** The dedupe key: one adapter on one connection. */
|
|
32
39
|
export declare function signalsAlertKey(entry: Pick<RunLedgerEntry, "adapter" | "connectionId">): string;
|
|
40
|
+
/** The dedupe key shared by every connection of one adapter that failed signed out. */
|
|
41
|
+
export declare function signedOutAlertKey(entry: Pick<RunLedgerEntry, "adapter">): string;
|
|
33
42
|
/** The first words of every signals-failure alert; the Fleet job script finds the alert by them. */
|
|
34
43
|
export declare const SIGNALS_FAILURE_PREFIX = "Signals failure for ";
|
|
35
44
|
export declare function formatSignalsFailureAlert(entry: RunLedgerEntry, options?: {
|
|
@@ -17,8 +17,16 @@ import * as fs from "node:fs";
|
|
|
17
17
|
import * as path from "node:path";
|
|
18
18
|
import { assertNotIntegrationSecretsPath, personDirName } from "./cursors.js";
|
|
19
19
|
import { writeFileAtomic } from "./landing.js";
|
|
20
|
-
import { CODEX_BOT_NEEDS_CLAUDE_TEXT } from "./signals-pass.js";
|
|
20
|
+
import { CLAUDE_SIGNED_OUT_TEXT, CODEX_BOT_NEEDS_CLAUDE_TEXT, CODEX_SIGNED_OUT_TEXT } from "./signals-pass.js";
|
|
21
21
|
const CODEX_BOT_NEEDS_CLAUDE_CODE = "claude-logged-out-codex-bot";
|
|
22
|
+
const CLAUDE_SIGNED_OUT_CODE = "claude-logged-out";
|
|
23
|
+
const CODEX_SIGNED_OUT_CODE = "codex-logged-out";
|
|
24
|
+
/** Pass failures that mean the tool signals run on (Claude Code, or a Codex bot's Codex) is signed out or missing on this computer. */
|
|
25
|
+
export const SIGNED_OUT_SIGNALS_CODES = new Set([CLAUDE_SIGNED_OUT_CODE, CODEX_BOT_NEEDS_CLAUDE_CODE, CODEX_SIGNED_OUT_CODE]);
|
|
26
|
+
/** A failed ledger line whose pass found its tool signed out. */
|
|
27
|
+
export function isSignedOutSignalsFailure(entry) {
|
|
28
|
+
return entry.status === "failed" && entry.error !== null && SIGNED_OUT_SIGNALS_CODES.has(entry.error);
|
|
29
|
+
}
|
|
22
30
|
export const SIGNALS_HEALTH_RULE = 'Owner rule: "sync and build feels wrong. we should be logging sources and signals generated." ' +
|
|
23
31
|
"A run that lands sources and generates no signals is a failure.";
|
|
24
32
|
/** One alert per adapter and connection per hour. */
|
|
@@ -30,15 +38,22 @@ export const SIGNALS_ALERT_CHANNEL_FIELD = "signals_alert_channel";
|
|
|
30
38
|
export const SLACK_POST_TOOL = "slack.messages.post";
|
|
31
39
|
/**
|
|
32
40
|
* Ledger lines that landed sources and either generated no signals, whatever
|
|
33
|
-
* their status, or failed partway after generating some.
|
|
41
|
+
* their status, or failed partway after generating some. A line whose pass
|
|
42
|
+
* failed because Claude Code is signed out counts too when it landed nothing:
|
|
43
|
+
* the pass only checks the login when queued documents are waiting, so that
|
|
44
|
+
* run had backlog it could not process, and the owner must hear about it.
|
|
34
45
|
*/
|
|
35
46
|
export function findSignalsFailures(entries) {
|
|
36
|
-
return entries.filter((e) => e.sourcesLanded > 0 && (e.signalsGenerated === 0 || e.status === "failed"));
|
|
47
|
+
return entries.filter((e) => (e.sourcesLanded > 0 && (e.signalsGenerated === 0 || e.status === "failed")) || isSignedOutSignalsFailure(e));
|
|
37
48
|
}
|
|
38
49
|
/** The dedupe key: one adapter on one connection. */
|
|
39
50
|
export function signalsAlertKey(entry) {
|
|
40
51
|
return `${entry.adapter}:${entry.connectionId ?? "-"}`;
|
|
41
52
|
}
|
|
53
|
+
/** The dedupe key shared by every connection of one adapter that failed signed out. */
|
|
54
|
+
export function signedOutAlertKey(entry) {
|
|
55
|
+
return `${entry.adapter}:claude-signed-out`;
|
|
56
|
+
}
|
|
42
57
|
/** The first words of every signals-failure alert; the Fleet job script finds the alert by them. */
|
|
43
58
|
export const SIGNALS_FAILURE_PREFIX = "Signals failure for ";
|
|
44
59
|
export function formatSignalsFailureAlert(entry, options = {}) {
|
|
@@ -51,11 +66,16 @@ export function formatSignalsFailureAlert(entry, options = {}) {
|
|
|
51
66
|
];
|
|
52
67
|
if (entry.error)
|
|
53
68
|
lines.push(`Error: ${entry.error}`);
|
|
54
|
-
//
|
|
69
|
+
// Name the tool the pass ran on, and how to fix it on this computer.
|
|
55
70
|
if (entry.error === CODEX_BOT_NEEDS_CLAUDE_CODE)
|
|
56
71
|
lines.push(CODEX_BOT_NEEDS_CLAUDE_TEXT);
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
else if (entry.error === CLAUDE_SIGNED_OUT_CODE)
|
|
73
|
+
lines.push(CLAUDE_SIGNED_OUT_TEXT);
|
|
74
|
+
else if (entry.error === CODEX_SIGNED_OUT_CODE)
|
|
75
|
+
lines.push(CODEX_SIGNED_OUT_TEXT);
|
|
76
|
+
// The rule is about a run that landed sources and made no signals; a
|
|
77
|
+
// partial pass, or a backlog-only run, fails on its error alone.
|
|
78
|
+
if (entry.signalsGenerated === 0 && entry.sourcesLanded > 0)
|
|
59
79
|
lines.push(SIGNALS_HEALTH_RULE);
|
|
60
80
|
return lines.join("\n");
|
|
61
81
|
}
|
|
@@ -98,17 +118,25 @@ export async function raiseSignalsFailureAlerts(input) {
|
|
|
98
118
|
const state = await readAlertState(file);
|
|
99
119
|
const seen = new Set();
|
|
100
120
|
let changed = false;
|
|
121
|
+
const recent = (k, at) => {
|
|
122
|
+
const last = state.lastAlertAt[k] ? Date.parse(state.lastAlertAt[k]) : Number.NaN;
|
|
123
|
+
return !Number.isNaN(last) && at.getTime() - last < SIGNALS_ALERT_DEDUPE_MS;
|
|
124
|
+
};
|
|
101
125
|
for (const entry of failures) {
|
|
102
126
|
const key = signalsAlertKey(entry);
|
|
103
127
|
if (seen.has(key))
|
|
104
128
|
continue;
|
|
105
129
|
seen.add(key);
|
|
106
130
|
const at = input.now();
|
|
107
|
-
|
|
108
|
-
|
|
131
|
+
// One sign-out fails every connection of an adapter that has backlog the
|
|
132
|
+
// same way: the adapter gets one DM per hour, not one per connection.
|
|
133
|
+
const signedOutKey = isSignedOutSignalsFailure(entry) ? signedOutAlertKey(entry) : null;
|
|
134
|
+
if (recent(key, at) || (signedOutKey !== null && (seen.has(signedOutKey) || recent(signedOutKey, at)))) {
|
|
109
135
|
result.suppressed.push(key);
|
|
110
136
|
continue;
|
|
111
137
|
}
|
|
138
|
+
if (signedOutKey !== null)
|
|
139
|
+
seen.add(signedOutKey);
|
|
112
140
|
const text = formatSignalsFailureAlert(entry, input.personName ? { personName: input.personName } : {});
|
|
113
141
|
try {
|
|
114
142
|
await input.sendOwnerDm(text);
|
|
@@ -119,6 +147,8 @@ export async function raiseSignalsFailureAlerts(input) {
|
|
|
119
147
|
continue;
|
|
120
148
|
}
|
|
121
149
|
state.lastAlertAt[key] = at.toISOString();
|
|
150
|
+
if (signedOutKey !== null)
|
|
151
|
+
state.lastAlertAt[signedOutKey] = at.toISOString();
|
|
122
152
|
changed = true;
|
|
123
153
|
result.sent.push(key);
|
|
124
154
|
if (input.postCompanyChannel) {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Claude Code sign-in that the signals pass needs, as last seen by a pass.
|
|
3
|
+
*
|
|
4
|
+
* The signals pass always runs Claude Code, whatever the bot's own runtime is
|
|
5
|
+
* (signals-pass.ts), so a Codex bot can be signed in to its own tool while
|
|
6
|
+
* signals cannot run. Each pass reports what it saw through `onClaudeLogin`,
|
|
7
|
+
* and this module keeps one machine-local record of it
|
|
8
|
+
* (`{botsRoot}/signals-claude-login.json`; the login belongs to this
|
|
9
|
+
* computer, so the record never goes in a company vault). `hq bot status`
|
|
10
|
+
* reads it to show that login next to the bot's own runtime login.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SIGNALS_CLAUDE_LOGIN_FILE = "signals-claude-login.json";
|
|
13
|
+
/** Who saw the state. Only the signals pass records it today. */
|
|
14
|
+
export type SignalsClaudeLoginSource = "signals-pass";
|
|
15
|
+
export interface SignalsClaudeLogin {
|
|
16
|
+
v: 1;
|
|
17
|
+
signedIn: boolean;
|
|
18
|
+
checkedAt: string;
|
|
19
|
+
source: SignalsClaudeLoginSource;
|
|
20
|
+
/** When the login was first seen signed out, while it still is. */
|
|
21
|
+
signedOutSince?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function signalsClaudeLoginPath(root?: string): string;
|
|
24
|
+
/** The last recorded state, or null when nothing was recorded or the file is unreadable. */
|
|
25
|
+
export declare function readSignalsClaudeLogin(file?: string): SignalsClaudeLogin | null;
|
|
26
|
+
/**
|
|
27
|
+
* Record what a pass just saw. Never throws: the record is a report, and a
|
|
28
|
+
* failed write must not fail a signals run.
|
|
29
|
+
*/
|
|
30
|
+
export declare function recordSignalsClaudeLogin(signedIn: boolean, now?: () => Date, file?: string): void;
|
|
31
|
+
/** One live `claude auth status` answer for `hq bot status`. */
|
|
32
|
+
export interface ClaudeLoginNow {
|
|
33
|
+
/** null when the check could not tell (`error` says why). */
|
|
34
|
+
signedIn: boolean | null;
|
|
35
|
+
checkedAt: string;
|
|
36
|
+
error: string | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Ask `claude auth status` now, the way the signals pass reads it: a CLI that
|
|
40
|
+
* cannot start (not installed) or exits non-zero is signed out,
|
|
41
|
+
* `loggedIn: false` is signed out, any other exit 0 is signed in. It reads
|
|
42
|
+
* local credentials only: no network and no model call. A timeout or a
|
|
43
|
+
* thrown error is `signedIn: null` with the reason. Never throws.
|
|
44
|
+
*/
|
|
45
|
+
export declare function checkClaudeLoginNow(options?: {
|
|
46
|
+
claudeBin?: string;
|
|
47
|
+
env?: NodeJS.ProcessEnv;
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
now?: () => Date;
|
|
50
|
+
}): Promise<ClaudeLoginNow>;
|
|
51
|
+
/** The `onClaudeLogin` reporter `hq sources sync` and `hq bot` give the signals pass. */
|
|
52
|
+
export declare function recordSignalsPassClaudeLogin(signedIn: boolean): void;
|
|
53
|
+
//# sourceMappingURL=signals-claude-login.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Claude Code sign-in that the signals pass needs, as last seen by a pass.
|
|
3
|
+
*
|
|
4
|
+
* The signals pass always runs Claude Code, whatever the bot's own runtime is
|
|
5
|
+
* (signals-pass.ts), so a Codex bot can be signed in to its own tool while
|
|
6
|
+
* signals cannot run. Each pass reports what it saw through `onClaudeLogin`,
|
|
7
|
+
* and this module keeps one machine-local record of it
|
|
8
|
+
* (`{botsRoot}/signals-claude-login.json`; the login belongs to this
|
|
9
|
+
* computer, so the record never goes in a company vault). `hq bot status`
|
|
10
|
+
* reads it to show that login next to the bot's own runtime login.
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from "node:fs";
|
|
13
|
+
import * as os from "node:os";
|
|
14
|
+
import * as path from "node:path";
|
|
15
|
+
import { botsRoot } from "../bot/paths.js";
|
|
16
|
+
import { AUTH_PREFLIGHT_TIMEOUT_MS, runBounded } from "./signals-pass.js";
|
|
17
|
+
export const SIGNALS_CLAUDE_LOGIN_FILE = "signals-claude-login.json";
|
|
18
|
+
export function signalsClaudeLoginPath(root = botsRoot()) {
|
|
19
|
+
return path.join(root, SIGNALS_CLAUDE_LOGIN_FILE);
|
|
20
|
+
}
|
|
21
|
+
/** The last recorded state, or null when nothing was recorded or the file is unreadable. */
|
|
22
|
+
export function readSignalsClaudeLogin(file = signalsClaudeLoginPath()) {
|
|
23
|
+
try {
|
|
24
|
+
const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
25
|
+
if (parsed?.v !== 1 || typeof parsed.signedIn !== "boolean" || typeof parsed.checkedAt !== "string")
|
|
26
|
+
return null;
|
|
27
|
+
if (!Number.isFinite(Date.parse(parsed.checkedAt)))
|
|
28
|
+
return null;
|
|
29
|
+
return {
|
|
30
|
+
v: 1,
|
|
31
|
+
signedIn: parsed.signedIn,
|
|
32
|
+
checkedAt: parsed.checkedAt,
|
|
33
|
+
source: "signals-pass",
|
|
34
|
+
...(!parsed.signedIn && typeof parsed.signedOutSince === "string" ? { signedOutSince: parsed.signedOutSince } : {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// Missing or unreadable: nothing recorded yet.
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Record what a pass just saw. Never throws: the record is a report, and a
|
|
44
|
+
* failed write must not fail a signals run.
|
|
45
|
+
*/
|
|
46
|
+
export function recordSignalsClaudeLogin(signedIn, now = () => new Date(), file = signalsClaudeLoginPath()) {
|
|
47
|
+
try {
|
|
48
|
+
const at = now().toISOString();
|
|
49
|
+
const previous = readSignalsClaudeLogin(file);
|
|
50
|
+
const signedOutSince = signedIn ? undefined : previous && !previous.signedIn ? (previous.signedOutSince ?? previous.checkedAt) : at;
|
|
51
|
+
const record = { v: 1, signedIn, checkedAt: at, source: "signals-pass", ...(signedOutSince ? { signedOutSince } : {}) };
|
|
52
|
+
fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
53
|
+
const tmp = `${file}.${process.pid}.${Date.now()}.tmp`;
|
|
54
|
+
fs.writeFileSync(tmp, `${JSON.stringify(record, null, 2)}\n`, { mode: 0o600 });
|
|
55
|
+
fs.renameSync(tmp, file);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// A report only; the next pass writes it again.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Ask `claude auth status` now, the way the signals pass reads it: a CLI that
|
|
63
|
+
* cannot start (not installed) or exits non-zero is signed out,
|
|
64
|
+
* `loggedIn: false` is signed out, any other exit 0 is signed in. It reads
|
|
65
|
+
* local credentials only: no network and no model call. A timeout or a
|
|
66
|
+
* thrown error is `signedIn: null` with the reason. Never throws.
|
|
67
|
+
*/
|
|
68
|
+
export async function checkClaudeLoginNow(options = {}) {
|
|
69
|
+
const checkedAt = (options.now ?? (() => new Date()))().toISOString();
|
|
70
|
+
try {
|
|
71
|
+
const run = await runBounded(options.claudeBin ?? "claude", ["auth", "status"], {
|
|
72
|
+
timeoutMs: options.timeoutMs ?? AUTH_PREFLIGHT_TIMEOUT_MS,
|
|
73
|
+
cwd: os.tmpdir(),
|
|
74
|
+
env: options.env ?? process.env,
|
|
75
|
+
});
|
|
76
|
+
if (run.timedOut)
|
|
77
|
+
return { signedIn: null, checkedAt, error: "claude auth status timed out" };
|
|
78
|
+
if (run.spawnError !== undefined || run.code !== 0)
|
|
79
|
+
return { signedIn: false, checkedAt, error: null };
|
|
80
|
+
try {
|
|
81
|
+
return { signedIn: JSON.parse(run.stdout).loggedIn !== false, checkedAt, error: null };
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// A plain-text status with exit 0 means signed in, as in the pass.
|
|
85
|
+
return { signedIn: true, checkedAt, error: null };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
return { signedIn: null, checkedAt, error: err instanceof Error ? err.message : String(err) };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** The `onClaudeLogin` reporter `hq sources sync` and `hq bot` give the signals pass. */
|
|
93
|
+
export function recordSignalsPassClaudeLogin(signedIn) {
|
|
94
|
+
recordSignalsClaudeLogin(signedIn);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=signals-claude-login.js.map
|