@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/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MARIA - AI Development Platform v4.2.
|
|
1
|
+
# MARIA - AI Development Platform v4.2.11
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@bonginkan/maria)
|
|
4
4
|
[](LICENSE)
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
> **Enterprise-grade AI development platform with 100% command availability and comprehensive fallback support**
|
|
12
12
|
|
|
13
|
-
## 🚀 What's New in v4.2.
|
|
13
|
+
## 🚀 What's New in v4.2.11 (September 3, 2025)
|
|
14
14
|
|
|
15
15
|
### 🏗️ Build Status - All Systems Operational ✅
|
|
16
16
|
- **CLI NPM Package**: ESM + CJS builds successful (2.02MB/1.16MB)
|
|
@@ -61,6 +61,34 @@
|
|
|
61
61
|
$ npm install -g @bonginkan/maria
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
### 🪟 Windows: Add npm global prefix to PATH
|
|
65
|
+
On Windows, npm's global bin directory may not be on PATH by default. After installing, verify and add the directory returned by `npm prefix -g` to PATH.
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
# Show npm global prefix (this directory should be on PATH)
|
|
69
|
+
npm prefix -g;
|
|
70
|
+
|
|
71
|
+
# Temporarily add to current PowerShell session
|
|
72
|
+
$env:Path += ";" + (npm prefix -g).Trim(); Get-Command maria;
|
|
73
|
+
|
|
74
|
+
# Persist for the current user (idempotent)
|
|
75
|
+
$npmBin = (npm prefix -g).Trim();
|
|
76
|
+
$userPath = [Environment]::GetEnvironmentVariable('Path','User');
|
|
77
|
+
if ($userPath -notlike "*$npmBin*") {
|
|
78
|
+
[Environment]::SetEnvironmentVariable('Path', ($userPath.TrimEnd(';') + ";" + $npmBin), 'User');
|
|
79
|
+
"Added to PATH: $npmBin";
|
|
80
|
+
} else {
|
|
81
|
+
"Already on PATH: $npmBin";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Restart PowerShell, then verify
|
|
85
|
+
maria --version;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Notes:
|
|
89
|
+
- Default location is typically `%APPDATA%\npm` on Windows.
|
|
90
|
+
- You can also run the CLI without installing globally via: `npx @bonginkan/maria --help`
|
|
91
|
+
|
|
64
92
|
### 🔗 VS Code Extension (NEW)
|
|
65
93
|
**AI-powered coding directly in your editor**
|
|
66
94
|
|
|
@@ -707,10 +735,10 @@ await secureWorkflow.executeWithAuth(workflowDefinition, securityContext);
|
|
|
707
735
|
### Quick Installation
|
|
708
736
|
```bash
|
|
709
737
|
# Install globally (recommended)
|
|
710
|
-
npm install -g @bonginkan/maria@4.2.
|
|
738
|
+
npm install -g @bonginkan/maria@4.2.11
|
|
711
739
|
|
|
712
740
|
# Verify installation
|
|
713
|
-
maria --version # Should show v4.2.
|
|
741
|
+
maria --version # Should show v4.2.11
|
|
714
742
|
|
|
715
743
|
# Initialize with authentication
|
|
716
744
|
maria /login # Setup OAuth2.0 + PKCE authentication
|
|
@@ -911,7 +939,7 @@ MARIA CODE is distributed under a comprehensive licensing system designed for in
|
|
|
911
939
|
|
|
912
940
|
*MARIA v4.1.4 represents the pinnacle of multimodal AI development platform evolution - combining revolutionary voice-to-code capabilities, advanced memory systems, and comprehensive command ecosystems with enterprise-grade security and performance. This release establishes MARIA as the definitive choice for developers and Fortune 500 enterprises seeking intelligent, multimodal development experiences with GraphRAG intelligence, multilingual support, and zero-anxiety coding workflows.*
|
|
913
941
|
|
|
914
|
-
**Transform your development experience today**: `npm install -g @bonginkan/maria@4.2.
|
|
942
|
+
**Transform your development experience today**: `npm install -g @bonginkan/maria@4.2.11`
|
|
915
943
|
|
|
916
944
|
🌐 **Official Website**: [https://maria-code.ai](https://maria-code.ai)
|
|
917
945
|
💬 **Community**: [https://discord.gg/SMSmSGcEQy](https://discord.gg/SMSmSGcEQy)
|
package/dist/READY.manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "2.0.0",
|
|
3
|
-
"generatedAt": "2025-09-
|
|
3
|
+
"generatedAt": "2025-09-04T06:48:50.491Z",
|
|
4
4
|
"totalCommands": 76,
|
|
5
5
|
"readyCount": 74,
|
|
6
6
|
"partialCount": 1,
|
|
@@ -244,6 +244,13 @@
|
|
|
244
244
|
"depsAvailable": true,
|
|
245
245
|
"description": "Evaluate and test AI model performance"
|
|
246
246
|
},
|
|
247
|
+
"conversation/clear": {
|
|
248
|
+
"status": "READY",
|
|
249
|
+
"hasExecute": true,
|
|
250
|
+
"hasMetadata": true,
|
|
251
|
+
"depsAvailable": true,
|
|
252
|
+
"description": "Clear conversation history"
|
|
253
|
+
},
|
|
247
254
|
"core/whoami": {
|
|
248
255
|
"status": "READY",
|
|
249
256
|
"hasExecute": true,
|
|
@@ -363,47 +370,40 @@
|
|
|
363
370
|
"depsAvailable": true,
|
|
364
371
|
"description": "First-time environment setup wizard"
|
|
365
372
|
},
|
|
366
|
-
"
|
|
367
|
-
"status": "READY",
|
|
368
|
-
"hasExecute": true,
|
|
369
|
-
"hasMetadata": true,
|
|
370
|
-
"depsAvailable": true,
|
|
371
|
-
"description": "Clear conversation history"
|
|
372
|
-
},
|
|
373
|
-
"business/sales-dashboard": {
|
|
373
|
+
"code/mm": {
|
|
374
374
|
"status": "READY",
|
|
375
375
|
"hasExecute": true,
|
|
376
376
|
"hasMetadata": true,
|
|
377
377
|
"depsAvailable": true,
|
|
378
|
-
"description": "
|
|
378
|
+
"description": "Multimodal code generation (image/voice to code)"
|
|
379
379
|
},
|
|
380
|
-
"
|
|
380
|
+
"code/multimodal": {
|
|
381
381
|
"status": "READY",
|
|
382
382
|
"hasExecute": true,
|
|
383
383
|
"hasMetadata": true,
|
|
384
384
|
"depsAvailable": true,
|
|
385
|
-
"description": "
|
|
385
|
+
"description": "Advanced multimodal AI operations"
|
|
386
386
|
},
|
|
387
|
-
"code/
|
|
387
|
+
"code/code": {
|
|
388
388
|
"status": "READY",
|
|
389
389
|
"hasExecute": true,
|
|
390
390
|
"hasMetadata": true,
|
|
391
391
|
"depsAvailable": true,
|
|
392
|
-
"description": "
|
|
392
|
+
"description": "Generate code with AI assistance"
|
|
393
393
|
},
|
|
394
|
-
"
|
|
394
|
+
"business/sales-dashboard": {
|
|
395
395
|
"status": "READY",
|
|
396
396
|
"hasExecute": true,
|
|
397
397
|
"hasMetadata": true,
|
|
398
398
|
"depsAvailable": true,
|
|
399
|
-
"description": "
|
|
399
|
+
"description": "Sales metrics and dashboard"
|
|
400
400
|
},
|
|
401
|
-
"
|
|
401
|
+
"business/battlecard": {
|
|
402
402
|
"status": "READY",
|
|
403
403
|
"hasExecute": true,
|
|
404
404
|
"hasMetadata": true,
|
|
405
405
|
"depsAvailable": true,
|
|
406
|
-
"description": "
|
|
406
|
+
"description": "Competitive battlecard generator"
|
|
407
407
|
},
|
|
408
408
|
"ai/gpu": {
|
|
409
409
|
"status": "READY",
|
|
@@ -441,47 +441,47 @@
|
|
|
441
441
|
"depsAvailable": true,
|
|
442
442
|
"description": "AI-powered research and analysis"
|
|
443
443
|
},
|
|
444
|
-
"
|
|
444
|
+
"core/update": {
|
|
445
445
|
"status": "READY",
|
|
446
446
|
"hasExecute": true,
|
|
447
447
|
"hasMetadata": true,
|
|
448
448
|
"depsAvailable": true,
|
|
449
|
-
"description": "
|
|
449
|
+
"description": "Update project dependencies and configurations"
|
|
450
450
|
},
|
|
451
|
-
"
|
|
451
|
+
"core/exit": {
|
|
452
452
|
"status": "READY",
|
|
453
453
|
"hasExecute": true,
|
|
454
454
|
"hasMetadata": true,
|
|
455
455
|
"depsAvailable": true,
|
|
456
|
-
"description": "
|
|
456
|
+
"description": "Exit MARIA CLI"
|
|
457
457
|
},
|
|
458
|
-
"configuration/
|
|
458
|
+
"configuration/permissions": {
|
|
459
459
|
"status": "READY",
|
|
460
460
|
"hasExecute": true,
|
|
461
|
-
"hasMetadata":
|
|
461
|
+
"hasMetadata": true,
|
|
462
462
|
"depsAvailable": true,
|
|
463
|
-
"description": "
|
|
463
|
+
"description": "Manage permissions and access control"
|
|
464
464
|
},
|
|
465
|
-
"configuration/
|
|
465
|
+
"configuration/model": {
|
|
466
466
|
"status": "READY",
|
|
467
467
|
"hasExecute": true,
|
|
468
468
|
"hasMetadata": true,
|
|
469
469
|
"depsAvailable": true,
|
|
470
|
-
"description": "
|
|
470
|
+
"description": "Select and configure AI model"
|
|
471
471
|
},
|
|
472
|
-
"
|
|
472
|
+
"configuration/unknown": {
|
|
473
473
|
"status": "READY",
|
|
474
474
|
"hasExecute": true,
|
|
475
|
-
"hasMetadata":
|
|
475
|
+
"hasMetadata": false,
|
|
476
476
|
"depsAvailable": true,
|
|
477
|
-
"description": "
|
|
477
|
+
"description": "Handle unknown command fallback"
|
|
478
478
|
},
|
|
479
|
-
"
|
|
479
|
+
"configuration/config": {
|
|
480
480
|
"status": "READY",
|
|
481
481
|
"hasExecute": true,
|
|
482
482
|
"hasMetadata": true,
|
|
483
483
|
"depsAvailable": true,
|
|
484
|
-
"description": "
|
|
484
|
+
"description": "Configuration management"
|
|
485
485
|
},
|
|
486
486
|
"monitoring/monitor": {
|
|
487
487
|
"status": "READY",
|
package/dist/bin/maria.cjs
CHANGED
|
@@ -21942,8 +21942,8 @@ var init_package = __esm({
|
|
|
21942
21942
|
"package.json"() {
|
|
21943
21943
|
package_default = {
|
|
21944
21944
|
name: "@bonginkan/maria",
|
|
21945
|
-
version: "4.2.
|
|
21946
|
-
description: "\u{1F680} MARIA v4.2.
|
|
21945
|
+
version: "4.2.11",
|
|
21946
|
+
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.",
|
|
21947
21947
|
keywords: [
|
|
21948
21948
|
"ai",
|
|
21949
21949
|
"cli",
|
|
@@ -23150,6 +23150,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23150
23150
|
this.clientId = config2.clientId;
|
|
23151
23151
|
this.initialized = true;
|
|
23152
23152
|
} catch (error2) {
|
|
23153
|
+
console.warn("Auth config initialization failed, using fallbacks:", error2);
|
|
23153
23154
|
this.authBase = this.getAuthBaseUrl();
|
|
23154
23155
|
this.apiBase = this.getApiBaseUrl();
|
|
23155
23156
|
this.clientId = process.env.MARIA_CLIENT_ID || "maria-cli";
|
|
@@ -23196,7 +23197,8 @@ var init_AuthenticationManager = __esm({
|
|
|
23196
23197
|
return await this.refreshToken();
|
|
23197
23198
|
}
|
|
23198
23199
|
return true;
|
|
23199
|
-
} catch {
|
|
23200
|
+
} catch (error2) {
|
|
23201
|
+
console.error("isAuthenticated failed:", error2);
|
|
23200
23202
|
return false;
|
|
23201
23203
|
}
|
|
23202
23204
|
}
|
|
@@ -23260,6 +23262,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23260
23262
|
if (error2 instanceof AuthenticationRequiredError || error2 instanceof QuotaExceededError) {
|
|
23261
23263
|
throw error2;
|
|
23262
23264
|
}
|
|
23265
|
+
console.error("getCurrentUser failed:", error2);
|
|
23263
23266
|
throw new Error(ERROR_MESSAGES.NETWORK_ERROR);
|
|
23264
23267
|
}
|
|
23265
23268
|
}
|
|
@@ -23283,6 +23286,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23283
23286
|
try {
|
|
23284
23287
|
tokens = await this.loginWithPKCEFlow();
|
|
23285
23288
|
} catch (error2) {
|
|
23289
|
+
console.error("PKCE flow error:", error2);
|
|
23286
23290
|
if (error2.message?.includes("ECONNREFUSED") || error2.message?.includes("fetch failed")) {
|
|
23287
23291
|
console.error("\n\u274C Authentication service is currently unavailable");
|
|
23288
23292
|
console.error("Please try one of the following:");
|
|
@@ -23304,6 +23308,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23304
23308
|
const user = await this.getCurrentUser();
|
|
23305
23309
|
return { success: true, user, tokens };
|
|
23306
23310
|
} catch (error2) {
|
|
23311
|
+
console.error("Login failed:", error2);
|
|
23307
23312
|
return {
|
|
23308
23313
|
success: false,
|
|
23309
23314
|
error: error2.message || "Login failed"
|
|
@@ -23395,7 +23400,8 @@ var init_AuthenticationManager = __esm({
|
|
|
23395
23400
|
};
|
|
23396
23401
|
await this.tokenStorage.save(updatedTokens);
|
|
23397
23402
|
return true;
|
|
23398
|
-
} catch {
|
|
23403
|
+
} catch (error2) {
|
|
23404
|
+
console.error("Token refresh failed:", error2);
|
|
23399
23405
|
return false;
|
|
23400
23406
|
}
|
|
23401
23407
|
}
|
|
@@ -23437,6 +23443,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23437
23443
|
await (0, import_open.default)(authUrl);
|
|
23438
23444
|
} catch (error2) {
|
|
23439
23445
|
server.close();
|
|
23446
|
+
console.error("Failed to open browser for authentication:", error2);
|
|
23440
23447
|
throw new Error("Failed to open browser");
|
|
23441
23448
|
}
|
|
23442
23449
|
const authCode = await this.waitForCallback(server, pkceParams.state);
|
|
@@ -23460,57 +23467,62 @@ var init_AuthenticationManager = __esm({
|
|
|
23460
23467
|
* Login with device flow (fallback)
|
|
23461
23468
|
*/
|
|
23462
23469
|
async loginWithDeviceFlow() {
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
headers: { "Content-Type": "application/json" },
|
|
23466
|
-
body: JSON.stringify({
|
|
23467
|
-
client_id: this.clientId,
|
|
23468
|
-
scope: "user:profile user:inference org:create_api_key"
|
|
23469
|
-
})
|
|
23470
|
-
});
|
|
23471
|
-
if (!response2.ok) {
|
|
23472
|
-
throw new Error(`Device flow start failed: ${response2.statusText}`);
|
|
23473
|
-
}
|
|
23474
|
-
const raw = await response2.json();
|
|
23475
|
-
const deviceResponse = {
|
|
23476
|
-
verificationUri: raw.verification_uri || raw.verificationUri || "https://auth.maria-code.ai/device",
|
|
23477
|
-
userCode: raw.user_code || raw.userCode || "",
|
|
23478
|
-
deviceCode: raw.device_code || raw.deviceCode || "",
|
|
23479
|
-
interval: (typeof raw.interval === "number" ? raw.interval : parseInt(String(raw.interval || 5), 10)) || 5,
|
|
23480
|
-
expiresIn: (typeof raw.expires_in === "number" ? raw.expires_in : parseInt(String(raw.expires_in || raw.expiresIn || 600), 10)) || 600
|
|
23481
|
-
};
|
|
23482
|
-
const verificationUrl = deviceResponse.verificationUri || `${this.authBase}/device`;
|
|
23483
|
-
console.log(`\u{1F510} Device Login`);
|
|
23484
|
-
console.log(`Open: ${verificationUrl}`);
|
|
23485
|
-
console.log(`Code: ${deviceResponse.userCode}`);
|
|
23486
|
-
const deadline = Date.now() + deviceResponse.expiresIn * 1e3;
|
|
23487
|
-
const intervalMs = Math.max(1500, deviceResponse.interval * 1e3);
|
|
23488
|
-
while (Date.now() < deadline) {
|
|
23489
|
-
await this.sleep(intervalMs);
|
|
23490
|
-
const finishResponse = await fetch(`${this.authBase}/oauth/device/finish`, {
|
|
23470
|
+
try {
|
|
23471
|
+
const response2 = await fetch(`${this.authBase}/oauth/device/start`, {
|
|
23491
23472
|
method: "POST",
|
|
23492
23473
|
headers: { "Content-Type": "application/json" },
|
|
23493
23474
|
body: JSON.stringify({
|
|
23494
23475
|
client_id: this.clientId,
|
|
23495
|
-
|
|
23476
|
+
scope: "user:profile user:inference org:create_api_key"
|
|
23496
23477
|
})
|
|
23497
23478
|
});
|
|
23498
|
-
if (
|
|
23499
|
-
|
|
23500
|
-
}
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
refreshToken: tokens.refresh_token || "",
|
|
23509
|
-
customToken: tokens.custom_token,
|
|
23510
|
-
expiresAt: Date.now() + (tokens.expires_in ? Number(tokens.expires_in) : 600) * 1e3
|
|
23479
|
+
if (!response2.ok) {
|
|
23480
|
+
throw new Error(`Device flow start failed: ${response2.statusText}`);
|
|
23481
|
+
}
|
|
23482
|
+
const raw = await response2.json();
|
|
23483
|
+
const deviceResponse = {
|
|
23484
|
+
verificationUri: raw.verification_uri || raw.verificationUri || "https://auth.maria-code.ai/device",
|
|
23485
|
+
userCode: raw.user_code || raw.userCode || "",
|
|
23486
|
+
deviceCode: raw.device_code || raw.deviceCode || "",
|
|
23487
|
+
interval: (typeof raw.interval === "number" ? raw.interval : parseInt(String(raw.interval || 5), 10)) || 5,
|
|
23488
|
+
expiresIn: (typeof raw.expires_in === "number" ? raw.expires_in : parseInt(String(raw.expires_in || raw.expiresIn || 600), 10)) || 600
|
|
23511
23489
|
};
|
|
23490
|
+
const verificationUrl = deviceResponse.verificationUri || `${this.authBase}/device`;
|
|
23491
|
+
console.log(`\u{1F510} Device Login`);
|
|
23492
|
+
console.log(`Open: ${verificationUrl}`);
|
|
23493
|
+
console.log(`Code: ${deviceResponse.userCode}`);
|
|
23494
|
+
const deadline = Date.now() + deviceResponse.expiresIn * 1e3;
|
|
23495
|
+
const intervalMs = Math.max(1500, deviceResponse.interval * 1e3);
|
|
23496
|
+
while (Date.now() < deadline) {
|
|
23497
|
+
await this.sleep(intervalMs);
|
|
23498
|
+
const finishResponse = await fetch(`${this.authBase}/oauth/device/finish`, {
|
|
23499
|
+
method: "POST",
|
|
23500
|
+
headers: { "Content-Type": "application/json" },
|
|
23501
|
+
body: JSON.stringify({
|
|
23502
|
+
client_id: this.clientId,
|
|
23503
|
+
device_code: deviceResponse.deviceCode
|
|
23504
|
+
})
|
|
23505
|
+
});
|
|
23506
|
+
if (finishResponse.status === 428 || finishResponse.status === 400) {
|
|
23507
|
+
continue;
|
|
23508
|
+
}
|
|
23509
|
+
if (!finishResponse.ok) {
|
|
23510
|
+
throw new Error(`Device flow failed: ${finishResponse.statusText}`);
|
|
23511
|
+
}
|
|
23512
|
+
const tokens = await finishResponse.json();
|
|
23513
|
+
return {
|
|
23514
|
+
idToken: tokens.id_token || tokens.access_token || "",
|
|
23515
|
+
accessToken: tokens.access_token || tokens.id_token || "",
|
|
23516
|
+
refreshToken: tokens.refresh_token || "",
|
|
23517
|
+
customToken: tokens.custom_token,
|
|
23518
|
+
expiresAt: Date.now() + (tokens.expires_in ? Number(tokens.expires_in) : 600) * 1e3
|
|
23519
|
+
};
|
|
23520
|
+
}
|
|
23521
|
+
throw new Error(ERROR_MESSAGES.LOGIN_TIMEOUT);
|
|
23522
|
+
} catch (error2) {
|
|
23523
|
+
console.error("Device flow error:", error2);
|
|
23524
|
+
throw error2;
|
|
23512
23525
|
}
|
|
23513
|
-
throw new Error(ERROR_MESSAGES.LOGIN_TIMEOUT);
|
|
23514
23526
|
}
|
|
23515
23527
|
/**
|
|
23516
23528
|
* Generate PKCE parameters
|
|
@@ -23549,8 +23561,10 @@ var init_AuthenticationManager = __esm({
|
|
|
23549
23561
|
} catch (error2) {
|
|
23550
23562
|
lastError = error2;
|
|
23551
23563
|
if (error2.code !== "EADDRINUSE") {
|
|
23564
|
+
console.error("Failed to start callback server:", error2);
|
|
23552
23565
|
throw error2;
|
|
23553
23566
|
}
|
|
23567
|
+
console.warn("Callback server port in use, retrying...", error2?.message || error2);
|
|
23554
23568
|
}
|
|
23555
23569
|
}
|
|
23556
23570
|
throw lastError || new Error("Failed to find available port");
|
|
@@ -23582,6 +23596,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23582
23596
|
return new Promise((resolve4, reject) => {
|
|
23583
23597
|
const timeout = setTimeout(() => {
|
|
23584
23598
|
server.close();
|
|
23599
|
+
console.error("OAuth callback timed out");
|
|
23585
23600
|
reject(new Error(ERROR_MESSAGES.LOGIN_TIMEOUT));
|
|
23586
23601
|
}, 5 * 60 * 1e3);
|
|
23587
23602
|
server.on("request", (req, res) => {
|
|
@@ -23594,6 +23609,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23594
23609
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
23595
23610
|
res.end(this.getErrorPage(error2));
|
|
23596
23611
|
clearTimeout(timeout);
|
|
23612
|
+
console.error("OAuth callback returned error:", error2);
|
|
23597
23613
|
reject(new Error(error2));
|
|
23598
23614
|
return;
|
|
23599
23615
|
}
|
|
@@ -23601,6 +23617,7 @@ var init_AuthenticationManager = __esm({
|
|
|
23601
23617
|
res.writeHead(400, { "Content-Type": "text/html" });
|
|
23602
23618
|
res.end(this.getErrorPage("Invalid state parameter"));
|
|
23603
23619
|
clearTimeout(timeout);
|
|
23620
|
+
console.error("OAuth callback invalid state", { received: state, expected: expectedState });
|
|
23604
23621
|
reject(new Error(ERROR_MESSAGES.INVALID_STATE));
|
|
23605
23622
|
return;
|
|
23606
23623
|
}
|
|
@@ -23618,28 +23635,39 @@ var init_AuthenticationManager = __esm({
|
|
|
23618
23635
|
* Exchange authorization code for tokens
|
|
23619
23636
|
*/
|
|
23620
23637
|
async exchangeCodeForTokens(code, codeVerifier, redirectUri) {
|
|
23621
|
-
|
|
23622
|
-
|
|
23623
|
-
|
|
23624
|
-
|
|
23625
|
-
|
|
23626
|
-
|
|
23627
|
-
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23638
|
+
try {
|
|
23639
|
+
const response2 = await fetch(`${this.authBase}/oauth/token`, {
|
|
23640
|
+
method: "POST",
|
|
23641
|
+
headers: { "Content-Type": "application/json" },
|
|
23642
|
+
body: JSON.stringify({
|
|
23643
|
+
grant_type: "authorization_code",
|
|
23644
|
+
client_id: this.clientId,
|
|
23645
|
+
code,
|
|
23646
|
+
code_verifier: codeVerifier,
|
|
23647
|
+
redirect_uri: redirectUri
|
|
23648
|
+
})
|
|
23649
|
+
});
|
|
23650
|
+
if (!response2.ok) {
|
|
23651
|
+
let bodyText = "";
|
|
23652
|
+
try {
|
|
23653
|
+
bodyText = await response2.text();
|
|
23654
|
+
} catch {
|
|
23655
|
+
}
|
|
23656
|
+
console.error("Token exchange failed:", response2.status, response2.statusText, bodyText);
|
|
23657
|
+
throw new Error(`Token exchange failed: ${response2.status} ${response2.statusText}`);
|
|
23658
|
+
}
|
|
23659
|
+
const tokens = await response2.json();
|
|
23660
|
+
return {
|
|
23661
|
+
idToken: tokens.id_token,
|
|
23662
|
+
accessToken: tokens.access_token,
|
|
23663
|
+
refreshToken: tokens.refresh_token,
|
|
23664
|
+
customToken: tokens.custom_token,
|
|
23665
|
+
expiresAt: Date.now() + tokens.expires_in * 1e3
|
|
23666
|
+
};
|
|
23667
|
+
} catch (error2) {
|
|
23668
|
+
console.error("Token exchange request error:", error2);
|
|
23669
|
+
throw error2;
|
|
23634
23670
|
}
|
|
23635
|
-
const tokens = await response2.json();
|
|
23636
|
-
return {
|
|
23637
|
-
idToken: tokens.id_token,
|
|
23638
|
-
accessToken: tokens.access_token,
|
|
23639
|
-
refreshToken: tokens.refresh_token,
|
|
23640
|
-
customToken: tokens.custom_token,
|
|
23641
|
-
expiresAt: Date.now() + tokens.expires_in * 1e3
|
|
23642
|
-
};
|
|
23643
23671
|
}
|
|
23644
23672
|
/**
|
|
23645
23673
|
* Revoke tokens on server
|