@indigoai-us/hq-cli 5.325.0 → 5.327.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/bin/hq-auth-refresh.js +2 -3
  3. package/dist/command-catalog.generated.d.ts +19 -1
  4. package/dist/command-catalog.generated.js +21 -1
  5. package/dist/commands/anywhere-runtime-flag.d.ts +2 -2
  6. package/dist/commands/anywhere-runtime-flag.js +2 -2
  7. package/dist/commands/auth.js +3 -1
  8. package/dist/commands/core-detect-stale-review-base-fast.d.ts +2 -0
  9. package/dist/commands/core-detect-stale-review-base-fast.js +23 -0
  10. package/dist/commands/core-job-remote-launcher.js +2 -3
  11. package/dist/commands/core-register-project-native.js +1 -1
  12. package/dist/commands/core-repo-run-registry-fast.d.ts +2 -0
  13. package/dist/commands/core-repo-run-registry-fast.js +35 -0
  14. package/dist/commands/core-rrr-worktree-scope-fix-fast-flag.d.ts +7 -0
  15. package/dist/commands/core-rrr-worktree-scope-fix-fast-flag.js +25 -0
  16. package/dist/commands/core-session-journal-native.js +1 -1
  17. package/dist/commands/core-share-suggestion-state-fast.d.ts +2 -0
  18. package/dist/commands/core-share-suggestion-state-fast.js +25 -0
  19. package/dist/commands/daemon.js +1 -1
  20. package/dist/commands/install-global.d.ts +10 -0
  21. package/dist/commands/install-global.js +96 -41
  22. package/dist/commands/logout.js +2 -0
  23. package/dist/commands/mcp-serve.d.ts +28 -0
  24. package/dist/commands/mcp-serve.js +165 -0
  25. package/dist/commands/mcp-status.js +14 -0
  26. package/dist/fast-core.js +3 -6
  27. package/dist/fast-scaffold.js +5 -1
  28. package/dist/index.d.ts +3 -0
  29. package/dist/index.js +9 -0
  30. package/dist/lanes-drain-hook.js +2 -2
  31. package/dist/lib/anywhere-runtime-fast-flag.d.ts +3 -0
  32. package/dist/lib/anywhere-runtime-fast-flag.js +23 -0
  33. package/dist/lib/anywhere-runtime-flag-key.d.ts +3 -0
  34. package/dist/lib/anywhere-runtime-flag-key.js +3 -0
  35. package/dist/lib/daemon/mcp-endpoint.d.ts +8 -0
  36. package/dist/lib/daemon/mcp-endpoint.js +30 -0
  37. package/dist/lib/daemon/mcp-oauth.d.ts +24 -0
  38. package/dist/lib/daemon/mcp-oauth.js +298 -0
  39. package/dist/lib/daemon/ops/mcp.d.ts +53 -0
  40. package/dist/lib/daemon/ops/mcp.js +217 -0
  41. package/dist/lib/daemon/protocol.d.ts +2 -1
  42. package/dist/lib/daemon/protocol.js +3 -1
  43. package/dist/lib/daemon/server.d.ts +5 -0
  44. package/dist/lib/daemon/server.js +78 -11
  45. package/dist/lib/install/claude-targets.d.ts +11 -4
  46. package/dist/lib/install/claude-targets.js +21 -9
  47. package/dist/lib/install/codex-targets.d.ts +8 -4
  48. package/dist/lib/install/codex-targets.js +18 -9
  49. package/dist/lib/lanes/watcher-main.js +2 -4
  50. package/dist/lib/mcp/hosted-search-tools.d.ts +4 -0
  51. package/dist/lib/mcp/hosted-search-tools.js +28 -0
  52. package/dist/lib/mcp/hq-mcp-tools.generated.d.ts +3 -0
  53. package/dist/lib/mcp/hq-mcp-tools.generated.js +538 -0
  54. package/dist/lib/mcp/prompts.d.ts +30 -0
  55. package/dist/lib/mcp/prompts.js +48 -0
  56. package/dist/lib/mcp/tools.d.ts +22 -0
  57. package/dist/lib/mcp/tools.js +82 -0
  58. package/dist/lib/mcp/types.d.ts +6 -0
  59. package/dist/lib/mcp/types.js +2 -0
  60. package/dist/lib/process-flag-company-context-fast.d.ts +4 -0
  61. package/dist/lib/process-flag-company-context-fast.js +20 -0
  62. package/dist/lib/process-flag-company-context-light.d.ts +9 -0
  63. package/dist/lib/process-flag-company-context-light.js +81 -0
  64. package/dist/lib/process-flag-company-context.d.ts +2 -4
  65. package/dist/lib/process-flag-company-context.js +2 -46
  66. package/dist/utils/hq-roots-core.d.ts +130 -0
  67. package/dist/utils/hq-roots-core.js +354 -0
  68. package/dist/utils/hq-roots.d.ts +2 -129
  69. package/dist/utils/hq-roots.js +2 -353
  70. package/dist/utils/is-main-module.d.ts +3 -0
  71. package/dist/utils/is-main-module.js +19 -0
  72. package/dist/utils/package-root-diagnostics.d.ts +5 -36
  73. package/dist/utils/package-root-diagnostics.js +4 -83
  74. package/dist/utils/package-root-resolution-error.d.ts +32 -0
  75. package/dist/utils/package-root-resolution-error.js +79 -0
  76. package/dist/utils/staged-npm-install.js +2 -1
  77. package/package.json +3 -1
