@braingrid/cli 0.2.4 → 0.2.5

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/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.5] - 2025-11-11
9
+
10
+ ### Fixed
11
+
12
+ - **Status line installation in setup command** (#38)
13
+ - Fixed critical bug where `braingrid setup claude-code` failed to install status line
14
+ - Changed to fetch `statusline.sh` from GitHub repository instead of local package
15
+ - Fixed configuration format to use object with `type`, `command`, and `padding` fields
16
+ - Removed unused `fileURLToPath` import from setup handlers
17
+ - Status line now correctly installs and displays BrainGrid context in Claude Code
18
+
19
+ ### Changed
20
+
21
+ - **CLAUDE.md injection source** (#38)
22
+ - Setup command now fetches `claude-code/CLAUDE.md` instead of `claude-code/README.md`
23
+ - Provides cleaner, more focused BrainGrid workflow instructions for injection
24
+ - Injected content matches the curated `.claude/CLAUDE.md` format
25
+
26
+ - **AGENTS.md injection consistency** (#38)
27
+ - Created `.cursor/AGENTS.md` with same BrainGrid workflow content as `.claude/CLAUDE.md`
28
+ - Updated `cursor/AGENTS.md` in braingrid repo to match injection pattern (44 lines)
29
+ - Both Claude Code and Cursor now follow consistent injection pattern
30
+ - Provides unified BrainGrid workflow experience across both IDEs
31
+
8
32
  ## [0.2.4] - 2025-11-10
9
33
 
10
34
  ### Added
package/dist/cli.js CHANGED
@@ -343,7 +343,7 @@ var DEFAULT_OPTIONS = {
343
343
  // No-op by default
344
344
  };
345
345
  async function sleep(ms) {
346
- return new Promise((resolve2) => setTimeout(resolve2, ms));
346
+ return new Promise((resolve) => setTimeout(resolve, ms));
347
347
  }
348
348
  function calculateDelay(attempt, initialDelay, maxDelay, backoffMultiplier) {
349
349
  const exponentialDelay = initialDelay * Math.pow(backoffMultiplier, attempt - 1);
@@ -422,7 +422,7 @@ import axios3, { AxiosError as AxiosError2 } from "axios";
422
422
 
423
423
  // src/build-config.ts
424
424
  var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
425
- var CLI_VERSION = true ? "0.2.4" : "0.0.0-test";
425
+ var CLI_VERSION = true ? "0.2.5" : "0.0.0-test";
426
426
  var PRODUCTION_CONFIG = {
427
427
  apiUrl: "https://app.braingrid.ai",
428
428
  workosAuthUrl: "https://sensitive-harvest-60.authkit.app",
@@ -531,7 +531,7 @@ var OAuth2Handler = class {
531
531
  * Start local HTTP server to handle OAuth callback
532
532
  */
533
533
  async startCallbackServer(port) {
534
- return new Promise((resolve2) => {
534
+ return new Promise((resolve) => {
535
535
  this.server = createServer((req, res) => {
536
536
  const url = new URL(req.url || "", `http://127.0.0.1:${port}`);
537
537
  if (url.pathname === "/callback") {
@@ -634,7 +634,7 @@ var OAuth2Handler = class {
634
634
  });
635
635
  this.server.listen(port, "127.0.0.1", () => {
636
636
  logger2.debug(`Callback server listening on http://127.0.0.1:${port}`);
637
- resolve2();
637
+ resolve();
638
638
  });
639
639
  });
640
640
  }
@@ -699,7 +699,7 @@ var OAuth2Handler = class {
699
699
  * Wait for the authorization code from the callback
700
700
  */
701
701
  async waitForAuthorizationCode(timeoutMs = 3e5) {
702
- return new Promise((resolve2, reject) => {
702
+ return new Promise((resolve, reject) => {
703
703
  const startTime = Date.now();
704
704
  const checkInterval = setInterval(() => {
705
705
  if (this.abortController?.signal.aborted) {
@@ -714,7 +714,7 @@ var OAuth2Handler = class {
714
714
  }
715
715
  if (this.authorizationCode) {
716
716
  clearInterval(checkInterval);
717
- resolve2(this.authorizationCode);
717
+ resolve(this.authorizationCode);
718
718
  return;
719
719
  }
720
720
  if (Date.now() - startTime > timeoutMs) {
@@ -2091,7 +2091,7 @@ async function waitWithSpinner(message, checkFn, intervalMs = 3e3, maxAttempts =
2091
2091
  return true;
2092
2092
  }
2093
2093
  if (attempt < maxAttempts - 1) {
2094
- await new Promise((resolve2) => setTimeout(resolve2, intervalMs));
2094
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
2095
2095
  }
2096
2096
  }
2097
2097
  if (spinnerInterval) clearInterval(spinnerInterval);
@@ -6118,7 +6118,6 @@ import chalk14 from "chalk";
6118
6118
  import { select as select3 } from "@inquirer/prompts";
6119
6119
  import * as path5 from "path";
6120
6120
  import * as fs4 from "fs/promises";
6121
- import { fileURLToPath } from "url";
6122
6121
 
6123
6122
  // src/utils/command-execution.ts
6124
6123
  import { exec as exec4, spawn } from "child_process";
@@ -6163,7 +6162,7 @@ async function withRetry(fn, retries = MAX_RETRIES, delay = INITIAL_RETRY_DELAY)
6163
6162
  if (!isNetworkError) {
6164
6163
  throw error;
6165
6164
  }
6166
- await new Promise((resolve2) => setTimeout(resolve2, delay));
6165
+ await new Promise((resolve) => setTimeout(resolve, delay));
6167
6166
  return withRetry(fn, retries - 1, delay * 2);
6168
6167
  }
6169
6168
  }
@@ -6303,7 +6302,11 @@ async function updateClaudeSettings(settingsPath = ".claude/settings.json", scri
6303
6302
  settings = JSON.parse(content2);
6304
6303
  } catch {
6305
6304
  }
6306
- settings.statusLine = scriptPath;
6305
+ settings.statusLine = {
6306
+ type: "command",
6307
+ command: scriptPath,
6308
+ padding: 0
6309
+ };
6307
6310
  const parentDir = path4.dirname(settingsPath);
6308
6311
  await fs3.mkdir(parentDir, { recursive: true });
6309
6312
  const content = JSON.stringify(settings, null, 2);
@@ -6478,10 +6481,7 @@ async function _handleSetup(config, opts) {
6478
6481
  let statusLineInstalled = false;
6479
6482
  if (config.name === "Claude Code") {
6480
6483
  try {
6481
- const __filename = fileURLToPath(import.meta.url);
6482
- const __dirname = path5.dirname(__filename);
6483
- const scriptPath = path5.resolve(__dirname, "../../.claude/statusline.sh");
6484
- const scriptContent = await fs4.readFile(scriptPath, "utf8");
6484
+ const scriptContent = await fetchFileFromGitHub("claude-code/statusline.sh");
6485
6485
  await installStatusLineScript(scriptContent);
6486
6486
  await updateClaudeSettings();
6487
6487
  statusLineInstalled = true;
@@ -6517,7 +6517,7 @@ async function handleSetupClaudeCode(opts) {
6517
6517
  sourceDirs: ["claude-code/commands", "claude-code/skills"],
6518
6518
  targetDirs: [".claude/commands", ".claude/skills/braingrid-cli"],
6519
6519
  injection: {
6520
- sourceFile: "claude-code/README.md",
6520
+ sourceFile: "claude-code/CLAUDE.md",
6521
6521
  targetFile: "CLAUDE.md"
6522
6522
  },
6523
6523
  docsUrl: "https://braingrid.ai/docs/claude-code"