dexe-mcp 0.2.0 → 0.3.0
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/CHANGELOG.md +51 -0
- package/README.md +103 -80
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/addresses.js +1 -1
- package/dist/lib/ipfs.d.ts.map +1 -1
- package/dist/lib/ipfs.js +2 -1
- package/dist/lib/ipfs.js.map +1 -1
- package/dist/lib/markdownToSlate.d.ts +39 -0
- package/dist/lib/markdownToSlate.d.ts.map +1 -0
- package/dist/lib/markdownToSlate.js +203 -0
- package/dist/lib/markdownToSlate.js.map +1 -0
- package/dist/lib/signer.d.ts +12 -0
- package/dist/lib/signer.d.ts.map +1 -0
- package/dist/lib/signer.js +31 -0
- package/dist/lib/signer.js.map +1 -0
- package/dist/lib/subgraph.d.ts +2 -2
- package/dist/lib/subgraph.d.ts.map +1 -1
- package/dist/lib/subgraph.js +14 -9
- package/dist/lib/subgraph.js.map +1 -1
- package/dist/tools/daoDeploy.d.ts.map +1 -1
- package/dist/tools/daoDeploy.js +313 -63
- package/dist/tools/daoDeploy.js.map +1 -1
- package/dist/tools/flow.d.ts +5 -0
- package/dist/tools/flow.d.ts.map +1 -0
- package/dist/tools/flow.js +451 -0
- package/dist/tools/flow.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/ipfs.d.ts.map +1 -1
- package/dist/tools/ipfs.js +94 -28
- package/dist/tools/ipfs.js.map +1 -1
- package/dist/tools/proposal.js +28 -10
- package/dist/tools/proposal.js.map +1 -1
- package/dist/tools/proposalBuild.d.ts.map +1 -1
- package/dist/tools/proposalBuild.js +28 -13
- package/dist/tools/proposalBuild.js.map +1 -1
- package/dist/tools/proposalBuildComplex.d.ts.map +1 -1
- package/dist/tools/proposalBuildComplex.js +147 -81
- package/dist/tools/proposalBuildComplex.js.map +1 -1
- package/dist/tools/proposalBuildInternal.js +24 -11
- package/dist/tools/proposalBuildInternal.js.map +1 -1
- package/dist/tools/proposalBuildMore.js +42 -21
- package/dist/tools/proposalBuildMore.js.map +1 -1
- package/dist/tools/proposalBuildOffchain.d.ts.map +1 -1
- package/dist/tools/proposalBuildOffchain.js +8 -5
- package/dist/tools/proposalBuildOffchain.js.map +1 -1
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +227 -0
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/subgraph.d.ts +4 -0
- package/dist/tools/subgraph.d.ts.map +1 -0
- package/dist/tools/subgraph.js +404 -0
- package/dist/tools/subgraph.js.map +1 -0
- package/dist/tools/txSend.d.ts +5 -0
- package/dist/tools/txSend.d.ts.map +1 -0
- package/dist/tools/txSend.js +87 -0
- package/dist/tools/txSend.js.map +1 -0
- package/dist/tools/voteBuild.d.ts.map +1 -1
- package/dist/tools/voteBuild.js +420 -0
- package/dist/tools/voteBuild.js.map +1 -1
- package/package.json +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
End-to-end testnet validation. Every proposal-builder tool is now exercised by an automated swarm scenario on BSC testnet, and the harness itself ships in-repo so external integrators can run it. **111 tools** total, **41 swarm scenarios**, full sweep green.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
**Swarm test harness (`tests/swarm/` + `scripts/swarm/`)**
|
|
10
|
+
- `scripts/swarm/orchestrator.ts` — scenario loader + dispatcher. Inline ethers dispatchers for the no-IPFS toolset (vote_user_power, read_delegation_map, build_undelegate, build_withdraw, build_withdraw_all, build_erc20_approve, build_deposit, build_delegate, build_vote). Generic MCP-stdio fallback (`mcpFallbackDispatcher`) routes anything else through the dexe-mcp child server, so adding a scenario for a new tool is JSON-only — no code changes.
|
|
11
|
+
- Loop expansion (`spec.loop.over` × `appliesToSteps`), template engine (`{{dao}}`, `{{firstAllowlistedToken}}`, `{{firstAllowlistedDao}}`, `{{secondAllowlistedDao}}`, `{{dao.<helper>}}`, `{{agent:X:address}}`, `{{capture.path}}`, `{{capture.0.field}}`), `skipIf` evaluator with limited expressions, deferred-cascade for chained captures, wallet semaphore for parallel-safe broadcasts, per-scenario `prefund` hook that tops up agents from `AGENT_FUNDER_PK` before each scenario runs.
|
|
12
|
+
- `scripts/swarm/preflight.ts` + `scripts/swarm/fund-pool.ts` — wallet-readiness check + token allowlist–enforced top-up. Hard-refuses to send to any non-pool address or any token not on the allowlist.
|
|
13
|
+
- `scripts/swarm/nightly.sh` — Phase 5 cron runner. Pulls main, runs preflight + full sweep, tails the run report, posts the one-line summary to `SWARM_SUMMARY_WEBHOOK` and/or `SWARM_SUMMARY_ISSUE` (gh CLI), runs a triage stub on failure (with `SWARM_FIXER=1` opt-in for auto-fix), and rotates run-report dirs older than 30 days while keeping the latest 50.
|
|
14
|
+
- `scripts/swarm/orchestrator.ts` emits a single greppable summary line after `writeReport`: `SWARM <runId> <pass>/<total> <mode> <chainTag> <reportPath>` — consumed by nightly.sh and any external poster.
|
|
15
|
+
- `scripts/swarm/one-shot-execute.mjs` — closes a proposal lifecycle once it reaches `SucceededFor`. Polls + caps `wait()` at 90 s to avoid sandbox hangs.
|
|
16
|
+
- 41 scenario JSONs covering: reset, delegation chain, validator pass / veto / full lifecycle, expert / participation / staking / validator / catalog / cross-DAO / multi-proposal-state read snapshots, cancel-vote, decode-and-introspect, build-only sanity for every external + internal proposal type from `dexe_proposal_catalog`.
|
|
17
|
+
- Role prompts: `proposer`, `voter`, `delegator`, `reporter`, `triage`, `validator`, `expert`, `fixer`, plus `_shared.md` and the dao-personas fixture. Fixer prompt encodes the CLAUDE.md auto-fix loop verbatim — branch `swarm-fix/<YYYY-MM-DD>`, never push to main, diff scope hard-bounded to `src/tools/`, `src/lib/`, `tests/swarm/`.
|
|
18
|
+
|
|
19
|
+
**Composite + signing tools**
|
|
20
|
+
- `dexe_proposal_create` — full prerequisite handling: balance check, ERC20 approve, deposit, IPFS metadata upload, `createProposalAndVote`. When `DEXE_PRIVATE_KEY` is set the tool signs and broadcasts; otherwise returns the ordered `TxPayload` list. Supports `proposalType: 'modify_dao_profile' | 'custom'`.
|
|
21
|
+
- `dexe_proposal_vote_and_execute` — vote-then-execute composite with `autoExecute` + `depositFirst` flags.
|
|
22
|
+
- `dexe_tx_send` + `dexe_tx_status` — opt-in signer surface that uses the configured `DEXE_PRIVATE_KEY` when present. Calls remain calldata-by-default; users opt in by setting the env var.
|
|
23
|
+
- `dexe_dao_build_deploy` predicted-address auto-wiring: `govToken` flowed into `userKeeperParams.tokenAddress` and `distributionProposal` + `govTokenSale` into `additionalProposalExecutors` automatically. LINEAR / POLYNOMIAL `votePower` initData auto-encoded.
|
|
24
|
+
|
|
25
|
+
**Reads + introspection**
|
|
26
|
+
- `dexe_read_dao_list`, `_dao_members`, `_dao_experts`, `_user_activity`, `_distribution_status`, `_token_sale_tiers`, `_token_sale_user`, `_staking_info`, `_validator_list`, `_privacy_policy_status`, `_delegation_map` — fill out the DAO read surface.
|
|
27
|
+
- `dexe_get_methods` returns structured per-function metadata (4-byte selectors, mutability, full structured inputs/outputs with `internalType` preserved for tuples).
|
|
28
|
+
- `dexe_proposal_voters` switched to the `pools` subgraph and the proposalInteractions composite ID format (poolAddr + uint32LE(proposalId), no separator).
|
|
29
|
+
- `dexe_decode_proposal` understands every external + internal proposal action shape.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **Proposal metadata format**: builders now emit `proposalName` / `proposalDescription` (not `name` / `description`), wrap diffs inside `changes: { proposedChanges, currentChanges }`, set `isMeta: false`, and round-trip identical to the frontend reference. 17 builders touched.
|
|
34
|
+
- **Approve target for deposits** is `UserKeeper`, not `GovPool`. Both flow tools (`proposal_create`, `vote_and_execute`) now approve the right address.
|
|
35
|
+
- **Personal voting power** = `tokenBalance.balance − ownedBalance` (deposited only). Without this, `withdraw` on freshly-funded agents reverts `GovUK: can't withdraw this`.
|
|
36
|
+
- **VotePower initData** uses `__LinearPower_init()` selector `0x892aea1f` (not empty `0x`) so newly-deployed DAOs initialize their LINEAR vote-power proxy correctly.
|
|
37
|
+
- **`STATE_NAMES` enum order** corrected (Defeated / Locked positions were swapped).
|
|
38
|
+
- **Custom-proposal IPFS metadata** now includes `category`, `isMeta`, `proposedChanges`, `currentChanges`.
|
|
39
|
+
- **Subgraph migration**: Studio URLs deprecated; switched to The Graph decentralized network with API key. Per-chain endpoints documented.
|
|
40
|
+
- **IPFS gateway path normalization**: dedicated gateways configured with a trailing `/ipfs` (e.g. `https://<sub>.mypinata.cloud/ipfs`) no longer produce `/ipfs/ipfs/<cid>` 404s.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- README updated: tool count `83 → 111`, new "Swarm test harness" section.
|
|
45
|
+
- `process.loadEnvFile()` is invoked from `index.ts` so the MCP server loads `.env` itself; users no longer have to plumb env-var changes through their MCP client config (which often doesn't reload).
|
|
46
|
+
- Repo now ships `.claude/skills/swarm-test/SKILL.md` for users running Claude Code; lets them invoke the swarm with `/swarm-test`.
|
|
47
|
+
|
|
48
|
+
### Notes
|
|
49
|
+
|
|
50
|
+
- **Validated network**: BSC testnet (chain 97). Two fixture DAOs deployed for the harness — Glacier (50% quorum, no validators) and Sentinel (5% quorum, 2 validators with 1k SVT each).
|
|
51
|
+
- **Mainnet status**: a separate run pass is staged (Stage B per `tests/swarm/README.md`) but blocked on a previously-observed `PoolFactory.deployGovPool` revert. Re-validate when the protocol team confirms a fix.
|
|
52
|
+
- **Off-chain backend tools** require `DEXE_BACKEND_API_URL` and only run on chains where DeXe operates a backend. The corresponding swarm scenarios declare `requiresChain: [56]` so they auto-skip on testnet.
|
|
53
|
+
|
|
3
54
|
## 0.2.0
|
|
4
55
|
|
|
5
56
|
The big one — dexe-mcp expands from 15 dev-tooling tools to **83 tools** covering the full DeXe DAO lifecycle. AI agents can now create DAOs, build any of the 33 proposal types the DeXe frontend exposes, upload metadata to IPFS, stake/delegate/vote/execute/claim — all end-to-end.
|
package/README.md
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
MCP server that gives AI agents **full DeXe Protocol DAO operations coverage** — deploy DAOs, build any of the 33 proposal types the DeXe UI exposes, upload metadata to IPFS, stake/delegate/vote/execute/claim. Plus dev tooling: build/test/lint, contract introspection, ABI-aware calldata decoding.
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**Two write modes, calldata-default.** Every write tool returns a ready-to-sign `TxPayload = { to, data, value, chainId, description }` that the agent's wallet (MetaMask, Safe, hardware, etc.) signs and submits — no key in the MCP. Power users who *want* the server to sign and broadcast can opt in by setting `DEXE_PRIVATE_KEY`; that unlocks `dexe_tx_send`, `dexe_tx_status`, and the auto-broadcast branch of `dexe_proposal_create` / `dexe_proposal_vote_and_execute`. Default stays calldata-only.
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**111 tools** across 9 groups. Call `dexe_proposal_catalog` at runtime for the full proposal-type map, or browse the [catalog](#tool-catalog) below.
|
|
10
|
+
|
|
11
|
+
> **End-to-end coverage.** Every proposal-builder tool ships with a swarm-test scenario that exercises it on BSC testnet. Latest pass: **41/41 scenarios green**, ~200 broadcasts validated against two fixture DAOs (Glacier 50%-quorum + Sentinel 5%-quorum-with-validators). See [Swarm test harness](#swarm-test-harness) below.
|
|
10
12
|
|
|
11
13
|
## Prerequisites
|
|
12
14
|
|
|
@@ -46,6 +48,44 @@ If your client can't spawn the bare `dexe-mcp` command directly (a known issue w
|
|
|
46
48
|
|
|
47
49
|
Run `npm root -g` to resolve the path on your machine. Restart the MCP client and the `dexe_*` tools will appear.
|
|
48
50
|
|
|
51
|
+
## Quickstart
|
|
52
|
+
|
|
53
|
+
Minimum config to get **read-only** access to a BSC mainnet DAO:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"dexe": {
|
|
59
|
+
"command": "dexe-mcp",
|
|
60
|
+
"env": {
|
|
61
|
+
"DEXE_RPC_URL": "https://bsc-dataseed.binance.org",
|
|
62
|
+
"DEXE_CHAIN_ID": "56"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Add `DEXE_PINATA_JWT` for IPFS uploads, `DEXE_BACKEND_API_URL` for off-chain proposals, and per-chain subgraph URLs for `dexe_proposal_voters` and the DAO-list reads. Full matrix → [`docs/ENVIRONMENT.md`](./docs/ENVIRONMENT.md).
|
|
70
|
+
|
|
71
|
+
Three first-call examples (full set in [`docs/USAGE.md`](./docs/USAGE.md)):
|
|
72
|
+
|
|
73
|
+
```jsonc
|
|
74
|
+
// 1) discover available proposal types
|
|
75
|
+
dexe_proposal_catalog({ category: "all", implementedOnly: true })
|
|
76
|
+
|
|
77
|
+
// 2) read a DAO
|
|
78
|
+
dexe_dao_info({ govPool: "0x..." })
|
|
79
|
+
|
|
80
|
+
// 3) build a token-transfer proposal (calldata only)
|
|
81
|
+
dexe_proposal_build_token_transfer({
|
|
82
|
+
govPool: "0x...",
|
|
83
|
+
token: "0x...",
|
|
84
|
+
recipient: "0x...",
|
|
85
|
+
amount: "1000000000000000000"
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
49
89
|
## First run
|
|
50
90
|
|
|
51
91
|
The MCP server starts instantly. On the first build-tool call (`dexe_compile` / `dexe_test` / `dexe_lint`), dexe-mcp will automatically shallow-clone DeXe-Protocol into a platform cache directory and run `npm install` there once. If you prefer to reuse an existing checkout, set `DEXE_PROTOCOL_PATH` in the MCP `env` block and nothing will be cloned.
|
|
@@ -54,7 +94,7 @@ Most tools don't need the protocol checkout at all — read/proposal/vote/deploy
|
|
|
54
94
|
|
|
55
95
|
## Environment variables
|
|
56
96
|
|
|
57
|
-
All optional. Tools that need a missing variable fail with a clear message pointing at exactly what to set.
|
|
97
|
+
All optional. Tools that need a missing variable fail with a clear message pointing at exactly what to set. Full matrix + per-tool requirements → [`docs/ENVIRONMENT.md`](./docs/ENVIRONMENT.md).
|
|
58
98
|
|
|
59
99
|
| Variable | Required for | Purpose |
|
|
60
100
|
|----------|--------------|---------|
|
|
@@ -69,85 +109,68 @@ All optional. Tools that need a missing variable fail with a clear message point
|
|
|
69
109
|
| `DEXE_SUBGRAPH_POOLS_URL`, `DEXE_SUBGRAPH_VALIDATORS_URL` | reserved | Additional subgraph endpoints for future tools |
|
|
70
110
|
| `DEXE_BACKEND_API_URL` | off-chain proposals | DeXe backend (e.g. `https://api.dexe.io`) |
|
|
71
111
|
|
|
72
|
-
##
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
112
|
+
## Documentation
|
|
113
|
+
|
|
114
|
+
Full docs in [`docs/`](./docs):
|
|
115
|
+
|
|
116
|
+
- [`docs/TOOLS.md`](./docs/TOOLS.md) — complete catalog of all 111 tools, organized by category, with one-line descriptions and required envs per tool.
|
|
117
|
+
- [`docs/USAGE.md`](./docs/USAGE.md) — 10 worked examples (deploy DAO, create proposals, vote, delegate, validator chamber, decode calldata, off-chain proposals, multicall batching). Copy-pasteable JSON.
|
|
118
|
+
- [`docs/ENVIRONMENT.md`](./docs/ENVIRONMENT.md) — full env-var reference: minimum block to get started, per-category requirements, calldata vs signer mode, chain-specific config, IPFS gateway rationale, subgraph migration, swarm harness envs, common pitfalls.
|
|
119
|
+
|
|
120
|
+
## Tool surface (high-level)
|
|
121
|
+
|
|
122
|
+
| Group | Tools | What |
|
|
123
|
+
|-------|-------|------|
|
|
124
|
+
| Dev tooling | 4 | Hardhat wrappers: `dexe_compile`, `_test`, `_coverage`, `_lint` |
|
|
125
|
+
| Contract introspection | 10 | `_list_contracts`, `_get_abi`, `_get_methods`, `_get_selectors`, `_find_selector`, `_get_natspec`, `_get_source`, `_decode_calldata`, `_decode_proposal`, `_list_gov_contract_types` |
|
|
126
|
+
| DAO reads | 25 | `_dao_info`, `_dao_predict_addresses`, `_dao_registry_lookup`, `_proposal_state/_list/_voters`, `_vote_user_power/_get_votes`, `_read_*` family |
|
|
127
|
+
| IPFS | 6 | Pinata uploads, gateway fetch, CID computation |
|
|
128
|
+
| DAO deploy | 1 | `dexe_dao_build_deploy` (encodes `PoolFactory.deployGovPool` with full nested struct + predicted addr wiring) |
|
|
129
|
+
| Proposal catalog + primitives | 5 | `dexe_proposal_catalog` enumerates **all 33** types; primitives: `_build_external`, `_build_internal`, `_build_custom_abi`, `_build_offchain` |
|
|
130
|
+
| External proposal wrappers | 18 | Token transfer / distribution / sale, treasury withdraw, validators, experts, staking tier, math model, blacklist, reward multiplier, apply to DAO, modify profile, change voting settings, new proposal type, etc. |
|
|
131
|
+
| Internal validator wrappers | 4 | `_change_validator_balances`, `_change_validator_settings`, `_monthly_withdraw`, `_offchain_internal_proposal` |
|
|
132
|
+
| Off-chain backend | 8 | `_offchain_single_option/_multi_option/_for_against/_settings`, auth flow (`_auth_request_nonce`, `_auth_login_request`), `_offchain_build_vote/_cancel_vote` |
|
|
133
|
+
| Vote / stake / delegate / execute / claim | 16 | `_vote_build_*` family — every direct EOA write on GovPool / Validators |
|
|
134
|
+
| Composite signing flows | 4 | `_proposal_create`, `_proposal_vote_and_execute`, `_tx_send`, `_tx_status` (all opt-in via `DEXE_PRIVATE_KEY`) |
|
|
135
|
+
| Subgraph reads | 6 | DAO list, members, experts, user activity, delegation map, distribution status (decentralized network endpoints) |
|
|
136
|
+
|
|
137
|
+
Total: **~111**. Per-tool descriptions, args, return shapes → [`docs/TOOLS.md`](./docs/TOOLS.md).
|
|
138
|
+
|
|
139
|
+
## Swarm test harness
|
|
140
|
+
|
|
141
|
+
`tests/swarm/` is a multi-agent DAO testing harness that exercises every dexe-mcp
|
|
142
|
+
tool against real BSC-testnet DAOs. Scenarios are JSON specs; the orchestrator
|
|
143
|
+
loads them, resolves agent wallets, and runs each step through either an inline
|
|
144
|
+
ethers dispatcher or the dexe-mcp stdio bridge.
|
|
145
|
+
|
|
146
|
+
**41 scenarios shipped** covering:
|
|
147
|
+
|
|
148
|
+
- Reset + delegation chains (S00, S01, S06, S14)
|
|
149
|
+
- Validator chamber pass / veto / full lifecycle (S02, S03, S07)
|
|
150
|
+
- Read-only snapshots: expert state, participation, validators, cross-DAO,
|
|
151
|
+
catalog, multi-proposal state, user activity (S04, S05, S09, S10, S11, S13, S15)
|
|
152
|
+
- Cancel-vote, decode-and-introspect (S08, S12)
|
|
153
|
+
- Build-only sanity for every proposal type in `dexe_proposal_catalog`
|
|
154
|
+
(token transfer, blacklist, withdraw treasury, apply to dao, token
|
|
155
|
+
distribution, token sale + recover, manage validators, change validator
|
|
156
|
+
balances/settings, monthly withdraw, add/remove expert (local + global),
|
|
157
|
+
delegate/revoke from expert, reward multiplier (4 modes), change voting
|
|
158
|
+
settings, new proposal type, change math model, custom ABI, manual calldata,
|
|
159
|
+
create staking tier, off-chain validator + for/against + settings) (S16–S40)
|
|
81
160
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| `dexe_read_multicall` | Generic Multicall3 batched `eth_call` |
|
|
92
|
-
| `dexe_read_treasury`, `dexe_read_validators`, `dexe_read_settings`, `dexe_read_expert_status` | Canned live reads |
|
|
93
|
-
| `dexe_read_gov_state` | Aggregate gov-pool state (legacy helper) |
|
|
94
|
-
|
|
95
|
-
### IPFS
|
|
96
|
-
|
|
97
|
-
| Tool | Description |
|
|
98
|
-
|------|-------------|
|
|
99
|
-
| `dexe_ipfs_upload_proposal_metadata`, `dexe_ipfs_upload_dao_metadata`, `dexe_ipfs_upload_file` | Pinata uploads (requires `DEXE_PINATA_JWT`) |
|
|
100
|
-
| `dexe_ipfs_fetch` | Fetch by CID via configured dedicated gateway |
|
|
101
|
-
| `dexe_ipfs_cid_info` | Parse CID + v0↔v1 conversion + gateway URLs |
|
|
102
|
-
| `dexe_ipfs_cid_for_json` | Compute CIDv1 locally (no network) for dry-run flows |
|
|
103
|
-
|
|
104
|
-
### DAO deploy
|
|
105
|
-
|
|
106
|
-
| Tool | Description |
|
|
107
|
-
|------|-------------|
|
|
108
|
-
| `dexe_dao_build_deploy` | Encode `PoolFactory.deployGovPool(GovPoolDeployParams)` with full nested-struct input (settings / validators / userKeeper / token / votePower / verifier / BABT flag / descriptionURL / name). Auto-resolves PoolFactory via registry; optionally returns the predicted GovPool address |
|
|
109
|
-
|
|
110
|
-
### Proposals — primitives + catalog
|
|
111
|
-
|
|
112
|
-
| Tool | Description |
|
|
113
|
-
|------|-------------|
|
|
114
|
-
| `dexe_proposal_catalog` | Enumerate **all 33** proposal types with schemas, gating, metadata shape, and the MCP tool that handles each |
|
|
115
|
-
| `dexe_proposal_build_external` | Raw `GovPool.createProposal(url, actionsFor, actionsAgainst)` (+ `createProposalAndVote` variant) |
|
|
116
|
-
| `dexe_proposal_build_internal` | Raw `GovValidators.createInternalProposal(type, url, data)` |
|
|
117
|
-
| `dexe_proposal_build_custom_abi` | Encode any ABI call → one `ProposalAction` |
|
|
118
|
-
| `dexe_proposal_build_offchain` | Generic DeXe backend HTTP request builder |
|
|
119
|
-
|
|
120
|
-
### Proposal wrappers — external (on-chain)
|
|
121
|
-
|
|
122
|
-
Each returns `{ metadata, actions[] }` — upload the metadata via `dexe_ipfs_upload_proposal_metadata`, then feed actions into `dexe_proposal_build_external`:
|
|
123
|
-
|
|
124
|
-
`dexe_proposal_build_token_transfer`, `_token_distribution`, `_token_sale`, `_token_sale_recover`, `_change_voting_settings`, `_manage_validators`, `_add_expert`, `_remove_expert`, `_withdraw_treasury`, `_delegate_to_expert`, `_revoke_from_expert`, `_create_staking_tier`, `_change_math_model`, `_modify_dao_profile`, `_blacklist`, `_reward_multiplier`, `_apply_to_dao`, `_new_proposal_type` (also covers *Enable Staking*).
|
|
125
|
-
|
|
126
|
-
### Proposal wrappers — internal validator
|
|
127
|
-
|
|
128
|
-
Return `{ metadata, proposalType, data }` — compose with `dexe_proposal_build_internal`:
|
|
129
|
-
|
|
130
|
-
`dexe_proposal_build_change_validator_balances` (type 0), `_change_validator_settings` (type 1), `_monthly_withdraw` (type 2), `_offchain_internal_proposal` (type 3).
|
|
131
|
-
|
|
132
|
-
### Proposal wrappers — off-chain (DeXe backend)
|
|
133
|
-
|
|
134
|
-
`dexe_proposal_build_offchain_single_option`, `_offchain_multi_option`, `_offchain_for_against`, `_offchain_settings`.
|
|
135
|
-
|
|
136
|
-
Plus auth + vote helpers: `dexe_auth_request_nonce`, `dexe_auth_login_request`, `dexe_offchain_build_vote`, `dexe_offchain_build_cancel_vote`.
|
|
137
|
-
|
|
138
|
-
### Vote / stake / execute / claim (direct EOA writes)
|
|
161
|
+
```bash
|
|
162
|
+
# 1) generate 9 wallets (8 agents + funder), fund the funder from your wallet
|
|
163
|
+
# 2) deploy fixture DAOs via dexe_dao_build_deploy (one 50% quorum + one with validators)
|
|
164
|
+
# 3) configure SWARM_DAOS_TESTNET / SWARM_TOKENS_TESTNET / SWARM_RPC_URL_TESTNET
|
|
165
|
+
npm run swarm:preflight # red/green table per wallet
|
|
166
|
+
npm run swarm:fund -- --confirm # broadcast top-ups from funder
|
|
167
|
+
npm run swarm:run # full sweep, all scenarios
|
|
168
|
+
npm run swarm:run -- --scenarios=S00-reset,S01-delegation-chain-3hop --dry-run
|
|
169
|
+
```
|
|
139
170
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
| `dexe_vote_build_deposit` | `GovPool.deposit(amount, nftIds)` — payable for native-coin DAOs |
|
|
144
|
-
| `dexe_vote_build_withdraw` | `GovPool.withdraw(receiver, amount, nftIds)` |
|
|
145
|
-
| `dexe_vote_build_delegate`, `_undelegate` | User-level delegation on `GovPool` |
|
|
146
|
-
| `dexe_vote_build_vote`, `_cancel_vote` | `GovPool.vote(pid, isFor, amount, nftIds)` / `cancelVote` |
|
|
147
|
-
| `dexe_vote_build_validator_vote`, `_validator_cancel_vote` | Validator voting (internal/external scope) |
|
|
148
|
-
| `dexe_vote_build_move_to_validators`, `_execute` | Proposal lifecycle |
|
|
149
|
-
| `dexe_vote_build_claim_rewards`, `_claim_micropool_rewards` | Reward claiming |
|
|
150
|
-
| `dexe_vote_build_multicall` | Atomic `GovPool.multicall(bytes[])` — batch any of the above into one tx |
|
|
171
|
+
Setup runbook: [`tests/swarm/README.md`](tests/swarm/README.md).
|
|
172
|
+
Scenario schema: [`tests/swarm/scenarios/_schema.md`](tests/swarm/scenarios/_schema.md).
|
|
173
|
+
Per-role agent prompts: `tests/swarm/prompts/`.
|
|
151
174
|
|
|
152
175
|
## Contributing
|
|
153
176
|
|
package/dist/config.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface DexeConfig {
|
|
|
15
15
|
subgraphInteractionsUrl?: string;
|
|
16
16
|
/** Optional fork block pin (Phase B). */
|
|
17
17
|
forkBlock?: number;
|
|
18
|
+
/** Private key for tx signing. When set, `dexe_tx_send` can broadcast. */
|
|
19
|
+
privateKey?: string;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Reads environment and returns a frozen config. **Fast and side-effect-free**
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,CAgEtD"}
|
package/dist/config.js
CHANGED
|
@@ -32,6 +32,15 @@ export async function loadConfig() {
|
|
|
32
32
|
const subgraphPoolsUrl = process.env.DEXE_SUBGRAPH_POOLS_URL?.trim() || undefined;
|
|
33
33
|
const subgraphValidatorsUrl = process.env.DEXE_SUBGRAPH_VALIDATORS_URL?.trim() || undefined;
|
|
34
34
|
const subgraphInteractionsUrl = process.env.DEXE_SUBGRAPH_INTERACTIONS_URL?.trim() || undefined;
|
|
35
|
+
const privateKey = process.env.DEXE_PRIVATE_KEY?.trim() || undefined;
|
|
36
|
+
if (privateKey && !rpcUrl) {
|
|
37
|
+
fatal("DEXE_PRIVATE_KEY requires DEXE_RPC_URL to be set (signing needs an RPC endpoint).");
|
|
38
|
+
}
|
|
39
|
+
if (privateKey) {
|
|
40
|
+
const { Wallet } = await import("ethers");
|
|
41
|
+
const addr = new Wallet(privateKey).address;
|
|
42
|
+
process.stderr.write(`[dexe-mcp] signing enabled for ${addr}\n`);
|
|
43
|
+
}
|
|
35
44
|
let forkBlock;
|
|
36
45
|
if (process.env.DEXE_FORK_BLOCK) {
|
|
37
46
|
const n = Number(process.env.DEXE_FORK_BLOCK);
|
|
@@ -50,6 +59,7 @@ export async function loadConfig() {
|
|
|
50
59
|
subgraphValidatorsUrl,
|
|
51
60
|
subgraphInteractionsUrl,
|
|
52
61
|
forkBlock,
|
|
62
|
+
privateKey,
|
|
53
63
|
});
|
|
54
64
|
}
|
|
55
65
|
function fatal(msg) {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAuBnE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,YAAY,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAEpD,0EAA0E;IAC1E,0EAA0E;I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index.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { resolve, dirname } from "node:path";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
7
|
import { loadConfig } from "./config.js";
|
|
5
8
|
import { registerAll } from "./tools/index.js";
|
|
9
|
+
// Load .env from project root if present — ensures env vars reach the process
|
|
10
|
+
// regardless of how the MCP host launches us (Claude Code drops most env vars
|
|
11
|
+
// from its settings.json "env" block on Windows).
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const dotenvPath = resolve(__dirname, "..", ".env");
|
|
14
|
+
if (existsSync(dotenvPath)) {
|
|
15
|
+
try {
|
|
16
|
+
process.loadEnvFile(dotenvPath);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// Node < 21.7 or other issue — fall through to process.env as-is
|
|
20
|
+
}
|
|
21
|
+
}
|
|
6
22
|
async function main() {
|
|
7
23
|
const config = await loadConfig();
|
|
8
24
|
const server = new McpServer({ name: "dexe-mcp", version: "0.1.5" }, {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAElC,MAAM,MAAM,GAAG,IAAI,SAA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C,GAAG,IAAI,CAAC,CAAC;IAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/lib/addresses.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Contract, ZeroAddress } from "ethers";
|
|
|
9
9
|
* frontend env. Add more chains as they come online.
|
|
10
10
|
*/
|
|
11
11
|
export const CONTRACTS_REGISTRY_BY_CHAIN = {
|
|
12
|
-
56: "
|
|
12
|
+
56: "0x46B46629B674b4C0b48B111DEeB0eAfd9F84A1c0",
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Canonical contract names used as keys inside `ContractsRegistry`. Mirrors
|
package/dist/lib/ipfs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipfs.d.ts","sourceRoot":"","sources":["../../src/lib/ipfs.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAO,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,gEAAgE;IAChE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"ipfs.d.ts","sourceRoot":"","sources":["../../src/lib/ipfs.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eA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,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,MAAM;IAIxC,4DAA4D;IACtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAOrB,OAAO,CACX,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAC3D,OAAO,CAAC,eAAe,CAAC;IA0BrB,OAAO,CACX,KAAK,EAAE,UAAU,EACjB,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAChE,OAAO,CAAC,eAAe,CAAC;CAwB5B"}
|
package/dist/lib/ipfs.js
CHANGED
|
@@ -21,7 +21,8 @@ export async function fetchIpfs(cid, cfg) {
|
|
|
21
21
|
let attempts = 0;
|
|
22
22
|
for (const gw of cfg.gateways) {
|
|
23
23
|
attempts++;
|
|
24
|
-
const
|
|
24
|
+
const base = gw.replace(/\/+$/, "").replace(/\/ipfs$/, "");
|
|
25
|
+
const url = `${base}/ipfs/${cidStr}`;
|
|
25
26
|
const controller = new AbortController();
|
|
26
27
|
const t = setTimeout(() => controller.abort(), timeout);
|
|
27
28
|
try {
|
package/dist/lib/ipfs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipfs.js","sourceRoot":"","sources":["../../src/lib/ipfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,0BAA0B,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACn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AAE,UAAU,IAAI,CAAC,GAAG,EAAE,EAAE;YAChD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAI7B,CAAC;QACF,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a Markdown string to the Slate node format used by the DeXe
|
|
3
|
+
* investing-dashboard frontend.
|
|
4
|
+
*
|
|
5
|
+
* Uses `unified` + `remark-parse` + `remark-slate-transformer` with overrides
|
|
6
|
+
* that map remark's default node types to the frontend's ELEMENT_TYPES enum:
|
|
7
|
+
*
|
|
8
|
+
* Remark default → Frontend Slate type
|
|
9
|
+
* ─────────────────────────────────────────────
|
|
10
|
+
* heading depth=1 → "heading-one"
|
|
11
|
+
* heading depth=2 → "heading-two"
|
|
12
|
+
* heading depth=3 → "heading-three"
|
|
13
|
+
* paragraph → "paragraph" (same)
|
|
14
|
+
* list ordered=false → "bulleted-list"
|
|
15
|
+
* list ordered=true → "numbered-list"
|
|
16
|
+
* listItem → "list-item"
|
|
17
|
+
* code → "code-block"
|
|
18
|
+
* link → "link"
|
|
19
|
+
* image → "image"
|
|
20
|
+
* delete → "strikethrough" (~~text~~)
|
|
21
|
+
*
|
|
22
|
+
* Text marks:
|
|
23
|
+
* strong → { bold: true }
|
|
24
|
+
* emphasis → { italic: true }
|
|
25
|
+
* inlineCode → wrapped in code-inline element
|
|
26
|
+
* delete → { strikethrough: true }
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Convert a Markdown string to a Slate `SlateDescendant[]` array compatible
|
|
30
|
+
* with the DeXe investing-dashboard frontend.
|
|
31
|
+
*
|
|
32
|
+
* - Empty / whitespace-only input → default empty paragraph node
|
|
33
|
+
* - Plain text (no markdown syntax) → paragraph nodes split by newline
|
|
34
|
+
* - Rich markdown → full Slate tree with headings, lists, bold, etc.
|
|
35
|
+
*
|
|
36
|
+
* This function is synchronous (`processSync`).
|
|
37
|
+
*/
|
|
38
|
+
export declare function markdownToSlate(markdown: string): unknown[];
|
|
39
|
+
//# sourceMappingURL=markdownToSlate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownToSlate.d.ts","sourceRoot":"","sources":["../../src/lib/markdownToSlate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA6IH;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAuB3D"}
|