@hivefloor/cli 0.1.5 → 0.1.8

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 (48) hide show
  1. package/LICENSE +6 -20
  2. package/README.md +29 -8
  3. package/dist/chunk-2ERPDCOT.js +38 -0
  4. package/dist/chunk-4G362W6G.js +19 -0
  5. package/dist/chunk-5OJUJCE3.js +817 -0
  6. package/dist/{chunk-U6RRUAC2.js → chunk-5XXYQQG6.js} +53 -8
  7. package/dist/chunk-AGIYVFDQ.js +10984 -0
  8. package/dist/{chunk-RYGL6XU4.js → chunk-BLLPDPTL.js} +4 -2
  9. package/dist/{chunk-3N5JYP5O.js → chunk-FPJNGKT5.js} +5 -3
  10. package/dist/chunk-HW3KRNCO.js +201 -0
  11. package/dist/{chunk-4DRHR7LR.js → chunk-HWBUESB4.js} +1158 -196
  12. package/dist/{chunk-C627OKTW.js → chunk-K2IRTZH5.js} +7 -6
  13. package/dist/chunk-KQMPCV57.js +122 -0
  14. package/dist/{chunk-J36OIJBM.js → chunk-L6EFW2SJ.js} +14 -10
  15. package/dist/{chunk-IJRHCDIG.js → chunk-LX5A25O6.js} +4 -2
  16. package/dist/{chunk-MZGGJ6ZS.js → chunk-MYJCU5JL.js} +4 -2
  17. package/dist/{chunk-H6NYMF2D.js → chunk-NMUH5NXN.js} +6 -4
  18. package/dist/{chunk-VX7SCIF2.js → chunk-NRJONTFT.js} +3 -1
  19. package/dist/chunk-QBBKGORP.js +327 -0
  20. package/dist/{chunk-SOXRITAW.js → chunk-QGULSOQ2.js} +3 -0
  21. package/dist/{chunk-6MDJB3BV.js → chunk-QLMLB7RB.js} +17 -9
  22. package/dist/{chunk-TKMIV7BG.js → chunk-QPAFN47B.js} +3 -1
  23. package/dist/chunk-SBOEAOHD.js +48 -0
  24. package/dist/{chunk-IWIDKNWC.js → chunk-TIR4CV3P.js} +21 -17
  25. package/dist/{chunk-6XVIEX75.js → chunk-X2KH6AR4.js} +25 -303
  26. package/dist/chunk-XAXKZ572.js +106 -0
  27. package/dist/{chunk-TPMFQUAW.js → chunk-XPGL7VYE.js} +12 -0
  28. package/dist/{cli-JCBZICR3.js → cli-BFOJWJNG.js} +56 -20
  29. package/dist/connect-ZJ4JXBAJ.js +27 -0
  30. package/dist/control-6GHTZQJV.js +25 -0
  31. package/dist/{disconnect-WQMDCUXT.js → disconnect-3T25NTKX.js} +24 -17
  32. package/dist/{hook-AYJNRGIY.js → hook-TPSHBCWU.js} +277 -17
  33. package/dist/index.js +9 -6
  34. package/dist/{link-ORT4LID6.js → link-EAS5F5PC.js} +14 -11
  35. package/dist/{machine-connect-N52CKQEW.js → machine-connect-KEI4BRWF.js} +23 -17
  36. package/dist/mcp-LVIYR3EN.js +1882 -0
  37. package/dist/orch-KVRL2YA2.js +137 -0
  38. package/dist/{run-ZAZ45MKQ.js → run-JL2OZWK3.js} +1920 -28
  39. package/dist/{status-GOCFNO7K.js → status-QXOOJGGN.js} +14 -11
  40. package/dist/{token-EMM4AJAU.js → token-BFWWQIDA.js} +10 -7
  41. package/dist/{voice-F5MIS3IZ.js → voice-QXHFXRWG.js} +5 -3
  42. package/dist/{where-XFXRTP7E.js → where-CMUORQIO.js} +11 -8
  43. package/package.json +5 -6
  44. package/dist/chunk-JCLWCMEM.js +0 -8
  45. package/dist/chunk-K3NQKI34.js +0 -10
  46. package/dist/chunk-X6B6R32A.js +0 -303
  47. package/dist/connect-2HLVPEOL.js +0 -23
  48. package/dist/mcp-2SF6Y73M.js +0 -118
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire as __hfCreateRequire } from 'node:module';
3
+ const require = __hfCreateRequire(import.meta.url);
4
+ import {
5
+ PERMISSION_TIMEOUT_SEC
6
+ } from "./chunk-4G362W6G.js";
2
7
  import {
3
8
  CLAUDE_EVENTS,
4
9
  CODEX_EVENTS,
@@ -10,12 +15,16 @@ import {
10
15
  removeHooks,
11
16
  restoreFeatureHooks,
12
17
  wasCreated
13
- } from "./chunk-6XVIEX75.js";
18
+ } from "./chunk-X2KH6AR4.js";
19
+ import {
20
+ activeVerbs,
21
+ readControl
22
+ } from "./chunk-KQMPCV57.js";
14
23
  import {
15
24
  claudeConfigDirs,
16
25
  codexConfigDir,
17
26
  profileKeys
18
- } from "./chunk-J36OIJBM.js";
27
+ } from "./chunk-L6EFW2SJ.js";
19
28
  import {
20
29
  atomicWrite,
21
30
  backupOnce,
@@ -26,7 +35,7 @@ import {
26
35
  isDir,
27
36
  readText,
28
37
  removeFile
29
- } from "./chunk-TPMFQUAW.js";
38
+ } from "./chunk-XPGL7VYE.js";
30
39
 
