@hivefloor/cli 0.1.1 → 0.1.3

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 (29) hide show
  1. package/dist/{chunk-76HDATOB.js → chunk-3YOTXIFP.js} +13 -13
  2. package/dist/{chunk-Q2TS3GT3.js → chunk-DQV6FAJU.js} +2 -2
  3. package/dist/{chunk-MMWX62ZU.js → chunk-DWHMBUCA.js} +2 -2
  4. package/dist/{chunk-NCRQGIJY.js → chunk-E4V47VEV.js} +3 -9
  5. package/dist/{chunk-WO7NALQO.js → chunk-HT5KXWXM.js} +1 -1
  6. package/dist/{chunk-WLHRUZTR.js → chunk-KHHSRIMU.js} +2 -1
  7. package/dist/{chunk-WHHV2NZA.js → chunk-NKMVO5BP.js} +4 -10
  8. package/dist/{chunk-YCZ7XJJF.js → chunk-NLZXB26Y.js} +2 -2
  9. package/dist/{chunk-SGDM7MAT.js → chunk-O2TC3WSS.js} +68 -2
  10. package/dist/{chunk-U7PMOZGI.js → chunk-O6VSA2JT.js} +4 -3
  11. package/dist/{chunk-3IMV5EHP.js → chunk-T7TG6WA4.js} +1 -1
  12. package/dist/{chunk-ZYRPQPGL.js → chunk-TH4ANHSG.js} +333 -190
  13. package/dist/{chunk-WNDUGQDX.js → chunk-VNCQFFQO.js} +8 -0
  14. package/dist/{chunk-CWEEIRW2.js → chunk-YRNMECUF.js} +1 -1
  15. package/dist/{cli-FFAZRKLR.js → cli-MAHYTCYV.js} +13 -10
  16. package/dist/connect-QA3QIEGL.js +23 -0
  17. package/dist/{disconnect-VWUOUZP6.js → disconnect-FI76IEZJ.js} +10 -10
  18. package/dist/{hook-WSJXG2XU.js → hook-N4ZTQEWM.js} +53 -19
  19. package/dist/index.js +2 -2
  20. package/dist/{link-TFITMC6H.js → link-5WSZHKBE.js} +9 -9
  21. package/dist/{machine-connect-I3OZCTUZ.js → machine-connect-GQJ4SB3D.js} +24 -24
  22. package/dist/{mcp-47WTNQNN.js → mcp-EUBTVJNX.js} +7 -7
  23. package/dist/run-BEE2ATEM.js +1989 -0
  24. package/dist/{status-GXZ267BD.js → status-SMAVPW4D.js} +14 -14
  25. package/dist/{token-C4K23KXH.js → token-AUEAWQDH.js} +4 -4
  26. package/dist/where-7NI7UEEF.js +70 -0
  27. package/package.json +1 -1
  28. package/dist/connect-FM4BXTQQ.js +0 -23
  29. package/dist/run-JO4NEHWG.js +0 -629
@@ -1,35 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- profileKeys
4
- } from "./chunk-NCRQGIJY.js";
5
- import {
6
- SERVICE_ALIVE_MS,
7
- readMachine,
8
- readServiceState
9
- } from "./chunk-3IMV5EHP.js";
3
+ detectRepo
4
+ } from "./chunk-YRNMECUF.js";
10
5
  import {
11
6
  resolveSession
12
- } from "./chunk-MMWX62ZU.js";
13
- import {
14
- detectRepo
15
- } from "./chunk-CWEEIRW2.js";
7
+ } from "./chunk-DWHMBUCA.js";
16
8
  import "./chunk-2IMJECYD.js";
17
9
  import "./chunk-TKMIV7BG.js";
18
10
  import {
19
11
  SCHTASKS_TASK,
20
12
  readCredentials,
21
13
  windowsServiceStatus
22
- } from "./chunk-Q2TS3GT3.js";
14
+ } from "./chunk-DQV6FAJU.js";
15
+ import {
16
+ profileKeys
17
+ } from "./chunk-E4V47VEV.js";
18
+ import {
19
+ SERVICE_ALIVE_MS,
20
+ readMachine,
21
+ readServiceState
22
+ } from "./chunk-T7TG6WA4.js";
23
23
  import {
24
24
  apiRequest,
25
25
  errorOf
26
26
  } from "./chunk-PY74LT2W.js";
27
- import "./chunk-WNDUGQDX.js";
27
+ import "./chunk-VNCQFFQO.js";
28
28
  import {
29
29
  cliNpxCommand,
30
30
  machineName,
31
31
  runCmd
32
- } from "./chunk-ZYRPQPGL.js";
32
+ } from "./chunk-TH4ANHSG.js";
33
33
  import "./chunk-K3NQKI34.js";
34
34
 
35
35
  // src/status.ts
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveSession
4
- } from "./chunk-MMWX62ZU.js";
4
+ } from "./chunk-DWHMBUCA.js";
5
5
  import "./chunk-2IMJECYD.js";
