edoardo 1.0.10 → 1.0.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/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Edoardo</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CImUwnjD.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-Cp6s2BCA.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
package/server/standalone.js
CHANGED
|
@@ -668,12 +668,48 @@ app.post('/oauth/token', async (req, res) => {
|
|
|
668
668
|
}
|
|
669
669
|
});
|
|
670
670
|
|
|
671
|
+
// ============ xAI VIDEO STATUS PROXY ============
|
|
672
|
+
// Proxies video status requests to avoid browser CORS issues
|
|
673
|
+
|
|
674
|
+
app.get('/xai/video/status', async (req, res) => {
|
|
675
|
+
const taskId = req.query.taskId;
|
|
676
|
+
const apiKey = req.headers['authorization']?.replace('Bearer ', '');
|
|
677
|
+
|
|
678
|
+
if (!taskId) {
|
|
679
|
+
return res.status(400).json({ error: 'Missing taskId parameter' });
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
if (!apiKey) {
|
|
683
|
+
return res.status(400).json({ error: 'Missing Authorization header' });
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
try {
|
|
687
|
+
console.log(`[xAI Video] Checking status for taskId: ${taskId}`);
|
|
688
|
+
|
|
689
|
+
const response = await fetch(`https://api.x.ai/api/v1/video/status?taskId=${taskId}`, {
|
|
690
|
+
method: 'GET',
|
|
691
|
+
headers: {
|
|
692
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
693
|
+
'Content-Type': 'application/json',
|
|
694
|
+
},
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
const data = await response.json();
|
|
698
|
+
console.log(`[xAI Video] Status response:`, JSON.stringify(data).substring(0, 200));
|
|
699
|
+
|
|
700
|
+
res.status(response.status).json(data);
|
|
701
|
+
} catch (error) {
|
|
702
|
+
console.error('[xAI Video] Error:', error.message);
|
|
703
|
+
res.status(500).json({ error: 'Failed to check video status', message: error.message });
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
|
|
671
707
|
// ============ SPA FALLBACK ============
|
|
672
708
|
|
|
673
709
|
// Express 5 catch-all for SPA routes (not matched by API routes)
|
|
674
710
|
app.use((req, res, next) => {
|
|
675
711
|
// Only handle GET requests that weren't matched by other routes
|
|
676
|
-
if (req.method === 'GET' && !req.path.startsWith('/api') && !req.path.startsWith('/mcp') && !req.path.startsWith('/plugins') && !req.path.startsWith('/oauth') && !req.path.startsWith('/health')) {
|
|
712
|
+
if (req.method === 'GET' && !req.path.startsWith('/api') && !req.path.startsWith('/mcp') && !req.path.startsWith('/plugins') && !req.path.startsWith('/oauth') && !req.path.startsWith('/health') && !req.path.startsWith('/xai')) {
|
|
677
713
|
const indexPath = join(distDir, 'index.html');
|
|
678
714
|
if (existsSync(indexPath)) {
|
|
679
715
|
res.sendFile(indexPath);
|