|
| 1 | +import { readFileSync } from 'fs'; |
| 2 | +import { join } from 'path'; |
| 3 | + |
| 4 | +let cachedVersion = 'unknown'; |
| 5 | + |
| 6 | +try { |
| 7 | + // Use process.cwd() as we can safely assume this runs from backend/ directory |
| 8 | + const pkgPath = join(process.cwd(), 'package.json'); |
| 9 | + const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')); |
| 10 | + cachedVersion = pkg.version || '0.1.0'; |
| 11 | +} catch (e) { |
| 12 | + console.warn('Could not read package.json version, defaulting to 0.1.0'); |
| 13 | + cachedVersion = '0.1.0'; |
| 14 | +} |
| 15 | + |
| 16 | +export function getCatalog() { |
| 17 | + return { |
| 18 | + version: cachedVersion, |
| 19 | + services: [ |
| 20 | + { |
| 21 | + id: 'verification', |
| 22 | + name: 'AI-powered work verification', |
| 23 | + capabilities: ['Verify work based on milestone descriptions and repository URLs'], |
| 24 | + dependencies: ['OpenAI API'], |
| 25 | + }, |
| 26 | + { |
| 27 | + id: 'invoice', |
| 28 | + name: 'Invoice Generation', |
| 29 | + capabilities: ['Generate professional invoices with itemized line items and summaries based on hours and rates'], |
| 30 | + dependencies: ['OpenAI API'], |
| 31 | + }, |
| 32 | + { |
| 33 | + id: 'stellar', |
| 34 | + name: 'Stellar Network Operations', |
| 35 | + capabilities: ['Retrieve account info (balances, sequence)', 'Get transaction status via hash'], |
| 36 | + dependencies: ['Stellar SDK', 'Stellar Horizon'], |
| 37 | + } |
| 38 | + ] |
| 39 | + }; |
| 40 | +} |
0 commit comments