@@ -0,0 +1,538 @@
1
+ export const HQ_MCP_TOOLS = [
2
+ {
3
+ "name": "hq_companies_list",
4
+ "description": "Returns the companies the authenticated HQ user is a member of, with roles",
5
+ "inputSchema": {
6
+ "type": "object",
7
+ "properties": {},
8
+ "$schema": "http://json-schema.org/draft-07/schema#"
9
+ }
10
+ },
11
+ {
12
+ "name": "hq_company_ping",
13
+ "description": "Confirms the caller is a member of the given company. Useful for testing the company-scope guard.",
14
+ "inputSchema": {
15
+ "type": "object",
16
+ "properties": {
17
+ "company": {
18
+ "description": "Company slug — must match one of your memberships",
19
+ "type": "string"
20
+ }
21
+ },
22
+ "required": [
23
+ "company"
24
+ ],
25
+ "$schema": "http://json-schema.org/draft-07/schema#"
26
+ }
27
+ },
28
+ {
29
+ "name": "hq_exec_check",
30
+ "description": "Checks whether an hq CLI subcommand is on the bridge whitelist. Returns allowed or a refusal message.",
31
+ "inputSchema": {
32
+ "type": "object",
33
+ "properties": {
34
+ "subcommand": {
35
+ "description": "The hq subcommand to validate",
36
+ "type": "string"
37
+ }
38
+ },
39
+ "required": [
40
+ "subcommand"
41
+ ],
42
+ "$schema": "http://json-schema.org/draft-07/schema#"
43
+ }
44
+ },
45
+ {
46
+ "name": "hq_files_list",
47
+ "description": "Lists files and directories under a company-scoped prefix. Paths under settings/, secrets, and workers/ are excluded.",
48
+ "inputSchema": {
49
+ "type": "object",
50
+ "properties": {
51
+ "prefix": {
52
+ "description": "Directory prefix relative to the company root (e.g. \"knowledge\", \"projects\"). Defaults to the root.",
53
+ "type": "string"
54
+ },
55
+ "company": {
56
+ "description": "Company slug — must match one of your memberships",
57
+ "type": "string"
58
+ }
59
+ },
60
+ "required": [
61
+ "company"
62
+ ],
63
+ "$schema": "http://json-schema.org/draft-07/schema#"
64
+ }
65
+ },
66
+ {
67
+ "name": "hq_files_read",
68
+ "description": "Returns the content of a file, scoped to the company directory. Paths under settings/, secrets, and workers/ are refused.",
69
+ "inputSchema": {
70
+ "type": "object",
71
+ "properties": {
72
+ "path": {
73
+ "description": "Path relative to the company root, e.g. \"knowledge/overview.md\"",
74
+ "type": "string"
75
+ },
76
+ "company": {
77
+ "description": "Company slug — must match one of your memberships",
78
+ "type": "string"
79
+ }
80
+ },
81
+ "required": [
82
+ "path",
83
+ "company"
84
+ ],
85
+ "$schema": "http://json-schema.org/draft-07/schema#"
86
+ }
87
+ },
88
+ {
89
+ "name": "hq_files_write",
90
+ "description": "Writes a UTF-8 file to one of the caller's writable areas within a company. Allowed top-level prefixes: notes/, inbox/, drafts/, scratch/, journal/. Refuses paths under settings/, secrets, workers/, or outside the caller's write ACL. Overwriting an existing file requires { confirm: true } — by default, an existing file causes a refusal.",
91
+ "inputSchema": {
92
+ "type": "object",
93
+ "properties": {
94
+ "path": {
95
+ "description": "Path relative to the company root, e.g. \"notes/2026-06-02-idea.md\"",
96
+ "type": "string"
97
+ },
98
+ "content": {
99
+ "description": "UTF-8 content to write",
100
+ "type": "string"
101
+ },
102
+ "confirm": {
103
+ "description": "Set true to overwrite an existing file. Defaults to false (create-or-refuse).",
104
+ "type": "boolean"
105
+ },
106
+ "company": {
107
+ "description": "Company slug — must match one of your memberships",
108
+ "type": "string"
109
+ }
110
+ },
111
+ "required": [
112
+ "path",
113
+ "content",
114
+ "company"
115
+ ],
116
+ "$schema": "http://json-schema.org/draft-07/schema#"
117
+ }
118
+ },
119
+ {
120
+ "name": "hq_knowledge_capture",
121
+ "description": "Captures a dated knowledge note under the company's knowledge/captures/ folder. Filename pattern: YYYY-MM-DD-HHMM-{slug}.md (UTC). Additive — never overwrites.",
122
+ "inputSchema": {
123
+ "type": "object",
124
+ "properties": {
125
+ "slug": {
126
+ "description": "Short slug for the capture filename (e.g. \"deploy-runbook\"). Sanitized to kebab-case.",
127
+ "type": "string"
128
+ },
129
+ "title": {
130
+ "description": "Optional human-readable title for the captured note. Defaults to the slug.",
131
+ "type": "string"
132
+ },
133
+ "content": {
134
+ "description": "Markdown content for the knowledge capture",
135
+ "type": "string"
136
+ },
137
+ "company": {
138
+ "description": "Company slug — must match one of your memberships",
139
+ "type": "string"
140
+ }
141
+ },
142
+ "required": [
143
+ "slug",
144
+ "content",
145
+ "company"
146
+ ],
147
+ "$schema": "http://json-schema.org/draft-07/schema#"
148
+ }
149
+ },
150
+ {
151
+ "name": "hq_knowledge_get",
152
+ "description": "Returns the content of a knowledge doc. Path is relative to the company knowledge root (e.g. \"engineering/api-design.md\").",
153
+ "inputSchema": {
154
+ "type": "object",
155
+ "properties": {
156
+ "path": {
157
+ "description": "Relative path from the knowledge root, e.g. \"engineering/patterns.md\"",
158
+ "type": "string"
159
+ },
160
+ "company": {
161
+ "description": "Company slug — must match one of your memberships",
162
+ "type": "string"
163
+ }
164
+ },
165
+ "required": [
166
+ "path",
167
+ "company"
168
+ ],
169
+ "$schema": "http://json-schema.org/draft-07/schema#"
170
+ }
171
+ },
172
+ {
173
+ "name": "hq_knowledge_list",
174
+ "description": "Lists knowledge docs for a company, grouped by domain (architecture, engineering, product, etc.). Optionally filter to a single domain.",
175
+ "inputSchema": {
176
+ "type": "object",
177
+ "properties": {
178
+ "domain": {
179
+ "description": "Optional domain filter — e.g. \"engineering\", \"product\"",
180
+ "type": "string"
181
+ },
182
+ "company": {
183
+ "description": "Company slug — must match one of your memberships",
184
+ "type": "string"
185
+ }
186
+ },
187
+ "required": [
188
+ "company"
189
+ ],
190
+ "$schema": "http://json-schema.org/draft-07/schema#"
191
+ }
192
+ },
193
+ {
194
+ "name": "hq_knowledge_search",
195
+ "description": "Semantic search over a company's qmd-indexed knowledge and projects. Returns ranked hits (path, title, snippet, score). Scoped to the company's collection — results never leak across companies.",
196
+ "inputSchema": {
197
+ "type": "object",
198
+ "properties": {
199
+ "query": {
200
+ "description": "Search query — natural language or keywords",
201
+ "type": "string",
202
+ "minLength": 1
203
+ },
204
+ "limit": {
205
+ "description": "Max results (default 10)",
206
+ "type": "integer",
207
+ "minimum": 1,
208
+ "maximum": 50
209
+ },
210
+ "company": {
211
+ "description": "Company slug — must match one of your memberships",
212
+ "type": "string"
213
+ }
214
+ },
215
+ "required": [
216
+ "query",
217
+ "company"
218
+ ],
219
+ "$schema": "http://json-schema.org/draft-07/schema#"
220
+ }
221
+ },
222
+ {
223
+ "name": "hq_personal_capture",
224
+ "description": "Captures a dated note into the caller's PERSONAL vault. Defaults to knowledge/captures/{stamp}-{slug}.md. Set kind=note for notes/captures/. Additive — never overwrites.",
225
+ "inputSchema": {
226
+ "type": "object",
227
+ "properties": {
228
+ "slug": {
229
+ "description": "Short slug for the capture filename. Sanitized to kebab-case.",
230
+ "type": "string"
231
+ },
232
+ "title": {
233
+ "description": "Optional human-readable title — defaults to the slug.",
234
+ "type": "string"
235
+ },
236
+ "content": {
237
+ "description": "Markdown content",
238
+ "type": "string"
239
+ },
240
+ "kind": {
241
+ "description": "Where to capture under the personal vault. Defaults to \"knowledge\".",
242
+ "type": "string",
243
+ "enum": [
244
+ "knowledge",
245
+ "note"
246
+ ]
247
+ }
248
+ },
249
+ "required": [
250
+ "slug",
251
+ "content"
252
+ ],
253
+ "$schema": "http://json-schema.org/draft-07/schema#"
254
+ }
255
+ },
256
+ {
257
+ "name": "hq_ping",
258
+ "description": "Health check — confirms the HQ bridge is running",
259
+ "inputSchema": {
260
+ "type": "object",
261
+ "properties": {},
262
+ "$schema": "http://json-schema.org/draft-07/schema#"
263
+ }
264
+ },
265
+ {
266
+ "name": "hq_policies_list",
267
+ "description": "Lists active policies for a company and/or your personal policies. Policies are injected context — they inform behavior but are not programmatically enforced by the bridge.",
268
+ "inputSchema": {
269
+ "type": "object",
270
+ "properties": {
271
+ "scope": {
272
+ "description": "Which policies to list: \"company\", \"personal\", or \"all\" (default)",
273
+ "type": "string",
274
+ "enum": [
275
+ "company",
276
+ "personal",
277
+ "all"
278
+ ]
279
+ },
280
+ "company": {
281
+ "description": "Company slug — must match one of your memberships",
282
+ "type": "string"
283
+ }
284
+ },
285
+ "required": [
286
+ "company"
287
+ ],
288
+ "$schema": "http://json-schema.org/draft-07/schema#"
289
+ }
290
+ },
291
+ {
292
+ "name": "hq_policy_get",
293
+ "description": "Returns the full content of a named policy. Policies are injected context — they describe how you should behave, but the bridge does not enforce them as gates.",
294
+ "inputSchema": {
295
+ "type": "object",
296
+ "properties": {
297
+ "name": {
298
+ "description": "Policy filename, e.g. \"aws-credentials-safety.md\"",
299
+ "type": "string"
300
+ },
301
+ "scope": {
302
+ "description": "Where to look: \"company\" (default) or \"personal\"",
303
+ "type": "string",
304
+ "enum": [
305
+ "company",
306
+ "personal"
307
+ ]
308
+ },
309
+ "company": {
310
+ "description": "Company slug — must match one of your memberships",
311
+ "type": "string"
312
+ }
313
+ },
314
+ "required": [
315
+ "name",
316
+ "company"
317
+ ],
318
+ "$schema": "http://json-schema.org/draft-07/schema#"
319
+ }
320
+ },
321
+ {
322
+ "name": "hq_project_get",
323
+ "description": "Returns a project's prd.json, README, and journal file index. Project is identified by its directory slug (e.g. 'hq-chat-mcp').",
324
+ "inputSchema": {
325
+ "type": "object",
326
+ "properties": {
327
+ "project": {
328
+ "description": "Project directory slug, e.g. \"hq-chat-mcp\"",
329
+ "type": "string"
330
+ },
331
+ "company": {
332
+ "description": "Company slug — must match one of your memberships",
333
+ "type": "string"
334
+ }
335
+ },
336
+ "required": [
337
+ "project",
338
+ "company"
339
+ ],
340
+ "$schema": "http://json-schema.org/draft-07/schema#"
341
+ }
342
+ },
343
+ {
344
+ "name": "hq_project_journal_append",
345
+ "description": "Appends a new dated entry to a project's journal/ directory. Filename pattern: YYYY-MM-DD-HHMM-{slug}.md (UTC). Additive — never overwrites or modifies existing entries.",
346
+ "inputSchema": {
347
+ "type": "object",
348
+ "properties": {
349
+ "project": {
350
+ "description": "Project directory slug, e.g. \"hq-chat-mcp\"",
351
+ "type": "string"
352
+ },
353
+ "slug": {
354
+ "description": "Short slug for the entry filename (e.g. \"design-notes\"). Will be sanitized to kebab-case.",
355
+ "type": "string"
356
+ },
357
+ "content": {
358
+ "description": "Markdown content for the journal entry",
359
+ "type": "string"
360
+ },
361
+ "company": {
362
+ "description": "Company slug — must match one of your memberships",
363
+ "type": "string"
364
+ }
365
+ },
366
+ "required": [
367
+ "project",
368
+ "slug",
369
+ "content",
370
+ "company"
371
+ ],
372
+ "$schema": "http://json-schema.org/draft-07/schema#"
373
+ }
374
+ },
375
+ {
376
+ "name": "hq_project_status",
377
+ "description": "Returns a project's story pass-rate, blockers (stories with unmet dependencies), and the full dependsOn graph.",
378
+ "inputSchema": {
379
+ "type": "object",
380
+ "properties": {
381
+ "project": {
382
+ "description": "Project directory slug, e.g. \"hq-chat-mcp\"",
383
+ "type": "string"
384
+ },
385
+ "company": {
386
+ "description": "Company slug — must match one of your memberships",
387
+ "type": "string"
388
+ }
389
+ },
390
+ "required": [
391
+ "project",
392
+ "company"
393
+ ],
394
+ "$schema": "http://json-schema.org/draft-07/schema#"
395
+ }
396
+ },
397
+ {
398
+ "name": "hq_projects_list",
399
+ "description": "Lists all projects for a company with name, status (done/in-progress/planning), story count, and description.",
400
+ "inputSchema": {
401
+ "type": "object",
402
+ "properties": {
403
+ "company": {
404
+ "description": "Company slug — must match one of your memberships",
405
+ "type": "string"
406
+ }
407
+ },
408
+ "required": [
409
+ "company"
410
+ ],
411
+ "$schema": "http://json-schema.org/draft-07/schema#"
412
+ }
413
+ },
414
+ {
415
+ "name": "hq_run",
416
+ "description": "Executes a pre-approved `hq run` operation by name. Only whitelisted operations are allowed — arbitrary `hq run -- <cmd>` is blocked to prevent secret exfiltration via printenv or similar. Use hq_run_list to see available operations.",
417
+ "inputSchema": {
418
+ "type": "object",
419
+ "properties": {
420
+ "operation": {
421
+ "description": "Name of the whitelisted operation (e.g. \"version\"). Use hq_run_list to see available operations.",
422
+ "type": "string"
423
+ },
424
+ "company": {
425
+ "description": "Company slug — must match one of your memberships",
426
+ "type": "string"
427
+ }
428
+ },
429
+ "required": [
430
+ "operation",
431
+ "company"
432
+ ],
433
+ "$schema": "http://json-schema.org/draft-07/schema#"
434
+ }
435
+ },
436
+ {
437
+ "name": "hq_run_list",
438
+ "description": "Lists the whitelisted `hq run` operations available through the bridge. Only pre-approved operations are executable — arbitrary commands are blocked to prevent secret exfiltration.",
439
+ "inputSchema": {
440
+ "type": "object",
441
+ "properties": {
442
+ "company": {
443
+ "description": "Company slug — must match one of your memberships",
444
+ "type": "string"
445
+ }
446
+ },
447
+ "required": [
448
+ "company"
449
+ ],
450
+ "$schema": "http://json-schema.org/draft-07/schema#"
451
+ }
452
+ },
453
+ {
454
+ "name": "hq_secrets_generate_link",
455
+ "description": "Generates a time-limited link for human secret submission. The link allows a user to submit a secret value through a web form — no values are returned to the chat.",
456
+ "inputSchema": {
457
+ "type": "object",
458
+ "properties": {
459
+ "secretName": {
460
+ "description": "The name of the secret to generate a submission link for",
461
+ "type": "string"
462
+ },
463
+ "company": {
464
+ "description": "Company slug — must match one of your memberships",
465
+ "type": "string"
466
+ }
467
+ },
468
+ "required": [
469
+ "secretName",
470
+ "company"
471
+ ],
472
+ "$schema": "http://json-schema.org/draft-07/schema#"
473
+ }
474
+ },
475
+ {
476
+ "name": "hq_secrets_list",
477
+ "description": "Lists secret names and metadata for a company. Returns names and sizes only — never reveals secret values. Values never enter the chat transcript.",
478
+ "inputSchema": {
479
+ "type": "object",
480
+ "properties": {
481
+ "company": {
482
+ "description": "Company slug — must match one of your memberships",
483
+ "type": "string"
484
+ }
485
+ },
486
+ "required": [
487
+ "company"
488
+ ],
489
+ "$schema": "http://json-schema.org/draft-07/schema#"
490
+ }
491
+ },
492
+ {
493
+ "name": "hq_secrets_schema",
494
+ "description": "Parses a project's .env.schema to show what secrets a project needs (variable names, descriptions, required/optional). Returns schema info only — never actual values.",
495
+ "inputSchema": {
496
+ "type": "object",
497
+ "properties": {
498
+ "project": {
499
+ "description": "Project directory slug, e.g. \"my-app\"",
500
+ "type": "string"
501
+ },
502
+ "company": {
503
+ "description": "Company slug — must match one of your memberships",
504
+ "type": "string"
505
+ }
506
+ },
507
+ "required": [
508
+ "project",
509
+ "company"
510
+ ],
511
+ "$schema": "http://json-schema.org/draft-07/schema#"
512
+ }
513
+ },
514
+ {
515
+ "name": "hq_version",
516
+ "description": "Returns the hq-mcp bridge version",
517
+ "inputSchema": {
518
+ "type": "object",
519
+ "properties": {
520
+ "verbose": {
521
+ "description": "Include build metadata",
522
+ "type": "boolean"
523
+ }
524
+ },
525
+ "$schema": "http://json-schema.org/draft-07/schema#"
526
+ }
527
+ },
528
+ {
529
+ "name": "hq_whoami",
530
+ "description": "Returns the HQ Cognito identity of the authenticated user: email, personUid, and token expiry. In the cloud transport, also verifies the caller's personal bucket is provisioned.",
531
+ "inputSchema": {
532
+ "type": "object",
533
+ "properties": {},
534
+ "$schema": "http://json-schema.org/draft-07/schema#"
535
+ }
536
+ }
537
+ ];
538
+ //# sourceMappingURL=hq-mcp-tools.generated.js.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MCP prompts for hosts without slash commands (hq-anywhere US-011). Each
3
+ * prompt returns the HQ skill text from <HQ root>/.claude/skills/<name>/SKILL.md
4
+ * when the HQ root is known, and a short instruction otherwise.
5
+ */
6
+ export interface McpPromptDefinition {
7
+ name: string;
8
+ description: string;
9
+ arguments: Array<{
10
+ name: string;
11
+ description: string;
12
+ required: boolean;
13
+ }>;
14
+ }
15
+ export declare const MCP_PROMPTS: readonly McpPromptDefinition[];
16
+ export declare class PromptNotFoundError extends Error {
17
+ readonly code = "prompt_not_found";
18
+ }
19
+ export interface PromptMessage {
20
+ role: "user";
21
+ content: {
22
+ type: "text";
23
+ text: string;
24
+ };
25
+ }
26
+ export declare function getPrompt(name: string, args: Record<string, unknown>, hqRoot: string | null): {
27
+ description: string;
28
+ messages: PromptMessage[];
29
+ };
30
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1,48 @@
1
+ /**
2
+ * MCP prompts for hosts without slash commands (hq-anywhere US-011). Each
3
+ * prompt returns the HQ skill text from <HQ root>/.claude/skills/<name>/SKILL.md
4
+ * when the HQ root is known, and a short instruction otherwise.
5
+ */
6
+ import * as fs from "node:fs";
7
+ import * as path from "node:path";
8
+ const argsArg = { name: "args", description: "Arguments, as you would type them after the slash command", required: false };
9
+ export const MCP_PROMPTS = [
10
+ { name: "startwork", description: "Resolve the current HQ context and pick the next piece of work", arguments: [argsArg] },
11
+ { name: "plan", description: "Create an execution-ready PRD and README for an HQ project", arguments: [argsArg] },
12
+ {
13
+ name: "run",
14
+ description: "Run or list HQ workers",
15
+ arguments: [
16
+ { name: "worker", description: "Worker id; leave empty to list workers", required: false },
17
+ { name: "skill", description: "Skill on that worker", required: false },
18
+ argsArg,
19
+ ],
20
+ },
21
+ { name: "handoff", description: "Save session state for a follow-up session", arguments: [argsArg] },
22
+ ];
23
+ export class PromptNotFoundError extends Error {
24
+ code = "prompt_not_found";
25
+ }
26
+ export function getPrompt(name, args, hqRoot) {
27
+ const prompt = MCP_PROMPTS.find((p) => p.name === name);
28
+ if (!prompt)
29
+ throw new PromptNotFoundError(`unknown prompt ${name}; available: ${MCP_PROMPTS.map((p) => p.name).join(", ")}`);
30
+ const invocation = [`/${name}`, ...prompt.arguments.map((a) => args[a.name]).filter((v) => typeof v === "string" && v.trim() !== "")]
31
+ .join(" ");
32
+ let skill = null;
33
+ const skillPath = hqRoot ? path.join(hqRoot, ".claude", "skills", name, "SKILL.md") : null;
34
+ if (skillPath) {
35
+ try {
36
+ skill = fs.readFileSync(skillPath, "utf8");
37
+ }
38
+ catch (err) {
39
+ if (err.code !== "ENOENT")
40
+ throw err;
41
+ }
42
+ }
43
+ const text = skill
44
+ ? `The user invoked the HQ command \`${invocation}\`. HQ root: ${hqRoot}. Follow these instructions (paths are relative to the HQ root):\n\n${skill}`
45
+ : `The user invoked the HQ command \`${invocation}\`. The HQ skill file was not found${skillPath ? ` at ${skillPath}` : " (HQ root unknown; run `hq install --global`)"}. Use the hq_* tools to carry out the request.`;
46
+ return { description: prompt.description, messages: [{ role: "user", content: { type: "text", text } }] };
47
+ }
48
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tool surface of `hq mcp serve` (hq-anywhere US-011).
3
+ *
4
+ * The hq-mcp tools come from src/lib/mcp/hq-mcp-tools.generated.ts, which
5
+ * scripts/generate-hq-mcp-tools.mjs builds from repos/public/hq-mcp. The four
6
+ * daemon-native tools are defined here. Names use underscores because
7
+ * Anthropic and OpenAI tool names reject dots (hq.resolve_company is exposed
8
+ * as hq_resolve_company).
9
+ *
10
+ * hqd answers every one of these through the `mcp.call` op, so a subagent
11
+ * without MCP can call the same tool with
12
+ * `hq daemon call mcp.call --json '{"name":"hq_journal_append","arguments":{...}}'`.
13
+ */
14
+ import type { McpToolDefinition } from "./types.js";
15
+ export type { McpToolDefinition } from "./types.js";
16
+ export declare const HQD_NATIVE_TOOLS: readonly McpToolDefinition[];
17
+ export declare const HQD_NATIVE_TOOL_NAMES: ReadonlySet<string>;
18
+ /** Every tool `hq mcp serve` lists: the four native tools, then the hq-mcp set. */
19
+ export declare const HQ_MCP_HOSTED_TOOLS: readonly McpToolDefinition[];
20
+ export declare const MCP_TOOLS: readonly McpToolDefinition[];
21
+ export declare const HQ_MCP_TOOL_NAMES: ReadonlySet<string>;
22
+ //# sourceMappingURL=tools.d.ts.map