diff --git a/CHANGELOG.md b/CHANGELOG.md index ab0f936..19db0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,41 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [4.9.0] - 2026-06-26 + +> **Minor: hybrid 切割 deprecation 期开启.** v0.5.23 之前 abyss CLI 文档把自己定位为「cargo-only fallback」、把 `npx code-abyss --with-abyss` 定位为 production 主入口;abyss v0.5.24 正式定位反转——`abyss attach` 是 claude/codex/gemini 三平台 hook 注入的 production 主入口;openclaw/pi/hermes 由 code-abyss npm 包独占(abyss 设计上不接管,因 per-pack 布局 + 不稳定 hook shape)。v4.9.0 是配合这次反转的 deprecation 期;v5.0 物理切割。 + +### Deprecated + +- **`--with-abyss`** — 二进制下载职责转交 abyss 仓库本体的 `install.sh` / `cargo binstall code-abyss` / `@code-abyss/cli` npm wrapper。`bin/install.js` 解析到该 flag 时打印 `⚠ DEPRECATED` warning + 推荐迁移命令;旧行为(下载到 `~/.code-abyss/bin/`)在 v4.9 全程保留以维持兼容。v5.0 物理移除 `bin/lib/abyss-binary.js` 与 flag 解析。 +- **`--with-mcp`** — MCP 注册由 MCP 客户端自管(添加 `mcpServers.abyss = { command: "abyss", args: ["mcp"] }` 到客户端配置即可)。warning + 迁移引导同上;v5.0 物理移除。 +- **`--with-hooks` 对 claude/codex/gemini** — `abyss attach ` (abyss v0.5.20+) 是 production 主入口,shape 一致、idempotent、重跑覆盖。warning + 引导 `abyss attach `;v4.9 旧行为保留(仍写入 settings 文件);v5.0 物理移除 `injectClaudeHooks` / `injectGeminiHooks` / `injectCodexHooks` + 相关 `~256 行 codex.js TOML 编辑器` (`splitTomlBlocks` / `gatherHookGroup` / `renderCodexHookBlock` / `stripCodexAbyssIntegration`) + `ABYSS_HOOK_MARKER` 常量。 + +### Changed + +- **`--with-hooks` 对 openclaw/pi/hermes 改造为 net-new 能力**:v4.9 起当 `targetName ∈ {openclaw, pi, hermes}` 且 `withHooks=true` 时,自动 `spawn bash skills/indexing-code/hooks/common/install-hooks.sh `,由 install-hooks.sh 完成 per-host hook 注入。新 helper `maybeSpawnInstallHooks(targetName)` 落 `bin/install.js`。abyss CLI 设计上不接管这三平台(per-pack layout / 不稳定 hook shape),所以 `--with-hooks` 对它们永久保留并在 v5.0 之后仍工作。 +- **`bin/lib/lifecycle/finish.js` `reportAbyssStatus(projectLock, targetName)`** 加 `targetName` 参数;当 target ∈ {claude, codex, gemini} 时引导文案改为「装好 abyss 后跑 `abyss attach `」(替代旧的「重跑 `--with-abyss`」引导);abyss 缺失时安装命令清单不再首推 `npx code-abyss --with-abyss`,改首推 `curl install.sh`。 +- **`skills/indexing-code/SKILL.md` `## Hook 自动执行` 段重写**:明确 hybrid 分工——claude/codex/gemini 走 `abyss attach`(production 主入口);openclaw/pi/hermes 走 `npx code-abyss --with-hooks` 或直接 `bash install-hooks.sh`。修复 L103 与 `install.js` L292 字面冲突(v4.8.1 起 hook 默认 opt-in,但 SKILL.md 仍说「自动注入」)。 +- **`README.md` 副标题去掉 `code graph intelligence`**——code graph 由独立 abyss Rust CLI 提供,不再作为 code-abyss npm 包的内置卖点。What's new 段新增 v4.9 entry 解释 hybrid 切割;首屏命令示例改为「先装 code-abyss → 再装 abyss CLI → 再 `abyss attach`」三步。 +- **`site/index.html` + `site/i18n.js`** 双源 hero.badge / hero.sub 统一对齐:badge 从 v4.5/v4.6 推到 v4.9;hero.sub 去掉「code graph intelligence」;nav.graph 从「Graph / 代码图」改为「Companion / 协同」。 +- **`package.json` description** 删除「+ 代码关系图智能」括号;style 数字 5→6(与 README L9/L47 + `output-styles/index.json` 实际值一致)。 +- **`bin/lib/abyss-integration.js` / `bin/lib/abyss-binary.js` / `bin/adapters/codex.js`** 文件头加 v4.9 deprecation 注释 + `@deprecated` JSDoc;逻辑零改动。 + +### Compatibility + +- 100% backward compatible。所有现有 flag、helper、inject 函数行为不变;424 现有 test + verify:skills 30 skills 零回归。 +- 现有用户跑 `npx code-abyss -t claude --with-abyss --with-mcp --with-hooks` 仍 work,只是看到三条 deprecation warning。 +- abyss CLI < 0.5.20 用户:`--with-hooks` 对 claude/codex/gemini 仍是有效路径直到 v5.0。 + +### Required follow-up (v4.10 / v5.0) + +- **v4.10.0**:残留检测——安装收尾时若检测到 `~/.code-abyss/bin/abyss` 或 settings.json 中含旧 `HOOK_MARKER` 条目,主动告警 + 引导 `abyss attach --force` 接管。 +- **v5.0.0** (BREAKING):物理删除 `bin/lib/abyss-binary.js` (107 行) + `bin/adapters/codex.js` L430-686 (~256 行) + `bin/lib/abyss-integration.js` 中 `injectClaudeHooks` / `injectGeminiHooks` / `stripAbyssHooks` (claude/codex/gemini 部分) + `--with-abyss` / `--with-mcp` flag。`--with-hooks` 永久缩 scope 到 openclaw/pi/hermes。`bin/lib/lifecycle/core-install.js` L466-495 删除 claude/gemini hook 分支。`stripAbyssHooks` 仍保留供 `uninstall.js` 剥除遗留条目。 + +### Companion release + +- **abyss v0.5.24** (telagod/abyss, planned simultaneously) — 仅文档定位反转 patch:`src/attach/mod.rs` 注释升级、`src/attach/openclaw.rs` 错误信息改 `--with-hooks`、`README.md` Pre-edit hooks 段重写、`docs/book/getting-started/agent-hook.md` 整章重写、`CHANGELOG.md` Unreleased entry。Hook shape / skill-manifest schema / hook payload 全不变。 + ## [4.8.2] - 2026-06-25 ### Changed diff --git a/README.md b/README.md index 529e2cf..eb03b81 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@

