Files

34 lines
908 B
JSON
Raw Permalink Normal View History

2026-03-13 23:21:55 +00:00
{
"name": "@workspace/api-server",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "NODE_ENV=development tsx ./src/index.ts",
"build": "tsx ./build.ts",
Task #2: MVP Foundation — injectable services, DB schema, smoke test DB schema - jobs and invoices tables in lib/db/src/schema/ - schema barrel exports jobs, invoices, conversations, messages - Schema pushed successfully LNbitsService (artifacts/api-server/src/lib/lnbits.ts) - Injectable class: constructor accepts optional { url, apiKey } config - Falls back to LNBITS_URL / LNBITS_API_KEY env vars - Auto-detects stub mode when credentials absent; logs clear warning - createInvoice(amountSats, memo) -> { paymentHash, paymentRequest } - checkInvoicePaid(paymentHash) -> boolean - stubMarkPaid(hash) helper for dev flows (guarded to stub mode only) - Real LNbits REST v1 calls wired behind stub guard AgentService (artifacts/api-server/src/lib/agent.ts) - Injectable class with configurable evalModel/workModel - evaluateRequest(text) -> { accepted: boolean, reason: string } uses claude-haiku-4-5; strips markdown fences before JSON parse - executeWork(text) -> { result: string } uses claude-sonnet-4-6 - No @anthropic-ai/sdk import; types inferred from SDK response union - Wired via Replit Anthropic AI Integration PricingService (artifacts/api-server/src/lib/pricing.ts) - Injectable class with configurable fee/bucket thresholds - calculateEvalFeeSats() -> 10 sats (fixed) - calculateWorkFeeSats(text) -> 50/100/250 by char-length bucket - Fully deterministic, no LLM Smoke test (artifacts/api-server/src/smoke.ts) - pnpm --filter @workspace/api-server run smoke - LNbits: create invoice, check unpaid, mark paid, check paid — all pass - Anthropic: evaluateRequest round-trip — passes replit.md: documented LNBITS_URL, LNBITS_API_KEY and auto-provisioned secrets
2026-03-18 15:18:23 +00:00
"typecheck": "tsc -p tsconfig.json --noEmit",
"smoke": "tsx ./src/smoke.ts"
2026-03-13 23:21:55 +00:00
},
"dependencies": {
"@workspace/api-zod": "workspace:*",
"@workspace/db": "workspace:*",
"@workspace/integrations-anthropic-ai": "workspace:*",
"@workspace/integrations-gemini-ai": "workspace:*",
"cookie-parser": "^1.4.7",
"cors": "^2",
2026-03-13 23:21:55 +00:00
"drizzle-orm": "catalog:",
"express": "^5",
"express-rate-limit": "^8.3.1",
"nostr-tools": "^2.23.3",
"ws": "^8.19.0"
2026-03-13 23:21:55 +00:00
},
"devDependencies": {
"@types/cookie-parser": "^1.4.10",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/node": "catalog:",
"@types/ws": "^8.18.1",
2026-03-13 23:21:55 +00:00
"esbuild": "^0.27.3",
"tsx": "catalog:"
}
}