@hivefloor/cli 0.1.4 → 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 (55) hide show
  1. package/LICENSE +6 -20
  2. package/README.md +31 -9
  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-5XXYQQG6.js +274 -0
  7. package/dist/chunk-AGIYVFDQ.js +10984 -0
  8. package/dist/{chunk-2BSA7LFD.js → chunk-BLLPDPTL.js} +7 -3
  9. package/dist/{chunk-R5KDI4WI.js → chunk-FPJNGKT5.js} +9 -3
  10. package/dist/chunk-HW3KRNCO.js +201 -0
  11. package/dist/{chunk-ZC2DAKB5.js → chunk-HWBUESB4.js} +1500 -316
  12. package/dist/{chunk-DNG5CRT3.js → chunk-K2IRTZH5.js} +8 -7
  13. package/dist/chunk-KQMPCV57.js +122 -0
  14. package/dist/{chunk-UJ4BQFWV.js → chunk-L6EFW2SJ.js} +53 -31
  15. package/dist/{chunk-T7TG6WA4.js → chunk-LX5A25O6.js} +4 -2
  16. package/dist/{chunk-W7DROKC7.js → chunk-MYJCU5JL.js} +89 -13
  17. package/dist/chunk-NMUH5NXN.js +52 -0
  18. package/dist/chunk-NRJONTFT.js +67 -0
  19. package/dist/chunk-QBBKGORP.js +327 -0
  20. package/dist/chunk-QGULSOQ2.js +142 -0
  21. package/dist/{chunk-PDXYOREI.js → chunk-QLMLB7RB.js} +110 -31
  22. package/dist/{chunk-TKMIV7BG.js → chunk-QPAFN47B.js} +3 -1
  23. package/dist/chunk-SBOEAOHD.js +48 -0
  24. package/dist/{chunk-SD65CIIY.js → chunk-TIR4CV3P.js} +117 -33
  25. package/dist/{chunk-QHYZBHXO.js → chunk-X2KH6AR4.js} +195 -251
  26. package/dist/chunk-XAXKZ572.js +106 -0
  27. package/dist/{chunk-VNCQFFQO.js → chunk-XPGL7VYE.js} +114 -1
  28. package/dist/cli-BFOJWJNG.js +279 -0
  29. package/dist/connect-ZJ4JXBAJ.js +27 -0
  30. package/dist/control-6GHTZQJV.js +25 -0
  31. package/dist/{disconnect-MKRHK4CX.js → disconnect-3T25NTKX.js} +55 -34
  32. package/dist/hook-TPSHBCWU.js +575 -0
  33. package/dist/index.js +9 -6
  34. package/dist/{link-HXBMMSG3.js → link-EAS5F5PC.js} +34 -18
  35. package/dist/{machine-connect-BYHZRRRB.js → machine-connect-KEI4BRWF.js} +30 -24
  36. package/dist/mcp-LVIYR3EN.js +1882 -0
  37. package/dist/orch-KVRL2YA2.js +137 -0
  38. package/dist/{run-336BSU72.js → run-JL2OZWK3.js} +1933 -29
  39. package/dist/{status-KBBSAADD.js → status-QXOOJGGN.js} +29 -14
  40. package/dist/token-BFWWQIDA.js +44 -0
  41. package/dist/voice-QXHFXRWG.js +264 -0
  42. package/dist/{where-KR7VWSEC.js → where-CMUORQIO.js} +20 -8
  43. package/package.json +6 -7
  44. package/dist/chunk-2IMJECYD.js +0 -71
  45. package/dist/chunk-7KF7IQJN.js +0 -30
  46. package/dist/chunk-GT3HFFT4.js +0 -132
  47. package/dist/chunk-JCLWCMEM.js +0 -8
  48. package/dist/chunk-K3NQKI34.js +0 -10
  49. package/dist/chunk-O2TC3WSS.js +0 -303
  50. package/dist/chunk-PY74LT2W.js +0 -41
  51. package/dist/cli-P3DYE5IR.js +0 -103
  52. package/dist/connect-ACNM5DQG.js +0 -23
  53. package/dist/hook-KR2HGVAR.js +0 -301
  54. package/dist/mcp-N2TMD4GR.js +0 -121
  55. package/dist/token-JDRLEV5D.js +0 -32
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __hfCreateRequire } from 'node:module';
3
+ const require = __hfCreateRequire(import.meta.url);
4
+ import {
5
+ FULL_POWER_MEANS,
6
+ describeFull
7
+ } from "./chunk-HW3KRNCO.js";
8
+ import "./chunk-5XXYQQG6.js";
9
+ import "./chunk-4G362W6G.js";
10
+ import "./chunk-X2KH6AR4.js";
11
+ import {
12
+ checkUnknownFlags
13
+ } from "./chunk-QPAFN47B.js";
14
+ import {
15
+ allOff,
16
+ orchestratorFullOn,
17
+ orchestratorOn,
18
+ readControl,
19
+ writeControl
20
+ } from "./chunk-KQMPCV57.js";
21
+ import "./chunk-L6EFW2SJ.js";
22
+ import {
23
+ readMachine,
24
+ serviceAlive
25
+ } from "./chunk-LX5A25O6.js";
26
+ import "./chunk-NRJONTFT.js";
27
+ import {
28
+ controlFile
29
+ } from "./chunk-XPGL7VYE.js";
30
+ import "./chunk-QGULSOQ2.js";
31
+ import "./chunk-HWBUESB4.js";
32
+ import "./chunk-2ERPDCOT.js";
33
+
34
+ // src/orch.ts
35
+ var FULL_WORD = "FULL";
36
+ function consentTrouble(ctx) {
37
+ if (ctx.env.CLAUDECODE || ctx.env.CLAUDE_CODE_ENTRYPOINT) {
38
+ return 'full power cannot be turned on from inside a Claude Code session. Run "hivefloor orch enable --full" yourself, in your own terminal.';
39
+ }
40
+ if (ctx.stdinIsTTY !== true || !ctx.stdoutIsTTY) {
41
+ return 'full power is turned on by a person at a terminal: run "hivefloor orch enable --full" in one, with no pipe or redirect.';
42
+ }
43
+ return void 0;
44
+ }
45
+ var ORCH_FLAGS = /* @__PURE__ */ new Set(["full", "no-full", "help", "h"]);
46
+ var USAGE = "hivefloor: usage: hivefloor orch enable [--full | --no-full] | disable | status\n";
47
+ function describe(ctx) {
48
+ const r = readControl();
49
+ ctx.out(`Orchestrator: ${orchestratorOn(r) ? "on" : "off"}
50
+ `);
51
+ ctx.out(`File: ${controlFile()} (${r.state === "ok" ? "valid" : r.state === "missing" ? "not there: everything is off" : "NOT TRUSTED: everything is off"})
52
+ `);
53
+ if (r.state === "invalid") ctx.out(`Why: ${r.reason}
54
+ `);
55
+ if (orchestratorOn(r) && !orchestratorFullOn(r)) {
56
+ ctx.out("The session is sandboxed: its own folder (~/.config/hivefloor/orchestrator/work), none of your settings, and every tool call outside reading that folder is asked on the HiveFloor orchestrator page.\n");
57
+ }
58
+ describeFull(ctx, r);
59
+ const m = readMachine();
60
+ if (!m || m.revoked) ctx.out('This machine is not connected: run "hivefloor connect" first, or nothing can reach it.\n');
61
+ else if (!serviceAlive(ctx.now())) ctx.out("The background service is not running: the orchestrator only runs while it does.\n");
62
+ }
63
+ async function orch(ctx, p) {
64
+ const unknown = checkUnknownFlags(p, ORCH_FLAGS);
65
+ if (unknown) {
66
+ ctx.err(`hivefloor: unknown flag "--${unknown}". Run "hivefloor help orch".
67
+ `);
68
+ return 2;
69
+ }
70
+ const sub = p.positionals[0];
71
+ if (p.positionals.length !== 1 || sub !== "enable" && sub !== "disable" && sub !== "status") {
72
+ ctx.err(USAGE);
73
+ return 2;
74
+ }
75
+ const full = p.flags.full !== void 0;
76
+ const noFull = p.flags["no-full"] !== void 0;
77
+ if ((full || noFull) && sub !== "enable") {
78
+ ctx.err('hivefloor: --full and --no-full go with "orch enable".\n');
79
+ return 2;
80
+ }
81
+ if (full && noFull) {
82
+ ctx.err("hivefloor: pass --full or --no-full, not both.\n");
83
+ return 2;
84
+ }
85
+ if (full && p.flags.full !== true || noFull && p.flags["no-full"] !== true) {
86
+ ctx.err("hivefloor: --full and --no-full take no value.\n");
87
+ return 2;
88
+ }
89
+ if (sub === "status") {
90
+ describe(ctx);
91
+ return 0;
92
+ }
93
+ const cur = readControl();
94
+ if (cur.state === "invalid") {
95
+ ctx.err(`hivefloor: ${cur.reason}. Fix that and run this again; the file is not overwritten.
96
+ `);
97
+ return 1;
98
+ }
99
+ const base = cur.state === "ok" ? cur.config : allOff();
100
+ if (sub === "disable") {
101
+ if (cur.state === "ok") writeControl({ ...base, orchestrator: false, orchestrator_full: false });
102
+ ctx.out("The orchestrator is off on this machine. A running session is stopped within a few seconds.\n");
103
+ return 0;
104
+ }
105
+ if (full) {
106
+ const trouble = consentTrouble(ctx);
107
+ if (trouble) {
108
+ ctx.err(`hivefloor: ${trouble} Nothing was changed.
109
+ `);
110
+ return 1;
111
+ }
112
+ ctx.out(`${FULL_POWER_MEANS}
113
+ `);
114
+ const answer = (await ctx.ask(`Type ${FULL_WORD} to turn full power on (anything else leaves it as it is): `)).trim();
115
+ if (answer !== FULL_WORD) {
116
+ ctx.err("hivefloor: full power was not turned on. Nothing was changed.\n");
117
+ return 1;
118
+ }
119
+ }
120
+ const wasOn = base.enabled && base.orchestrator;
121
+ const next = {
122
+ ...base,
123
+ version: 1,
124
+ enabled: true,
125
+ verbs: base.enabled ? base.verbs : allOff().verbs,
126
+ orchestrator: true,
127
+ orchestrator_full: full ? true : noFull ? false : wasOn && base.orchestrator_full
128
+ };
129
+ writeControl(next);
130
+ ctx.out(full ? "The orchestrator is on, with full power.\n" : "The orchestrator is on.\n");
131
+ describe(ctx);
132
+ return 0;
133
+ }
134
+ export {
135
+ FULL_WORD,
136
+ orch
137
+ };