@braingrid/cli 0.2.9 → 0.2.10
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 +19 -0
- package/dist/cli.js +55 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ 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.10] - 2025-11-25
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Organization ID handling in project initialization**
|
|
13
|
+
- Fixed issue where `organization_id` was set to "default" in `.braingrid/project.json`
|
|
14
|
+
- Login flow now automatically fetches organization ID from validation endpoint when missing from JWT token
|
|
15
|
+
- Init command validates and fixes any existing sessions with "default" organization_id
|
|
16
|
+
- Added clear user feedback with warnings and success messages during organization ID updates
|
|
17
|
+
- Prevents invalid "default" organization IDs from being stored in project configuration
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **Enhanced breakdown command documentation**
|
|
22
|
+
- Added patience messages to both Claude Code and Cursor breakdown slash commands
|
|
23
|
+
- Commands now explicitly instruct AI agents to wait 1-3 minutes for AI task generation
|
|
24
|
+
- Prevents AI agents from prematurely aborting breakdown operations before completion
|
|
25
|
+
- Improves reliability of AI-powered task breakdown workflow
|
|
26
|
+
|
|
8
27
|
## [0.2.9] - 2025-11-12
|
|
9
28
|
|
|
10
29
|
### Fixed
|
package/dist/cli.js
CHANGED
|
@@ -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.
|
|
425
|
+
var CLI_VERSION = true ? "0.2.10" : "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",
|
|
@@ -1251,12 +1251,45 @@ var BraingridAuth = class {
|
|
|
1251
1251
|
externalId: null,
|
|
1252
1252
|
metadata: jwtPayload.metadata || {}
|
|
1253
1253
|
};
|
|
1254
|
+
let organizationId = jwtPayload.organization_id;
|
|
1255
|
+
if (!organizationId) {
|
|
1256
|
+
this.logger.warn(
|
|
1257
|
+
"[AUTH] organization_id missing from JWT, fetching from validation endpoint"
|
|
1258
|
+
);
|
|
1259
|
+
try {
|
|
1260
|
+
const tempSession = {
|
|
1261
|
+
user,
|
|
1262
|
+
sealed_session: authResult.accessToken,
|
|
1263
|
+
organization_id: "default",
|
|
1264
|
+
// Temporary placeholder
|
|
1265
|
+
created_at: /* @__PURE__ */ new Date(),
|
|
1266
|
+
updated_at: /* @__PURE__ */ new Date(),
|
|
1267
|
+
login_time: /* @__PURE__ */ new Date(),
|
|
1268
|
+
git_user: gitUser
|
|
1269
|
+
};
|
|
1270
|
+
const validationResult = await this.validateSessionWithServer(tempSession);
|
|
1271
|
+
if (validationResult.isValid && validationResult.user?.metadata?.organizationId) {
|
|
1272
|
+
organizationId = validationResult.user.metadata.organizationId;
|
|
1273
|
+
this.logger.debug(`[AUTH] Fetched organization_id from validation: ${organizationId}`);
|
|
1274
|
+
user.metadata = {
|
|
1275
|
+
...user.metadata,
|
|
1276
|
+
organizationId: validationResult.user.metadata.organizationId,
|
|
1277
|
+
organizationName: validationResult.user.metadata.organizationName
|
|
1278
|
+
};
|
|
1279
|
+
} else {
|
|
1280
|
+
this.logger.error("[AUTH] Failed to fetch organization_id from validation endpoint");
|
|
1281
|
+
organizationId = "default";
|
|
1282
|
+
}
|
|
1283
|
+
} catch (error) {
|
|
1284
|
+
this.logger.error("[AUTH] Error fetching organization_id from validation:", { error });
|
|
1285
|
+
organizationId = "default";
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1254
1288
|
const session = {
|
|
1255
1289
|
user,
|
|
1256
1290
|
sealed_session: authResult.accessToken,
|
|
1257
1291
|
// Store access token as sealed_session
|
|
1258
|
-
organization_id:
|
|
1259
|
-
// Use organization from token or default
|
|
1292
|
+
organization_id: organizationId,
|
|
1260
1293
|
created_at: /* @__PURE__ */ new Date(),
|
|
1261
1294
|
updated_at: /* @__PURE__ */ new Date(),
|
|
1262
1295
|
login_time: /* @__PURE__ */ new Date(),
|
|
@@ -6218,6 +6251,25 @@ async function handleInit(opts) {
|
|
|
6218
6251
|
message: chalk13.red("\u274C No session found. Please run `braingrid login` first.")
|
|
6219
6252
|
};
|
|
6220
6253
|
}
|
|
6254
|
+
if (session.organization_id === "default") {
|
|
6255
|
+
console.log(chalk13.yellow("\u26A0\uFE0F Organization ID not set, validating session...\n"));
|
|
6256
|
+
const isValid = await auth.isAuthenticated();
|
|
6257
|
+
if (!isValid) {
|
|
6258
|
+
return {
|
|
6259
|
+
success: false,
|
|
6260
|
+
message: chalk13.red("\u274C Session validation failed. Please run `braingrid login` again.")
|
|
6261
|
+
};
|
|
6262
|
+
}
|
|
6263
|
+
const updatedSession = await auth.getStoredSession();
|
|
6264
|
+
if (!updatedSession || updatedSession.organization_id === "default") {
|
|
6265
|
+
return {
|
|
6266
|
+
success: false,
|
|
6267
|
+
message: chalk13.red("\u274C Unable to retrieve organization information.\n\n") + chalk13.dim("This may indicate an issue with your account setup.\n") + chalk13.dim("Please contact support or try logging in again with ") + chalk13.cyan("braingrid logout") + chalk13.dim(" and ") + chalk13.cyan("braingrid login")
|
|
6268
|
+
};
|
|
6269
|
+
}
|
|
6270
|
+
Object.assign(session, updatedSession);
|
|
6271
|
+
console.log(chalk13.green("\u2705 Organization ID updated successfully\n"));
|
|
6272
|
+
}
|
|
6221
6273
|
let gitInfo = await getGitRepositoryInfo();
|
|
6222
6274
|
let project2;
|
|
6223
6275
|
if (opts.project) {
|