@elizaos/plugin-finances 2.0.11-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @elizaos/plugin-finances
2
+
3
+ Owner-facing finance dashboard for elizaOS: balance summary, transactions, and recurring charges.
4
+
5
+ ## Plugin surface
6
+
7
+ **Back-end**
8
+ - `runPaymentsHandler`, `MONEY_PARAMETERS`, `OWNER_FINANCE_SIMILES`, `MONEY_TAGS`, `MONEY_CONTEXTS` (`src/actions/finances.ts`) — the payments OWNER_FINANCES dispatch and parameter schema. `@elizaos/plugin-personal-assistant` imports these; the registered `OWNER_FINANCES` umbrella action stays in PA because it also routes `subscription_*` to PA's subscription back-end.
9
+ - `FinancesService` (`src/finances-service.ts`) — payment sources, CSV import, transactions, spending summaries, recurring-charge detection, and email bills. Holds its own runtime + `FinancesRepository`.
10
+ - `FinancesRepository` (`src/db/finances-repository.ts`) — raw SQL over `app_finances`.
11
+
12
+ **View**
13
+ - `finances` — `FinancesView` at `/finances` with balance summary, transactions, and recurring charges. Bundle: `dist/views/bundle.js`.
14
+
15
+ **Schema** — `pgSchema("app_finances")` (`financesDbSchema`) with five tables:
16
+ - `lifePaymentSources` (`life_payment_sources`) — payment source records per agent.
17
+ - `lifePaymentTransactions` (`life_payment_transactions`) — transactions; amounts stored as `amount_usd` (real), not minor units, to preserve the original LifeOps schema during the non-destructive copy migration.
18
+ - `lifeSubscriptionAudits` (`life_subscription_audits`) — subscription audit runs.
19
+ - `lifeSubscriptionCandidates` (`life_subscription_candidates`) — detected subscription candidates.
20
+ - `lifeSubscriptionCancellations` (`life_subscription_cancellations`) — cancellation records.
21
+
22
+ Table names are preserved verbatim from the original LifeOps tables (`life_payment_*`, `life_subscription_*`) so the non-destructive copy migration (`FinancesMigrationService`) can move existing `app_lifeops` rows across without data loss.
23
+
24
+ ## Commands
25
+
26
+ ```bash
27
+ bun run --cwd plugins/plugin-finances typecheck
28
+ bun run --cwd plugins/plugin-finances lint
29
+ bun run --cwd plugins/plugin-finances test
30
+ bun run --cwd plugins/plugin-finances build
31
+ bun run --cwd plugins/plugin-finances build:js
32
+ bun run --cwd plugins/plugin-finances build:views
33
+ bun run --cwd plugins/plugin-finances build:types
34
+ bun run --cwd plugins/plugin-finances clean
35
+ ```
36
+
37
+ ## Config / env vars
38
+
39
+ | Variable | Required | Description |
40
+ |---|---|---|
41
+ | `ELIZA_TOKEN_ENCRYPTION_KEY` | No | 32-byte (base64/hex) key encrypting Plaid / PayPal tokens at rest. Falls back to a lazily-generated file under `<oauth-dir>/lifeops/payments/.encryption-key` (mode 0600). |
42
+ | `ELIZAOS_CLOUD_API_KEY` | No | Eliza Cloud API key for the managed Plaid / PayPal bridges. |
43
+ | `ELIZAOS_CLOUD_BASE_URL` | No | Eliza Cloud base URL override for the managed bridges. |
44
+
45
+ ## Conventions
46
+
47
+ - ESM only (`"type": "module"`).
48
+ - Drizzle schema is registered through the `schema` field on the Plugin object; the elizaOS runtime owns migrations. No manual migration runner here.
49
+ - Amounts are stored in USD (`amount_usd` real), not minor units. New UI and API code should round inbound decimal values at the boundary and convert to minor units only for display/export. A future schema migration can move storage to integer minor units once the LifeOps compatibility window closes.
50
+ - Requires `@elizaos/plugin-sql` to be loaded first (peer dep + declared in the plugin `dependencies` array).
51
+ - Do NOT import `@elizaos/plugin-personal-assistant` from this package.
@@ -0,0 +1,70 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1024" height="1024" role="img" aria-label="Finances">
2
+ <defs>
3
+ <linearGradient id="bg-finances" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#15281f"/>
5
+ <stop offset="1" stop-color="#0b1915"/>
6
+ </linearGradient>
7
+ <radialGradient id="blobA-finances" cx="0.5" cy="0.5" r="0.5">
8
+ <stop offset="0" stop-color="#2fda85" stop-opacity="0.55"/>
9
+ <stop offset="1" stop-color="#2fda85" stop-opacity="0"/>
10
+ </radialGradient>
11
+ <radialGradient id="blobB-finances" cx="0.5" cy="0.5" r="0.5">
12
+ <stop offset="0" stop-color="#28c3be" stop-opacity="0.5"/>
13
+ <stop offset="1" stop-color="#28c3be" stop-opacity="0"/>
14
+ </radialGradient>
15
+ <radialGradient id="vig-finances" cx="0.5" cy="0.42" r="0.75">
16
+ <stop offset="0" stop-color="#000000" stop-opacity="0"/>
17
+ <stop offset="0.72" stop-color="#000000" stop-opacity="0"/>
18
+ <stop offset="1" stop-color="#000000" stop-opacity="0.5"/>
19
+ </radialGradient>
20
+ <linearGradient id="label-finances" x1="0" y1="0" x2="0" y2="1">
21
+ <stop offset="0" stop-color="#000000" stop-opacity="0"/>
22
+ <stop offset="1" stop-color="#000000" stop-opacity="0.55"/>
23
+ </linearGradient>
24
+ <filter id="soft-finances" x="-30%" y="-30%" width="160%" height="160%">
25
+ <feGaussianBlur stdDeviation="46"/>
26
+ </filter>
27
+ <filter id="iglow-finances" x="-40%" y="-40%" width="180%" height="180%">
28
+ <feDropShadow dx="0" dy="0" stdDeviation="14" flood-color="#45ed99" flood-opacity="0.45"/>
29
+ </filter>
30
+ </defs>
31
+
32
+ <rect width="1024" height="1024" fill="url(#bg-finances)"/>
33
+
34
+ <g opacity="0.9">
35
+ <circle cx="232" cy="220" r="300" fill="url(#blobA-finances)" filter="url(#soft-finances)"/>
36
+ <circle cx="840" cy="800" r="340" fill="url(#blobB-finances)" filter="url(#soft-finances)"/>
37
+ </g>
38
+
39
+ <g stroke="#d7eae0" stroke-width="1.4" opacity="0.06">
40
+ <line x1="0" y1="256" x2="1024" y2="256"/>
41
+ <line x1="0" y1="512" x2="1024" y2="512"/>
42
+ <line x1="0" y1="768" x2="1024" y2="768"/>
43
+ <line x1="256" y1="0" x2="256" y2="1024"/>
44
+ <line x1="512" y1="0" x2="512" y2="1024"/>
45
+ <line x1="768" y1="0" x2="768" y2="1024"/>
46
+ </g>
47
+
48
+ <g opacity="0.5">
49
+ <path d="M120 470 A 400 400 0 0 1 904 470" fill="none" stroke="#45ed99" stroke-width="3" opacity="0.35"/>
50
+ </g>
51
+
52
+ <g transform="translate(512 432)" filter="url(#iglow-finances)"
53
+ color="#d7eae0" stroke="#d7eae0" stroke-width="20"
54
+ stroke-linecap="round" stroke-linejoin="round" fill="none">
55
+ <polyline points="-150,-150 -150,150 150,150"/>
56
+ <polyline points="-118,86 -50,-2 6,52 76,-62 132,-104" fill="none"/>
57
+ <circle cx="-50" cy="-2" r="13" stroke-width="0" fill="currentColor"/>
58
+ <circle cx="76" cy="-62" r="13" stroke-width="0" fill="currentColor"/>
59
+ <circle cx="132" cy="-104" r="13" stroke-width="0" fill="currentColor"/>
60
+ </g>
61
+
62
+ <rect x="0" y="784" width="1024" height="240" fill="url(#label-finances)"/>
63
+ <text x="512" y="892" text-anchor="middle"
64
+ font-family="system-ui, -apple-system, Segoe UI, Roboto, sans-serif"
65
+ font-size="76" font-weight="600" letter-spacing="0.5"
66
+ fill="#d7eae0">Finances</text>
67
+ <rect x="460" y="924" width="104" height="6" rx="3" fill="#45ed99"/>
68
+
69
+ <rect width="1024" height="1024" fill="url(#vig-finances)"/>
70
+ </svg>
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@elizaos/plugin-finances",
3
+ "version": "2.0.11-beta.7",
4
+ "type": "module",
5
+ "description": "Owner finances overlay app: finance dashboard, transactions, recurring charges. Hooks into other finance providers later.",
6
+ "main": "./dist/index.js",
7
+ "scripts": {
8
+ "typecheck": "tsc --noEmit -p tsconfig.json",
9
+ "lint": "bunx @biomejs/biome check src/",
10
+ "test": "bunx vitest run --config ./vitest.config.ts",
11
+ "build": "bun run build:js && bun run build:views && bun run build:types",
12
+ "clean": "rm -rf dist",
13
+ "build:js": "tsup --config ../tsup.plugin-packages.shared.ts",
14
+ "build:views": "bunx --bun vite build --config vite.config.views.ts",
15
+ "build:types": "bunx tsc --noCheck -p tsconfig.build.json"
16
+ },
17
+ "exports": {
18
+ "./package.json": "./package.json",
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "eliza-source": {
22
+ "types": "./src/index.ts",
23
+ "import": "./src/index.ts",
24
+ "default": "./src/index.ts"
25
+ },
26
+ "import": "./dist/index.js",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./plugin": {
30
+ "types": "./dist/plugin.d.ts",
31
+ "eliza-source": {
32
+ "types": "./src/plugin.ts",
33
+ "import": "./src/plugin.ts",
34
+ "default": "./src/plugin.ts"
35
+ },
36
+ "import": "./dist/plugin.js",
37
+ "default": "./dist/plugin.js"
38
+ },
39
+ "./*.css": "./dist/*.css",
40
+ "./*": {
41
+ "types": "./dist/*.d.ts",
42
+ "eliza-source": {
43
+ "types": "./src/*.ts",
44
+ "import": "./src/*.ts",
45
+ "default": "./src/*.ts"
46
+ },
47
+ "import": "./dist/*.js",
48
+ "default": "./dist/*.js"
49
+ }
50
+ },
51
+ "dependencies": {
52
+ "@elizaos/agent": "2.0.11-beta.7",
53
+ "@elizaos/app-core": "2.0.11-beta.7",
54
+ "@elizaos/core": "2.0.11-beta.7",
55
+ "@elizaos/plugin-browser": "2.0.11-beta.7",
56
+ "@elizaos/plugin-elizacloud": "2.0.11-beta.7",
57
+ "@elizaos/plugin-google": "2.0.11-beta.7",
58
+ "@elizaos/shared": "2.0.11-beta.7",
59
+ "@elizaos/ui": "2.0.11-beta.7",
60
+ "drizzle-orm": "^0.45.1",
61
+ "lucide-react": "^1.0.0"
62
+ },
63
+ "peerDependencies": {
64
+ "@elizaos/plugin-sql": "2.0.11-beta.7",
65
+ "react": "^19.0.0",
66
+ "react-dom": "^19.0.0"
67
+ },
68
+ "elizaos": {
69
+ "app": {
70
+ "displayName": "Finances",
71
+ "category": "owner"
72
+ }
73
+ },
74
+ "publishConfig": {
75
+ "access": "public"
76
+ },
77
+ "types": "./dist/index.d.ts",
78
+ "files": [
79
+ "assets",
80
+ "dist"
81
+ ],
82
+ "devDependencies": {
83
+ "@biomejs/biome": "^2.4.14",
84
+ "@types/node": "^25.0.6",
85
+ "@types/react": "^19.0.0",
86
+ "@types/react-dom": "^19.0.0",
87
+ "react": "^19.0.0",
88
+ "react-dom": "^19.0.0",
89
+ "tsup": "^8.5.1",
90
+ "typescript": "^6.0.3",
91
+ "vite": "^8.0.0",
92
+ "vitest": "^4.0.17"
93
+ },
94
+ "gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e"
95
+ }