diff --git a/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl b/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl index 4b32379..b2ca400 100644 --- a/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl +++ b/.omc/state/agent-replay-47a38a07-3b39-4e33-8da2-ad3c7604975c.jsonl @@ -9,3 +9,8 @@ {"t":0,"agent":"a9b8a44","agent_type":"unknown","event":"agent_stop","success":true} {"t":0,"agent":"ad24c6c","agent_type":"unknown","event":"agent_stop","success":true} {"t":0,"agent":"a869894","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"a2a51be","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"a462672","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"a6bd471","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"aa941d3","agent_type":"unknown","event":"agent_stop","success":true} +{"t":0,"agent":"a4954dc","agent_type":"unknown","event":"agent_stop","success":true} diff --git a/.omc/state/last-tool-error.json b/.omc/state/last-tool-error.json index 51b8405..32f1d86 100644 --- a/.omc/state/last-tool-error.json +++ b/.omc/state/last-tool-error.json @@ -1,7 +1,7 @@ { "tool_name": "WebFetch", - "tool_input_preview": "{\"url\":\"https://tina.io/docs/reference/config/\",\"prompt\":\"What is the correct media configuration for tinacms 2.x? The error is \\\"Cannot read properties of undefined (reading 'publicFolder')\\\". What s...", + "tool_input_preview": "{\"url\":\"https://docs.astro.build/en/guides/deploy/easypanel/\",\"prompt\":\"How to deploy Astro to Easypanel? What type of service should be used? What port or configuration is needed for Easypanel + Astr...", "error": "timeout of 60000ms exceeded", - "timestamp": "2026-04-27T12:46:34.409Z", + "timestamp": "2026-04-28T00:25:40.810Z", "retry_count": 1 } \ No newline at end of file diff --git a/.omc/state/subagent-tracking.json b/.omc/state/subagent-tracking.json index 5f5adea..30eaef3 100644 --- a/.omc/state/subagent-tracking.json +++ b/.omc/state/subagent-tracking.json @@ -3,5 +3,5 @@ "total_spawned": 0, "total_completed": 0, "total_failed": 0, - "last_updated": "2026-04-27T13:57:02.103Z" + "last_updated": "2026-04-28T00:28:25.963Z" } \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fcf3386..0a569da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ -# Build stage FROM node:22-alpine AS builder WORKDIR /app @@ -8,17 +7,16 @@ RUN npm install COPY . . RUN npm run build -# Static files stage -FROM nginx:alpine AS runner +FROM node:22-alpine AS runner WORKDIR /app -# Copy static files from builder +ENV PORT=8080 +ENV DIST_DIR=./dist + COPY --from=builder /app/dist ./dist +COPY --from=builder /app/server.js . -# Copy nginx config -COPY nginx.conf /etc/nginx/http.d/default.conf +EXPOSE 8080 -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] +CMD ["node", "server.js"] \ No newline at end of file diff --git a/package.json b/package.json index f10c619..9e2241f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "dev:tina": "tinacms dev --port 3001", "build": "astro build", "preview": "astro preview", - "astro": "astro" + "astro": "astro", + "start": "node server.js" }, "dependencies": { "@astrojs/check": "^0.9.4", diff --git a/server.js b/server.js new file mode 100644 index 0000000..4c87faf --- /dev/null +++ b/server.js @@ -0,0 +1,74 @@ +import { createServer } from 'node:http' +import { readFile } from 'node:fs/promises' +import { join, extname } from 'node:path' +import { existsSync } from 'node:fs' + +const PORT = process.env.PORT || 8080 +const DIST_DIR = process.env.DIST_DIR || './dist' + +const mimeTypes = { + '.html': 'text/html', + '.js': 'application/javascript', + '.css': 'text/css', + '.json': 'application/json', + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.svg': 'image/svg+xml', + '.ico': 'image/x-icon', + '.woff': 'font/woff', + '.woff2': 'font/woff2', +} + +async function serveFile(res, filePath) { + try { + const content = await readFile(filePath) + const ext = extname(filePath) + const contentType = mimeTypes[ext] || 'application/octet-stream' + res.writeHead(200, { 'Content-Type': contentType }) + res.end(content) + } catch { + res.writeHead(404) + res.end('Not found') + } +} + +const server = createServer(async (req, res) => { + let url = req.url.split('?')[0] + + // Try exact file first + let filePath = join(DIST_DIR, url) + if (existsSync(filePath) && !existsSync(join(DIST_DIR, url, 'index.html'))) { + await serveFile(res, filePath) + return + } + + // Try directory index + const indexPaths = [ + join(DIST_DIR, url, 'index.html'), + join(DIST_DIR, 'index.html'), + ] + for (const idx of indexPaths) { + if (existsSync(idx)) { + await serveFile(res, idx) + return + } + } + + // Try with .html extension + if (!extname(url)) { + const htmlPath = join(DIST_DIR, url + '.html') + if (existsSync(htmlPath)) { + await serveFile(res, htmlPath) + return + } + } + + // 404 + res.writeHead(404) + res.end('Not found') +}) + +server.listen(PORT, '0.0.0.0', () => { + console.log(`Server running at http://0.0.0.0:${PORT}`) + console.log(`Serving files from ${DIST_DIR}`) +}) \ No newline at end of file