mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 18:59:40 +02:00
Create @manacore/shared-credit-service with:
- createCreditService() factory function
- Credit balance fetching with auth token support
- Operation pricing with caching (30min default)
- Fallback pricing for all standard operations
- Credit check before operations
- Credit consumption notification system
- Sync and async cost calculation methods
Standard operations supported:
- Memoro: transcription, headline, memory, blueprint, etc.
- Maerchenzauber: character creation, story creation
- ManaDeck: deck creation, card generation, AI review
- Generic: AI processing, export, import
Apps can use this service with their own configuration:
```ts
const creditService = createCreditService({
apiUrl: 'https://api.myapp.com',
getAuthToken: () => auth.getToken()
});
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
469 B
JSON
25 lines
469 B
JSON
{
|
|
"name": "@manacore/shared-credit-service",
|
|
"version": "0.0.1",
|
|
"type": "module",
|
|
"exports": {
|
|
".": {
|
|
"types": "./src/index.ts",
|
|
"default": "./src/index.ts"
|
|
}
|
|
},
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"files": [
|
|
"src"
|
|
],
|
|
"scripts": {
|
|
"type-check": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"@manacore/shared-subscription-types": "workspace:*"
|
|
},
|
|
"devDependencies": {
|
|
"typescript": "^5.0.0"
|
|
}
|
|
}
|