Skip to content

Commit 88a32f9

Browse files
autogame-17claude
andauthored
feat(onboarding): 移植认领链接引导与零配置文案 (#3)
将 claude-code 插件已合并的 onboarding UX 改进移植到 antigravity 端: - session-start.js:新增 CLAIM_TTL_MS 与 readPendingClaimUrl(),读取 ~/.evomap/claim_url 后一次性(12h 节流、fail-closed)提示去 evomap.ai 认领本地已注册但未连网的 node,复用既有 throttled() 基建。 - README.md:安装小节点明本地记忆零配置可用,新增 "Connecting to the EvoMap network (optional)" 三步(留空 Node ID → 跑 evolver → 认领链接), 并在 hooks 说明表补充 session-start 的一次性认领提示。 - evolver-status 技能:补充 claim_url 未认领与 HTTP 402/credits 的平白话 说明,避免直接甩 JSON / node_secret / stake / hub_rotate。 - CHANGELOG.md:新增 [Unreleased] → Changed — onboarding UX,不 bump 版本。 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6b65c84 commit 88a32f9

4 files changed

Lines changed: 87 additions & 1 deletion

File tree

CHANGELOG.md

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

6+
## [Unreleased]
7+
8+
### Changed — onboarding UX
9+
- README: the Installation section now states that local memory works with zero
10+
config, and a new **"Connecting to the EvoMap network (optional)"** section
11+
walks through the blank-node-id → `evolver` → claim-link flow (and notes that
12+
reusing a specific older node is the harder, secret-requiring path). The
13+
`session-start.js` hook row now mentions the one-time claim nudge.
14+
- `session-start.js` gives a one-time, throttled nudge to claim the node when
15+
one has been registered locally (`~/.evomap/claim_url`) but not yet connected
16+
to the network (fail-closed, 12h throttle).
17+
- `evolver-status` skill now translates connection state into plain "are you
18+
connected?" language — surfacing the pending claim link and explaining HTTP
19+
402 as "network features need credits" (https://evomap.ai/pricing) instead of
20+
dumping raw JSON or internal terms like `node_secret` / `stake`.
21+
622
## [0.1.1] — 2026-06-25
723

824
### Fixed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Three lifecycle hooks run automatically on events and require no configuration o
2020

2121
| Hook | Event | Effect |
2222
|---|---|---|
23-
| `session-start.js` | `PreInvocation` | Injects a summary of recent **successful** outcomes for this workspace (score ≥ 0.5, < 7 days, max 3) as an ephemeral model context step. |
23+
| `session-start.js` | `PreInvocation` | Injects a summary of recent **successful** outcomes for this workspace (score ≥ 0.5, < 7 days, max 3) as an ephemeral model context step. When a node has been registered locally but not yet connected to the network, it also gives a one-time (throttled) nudge to claim it. |
2424
| `signal-detect.js` | `PostToolUse` | Detects improvement signals (`log_error`, `perf_bottleneck`, `capability_gap`, `test_failure` ...) in tool outputs or edits and exits cleanly under Antigravity's PostToolUse contract. |
2525
| `session-end.js` | `Stop` | Classifies the current working-tree/staged git diff once per session and appends the outcome to the evolution memory graph. |
2626

@@ -76,6 +76,29 @@ If `~/.gemini/config/mcp_config.json` exists, it must contain valid JSON, for ex
7676
}
7777
```
7878

79+
After installing, that's it — **local memory works with zero config**: no account, no key, nothing to fill in.
80+
81+
### Connecting to the EvoMap network (optional)
82+
83+
The network layer (searching/reusing genes & capsules) is opt-in. To connect:
84+
85+
1. In the plugin's config, **leave "Node ID" blank**. Don't paste an old id and
86+
don't go hunting for a secret — blank is the intended path.
87+
2. Install the engine and run it once inside a git repo:
88+
89+
```bash
90+
npm i -g @evomap/evolver
91+
evolver
92+
```
93+
94+
The first run registers a fresh node for you and prints a **claim link**.
95+
3. Open that link while signed in to [evomap.ai](https://evomap.ai) to claim the
96+
node. Check status any time with the `evolver-status` skill.
97+
98+
If you see a different, older node than you expected, don't worry about it —
99+
just claim the current one. Reusing a specific older node requires that node's
100+
secret, which is more trouble than it's worth.
101+
79102
---
80103

81104
## Requirements

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.
@@ -243,6 +264,23 @@ function main(input) {
243264
// ignore — notice is optional
244265
}
245266

267+
// 1b. Pending-claim nudge (throttled per claim url).
268+
try {
269+
const claimUrl = readPendingClaimUrl();
270+
if (claimUrl && !throttled(`claim:${claimUrl}`, CLAIM_TTL_MS)) {
271+
parts.push(
272+
'[Evolver] Your local node is not connected to the EvoMap network ' +
273+
'yet. To finish connecting, open ' +
274+
claimUrl +
275+
' while signed in to evomap.ai — that is the only step, with no id ' +
276+
'or secret to enter. Local evolution memory already works without ' +
277+
'this; connecting only adds the network gene/capsule tools.'
278+
);
279+
}
280+
} catch (_err) {
281+
// ignore — nudge is optional
282+
}
283+
246284
// 2. Workspace-scoped evolution memory.
247285
try {
248286
const graphPath = findMemoryGraph(currentDir);

skills/evolver-status/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,13 @@ When requested by the user, run the following diagnostic checks using shell/term
3636
command -v evolver >/dev/null 2>&1 && evolver --version 2>/dev/null | head -1 || echo "evolver CLI not installed — hooks still work standalone; 'npm i -g @evomap/evolver' unlocks full pipeline features"
3737
```
3838

39+
5. **Network connection (optional)** — check whether a node has been registered locally but not yet claimed on the network:
40+
41+
```bash
42+
C=~/.evomap/claim_url
43+
[ -s "$C" ] && echo "not connected yet — claim this node by opening $(cat "$C") while signed in to evomap.ai (that is the only step; no id or secret to enter)" || echo "no pending claim (either not registered yet, or already connected)"
44+
```
45+
46+
If the Proxy is reachable and `evolver_status` reports an HTTP **402 / insufficient credits**, translate that for the user in plain language: the network features (searching/reusing genes & capsules) need credits — see https://evomap.ai/pricing — while local evolution memory keeps working exactly as before. When reporting connection state, keep it to plain "are you connected?" language: surface the claim link and the credits note as above; do **not** dump raw JSON or internal terms like `node_secret`, `stake`, or `hub_rotate`.
47+
3948
Finish with a single-line summary statement on the overall readiness of the self-evolution memory.

0 commit comments

Comments
 (0)