@indigoai-us/hq-cli 5.111.1 → 5.112.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.
@@ -0,0 +1,394 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * The one authoritative registration plan for eager validation and lazy
4
+ * invocation. Multi-module roots keep the old registration order here.
5
+ */
6
+ export declare const REGISTRATION_PLAN: readonly [{
7
+ readonly type: "group";
8
+ readonly root: "modules";
9
+ readonly id: "modules";
10
+ readonly name: "modules";
11
+ readonly description: "Module management commands";
12
+ }, {
13
+ readonly type: "registrar";
14
+ readonly root: "modules";
15
+ readonly parent: "modules";
16
+ readonly module: "./commands/add.js";
17
+ readonly exportName: "registerAddCommand";
18
+ }, {
19
+ readonly type: "registrar";
20
+ readonly root: "modules";
21
+ readonly parent: "modules";
22
+ readonly module: "./commands/sync.js";
23
+ readonly exportName: "registerSyncCommand";
24
+ }, {
25
+ readonly type: "registrar";
26
+ readonly root: "modules";
27
+ readonly parent: "modules";
28
+ readonly module: "./commands/list.js";
29
+ readonly exportName: "registerListCommand";
30
+ }, {
31
+ readonly type: "registrar";
32
+ readonly root: "modules";
33
+ readonly parent: "modules";
34
+ readonly module: "./commands/update.js";
35
+ readonly exportName: "registerUpdateCommand";
36
+ }, {
37
+ readonly type: "group";
38
+ readonly root: "packages";
39
+ readonly id: "packages";
40
+ readonly name: "packages";
41
+ readonly description: "Package management commands";
42
+ }, {
43
+ readonly type: "registrar";
44
+ readonly root: "packages";
45
+ readonly parent: "packages";
46
+ readonly module: "./commands/pkg-install.js";
47
+ readonly exportName: "registerPackageInstallCommand";
48
+ }, {
49
+ readonly type: "registrar";
50
+ readonly root: "packages";
51
+ readonly parent: "packages";
52
+ readonly module: "./commands/pkg-remove.js";
53
+ readonly exportName: "registerPackageRemoveCommand";
54
+ }, {
55
+ readonly type: "registrar";
56
+ readonly root: "packages";
57
+ readonly parent: "packages";
58
+ readonly module: "./commands/pkg-update.js";
59
+ readonly exportName: "registerPackageUpdateCommand";
60
+ }, {
61
+ readonly type: "registrar";
62
+ readonly root: "packages";
63
+ readonly parent: "packages";
64
+ readonly module: "./commands/pkg-list.js";
65
+ readonly exportName: "registerPackageListCommand";
66
+ }, {
67
+ readonly type: "registrar";
68
+ readonly root: "packages";
69
+ readonly parent: "packages";
70
+ readonly module: "./commands/packs.js";
71
+ readonly exportName: "registerPacksCommand";
72
+ }, {
73
+ readonly type: "registrar";
74
+ readonly root: "packs";
75
+ readonly parent: "program";
76
+ readonly module: "./commands/packs.js";
77
+ readonly exportName: "registerPacksCommand";
78
+ }, {
79
+ readonly type: "registrar";
80
+ readonly root: "install";
81
+ readonly parent: "program";
82
+ readonly module: "./commands/pkg-install.js";
83
+ readonly exportName: "registerPackageInstallCommand";
84
+ }, {
85
+ readonly type: "registrar";
86
+ readonly root: "remove";
87
+ readonly parent: "program";
88
+ readonly module: "./commands/pkg-remove.js";
89
+ readonly exportName: "registerPackageRemoveCommand";
90
+ }, {
91
+ readonly type: "registrar";
92
+ readonly root: "publish";
93
+ readonly parent: "program";
94
+ readonly module: "./commands/publish.js";
95
+ readonly exportName: "registerPublishCommand";
96
+ }, {
97
+ readonly type: "registrar";
98
+ readonly root: "creators";
99
+ readonly parent: "program";
100
+ readonly module: "./commands/creators.js";
101
+ readonly exportName: "registerCreatorsCommand";
102
+ }, {
103
+ readonly type: "group";
104
+ readonly root: "sync";
105
+ readonly id: "sync";
106
+ readonly name: "sync";
107
+ readonly description: "Cloud sync commands — sync HQ to S3 for mobile access";
108
+ }, {
109
+ readonly type: "registrar";
110
+ readonly root: "sync";
111
+ readonly parent: "sync";
112
+ readonly module: "./commands/cloud.js";
113
+ readonly exportName: "registerCloudCommands";
114
+ }, {
115
+ readonly type: "registrar";
116
+ readonly root: "sync";
117
+ readonly parent: "sync";
118
+ readonly module: "./commands/sync-mode.js";
119
+ readonly exportName: "registerSyncModeCommand";
120
+ }, {
121
+ readonly type: "registrar";
122
+ readonly root: "sync";
123
+ readonly parent: "sync";
124
+ readonly module: "./commands/sync-narrow.js";
125
+ readonly exportName: "registerSyncNarrowCommand";
126
+ }, {
127
+ readonly type: "registrar";
128
+ readonly root: "sync";
129
+ readonly parent: "sync";
130
+ readonly module: "./commands/sync-manifest.js";
131
+ readonly exportName: "registerSyncManifestCommand";
132
+ }, {
133
+ readonly type: "group";
134
+ readonly root: "cloud";
135
+ readonly id: "cloud";
136
+ readonly name: "cloud";
137
+ readonly description: "Cloud commands — provision entities and manage cloud-backed companies";
138
+ }, {
139
+ readonly type: "registrar";
140
+ readonly root: "cloud";
141
+ readonly parent: "cloud";
142
+ readonly module: "./commands/cloud-provision.js";
143
+ readonly exportName: "registerCloudProvisionCommands";
144
+ }, {
145
+ readonly type: "registrar";
146
+ readonly root: "cloud";
147
+ readonly parent: "cloud";
148
+ readonly module: "./commands/cloud-demote.js";
149
+ readonly exportName: "registerCloudDemoteCommands";
150
+ }, {
151
+ readonly type: "registrar";
152
+ readonly root: "team-sync";
153
+ readonly parent: "program";
154
+ readonly module: "./commands/team-sync.js";
155
+ readonly exportName: "registerTeamSyncCommand";
156
+ }, {
157
+ readonly type: "registrar";
158
+ readonly root: "login";
159
+ readonly parent: "program";
160
+ readonly module: "./commands/login.js";
161
+ readonly exportName: "registerLoginCommand";
162
+ }, {
163
+ readonly type: "registrar";
164
+ readonly root: "logout";
165
+ readonly parent: "program";
166
+ readonly module: "./commands/logout.js";
167
+ readonly exportName: "registerLogoutCommand";
168
+ }, {
169
+ readonly type: "registrar";
170
+ readonly root: "whoami";
171
+ readonly parent: "program";
172
+ readonly module: "./commands/whoami.js";
173
+ readonly exportName: "registerWhoamiCommand";
174
+ }, {
175
+ readonly type: "registrar";
176
+ readonly root: "auth";
177
+ readonly parent: "program";
178
+ readonly module: "./commands/auth.js";
179
+ readonly exportName: "registerAuthCommands";
180
+ }, {
181
+ readonly type: "registrar";
182
+ readonly root: "secrets";
183
+ readonly parent: "program";
184
+ readonly module: "./commands/secrets.js";
185
+ readonly exportName: "registerSecretsCommand";
186
+ }, {
187
+ readonly type: "registrar";
188
+ readonly root: "db";
189
+ readonly parent: "program";
190
+ readonly module: "./commands/db.js";
191
+ readonly exportName: "registerDbCommand";
192
+ }, {
193
+ readonly type: "registrar";
194
+ readonly root: "api-keys";
195
+ readonly parent: "program";
196
+ readonly module: "./commands/api-keys.js";
197
+ readonly exportName: "registerApiKeysCommand";
198
+ }, {
199
+ readonly type: "registrar";
200
+ readonly root: "run";
201
+ readonly parent: "program";
202
+ readonly module: "./commands/run.js";
203
+ readonly exportName: "registerRunCommand";
204
+ }, {
205
+ readonly type: "registrar";
206
+ readonly root: "groups";
207
+ readonly parent: "program";
208
+ readonly module: "./commands/groups.js";
209
+ readonly exportName: "registerGroupsCommand";
210
+ }, {
211
+ readonly type: "registrar";
212
+ readonly root: "workers";
213
+ readonly parent: "program";
214
+ readonly module: "./commands/workers.js";
215
+ readonly exportName: "registerWorkersCommand";
216
+ }, {
217
+ readonly type: "registrar";
218
+ readonly root: "group-grants";
219
+ readonly parent: "program";
220
+ readonly module: "./commands/group-grants.js";
221
+ readonly exportName: "registerGroupGrantsCommand";
222
+ }, {
223
+ readonly type: "registrar";
224
+ readonly root: "files";
225
+ readonly parent: "program";
226
+ readonly module: "./commands/files.js";
227
+ readonly exportName: "registerFilesCommand";
228
+ readonly result: "files";
229
+ }, {
230
+ readonly type: "registrar";
231
+ readonly root: "files";
232
+ readonly parent: "files";
233
+ readonly module: "./commands/files-browse.js";
234
+ readonly exportName: "registerFilesBrowseCommands";
235
+ }, {
236
+ readonly type: "registrar";
237
+ readonly root: "access";
238
+ readonly parent: "program";
239
+ readonly module: "./commands/access.js";
240
+ readonly exportName: "registerAccessCommand";
241
+ }, {
242
+ readonly type: "registrar";
243
+ readonly root: "skill";
244
+ readonly parent: "program";
245
+ readonly module: "./commands/skill.js";
246
+ readonly exportName: "registerSkillCommand";
247
+ }, {
248
+ readonly type: "registrar";
249
+ readonly root: "members";
250
+ readonly parent: "program";
251
+ readonly module: "./commands/members.js";
252
+ readonly exportName: "registerMembersCommand";
253
+ }, {
254
+ readonly type: "registrar";
255
+ readonly root: "people";
256
+ readonly parent: "program";
257
+ readonly module: "./commands/people.js";
258
+ readonly exportName: "registerPeopleCommand";
259
+ }, {
260
+ readonly type: "registrar";
261
+ readonly root: "dm";
262
+ readonly parent: "program";
263
+ readonly module: "./commands/dm.js";
264
+ readonly exportName: "registerDmCommand";
265
+ }, {
266
+ readonly type: "registrar";
267
+ readonly root: "channels";
268
+ readonly parent: "program";
269
+ readonly module: "./commands/channels.js";
270
+ readonly exportName: "registerChannelsCommand";
271
+ }, {
272
+ readonly type: "registrar";
273
+ readonly root: "onboard";
274
+ readonly parent: "program";
275
+ readonly module: "./commands/onboard.js";
276
+ readonly exportName: "registerOnboardCommand";
277
+ }, {
278
+ readonly type: "registrar";
279
+ readonly root: "feedback";
280
+ readonly parent: "program";
281
+ readonly module: "./commands/feedback.js";
282
+ readonly exportName: "registerFeedbackCommand";
283
+ }, {
284
+ readonly type: "registrar";
285
+ readonly root: "meetings";
286
+ readonly parent: "program";
287
+ readonly module: "./commands/meetings.js";
288
+ readonly exportName: "registerMeetingsCommand";
289
+ }, {
290
+ readonly type: "registrar";
291
+ readonly root: "sources";
292
+ readonly parent: "program";
293
+ readonly module: "./commands/sources.js";
294
+ readonly exportName: "registerSourcesCommand";
295
+ }, {
296
+ readonly type: "registrar";
297
+ readonly root: "signals";
298
+ readonly parent: "program";
299
+ readonly module: "./commands/signals.js";
300
+ readonly exportName: "registerSignalsCommand";
301
+ }, {
302
+ readonly type: "registrar";
303
+ readonly root: "integrations";
304
+ readonly parent: "program";
305
+ readonly module: "./commands/integrations.js";
306
+ readonly exportName: "registerIntegrationsCommand";
307
+ }, {
308
+ readonly type: "registrar";
309
+ readonly root: "reindex";
310
+ readonly parent: "program";
311
+ readonly module: "./commands/reindex.js";
312
+ readonly exportName: "registerReindexCommand";
313
+ }, {
314
+ readonly type: "registrar";
315
+ readonly root: "rescue";
316
+ readonly parent: "program";
317
+ readonly module: "./commands/rescue.js";
318
+ readonly exportName: "registerRescueCommand";
319
+ }, {
320
+ readonly type: "registrar";
321
+ readonly root: "mcp";
322
+ readonly parent: "program";
323
+ readonly module: "./commands/mcp-status.js";
324
+ readonly exportName: "registerMcpCommand";
325
+ }, {
326
+ readonly type: "registrar";
327
+ readonly root: "crm";
328
+ readonly parent: "program";
329
+ readonly module: "./commands/crm.js";
330
+ readonly exportName: "registerCrmCommand";
331
+ }, {
332
+ readonly type: "registrar";
333
+ readonly root: "company";
334
+ readonly parent: "program";
335
+ readonly module: "./commands/company.js";
336
+ readonly exportName: "registerCompanyCommand";
337
+ }, {
338
+ readonly type: "registrar";
339
+ readonly root: "agents";
340
+ readonly parent: "program";
341
+ readonly module: "./commands/agents.js";
342
+ readonly exportName: "registerAgentsCommand";
343
+ }, {
344
+ readonly type: "registrar";
345
+ readonly root: "outposts";
346
+ readonly parent: "program";
347
+ readonly module: "./commands/outposts.js";
348
+ readonly exportName: "registerOutpostsCommand";
349
+ }, {
350
+ readonly type: "registrar";
351
+ readonly root: "billing";
352
+ readonly parent: "program";
353
+ readonly module: "./commands/billing.js";
354
+ readonly exportName: "registerBillingCommand";
355
+ }, {
356
+ readonly type: "registrar";
357
+ readonly root: "core";
358
+ readonly parent: "program";
359
+ readonly module: "./commands/core.js";
360
+ readonly exportName: "registerCoreCommands";
361
+ }, {
362
+ readonly type: "registrar";
363
+ readonly root: "search";
364
+ readonly parent: "program";
365
+ readonly module: "./commands/search.js";
366
+ readonly exportName: "registerSearchCommand";
367
+ }, {
368
+ readonly type: "registrar";
369
+ readonly root: "index";
370
+ readonly parent: "program";
371
+ readonly module: "./commands/index-cmd.js";
372
+ readonly exportName: "registerIndexCommand";
373
+ }, {
374
+ readonly type: "registrar";
375
+ readonly root: "doctor";
376
+ readonly parent: "program";
377
+ readonly module: "./commands/doctor.js";
378
+ readonly exportName: "registerDoctorCommand";
379
+ }, {
380
+ readonly type: "registrar";
381
+ readonly root: "mesh";
382
+ readonly parent: "program";
383
+ readonly module: "./commands/mesh.js";
384
+ readonly exportName: "registerMeshCommand";
385
+ }, {
386
+ readonly type: "registrar";
387
+ readonly root: "bot";
388
+ readonly parent: "program";
389
+ readonly module: "./commands/bot.js";
390
+ readonly exportName: "registerBotCommand";
391
+ }];
392
+ export declare function registerAllCommands(program: Command): Promise<void>;
393
+ export declare function registerCommandRoot(program: Command, root: string): Promise<boolean>;
394
+ //# sourceMappingURL=command-registration-plan.d.ts.map
@@ -0,0 +1,103 @@
1
+ /**
2
+ * The one authoritative registration plan for eager validation and lazy
3
+ * invocation. Multi-module roots keep the old registration order here.
4
+ */
5
+ export const REGISTRATION_PLAN = [
6
+ { type: "group", root: "modules", id: "modules", name: "modules", description: "Module management commands" },
7
+ { type: "registrar", root: "modules", parent: "modules", module: "./commands/add.js", exportName: "registerAddCommand" },
8
+ { type: "registrar", root: "modules", parent: "modules", module: "./commands/sync.js", exportName: "registerSyncCommand" },
9
+ { type: "registrar", root: "modules", parent: "modules", module: "./commands/list.js", exportName: "registerListCommand" },
10
+ { type: "registrar", root: "modules", parent: "modules", module: "./commands/update.js", exportName: "registerUpdateCommand" },
11
+ { type: "group", root: "packages", id: "packages", name: "packages", description: "Package management commands" },
12
+ { type: "registrar", root: "packages", parent: "packages", module: "./commands/pkg-install.js", exportName: "registerPackageInstallCommand" },
13
+ { type: "registrar", root: "packages", parent: "packages", module: "./commands/pkg-remove.js", exportName: "registerPackageRemoveCommand" },
14
+ { type: "registrar", root: "packages", parent: "packages", module: "./commands/pkg-update.js", exportName: "registerPackageUpdateCommand" },
15
+ { type: "registrar", root: "packages", parent: "packages", module: "./commands/pkg-list.js", exportName: "registerPackageListCommand" },
16
+ { type: "registrar", root: "packages", parent: "packages", module: "./commands/packs.js", exportName: "registerPacksCommand" },
17
+ { type: "registrar", root: "packs", parent: "program", module: "./commands/packs.js", exportName: "registerPacksCommand" },
18
+ { type: "registrar", root: "install", parent: "program", module: "./commands/pkg-install.js", exportName: "registerPackageInstallCommand" },
19
+ { type: "registrar", root: "remove", parent: "program", module: "./commands/pkg-remove.js", exportName: "registerPackageRemoveCommand" },
20
+ { type: "registrar", root: "publish", parent: "program", module: "./commands/publish.js", exportName: "registerPublishCommand" },
21
+ { type: "registrar", root: "creators", parent: "program", module: "./commands/creators.js", exportName: "registerCreatorsCommand" },
22
+ { type: "group", root: "sync", id: "sync", name: "sync", description: "Cloud sync commands — sync HQ to S3 for mobile access" },
23
+ { type: "registrar", root: "sync", parent: "sync", module: "./commands/cloud.js", exportName: "registerCloudCommands" },
24
+ { type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-mode.js", exportName: "registerSyncModeCommand" },
25
+ { type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-narrow.js", exportName: "registerSyncNarrowCommand" },
26
+ { type: "registrar", root: "sync", parent: "sync", module: "./commands/sync-manifest.js", exportName: "registerSyncManifestCommand" },
27
+ { type: "group", root: "cloud", id: "cloud", name: "cloud", description: "Cloud commands — provision entities and manage cloud-backed companies" },
28
+ { type: "registrar", root: "cloud", parent: "cloud", module: "./commands/cloud-provision.js", exportName: "registerCloudProvisionCommands" },
29
+ { type: "registrar", root: "cloud", parent: "cloud", module: "./commands/cloud-demote.js", exportName: "registerCloudDemoteCommands" },
30
+ { type: "registrar", root: "team-sync", parent: "program", module: "./commands/team-sync.js", exportName: "registerTeamSyncCommand" },
31
+ { type: "registrar", root: "login", parent: "program", module: "./commands/login.js", exportName: "registerLoginCommand" },
32
+ { type: "registrar", root: "logout", parent: "program", module: "./commands/logout.js", exportName: "registerLogoutCommand" },
33
+ { type: "registrar", root: "whoami", parent: "program", module: "./commands/whoami.js", exportName: "registerWhoamiCommand" },
34
+ { type: "registrar", root: "auth", parent: "program", module: "./commands/auth.js", exportName: "registerAuthCommands" },
35
+ { type: "registrar", root: "secrets", parent: "program", module: "./commands/secrets.js", exportName: "registerSecretsCommand" },
36
+ { type: "registrar", root: "db", parent: "program", module: "./commands/db.js", exportName: "registerDbCommand" },
37
+ { type: "registrar", root: "api-keys", parent: "program", module: "./commands/api-keys.js", exportName: "registerApiKeysCommand" },
38
+ { type: "registrar", root: "run", parent: "program", module: "./commands/run.js", exportName: "registerRunCommand" },
39
+ { type: "registrar", root: "groups", parent: "program", module: "./commands/groups.js", exportName: "registerGroupsCommand" },
40
+ { type: "registrar", root: "workers", parent: "program", module: "./commands/workers.js", exportName: "registerWorkersCommand" },
41
+ { type: "registrar", root: "group-grants", parent: "program", module: "./commands/group-grants.js", exportName: "registerGroupGrantsCommand" },
42
+ { type: "registrar", root: "files", parent: "program", module: "./commands/files.js", exportName: "registerFilesCommand", result: "files" },
43
+ { type: "registrar", root: "files", parent: "files", module: "./commands/files-browse.js", exportName: "registerFilesBrowseCommands" },
44
+ { type: "registrar", root: "access", parent: "program", module: "./commands/access.js", exportName: "registerAccessCommand" },
45
+ { type: "registrar", root: "skill", parent: "program", module: "./commands/skill.js", exportName: "registerSkillCommand" },
46
+ { type: "registrar", root: "members", parent: "program", module: "./commands/members.js", exportName: "registerMembersCommand" },
47
+ { type: "registrar", root: "people", parent: "program", module: "./commands/people.js", exportName: "registerPeopleCommand" },
48
+ { type: "registrar", root: "dm", parent: "program", module: "./commands/dm.js", exportName: "registerDmCommand" },
49
+ { type: "registrar", root: "channels", parent: "program", module: "./commands/channels.js", exportName: "registerChannelsCommand" },
50
+ { type: "registrar", root: "onboard", parent: "program", module: "./commands/onboard.js", exportName: "registerOnboardCommand" },
51
+ { type: "registrar", root: "feedback", parent: "program", module: "./commands/feedback.js", exportName: "registerFeedbackCommand" },
52
+ { type: "registrar", root: "meetings", parent: "program", module: "./commands/meetings.js", exportName: "registerMeetingsCommand" },
53
+ { type: "registrar", root: "sources", parent: "program", module: "./commands/sources.js", exportName: "registerSourcesCommand" },
54
+ { type: "registrar", root: "signals", parent: "program", module: "./commands/signals.js", exportName: "registerSignalsCommand" },
55
+ { type: "registrar", root: "integrations", parent: "program", module: "./commands/integrations.js", exportName: "registerIntegrationsCommand" },
56
+ { type: "registrar", root: "reindex", parent: "program", module: "./commands/reindex.js", exportName: "registerReindexCommand" },
57
+ { type: "registrar", root: "rescue", parent: "program", module: "./commands/rescue.js", exportName: "registerRescueCommand" },
58
+ { type: "registrar", root: "mcp", parent: "program", module: "./commands/mcp-status.js", exportName: "registerMcpCommand" },
59
+ { type: "registrar", root: "crm", parent: "program", module: "./commands/crm.js", exportName: "registerCrmCommand" },
60
+ { type: "registrar", root: "company", parent: "program", module: "./commands/company.js", exportName: "registerCompanyCommand" },
61
+ { type: "registrar", root: "agents", parent: "program", module: "./commands/agents.js", exportName: "registerAgentsCommand" },
62
+ { type: "registrar", root: "outposts", parent: "program", module: "./commands/outposts.js", exportName: "registerOutpostsCommand" },
63
+ { type: "registrar", root: "billing", parent: "program", module: "./commands/billing.js", exportName: "registerBillingCommand" },
64
+ { type: "registrar", root: "core", parent: "program", module: "./commands/core.js", exportName: "registerCoreCommands" },
65
+ { type: "registrar", root: "search", parent: "program", module: "./commands/search.js", exportName: "registerSearchCommand" },
66
+ { type: "registrar", root: "index", parent: "program", module: "./commands/index-cmd.js", exportName: "registerIndexCommand" },
67
+ { type: "registrar", root: "doctor", parent: "program", module: "./commands/doctor.js", exportName: "registerDoctorCommand" },
68
+ { type: "registrar", root: "mesh", parent: "program", module: "./commands/mesh.js", exportName: "registerMeshCommand" },
69
+ { type: "registrar", root: "bot", parent: "program", module: "./commands/bot.js", exportName: "registerBotCommand" },
70
+ ];
71
+ async function executePlan(program, steps) {
72
+ const parents = new Map([["program", program]]);
73
+ for (const step of steps) {
74
+ if (step.type === "group") {
75
+ parents.set(step.id, program.command(step.name).description(step.description));
76
+ continue;
77
+ }
78
+ const parent = parents.get(step.parent);
79
+ if (!parent)
80
+ throw new Error(`Missing command parent '${step.parent}' for '${step.exportName}'`);
81
+ const imported = await import(step.module);
82
+ const register = imported[step.exportName];
83
+ if (!register)
84
+ throw new Error(`Missing command registrar '${step.exportName}' from '${step.module}'`);
85
+ const result = register(parent);
86
+ if (step.result) {
87
+ if (!result)
88
+ throw new Error(`Command registrar '${step.exportName}' did not return '${step.result}'`);
89
+ parents.set(step.result, result);
90
+ }
91
+ }
92
+ }
93
+ export async function registerAllCommands(program) {
94
+ await executePlan(program, REGISTRATION_PLAN);
95
+ }
96
+ export async function registerCommandRoot(program, root) {
97
+ const steps = REGISTRATION_PLAN.filter((step) => step.root === root);
98
+ if (steps.length === 0)
99
+ return false;
100
+ await executePlan(program, steps);
101
+ return true;
102
+ }
103
+ //# sourceMappingURL=command-registration-plan.js.map
@@ -46,6 +46,7 @@ import { archiveOldThreads } from "../lib/core-utils/archive-old-threads.js";
46
46
  import { qmdReindexAfterSync } from "../lib/core-utils/qmd-reindex-after-sync.js";
47
47
  import { softTimeoutCommand } from "../lib/core-utils/soft-timeout.js";
48
48
  import { timeoutGuardCommand } from "../lib/core-utils/timeout-guard.js";
49
+ import { readSentryReportStdin, reportSentryEvent } from "../lib/core-utils/sentry-report.js";
49
50
  /**
50
51
  * These commands are now native implementations. Their retained shell assets
51
52
  * are deliberately claimed in SCAFFOLD_ONLY_ASSETS: loose HQ trees still ship
@@ -457,6 +458,23 @@ export function registerCoreCommands(program) {
457
458
  if (code !== 0)
458
459
  process.exit(code);
459
460
  });
461
+ // `hq core sentry report` — constrained, stderr-diagnostic-only transport
462
+ // for hook health events. Event data is accepted only on stdin so it never
463
+ // appears in the process list shared by the fleet.
464
+ core
465
+ .command("sentry")
466
+ .description("Constrained diagnostics transport for HQ hooks")
467
+ .command("report")
468
+ .description("Report one validated hook diagnostic from stdin")
469
+ .option("--dry-run", "validate and print the scrubbed Sentry event projection without sending")
470
+ .option("--timeout-ms <milliseconds>", "bounded Sentry flush budget (1-5000ms)")
471
+ .action(async (options) => {
472
+ const stdin = await readSentryReportStdin(process.stdin);
473
+ const timeoutMs = options.timeoutMs === undefined ? undefined : Number(options.timeoutMs);
474
+ const result = await reportSentryEvent(stdin ?? "", { dryRun: options.dryRun, timeoutMs });
475
+ if (result.code !== 0)
476
+ process.exitCode = result.code;
477
+ });
460
478
  return core;
461
479
  }
462
480
  //# sourceMappingURL=core.js.map
@@ -2,5 +2,22 @@
2
2
  * hq whoami — displays current user or 'not logged in'
3
3
  */
4
4
  import { Command } from 'commander';
5
+ export interface WhoamiTokenIdentity {
6
+ email?: string;
7
+ sub?: string;
8
+ delegatedEmail?: string;
9
+ delegatedSub?: string;
10
+ entityType?: string;
11
+ entityUid?: string;
12
+ }
13
+ export interface WhoamiDisplayIdentity {
14
+ email?: string;
15
+ sub?: string;
16
+ }
17
+ /**
18
+ * Resolves the person represented by an ID token without pairing a delegated
19
+ * email with the token subject of the delegating machine.
20
+ */
21
+ export declare function resolveWhoamiIdentity(identity: WhoamiTokenIdentity): WhoamiDisplayIdentity;
5
22
  export declare function registerWhoamiCommand(program: Command): void;
6
23
  //# sourceMappingURL=whoami.d.ts.map
@@ -5,11 +5,33 @@ import chalk from 'chalk';
5
5
  import { loadCachedTokens, isExpiring, loadMachineCreds, } from '@indigoai-us/hq-cloud';
6
6
  import { peekIdToken as decodeIdToken } from "../utils/id-token.js";
7
7
  import { loadMachineCachedTokens, resolveCognitoTokenSource } from "../utils/cognito-session.js";
8
+ /**
9
+ * Resolves the person represented by an ID token without pairing a delegated
10
+ * email with the token subject of the delegating machine.
11
+ */
12
+ export function resolveWhoamiIdentity(identity) {
13
+ if (identity.email !== undefined && identity.sub !== undefined) {
14
+ return { email: identity.email, sub: identity.sub };
15
+ }
16
+ if (identity.delegatedEmail !== undefined && identity.delegatedSub !== undefined) {
17
+ return { email: identity.delegatedEmail, sub: identity.delegatedSub };
18
+ }
19
+ if (identity.email !== undefined || identity.sub !== undefined) {
20
+ return { email: identity.email, sub: identity.sub };
21
+ }
22
+ return {};
23
+ }
8
24
  function peekIdToken(idToken) {
9
25
  const decoded = decodeIdToken(idToken);
10
26
  return {
11
27
  email: typeof decoded.email === "string" ? decoded.email : undefined,
12
28
  sub: typeof decoded.sub === "string" ? decoded.sub : undefined,
29
+ delegatedEmail: typeof decoded["custom:delegatedEmail"] === "string"
30
+ ? decoded["custom:delegatedEmail"]
31
+ : undefined,
32
+ delegatedSub: typeof decoded["custom:delegatedSub"] === "string"
33
+ ? decoded["custom:delegatedSub"]
34
+ : undefined,
13
35
  entityType: typeof decoded["custom:entityType"] === "string"
14
36
  ? decoded["custom:entityType"]
15
37
  : undefined,
@@ -34,6 +56,7 @@ export function registerWhoamiCommand(program) {
34
56
  const machineCreds = machine ? loadMachineCreds() : null;
35
57
  const identityCache = machine ? loadMachineCachedTokens() : cached;
36
58
  const identity = identityCache ? peekIdToken(identityCache.idToken) : {};
59
+ const displayedIdentity = resolveWhoamiIdentity(identity);
37
60
  const claims = identityCache ? decodeIdToken(identityCache.idToken) : {};
38
61
  // Modern credentials carry the canonical UID. Legacy caches may only
39
62
  // supply a UID when their subject is bound to the selected username.
@@ -48,7 +71,7 @@ export function registerWhoamiCommand(program) {
48
71
  schemaVersion: 1,
49
72
  authenticated: machine ? Boolean(machineCreds) : Boolean(cached && !isExpiring(cached, 0)),
50
73
  tokenSource: machine ? 'machine' : 'person',
51
- email: machine ? null : identity.email ?? null,
74
+ email: machine ? null : displayedIdentity.email ?? null,
52
75
  personUid: !machine && identity.entityType === 'person' ? identity.entityUid ?? null : null,
53
76
  agentUid,
54
77
  username: machineCreds?.username ?? null,
@@ -72,11 +95,11 @@ export function registerWhoamiCommand(program) {
72
95
  return;
73
96
  }
74
97
  if (isExpiring(cached, 0)) {
75
- const who = peekIdToken(cached.idToken).email ?? 'unknown';
98
+ const who = resolveWhoamiIdentity(peekIdToken(cached.idToken)).email ?? 'unknown';
76
99
  console.log(chalk.yellow(`Session expired for ${who}. Run 'hq login' to re-authenticate.`));
77
100
  return;
78
101
  }
79
- const { email, sub } = peekIdToken(cached.idToken);
102
+ const { email, sub } = resolveWhoamiIdentity(peekIdToken(cached.idToken));
80
103
  console.log(`Logged in as ${email ?? 'unknown'}${sub ? ` (${sub})` : ''}`);
81
104
  }
82
105
  catch (error) {