@h1veframework/cli 0.14.0 → 0.15.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.
Files changed (2) hide show
  1. package/dist/index.js +44 -21
  2. package/package.json +61 -61
package/dist/index.js CHANGED
@@ -297,6 +297,26 @@ async function exchangeCliLoginCode(config, code) {
297
297
  return { apiKey: body.api_key };
298
298
  }
299
299
 
300
+ // ../core/src/cli-login.ts
301
+ function buildAuthorizeUrl(baseUrl, port, state) {
302
+ const base = baseUrl.replace(/\/+$/, "");
303
+ return `${base}/cli-login?port=${port}&state=${encodeURIComponent(state)}`;
304
+ }
305
+ function parseCallbackUrl(reqUrl, expectedState) {
306
+ let u;
307
+ try {
308
+ u = new URL(reqUrl, "http://127.0.0.1");
309
+ } catch {
310
+ return { error: "bad_url" };
311
+ }
312
+ if (u.pathname !== "/cb") return { error: "not_cb" };
313
+ const code = u.searchParams.get("code");
314
+ const state = u.searchParams.get("state");
315
+ if (!code || !state) return { error: "missing" };
316
+ if (state !== expectedState) return { error: "state_mismatch" };
317
+ return { code };
318
+ }
319
+
300
320
  // ../core/src/env.ts
301
321
  import { readFile as fsReadFile, writeFile as fsWriteFile } from "fs/promises";
302
322
  import { join } from "path";
@@ -528,6 +548,13 @@ function formatStatus(d) {
528
548
  } else {
529
549
  lines.push("Blockers ativos: nenhum");
530
550
  }
551
+ if (d.attachments && d.attachments.length) {
552
+ lines.push(`Anexos (${d.attachments.length}):`);
553
+ for (const a of d.attachments) {
554
+ const tag = a.kind === "repo_path" ? " (arquivo local \u2014 leia)" : "";
555
+ lines.push(` \u{1F4CE} ${a.label ? `${a.label} \u2014 ` : ""}${a.value}${tag}`);
556
+ }
557
+ }
531
558
  if (d.ai_declaration?.submitted) lines.push("AI declaration: enviada");
532
559
  return lines.join("\n");
533
560
  }
