Skip to content

Commit ab9d33c

Browse files
autogame-17claude
andauthored
feat(onboarding): 把入门体验反向做顺,突出 node_id 留空为正道 (#6)
从插件侧重做首次配置体验:核心信息是「node_id 留空才是正道」——不用 找旧 node、不用 secret,首次运行自动注册并给一条认领链接,点它认领即可。 - plugin.json: node_id 文案改为「leave blank for automatic setup」, 描述说明首次运行自动注册 + 打印认领链接,绝不粘 id/secret。 - README: Install 段点明本地记忆零配置可用;新增 「Connecting to the EvoMap network (optional)」三步指引 (留空 → 跑 evolver → 认领链接),并说明复用旧 node 才需 secret、更麻烦。 - session-start.js: 有本地已注册但未连接网络的 node 时,一次性(12h 节流) 提示去认领;读 ~/.evomap/claim_url,fail-closed。 - /evolver:status: 把 Proxy 状态翻成平白话「你连上了没」,surface 认领链接、 把 402 说成「网络功能需要 credits」,不甩原始 JSON / node_secret / stake。 - CHANGELOG: 新增 [Unreleased] → Changed — onboarding UX(不 bump 版本)。 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 44e2aae commit ab9d33c

5 files changed

Lines changed: 99 additions & 5 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"userConfig": {
2323
"node_id": {
2424
"type": "string",
25-
"title": "EvoMap Node ID (A2A_NODE_ID)",
26-
"description": "Your EvoMap node identity. Leave blank to let the Proxy register one on first run.",
25+
"title": "EvoMap Node ID — leave blank for automatic setup",
26+
"description": "Leave this blank (recommended). On first run the local Proxy registers a fresh node for you and prints a link to claim it on evomap.ai — you never paste an id or a secret here. Only fill this in to point the install at a node you already run yourself.",
2727
"default": ""
2828
},
2929
"hub_url": {

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@
33
All notable changes to the Evolver Claude Code plugin are documented here.
44
This project adheres to [Semantic Versioning](https://semver.org/).
55

6+
## [Unreleased]
7+
8+
### Changed — onboarding UX
9+
- `node_id` config field reworded to make **leaving it blank** the clear default:
10+
the title now reads "leave blank for automatic setup" and the description
11+
explains that the first run registers a fresh node and prints a claim link —
12+
no id or secret to paste.
13+
- README: the Install section now states that local memory works with zero
14+
config, and a new **"Connecting to the EvoMap network (optional)"** section
15+
walks through the blank-node-id → `evolver` → claim-link flow (and notes that
16+
reusing a specific older node is the harder, secret-requiring path).
17+
- `session-start.js` gives a one-time, throttled nudge to claim the node when
18+
one has been registered locally (`~/.evomap/claim_url`) but not yet connected
19+
to the network (fail-closed, 12h throttle).
20+
- `/evolver:status` now translates Proxy state into plain "are you connected?"
21+
language — surfacing the pending claim link and explaining HTTP 402 as
22+
"network features need credits" instead of dumping raw JSON or internal terms
23+
like `node_secret` / `stake`.
24+
625
## [0.2.2] — 2026-06-25
726

827
### Fixed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Three hooks run automatically — you don't invoke them:
2525

2626
| Hook | Event | Effect |
2727
|---|---|---|
28-
| `session-start.js` | `SessionStart` | Injects a summary of recent **successful** outcomes for this workspace (score ≥ 0.5, < 7 days, max 3) as context. |
28+
| `session-start.js` | `SessionStart` | Injects a summary of recent **successful** outcomes for this workspace (score ≥ 0.5, < 7 days, max 3) as context. Also, when a node has been registered locally but not yet connected to the network, gives a one-time (throttled) nudge to claim it. |
2929
| `signal-detect.js` | `PostToolUse` (Write/Edit) | Detects improvement signals (`log_error`, `perf_bottleneck`, `capability_gap`, …) in edits. |
3030
| `session-end.js` | `Stop` | Classifies the current working-tree/staged git diff once per session and appends the outcome to the evolution memory graph. |
3131

@@ -56,8 +56,29 @@ and — when `@evomap/evolver` is installed — **`/evolver:run`**, **`/evolver:
5656
/plugin install evolver@evolver
5757
```
5858

59-
Restart Claude Code (or `/reload-plugins`). Set the EvoMap node id / hub / proxy
60-
port in the plugin's config if you use the MCP tools.
59+
Restart Claude Code (or `/reload-plugins`). That's it — **local memory works
60+
with zero config**: no account, no key, nothing to fill in.
61+
62+
### Connecting to the EvoMap network (optional)
63+
64+
The network layer (searching/reusing genes & capsules) is opt-in. To connect:
65+
66+
1. In the plugin's config, **leave "Node ID" blank**. Don't paste an old id and
67+
don't go hunting for a secret — blank is the intended path.
68+
2. Install the engine and run it once inside a git repo:
69+
70+
```bash
71+
npm i -g @evomap/evolver
72+
evolver
73+
```
74+
75+
The first run registers a fresh node for you and prints a **claim link**.
76+
3. Open that link while signed in to [evomap.ai](https://evomap.ai) to claim the
77+
node. Check status any time with `/evolver:status`.
78+
79+
If you see a different, older node than you expected, don't worry about it —
80+
just claim the current one. Reusing a specific older node requires that node's
81+
secret, which is more trouble than it's worth.
6182

6283
### Local development
6384

commands/status.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ Report Evolver health as a short checklist.
1111
starts when you run `evolver` once in a git repo, and that the local memory
1212
hooks keep working regardless.
1313

14+
Then translate the Proxy state into plain "are you connected?" language for
15+
the user — **don't** dump raw error JSON or internal terms like
16+
`node_secret`, `stake`, or `hub_rotate`:
17+
18+
- If `~/.evomap/claim_url` exists, the node is registered but **not yet
19+
claimed**. Tell the user to sign in to evomap.ai and open that URL to
20+
finish connecting — that's the only step, with no id or secret to find.
21+
22+
```bash
23+
[ -f ~/.evomap/claim_url ] && echo "not yet connected — sign in to evomap.ai and open: $(cat ~/.evomap/claim_url)" || echo "no pending claim link"
24+
```
25+
26+
- If a network call reports `insufficient credits` / HTTP 402, say plainly
27+
that the network features need credits (buy or subscribe at
28+
https://evomap.ai/pricing); local memory keeps working as usual.
29+
1430
2. **Evolution memory** — does the local graph exist and how many outcomes?
1531

1632
```bash

hooks/session-start.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const { filterRelevant } = require('./_filter');
2525
const MAX_SCAN_ENTRIES = 5; // how many workspace-matched entries to gather
2626
const LINE_MAX = 200; // per-outcome line truncation
2727
const NONGIT_TTL_MS = 30 * 60 * 1000; // throttle the non-git notice
28+
const CLAIM_TTL_MS = 12 * 60 * 60 * 1000; // throttle the pending-claim nudge
2829
const THROTTLE_PRUNE_MS = 24 * 60 * 60 * 1000;
2930

3031
const NONGIT_NOTICE =
@@ -104,6 +105,26 @@ function throttled(key, ttlMs) {
104105
}
105106
}
106107

108+
/**
109+
* Read a pending claim URL left by the engine. When the engine registers a
110+
* fresh node that hasn't been claimed on evomap.ai yet, it writes the claim
111+
* link to `~/.evomap/claim_url`; it clears that file once the node is claimed.
112+
* Returns the trimmed url if it looks like an http(s) link, else null.
113+
* Fails closed (null) on any error — the nudge is optional.
114+
*/
115+
function readPendingClaimUrl() {
116+
try {
117+
const file = path.join(os.homedir(), '.evomap', 'claim_url');
118+
const url = fs.readFileSync(file, 'utf8').trim();
119+
if (/^https?:\/\//.test(url)) {
120+
return url;
121+
}
122+
return null;
123+
} catch (_err) {
124+
return null;
125+
}
126+
}
127+
107128
/**
108129
* Decide whether a memory entry belongs to the current workspace.
109130
* - tagged with workspace_id, our id known: match iff equal.
@@ -234,6 +255,23 @@ function main() {
234255
// ignore — notice is optional
235256
}
236257

258+
// 1b. Pending-claim nudge (throttled per claim url).
259+
try {
260+
const claimUrl = readPendingClaimUrl();
261+
if (claimUrl && !throttled(`claim:${claimUrl}`, CLAIM_TTL_MS)) {
262+
parts.push(
263+
'[Evolver] Your local node is not connected to the EvoMap network ' +
264+
'yet. To finish connecting, open ' +
265+
claimUrl +
266+
' while signed in to evomap.ai — that is the only step, with no id ' +
267+
'or secret to enter. Local evolution memory already works without ' +
268+
'this; connecting only adds the network gene/capsule tools.'
269+
);
270+
}
271+
} catch (_err) {
272+
// ignore — nudge is optional
273+
}
274+
237275
// 2. Workspace-scoped evolution memory.
238276
try {
239277
const graphPath = findMemoryGraph(currentDir);

0 commit comments

Comments
 (0)