@indigoai-us/hq-cli 5.325.0 → 5.326.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.
- package/CHANGELOG.md +6 -0
- package/dist/bin/hq-auth-refresh.js +2 -3
- package/dist/command-catalog.generated.d.ts +10 -1
- package/dist/command-catalog.generated.js +11 -1
- package/dist/commands/anywhere-runtime-flag.d.ts +2 -2
- package/dist/commands/anywhere-runtime-flag.js +2 -2
- package/dist/commands/core-job-remote-launcher.js +2 -3
- package/dist/commands/daemon.js +1 -1
- package/dist/commands/install-global.d.ts +10 -0
- package/dist/commands/install-global.js +96 -41
- package/dist/commands/mcp-serve.d.ts +28 -0
- package/dist/commands/mcp-serve.js +165 -0
- package/dist/commands/mcp-status.js +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/lanes-drain-hook.js +2 -2
- package/dist/lib/anywhere-runtime-fast-flag.d.ts +3 -0
- package/dist/lib/anywhere-runtime-fast-flag.js +23 -0
- package/dist/lib/anywhere-runtime-flag-key.d.ts +3 -0
- package/dist/lib/anywhere-runtime-flag-key.js +3 -0
- package/dist/lib/daemon/ops/mcp.d.ts +54 -0
- package/dist/lib/daemon/ops/mcp.js +217 -0
- package/dist/lib/daemon/protocol.d.ts +2 -1
- package/dist/lib/daemon/protocol.js +3 -1
- package/dist/lib/daemon/server.d.ts +5 -0
- package/dist/lib/daemon/server.js +78 -11
- package/dist/lib/install/claude-targets.d.ts +11 -4
- package/dist/lib/install/claude-targets.js +21 -9
- package/dist/lib/install/codex-targets.d.ts +8 -4
- package/dist/lib/install/codex-targets.js +18 -9
- package/dist/lib/lanes/watcher-main.js +2 -4
- package/dist/lib/mcp/hosted-search-tools.d.ts +4 -0
- package/dist/lib/mcp/hosted-search-tools.js +28 -0
- package/dist/lib/mcp/hq-mcp-tools.generated.d.ts +3 -0
- package/dist/lib/mcp/hq-mcp-tools.generated.js +538 -0
- package/dist/lib/mcp/prompts.d.ts +30 -0
- package/dist/lib/mcp/prompts.js +48 -0
- package/dist/lib/mcp/tools.d.ts +22 -0
- package/dist/lib/mcp/tools.js +82 -0
- package/dist/lib/mcp/types.d.ts +6 -0
- package/dist/lib/mcp/types.js +2 -0
- package/dist/utils/is-main-module.d.ts +3 -0
- package/dist/utils/is-main-module.js +19 -0
- package/dist/utils/staged-npm-install.js +2 -1
- package/package.json +3 -1
|
@@ -0,0 +1,82 @@
|
|
|
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 { HQ_MCP_TOOLS } from "./hq-mcp-tools.generated.js";
|
|
15
|
+
import { HOSTED_SEARCH_FETCH_TOOLS } from "./hosted-search-tools.js";
|
|
16
|
+
const companyProp = { type: "string", description: "Company slug. Defaults to the company linked to cwd." };
|
|
17
|
+
const cwdProp = { type: "string", description: "Directory to resolve the company from. Defaults to the server's working directory." };
|
|
18
|
+
export const HQD_NATIVE_TOOLS = [
|
|
19
|
+
{
|
|
20
|
+
name: "hq_resolve_company",
|
|
21
|
+
description: "Returns the HQ company linked to a directory (registry from `hq link`), with the matched repo path.",
|
|
22
|
+
inputSchema: { type: "object", properties: { cwd: cwdProp }, additionalProperties: false },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "hq_policy_check",
|
|
26
|
+
description: "Runs the HQ policy engine for a proposed tool call and returns allow/block plus any policy context to inject. Fails closed when the engine errors.",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
tool: { type: "string", description: "Tool name the policy is checked for, e.g. Bash or Write" },
|
|
31
|
+
input: { type: "object", description: "The tool input, e.g. {\"command\": \"git push\"}" },
|
|
32
|
+
event: { type: "string", description: "Hook event, default PreToolUse" },
|
|
33
|
+
company: companyProp,
|
|
34
|
+
cwd: cwdProp,
|
|
35
|
+
sessionId: { type: "string" },
|
|
36
|
+
},
|
|
37
|
+
required: ["tool"],
|
|
38
|
+
additionalProperties: false,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "hq_journal_append",
|
|
43
|
+
description: "Appends a line to a project's active HQ journal under a section heading.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
project: { type: "string", description: "Project slug under companies/<company>/projects" },
|
|
48
|
+
section: { type: "string", enum: ["decisions", "open", "findings", "rejected"], description: "Journal section" },
|
|
49
|
+
text: { type: "string", description: "The line to append" },
|
|
50
|
+
company: companyProp,
|
|
51
|
+
cwd: cwdProp,
|
|
52
|
+
},
|
|
53
|
+
required: ["project", "section", "text"],
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "hq_run_worker",
|
|
59
|
+
description: "Dispatches an HQ worker skill through the /run command in a detached headless session. Returns the pid and log path; it does not wait for the worker to finish.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {
|
|
63
|
+
worker: { type: "string", description: "Worker id from core/workers/registry.yaml or a company registry" },
|
|
64
|
+
skill: { type: "string", description: "Skill name on that worker" },
|
|
65
|
+
args: { type: "string", description: "Free-text arguments passed to the skill" },
|
|
66
|
+
company: companyProp,
|
|
67
|
+
cwd: cwdProp,
|
|
68
|
+
},
|
|
69
|
+
required: ["worker"],
|
|
70
|
+
additionalProperties: false,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
export const HQD_NATIVE_TOOL_NAMES = new Set(HQD_NATIVE_TOOLS.map((t) => t.name));
|
|
75
|
+
/** Every tool `hq mcp serve` lists: the four native tools, then the hq-mcp set. */
|
|
76
|
+
export const HQ_MCP_HOSTED_TOOLS = [...HQ_MCP_TOOLS, ...HOSTED_SEARCH_FETCH_TOOLS];
|
|
77
|
+
export const MCP_TOOLS = [
|
|
78
|
+
...HQD_NATIVE_TOOLS,
|
|
79
|
+
...HQ_MCP_HOSTED_TOOLS.filter((t) => !HQD_NATIVE_TOOL_NAMES.has(t.name)),
|
|
80
|
+
];
|
|
81
|
+
export const HQ_MCP_TOOL_NAMES = new Set(HQ_MCP_HOSTED_TOOLS.map((t) => t.name));
|
|
82
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
/** Compare executable and module paths after resolving npm-style symlinks. */
|
|
5
|
+
export function isMainModule(moduleUrl, argvEntryPath = process.argv[1]) {
|
|
6
|
+
if (!argvEntryPath)
|
|
7
|
+
return false;
|
|
8
|
+
const modulePath = fileURLToPath(moduleUrl);
|
|
9
|
+
const invokedPath = path.resolve(argvEntryPath);
|
|
10
|
+
try {
|
|
11
|
+
return realpathSync(modulePath) === realpathSync(invokedPath);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// Direct invocation still works if path canonicalization is unavailable;
|
|
15
|
+
// an unresolved symlink does not get treated as the module entry point.
|
|
16
|
+
return modulePath === invokedPath;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=is-main-module.js.map
|
|
@@ -3,6 +3,7 @@ import { randomBytes } from "node:crypto";
|
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { isMainModule } from "./is-main-module.js";
|
|
6
7
|
const PACKAGE_NAME = "@indigoai-us/hq-cli";
|
|
7
8
|
const RANDOM_HEX_BYTES = 6;
|
|
8
9
|
function packageRoot(prefix, platform) {
|
|
@@ -239,7 +240,7 @@ export function activateStagedNpmPackage(prefix, stagePrefix, platform = process
|
|
|
239
240
|
bestEffortRemove(backupPackage);
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
|
-
if (
|
|
243
|
+
if (isMainModule(import.meta.url) && process.argv[2] === "--activate") {
|
|
243
244
|
const [prefix, stagePrefix, platform] = process.argv.slice(3);
|
|
244
245
|
if (!prefix || !stagePrefix) {
|
|
245
246
|
console.error("usage: staged-npm-install.js --activate <prefix> <stage-prefix> [platform]");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.326.0",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"lint": "eslint .",
|
|
32
32
|
"pretest": "node scripts/generate-dsn.mjs && node scripts/build-flag-registry-worker.mjs",
|
|
33
33
|
"test": "vitest run",
|
|
34
|
+
"gen:hq-mcp-tools": "node scripts/generate-hq-mcp-tools.mjs",
|
|
34
35
|
"test:db": "vitest run src/lib/db test/commands/db.test.ts test/commands/db-tenant-isolation.test.ts",
|
|
35
36
|
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
36
37
|
"coverage": "vitest run --coverage --coverage.reporter=text-summary --coverage.reporter=json-summary",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"@aws-sdk/client-s3": "^3.1049.0",
|
|
47
48
|
"@indigoai-us/hq-cloud": "~6.18.33",
|
|
48
49
|
"@indigoai-us/hq-flags-client": "^0.1.2",
|
|
50
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
49
51
|
"@sentry/node": "^10.49.0",
|
|
50
52
|
"@tobilu/qmd": "2.5.3",
|
|
51
53
|
"ajv": "^8.20.0",
|