@demath-ai/cli 0.1.0 → 0.1.2
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 +89 -66
- package/SKILL.md +1 -1
- package/dist/cli.cjs +9 -10
- package/dist/cli.js +9 -10
- package/dist/index.cjs +9 -10
- package/dist/index.js +9 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
<a href="https://demath.org"><img src="https://raw.githubusercontent.com/demath-ai/DeMath/main/assets/banner.png" alt="DeMath — Decentralized Math Research Infrastructure" /></a>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://github.com/demath-ai/DeMath/actions/workflows/test.yml"><img alt="tests" src="https://img.shields.io/github/actions/workflow/status/demath-ai/DeMath/test.yml?branch=main&style=flat-square&color=0057B8&label=tests" /></a>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@demath-ai/cli"><img alt="npm version" src="https://img.shields.io/npm/v/@demath-ai/cli?style=flat-square&color=0057B8&label=npm" /></a>
|
|
6
|
+
<img alt="MIT licensed" src="https://img.shields.io/npm/l/@demath-ai/cli?style=flat-square&color=0057B8" />
|
|
7
|
+
<img alt="node 18 plus" src="https://img.shields.io/badge/node-18%2B-0057B8?style=flat-square" />
|
|
8
|
+
<a href="https://demath.org"><img alt="demath.org" src="https://img.shields.io/badge/web-demath.org-0057B8?style=flat-square" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
1
11
|
# @demath-ai/cli
|
|
2
12
|
|
|
13
|
+
Official command-line client for the [DeMath](https://demath.org)
|
|
14
|
+
protocol. Mine $DEMATH from any terminal with Node 18+ and an API key
|
|
15
|
+
from one of the four supported providers (OpenRouter, Anthropic,
|
|
16
|
+
OpenAI, Google Gemini).
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g @demath-ai/cli
|
|
20
|
+
demath skill # drop into an AI agent for project context
|
|
21
|
+
demath problems # list the curated open problems
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## What is DeMath
|
|
25
|
+
|
|
3
26
|
DeMath is the first decentralized math research infrastructure on
|
|
4
27
|
Base. The biggest mission in math history is wide open — Erdős
|
|
5
28
|
conjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a
|
|
@@ -22,28 +45,15 @@ attempt — full chain of thought — is pinned to IPFS as a permanent
|
|
|
22
45
|
public dataset. A treasury funded by LP fees pays a solver bounty on
|
|
23
46
|
the first independently verified proof of any listed problem.
|
|
24
47
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
total epoch USD spend) × that epoch's emission.
|
|
35
|
-
- **Wallet lock-for-life**: your first attempt binds the wallet to one
|
|
36
|
-
team (Claude / GPT / Gemini). Use different wallets for different
|
|
37
|
-
teams.
|
|
38
|
-
- **Solver bounty**: a treasury funded by LP fees pays out to the
|
|
39
|
-
miner who lands the first verified proof / disproof of a listed
|
|
40
|
-
problem.
|
|
41
|
-
|
|
42
|
-
This package is the official command-line client. Mine from any
|
|
43
|
-
terminal with Node 18+ and an API key from one of the four supported
|
|
44
|
-
providers.
|
|
45
|
-
|
|
46
|
-
→ Protocol docs and web miner: https://demath.org
|
|
48
|
+
| Parameter | Value |
|
|
49
|
+
|---|---|
|
|
50
|
+
| **Emission** | 16M $DEMATH per 24h epoch at launch, halving every 25 days |
|
|
51
|
+
| **Mining cap** | 800M $DEMATH (~4.4 years until full distribution) |
|
|
52
|
+
| **Early-miner edge** | First 25 days release half the entire mining bucket |
|
|
53
|
+
| **Settlement** | one epoch per UTC day, ~00:10 UTC, Merkle root on-chain |
|
|
54
|
+
| **Pro-rata** | your daily $DEMATH = (your epoch USD ÷ total epoch USD) × emission |
|
|
55
|
+
| **Wallet lock-for-life** | first attempt binds the wallet to one team (Claude / GPT / Gemini) |
|
|
56
|
+
| **Solver bounty** | LP-fees treasury pays out on the first verified proof |
|
|
47
57
|
|
|
48
58
|
## For AI agents
|
|
49
59
|
|
|
@@ -55,15 +65,20 @@ mine $DEMATH:
|
|
|
55
65
|
npm install -g @demath-ai/cli
|
|
56
66
|
```
|
|
57
67
|
|
|
58
|
-
2. **
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
2. **Read the skill file** — short, agent-facing project intro:
|
|
69
|
+
```sh
|
|
70
|
+
demath skill
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
3. **Discover problems** — list the curated set and pick one. The
|
|
74
|
+
test problem `irrationality-of-e` (the entry with
|
|
75
|
+
`expected_difficulty: "test"`) is the cheapest to mine and the
|
|
76
|
+
recommended first call:
|
|
62
77
|
```sh
|
|
63
78
|
demath problems --json
|
|
64
79
|
```
|
|
65
80
|
|
|
66
|
-
|
|
81
|
+
4. **Verify the user's API key works** before committing real spend:
|
|
67
82
|
```sh
|
|
68
83
|
demath probe --model anthropic/claude-opus-4-7 --key "$ANTHROPIC_KEY" --json
|
|
69
84
|
```
|
|
@@ -72,66 +87,54 @@ mine $DEMATH:
|
|
|
72
87
|
is under $0.0001). Non-zero means stop and surface the `detail`
|
|
73
88
|
field to the human.
|
|
74
89
|
|
|
75
|
-
|
|
76
|
-
|
|
90
|
+
5. **Run the attempt**. Stream NDJSON so you can react
|
|
91
|
+
per-iteration:
|
|
77
92
|
```sh
|
|
78
93
|
demath mine \
|
|
79
94
|
--problem irrationality-of-e \
|
|
80
95
|
--model anthropic/claude-opus-4-7 \
|
|
81
96
|
--key "$ANTHROPIC_KEY" \
|
|
82
97
|
--wallet 0xYourEvmAddress \
|
|
83
|
-
--max-usd 1.0 \
|
|
84
98
|
--json
|
|
85
99
|
```
|
|
86
|
-
stdout emits one JSON object per line. The final
|
|
87
|
-
line carries the terminal `status`
|
|
88
|
-
`breakthrough`, `stopped`, or
|
|
89
|
-
chain-of-thought bundle.
|
|
100
|
+
stdout emits one JSON object per line. The final
|
|
101
|
+
`{"event":"final",...}` line carries the terminal `status`
|
|
102
|
+
(`proof_complete`, `counterexample`, `breakthrough`, `stopped`, or
|
|
103
|
+
`error`) and the IPFS CID of the full chain-of-thought bundle.
|
|
90
104
|
|
|
91
|
-
|
|
105
|
+
6. **Exit codes** are the contract. `0` = the attempt reached a graded
|
|
92
106
|
success status. `1` = ended without success. `2` = invalid input or
|
|
93
107
|
backend error. `3` = network error. `130` = SIGINT (the CLI sent a
|
|
94
108
|
stop request to the backend on the way out).
|
|
95
109
|
|
|
96
|
-
|
|
97
|
-
the chosen team (`anthropic` / `openai` / `google`) on its first
|
|
98
|
-
successful attempt. The backend returns HTTP 409 if you later
|
|
99
|
-
the same wallet with a different team. Surface this clearly
|
|
100
|
-
human; use a fresh EVM address per team if needed.
|
|
110
|
+
7. **Lock-for-life**: the wallet address you pass to `mine` is bound
|
|
111
|
+
to the chosen team (`anthropic` / `openai` / `google`) on its first
|
|
112
|
+
successful attempt. The backend returns HTTP 409 if you later
|
|
113
|
+
submit the same wallet with a different team. Surface this clearly
|
|
114
|
+
to the human; use a fresh EVM address per team if needed.
|
|
101
115
|
|
|
102
|
-
|
|
116
|
+
8. **Key handling**: the CLI holds the API key in process memory only.
|
|
103
117
|
Never logs it, never writes it to disk, never sends it anywhere
|
|
104
|
-
except the configured `--api-url` (default
|
|
118
|
+
except the configured `--api-url` (default
|
|
119
|
+
`https://api.demath.org`).
|
|
105
120
|
|
|
106
121
|
For the short skill doc (project intro + mine-in-three-steps), run
|
|
107
122
|
`demath skill`. For more invocations, run `demath examples`.
|
|
108
123
|
|
|
109
|
-
## Install
|
|
110
|
-
|
|
111
|
-
```sh
|
|
112
|
-
npm install -g @demath-ai/cli
|
|
113
|
-
# or, project-local
|
|
114
|
-
npm install --save-dev @demath-ai/cli
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Requirements: Node 18 or newer. No native deps, no Python, no build
|
|
118
|
-
step on install — ships pre-bundled ESM + CJS.
|
|
119
|
-
|
|
120
124
|
## Usage
|
|
121
125
|
|
|
122
126
|
```
|
|
123
127
|
demath <command> [options]
|
|
124
128
|
```
|
|
125
129
|
|
|
126
|
-
Commands:
|
|
127
|
-
|
|
128
130
|
| Command | What it does |
|
|
129
131
|
|---|---|
|
|
130
|
-
| `demath problems` | List active problems with id, name, difficulty, classification
|
|
131
|
-
| `demath probe` | Verify an API key works against a model (no real spend)
|
|
132
|
-
| `demath mine` | Start an attempt and stream live progress until terminal
|
|
133
|
-
| `demath status` | Fetch the current state of an attempt by id
|
|
134
|
-
| `demath examples` | Print copy-pasteable example invocations
|
|
132
|
+
| `demath problems` | List active problems with id, name, difficulty, classification |
|
|
133
|
+
| `demath probe` | Verify an API key works against a model (no real spend) |
|
|
134
|
+
| `demath mine` | Start an attempt and stream live progress until terminal |
|
|
135
|
+
| `demath status` | Fetch the current state of an attempt by id |
|
|
136
|
+
| `demath examples` | Print copy-pasteable example invocations |
|
|
137
|
+
| `demath skill` | Print the SKILL.md doc to stdout (for AI agents) |
|
|
135
138
|
|
|
136
139
|
Every command supports `--help`, `--api-url <url>`, and `--json`.
|
|
137
140
|
|
|
@@ -156,8 +159,7 @@ demath mine \
|
|
|
156
159
|
--problem irrationality-of-e \
|
|
157
160
|
--model anthropic/claude-opus-4-7 \
|
|
158
161
|
--key sk-ant-... \
|
|
159
|
-
--wallet 0xYourEvmAddress
|
|
160
|
-
--max-usd 1.0
|
|
162
|
+
--wallet 0xYourEvmAddress
|
|
161
163
|
```
|
|
162
164
|
|
|
163
165
|
With `--json`, stdout receives one NDJSON event per iteration:
|
|
@@ -190,15 +192,16 @@ provider. The backend auto-detects from the key prefix.
|
|
|
190
192
|
|
|
191
193
|
## Lock-for-life
|
|
192
194
|
|
|
193
|
-
The first attempt from a wallet binds that wallet to a single team.
|
|
194
|
-
backend rejects later attempts from the same wallet with a
|
|
195
|
-
team using HTTP 409. Different wallets for different teams
|
|
195
|
+
The first attempt from a wallet binds that wallet to a single team.
|
|
196
|
+
The backend rejects later attempts from the same wallet with a
|
|
197
|
+
different team using HTTP 409. Different wallets for different teams
|
|
198
|
+
works.
|
|
196
199
|
|
|
197
200
|
## Environment
|
|
198
201
|
|
|
199
202
|
| Variable | Default | Purpose |
|
|
200
203
|
|---|---|---|
|
|
201
|
-
| `DEMATH_API_URL` | `https://api.demath.org` | Override the backend base URL (testing, self-host)
|
|
204
|
+
| `DEMATH_API_URL` | `https://api.demath.org` | Override the backend base URL (testing, self-host) |
|
|
202
205
|
|
|
203
206
|
## Programmatic use
|
|
204
207
|
|
|
@@ -209,6 +212,26 @@ const client = new DemathClient({ apiUrl: "https://api.demath.org" });
|
|
|
209
212
|
const { problems } = await client.listProblems();
|
|
210
213
|
```
|
|
211
214
|
|
|
215
|
+
## Build from source
|
|
216
|
+
|
|
217
|
+
```sh
|
|
218
|
+
git clone https://github.com/demath-ai/DeMath
|
|
219
|
+
cd DeMath
|
|
220
|
+
npm install
|
|
221
|
+
npm run build # prebuild embeds SKILL.md, then tsup bundles
|
|
222
|
+
npm test # 12 tests pass; no provider keys required
|
|
223
|
+
node bin/demath.mjs --help
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Zero runtime dependencies. ESM + CJS dual-bundle, ~33 kB each.
|
|
227
|
+
|
|
228
|
+
## Links
|
|
229
|
+
|
|
230
|
+
- **Web miner**: [demath.org](https://demath.org)
|
|
231
|
+
- **API**: `https://api.demath.org` ([OpenAPI docs](https://api.demath.org/docs))
|
|
232
|
+
- **npm**: [`@demath-ai/cli`](https://www.npmjs.com/package/@demath-ai/cli)
|
|
233
|
+
- **Issues**: [github.com/demath-ai/DeMath/issues](https://github.com/demath-ai/DeMath/issues)
|
|
234
|
+
|
|
212
235
|
## License
|
|
213
236
|
|
|
214
237
|
MIT.
|
package/SKILL.md
CHANGED
|
@@ -26,7 +26,7 @@ You are an AI agent reading this skill. To mine on a human's behalf:
|
|
|
26
26
|
demath problems --json
|
|
27
27
|
demath probe --model <slug> --key $KEY --json # exit 0 = ready
|
|
28
28
|
demath mine --problem <id> --model <slug> --key $KEY \
|
|
29
|
-
--wallet 0x... --
|
|
29
|
+
--wallet 0x... --json
|
|
30
30
|
|
|
31
31
|
The terminal `event:final` line on the mine stream carries the
|
|
32
32
|
attempt's `status` (`proof_complete`, `counterexample`, `breakthrough`,
|
package/dist/cli.cjs
CHANGED
|
@@ -204,8 +204,11 @@ REQUIRED
|
|
|
204
204
|
(locks to the chosen team on first use)
|
|
205
205
|
|
|
206
206
|
OPTIONAL
|
|
207
|
-
--max-iterations
|
|
208
|
-
--max-usd
|
|
207
|
+
--max-iterations upper bound on agent loop iterations (default: backend default)
|
|
208
|
+
--max-usd upper bound on USD spend. Leave unset (default: backend
|
|
209
|
+
default) unless you specifically need to limit the run.
|
|
210
|
+
Reasoning models can ramp spend mid-attempt on legitimate
|
|
211
|
+
progress; a tight cap will stop them before they finish.
|
|
209
212
|
--json emit one NDJSON event per iteration on stdout
|
|
210
213
|
|
|
211
214
|
EXAMPLES
|
|
@@ -213,8 +216,7 @@ EXAMPLES
|
|
|
213
216
|
--problem irrationality-of-e \\
|
|
214
217
|
--model anthropic/claude-opus-4-7 \\
|
|
215
218
|
--key sk-ant-... \\
|
|
216
|
-
--wallet 0xYourEvmAddress
|
|
217
|
-
--max-usd 1.0
|
|
219
|
+
--wallet 0xYourEvmAddress
|
|
218
220
|
|
|
219
221
|
demath mine --problem collatz --model openai/gpt-5.5 \\
|
|
220
222
|
--key sk-or-v1-... --wallet 0xAbc... --json | tee run.ndjson
|
|
@@ -263,14 +265,13 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
263
265
|
--key sk-ant-... \\
|
|
264
266
|
--json
|
|
265
267
|
|
|
266
|
-
3) Start
|
|
268
|
+
3) Start an attempt on the test problem (a few cents end-to-end):
|
|
267
269
|
|
|
268
270
|
demath mine \\
|
|
269
271
|
--problem irrationality-of-e \\
|
|
270
272
|
--model anthropic/claude-opus-4-7 \\
|
|
271
273
|
--key sk-ant-... \\
|
|
272
|
-
--wallet 0xYourEvmAddress
|
|
273
|
-
--max-usd 1.0
|
|
274
|
+
--wallet 0xYourEvmAddress
|
|
274
275
|
|
|
275
276
|
4) Same flow but routing via OpenRouter (one key, any team):
|
|
276
277
|
|
|
@@ -279,8 +280,6 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
279
280
|
--model openai/gpt-5.5 \\
|
|
280
281
|
--key sk-or-v1-... \\
|
|
281
282
|
--wallet 0xYourEvmAddress \\
|
|
282
|
-
--max-iterations 8 \\
|
|
283
|
-
--max-usd 5.0 \\
|
|
284
283
|
--json
|
|
285
284
|
|
|
286
285
|
5) Inspect an attempt by id after the fact (e.g. for a background run):
|
|
@@ -644,7 +643,7 @@ async function runProbe(args) {
|
|
|
644
643
|
}
|
|
645
644
|
|
|
646
645
|
// src/skillContent.generated.ts
|
|
647
|
-
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --
|
|
646
|
+
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --json\n\nThe terminal `event:final` line on the mine stream carries the\nattempt's `status` (`proof_complete`, `counterexample`, `breakthrough`,\n`stopped`, or `error`) and the IPFS CID of the full chain-of-thought\nbundle.\n\n## Wallet lock-for-life\n\nThe wallet you submit to `mine` binds to a single team (Claude / GPT /\nGemini) on its first successful attempt. The backend rejects later\nattempts from that same wallet against a different team with HTTP 409.\nUse a fresh EVM address per team.\n\n## What DeMath does NOT do with the human's API key\n\nThe CLI sends the key once per attempt to the backend, which forwards\nit inline to the upstream provider and drops it from memory the moment\nthe attempt finishes. No disk write, no log line, no IPFS bundle, no\ntelemetry, no SQLite, no env files. The human's billing relationship\nwith the upstream provider stays theirs.\n\n## Claim\n\nClaiming the earned emission is a web step at https://demath.org/claim.\nThe CLI does not sign on-chain transactions in v0.1.\n";
|
|
648
647
|
|
|
649
648
|
// src/commands/skill.ts
|
|
650
649
|
function runSkill() {
|
package/dist/cli.js
CHANGED
|
@@ -202,8 +202,11 @@ REQUIRED
|
|
|
202
202
|
(locks to the chosen team on first use)
|
|
203
203
|
|
|
204
204
|
OPTIONAL
|
|
205
|
-
--max-iterations
|
|
206
|
-
--max-usd
|
|
205
|
+
--max-iterations upper bound on agent loop iterations (default: backend default)
|
|
206
|
+
--max-usd upper bound on USD spend. Leave unset (default: backend
|
|
207
|
+
default) unless you specifically need to limit the run.
|
|
208
|
+
Reasoning models can ramp spend mid-attempt on legitimate
|
|
209
|
+
progress; a tight cap will stop them before they finish.
|
|
207
210
|
--json emit one NDJSON event per iteration on stdout
|
|
208
211
|
|
|
209
212
|
EXAMPLES
|
|
@@ -211,8 +214,7 @@ EXAMPLES
|
|
|
211
214
|
--problem irrationality-of-e \\
|
|
212
215
|
--model anthropic/claude-opus-4-7 \\
|
|
213
216
|
--key sk-ant-... \\
|
|
214
|
-
--wallet 0xYourEvmAddress
|
|
215
|
-
--max-usd 1.0
|
|
217
|
+
--wallet 0xYourEvmAddress
|
|
216
218
|
|
|
217
219
|
demath mine --problem collatz --model openai/gpt-5.5 \\
|
|
218
220
|
--key sk-or-v1-... --wallet 0xAbc... --json | tee run.ndjson
|
|
@@ -261,14 +263,13 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
261
263
|
--key sk-ant-... \\
|
|
262
264
|
--json
|
|
263
265
|
|
|
264
|
-
3) Start
|
|
266
|
+
3) Start an attempt on the test problem (a few cents end-to-end):
|
|
265
267
|
|
|
266
268
|
demath mine \\
|
|
267
269
|
--problem irrationality-of-e \\
|
|
268
270
|
--model anthropic/claude-opus-4-7 \\
|
|
269
271
|
--key sk-ant-... \\
|
|
270
|
-
--wallet 0xYourEvmAddress
|
|
271
|
-
--max-usd 1.0
|
|
272
|
+
--wallet 0xYourEvmAddress
|
|
272
273
|
|
|
273
274
|
4) Same flow but routing via OpenRouter (one key, any team):
|
|
274
275
|
|
|
@@ -277,8 +278,6 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
277
278
|
--model openai/gpt-5.5 \\
|
|
278
279
|
--key sk-or-v1-... \\
|
|
279
280
|
--wallet 0xYourEvmAddress \\
|
|
280
|
-
--max-iterations 8 \\
|
|
281
|
-
--max-usd 5.0 \\
|
|
282
281
|
--json
|
|
283
282
|
|
|
284
283
|
5) Inspect an attempt by id after the fact (e.g. for a background run):
|
|
@@ -642,7 +641,7 @@ async function runProbe(args) {
|
|
|
642
641
|
}
|
|
643
642
|
|
|
644
643
|
// src/skillContent.generated.ts
|
|
645
|
-
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --
|
|
644
|
+
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --json\n\nThe terminal `event:final` line on the mine stream carries the\nattempt's `status` (`proof_complete`, `counterexample`, `breakthrough`,\n`stopped`, or `error`) and the IPFS CID of the full chain-of-thought\nbundle.\n\n## Wallet lock-for-life\n\nThe wallet you submit to `mine` binds to a single team (Claude / GPT /\nGemini) on its first successful attempt. The backend rejects later\nattempts from that same wallet against a different team with HTTP 409.\nUse a fresh EVM address per team.\n\n## What DeMath does NOT do with the human's API key\n\nThe CLI sends the key once per attempt to the backend, which forwards\nit inline to the upstream provider and drops it from memory the moment\nthe attempt finishes. No disk write, no log line, no IPFS bundle, no\ntelemetry, no SQLite, no env files. The human's billing relationship\nwith the upstream provider stays theirs.\n\n## Claim\n\nClaiming the earned emission is a web step at https://demath.org/claim.\nThe CLI does not sign on-chain transactions in v0.1.\n";
|
|
646
645
|
|
|
647
646
|
// src/commands/skill.ts
|
|
648
647
|
function runSkill() {
|
package/dist/index.cjs
CHANGED
|
@@ -318,8 +318,11 @@ REQUIRED
|
|
|
318
318
|
(locks to the chosen team on first use)
|
|
319
319
|
|
|
320
320
|
OPTIONAL
|
|
321
|
-
--max-iterations
|
|
322
|
-
--max-usd
|
|
321
|
+
--max-iterations upper bound on agent loop iterations (default: backend default)
|
|
322
|
+
--max-usd upper bound on USD spend. Leave unset (default: backend
|
|
323
|
+
default) unless you specifically need to limit the run.
|
|
324
|
+
Reasoning models can ramp spend mid-attempt on legitimate
|
|
325
|
+
progress; a tight cap will stop them before they finish.
|
|
323
326
|
--json emit one NDJSON event per iteration on stdout
|
|
324
327
|
|
|
325
328
|
EXAMPLES
|
|
@@ -327,8 +330,7 @@ EXAMPLES
|
|
|
327
330
|
--problem irrationality-of-e \\
|
|
328
331
|
--model anthropic/claude-opus-4-7 \\
|
|
329
332
|
--key sk-ant-... \\
|
|
330
|
-
--wallet 0xYourEvmAddress
|
|
331
|
-
--max-usd 1.0
|
|
333
|
+
--wallet 0xYourEvmAddress
|
|
332
334
|
|
|
333
335
|
demath mine --problem collatz --model openai/gpt-5.5 \\
|
|
334
336
|
--key sk-or-v1-... --wallet 0xAbc... --json | tee run.ndjson
|
|
@@ -377,14 +379,13 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
377
379
|
--key sk-ant-... \\
|
|
378
380
|
--json
|
|
379
381
|
|
|
380
|
-
3) Start
|
|
382
|
+
3) Start an attempt on the test problem (a few cents end-to-end):
|
|
381
383
|
|
|
382
384
|
demath mine \\
|
|
383
385
|
--problem irrationality-of-e \\
|
|
384
386
|
--model anthropic/claude-opus-4-7 \\
|
|
385
387
|
--key sk-ant-... \\
|
|
386
|
-
--wallet 0xYourEvmAddress
|
|
387
|
-
--max-usd 1.0
|
|
388
|
+
--wallet 0xYourEvmAddress
|
|
388
389
|
|
|
389
390
|
4) Same flow but routing via OpenRouter (one key, any team):
|
|
390
391
|
|
|
@@ -393,8 +394,6 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
393
394
|
--model openai/gpt-5.5 \\
|
|
394
395
|
--key sk-or-v1-... \\
|
|
395
396
|
--wallet 0xYourEvmAddress \\
|
|
396
|
-
--max-iterations 8 \\
|
|
397
|
-
--max-usd 5.0 \\
|
|
398
397
|
--json
|
|
399
398
|
|
|
400
399
|
5) Inspect an attempt by id after the fact (e.g. for a background run):
|
|
@@ -644,7 +643,7 @@ async function runProbe(args) {
|
|
|
644
643
|
}
|
|
645
644
|
|
|
646
645
|
// src/skillContent.generated.ts
|
|
647
|
-
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --
|
|
646
|
+
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --json\n\nThe terminal `event:final` line on the mine stream carries the\nattempt's `status` (`proof_complete`, `counterexample`, `breakthrough`,\n`stopped`, or `error`) and the IPFS CID of the full chain-of-thought\nbundle.\n\n## Wallet lock-for-life\n\nThe wallet you submit to `mine` binds to a single team (Claude / GPT /\nGemini) on its first successful attempt. The backend rejects later\nattempts from that same wallet against a different team with HTTP 409.\nUse a fresh EVM address per team.\n\n## What DeMath does NOT do with the human's API key\n\nThe CLI sends the key once per attempt to the backend, which forwards\nit inline to the upstream provider and drops it from memory the moment\nthe attempt finishes. No disk write, no log line, no IPFS bundle, no\ntelemetry, no SQLite, no env files. The human's billing relationship\nwith the upstream provider stays theirs.\n\n## Claim\n\nClaiming the earned emission is a web step at https://demath.org/claim.\nThe CLI does not sign on-chain transactions in v0.1.\n";
|
|
648
647
|
|
|
649
648
|
// src/commands/skill.ts
|
|
650
649
|
function runSkill() {
|
package/dist/index.js
CHANGED
|
@@ -316,8 +316,11 @@ REQUIRED
|
|
|
316
316
|
(locks to the chosen team on first use)
|
|
317
317
|
|
|
318
318
|
OPTIONAL
|
|
319
|
-
--max-iterations
|
|
320
|
-
--max-usd
|
|
319
|
+
--max-iterations upper bound on agent loop iterations (default: backend default)
|
|
320
|
+
--max-usd upper bound on USD spend. Leave unset (default: backend
|
|
321
|
+
default) unless you specifically need to limit the run.
|
|
322
|
+
Reasoning models can ramp spend mid-attempt on legitimate
|
|
323
|
+
progress; a tight cap will stop them before they finish.
|
|
321
324
|
--json emit one NDJSON event per iteration on stdout
|
|
322
325
|
|
|
323
326
|
EXAMPLES
|
|
@@ -325,8 +328,7 @@ EXAMPLES
|
|
|
325
328
|
--problem irrationality-of-e \\
|
|
326
329
|
--model anthropic/claude-opus-4-7 \\
|
|
327
330
|
--key sk-ant-... \\
|
|
328
|
-
--wallet 0xYourEvmAddress
|
|
329
|
-
--max-usd 1.0
|
|
331
|
+
--wallet 0xYourEvmAddress
|
|
330
332
|
|
|
331
333
|
demath mine --problem collatz --model openai/gpt-5.5 \\
|
|
332
334
|
--key sk-or-v1-... --wallet 0xAbc... --json | tee run.ndjson
|
|
@@ -375,14 +377,13 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
375
377
|
--key sk-ant-... \\
|
|
376
378
|
--json
|
|
377
379
|
|
|
378
|
-
3) Start
|
|
380
|
+
3) Start an attempt on the test problem (a few cents end-to-end):
|
|
379
381
|
|
|
380
382
|
demath mine \\
|
|
381
383
|
--problem irrationality-of-e \\
|
|
382
384
|
--model anthropic/claude-opus-4-7 \\
|
|
383
385
|
--key sk-ant-... \\
|
|
384
|
-
--wallet 0xYourEvmAddress
|
|
385
|
-
--max-usd 1.0
|
|
386
|
+
--wallet 0xYourEvmAddress
|
|
386
387
|
|
|
387
388
|
4) Same flow but routing via OpenRouter (one key, any team):
|
|
388
389
|
|
|
@@ -391,8 +392,6 @@ var EXAMPLES = `DeMath CLI \u2014 worked examples
|
|
|
391
392
|
--model openai/gpt-5.5 \\
|
|
392
393
|
--key sk-or-v1-... \\
|
|
393
394
|
--wallet 0xYourEvmAddress \\
|
|
394
|
-
--max-iterations 8 \\
|
|
395
|
-
--max-usd 5.0 \\
|
|
396
395
|
--json
|
|
397
396
|
|
|
398
397
|
5) Inspect an attempt by id after the fact (e.g. for a background run):
|
|
@@ -642,7 +641,7 @@ async function runProbe(args) {
|
|
|
642
641
|
}
|
|
643
642
|
|
|
644
643
|
// src/skillContent.generated.ts
|
|
645
|
-
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --
|
|
644
|
+
var SKILL_MD_CONTENT = "# DeMath skill\n\nDeMath is the first decentralized math research infrastructure on\nBase. The biggest mission in math history is wide open \u2014 Erd\u0151s\nconjectures, Collatz, twin primes, Hadwiger-Nelson, Beal, and a\ncurated list of problems mathematicians have worked on for decades.\nDeMath is the coordination layer for putting frontier AI compute on\nall of them, in public.\n\nMiners spend API budget on Anthropic / OpenAI / Google / OpenRouter\nand earn $DEMATH pro-rata to their compute spend per 24h epoch. Every\nattempt is pinned to IPFS with full chain-of-thought as a permanent\npublic dataset.\n\nYou are an AI agent reading this skill. To mine on a human's behalf:\n\n1. Install once: `npm install -g @demath-ai/cli`\n2. Run `demath --help` \u2014 the authoritative reference for flags and\n exit codes. Re-read it before every invocation; nothing in this\n skill replaces it.\n3. The four commands: `problems`, `probe`, `mine`, `status`. Each has\n its own `--help`. Use `--json` for machine output.\n\n## Mine in three steps\n\n demath problems --json\n demath probe --model <slug> --key $KEY --json # exit 0 = ready\n demath mine --problem <id> --model <slug> --key $KEY \\\n --wallet 0x... --json\n\nThe terminal `event:final` line on the mine stream carries the\nattempt's `status` (`proof_complete`, `counterexample`, `breakthrough`,\n`stopped`, or `error`) and the IPFS CID of the full chain-of-thought\nbundle.\n\n## Wallet lock-for-life\n\nThe wallet you submit to `mine` binds to a single team (Claude / GPT /\nGemini) on its first successful attempt. The backend rejects later\nattempts from that same wallet against a different team with HTTP 409.\nUse a fresh EVM address per team.\n\n## What DeMath does NOT do with the human's API key\n\nThe CLI sends the key once per attempt to the backend, which forwards\nit inline to the upstream provider and drops it from memory the moment\nthe attempt finishes. No disk write, no log line, no IPFS bundle, no\ntelemetry, no SQLite, no env files. The human's billing relationship\nwith the upstream provider stays theirs.\n\n## Claim\n\nClaiming the earned emission is a web step at https://demath.org/claim.\nThe CLI does not sign on-chain transactions in v0.1.\n";
|
|
646
645
|
|
|
647
646
|
// src/commands/skill.ts
|
|
648
647
|
function runSkill() {
|