@panoptic-eng/mcp 0.1.1 → 0.1.3
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 +22 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +19 -10
- package/dist/index.js +1 -1
- package/dist/{server--YF2LHqv.js → server-CabyB7Fb.js} +821 -177
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,10 +40,15 @@ npx @panoptic-eng/mcp --rpc-url https://eth-mainnet.g.alchemy.com/v2/<key> --cha
|
|
|
40
40
|
|
|
41
41
|
Supported chains: Ethereum mainnet (`1`), Sepolia (`11155111`).
|
|
42
42
|
|
|
43
|
-
## v0 tools (read-only
|
|
43
|
+
## v0 tools (read-only)
|
|
44
|
+
|
|
45
|
+
All tools are read-only (they never build or send transactions). The one
|
|
46
|
+
exception to statelessness is `configure_session`, which mutates in-process
|
|
47
|
+
session preferences rather than reading the chain.
|
|
44
48
|
|
|
45
49
|
| Tool | What it does |
|
|
46
50
|
| --- | --- |
|
|
51
|
+
| `configure_session` | **Local session state — not an RPC read.** Set/read this session's preferences — notably the preferred delta reporting frame (`assetIndex`) — so delta tools don't re-ask which token to denominate net delta in. State lives in the server process for the session only. |
|
|
47
52
|
| `list_pools` | Known pool deployment + live pool state (tokens, tick, trackers, health). |
|
|
48
53
|
| `explain_position` | Decode a TokenId into readable legs + a strategy label (no RPC). |
|
|
49
54
|
| `identify_address` | Map an address to its role in a Panoptic deployment. |
|
|
@@ -57,6 +62,10 @@ Supported chains: Ethereum mainnet (`1`), Sepolia (`11155111`).
|
|
|
57
62
|
| `position_scenario` | Payoff / NLV curve — net liquidation value across a band of hypothetical prices. |
|
|
58
63
|
| `hedge_params` | SDK-native delta-hedge parameters (`getDeltaHedgeParams`) to reach a target delta; whole-portfolio or single-position. |
|
|
59
64
|
| `trade_history` | Chronological mints/burns from on-chain events (event-level only — no realized P&L). |
|
|
65
|
+
| `list_vaults` | Known HypoVault deployments: vaults, managers, accountant, underlying token, pool, trackers, and strategy labels. |
|
|
66
|
+
| `vault_summary` | Live HypoVault state: supply, manager/accountant, fees, epochs, reserved withdrawal assets, and current epoch totals. |
|
|
67
|
+
| `vault_account` | A user's HypoVault share balance, basis, queued deposit/withdrawal, redeposit flag, and executable epoch hints. |
|
|
68
|
+
| `vault_exposure` | Treat a HypoVault as the Panoptic account and return positions, collateral, greeks, and margin health. |
|
|
60
69
|
|
|
61
70
|
`get_portfolio`, `account_health`, `suggest_delta_hedge`, `advise_position`,
|
|
62
71
|
`preview_position`, `position_scenario`, and `hedge_params` discover positions
|
|
@@ -65,6 +74,18 @@ Pass `fromBlock` to bound the scan on chains with a distant deployment block.
|
|
|
65
74
|
These account tools need an RPC that permits `eth_getLogs`; many free public
|
|
66
75
|
endpoints throttle or block large log scans, so a private RPC is recommended.
|
|
67
76
|
|
|
77
|
+
An account's aggregate net delta is a single figure and must be denominated in
|
|
78
|
+
one token's units (its "reporting frame"). There is no canonical pool asset —
|
|
79
|
+
each position leg carries its own — so `suggest_delta_hedge` and `hedge_params`
|
|
80
|
+
(portfolio mode) resolve the frame as: explicit `assetIndex` argument → session
|
|
81
|
+
preference → **ask the user**. When neither is set they return a
|
|
82
|
+
`needs_asset_preference` prompt rather than silently guessing; call
|
|
83
|
+
`configure_session` with `assetIndex` to record the choice for the session.
|
|
84
|
+
|
|
85
|
+
HypoVault NAV/share-price reads are intentionally not exposed in v0 because
|
|
86
|
+
`totalAssets(bytes)` and `convertToAssets(uint256,bytes)` require
|
|
87
|
+
managerInput-aware accounting; use `vault_summary` for raw vault state.
|
|
88
|
+
|
|
68
89
|
Build + simulate tools (`build_position`, `build_strategy`, `simulate_tx`, …)
|
|
69
90
|
that return unsigned transaction envelopes are planned for a future release and
|
|
70
91
|
are **not** shipped yet. All numeric on-chain quantities are serialized as
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { SERVER_VERSION, createContext, createServer, resolveConfig } from "./server
|
|
2
|
+
import { SERVER_VERSION, createContext, createServer, resolveConfig } from "./server-CabyB7Fb.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
|
|
5
5
|
//#region src/cli.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -4,14 +4,10 @@ import { Address, Hex, PublicClient } from "viem";
|
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
|
|
6
6
|
//#region src/config.d.ts
|
|
7
|
-
|
|
8
|
-
/** Chain ids Panoptic has deployments for (mainnet, Base, Sepolia). */
|
|
9
|
-
declare const KNOWN_CHAIN_IDS: readonly [1, 8453, 11155111];
|
|
7
|
+
declare const KNOWN_CHAIN_IDS: readonly [1, 11155111];
|
|
10
8
|
/**
|
|
11
|
-
* Resolve an optional user-supplied chain-id string to a trusted
|
|
12
|
-
* constant, falling back to `fallback` when omitted/blank.
|
|
13
|
-
* decimal form only (never Number(), so "1e0" is rejected) and throws on
|
|
14
|
-
* unsupported ids.
|
|
9
|
+
* Resolve an optional user-supplied chain-id string to a trusted, deployed
|
|
10
|
+
* known-chain constant, falling back to `fallback` when omitted/blank.
|
|
15
11
|
*/
|
|
16
12
|
|
|
17
13
|
interface ServerConfig {
|
|
@@ -20,10 +16,25 @@ interface ServerConfig {
|
|
|
20
16
|
/** Optional indexer URL; enables enhanced analytics tools. */
|
|
21
17
|
subgraphUrl?: string;
|
|
22
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Mutable per-process session state. The stdio server runs for the lifetime of
|
|
21
|
+
* one agent session, so tools can record user preferences here (via
|
|
22
|
+
* `configure_session`) and later tools read them back. Nothing here is
|
|
23
|
+
* persisted across restarts.
|
|
24
|
+
*/
|
|
25
|
+
interface SessionState {
|
|
26
|
+
/**
|
|
27
|
+
* The user's preferred delta reporting frame for this session (0n = token0,
|
|
28
|
+
* 1n = token1). When set, delta tools report net delta in this frame instead
|
|
29
|
+
* of asking. There is no canonical pool asset — this is a user choice.
|
|
30
|
+
*/
|
|
31
|
+
preferredAssetIndex?: 0n | 1n;
|
|
32
|
+
}
|
|
23
33
|
interface PanopticContext {
|
|
24
34
|
config: ServerConfig;
|
|
25
35
|
client: PublicClient;
|
|
26
36
|
deployment: ChainDeployment;
|
|
37
|
+
session: SessionState;
|
|
27
38
|
}
|
|
28
39
|
/**
|
|
29
40
|
* Resolve server config from CLI flags (`--rpc-url`, `--chain-id`,
|
|
@@ -33,9 +44,7 @@ interface PanopticContext {
|
|
|
33
44
|
*/
|
|
34
45
|
declare function resolveConfig(argv: string[], env: NodeJS.ProcessEnv): ServerConfig;
|
|
35
46
|
/** Create the shared context (viem client + resolved deployment) for tools. */
|
|
36
|
-
declare function createContext(config: ServerConfig): Promise<PanopticContext>;
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
47
|
+
declare function createContext(config: ServerConfig): Promise<PanopticContext>; //#endregion
|
|
39
48
|
//#region src/serialize.d.ts
|
|
40
49
|
/**
|
|
41
50
|
* Recursively convert a value into a JSON-safe form. The only Panoptic-specific
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { KNOWN_CHAIN_IDS, SERVER_NAME, SERVER_VERSION, buildEnvelope, createContext, createServer, jsonResult, resolveConfig, toJsonSafe } from "./server
|
|
1
|
+
import { KNOWN_CHAIN_IDS, SERVER_NAME, SERVER_VERSION, buildEnvelope, createContext, createServer, jsonResult, resolveConfig, toJsonSafe } from "./server-CabyB7Fb.js";
|
|
2
2
|
|
|
3
3
|
export { KNOWN_CHAIN_IDS, SERVER_NAME, SERVER_VERSION, buildEnvelope, createContext, createServer, jsonResult, resolveConfig, toJsonSafe };
|