@bonginkan/maria 4.2.10 → 4.2.11
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/README.md +33 -5
- package/dist/READY.manifest.json +32 -32
- package/dist/bin/maria.cjs +96 -68
- package/dist/bin/maria.cjs.map +1 -1
- package/dist/cli.cjs +96 -68
- package/dist/cli.cjs.map +1 -1
- package/package.json +2 -2
- package/src/slash-commands/READY.manifest.json +32 -32
package/dist/cli.cjs
CHANGED
|
@@ -876,6 +876,7 @@ var init_AuthenticationManager = __esm({
|
|
|
876
876
|
this.clientId = config2.clientId;
|
|
877
877
|
this.initialized = true;
|
|
878
878
|
} catch (error2) {
|
|
879
|
+
console.warn("Auth config initialization failed, using fallbacks:", error2);
|
|
879
880
|
this.authBase = this.getAuthBaseUrl();
|
|
880
881
|
this.apiBase = this.getApiBaseUrl();
|
|
881
882
|
this.clientId = process.env.MARIA_CLIENT_ID || "maria-cli";
|
|
@@ -922,7 +923,8 @@ var init_AuthenticationManager = __esm({
|
|
|
922
923
|
return await this.refreshToken();
|
|
923
924
|
}
|
|
924
925
|
return true;
|
|
925
|
-
} catch {
|
|
926
|
+
} catch (error2) {
|
|
927
|
+
console.error("isAuthenticated failed:", error2);
|
|
926
928
|
return false;
|
|
927
929
|
}
|
|
928
930
|
}
|
|
@@ -986,6 +988,7 @@ var init_AuthenticationManager = __esm({
|
|
|
986
988
|
if (error2 instanceof AuthenticationRequiredError || error2 instanceof QuotaExceededError) {
|
|
987
989
|
throw error2;
|
|
988
990
|
}
|
|
991
|
+
console.error("getCurrentUser failed:", error2);
|
|
989
992
|
throw new Error(ERROR_MESSAGES.NETWORK_ERROR);
|
|
990
993
|
}
|
|
991
994
|
}
|
|
@@ -1009,6 +1012,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1009
1012
|
try {
|
|
1010
1013
|
tokens = await this.loginWithPKCEFlow();
|
|
1011
1014
|
} catch (error2) {
|
|
1015
|
+
console.error("PKCE flow error:", error2);
|
|
1012
1016
|
if (error2.message?.includes("ECONNREFUSED") || error2.message?.includes("fetch failed")) {
|
|
1013
1017
|
console.error("\n\u274C Authentication service is currently unavailable");
|
|
1014
1018
|
console.error("Please try one of the following:");
|
|
@@ -1030,6 +1034,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1030
1034
|
const user = await this.getCurrentUser();
|
|
1031
1035
|
return { success: true, user, tokens };
|
|
1032
1036
|
} catch (error2) {
|
|
1037
|
+
console.error("Login failed:", error2);
|
|
1033
1038
|
return {
|
|
1034
1039
|
success: false,
|
|
1035
1040
|
error: error2.message || "Login failed"
|
|
@@ -1121,7 +1126,8 @@ var init_AuthenticationManager = __esm({
|
|
|
1121
1126
|
};
|
|
1122
1127
|
await this.tokenStorage.save(updatedTokens);
|
|
1123
1128
|
return true;
|
|
1124
|
-
} catch {
|
|
1129
|
+
} catch (error2) {
|
|
1130
|
+
console.error("Token refresh failed:", error2);
|
|
1125
1131
|
return false;
|
|
1126
1132
|
}
|
|
1127
1133
|
}
|
|
@@ -1163,6 +1169,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1163
1169
|
await open__default.default(authUrl);
|
|
1164
1170
|
} catch (error2) {
|
|
1165
1171
|
server.close();
|
|
1172
|
+
console.error("Failed to open browser for authentication:", error2);
|
|
1166
1173
|
throw new Error("Failed to open browser");
|
|
1167
1174
|
}
|
|
1168
1175
|
const authCode = await this.waitForCallback(server, pkceParams.state);
|
|
@@ -1186,57 +1193,62 @@ var init_AuthenticationManager = __esm({
|
|
|
1186
1193
|
* Login with device flow (fallback)
|
|
1187
1194
|
*/
|
|
1188
1195
|
async loginWithDeviceFlow() {
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
headers: { "Content-Type": "application/json" },
|
|
1192
|
-
body: JSON.stringify({
|
|
1193
|
-
client_id: this.clientId,
|
|
1194
|
-
scope: "user:profile user:inference org:create_api_key"
|
|
1195
|
-
})
|
|
1196
|
-
});
|
|
1197
|
-
if (!response2.ok) {
|
|
1198
|
-
throw new Error(`Device flow start failed: ${response2.statusText}`);
|
|
1199
|
-
}
|
|
1200
|
-
const raw = await response2.json();
|
|
1201
|
-
const deviceResponse = {
|
|
1202
|
-
verificationUri: raw.verification_uri || raw.verificationUri || "https://auth.maria-code.ai/device",
|
|
1203
|
-
userCode: raw.user_code || raw.userCode || "",
|
|
1204
|
-
deviceCode: raw.device_code || raw.deviceCode || "",
|
|
1205
|
-
interval: (typeof raw.interval === "number" ? raw.interval : parseInt(String(raw.interval || 5), 10)) || 5,
|
|
1206
|
-
expiresIn: (typeof raw.expires_in === "number" ? raw.expires_in : parseInt(String(raw.expires_in || raw.expiresIn || 600), 10)) || 600
|
|
1207
|
-
};
|
|
1208
|
-
const verificationUrl = deviceResponse.verificationUri;
|
|
1209
|
-
console.log(`\u{1F510} Device Login`);
|
|
1210
|
-
console.log(`Open: ${verificationUrl}`);
|
|
1211
|
-
console.log(`Code: ${deviceResponse.userCode}`);
|
|
1212
|
-
const deadline = Date.now() + deviceResponse.expiresIn * 1e3;
|
|
1213
|
-
const intervalMs = Math.max(1500, deviceResponse.interval * 1e3);
|
|
1214
|
-
while (Date.now() < deadline) {
|
|
1215
|
-
await this.sleep(intervalMs);
|
|
1216
|
-
const finishResponse = await fetch(`${this.authBase}/oauth/device/finish`, {
|
|
1196
|
+
try {
|
|
1197
|
+
const response2 = await fetch(`${this.authBase}/oauth/device/start`, {
|
|
1217
1198
|
method: "POST",
|
|
1218
1199
|
headers: { "Content-Type": "application/json" },
|
|
1219
1200
|
body: JSON.stringify({
|
|
1220
1201
|
client_id: this.clientId,
|
|
1221
|
-
|
|
1202
|
+
scope: "user:profile user:inference org:create_api_key"
|
|
1222
1203
|
})
|
|
1223
1204
|
});
|
|
1224
|
-
if (
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
refreshToken: tokens.refresh_token || "",
|
|
1235
|
-
customToken: tokens.custom_token,
|
|
1236
|
-
expiresAt: Date.now() + (tokens.expires_in ? Number(tokens.expires_in) : 600) * 1e3
|
|
1205
|
+
if (!response2.ok) {
|
|
1206
|
+
throw new Error(`Device flow start failed: ${response2.statusText}`);
|
|
1207
|
+
}
|
|
1208
|
+
const raw = await response2.json();
|
|
1209
|
+
const deviceResponse = {
|
|
1210
|
+
verificationUri: raw.verification_uri || raw.verificationUri || "https://auth.maria-code.ai/device",
|
|
1211
|
+
userCode: raw.user_code || raw.userCode || "",
|
|
1212
|
+
deviceCode: raw.device_code || raw.deviceCode || "",
|
|
1213
|
+
interval: (typeof raw.interval === "number" ? raw.interval : parseInt(String(raw.interval || 5), 10)) || 5,
|
|
1214
|
+
expiresIn: (typeof raw.expires_in === "number" ? raw.expires_in : parseInt(String(raw.expires_in || raw.expiresIn || 600), 10)) || 600
|
|
1237
1215
|
};
|
|
1216
|
+
const verificationUrl = deviceResponse.verificationUri || `${this.authBase}/device`;
|
|
1217
|
+
console.log(`\u{1F510} Device Login`);
|
|
1218
|
+
console.log(`Open: ${verificationUrl}`);
|
|
1219
|
+
console.log(`Code: ${deviceResponse.userCode}`);
|
|
1220
|
+
const deadline = Date.now() + deviceResponse.expiresIn * 1e3;
|
|
1221
|
+
const intervalMs = Math.max(1500, deviceResponse.interval * 1e3);
|
|
1222
|
+
while (Date.now() < deadline) {
|
|
1223
|
+
await this.sleep(intervalMs);
|
|
1224
|
+
const finishResponse = await fetch(`${this.authBase}/oauth/device/finish`, {
|
|
1225
|
+
method: "POST",
|
|
1226
|
+
headers: { "Content-Type": "application/json" },
|
|
1227
|
+
body: JSON.stringify({
|
|
1228
|
+
client_id: this.clientId,
|
|
1229
|
+
device_code: deviceResponse.deviceCode
|
|
1230
|
+
})
|
|
1231
|
+
});
|
|
1232
|
+
if (finishResponse.status === 428 || finishResponse.status === 400) {
|
|
1233
|
+
continue;
|
|
1234
|
+
}
|
|
1235
|
+
if (!finishResponse.ok) {
|
|
1236
|
+
throw new Error(`Device flow failed: ${finishResponse.statusText}`);
|
|
1237
|
+
}
|
|
1238
|
+
const tokens = await finishResponse.json();
|
|
1239
|
+
return {
|
|
1240
|
+
idToken: tokens.id_token || tokens.access_token || "",
|
|
1241
|
+
accessToken: tokens.access_token || tokens.id_token || "",
|
|
1242
|
+
refreshToken: tokens.refresh_token || "",
|
|
1243
|
+
customToken: tokens.custom_token,
|
|
1244
|
+
expiresAt: Date.now() + (tokens.expires_in ? Number(tokens.expires_in) : 600) * 1e3
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
throw new Error(ERROR_MESSAGES.LOGIN_TIMEOUT);
|
|
1248
|
+
} catch (error2) {
|
|
1249
|
+
console.error("Device flow error:", error2);
|
|
1250
|
+
throw error2;
|
|
1238
1251
|
}
|
|
1239
|
-
throw new Error(ERROR_MESSAGES.LOGIN_TIMEOUT);
|
|
1240
1252
|
}
|
|
1241
1253
|
/**
|
|
1242
1254
|
* Generate PKCE parameters
|
|
@@ -1275,8 +1287,10 @@ var init_AuthenticationManager = __esm({
|
|
|
1275
1287
|
} catch (error2) {
|
|
1276
1288
|
lastError = error2;
|
|
1277
1289
|
if (error2.code !== "EADDRINUSE") {
|
|
1290
|
+
console.error("Failed to start callback server:", error2);
|
|
1278
1291
|
throw error2;
|
|
1279
1292
|
}
|
|
1293
|
+
console.warn("Callback server port in use, retrying...", error2?.message || error2);
|
|
1280
1294
|
}
|
|
1281
1295
|
}
|
|
1282
1296
|
throw lastError || new Error("Failed to find available port");
|
|
@@ -1308,6 +1322,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1308
1322
|
return new Promise((resolve4, reject) => {
|
|
1309
1323
|
const timeout = setTimeout(() => {
|
|
1310
1324
|
server.close();
|
|
1325
|
+
console.error("OAuth callback timed out");
|
|
1311
1326
|
reject(new Error(ERROR_MESSAGES.LOGIN_TIMEOUT));
|
|
1312
1327
|
}, 5 * 60 * 1e3);
|
|
1313
1328
|
server.on("request", (req, res) => {
|
|
@@ -1320,6 +1335,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1320
1335
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
1321
1336
|
res.end(this.getErrorPage(error2));
|
|
1322
1337
|
clearTimeout(timeout);
|
|
1338
|
+
console.error("OAuth callback returned error:", error2);
|
|
1323
1339
|
reject(new Error(error2));
|
|
1324
1340
|
return;
|
|
1325
1341
|
}
|
|
@@ -1327,6 +1343,7 @@ var init_AuthenticationManager = __esm({
|
|
|
1327
1343
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
1328
1344
|
res.end(this.getErrorPage("Invalid state parameter"));
|
|
1329
1345
|
clearTimeout(timeout);
|
|
1346
|
+
console.error("OAuth callback invalid state", { received: state, expected: expectedState });
|
|
1330
1347
|
reject(new Error(ERROR_MESSAGES.INVALID_STATE));
|
|
1331
1348
|
return;
|
|
1332
1349
|
}
|
|
@@ -1344,28 +1361,39 @@ var init_AuthenticationManager = __esm({
|
|
|
1344
1361
|
* Exchange authorization code for tokens
|
|
1345
1362
|
*/
|
|
1346
1363
|
async exchangeCodeForTokens(code, codeVerifier, redirectUri) {
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1364
|
+
try {
|
|
1365
|
+
const response2 = await fetch(`${this.authBase}/oauth/token`, {
|
|
1366
|
+
method: "POST",
|
|
1367
|
+
headers: { "Content-Type": "application/json" },
|
|
1368
|
+
body: JSON.stringify({
|
|
1369
|
+
grant_type: "authorization_code",
|
|
1370
|
+
client_id: this.clientId,
|
|
1371
|
+
code,
|
|
1372
|
+
code_verifier: codeVerifier,
|
|
1373
|
+
redirect_uri: redirectUri
|
|
1374
|
+
})
|
|
1375
|
+
});
|
|
1376
|
+
if (!response2.ok) {
|
|
1377
|
+
let bodyText = "";
|
|
1378
|
+
try {
|
|
1379
|
+
bodyText = await response2.text();
|
|
1380
|
+
} catch {
|
|
1381
|
+
}
|
|
1382
|
+
console.error("Token exchange failed:", response2.status, response2.statusText, bodyText);
|
|
1383
|
+
throw new Error(`Token exchange failed: ${response2.status} ${response2.statusText}`);
|
|
1384
|
+
}
|
|
1385
|
+
const tokens = await response2.json();
|
|
1386
|
+
return {
|
|
1387
|
+
idToken: tokens.id_token,
|
|
1388
|
+
accessToken: tokens.access_token,
|
|
1389
|
+
refreshToken: tokens.refresh_token,
|
|
1390
|
+
customToken: tokens.custom_token,
|
|
1391
|
+
expiresAt: Date.now() + tokens.expires_in * 1e3
|
|
1392
|
+
};
|
|
1393
|
+
} catch (error2) {
|
|
1394
|
+
console.error("Token exchange request error:", error2);
|
|
1395
|
+
throw error2;
|
|
1360
1396
|
}
|
|
1361
|
-
const tokens = await response2.json();
|
|
1362
|
-
return {
|
|
1363
|
-
idToken: tokens.id_token,
|
|
1364
|
-
accessToken: tokens.access_token,
|
|
1365
|
-
refreshToken: tokens.refresh_token,
|
|
1366
|
-
customToken: tokens.custom_token,
|
|
1367
|
-
expiresAt: Date.now() + tokens.expires_in * 1e3
|
|
1368
|
-
};
|
|
1369
1397
|
}
|
|
1370
1398
|
/**
|
|
1371
1399
|
* Revoke tokens on server
|
|
@@ -31627,8 +31655,8 @@ var init_package = __esm({
|
|
|
31627
31655
|
"package.json"() {
|
|
31628
31656
|
package_default = {
|
|
31629
31657
|
name: "@bonginkan/maria",
|
|
31630
|
-
version: "4.2.
|
|
31631
|
-
description: "\u{1F680} MARIA v4.2.
|
|
31658
|
+
version: "4.2.11",
|
|
31659
|
+
description: "\u{1F680} MARIA v4.2.11 - Enterprise AI Development Platform with 100% Command Availability. Features 74 production-ready commands with comprehensive fallback implementation, local LLM support, and zero external dependencies. Includes natural language coding, AI safety evaluation, intelligent evolution system, episodic memory with PII masking, and real-time monitoring dashboard. Built with TypeScript AST-powered code generation, OAuth2.0 + PKCE authentication, quantum-resistant cryptography, and enterprise-grade performance.",
|
|
31632
31660
|
keywords: [
|
|
31633
31661
|
"ai",
|
|
31634
31662
|
"cli",
|