@higherdev/cli 0.2.1 → 0.4.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/dist/out.js ADDED
@@ -0,0 +1,76 @@
1
+ const ESC = `${String.fromCharCode(27)}[`;
2
+ export function colorEnabled(stream = process.stdout) {
3
+ if (process.env.HIGHERDEV_FORCE_COLOR === "1" || process.env.HDX_FORCE_COLOR === "1")
4
+ return true;
5
+ if (process.env.NO_COLOR)
6
+ return false;
7
+ return Boolean(stream.isTTY);
8
+ }
9
+ function wrap(code, text) {
10
+ return colorEnabled() ? `${ESC}${code}m${text}${ESC}0m` : text;
11
+ }
12
+ export const c = {
13
+ bold: (text) => wrap(1, text),
14
+ dim: (text) => wrap(2, text),
15
+ red: (text) => wrap(31, text),
16
+ green: (text) => wrap(32, text),
17
+ yellow: (text) => wrap(33, text),
18
+ blue: (text) => wrap(94, text),
19
+ };
20
+ const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
21
+ const ELLIPSIS = "…";
22
+ export function displayWidth(text) {
23
+ return text.replace(ANSI, "").length;
24
+ }
25
+ export function truncate(text, max) {
26
+ const flat = String(text ?? "").replace(/\s+/g, " ").trim();
27
+ return flat.length <= max ? flat : `${flat.slice(0, Math.max(0, max - 1))}${ELLIPSIS}`;
28
+ }
29
+ export function table(columns, rows) {
30
+ if (!rows.length)
31
+ return c.dim("none");
32
+ const widths = columns.map((header, index) => Math.max(displayWidth(header), ...rows.map((row) => displayWidth(row[index] ?? ""))));
33
+ const line = (cells) => cells.map((cell, index) => {
34
+ const gap = widths[index] - displayWidth(cell);
35
+ return index === cells.length - 1 ? cell : cell + " ".repeat(Math.max(0, gap));
36
+ }).join(" ").trimEnd();
37
+ return [c.dim(line(columns)), ...rows.map(line)].join("\n");
38
+ }
39
+ export function statusChip(status) {
40
+ const label = status.replaceAll("_", " ");
41
+ if (["queued", "running", "in_review"].includes(status))
42
+ return c.blue(label);
43
+ if (["ready", "approved", "merged", "succeeded"].includes(status))
44
+ return c.green(label);
45
+ if (["blocked", "needs_decision", "changes_requested"].includes(status))
46
+ return c.yellow(label);
47
+ if (["failed", "cancelled", "killed"].includes(status))
48
+ return c.red(label);
49
+ return c.dim(label);
50
+ }
51
+ const SMALL_BANNER = [
52
+ "██ ██ ██ ██ ██▀▀█▄ ██████ ██ ██",
53
+ "██ ██ ▄▄ ▄▄▄▄▄▄ ██ ▄▄▄ ▄▄▄▄▄ ▄▄▄▄▄▄ ██ ██ ██ ██ ██",
54
+ "███████ ██ ██ ██ ██▀ ██ ██ ██ ███▀▀ ██ ██ █████ ▀█▄ ▄█▀",
55
+ "██ ██ ██ ██ ██ ██ ██ ██▀▀▀▀▀ ██ ██ ██ ██ ██ ██ ",
56
+ "██ ██ ██ ▀█▄▄▄██ ██ ██ ▀█▄▄▄█▀ ██ ██▄▄█▀ ██████ ███ ",
57
+ " ▄▄▄▄█▀ ",
58
+ ];
59
+ export function banner(columns = process.stdout.columns || 80) {
60
+ const rows = columns >= 66 ? SMALL_BANNER : ["HigherDEV"];
61
+ return rows.map((row) => c.blue(row)).join("\n");
62
+ }
63
+ export function usage() {
64
+ return [
65
+ c.bold("Usage"),
66
+ ` ${c.blue("hd status")} workspace overview`,
67
+ ` ${c.blue("hd ticket list | show | new")} ticket operations`,
68
+ ` ${c.blue("hd workspace new")} create a paused workspace`,
69
+ ` ${c.blue("hd agents [set]")} inspect or update agents`,
70
+ ` ${c.blue("hd logs KEY [-f]")} run events`,
71
+ ` ${c.blue("hd msg KEY TEXT")} message a builder`,
72
+ ` ${c.blue("hd decide [ID --answer TEXT]")} decisions`,
73
+ ` ${c.blue("hd on | hd off")} workspace switch`,
74
+ ` ${c.blue("hd init | hd upgrade")} host setup`,
75
+ ].join("\n");
76
+ }
package/package.json CHANGED
@@ -1,52 +1,21 @@
1
1
  {
2
2
  "name": "@higherdev/cli",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
- "description": "HigherDEV in your terminal. Full control of the board, live.",
6
5
  "bin": {
7
6
  "hd": "dist/index.js"
8
7
  },
8
+ "main": "dist/index.js",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
12
  "scripts": {
13
- "dev": "tsx src/index.ts",
14
- "build": "node scripts/sync-version.mjs && tsup",
15
- "typecheck": "tsc --noEmit",
16
- "test": "vitest run",
17
- "prepublishOnly": "pnpm build",
18
- "sync-version": "node scripts/sync-version.mjs"
19
- },
20
- "dependencies": {
21
- "@modelcontextprotocol/sdk": "1.30.0",
22
- "@supabase/supabase-js": "2.112.3",
23
- "commander": "15.0.0",
24
- "ink": "7.1.1",
25
- "react": "19.2.8",
26
- "zod": "4.4.3"
13
+ "build": "tsc",
14
+ "test": "pnpm build && node --experimental-strip-types --test test/*.test.ts",
15
+ "prepublishOnly": "npm run build"
27
16
  },
28
17
  "devDependencies": {
29
- "@higherdev/db": "workspace:*",
30
- "@higherdev/runner": "workspace:*",
31
- "@types/node": "22.20.1",
32
- "@types/react": "19.2.18",
33
- "ink-testing-library": "4.0.0",
34
- "tsup": "8.5.1",
35
- "tsx": "4.23.12",
36
- "typescript": "5.9.3",
37
- "vitest": "4.1.11"
38
- },
39
- "license": "UNLICENSED",
40
- "repository": {
41
- "type": "git",
42
- "url": "git+https://github.com/craig-higherops/higherdev.git",
43
- "directory": "apps/cli"
44
- },
45
- "homepage": "https://dev.higherops.io",
46
- "engines": {
47
- "node": ">=22"
48
- },
49
- "publishConfig": {
50
- "access": "public"
18
+ "@types/node": "24.13.3",
19
+ "typescript": "7.0.2"
51
20
  }
52
21
  }