31
40
  // src/machine-hooks.ts
32
41
  import fs from "fs";
@@ -44,13 +53,33 @@ function installCliCopy(srcDir) {
44
53
  fs.writeFileSync(path.join(dest, "package.json"), '{"type":"module"}\n');
45
54
  }
46
55
  var removeCliCopy = () => fs.rmSync(cliDir(), { recursive: true, force: true });
47
- function claudeMachineSpecs(node, profile) {
48
- return CLAUDE_EVENTS.map((event) => ({
56
+ function claudeMachineSpecs(node, profile, verbs = {}) {
57
+ const entry = (event, extra) => ({ type: "command", command: node, args: [cliEntry(), "hook", "claude", event, "--profile", profile], ...extra });
58
+ const specs = CLAUDE_EVENTS.map((event) => ({
49
59
  event,
50
60
  ...event === "Notification" ? { matcher: "permission_prompt|idle_prompt" } : {},
51
61
  // Exec form: no shell, no quoting. async: the hook never slows the agent down.
52
- entry: { type: "command", command: node, args: [cliEntry(), "hook", "claude", event, "--profile", profile], async: true }
62
+ entry: entry(event, { async: true })
53
63
  }));
64
+ if (verbs.message) specs.push({ event: "PostToolUse", entry: entry("PostToolUse", { async: true }) });
65
+ if (verbs.approve || verbs.deny) specs.push({ event: "PermissionRequest", entry: entry("PermissionRequest", { timeout: PERMISSION_TIMEOUT_SEC }) });
66
+ return specs;
67
+ }
68
+ var currentControlVerbs = () => activeVerbs(readControl());
69
+ function applyControlHooks(node, dirs, verbs) {
70
+ const out = { lines: [], warnings: [] };
71
+ const existing = distinctSettingsDirs(dirs.filter(isDir));
72
+ const keys = profileKeys("claude", existing);
73
+ for (const dir of existing) {
74
+ const file = path.join(dir, "settings.json");
75
+ try {
76
+ editJson(file, (d) => (addHooks(d, "nested", claudeMachineSpecs(node, keys.get(dir), verbs), "machine"), true));
77
+ out.lines.push(`Claude Code hooks (${keys.get(dir)}): ${file}`);
78
+ } catch (e) {
79
+ out.warnings.push(e.message);
80
+ }
81
+ }
82
+ return out;
54
83
  }
55
84
  var q = (s) => `"${s.replace(/(["\\$`])/g, "\\$1")}"`;
56
85
  var CODEX_HOOK_CMD = "codex-hook.cmd";
@@ -133,14 +162,29 @@ function codexMachineSpecs(node, profile, shim = codexShimPath(cliDir(), home())
133
162
  };
134
163
  });
135
164
  }
165
+ function distinctSettingsDirs(dirs) {
166
+ const seen = /* @__PURE__ */ new Set();
167
+ return dirs.filter((dir) => {
168
+ const file = path.join(dir, "settings.json");
169
+ let real = file;
170
+ try {
171
+ real = fs.realpathSync(file);
172
+ } catch {
173
+ }
174
+ if (seen.has(real)) return false;
175
+ seen.add(real);
176
+ return true;
177
+ });
178
+ }
136
179
  function installMachineHooks(node, opts) {
137
180
  const res = { claude_dirs: [], lines: [], warnings: [] };
138
- const dirs = claudeConfigDirs(opts.processDirs).filter(isDir);
181
+ const verbs = currentControlVerbs();
182
+ const dirs = distinctSettingsDirs(claudeConfigDirs(opts.processDirs).filter(isDir));
139
183
  const keys = profileKeys("claude", dirs);
140
184
  for (const dir of dirs) {
141
185
  const file = path.join(dir, "settings.json");
142
186
  try {
143
- editJson(file, (d) => (addHooks(d, "nested", claudeMachineSpecs(node, keys.get(dir)), "machine"), true));
187
+ editJson(file, (d) => (addHooks(d, "nested", claudeMachineSpecs(node, keys.get(dir), verbs), "machine"), true));
144
188
  res.claude_dirs.push(dir);
145
189
  res.lines.push(`Claude Code hooks (${keys.get(dir)}): ${file}`);
146
190
  } catch (e) {
@@ -224,6 +268,7 @@ function removeMachineHooks(inst) {
224
268
  export {
225
269
  installCliCopy,
226
270
  removeCliCopy,
271
+ applyControlHooks,
227
272
  installMachineHooks,
228
273
  removeMachineHooks
229
274
  };