create-hyper-hq 0.1.6 → 0.2.2
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/dist/checks/check-claude-plugins.d.ts +11 -0
- package/dist/checks/check-claude-plugins.d.ts.map +1 -0
- package/dist/checks/check-claude-plugins.js +31 -0
- package/dist/checks/check-claude-plugins.js.map +1 -0
- package/dist/index.js +15 -34
- package/dist/index.js.map +1 -1
- package/dist/install/run-install.js +1 -1
- package/dist/install/run-install.js.map +1 -1
- package/dist/setup/claude-md.d.ts +1 -1
- package/dist/setup/claude-md.d.ts.map +1 -1
- package/dist/setup/claude-md.js +20 -6
- package/dist/setup/claude-md.js.map +1 -1
- package/dist/setup/hq-config-wizard.d.ts +51 -1
- package/dist/setup/hq-config-wizard.d.ts.map +1 -1
- package/dist/setup/hq-config-wizard.js +142 -37
- package/dist/setup/hq-config-wizard.js.map +1 -1
- package/dist/setup/workspace-trust.d.ts +1 -1
- package/dist/setup/workspace-trust.d.ts.map +1 -1
- package/dist/setup/workspace-trust.js +28 -8
- package/dist/setup/workspace-trust.js.map +1 -1
- package/package.json +7 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List installed Claude Code plugins by running `claude plugin list`.
|
|
3
|
+
* Returns plugin identifiers like "telegram@claude-plugins-official".
|
|
4
|
+
*/
|
|
5
|
+
export declare function listClaudePlugins(): string[];
|
|
6
|
+
export declare function isPluginInstalled(pluginId: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Install a Claude Code plugin. Returns true if successful.
|
|
9
|
+
*/
|
|
10
|
+
export declare function installPlugin(pluginId: string): boolean;
|
|
11
|
+
//# sourceMappingURL=check-claude-plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-claude-plugins.d.ts","sourceRoot":"","sources":["../../src/checks/check-claude-plugins.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAU5C;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOvD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
const PLUGIN_REGEX = /^\s+❯\s+(\S+@\S+)/gm;
|
|
3
|
+
/**
|
|
4
|
+
* List installed Claude Code plugins by running `claude plugin list`.
|
|
5
|
+
* Returns plugin identifiers like "telegram@claude-plugins-official".
|
|
6
|
+
*/
|
|
7
|
+
export function listClaudePlugins() {
|
|
8
|
+
const result = spawnSync("claude", ["plugin", "list"], {
|
|
9
|
+
encoding: "utf-8",
|
|
10
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
11
|
+
timeout: 15_000,
|
|
12
|
+
});
|
|
13
|
+
if (result.status !== 0)
|
|
14
|
+
return [];
|
|
15
|
+
return Array.from(result.stdout.matchAll(PLUGIN_REGEX), (m) => m[1]);
|
|
16
|
+
}
|
|
17
|
+
export function isPluginInstalled(pluginId) {
|
|
18
|
+
return listClaudePlugins().includes(pluginId);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Install a Claude Code plugin. Returns true if successful.
|
|
22
|
+
*/
|
|
23
|
+
export function installPlugin(pluginId) {
|
|
24
|
+
const result = spawnSync("claude", ["plugin", "install", pluginId], {
|
|
25
|
+
encoding: "utf-8",
|
|
26
|
+
stdio: "inherit",
|
|
27
|
+
timeout: 60_000,
|
|
28
|
+
});
|
|
29
|
+
return result.status === 0;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=check-claude-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-claude-plugins.js","sourceRoot":"","sources":["../../src/checks/check-claude-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;QACtD,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;QACjC,OAAO,EAAE,MAAM;KACf,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IACjD,OAAO,iBAAiB,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC7C,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE;QACnE,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,MAAM;KACf,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;AAC5B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import * as p from "@clack/prompts";
|
|
@@ -14,8 +14,10 @@ import { generateHqClaudeMd } from "./setup/claude-md.js";
|
|
|
14
14
|
import { runConfigWizard } from "./setup/hq-config-wizard.js";
|
|
15
15
|
import { isWorkspaceTrusted, trustWorkspace } from "./setup/workspace-trust.js";
|
|
16
16
|
import { installOrWaitLoop } from "./ui/prompts.js";
|
|
17
|
-
function phase(step, total, title) {
|
|
18
|
-
|
|
17
|
+
function phase(step, total, title, prevOutro) {
|
|
18
|
+
if (prevOutro)
|
|
19
|
+
p.outro(prevOutro);
|
|
20
|
+
p.intro(pc.bold(`${step} of ${total}: ${title}`));
|
|
19
21
|
}
|
|
20
22
|
async function checkAndUpdateTool(name, npmPackage, callingPm) {
|
|
21
23
|
const rawVersion = getToolVersion(name);
|
|
@@ -72,12 +74,14 @@ async function checkAndUpdateTool(name, npmPackage, callingPm) {
|
|
|
72
74
|
cmd = callingPm;
|
|
73
75
|
args = callingPm === "yarn" ? ["global", "add", npmPackage] : ["install", "-g", npmPackage];
|
|
74
76
|
}
|
|
75
|
-
const result = spawnSync(cmd, args, { stdio: "
|
|
77
|
+
const result = spawnSync(cmd, args, { stdio: "pipe", encoding: "utf-8" });
|
|
76
78
|
if (result.status === 0) {
|
|
77
79
|
p.log.success(`${name} updated to v${latest}`);
|
|
78
80
|
}
|
|
79
81
|
else {
|
|
80
82
|
p.log.warn("Update failed. Continuing with the installed version.");
|
|
83
|
+
if (result.stderr)
|
|
84
|
+
p.log.message(pc.dim(result.stderr.trim()));
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
else {
|
|
@@ -216,10 +220,10 @@ async function main() {
|
|
|
216
220
|
p.log.success("Claude is authenticated");
|
|
217
221
|
}
|
|
218
222
|
// ─── Phase 2: Configuration ───
|
|
219
|
-
phase(2, TOTAL_PHASES, "Pick your settings");
|
|
223
|
+
phase(2, TOTAL_PHASES, "Pick your settings", "You're all set on prerequisites!");
|
|
220
224
|
const config = await runConfigWizard();
|
|
221
225
|
// ─── Phase 3: Finishing touches ───
|
|
222
|
-
phase(3, TOTAL_PHASES, "Setting everything up");
|
|
226
|
+
phase(3, TOTAL_PHASES, "Setting everything up", "Settings saved!");
|
|
223
227
|
// Trust workspaces
|
|
224
228
|
for (const dir of [config.hqDir, config.projectsRoot]) {
|
|
225
229
|
if (!isWorkspaceTrusted(dir)) {
|
|
@@ -234,35 +238,12 @@ async function main() {
|
|
|
234
238
|
}
|
|
235
239
|
writeFileSync(claudeMdPath, generateHqClaudeMd(config.projectsRoot), "utf-8");
|
|
236
240
|
p.log.success(`Created ${claudeMdPath}`);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
options: [
|
|
242
|
-
{ label: "Yes, let's go!", value: "yes" },
|
|
243
|
-
{ label: "Not right now", value: "no" },
|
|
244
|
-
],
|
|
245
|
-
});
|
|
246
|
-
if (p.isCancel(startNow)) {
|
|
247
|
-
p.cancel("Setup cancelled.");
|
|
248
|
-
process.exit(0);
|
|
249
|
-
}
|
|
250
|
-
p.log.message(` You can always run ${pc.cyan("hyper hq start")} to launch HQ.`);
|
|
251
|
-
if (startNow === "yes") {
|
|
252
|
-
p.log.step("Starting HQ...");
|
|
253
|
-
const child = spawn("hyper", ["hq", "start"], {
|
|
254
|
-
stdio: "inherit",
|
|
255
|
-
detached: false,
|
|
256
|
-
});
|
|
257
|
-
await new Promise((resolve) => {
|
|
258
|
-
child.on("close", () => resolve());
|
|
259
|
-
child.on("error", (err) => {
|
|
260
|
-
p.log.error(`Failed to start HQ: ${err.message}`);
|
|
261
|
-
resolve();
|
|
262
|
-
});
|
|
263
|
-
});
|
|
241
|
+
p.outro(pc.green("All set! HQ is ready to go."));
|
|
242
|
+
const nextSteps = [`Run ${pc.cyan("hyper hq start")} to launch HQ.`];
|
|
243
|
+
if (config.telegramToken) {
|
|
244
|
+
nextSteps.push("", `${pc.bold("Telegram pairing")} — after HQ starts:`, ` 1. Message your bot on Telegram — it will reply with a pairing code`, ` 2. Connect to HQ via ${pc.cyan("claude.ai/code")} and tell it the code`, ` HQ will handle the rest automatically`);
|
|
264
245
|
}
|
|
265
|
-
p.
|
|
246
|
+
p.note(nextSteps.join("\n"), "Next steps");
|
|
266
247
|
}
|
|
267
248
|
main().catch((err) => {
|
|
268
249
|
if (err instanceof Error && err.message === "User force closed the prompt with CTRL+C") {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,WAAW,GAAW,IAAI,CAAC,KAAK,CACrC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CACzE,CAAC,OAAO,CAAC;AAEV,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,WAAW,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAA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,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-install.js","sourceRoot":"","sources":["../../src/install/run-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,MAAM,UAAU,iBAAiB,CAAC,MAAqB;IACtD,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,+CAA+C,EAAE,CAAC;IACnF,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE;YACrD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"run-install.js","sourceRoot":"","sources":["../../src/install/run-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,MAAM,UAAU,iBAAiB,CAAC,MAAqB;IACtD,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,+CAA+C,EAAE,CAAC;IACnF,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE;YACrD,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,OAAO;SACjB,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACxD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,MAAM,IAAI,4BAA4B,MAAM,CAAC,MAAM,EAAE;aAC5D,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO;YACN,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACvD,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function generateHqClaudeMd(projectsRoot: string): string;
|
|
1
|
+
export declare function generateHqClaudeMd(projectsRoot: string, sessionName?: string): string;
|
|
2
2
|
//# sourceMappingURL=claude-md.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-md.d.ts","sourceRoot":"","sources":["../../src/setup/claude-md.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"claude-md.d.ts","sourceRoot":"","sources":["../../src/setup/claude-md.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,SAAa,GAAG,MAAM,CAuEzF"}
|
package/dist/setup/claude-md.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function generateHqClaudeMd(projectsRoot) {
|
|
1
|
+
export function generateHqClaudeMd(projectsRoot, sessionName = "Hyper HQ") {
|
|
2
2
|
return `# Hyper HQ — Claude Code Command Center
|
|
3
3
|
|
|
4
4
|
You are **Hyper HQ**, an always-running Claude Code instance that serves as a command center.
|
|
@@ -6,19 +6,33 @@ Calm, decisive, and always in control.
|
|
|
6
6
|
|
|
7
7
|
## Your Role
|
|
8
8
|
|
|
9
|
-
You are a persistent Claude Code session running
|
|
10
|
-
Users connect to you from claude.ai/code
|
|
9
|
+
You are a persistent Claude Code session running inside tmux.
|
|
10
|
+
Users connect to you from claude.ai/code or mobile apps via Remote Control,
|
|
11
|
+
and via Telegram messages through the channels plugin when enabled.
|
|
11
12
|
|
|
12
13
|
## On Startup
|
|
13
14
|
|
|
14
15
|
When this session first starts, immediately:
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
16
|
+
1. Run \`/remote-control ${sessionName}\` to enable Remote Control access
|
|
17
|
+
2. Check if Telegram is configured by reading \`~/.claude/channels/telegram/.env\`
|
|
18
|
+
3. Check if Telegram is paired by reading \`~/.claude/channels/telegram/access.json\`
|
|
19
|
+
- If the file doesn't exist or \`allowFrom\` is empty, Telegram is NOT yet paired
|
|
20
|
+
4. If Telegram is available AND paired, use the \`reply\` tool to send: "Hyper HQ is online. Ready for orders."
|
|
21
|
+
5. Run \`hyper hq list --json\` to get the current project inventory.
|
|
22
|
+
|
|
23
|
+
## Telegram Pairing
|
|
24
|
+
|
|
25
|
+
If a user connects and Telegram is configured but NOT yet paired:
|
|
26
|
+
1. Tell the user to open Telegram and message the bot — the bot will reply with a pairing code
|
|
27
|
+
2. Ask the user for the pairing code
|
|
28
|
+
3. Run \`/telegram:access pair <code>\` to approve them
|
|
29
|
+
4. Run \`/telegram:access policy allowlist\` to lock down access
|
|
30
|
+
5. Confirm pairing is complete
|
|
17
31
|
|
|
18
32
|
## Capabilities
|
|
19
33
|
|
|
20
34
|
1. **Spawn new Claude sessions** for any project using the \`hyper hq\` CLI
|
|
21
|
-
2. **Receive and act on messages** via Telegram (if configured)
|
|
35
|
+
2. **Receive and act on messages** via Telegram (if configured and paired)
|
|
22
36
|
3. **Manage running sessions** — start, stop, check status
|
|
23
37
|
4. **Coordinate work** across multiple projects
|
|
24
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/setup/claude-md.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,YAAoB;
|
|
1
|
+
{"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/setup/claude-md.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,YAAoB,EAAE,WAAW,GAAG,UAAU;IAChF,OAAO;;;;;;;;;;;;;;2BAcmB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAgDnB,YAAY;;;;;;;CAO9B,CAAC;AACF,CAAC"}
|
|
@@ -3,5 +3,55 @@ export interface HqConfigResult {
|
|
|
3
3
|
hqDir: string;
|
|
4
4
|
telegramToken?: string;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* If the user typed a path starting with `~/`, expand it to their home
|
|
8
|
+
* directory — unless a literal `~` folder exists in cwd, in which case
|
|
9
|
+
* ask them to disambiguate.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveTilde(raw: string): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Write the Telegram bot token to ~/.claude/channels/telegram/.env
|
|
14
|
+
* This is what `/telegram:configure <token>` does internally.
|
|
15
|
+
*/
|
|
16
|
+
export declare function writeTelegramPluginConfig(token: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Prompt for and resolve the projects root directory.
|
|
19
|
+
* If opts.current is set, it is shown as the default with a "(current)" hint.
|
|
20
|
+
*/
|
|
21
|
+
export declare function configureProjectsRoot(opts?: {
|
|
22
|
+
current?: string;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Prompt for and resolve the HQ working directory.
|
|
26
|
+
* Resolved relative to projectsRoot if not absolute.
|
|
27
|
+
* If opts.current is set, it is shown as the default.
|
|
28
|
+
*/
|
|
29
|
+
export declare function configureHqDir(opts: {
|
|
30
|
+
projectsRoot: string;
|
|
31
|
+
current?: string;
|
|
32
|
+
}): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Configure Telegram integration.
|
|
35
|
+
* If opts.currentToken exists, asks the user whether to reconfigure.
|
|
36
|
+
* Returns the token if enabled, undefined if disabled.
|
|
37
|
+
*/
|
|
38
|
+
export declare function configureTelegram(opts?: {
|
|
39
|
+
currentToken?: string;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
token?: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Generate TOML config and write to ~/.config/hyper/hq.toml with mode 0o600.
|
|
45
|
+
*/
|
|
46
|
+
export declare function writeHqConfig(values: {
|
|
47
|
+
projectsRoot: string;
|
|
48
|
+
hqDir: string;
|
|
49
|
+
telegramToken?: string;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Orchestrator: runs all configuration steps in sequence and writes the config file.
|
|
53
|
+
*/
|
|
54
|
+
export declare function runConfigWizard(opts?: {
|
|
55
|
+
existing?: Partial<HqConfigResult>;
|
|
56
|
+
}): Promise<HqConfigResult>;
|
|
7
57
|
//# sourceMappingURL=hq-config-wizard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hq-config-wizard.d.ts","sourceRoot":"","sources":["../../src/setup/hq-config-wizard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hq-config-wizard.d.ts","sourceRoot":"","sources":["../../src/setup/hq-config-wizard.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB/D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAK7D;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgCxF;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBlB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,CAAC,EAAE;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAuG9B;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDhB;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,CAAC,EAAE;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACnC,GAAG,OAAO,CAAC,cAAc,CAAC,CAY1B"}
|
|
@@ -2,42 +2,63 @@ import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import * as p from "@clack/prompts";
|
|
5
|
+
import { installPlugin, isPluginInstalled } from "../checks/check-claude-plugins.js";
|
|
5
6
|
const HOME = homedir();
|
|
6
7
|
const CONFIG_PATH = resolve(HOME, ".config", "hyper", "hq.toml");
|
|
8
|
+
const TELEGRAM_CHANNEL_DIR = resolve(HOME, ".claude", "channels", "telegram");
|
|
7
9
|
/**
|
|
8
|
-
* If the user typed a path starting with `~/`,
|
|
9
|
-
*
|
|
10
|
+
* If the user typed a path starting with `~/`, expand it to their home
|
|
11
|
+
* directory — unless a literal `~` folder exists in cwd, in which case
|
|
12
|
+
* ask them to disambiguate.
|
|
10
13
|
*/
|
|
11
|
-
async function
|
|
14
|
+
export async function resolveTilde(raw) {
|
|
12
15
|
if (!raw.startsWith("~/") && raw !== "~")
|
|
13
16
|
return raw;
|
|
14
17
|
const expanded = resolve(HOME, raw.slice(2) || "");
|
|
18
|
+
// Only disambiguate if a literal `~` folder exists in cwd
|
|
19
|
+
if (!existsSync(resolve("~")))
|
|
20
|
+
return expanded;
|
|
21
|
+
const literal = resolve(raw);
|
|
15
22
|
const choice = await p.select({
|
|
16
|
-
message: `
|
|
23
|
+
message: `There's a folder named "~" in the current directory. Which path did you mean?`,
|
|
17
24
|
options: [
|
|
18
25
|
{ label: expanded, value: "expand", hint: "home directory" },
|
|
19
|
-
{ label:
|
|
26
|
+
{ label: literal, value: "literal", hint: "literal ~ folder" },
|
|
20
27
|
],
|
|
21
28
|
});
|
|
22
29
|
if (p.isCancel(choice)) {
|
|
23
30
|
p.cancel("Setup cancelled.");
|
|
24
31
|
process.exit(0);
|
|
25
32
|
}
|
|
26
|
-
return choice === "expand" ? expanded :
|
|
33
|
+
return choice === "expand" ? expanded : literal;
|
|
27
34
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Write the Telegram bot token to ~/.claude/channels/telegram/.env
|
|
37
|
+
* This is what `/telegram:configure <token>` does internally.
|
|
38
|
+
*/
|
|
39
|
+
export function writeTelegramPluginConfig(token) {
|
|
40
|
+
mkdirSync(TELEGRAM_CHANNEL_DIR, { recursive: true });
|
|
41
|
+
const envPath = resolve(TELEGRAM_CHANNEL_DIR, ".env");
|
|
42
|
+
writeFileSync(envPath, `TELEGRAM_BOT_TOKEN=${token}\n`, { encoding: "utf-8", mode: 0o600 });
|
|
43
|
+
chmodSync(envPath, 0o600);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Prompt for and resolve the projects root directory.
|
|
47
|
+
* If opts.current is set, it is shown as the default with a "(current)" hint.
|
|
48
|
+
*/
|
|
49
|
+
export async function configureProjectsRoot(opts) {
|
|
50
|
+
const defaultValue = opts?.current ?? resolve(HOME, "projects");
|
|
51
|
+
const placeholder = opts?.current ? `${opts.current} (current)` : defaultValue;
|
|
31
52
|
const projectsRootRaw = await p.text({
|
|
32
53
|
message: "Where are your projects?",
|
|
33
|
-
placeholder
|
|
34
|
-
defaultValue
|
|
54
|
+
placeholder,
|
|
55
|
+
defaultValue,
|
|
35
56
|
});
|
|
36
57
|
if (p.isCancel(projectsRootRaw)) {
|
|
37
58
|
p.cancel("Setup cancelled.");
|
|
38
59
|
process.exit(0);
|
|
39
60
|
}
|
|
40
|
-
const projectsRoot = await
|
|
61
|
+
const projectsRoot = await resolveTilde(projectsRootRaw);
|
|
41
62
|
// Ensure directory exists
|
|
42
63
|
if (!existsSync(projectsRoot)) {
|
|
43
64
|
const create = await p.confirm({
|
|
@@ -51,23 +72,54 @@ export async function runConfigWizard() {
|
|
|
51
72
|
mkdirSync(projectsRoot, { recursive: true });
|
|
52
73
|
p.log.success(`Created ${projectsRoot}`);
|
|
53
74
|
}
|
|
54
|
-
|
|
75
|
+
return projectsRoot;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Prompt for and resolve the HQ working directory.
|
|
79
|
+
* Resolved relative to projectsRoot if not absolute.
|
|
80
|
+
* If opts.current is set, it is shown as the default.
|
|
81
|
+
*/
|
|
82
|
+
export async function configureHqDir(opts) {
|
|
83
|
+
const defaultValue = opts.current ?? "./hyper-hq";
|
|
84
|
+
const placeholder = opts.current ? `${opts.current} (current)` : "./hyper-hq";
|
|
55
85
|
const hqDirRaw = await p.text({
|
|
56
86
|
message: "HQ working directory (relative to projects root)?",
|
|
57
|
-
placeholder
|
|
58
|
-
defaultValue
|
|
87
|
+
placeholder,
|
|
88
|
+
defaultValue,
|
|
59
89
|
});
|
|
60
90
|
if (p.isCancel(hqDirRaw)) {
|
|
61
91
|
p.cancel("Setup cancelled.");
|
|
62
92
|
process.exit(0);
|
|
63
93
|
}
|
|
64
|
-
const hqDirInput = await
|
|
65
|
-
const hqDir = hqDirInput.startsWith("/") ? hqDirInput : resolve(projectsRoot, hqDirInput);
|
|
94
|
+
const hqDirInput = await resolveTilde(hqDirRaw);
|
|
95
|
+
const hqDir = hqDirInput.startsWith("/") ? hqDirInput : resolve(opts.projectsRoot, hqDirInput);
|
|
66
96
|
if (!existsSync(hqDir)) {
|
|
67
97
|
mkdirSync(hqDir, { recursive: true });
|
|
68
98
|
p.log.success(`Created HQ directory: ${hqDir}`);
|
|
69
99
|
}
|
|
70
|
-
|
|
100
|
+
return hqDir;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Configure Telegram integration.
|
|
104
|
+
* If opts.currentToken exists, asks the user whether to reconfigure.
|
|
105
|
+
* Returns the token if enabled, undefined if disabled.
|
|
106
|
+
*/
|
|
107
|
+
export async function configureTelegram(opts) {
|
|
108
|
+
// If already configured, ask whether to reconfigure
|
|
109
|
+
if (opts?.currentToken) {
|
|
110
|
+
p.log.info("Telegram is currently configured.");
|
|
111
|
+
const reconfigure = await p.confirm({
|
|
112
|
+
message: "Do you want to reconfigure Telegram?",
|
|
113
|
+
initialValue: false,
|
|
114
|
+
});
|
|
115
|
+
if (p.isCancel(reconfigure)) {
|
|
116
|
+
p.cancel("Setup cancelled.");
|
|
117
|
+
process.exit(0);
|
|
118
|
+
}
|
|
119
|
+
if (!reconfigure) {
|
|
120
|
+
return { token: opts.currentToken };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
71
123
|
const useTelegram = await p.confirm({
|
|
72
124
|
message: "Enable Telegram integration?",
|
|
73
125
|
initialValue: false,
|
|
@@ -76,36 +128,77 @@ export async function runConfigWizard() {
|
|
|
76
128
|
p.cancel("Setup cancelled.");
|
|
77
129
|
process.exit(0);
|
|
78
130
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (!value?.includes(":"))
|
|
91
|
-
return "That doesn't look like a bot token (should contain a colon)";
|
|
92
|
-
return undefined;
|
|
93
|
-
},
|
|
131
|
+
if (!useTelegram) {
|
|
132
|
+
return { token: undefined };
|
|
133
|
+
}
|
|
134
|
+
const TELEGRAM_PLUGIN = "telegram@claude-plugins-official";
|
|
135
|
+
// Check if the Telegram channel plugin is installed
|
|
136
|
+
const pluginInstalled = isPluginInstalled(TELEGRAM_PLUGIN);
|
|
137
|
+
if (!pluginInstalled) {
|
|
138
|
+
p.log.warn("The Telegram channel plugin is not installed in Claude Code.");
|
|
139
|
+
const doInstall = await p.confirm({
|
|
140
|
+
message: "Install the Telegram plugin now?",
|
|
141
|
+
initialValue: true,
|
|
94
142
|
});
|
|
95
|
-
if (p.isCancel(
|
|
143
|
+
if (p.isCancel(doInstall)) {
|
|
96
144
|
p.cancel("Setup cancelled.");
|
|
97
145
|
process.exit(0);
|
|
98
146
|
}
|
|
99
|
-
|
|
147
|
+
if (doInstall) {
|
|
148
|
+
p.log.step("Installing Telegram plugin...");
|
|
149
|
+
const success = installPlugin(TELEGRAM_PLUGIN);
|
|
150
|
+
if (success) {
|
|
151
|
+
p.log.success("Telegram plugin installed");
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
p.log.warn("Plugin installation failed. You can install it later with:\n" +
|
|
155
|
+
" claude plugin install telegram@claude-plugins-official");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
p.log.info("You'll need to install the plugin before using Telegram:\n" +
|
|
160
|
+
" claude plugin install telegram@claude-plugins-official");
|
|
161
|
+
}
|
|
100
162
|
}
|
|
101
|
-
|
|
163
|
+
else {
|
|
164
|
+
p.log.success("Telegram channel plugin is installed");
|
|
165
|
+
}
|
|
166
|
+
p.note("1. Open Telegram and message @BotFather\n" +
|
|
167
|
+
"2. Send /newbot and follow the prompts\n" +
|
|
168
|
+
"3. Copy the token BotFather gives you", "Create a Telegram bot");
|
|
169
|
+
const token = await p.text({
|
|
170
|
+
message: "Paste your Telegram bot token:",
|
|
171
|
+
placeholder: "your-bot-token-from-botfather",
|
|
172
|
+
validate(value) {
|
|
173
|
+
if (!value?.trim())
|
|
174
|
+
return "Please enter a token";
|
|
175
|
+
if (!value?.includes(":"))
|
|
176
|
+
return "That doesn't look like a bot token (should contain a colon)";
|
|
177
|
+
return undefined;
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
if (p.isCancel(token)) {
|
|
181
|
+
p.cancel("Setup cancelled.");
|
|
182
|
+
process.exit(0);
|
|
183
|
+
}
|
|
184
|
+
const telegramToken = token;
|
|
185
|
+
// Write token to the plugin's config location
|
|
186
|
+
writeTelegramPluginConfig(telegramToken);
|
|
187
|
+
p.log.success("Bot token saved to Claude Code plugin config");
|
|
188
|
+
return { token: telegramToken };
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Generate TOML config and write to ~/.config/hyper/hq.toml with mode 0o600.
|
|
192
|
+
*/
|
|
193
|
+
export async function writeHqConfig(values) {
|
|
194
|
+
const { projectsRoot, hqDir, telegramToken } = values;
|
|
102
195
|
const lines = [
|
|
103
196
|
"# Hyper HQ — Claude Code Command Center",
|
|
104
197
|
"",
|
|
105
198
|
`projects_root = "${projectsRoot}"`,
|
|
106
199
|
"",
|
|
107
200
|
"[hq]",
|
|
108
|
-
'name = "
|
|
201
|
+
'name = "Hyper HQ"',
|
|
109
202
|
`dir = "${hqDir}"`,
|
|
110
203
|
'spawn_mode = "same-dir"',
|
|
111
204
|
"capacity = 32",
|
|
@@ -132,6 +225,18 @@ export async function runConfigWizard() {
|
|
|
132
225
|
writeFileSync(CONFIG_PATH, configContent, { encoding: "utf-8", mode: 0o600 });
|
|
133
226
|
chmodSync(CONFIG_PATH, 0o600);
|
|
134
227
|
p.log.success(`Config saved to ${CONFIG_PATH} (mode 0600)`);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Orchestrator: runs all configuration steps in sequence and writes the config file.
|
|
231
|
+
*/
|
|
232
|
+
export async function runConfigWizard(opts) {
|
|
233
|
+
const existing = opts?.existing;
|
|
234
|
+
const projectsRoot = await configureProjectsRoot({ current: existing?.projectsRoot });
|
|
235
|
+
const hqDir = await configureHqDir({ projectsRoot, current: existing?.hqDir });
|
|
236
|
+
const { token: telegramToken } = await configureTelegram({
|
|
237
|
+
currentToken: existing?.telegramToken,
|
|
238
|
+
});
|
|
239
|
+
await writeHqConfig({ projectsRoot, hqDir, telegramToken });
|
|
135
240
|
return { projectsRoot, hqDir, telegramToken };
|
|
136
241
|
}
|
|
137
242
|
//# sourceMappingURL=hq-config-wizard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hq-config-wizard.js","sourceRoot":"","sources":["../../src/setup/hq-config-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"hq-config-wizard.js","sourceRoot":"","sources":["../../src/setup/hq-config-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO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KACrC,CAAC,CAAC;IAEH,MAAM,aAAa,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;IAE5D,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-trust.d.ts","sourceRoot":"","sources":["../../src/setup/workspace-trust.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-trust.d.ts","sourceRoot":"","sources":["../../src/setup/workspace-trust.ts"],"names":[],"mappings":"AAoBA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CASvD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAMhD"}
|
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
import { existsSync,
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
const CLAUDE_JSON_PATH = resolve(homedir(), ".claude.json");
|
|
5
|
+
function readClaudeJson() {
|
|
6
|
+
if (!existsSync(CLAUDE_JSON_PATH))
|
|
7
|
+
return {};
|
|
8
|
+
return JSON.parse(readFileSync(CLAUDE_JSON_PATH, "utf-8"));
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
function writeClaudeJson(data) {
|
|
11
|
+
writeFileSync(CLAUDE_JSON_PATH, JSON.stringify(data, null, 2), "utf-8");
|
|
10
12
|
}
|
|
11
13
|
export function isWorkspaceTrusted(dir) {
|
|
12
|
-
|
|
14
|
+
const data = readClaudeJson();
|
|
15
|
+
if (!data.projects)
|
|
16
|
+
return false;
|
|
17
|
+
let current = dir;
|
|
18
|
+
while (current !== "/") {
|
|
19
|
+
if (data.projects[current]?.hasTrustDialogAccepted === true)
|
|
20
|
+
return true;
|
|
21
|
+
current = dirname(current);
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
export function trustWorkspace(dir) {
|
|
26
|
+
const data = readClaudeJson();
|
|
27
|
+
if (!data.projects)
|
|
28
|
+
data.projects = {};
|
|
29
|
+
if (!data.projects[dir])
|
|
30
|
+
data.projects[dir] = {};
|
|
31
|
+
data.projects[dir].hasTrustDialogAccepted = true;
|
|
32
|
+
writeClaudeJson(data);
|
|
13
33
|
}
|
|
14
34
|
//# sourceMappingURL=workspace-trust.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-trust.js","sourceRoot":"","sources":["../../src/setup/workspace-trust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"workspace-trust.js","sourceRoot":"","sources":["../../src/setup/workspace-trust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AAO5D,SAAS,cAAc;IACtB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,eAAe,CAAC,IAAgB;IACxC,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC7C,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IACjC,IAAI,OAAO,GAAG,GAAG,CAAC;IAClB,OAAO,OAAO,KAAK,GAAG,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QACzE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW;IACzC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;QAAE,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,sBAAsB,GAAG,IAAI,CAAC;IACjD,eAAe,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-hyper-hq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Set up Hyper HQ — always-on Claude Code command center",
|
|
6
6
|
"author": "Saulo Vallory <saulo@toki.life>",
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
"bin": {
|
|
21
21
|
"create-hyper-hq": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"exports": {
|
|
24
|
+
"./setup/wizard": "./dist/setup/hq-config-wizard.js",
|
|
25
|
+
"./setup/trust": "./dist/setup/workspace-trust.js",
|
|
26
|
+
"./setup/claude-md": "./dist/setup/claude-md.js",
|
|
27
|
+
"./checks/plugins": "./dist/checks/check-claude-plugins.js"
|
|
28
|
+
},
|
|
23
29
|
"files": [
|
|
24
30
|
"dist",
|
|
25
31
|
"README.md",
|