6
6
  import "./chunk-TKMIV7BG.js";
7
- import "./chunk-Q2TS3GT3.js";
8
- import "./chunk-WNDUGQDX.js";
7
+ import "./chunk-DQV6FAJU.js";
8
+ import "./chunk-VNCQFFQO.js";
9
9
  import {
10
10
  cliNpxCommand
11
- } from "./chunk-ZYRPQPGL.js";
11
+ } from "./chunk-TH4ANHSG.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
14
14
  // src/token.ts
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ resolveSession
4
+ } from "./chunk-DWHMBUCA.js";
5
+ import "./chunk-2IMJECYD.js";
6
+ import "./chunk-TKMIV7BG.js";
7
+ import "./chunk-DQV6FAJU.js";
8
+ import {
9
+ apiRequest,
10
+ errorOf
11
+ } from "./chunk-PY74LT2W.js";
12
+ import "./chunk-VNCQFFQO.js";
13
+ import {
14
+ cliNpxCommand,
15
+ routeProviderFromParam,
16
+ usageRouteSchema
17
+ } from "./chunk-TH4ANHSG.js";
18
+ import "./chunk-K3NQKI34.js";
19
+
20
+ // src/where.ts
21
+ async function where(ctx, p) {
22
+ const arg = p.positionals[0];
23
+ if (arg !== void 0 && routeProviderFromParam(arg) === null) {
24
+ ctx.err(`hivefloor: "${arg}" is not a tool or provider. Try: ${cliNpxCommand("where claude")}
25
+ `);
26
+ return 2;
27
+ }
28
+ const s = await resolveSession(ctx, p);
29
+ if (!s) {
30
+ ctx.err(`hivefloor: not connected. Run: ${cliNpxCommand("connect")}
31
+ `);
32
+ return 1;
33
+ }
34
+ const res = await apiRequest(ctx, s.host, `/api/v1/agent/where-to-run${arg ? `?tool=${encodeURIComponent(arg)}` : ""}`, { token: s.token, timeoutMs: 1e4 });
35
+ if (res.status === 401) {
36
+ ctx.err(`hivefloor: the token was rejected (revoked?). Run: ${cliNpxCommand("connect")}
37
+ `);
38
+ return 1;
39
+ }
40
+ if (res.status !== 200) {
41
+ ctx.err(`hivefloor: ${errorOf(res).message}
42
+ `);
43
+ return 1;
44
+ }
45
+ const parsed = usageRouteSchema.safeParse(res.json);
46
+ if (!parsed.success) {
47
+ ctx.err("hivefloor: the server answered something this version does not understand. Update the CLI.\n");
48
+ return 1;
49
+ }
50
+ if (p.flags.json) ctx.out(`${JSON.stringify(parsed.data, null, 2)}
51
+ `);
52
+ else ctx.out(render(parsed.data));
53
+ return 0;
54
+ }
55
+ function render(route) {
56
+ if (route.providers.length === 0) return "No account usage reported yet. Connect a machine and sign in to a provider.\n";
57
+ const lines = [];
58
+ for (const g of route.providers) {
59
+ const best = g.accounts.find((a) => a.id === g.best);
60
+ lines.push(best ? `${g.name}: run next on ${best.label}` : `${g.name}: no account can take work now`);
61
+ for (const a of g.accounts) lines.push(` ${a.id === g.best ? "*" : " "} ${a.reason}`);
62
+ }
63
+ if (route.unlinked_sessions > 0) lines.push(`${route.unlinked_sessions} live session${route.unlinked_sessions === 1 ? "" : "s"} not linked to an account (set the agent's account label to the account's label).`);
64
+ return `${lines.join("\n")}
65
+ `;
66
+ }
67
+ export {
68
+ render,
69
+ where
70
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hivefloor/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Connect your coding agents (Claude Code, Codex, Cursor, Gemini, Grok) to Hivefloor: live presence, task coordination and usage on one floor.",
5
5
  "author": {
6
6
  "name": "Errr0rr404",
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- connect,
4
- connectAgent,
5
- resolveHost
6
- } from "./chunk-76HDATOB.js";
7
- import "./chunk-YCZ7XJJF.js";
8
- import "./chunk-3IMV5EHP.js";
9
- import "./chunk-WO7NALQO.js";
10
- import "./chunk-CWEEIRW2.js";
11
- import "./chunk-2IMJECYD.js";
12
- import "./chunk-TKMIV7BG.js";
13
- import "./chunk-Q2TS3GT3.js";
14
- import "./chunk-WLHRUZTR.js";
15
- import "./chunk-PY74LT2W.js";
16
- import "./chunk-WNDUGQDX.js";
17
- import "./chunk-ZYRPQPGL.js";
18
- import "./chunk-K3NQKI34.js";
19
- export {
20
- connect,
21
- connectAgent,
22
- resolveHost
23
- };