@buildaureon/mcp 0.1.2 → 0.1.8
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/README.md +21 -19
- package/dist/index.js +297 -11
- package/dist/index.js.map +1 -1
- package/docs/agent-guide.md +192 -8
- package/docs/architecture.md +7 -7
- package/docs/auth.md +15 -13
- package/docs/security.md +5 -5
- package/docs/setup.md +18 -17
- package/docs/tools.md +223 -11
- package/examples/claude-desktop.json +0 -1
- package/examples/cursor.mcp.json +0 -1
- package/package.json +66 -62
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Exposes the full `@buildaureon/sdk` surface as tools for Cursor, Claude Desktop,
|
|
|
11
11
|
|
|
12
12
|
[](https://www.typescriptlang.org/)
|
|
13
13
|
[](https://modelcontextprotocol.io)
|
|
14
|
-
[](https://github.com/buildaureon)
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](#requirements--installation)
|
|
17
17
|
|
|
@@ -64,7 +64,7 @@ npx -y @buildaureon/mcp
|
|
|
64
64
|
| Rehearse market shocks | `aureon_apply_market_event`, `aureon_refresh_watchdog` |
|
|
65
65
|
| Manage developer API keys | `aureon_list_api_keys`, `aureon_create_api_key`, … |
|
|
66
66
|
|
|
67
|
-
**
|
|
67
|
+
**54 tools**: one per public `AureonClient` method. Full schemas: [docs/tools.md](docs/tools.md).
|
|
68
68
|
|
|
69
69
|
For scripts without MCP, use [`@buildaureon/sdk`](https://github.com/buildaureon/aureon-sdk). The operator app at [app.aureonlabs.network](https://app.aureonlabs.network) stays wallet-Bearer only.
|
|
70
70
|
|
|
@@ -86,8 +86,8 @@ Traditional AI trading scripts execute isolated market orders without context, f
|
|
|
86
86
|
### Requirements
|
|
87
87
|
|
|
88
88
|
- **Node.js**: 20 or higher (ESM compatible)
|
|
89
|
-
- **Developer API Key**:
|
|
90
|
-
- **Network Access**:
|
|
89
|
+
- **Developer API Key**: Issued on the **same** API you will call (local 5174 Developers for 8788 / 4663, or [app.aureonlabs.network](https://app.aureonlabs.network) for the public host — still 46630)
|
|
90
|
+
- **Network Access**: Default local mainnet `http://127.0.0.1:8788`. Optional `AUREON_NETWORK=testnet` for `https://api.aureonlabs.network` (still 46630)
|
|
91
91
|
|
|
92
92
|
### Installation
|
|
93
93
|
|
|
@@ -102,7 +102,7 @@ npm install @buildaureon/mcp
|
|
|
102
102
|
npx -y @buildaureon/mcp
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
You do not need to clone the AUREON monorepo: only the package
|
|
105
|
+
You do not need to clone the AUREON monorepo: only the package and an issued key for the network you will call.
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
@@ -112,9 +112,10 @@ You do not need to clone the AUREON monorepo: only the package, the live API URL
|
|
|
112
112
|
flowchart LR
|
|
113
113
|
Agent[Cursor / Claude] -->|stdio MCP| MCP["@buildaureon/mcp"]
|
|
114
114
|
MCP --> SDK["@buildaureon/sdk"]
|
|
115
|
-
SDK -->|
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
SDK -->|default| Main[127.0.0.1:8788 / 4663]
|
|
116
|
+
SDK -->|AUREON_NETWORK=testnet| Test[api.aureonlabs.network / still 46630]
|
|
117
|
+
Main --> Vault[Smart Vault]
|
|
118
|
+
Test --> Vault
|
|
118
119
|
```
|
|
119
120
|
|
|
120
121
|
### Surface & Ownership Breakdown
|
|
@@ -145,11 +146,13 @@ Get your AI agent running with AUREON MCP in 4 easy steps:
|
|
|
145
146
|
|
|
146
147
|
### 1. Create an issued API key
|
|
147
148
|
|
|
148
|
-
|
|
149
|
-
2. Connect your wallet (invite early access)
|
|
150
|
-
3. Navigate to **Developers** → click **Create API Key** → copy your key once
|
|
149
|
+
Issue the key on the **same** API this MCP process will call:
|
|
151
150
|
|
|
152
|
-
|
|
151
|
+
1. Local mainnet (default 8788 / 4663): open Living Capital on `http://127.0.0.1:5174` → **Developers**.
|
|
152
|
+
2. Public testnet (optional): open https://app.aureonlabs.network → **Developers** (still chain 46630).
|
|
153
|
+
3. Create API Key → copy your key once.
|
|
154
|
+
|
|
155
|
+
That key identifies your wallet for control-plane tools. **No Bearer token required.** A testnet key will not authenticate the local mainnet API.
|
|
153
156
|
|
|
154
157
|
### 2. Configure Cursor IDE
|
|
155
158
|
|
|
@@ -162,7 +165,6 @@ Copy [`examples/cursor.mcp.json`](examples/cursor.mcp.json) into `.cursor/mcp.js
|
|
|
162
165
|
"command": "npx",
|
|
163
166
|
"args": ["-y", "@buildaureon/mcp"],
|
|
164
167
|
"env": {
|
|
165
|
-
"AUREON_API_URL": "https://api.aureonlabs.network",
|
|
166
168
|
"AUREON_API_KEY": "<issued-developer-api-key>"
|
|
167
169
|
}
|
|
168
170
|
}
|
|
@@ -186,7 +188,6 @@ Merge [`examples/claude-desktop.json`](examples/claude-desktop.json) into Claude
|
|
|
186
188
|
"command": "npx",
|
|
187
189
|
"args": ["-y", "@buildaureon/mcp"],
|
|
188
190
|
"env": {
|
|
189
|
-
"AUREON_API_URL": "https://api.aureonlabs.network",
|
|
190
191
|
"AUREON_API_KEY": "<issued-developer-api-key>"
|
|
191
192
|
}
|
|
192
193
|
}
|
|
@@ -215,7 +216,8 @@ Point the host `command` / `args` at the built `dist/index.js`. See [docs/setup.
|
|
|
215
216
|
| Variable | Required | Role |
|
|
216
217
|
| --- | --- | --- |
|
|
217
218
|
| `AUREON_API_KEY` | Yes (recommended) | Issued developer key for product access **and** wallet identity |
|
|
218
|
-
| `
|
|
219
|
+
| `AUREON_NETWORK` | No | Omit for mainnet (4663 / 8788). Set `testnet` for the public host (still 46630). |
|
|
220
|
+
| `AUREON_API_URL` | No | Optional override. Must match `AUREON_NETWORK` if both are set. |
|
|
219
221
|
| `AUREON_AUTH_TOKEN` | No | Optional wallet Bearer (**wins** if both key and Bearer are sent) |
|
|
220
222
|
|
|
221
223
|
**Private Key Boundary**: Private keys are only needed outside MCP when signing and broadcasting deposit or withdrawal transactions. Prepare tools return unsigned transaction steps; the MCP server never signs.
|
|
@@ -234,13 +236,13 @@ Deep dive: [docs/auth.md](docs/auth.md).
|
|
|
234
236
|
|
|
235
237
|
## Tool Surface
|
|
236
238
|
|
|
237
|
-
AUREON MCP exposes **
|
|
239
|
+
AUREON MCP exposes **54 tools** covering 100% of the `AureonClient` SDK surface:
|
|
238
240
|
|
|
239
241
|
| Category | Count | Tools Included | Primary Purpose |
|
|
240
242
|
| --- | --- | --- | --- |
|
|
241
243
|
| **Health** | 1 | `aureon_ping` | Check API connectivity & backend watchdog state |
|
|
242
244
|
| **Auth** | 5 | `aureon_get_auth_nonce`, `aureon_verify_wallet`, `aureon_dev_login`, `aureon_logout`, `aureon_me` | Manage wallet sessions, challenges, and identity |
|
|
243
|
-
| **Read** |
|
|
245
|
+
| **Read** | 12 | `aureon_get_overview`, `aureon_get_portfolio`, `aureon_list_objectives`, `aureon_get_objective`, `aureon_get_health`, `aureon_list_timeline`, `aureon_list_market_presets`, `aureon_get_restore_plan`, `aureon_list_executions`, `aureon_get_vault`, `aureon_get_vault_status`, `aureon_get_audit_trail` | Inspect portfolio allocations, health scores, timelines, vault state, and the joined audit trail |
|
|
244
246
|
| **Objectives** | 4 | `aureon_create_objective`, `aureon_update_objective`, `aureon_pause_objective`, `aureon_resume_objective` | Create, modify, pause, and resume Financial Compass Objectives |
|
|
245
247
|
| **Portfolio** | 3 | `aureon_set_portfolio`, `aureon_clear_portfolio`, `aureon_sync_portfolio` | Synchronize and manage live Capital Book asset marks |
|
|
246
248
|
| **Execution** | 2 | `aureon_run_execution`, `aureon_restore_objective` | Trigger policy rebalancing and execute objective restore plans |
|
|
@@ -358,7 +360,7 @@ pnpm --filter @buildaureon/mcp typecheck
|
|
|
358
360
|
| --- | --- |
|
|
359
361
|
| **[Setup Guide](docs/setup.md)** | Step-by-step setup for Cursor, Claude Desktop, npx, building from source, and troubleshooting |
|
|
360
362
|
| **[Authentication Guide](docs/auth.md)** | Issued API key vs. Wallet Bearer vs. private key boundaries |
|
|
361
|
-
| **[Tools Reference](docs/tools.md)** | Full
|
|
363
|
+
| **[Tools Reference](docs/tools.md)** | Full 47-tool reference with arguments, schemas, and caveats |
|
|
362
364
|
| **[Agent Playbooks](docs/agent-guide.md)** | End-to-end agent decision playbooks, turn templates, and anti-patterns |
|
|
363
365
|
| **[Architecture Deep Dive](docs/architecture.md)** | Module boundaries, file maps, and end-to-end request data flows |
|
|
364
366
|
| **[Security Model](docs/security.md)** | Credential management, threat modeling, and operational safety |
|
|
@@ -372,7 +374,7 @@ pnpm --filter @buildaureon/mcp typecheck
|
|
|
372
374
|
No. You only need an issued `AUREON_API_KEY`. Private keys stay in your host wallet when signing prepare steps.
|
|
373
375
|
|
|
374
376
|
**Does MCP talk to a local backend server?**
|
|
375
|
-
|
|
377
|
+
Yes by default. Omit `AUREON_API_URL` for local mainnet `http://127.0.0.1:8788` (chain 4663). Set `AUREON_NETWORK=testnet` for the public host (still chain 46630). `api.aureonlabs.network` is not 4663.
|
|
376
378
|
|
|
377
379
|
**Why did my restore receipt say `staged`?**
|
|
378
380
|
`staged` indicates a ledger-local simulation receipt rather than an on-chain vault settlement. Always describe settlement receipts accurately in agent responses.
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
import {
|
|
4
|
+
import { resolveAureonNetworkFromEnv, createSessionTokenProvider, createAureonClient, validateExecutionReceipt, isAureonError } from '@buildaureon/sdk';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
function loadConfig() {
|
|
8
|
-
const
|
|
8
|
+
const resolved = resolveAureonNetworkFromEnv();
|
|
9
9
|
const apiKey = process.env.AUREON_API_KEY || void 0;
|
|
10
10
|
const authToken = process.env.AUREON_AUTH_TOKEN || void 0;
|
|
11
11
|
if (!apiKey && !authToken) {
|
|
12
12
|
throw new Error(
|
|
13
|
-
"Set AUREON_API_KEY (issued developer key
|
|
13
|
+
"Set AUREON_API_KEY (issued developer key) or AUREON_AUTH_TOKEN (wallet Bearer). Default network is mainnet (http://127.0.0.1:8788). Set AUREON_NETWORK=testnet for the public host (still 46630). See https://github.com/buildaureon/aureon-mcp#authentication"
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
return {
|
|
16
|
+
return {
|
|
17
|
+
apiUrl: resolved.baseUrl,
|
|
18
|
+
apiKey,
|
|
19
|
+
authToken,
|
|
20
|
+
network: resolved.network,
|
|
21
|
+
chainId: resolved.chainId
|
|
22
|
+
};
|
|
17
23
|
}
|
|
18
24
|
function createClient(config) {
|
|
19
25
|
const session = createSessionTokenProvider(config.authToken ?? null);
|
|
20
26
|
const client = createAureonClient({
|
|
27
|
+
network: config.network,
|
|
21
28
|
baseUrl: config.apiUrl,
|
|
22
29
|
apiKey: config.apiKey ?? null,
|
|
23
30
|
getAccessToken: session.getAccessToken
|
|
@@ -68,6 +75,18 @@ function registerReadTools(server, client) {
|
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
77
|
);
|
|
78
|
+
server.tool(
|
|
79
|
+
"aureon_get_allocation_vs_target",
|
|
80
|
+
"Objective vs actual portfolio \u2014 current weight vs policy target per objective, plus green-book/off-plan paradox flag",
|
|
81
|
+
{},
|
|
82
|
+
async () => {
|
|
83
|
+
try {
|
|
84
|
+
return ok(await client.getAllocationVsTarget());
|
|
85
|
+
} catch (err) {
|
|
86
|
+
return fail(err);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
);
|
|
71
90
|
server.tool(
|
|
72
91
|
"aureon_get_portfolio",
|
|
73
92
|
"Current capital book snapshot \u2014 positions, marks, weights",
|
|
@@ -151,7 +170,7 @@ function registerCompassTools(server, client) {
|
|
|
151
170
|
);
|
|
152
171
|
server.tool(
|
|
153
172
|
"aureon_run_execution",
|
|
154
|
-
"Run restorative execution for an objective
|
|
173
|
+
"Run restorative execution for an objective outside policy. Read receipt.settlement and receipt.verifiedOnChain \u2014 staged = never on-chain; vault + verifiedOnChain = chain-observed; vault without verified = submitted but not yet observed.",
|
|
155
174
|
{ objectiveId: z.string().describe("The objective ID") },
|
|
156
175
|
async ({ objectiveId }) => {
|
|
157
176
|
try {
|
|
@@ -163,7 +182,7 @@ function registerCompassTools(server, client) {
|
|
|
163
182
|
);
|
|
164
183
|
server.tool(
|
|
165
184
|
"aureon_restore_objective",
|
|
166
|
-
"Run
|
|
185
|
+
"Run restorative execution for an objective outside policy. Not always vault-backed: read settlement and verifiedOnChain. staged is never on-chain. vault without verifiedOnChain is submitted, not proven. Returns ExecutionReceipt.",
|
|
167
186
|
{ objectiveId: z.string().describe("The objective ID") },
|
|
168
187
|
async ({ objectiveId }) => {
|
|
169
188
|
try {
|
|
@@ -175,7 +194,7 @@ function registerCompassTools(server, client) {
|
|
|
175
194
|
);
|
|
176
195
|
server.tool(
|
|
177
196
|
"aureon_list_executions",
|
|
178
|
-
"Recent execution receipts \u2014
|
|
197
|
+
"Recent execution receipts \u2014 read settlement, verifiedOnChain, settlementRecord, explorerUrl, registryRef.",
|
|
179
198
|
{ objectiveId: z.string().optional().describe("Filter by objective ID (omit for all)") },
|
|
180
199
|
async ({ objectiveId }) => {
|
|
181
200
|
try {
|
|
@@ -327,6 +346,176 @@ var objectiveKind = z.enum([
|
|
|
327
346
|
"reward_reinvestment"
|
|
328
347
|
]);
|
|
329
348
|
var objectivePriority = z.enum(["low", "medium", "high", "critical"]);
|
|
349
|
+
function registerIntentTools(server, client) {
|
|
350
|
+
server.tool(
|
|
351
|
+
"aureon_apply_financial_intent",
|
|
352
|
+
"Register user/agent intent as an Automatic objective and return AI \u2192 objective \u2192 portfolio flow",
|
|
353
|
+
{
|
|
354
|
+
brief: z.string().describe("What the user wants their money to do \u2014 agent-extracted wording"),
|
|
355
|
+
kind: objectiveKind.describe("Objective kind"),
|
|
356
|
+
targetWeight: z.number().describe("Target portfolio weight (0\u20131)"),
|
|
357
|
+
tolerance: z.number().describe("Allowed drift band (0\u20131)"),
|
|
358
|
+
targetSymbol: z.string().optional().describe("Asset symbol for balanced_portfolio (required for that kind)"),
|
|
359
|
+
name: z.string().optional().describe("Objective display name override"),
|
|
360
|
+
priority: objectivePriority.optional().describe("Evaluation priority")
|
|
361
|
+
},
|
|
362
|
+
async (input) => {
|
|
363
|
+
try {
|
|
364
|
+
return ok(await client.applyFinancialIntent(input));
|
|
365
|
+
} catch (err) {
|
|
366
|
+
return fail(err);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
server.tool(
|
|
371
|
+
"aureon_get_objective_portfolio_flow",
|
|
372
|
+
"Read AI \u2192 objective \u2192 portfolio flow for active objectives",
|
|
373
|
+
{
|
|
374
|
+
objectiveId: z.string().optional().describe("Filter to one objective (omit for all active)")
|
|
375
|
+
},
|
|
376
|
+
async ({ objectiveId }) => {
|
|
377
|
+
try {
|
|
378
|
+
return ok(await client.getObjectivePortfolioFlow(objectiveId));
|
|
379
|
+
} catch (err) {
|
|
380
|
+
return fail(err);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
function registerDriftRestoreTools(server, client) {
|
|
386
|
+
server.tool(
|
|
387
|
+
"aureon_run_drift_restore_demo",
|
|
388
|
+
"Run drift \u2192 detection \u2192 restore demo (seed book, break rule, manual restore)",
|
|
389
|
+
{},
|
|
390
|
+
async () => {
|
|
391
|
+
try {
|
|
392
|
+
return ok(await client.runDriftRestoreDemo());
|
|
393
|
+
} catch (err) {
|
|
394
|
+
return fail(err);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
server.tool(
|
|
399
|
+
"aureon_get_drift_restore_flow",
|
|
400
|
+
"Read drift \u2192 detection \u2192 restore flow for active objectives",
|
|
401
|
+
{
|
|
402
|
+
objectiveId: z.string().optional().describe("Filter to one objective (omit for all active)")
|
|
403
|
+
},
|
|
404
|
+
async ({ objectiveId }) => {
|
|
405
|
+
try {
|
|
406
|
+
return ok(await client.getDriftRestoreFlow(objectiveId));
|
|
407
|
+
} catch (err) {
|
|
408
|
+
return fail(err);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
function registerReceiptVerificationTools(server, client) {
|
|
414
|
+
server.tool(
|
|
415
|
+
"aureon_run_receipt_verification_demo",
|
|
416
|
+
"Run receipt \u2192 verification demo (restore + validate receipt + settlement lookup)",
|
|
417
|
+
{},
|
|
418
|
+
async () => {
|
|
419
|
+
try {
|
|
420
|
+
return ok(await client.runReceiptVerificationDemo());
|
|
421
|
+
} catch (err) {
|
|
422
|
+
return fail(err);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
server.tool(
|
|
427
|
+
"aureon_get_receipt_verification_flow",
|
|
428
|
+
"Read receipt \u2192 verification flow for execution receipts",
|
|
429
|
+
{
|
|
430
|
+
executionId: z.string().optional().describe("Filter to one execution id (omit for five most recent)")
|
|
431
|
+
},
|
|
432
|
+
async ({ executionId }) => {
|
|
433
|
+
try {
|
|
434
|
+
return ok(await client.getReceiptVerificationFlow(executionId));
|
|
435
|
+
} catch (err) {
|
|
436
|
+
return fail(err);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
var agentHost = z.enum(["cursor", "claude", "mcp"]);
|
|
442
|
+
function registerPortfolioWatchTools(server, client) {
|
|
443
|
+
server.tool(
|
|
444
|
+
"aureon_run_portfolio_watch_demo",
|
|
445
|
+
"Run portfolio watch demo (brief \u2192 Automatic objective \u2192 while-away event \u2192 return briefing)",
|
|
446
|
+
{
|
|
447
|
+
brief: z.string().optional().describe(
|
|
448
|
+
"User wording \u2014 default: Watch my portfolio while I'm away \u2014 keep about 20% in stable assets."
|
|
449
|
+
),
|
|
450
|
+
host: agentHost.optional().describe("Agent host label for briefing (cursor | claude | mcp)")
|
|
451
|
+
},
|
|
452
|
+
async ({ brief, host }) => {
|
|
453
|
+
try {
|
|
454
|
+
return ok(await client.runPortfolioWatchDemo({ brief, host }));
|
|
455
|
+
} catch (err) {
|
|
456
|
+
return fail(err);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
server.tool(
|
|
461
|
+
"aureon_get_portfolio_watch_flow",
|
|
462
|
+
"Read portfolio watch briefing for Automatic objectives",
|
|
463
|
+
{
|
|
464
|
+
objectiveId: z.string().optional().describe("Filter to one objective (omit for all Automatic)"),
|
|
465
|
+
brief: z.string().optional().describe("User brief for briefing lines"),
|
|
466
|
+
host: agentHost.optional().describe("Agent host label")
|
|
467
|
+
},
|
|
468
|
+
async ({ objectiveId, brief, host }) => {
|
|
469
|
+
try {
|
|
470
|
+
return ok(
|
|
471
|
+
await client.getPortfolioWatchFlow({ objectiveId, brief, host })
|
|
472
|
+
);
|
|
473
|
+
} catch (err) {
|
|
474
|
+
return fail(err);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function registerFullAureonLoopTools(server, client) {
|
|
480
|
+
server.tool(
|
|
481
|
+
"aureon_run_full_aureon_loop_demo",
|
|
482
|
+
"Run Content Arc full AUREON loop (intent \u2192 plan check \u2192 restore \u2192 receipt verification)",
|
|
483
|
+
{
|
|
484
|
+
brief: z.string().optional().describe(
|
|
485
|
+
"User wording \u2014 default: Keep about 20% in stable assets \u2014 grow the book without abandoning the plan."
|
|
486
|
+
)
|
|
487
|
+
},
|
|
488
|
+
async ({ brief }) => {
|
|
489
|
+
try {
|
|
490
|
+
return ok(await client.runFullAureonLoopDemo({ brief }));
|
|
491
|
+
} catch (err) {
|
|
492
|
+
return fail(err);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
server.tool(
|
|
497
|
+
"aureon_get_full_aureon_loop_flow",
|
|
498
|
+
"Read full AUREON loop for active objectives with a latest execution receipt",
|
|
499
|
+
{
|
|
500
|
+
objectiveId: z.string().optional().describe("Filter to one objective (omit for all active with receipts)"),
|
|
501
|
+
brief: z.string().optional().describe("User brief for teaching shape")
|
|
502
|
+
},
|
|
503
|
+
async ({ objectiveId, brief }) => {
|
|
504
|
+
try {
|
|
505
|
+
return ok(await client.getFullAureonLoopFlow({ objectiveId, brief }));
|
|
506
|
+
} catch (err) {
|
|
507
|
+
return fail(err);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
var objectiveKind2 = z.enum([
|
|
513
|
+
"stable_allocation",
|
|
514
|
+
"balanced_portfolio",
|
|
515
|
+
"risk_ceiling",
|
|
516
|
+
"reward_reinvestment"
|
|
517
|
+
]);
|
|
518
|
+
var objectivePriority2 = z.enum(["low", "medium", "high", "critical"]);
|
|
330
519
|
var automationMode = z.enum(["auto", "manual"]);
|
|
331
520
|
function registerObjectiveTools(server, client) {
|
|
332
521
|
server.tool(
|
|
@@ -334,10 +523,10 @@ function registerObjectiveTools(server, client) {
|
|
|
334
523
|
"Create a Financial Compass Objective. targetSymbol and automationMode are locked after create \u2014 recreate to change them. Defaults to automationMode auto.",
|
|
335
524
|
{
|
|
336
525
|
name: z.string().describe("Objective display name"),
|
|
337
|
-
kind:
|
|
526
|
+
kind: objectiveKind2.describe("Objective kind"),
|
|
338
527
|
targetWeight: z.number().describe("Target portfolio weight (0\u20131)"),
|
|
339
528
|
tolerance: z.number().describe("Allowed drift band (0\u20131)"),
|
|
340
|
-
priority:
|
|
529
|
+
priority: objectivePriority2.optional().describe("Evaluation priority"),
|
|
341
530
|
maxRiskScore: z.number().optional().describe("Max risk score ceiling"),
|
|
342
531
|
reinvestRatio: z.number().optional().describe("Reinvest ratio for reward objectives"),
|
|
343
532
|
targetSymbol: z.string().nullable().optional().describe("Asset symbol to track (locked after create)"),
|
|
@@ -357,7 +546,7 @@ function registerObjectiveTools(server, client) {
|
|
|
357
546
|
{
|
|
358
547
|
objectiveId: z.string().describe("Objective ID"),
|
|
359
548
|
name: z.string().optional(),
|
|
360
|
-
priority:
|
|
549
|
+
priority: objectivePriority2.optional(),
|
|
361
550
|
targetWeight: z.number().optional(),
|
|
362
551
|
tolerance: z.number().optional(),
|
|
363
552
|
maxRiskScore: z.number().optional(),
|
|
@@ -452,7 +641,7 @@ function registerMarketTools(server, client) {
|
|
|
452
641
|
priceChangeRatio: z.number().describe("Fractional price change (e.g. -0.15 = -15%)"),
|
|
453
642
|
name: z.string().optional().describe("Event label"),
|
|
454
643
|
description: z.string().optional().describe("Event description"),
|
|
455
|
-
autoRestore: z.boolean().optional().describe("
|
|
644
|
+
autoRestore: z.boolean().optional().describe("Opt in to run restore if objectives breach. Omit or false = drift only. Automatic still 409s if the vault cannot execute.")
|
|
456
645
|
},
|
|
457
646
|
async (input) => {
|
|
458
647
|
try {
|
|
@@ -561,6 +750,95 @@ function registerRegistryTools(server, client) {
|
|
|
561
750
|
}
|
|
562
751
|
}
|
|
563
752
|
);
|
|
753
|
+
server.tool(
|
|
754
|
+
"aureon_confirm_objective_registry",
|
|
755
|
+
"Confirms an on-chain ObjectiveRegistry registration after the host wallet broadcast the prepare tx. Pass the transaction hash. The API verifies the receipt on chain and stores the registry link.",
|
|
756
|
+
{
|
|
757
|
+
objectiveId: z.string().describe("Objective id that was registered"),
|
|
758
|
+
transactionHash: z.string().describe("0x transaction hash from the wallet broadcast")
|
|
759
|
+
},
|
|
760
|
+
async ({ objectiveId, transactionHash }) => {
|
|
761
|
+
try {
|
|
762
|
+
return ok(await client.confirmObjectiveRegistry(objectiveId, transactionHash));
|
|
763
|
+
} catch (err) {
|
|
764
|
+
return fail(err);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
function registerSettlementTools(server, client) {
|
|
770
|
+
server.tool(
|
|
771
|
+
"aureon_get_execution_settlement",
|
|
772
|
+
"Returns the chain-verified settlement record for a vault execution when the listener has observed an on-chain Rebalanced event. Staged executions never have settlement records \u2014 do not claim on-chain proof without this.",
|
|
773
|
+
{
|
|
774
|
+
executionId: z.string().describe("Execution receipt id")
|
|
775
|
+
},
|
|
776
|
+
async ({ executionId }) => {
|
|
777
|
+
try {
|
|
778
|
+
return ok(await client.getExecutionSettlement(executionId));
|
|
779
|
+
} catch (err) {
|
|
780
|
+
return fail(err);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
server.tool(
|
|
785
|
+
"aureon_list_settlements",
|
|
786
|
+
"Lists settlement records for the authenticated wallet. May include orphans (observed vault Rebalanced events not yet bound to an execution). Optional objectiveId filter. Read status and executionId before claiming proof.",
|
|
787
|
+
{
|
|
788
|
+
objectiveId: z.string().optional().describe("Filter by objective id")
|
|
789
|
+
},
|
|
790
|
+
async ({ objectiveId }) => {
|
|
791
|
+
try {
|
|
792
|
+
return ok({ settlements: await client.listSettlements(objectiveId) });
|
|
793
|
+
} catch (err) {
|
|
794
|
+
return fail(err);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
);
|
|
798
|
+
server.tool(
|
|
799
|
+
"aureon_confirm_execution_settlement",
|
|
800
|
+
"Manual backfill: verify a vault Rebalanced transaction on chain and attach a settlement record to an execution. Use when the listener missed the event. Staged executions cannot be confirmed this way.",
|
|
801
|
+
{
|
|
802
|
+
executionId: z.string().describe("Execution receipt id"),
|
|
803
|
+
transactionHash: z.string().describe("0x vault Rebalanced transaction hash")
|
|
804
|
+
},
|
|
805
|
+
async ({ executionId, transactionHash }) => {
|
|
806
|
+
try {
|
|
807
|
+
return ok(await client.confirmExecutionSettlement(executionId, transactionHash));
|
|
808
|
+
} catch (err) {
|
|
809
|
+
return fail(err);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
function registerReceiptTools(server) {
|
|
815
|
+
server.tool(
|
|
816
|
+
"aureon_validate_receipt",
|
|
817
|
+
"Validates an execution receipt locally (schema + settlement honesty). No API call. Returns { valid, issues }. Do not trust or summarize a receipt as on-chain when validation fails.",
|
|
818
|
+
{
|
|
819
|
+
receipt: z.record(z.unknown()).describe("ExecutionReceipt JSON from restore, listExecutions, or API")
|
|
820
|
+
},
|
|
821
|
+
async ({ receipt }) => {
|
|
822
|
+
const result = validateExecutionReceipt(receipt);
|
|
823
|
+
return ok(result);
|
|
824
|
+
}
|
|
825
|
+
);
|
|
826
|
+
}
|
|
827
|
+
function registerAuditTrailTools(server, client) {
|
|
828
|
+
server.tool(
|
|
829
|
+
"aureon_get_audit_trail",
|
|
830
|
+
"Export the financial audit trail for one objective: registry, receipts, settlements, timeline. Missing proof is labeled. Never invent on-chain claims.",
|
|
831
|
+
{
|
|
832
|
+
objectiveId: z.string().describe("Objective id to export")
|
|
833
|
+
},
|
|
834
|
+
async ({ objectiveId }) => {
|
|
835
|
+
try {
|
|
836
|
+
return ok(await client.getAuditTrail(objectiveId));
|
|
837
|
+
} catch (err) {
|
|
838
|
+
return fail(err);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
);
|
|
564
842
|
}
|
|
565
843
|
|
|
566
844
|
// src/tools/index.ts
|
|
@@ -570,10 +848,18 @@ function registerTools(server, client, session) {
|
|
|
570
848
|
registerVaultTools(server, client);
|
|
571
849
|
registerAuthTools(server, client, session);
|
|
572
850
|
registerObjectiveTools(server, client);
|
|
851
|
+
registerIntentTools(server, client);
|
|
852
|
+
registerDriftRestoreTools(server, client);
|
|
853
|
+
registerReceiptVerificationTools(server, client);
|
|
854
|
+
registerPortfolioWatchTools(server, client);
|
|
855
|
+
registerFullAureonLoopTools(server, client);
|
|
573
856
|
registerPortfolioTools(server, client);
|
|
574
857
|
registerMarketTools(server, client);
|
|
575
858
|
registerDeveloperTools(server, client);
|
|
576
859
|
registerRegistryTools(server, client);
|
|
860
|
+
registerSettlementTools(server, client);
|
|
861
|
+
registerReceiptTools(server);
|
|
862
|
+
registerAuditTrailTools(server, client);
|
|
577
863
|
}
|
|
578
864
|
|
|
579
865
|
// src/server.ts
|