Implement a centralized logging system with typed events (webhook, PR, comment, review, Discord relay, errors, etc.) that feeds a pub/sub pattern. Events are logged to console (with ANSI colors: green=normal, yellow=skipped, red=errors, cyan=PR#) and persisted to JSONL files organized by git commit SHA. Restructure server code into src/server/ directory with separate route handlers. Add a new /logs endpoint with an HTML viewer that displays events in a searchable table with type/repo filtering and browser timezone conversion. Remove the old /errors endpoint. Improvements: - All webhook handlers, Discord events, and errors now use log() instead of console.* calls - Error objects are properly serialized to JSONL (message + stack extracted) - Path traversal vulnerability fixed in readLogFile() - Failed API calls and caught errors are now always logged - Graceful error handling with fallbacks where appropriate (e.g., missing Discord users) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
32 lines
795 B
JSON
32 lines
795 B
JSON
{
|
|
"name": "@workshop/spike",
|
|
"module": "src/discord/index.ts",
|
|
"type": "module",
|
|
"private": true,
|
|
"scripts": {
|
|
"bot:cli": "bun run --watch src/cli",
|
|
"bot:discord": "bun run --watch src/discord",
|
|
"authServer": "bun run --watch src/discord/auth.ts",
|
|
"subdomain:start": "bun run src/server/index.tsx",
|
|
"subdomain:dev": "bun run --hot src/server/index.tsx",
|
|
"test": "bun test src/gitea/test/"
|
|
},
|
|
"prettier": {
|
|
"printWidth": 110,
|
|
"semi": false
|
|
},
|
|
"dependencies": {
|
|
"@openai/agents": "^0.0.10",
|
|
"@workshop/shared": "workspace:*",
|
|
"discord.js": "^14.19.3",
|
|
"luxon": "catalog:",
|
|
"zod": "catalog:",
|
|
"hono": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@types/bun": "latest"
|
|
},
|
|
"peerDependencies": {
|
|
"typescript": "^5"
|
|
}
|
|
} |