chore: rebuild AIUI dist + add TMDB/API catch-all stubs for demo

- Rebuild AIUI with latest changes (haiku model fix, recipe panel, image fallbacks)
- Add /api/tmdb/* stub returning empty results
- Add /api/* catch-all returning JSON 404 (prevents HTML fallback errors)
- Improve Claude proxy error messages (include err.code fallback)
- Strip film images from dist to keep under 5MB

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-07 23:58:08 +00:00
parent fabc7c78f7
commit 255d0c2a78
81 changed files with 399 additions and 385 deletions

View File

@@ -1065,11 +1065,12 @@ app.post('/aiui/api/claude/*', (req, res) => {
})
proxyReq.on('error', (err) => {
console.error('[Claude Proxy] Error:', err.message)
const msg = err.message || err.code || JSON.stringify(err) || 'Unknown proxy error'
console.error('[Claude Proxy] Error:', msg)
if (!res.headersSent) {
res.status(502).json({
type: 'error',
error: { type: 'proxy_error', message: err.message }
error: { type: 'proxy_error', message: msg }
})
}
})
@@ -1080,11 +1081,24 @@ app.post('/aiui/api/claude/*', (req, res) => {
// Web search stub (no search engine configured in demo)
app.get('/api/web-search', (req, res) => {
res.json({ results: [], error: 'Web search not available in demo mode' })
res.json({ results: [] })
})
// AIUI API catch-all for unimplemented endpoints (return JSON instead of HTML)
// TMDB API stub (no TMDB key in demo)
app.get('/api/tmdb/*', (req, res) => {
res.json({ results: [] })
})
// Catch-all for unimplemented API endpoints (return JSON, not HTML)
app.all('/api/*', (req, res) => {
res.status(404).json({ error: 'Not available in demo mode' })
})
app.all('/aiui/api/*', (req, res) => {
res.status(404).json({ error: 'Not available in demo mode' })
})
// General /api/ catch-all
app.all('/api/*', (req, res) => {
res.status(404).json({ error: 'Not found' })
})