@@ -553,14 +580,28 @@ function formatMove(prevStage, r) {
553
580
  function formatBlocker(r) {
554
581
  return `\u2713 Blocker aberto: ${r.description}`;
555
582
  }
583
+ function suggestionReason(f) {
584
+ if (f.branch_slug !== null) return "j\xE1 iniciado \u2014 retome antes de abrir outra frente";
585
+ if (f.blocked_by_dep) return "\xE9 o mais priorit\xE1rio dispon\xEDvel, mas depende de trabalho n\xE3o conclu\xEDdo";
586
+ if (f.priority === "HIGH") return "prioridade alta e sem depend\xEAncia pendente";
587
+ if (f.priority === "MEDIUM") return "sem depend\xEAncia pendente; nada de prioridade alta na fila";
588
+ return "\xE9 o que resta na fila";
589
+ }
590
+ function metaOf(f) {
591
+ const aposta = f.appetite ? ` \xB7 ${f.appetite}d` : "";
592
+ return ` ${f.priority}${aposta}`;
593
+ }
556
594
  function formatStartList(list) {
557
595
  const header = "Features para iniciar ou retomar \u2014 escolha: h1ve start <n\xBA>";
558
- const rows = list.map((f, i) => {
596
+ const rows = list.flatMap((f, i) => {
597
+ const sugerido = i === 0;
598
+ const marca = sugerido ? "\u2192" : " ";
559
599
  const tag = f.branch_slug !== null ? " (retomar)" : "";
560
600
  const dep = f.depends_on && f.depends_on.length > 0 ? ` \u26A0 depende de ${f.depends_on.map((d) => d.name).join(", ")}` : "";
561
- return ` ${String(i + 1).padStart(2)}. ${f.name} [${stageLabel(f.stage)}]${tag}${dep}`;
601
+ const linha = `${marca} ${String(i + 1).padStart(2)}. ${f.name} [${stageLabel(f.stage)}]${metaOf(f)}${tag}${dep}`;
602
+ return sugerido ? [linha, ` sugerido: ${suggestionReason(f)}`] : [linha];
562
603
  });
563
- return [header, ...rows].join("\n");
604
+ return [header, "", ...rows].join("\n");
564
605
  }
565
606
  var PRIORITY_RANK = { HIGH: 0, MEDIUM: 1, LOW: 2 };
566
607
  function rankStartable(list) {
@@ -1340,24 +1381,6 @@ import { createServer as createServer2 } from "http";
1340
1381
  import { randomBytes as randomBytes2 } from "crypto";
1341
1382
  import { execFile as execFile2 } from "child_process";
1342
1383
  var LOGIN_TIMEOUT_MS = 3 * 60 * 1e3;
1343
- function buildAuthorizeUrl(baseUrl, port, state) {
1344
- const base = baseUrl.replace(/\/+$/, "");
1345
- return `${base}/cli-login?port=${port}&state=${encodeURIComponent(state)}`;
1346
- }
1347
- function parseCallbackUrl(reqUrl, expectedState) {
1348
- let u;
1349
- try {
1350
- u = new URL(reqUrl, "http://127.0.0.1");
1351
- } catch {
1352
- return { error: "bad_url" };
1353
- }
1354
- if (u.pathname !== "/cb") return { error: "not_cb" };
1355
- const code = u.searchParams.get("code");
1356
- const state = u.searchParams.get("state");
1357
- if (!code || !state) return { error: "missing" };
1358
- if (state !== expectedState) return { error: "state_mismatch" };
1359
- return { code };
1360
- }
1361
1384
  var SUCCESS_HTML = `<!doctype html><html><head><meta charset="utf-8"><title>H1VE</title></head>
1362
1385
  <body style="font-family:system-ui;background:#0f1115;color:#e7e9ee;display:flex;min-height:100vh;align-items:center;justify-content:center;margin:0">
1363
1386
  <div style="text-align:center"><div style="font-size:22px;font-weight:800;letter-spacing:.12em">H<span style="color:#f5a623">1</span>VE</div>
package/package.json CHANGED
@@ -1,61 +1,61 @@
1
- {
2
- "name": "@h1veframework/cli",
3
- "version": "0.14.0",
4
- "description": "The CLI for H1VE — the governance & memory layer for teams building with AI. Drive your feature flow (start, status, move, spec, done) from the terminal. Works with Claude Code, Cursor and Copilot.",
5
- "license": "MIT",
6
- "type": "module",
7
- "bin": {
8
- "h1ve": "dist/index.js",
9
- "nf": "dist/index.js"
10
- },
11
- "files": [
12
- "dist",
13
- "README.md"
14
- ],
15
- "engines": {
16
- "node": ">=18.18"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/GusHartz/nexus-flow.git",
21
- "directory": "packages/cli"
22
- },
23
- "homepage": "https://h1ve.org",
24
- "bugs": {
25
- "url": "https://github.com/GusHartz/nexus-flow/issues"
26
- },
27
- "keywords": [
28
- "h1ve",
29
- "cli",
30
- "nf",
31
- "ai",
32
- "claude-code",
33
- "cursor",
34
- "copilot",
35
- "ai-coding",
36
- "ai-agents",
37
- "memory",
38
- "anti-drift",
39
- "context",
40
- "governance",
41
- "developer-tools",
42
- "dev-workflow",
43
- "mcp"
44
- ],
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
- "scripts": {
49
- "build": "tsup",
50
- "typecheck": "tsc --noEmit",
51
- "test": "vitest run",
52
- "prepublishOnly": "npm run build"
53
- },
54
- "devDependencies": {
55
- "@nexus-flow/core": "*",
56
- "@types/node": "^20.19.43",
57
- "tsup": "^8.3.0",
58
- "typescript": "^5.6.0",
59
- "vitest": "^2.1.0"
60
- }
61
- }
1
+ {
2
+ "name": "@h1veframework/cli",
3
+ "version": "0.15.0",
4
+ "description": "The CLI for H1VE — the governance & memory layer for teams building with AI. Drive your feature flow (start, status, move, spec, done) from the terminal. Works with Claude Code, Cursor and Copilot.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "h1ve": "dist/index.js",
9
+ "nf": "dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18.18"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/GusHartz/nexus-flow.git",
21
+ "directory": "packages/cli"
22
+ },
23
+ "homepage": "https://h1ve.org",
24
+ "bugs": {
25
+ "url": "https://github.com/GusHartz/nexus-flow/issues"
26
+ },
27
+ "keywords": [
28
+ "h1ve",
29
+ "cli",
30
+ "nf",
31
+ "ai",
32
+ "claude-code",
33
+ "cursor",
34
+ "copilot",
35
+ "ai-coding",
36
+ "ai-agents",
37
+ "memory",
38
+ "anti-drift",
39
+ "context",
40
+ "governance",
41
+ "developer-tools",
42
+ "dev-workflow",
43
+ "mcp"
44
+ ],
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "scripts": {
49
+ "build": "tsup",
50
+ "typecheck": "tsc --noEmit",
51
+ "test": "vitest run",
52
+ "prepublishOnly": "npm run build"
53
+ },
54
+ "devDependencies": {
55
+ "@nexus-flow/core": "*",
56
+ "@types/node": "^20.19.43",
57
+ "tsup": "^8.3.0",
58
+ "typescript": "^5.6.0",
59
+ "vitest": "^2.1.0"
60
+ }
61
+ }