-

Composable persona · style · 30 engineering skills · 4 native security domains · self-evolution forge · code graph intelligence
for Claude Code · Codex CLI · Gemini CLI · OpenClaw

+

Composable persona · style · 30 engineering skills · 4 native security domains · self-evolution forge
for Claude Code · Codex CLI · Gemini CLI · OpenClaw

+ +

Need code graph intelligence? Use the companion abyss Rust CLI — it auto-attaches its hooks to claude/codex/gemini. The indexing-code skill ships its calling convention; the CLI ships separately.

npm @@ -57,22 +59,25 @@ Pick any persona. Pair it with any style. The behavior layer (iron laws, executi - Office skills slim to under 100 lines each; 4 design systems consolidated into one selector skill - **v4.1 — self-evolution forge**: `cultivating-skills` / `cultivating-personas` let the agent distill repeated workflows into reusable skills, with a safety scan and a three-tier publish funnel (local → project → community) - **v4.4 — hardware + academic writing**: 3 new domain skills (KiCad EDA, hardware product pipeline, AIGC detection reduction) + prompt injection defense + execution-drive shared behavior -- **v4.5 — dynamic persona loading**: only `abyss` ships with npm — all other personas are fetched from GitHub on first use and cached locally, slimming the package -- **v4.6 — code graph intelligence**: `abyss` CLI builds a code relationship graph (call graph + temporal analysis) in seconds — caller tracing, impact analysis, hotspot detection, change coupling. Pre-edit hooks auto-check callers across all 4 platforms -- **v4.7 — measured resolution**: `abyss` v0.3.3 ships four-language reference resolution (Go / TypeScript / Python / Rust), benchmarked against SCIP ground truth across five corpora at ≥98.5% gated precision. Named-import binding tiers, receiver-type inference, and type-grade evidence — published numbers, not claims. `npm install -g @code-abyss/cli` -- **v4.8 — dynamic capability discovery**: code-abyss reads `abyss skill-manifest` when the installed `abyss` is ≥ 0.5.22 — exposed CLI commands, MCP tools, and daemon socket verbs are now discovered at install time instead of hard-coded. `MIN_ABYSS_VERSION` bumped 0.3.0 → 0.5.20 (the 0.5.x line dogfooded across hono / helix / vite / FastAPI / Django / SQLAlchemy). Hand-coded fallbacks are preserved, so older `abyss` installs keep working unchanged. +- **v4.5 — dynamic persona loading**: only the `abyss` persona slug (邪修红尘仙) ships with npm — all other personas are fetched from GitHub on first use and cached locally, slimming the package +- **v4.6 — `indexing-code` skill (calling convention only)**: the `indexing-code` skill ships the calling convention for the external [`abyss`](https://github.com/telagod/abyss) Rust CLI (call graph + temporal analysis). The CLI itself is a separate product with its own release cadence — install it with its own `install.sh` / `cargo binstall` / `@code-abyss/cli` npm wrapper +- **v4.7 — measured resolution (abyss CLI)**: the companion `abyss` Rust CLI ships four-language reference resolution (Go / TypeScript / Python / Rust), benchmarked against SCIP ground truth across five corpora at ≥98.5% gated precision. See its repo for numbers +- **v4.8 — dynamic capability discovery**: code-abyss reads `abyss skill-manifest` when the installed `abyss` CLI is ≥ 0.5.22 — exposed CLI commands, MCP tools, and daemon socket verbs are discovered at install time instead of hard-coded +- **v4.9 — hybrid split deprecation period (2026-06-25)**: `--with-abyss` / `--with-mcp` enter deprecation (removed v5.0). `--with-hooks` splits: claude/codex/gemini move to `abyss attach ` as the production main entrypoint (abyss v0.5.20+); openclaw/pi/hermes stay with code-abyss and `--with-hooks` now auto-spawns `install-hooks.sh` for those three. See [CHANGELOG](CHANGELOG.md) for the migration guide ```bash -npx code-abyss -t claude -y --with-abyss +npx code-abyss -t claude -y # persona / skills / style layer (zero network) +curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash # then install abyss CLI +abyss attach claude # finally, attach the code-graph hook (idempotent) ``` -`--with-abyss` also downloads the `abyss` code-graph binary so the pre-edit hooks work out of the box; add `--with-mcp` to register `abyss` as an MCP server. Swap `-t claude` for `codex` / `gemini` / `openclaw`. Or as a Claude Code plugin: +Swap `-t claude` for `codex` / `gemini` / `openclaw`. For openclaw/pi/hermes (whose hook surface abyss CLI does not own), use `npx code-abyss -t openclaw --with-hooks` to spawn the bundled `install-hooks.sh`. Or as a Claude Code plugin: ```bash claude plugin install code-abyss ``` -> Plain `-y` (no `--with-abyss`) installs only the persona/skills/style layer and skips the network — code-graph hooks stay dormant until `abyss` is on `PATH`. Interactive runs (drop the `-y`) prompt before downloading. Verify code-graph is live with `abyss --version`, then `abyss index` in any project. +> The persona/skills/style layer is fully decoupled from the code-graph CLI — installing code-abyss alone never touches the network beyond fetching remote persona content. `abyss attach ` is idempotent (re-running upgrades shape in place). Verify code-graph is live with `abyss --version`, then `abyss index` in any project. --- diff --git a/bin/adapters/codex.js b/bin/adapters/codex.js index c803125..2e5f682 100644 --- a/bin/adapters/codex.js +++ b/bin/adapters/codex.js @@ -432,6 +432,16 @@ function patchAndReportCodexDefaults({ cfgPath, ok, warn }) { // [[hooks.PreToolUse]] matcher + [[hooks.PreToolUse.hooks]] type/command/timeout // 旧扁平 [hooks.X] 已被 Codex 拒载(invalid type: map, expected a sequence) // MCP: [mcp_servers.abyss] command/args —— 节名是我方命名空间,可自由 upsert。 +// +// ── v4.9.0 hybrid-切割 deprecation 期(2026-06-25 起)── +// +// `abyss attach codex` (abyss CLI v0.5.20+) 是 codex hook 注入的 production 主入口 +// (shape 与本文件 1:1 一致,2026-06-18 abyss v0.5.23 已对齐 ground truth)。下方 +// `injectCodexHooks` / `splitTomlBlocks` / `gatherHookGroup` / `renderCodexHookBlock` +// / `stripCodexAbyssIntegration` (~256 行) 与常量 `ABYSS_HOOK_MARKER` 在 v4.9 保留 +// 行为以维持 `--with-hooks` flag 兼容;install.js 触发时打印 deprecation warning +// 引导用户改用 `abyss attach codex`。v5.0 物理删除上述函数与常量。MCP 注册 +// (mcp_servers.abyss) 仍是 code-abyss 责任,不在切割范围。 const ABYSS_HOOK_MARKER = 'indexing-code/hooks/common'; diff --git a/bin/install.js b/bin/install.js index 8ae6550..b290307 100755 --- a/bin/install.js +++ b/bin/install.js @@ -199,6 +199,7 @@ function discoverAbyssCapabilities() { } async function installTargetFlow(targetName, installOptions = {}) { + emitDeprecationWarnings(targetName); const persona = installOptions.persona || await resolveInstallPersona(); const style = installOptions.style || await resolveInstallStyle(targetName); const packPlan = await resolveProjectPackPlan(targetName); @@ -209,6 +210,7 @@ async function installTargetFlow(targetName, installOptions = {}) { else if (targetName === 'gemini') await postGemini(ctx); else await postOpenClaw(ctx); registerAbyssMcp(targetName, ctx); + maybeSpawnInstallHooks(targetName); finish(ctx); if (ctx.cleanupPreviousBackup) ctx.cleanupPreviousBackup(); } @@ -287,9 +289,12 @@ for (let i = 0; i < args.length; i++) { `); console.log(` ${c.cyn('--target, -t')} <${formatTargetList('|')}> install one target`); console.log(` ${c.cyn('--uninstall, -u')} <${formatTargetList('|')}> remove one target`); - console.log(` ${c.cyn('--with-abyss')} download abyss binary to ~/.code-abyss/bin (code graph index)`); - console.log(` ${c.cyn('--with-mcp')} register abyss MCP server (claude/codex/gemini)`); - console.log(` ${c.cyn('--with-hooks')} inject SessionStart + Edit/Write hooks (opt-in; off by default)`); + console.log(` ${c.cyn('--with-abyss')} ${c.ylw('[DEPRECATED v4.9, removed v5.0]')} download abyss binary;`); + console.log(` use \`curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash\` instead`); + console.log(` ${c.cyn('--with-mcp')} ${c.ylw('[DEPRECATED v4.9, removed v5.0]')} register abyss MCP server;`); + console.log(` add { command: "abyss", args: ["mcp"] } to your MCP client config directly`); + console.log(` ${c.cyn('--with-hooks')} inject hooks (opt-in). claude/codex/gemini: ${c.ylw('[DEPRECATED v4.9]')} use \`abyss attach \`;`); + console.log(` openclaw/pi/hermes: spawns skills/indexing-code/hooks/common/install-hooks.sh (kept in v5.0)`); console.log(` ${c.cyn('--style')} ${c.cyn('--persona')} ${c.cyn('-y')} `); console.log(`${c.b('Examples')}`); @@ -301,6 +306,50 @@ for (let i = 0; i < args.length; i++) { } } +// ── v4.9.0 deprecation 期 helper(2026-06-25 起;见 [[code-abyss-v5-split]] memory + abyss v0.5.24 CHANGELOG) ── +// +// 三 flag 的对外承诺: +// --with-abyss (v4.9 deprecation, v5.0 移除) → abyss 仓库自身的 install.sh / cargo binstall / npm wrapper 接管 +// --with-mcp (v4.9 deprecation, v5.0 移除) → 客户端 MCP 配置直接写 mcpServers.abyss +// --with-hooks 分双 scope: +// • claude/codex/gemini → v4.9 deprecation + 仍 inject;v5.0 移除该路径,引导 abyss attach +// • openclaw/pi/hermes → v4.9 起新增能力:自动 spawn install-hooks.sh(abyss CLI 设计上不接管这三平台);v5.0 永久保留 + +function emitDeprecationWarnings(targetName) { + if (withAbyss) { + process.stderr.write(`${c.ylw('⚠ DEPRECATED')} --with-abyss 将在 v5.0 移除(abyss 二进制分发已转交 abyss 仓库本体)\n`); + process.stderr.write(` ${c.b('迁移:')} ${c.d('curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash')}\n`); + process.stderr.write(` ${c.d('# 或 cargo binstall code-abyss / npm i -g @code-abyss/cli')}\n`); + } + if (withMcp) { + process.stderr.write(`${c.ylw('⚠ DEPRECATED')} --with-mcp 将在 v5.0 移除(MCP 注册由客户端自管)\n`); + process.stderr.write(` ${c.b('迁移:')} 客户端 MCP 配置中添加 ${c.d('mcpServers.abyss = { command: "abyss", args: ["mcp"] }')}\n`); + } + if (withHooks && targetName && ['claude', 'codex', 'gemini'].includes(targetName)) { + process.stderr.write(`${c.ylw('⚠ DEPRECATED')} --with-hooks 对 ${targetName} 将在 v5.0 移除(abyss attach 是 production 主入口)\n`); + process.stderr.write(` ${c.b('迁移:')} ${c.d(`abyss attach ${targetName}`)} ${c.d('# abyss v0.5.20+,幂等')}\n`); + } +} + +// --with-hooks 对 openclaw 的真正能力(v4.9 起):自动 spawn install-hooks.sh。 +// abyss CLI 设计上不接管 openclaw(per-pack layout 单二进制无法可靠创建), +// 所以 code-abyss 是 openclaw hook 注入的唯一入口。pi/hermes 不在 install target 列表, +// 但若未来扩 target 至 pi/hermes,本函数已就位。 +function maybeSpawnInstallHooks(targetName) { + if (!withHooks) return; + if (!['openclaw', 'pi', 'hermes'].includes(targetName)) return; + const scriptPath = path.join(PKG_ROOT, 'skills', 'indexing-code', 'hooks', 'common', 'install-hooks.sh'); + if (!fs.existsSync(scriptPath)) { + warn(`--with-hooks: install-hooks.sh 未找到 (${scriptPath})`); + return; + } + info(`--with-hooks → bash install-hooks.sh ${targetName}`); + const { spawnSync } = require('child_process'); + const r = spawnSync('bash', [scriptPath, targetName], { stdio: 'inherit' }); + if (r.status === 0) ok(`hook 已注入 ${targetName}`); + else warn(`install-hooks.sh ${targetName} 退出码 ${r.status ?? 'n/a'}(不阻断安装)`); +} + // ── Select flows (must be assembled after CLI parsing) ── const { createSelectFlows } = require(path.join(__dirname, 'lib', 'select.js')); diff --git a/bin/lib/abyss-binary.js b/bin/lib/abyss-binary.js index a461c01..214a29a 100644 --- a/bin/lib/abyss-binary.js +++ b/bin/lib/abyss-binary.js @@ -9,6 +9,14 @@ // - 零额外依赖:Node 18+ 内建 fetch + 系统 tar(Windows 10+ 的 bsdtar // 同时支持 .tar.gz 与 .zip),与 abyss npm wrapper 同一套已验证逻辑。 // - 下载失败不阻断安装流程:报告原因 + 给出手动安装路,由 finish 收尾提示。 +// +// ── @deprecated v4.9.0(2026-06-25)── +// +// abyss 二进制分发已转交 abyss 仓库自身的 install.sh / `cargo binstall code-abyss` +// / npm wrapper `@code-abyss/cli`(见 abyss v0.5.24 CHANGELOG)。本文件在 v4.9 +// 保留以兼容 `--with-abyss` flag;install.js 触发时打印 deprecation warning +// 引导用户改用 `curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash`。 +// v5.0 物理删除本文件与 `--with-abyss` flag。 const fs = require('fs'); const path = require('path'); diff --git a/bin/lib/abyss-integration.js b/bin/lib/abyss-integration.js index eaa7ed7..c1727aa 100644 --- a/bin/lib/abyss-integration.js +++ b/bin/lib/abyss-integration.js @@ -14,6 +14,18 @@ // 易失路径的条目也会被同一标记捕获并重锚定。 // - 脚本自带 abyss 存在性守卫,注入不以安装时是否检测到 abyss 为条件—— // 用户后装 abyss 时 hook 自动生效,无需重装。 +// +// ── v4.9.0 hybrid-切割 deprecation 期(2026-06-25 起)── +// +// claude/gemini hook 注入由 `abyss attach ` 接管为 production 主入口 +// (见 abyss v0.5.24+ docs/book/getting-started/agent-hook.md)。本文件的 +// `injectClaudeHooks` / `injectGeminiHooks` / `stripAbyssHooks` 在 v4.9 保留 +// 行为以维持 `--with-hooks` flag 的 backward compatibility,但 install.js +// 触发时会打印 deprecation warning 引导用户改用 `abyss attach`。v5.0 物理 +// 删除这三个函数与相关 export;卸载剥除 (uninstall.js stripAbyssHooks) 与 +// MCP 注册 (injectClaudeMcp/GeminiMcp + removeClaudeMcp) 仍是 code-abyss +// 责任,不在切割范围。openclaw/pi/hermes 不在此文件——它们的 hook 由 +// skills/indexing-code/hooks/common/install-hooks.sh 处理(v5.0 仍保留)。 const fs = require('fs'); const path = require('path'); @@ -47,6 +59,11 @@ function upsertHookEntries(hooks, eventName, entries) { hooks[eventName] = existing.filter((e) => !isAbyssHookEntry(e)).concat(entries); } +/** + * @deprecated v4.9.0 — abyss attach claude 是 production 主入口。 + * 本函数保留行为以维持 `--with-hooks` flag 兼容,v5.0 物理删除。 + * 迁移:`abyss attach claude` (abyss CLI v0.5.20+)。 + */ function injectClaudeHooks(settings, targetDir) { const hookDir = resolveAbyssHookDir(targetDir); if (!settings.hooks || typeof settings.hooks !== 'object') settings.hooks = {}; @@ -69,6 +86,11 @@ function injectClaudeHooks(settings, targetDir) { return hookDir; } +/** + * @deprecated v4.9.0 — abyss attach gemini 是 production 主入口。 + * 本函数保留行为以维持 `--with-hooks` flag 兼容,v5.0 物理删除。 + * 迁移:`abyss attach gemini` (abyss CLI v0.5.20+)。 + */ function injectGeminiHooks(settings, targetDir) { const hookDir = resolveAbyssHookDir(targetDir); if (!settings.hooks || typeof settings.hooks !== 'object') settings.hooks = {}; diff --git a/bin/lib/lifecycle/finish.js b/bin/lib/lifecycle/finish.js index c19c1bc..e855e70 100644 --- a/bin/lib/lifecycle/finish.js +++ b/bin/lib/lifecycle/finish.js @@ -17,24 +17,33 @@ function createFinish(deps) { // indexing-code 的 hook 依赖 abyss 二进制;缺失或过旧时 hook 静默停用/降级, // 必须在安装收尾时显式告知,而不是让用户以为功能已生效。 - function reportAbyssStatus(projectLock) { + // v4.9.0 起引导文案:claude/codex/gemini → `abyss attach ` 是 production 主入口; + // openclaw/pi/hermes → `npx code-abyss -t --with-hooks` 自动跑 install-hooks.sh。 + function reportAbyssStatus(projectLock, targetName) { const detected = detectAbyss(); if (detected && satisfiesMin(detected.version, MIN_ABYSS_VERSION)) { const sourceNote = detected.source === 'managed' ? c.d(' (~/.code-abyss/bin)') : ''; console.log(` ${c.b('abyss:')} ${c.grn(detected.raw)}${sourceNote} — 代码图谱 pre-edit hook 可用`); + // claude/codex/gemini 用户:提示 abyss attach 是 hook 注入主入口(v0.5.20+ 自带 attach 子命令) + if (targetName && ['claude', 'codex', 'gemini'].includes(targetName)) { + console.log(` ${c.d(`hook 注入主入口:`)} ${c.d(`abyss attach ${targetName}`)} ${c.d(`(idempotent; v4.9+ 推荐路径)`)}`); + } } else if (detected) { console.log(''); console.log(` ${c.ylw(`⚠ abyss ${detected.version || detected.raw} 低于最低要求 ${MIN_ABYSS_VERSION} — hook 子命令不可用`)}`); - console.log(` ${c.b('升级:')} ${c.d('npx code-abyss --with-abyss # 或 cargo binstall code-abyss')}`); + console.log(` ${c.b('升级:')} ${c.d('curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash')}`); + console.log(` ${c.d('# 或 cargo binstall code-abyss / npm i -g @code-abyss/cli')}`); } else { console.log(''); console.log(` ${c.ylw('⚠ 未检测到 abyss 二进制 — indexing-code 的代码图谱 hook 将静默停用')}`); - console.log(` ${c.b('安装(任选其一):')}`); - console.log(` ${c.d('npx code-abyss --with-abyss # 重跑安装器,自动下载预编译版')}`); - console.log(` ${c.d('npm install -g @code-abyss/cli')}`); + console.log(` ${c.b('安装 abyss(任选其一):')}`); console.log(` ${c.d('curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash')}`); console.log(` ${c.d('curl -fsSL https://cdn.jsdelivr.net/gh/telagod/abyss@main/install.sh | bash # raw 不可达时的镜像')}`); console.log(` ${c.d('cargo binstall code-abyss # 或 cargo install code-abyss')}`); + console.log(` ${c.d('npm install -g @code-abyss/cli')}`); + if (targetName && ['claude', 'codex', 'gemini'].includes(targetName)) { + console.log(` ${c.b('装好后:')} ${c.d(`abyss attach ${targetName}`)} ${c.d('# 注入 hook 到 settings 文件(v4.9+ 推荐路径,替代 --with-hooks)')}`); + } } // 项目级工具链声明:.code-abyss/packs.lock.json 的 tools.abyss(P2) @@ -109,7 +118,7 @@ function createFinish(deps) { } console.log(` ${c.b('文件:')} ${ctx.manifest.installed.length} 个安装, ${ctx.manifest.backups.length} 个备份`); console.log(` ${c.b('卸载:')} ${c.d(`npx code-abyss --uninstall ${tgt}`)}`); - reportAbyssStatus(projectLock); + reportAbyssStatus(projectLock, tgt); console.log(''); console.log(c.grn(` ✓ 安装完成\n`)); }; diff --git a/package.json b/package.json index 7791fed..31f282b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-abyss", - "version": "4.8.2", - "description": "为 Claude Code / Codex CLI / Gemini CLI / OpenClaw 注入可切换人格、主动执行导向、5种输出风格与30个工程技能(含自我进化炼炉 + 代码关系图智能)", + "version": "4.9.0", + "description": "为 Claude Code / Codex CLI / Gemini CLI / OpenClaw 注入可切换人格、主动执行导向、6种输出风格与30个工程技能(含自我进化炼炉)。代码图谱由独立的 abyss Rust CLI 提供(github.com/telagod/abyss)", "keywords": [ "claude", "claude-code", diff --git a/site/i18n.js b/site/i18n.js index 0575b43..c2a522c 100644 --- a/site/i18n.js +++ b/site/i18n.js @@ -1,18 +1,18 @@ const I18N = { en: { 'site.title': 'Code Abyss — Personality, depth, and a security spine', - 'site.desc': 'Composable persona + style + 30 engineering skills with code graph intelligence, 4 native security domains, and a self-evolution forge. For Claude Code, Codex, Gemini CLI & OpenClaw.', + 'site.desc': 'Composable persona + style + 30 engineering skills with 4 native security domains and a self-evolution forge. For Claude Code, Codex, Gemini CLI & OpenClaw. Code graph intelligence is provided by the separate abyss Rust CLI.', 'nav.how': 'How', 'nav.security': 'Security', - 'nav.graph': 'Graph', + 'nav.graph': 'Companion', 'nav.evolve': 'Evolve', 'nav.personas': 'Personas', 'nav.spec': 'Spec', 'nav.install': 'Install', - 'hero.badge': '4.6 — Code Graph Intelligence · Cross-platform hooks', + 'hero.badge': '4.9 — Hybrid Split Deprecation · abyss CLI separation', 'hero.title.1': 'Give your AI agent', 'hero.title.2': 'a personality.', - 'hero.sub': 'Composable identity, style, and 30 engineering skills
— including code graph intelligence, 4 native security domains, and a self-evolution forge.', + 'hero.sub': 'Composable identity, style, and 30 engineering skills
— including 4 native security domains and a self-evolution forge.', 'hero.browse': 'Browse Personas', 'hero.submit': 'Submit Yours', 'hero.runs': 'Runs on', @@ -153,18 +153,18 @@ const I18N = { }, zh: { 'site.title': 'Code Abyss — 人格、深度,与一根安全脊柱', - 'site.desc': '可组合的人格 + 风格 + 30 项工程技能,含 4 个原生安全领域、自我进化炼炉与代码关系图智能。支持 Claude Code, Codex, Gemini CLI 和 OpenClaw。', + 'site.desc': '可组合的人格 + 风格 + 30 项工程技能,含 4 个原生安全领域与自我进化炼炉。支持 Claude Code, Codex, Gemini CLI 和 OpenClaw。代码图谱由独立的 abyss Rust CLI 提供(github.com/telagod/abyss)。', 'nav.how': '原理', 'nav.security': '安全', - 'nav.graph': '代码图', + 'nav.graph': '协同', 'nav.evolve': '进化', 'nav.personas': '人格', 'nav.spec': '规范', 'nav.install': '安装', - 'hero.badge': '4.6 — 代码关系图智能 · 跨平台 hooks', + 'hero.badge': '4.9 — Hybrid 切割 deprecation 期 · 与 abyss CLI 分家', 'hero.title.1': '给你的 AI 助手', 'hero.title.2': '一个人格。', - 'hero.sub': '可组合的身份、风格,与 30 项工程技能
—— 内含 代码关系图智能4 个原生安全领域自我进化炼炉。', + 'hero.sub': '可组合的身份、风格,与 30 项工程技能
—— 内含 4 个原生安全领域自我进化炼炉。', 'hero.browse': '浏览人格', 'hero.submit': '提交你的', 'hero.runs': '运行于', diff --git a/site/index.html b/site/index.html index 37a9730..ab57180 100644 --- a/site/index.html +++ b/site/index.html @@ -67,7 +67,7 @@

v - 4.5 — Dynamic Persona Loading + 4.9 — Hybrid Split Deprecation · abyss CLI separation

Give your AI agent
diff --git a/skills/indexing-code/SKILL.md b/skills/indexing-code/SKILL.md index eb04cd9..5673892 100644 --- a/skills/indexing-code/SKILL.md +++ b/skills/indexing-code/SKILL.md @@ -100,23 +100,38 @@ abyss stats # 索引统计 ## Hook 自动执行 -**code-abyss 安装器(claude/codex/gemini)会自动注入 hook**,无需手动操作: -hook 命令锚定安装后的 skill 路径(`/skills/indexing-code/hooks/common/`), -幂等注入(重装去重、旧路径自动重锚定),卸载时按标记剥除。 -配套 flag: +Hook 注入按 host 分两条路径(hybrid 切割架构,2026-06-25 锁定): + +**claude / codex / gemini** — 由 abyss CLI 的 `attach` 子命令负责(production 主入口,abyss v0.5.20+): ```sh -npx code-abyss --target claude --with-abyss # 顺带下载 abyss 预编译二进制到 ~/.code-abyss/bin/ -npx code-abyss --target claude --with-mcp # 顺带注册 abyss MCP server(8 tools,opt-in) +abyss attach claude # → ~/.claude/settings.json +abyss attach codex # → ~/.codex/config.toml(Codex 0.125+ 数组表) +abyss attach gemini # → ~/.gemini/settings.json(SessionStart/BeforeTool/AfterTool) +abyss attach all # 三平台一次完成 ``` -二进制查找顺序:PATH → `~/.code-abyss/bin/abyss`(`--with-abyss` 落点,不污染 PATH)。 -两处都没有时 hook 静默停用,后装即生效,无需重装。 +幂等,重跑覆盖旧 shape,不污染其它键。 + +二进制查找顺序:PATH → `~/.code-abyss/bin/abyss`。两处都没有时 hook 静默停用,后装 abyss 即生效,无需重装。 + +> **v4.8.x → v4.9 deprecation 期变更** +> - `--with-hooks` 对 claude/codex/gemini 仍写入 hook,但 install.js 打印 warning 引导改用 `abyss attach `;v5.0 移除该路径(openclaw/pi/hermes 的 `--with-hooks` 永久保留并改造为 spawn install-hooks.sh) +> - `--with-abyss` 下载 abyss 二进制到 `~/.code-abyss/bin/` 进入 deprecation,引导用户改用 `curl -fsSL https://raw.githubusercontent.com/telagod/abyss/main/install.sh | bash`;v5.0 移除 +> - `--with-mcp` 注册 abyss MCP 进入 deprecation,引导用户改用 `abyss mcp` 客户端自配;v5.0 移除 + +**openclaw / pi / hermes** — 由 code-abyss npm 包负责(abyss CLI 不接管这三平台,见 abyss `src/attach/mod.rs` 注释): + +```sh +npx code-abyss --target openclaw --with-hooks # 自动 spawn install-hooks.sh +npx code-abyss --target pi --with-hooks +npx code-abyss --target hermes --with-hooks +``` -其余平台(pi/hermes/openclaw)或脱离安装器时,一条命令手动安装: +或脱离安装器直接跑脚本: ```sh -bash skills/indexing-code/hooks/common/install-hooks.sh auto +bash skills/indexing-code/hooks/common/install-hooks.sh auto # 自动检测平台 ``` 自动检测平台并注入对应 hook 配置(幂等,JSON 合并用 node):