@surething/cockpit 1.0.220 → 1.0.221
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +2 -2
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +1 -1
- package/.next-prod/server/app/_not-found.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +2 -2
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js +2 -2
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +2 -2
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +2 -2
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/pty-input/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route.js +2 -2
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next-prod/server/app/page.js.nft.json +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js.nft.json +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +2 -2
- package/.next-prod/server/chunks/3863.js +2 -2
- package/.next-prod/server/chunks/8555.js +836 -0
- package/.next-prod/server/chunks/8916.js +1 -1
- package/.next-prod/server/chunks/9658.js +3 -3
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +1 -1
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/6345-bab6a02df39cb716.js +14 -0
- package/.next-prod/static/chunks/9403-de4673c851686913.js +29 -0
- package/.next-prod/static/chunks/app/{layout-e3a565f85cbc7298.js → layout-de73b7c59e956b47.js} +1 -1
- package/.next-prod/static/chunks/app/{page-9dfd5af2be962e89.js → page-d539c7c36a32fd49.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-9dfd5af2be962e89.js → page-d539c7c36a32fd49.js} +1 -1
- package/.next-prod/trace +13 -13
- package/.next-prod/trace-build +1 -1
- package/README.md +2 -1
- package/README.zh.md +2 -1
- package/dist/wsServer.mjs +10 -0
- package/package.json +1 -1
- package/.next-prod/server/chunks/9877.js +0 -511
- package/.next-prod/static/chunks/6321-604138b4f668f15d.js +0 -29
- package/.next-prod/static/chunks/6345-59866cd6d074c773.js +0 -14
- /package/.next-prod/static/{3yP7H7dfhCBEDq0V_mbpG → QNr0r0SO5D70hTak_CnhT}/_buildManifest.js +0 -0
- /package/.next-prod/static/{3yP7H7dfhCBEDq0V_mbpG → QNr0r0SO5D70hTak_CnhT}/_ssgManifest.js +0 -0
package/.next-prod/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":20779307,"timestamp":210722173,"id":14,"parentId":1,"tags":{},"startTime":1781283743366,"traceId":"de7a9f0cc4e0ee72"},{"name":"run-typescript","duration":16955561,"timestamp":231511781,"id":1528,"parentId":1,"tags":{},"startTime":1781283764155,"traceId":"de7a9f0cc4e0ee72"},{"name":"static-check","duration":1121392,"timestamp":248512898,"id":1531,"parentId":1,"tags":{},"startTime":1781283781157,"traceId":"de7a9f0cc4e0ee72"},{"name":"static-generation","duration":6044407,"timestamp":249734514,"id":1789,"parentId":1,"tags":{},"startTime":1781283782378,"traceId":"de7a9f0cc4e0ee72"},{"name":"collect-build-traces","duration":19091678,"timestamp":249634994,"id":1786,"parentId":1,"tags":{},"startTime":1781283782279,"traceId":"de7a9f0cc4e0ee72"},{"name":"telemetry-flush","duration":56,"timestamp":268730646,"id":1798,"parentId":1,"tags":{},"startTime":1781283801374,"traceId":"de7a9f0cc4e0ee72"},{"name":"next-build","duration":58175017,"timestamp":210555698,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1781283743199,"traceId":"de7a9f0cc4e0ee72"}]
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Cockpit is the instrument panel. It does **not** replace Claude Code; it stands
|
|
|
49
49
|
| Agent can't reach your browser / DB | **Smart Bubbles**: Chrome, PostgreSQL, MySQL, Redis — drivable by the agent |
|
|
50
50
|
| Reading an unfamiliar repo means a 90-min file-tree scavenger hunt | **Code Map** chip view — caller / callee pins, click to walk the call graph |
|
|
51
51
|
| Reviewing AI output is friction | **LAN-shared review pages**, line-level comments, send any comment back as AI context |
|
|
52
|
-
| Same "do X but don't change code" prompt every day | **Slash modes** `/qa /fx /ex /go /cg /cc` + custom `SKILL.md` via the Skills sidebar |
|
|
52
|
+
| Same "do X but don't change code" prompt every day | **Slash modes** `/qa /fx /ex /go /cg /cc /cr` + custom `SKILL.md` via the Skills sidebar |
|
|
53
53
|
| No automation hooks | One-time / interval / cron-based **scheduled tasks** |
|
|
54
54
|
| "Cloud relay" trust concerns | **Fully local**. No telemetry. Keys (Codex / DeepSeek / Kimi) stay in `~/.cockpit/settings.json` on your laptop. |
|
|
55
55
|
|
|
@@ -107,6 +107,7 @@ Cockpit is the instrument panel. It does **not** replace Claude Code; it stands
|
|
|
107
107
|
- `/go` — **Land**: take a converged plan, slice into MVP stages, write + self-verify per stage, recap at end
|
|
108
108
|
- `/cg` — **CodeGraph** project exploration: 10 HTTP endpoints for symbol / callers / impact / co-edit / risk / affected queries (precise where grep is fuzzy)
|
|
109
109
|
- `/cc` — **Cockpit CLI**: drive the cockpit CLI surface — codegraph subcommands, terminal observation, browser automation
|
|
110
|
+
- `/cr` — **Code review**: full PR review — static triangulation (intent / input domain / surroundings) + dynamic modelling (state diagram + timeline → 6 risk classes), findings ranked by impact × probability
|
|
110
111
|
- **Custom**: drop any `SKILL.md` and add it via the Skills sidebar — it auto-appears in the slash autocomplete menu (see [Skills](#skills--extensibility))
|
|
111
112
|
|
|
112
113
|
### Scheduled tasks — Cron for AI
|
package/README.zh.md
CHANGED
|
@@ -49,7 +49,7 @@ Cockpit 就是那个仪表盘。它**不替代** Claude Code,而是站在官
|
|
|
49
49
|
| Agent 够不到浏览器 / 数据库 | **智能气泡**:Chrome、PostgreSQL、MySQL、Redis —— Agent 可驱动 |
|
|
50
50
|
| 读陌生仓库就是 90 分钟"找地鼠" | **代码地图(Code Map)** chip 视图 —— caller / callee pin 一点即跳 |
|
|
51
51
|
| AI 输出审阅低效 | **局域网共享评审页**、行级评论、任意评论可回喂给 AI |
|
|
52
|
-
| 每天写一遍"做 X 但不要动代码" | **斜杠模式** `/qa /fx /ex /go /cg /cc` + 通过 Skills 侧边栏自定义 `SKILL.md` |
|
|
52
|
+
| 每天写一遍"做 X 但不要动代码" | **斜杠模式** `/qa /fx /ex /go /cg /cc /cr` + 通过 Skills 侧边栏自定义 `SKILL.md` |
|
|
53
53
|
| 没有自动化触发器 | 一次性 / 间隔 / **Cron** **定时任务** |
|
|
54
54
|
| 担心"云端中转" | **完全本地**。无遥测,Codex / DeepSeek / Kimi 的 Key 仅存在本机 `~/.cockpit/settings.json` |
|
|
55
55
|
|
|
@@ -107,6 +107,7 @@ Cockpit 就是那个仪表盘。它**不替代** Claude Code,而是站在官
|
|
|
107
107
|
- `/go` —— **落地**:把收敛后的方案切成 MVP 阶段,每阶段自运行验证,最后端到端回看
|
|
108
108
|
- `/cg` —— **CodeGraph 项目探索**:10 个 HTTP 接口按符号 / 调用关系 / 影响范围 / 协同编辑 / 风险 / 受影响测试精确查询(比 grep 精准)
|
|
109
109
|
- `/cc` —— **Cockpit CLI**:驾驭 cockpit 命令行 —— codegraph 子命令、terminal 观察、browser 自动化
|
|
110
|
+
- `/cr` —— **代码审查**:完整 PR 审查 —— 静态三角校验(意图 / 输入域 / 周遭)+ 动态推演(状态图 + 时间线 → 6 类风险),按 影响 × 概率 排序输出 findings
|
|
110
111
|
- **自定义**:任意 `SKILL.md` 通过 Skills 侧边栏添加 —— 自动出现在斜杠补全菜单(见 [Skills](#skills--可扩展性))
|
|
111
112
|
|
|
112
113
|
### 定时任务 —— 给 AI 的 Cron
|
package/dist/wsServer.mjs
CHANGED
|
@@ -951,6 +951,16 @@ var dispatchMessage = (msg, projectCwd, registry, send) => Effect_exports.sync((
|
|
|
951
951
|
USER: process.env.USER,
|
|
952
952
|
SHELL: process.env.SHELL,
|
|
953
953
|
TERM: "xterm-256color",
|
|
954
|
+
// UTF-8 locale so the pty renders multi-byte text (CJK, emoji) correctly.
|
|
955
|
+
// ptyEnv is rebuilt from scratch (not inherited from process.env), and a
|
|
956
|
+
// macOS `--login` shell does NOT restore LANG (Terminal.app/iTerm inject it,
|
|
957
|
+
// not the rc files) — so without this, vim/less open UTF-8 files in the
|
|
958
|
+
// C/POSIX locale and mojibake every non-ASCII char. Pass the real locale
|
|
959
|
+
// through when present, else fall back to a UTF-8 default; LC_ALL/LC_CTYPE
|
|
960
|
+
// stay undefined (and are skipped below) unless the server actually has them.
|
|
961
|
+
LANG: process.env.LANG ?? "en_US.UTF-8",
|
|
962
|
+
LC_ALL: process.env.LC_ALL,
|
|
963
|
+
LC_CTYPE: process.env.LC_CTYPE,
|
|
954
964
|
FORCE_COLOR: "1",
|
|
955
965
|
CLICOLOR: "1",
|
|
956
966
|
CLICOLOR_FORCE: "1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surething/cockpit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.221",
|
|
4
4
|
"description": "Claude Code GUI for parallel AI coding — drive Claude (default), Codex, DeepSeek, Kimi, or local Ollama in tabs. Multi-project sessions, terminal, browser & DB bubbles, code review, slash modes. Local-first, MIT.",
|
|
5
5
|
"author": "Robert",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=9877,exports.ids=[9877],exports.modules={29877:(a,b,c)=>{c.d(b,{M:()=>e});let d={qa:{zh:`进入需求澄清讨论模式
|
|
2
|
-
尝试理解用户的需求并给出你对需求的理解,有不明确的点需要向我确认,避免理解不一致而导致无效的代码修改
|
|
3
|
-
遵循 KISS 原则
|
|
4
|
-
输出理解,不改代码`,en:`Enter requirement clarification mode.
|
|
5
|
-
Understand the user's needs and state your understanding.
|
|
6
|
-
Ask for clarification on ambiguous points to avoid unnecessary code changes.
|
|
7
|
-
Follow the KISS principle.
|
|
8
|
-
Output your understanding only; do not modify code.`},fx:{zh:"进入bug证据链分析模式,只分析不修改代码,给出详细推理过程",en:`Enter bug evidence chain analysis mode.
|
|
9
|
-
Analyze only; do not modify code.
|
|
10
|
-
Provide a detailed reasoning process.`},ex:{zh:`---
|
|
11
|
-
name: ex
|
|
12
|
-
description: "结构化讨论 skill:用'问题研究 + 假设-验证循环 + 发散-收敛-发散-迭代验证-总结 + What/Why/How + 对比矩阵'方法论分析复杂问题。用户通过 \`/ex\` 显式触发。仅分析不改代码。"
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# ex — 结构化讨论 skill
|
|
16
|
-
|
|
17
|
-
用一套固定的思考骨架分析复杂问题。**只输出分析,不修改代码。**
|
|
18
|
-
|
|
19
|
-
## 入口:复杂度判断
|
|
20
|
-
|
|
21
|
-
收到问题后,**先判断复杂度**:
|
|
22
|
-
|
|
23
|
-
- **简单问题** → 直接简答,**不套方法论**(KISS)
|
|
24
|
-
- **复杂问题** → 走完整方法论骨架(下方 6 步)
|
|
25
|
-
|
|
26
|
-
判断标准(任一即视为复杂):
|
|
27
|
-
- 涉及多个候选方案需要权衡
|
|
28
|
-
- 存在多个可能假设需要验证
|
|
29
|
-
- 跨多个模块/系统/层次
|
|
30
|
-
- 用户明确要求深入讨论
|
|
31
|
-
|
|
32
|
-
## 方法论骨架(仅复杂问题)
|
|
33
|
-
|
|
34
|
-
按顺序一次性走完,**不中途停下问用户**:
|
|
35
|
-
|
|
36
|
-
\`\`\`
|
|
37
|
-
1. 问题研究 用 What / Why / How 三个切面把问题本身研究清楚
|
|
38
|
-
2. 发散 穷举可能的假设、方案、视角
|
|
39
|
-
3. 收敛 筛出 Top 1-3
|
|
40
|
-
4. 再发散 对优选做深入展开(细节、风险、边界条件)
|
|
41
|
-
5. 迭代验证 用代码检索 / Web 搜索 / Bash 实验 验证关键假设
|
|
42
|
-
6. 总结 给结论;若多方案/多假设并排,用对比矩阵
|
|
43
|
-
\`\`\`
|
|
44
|
-
|
|
45
|
-
### What / Why / How 切面(贯穿全流程)
|
|
46
|
-
|
|
47
|
-
- **What**:问题/方案是什么,边界在哪
|
|
48
|
-
- **Why**:为什么会有这个问题、为什么选这个方案
|
|
49
|
-
- **How**:怎么实现、怎么落地、怎么验证
|
|
50
|
-
|
|
51
|
-
## 执行规则
|
|
52
|
-
|
|
53
|
-
### 一次性走完,不打断用户
|
|
54
|
-
|
|
55
|
-
- 全程**不调用 AskUserQuestion**
|
|
56
|
-
- 信息不足时 → 明确标注 **"⚠️ 待补充:xxx"**,由用户后续追问补充
|
|
57
|
-
- 不要因为信息不全就中断流程,能推到哪推到哪
|
|
58
|
-
|
|
59
|
-
### 验证手段
|
|
60
|
-
|
|
61
|
-
允许的验证方式:
|
|
62
|
-
|
|
63
|
-
| 手段 | 工具 | 使用场景 |
|
|
64
|
-
|---|---|---|
|
|
65
|
-
| 代码检索 | Grep / Read / Glob | 在仓库中找证据验证假设 |
|
|
66
|
-
| Web 搜索 | WebSearch / WebFetch | 查官方文档、外部资料 |
|
|
67
|
-
| Bash 实验 | Bash | 跑小命令、测试脚本、curl |
|
|
68
|
-
|
|
69
|
-
**禁止**:通过 AskUserQuestion 向用户提问验证。
|
|
70
|
-
|
|
71
|
-
## 输出规则
|
|
72
|
-
|
|
73
|
-
- **不强制固定输出结构**,按问题特点灵活组织
|
|
74
|
-
- **对比矩阵不是必选项**,仅在"多方案/多假设需要并排比较"时才出
|
|
75
|
-
- 简单问题就简短回答,不要为了套框架而套框架
|
|
76
|
-
|
|
77
|
-
## 不做什么
|
|
78
|
-
|
|
79
|
-
- ❌ 不修改代码(这是讨论 skill,不是实施 skill)
|
|
80
|
-
- ❌ 不中途问用户(一次走完)
|
|
81
|
-
- ❌ 不强制对每个问题都输出对比矩阵
|
|
82
|
-
- ❌ 不和 \`/qa\`、\`/fx\` 抢戏 —— 三者并列,由用户显式选择触发
|
|
83
|
-
`,en:`---
|
|
84
|
-
name: ex
|
|
85
|
-
description: "Structured discussion skill: analyze complex problems with the methodology of 'problem study + hypothesis-verify loop + diverge-converge-diverge-iterate-verify-summarize + What/Why/How + comparison matrix'. Explicitly triggered by the user via \`/ex\`. Analysis only; do not modify code."
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
# ex — structured discussion skill
|
|
89
|
-
|
|
90
|
-
Analyze complex problems with a fixed thinking skeleton. **Output analysis only; do not modify code.**
|
|
91
|
-
|
|
92
|
-
## Entry: complexity check
|
|
93
|
-
|
|
94
|
-
When the question arrives, **first judge complexity**:
|
|
95
|
-
|
|
96
|
-
- **Simple problem** → answer directly, **do not apply the methodology** (KISS)
|
|
97
|
-
- **Complex problem** → run the full 6-step skeleton below
|
|
98
|
-
|
|
99
|
-
Treat as complex if any of these holds:
|
|
100
|
-
- Multiple candidate solutions need trade-off
|
|
101
|
-
- Multiple hypotheses need verification
|
|
102
|
-
- Spans multiple modules / systems / layers
|
|
103
|
-
- The user explicitly asks for deep discussion
|
|
104
|
-
|
|
105
|
-
## Methodology skeleton (complex problems only)
|
|
106
|
-
|
|
107
|
-
Run in order, **in one pass, without stopping to ask the user**:
|
|
108
|
-
|
|
109
|
-
\`\`\`
|
|
110
|
-
1. Problem study Clarify the problem itself through What / Why / How
|
|
111
|
-
2. Diverge Enumerate candidate hypotheses, solutions, perspectives
|
|
112
|
-
3. Converge Pick the top 1-3
|
|
113
|
-
4. Diverge again Deep-dive into the chosen ones (details, risks, edge cases)
|
|
114
|
-
5. Iterate-verify Verify key hypotheses via code search / web search / bash experiments
|
|
115
|
-
6. Summarize Conclude; use a comparison matrix when multiple options sit side by side
|
|
116
|
-
\`\`\`
|
|
117
|
-
|
|
118
|
-
### What / Why / How facets (cross-cutting)
|
|
119
|
-
|
|
120
|
-
- **What**: what is the problem / solution, what is the boundary
|
|
121
|
-
- **Why**: why does this problem exist, why pick this solution
|
|
122
|
-
- **How**: how to implement / land / verify it
|
|
123
|
-
|
|
124
|
-
## Execution rules
|
|
125
|
-
|
|
126
|
-
### Run once, never interrupt the user
|
|
127
|
-
|
|
128
|
-
- **Never call AskUserQuestion**
|
|
129
|
-
- When information is missing → explicitly mark **"⚠️ Pending: xxx"** and let the user follow up later
|
|
130
|
-
- Do not stop just because info is incomplete; push as far as the evidence allows
|
|
131
|
-
|
|
132
|
-
### Verification means
|
|
133
|
-
|
|
134
|
-
Allowed verification tools:
|
|
135
|
-
|
|
136
|
-
| Means | Tools | Use case |
|
|
137
|
-
|---|---|---|
|
|
138
|
-
| Code search | Grep / Read / Glob | Find in-repo evidence for hypotheses |
|
|
139
|
-
| Web search | WebSearch / WebFetch | Look up official docs and external material |
|
|
140
|
-
| Bash experiments | Bash | Run small commands, test scripts, curl |
|
|
141
|
-
|
|
142
|
-
**Forbidden**: verifying by asking the user via AskUserQuestion.
|
|
143
|
-
|
|
144
|
-
## Output rules
|
|
145
|
-
|
|
146
|
-
- **No mandatory output template** — organize by what the problem needs
|
|
147
|
-
- **Comparison matrix is optional** — use it only when multiple options / hypotheses must sit side by side
|
|
148
|
-
- Simple questions get short answers; do not over-frame for the sake of framing
|
|
149
|
-
|
|
150
|
-
## What this skill does NOT do
|
|
151
|
-
|
|
152
|
-
- ❌ Do not modify code (this is a discussion skill, not an implementation skill)
|
|
153
|
-
- ❌ Do not interrupt the user mid-flow (one-shot)
|
|
154
|
-
- ❌ Do not force a comparison matrix on every question
|
|
155
|
-
- ❌ Do not compete with \`/qa\` or \`/fx\` — the three are siblings, triggered explicitly by the user`},go:{zh:`---
|
|
156
|
-
name: go
|
|
157
|
-
description: "基于已有调研结论,按最小可交付可验证拆分原则连续推进落地。每阶段写代码 → 自运行验证 → 输出【交付总结 + 验证报告】 → 自动进入下一阶段,全部完成后再做端到端回看。用于:调研已收敛、用户说『开始落地 / 开始实施 / go』,希望自动连续推进不被中途打断。"
|
|
158
|
-
argument-hint: "[调研结论路径 / 简述 / 留空表示沿用当前会话上文]"
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
# 落地模式 (Landing Mode)
|
|
162
|
-
|
|
163
|
-
把已经收敛的调研结论,按 MVP 自动连续落地,每阶段内闭环验证,全部完成后统一回看。
|
|
164
|
-
|
|
165
|
-
## 触发条件(必须全部满足)
|
|
166
|
-
|
|
167
|
-
1. 调研/方案讨论阶段已结束,结论已收敛
|
|
168
|
-
2. 用户明确要"开始落地 / 实施 / go"
|
|
169
|
-
3. 用户希望自动连续推进,不需要每阶段停下来确认
|
|
170
|
-
|
|
171
|
-
任一不满足,先回 \`qa\` 模式澄清。
|
|
172
|
-
|
|
173
|
-
## 前置检查(开始前必做)
|
|
174
|
-
|
|
175
|
-
确认以下信息**已掌握**,缺一项就停下来问,不要猜:
|
|
176
|
-
|
|
177
|
-
| 项 | 来源 |
|
|
178
|
-
|---|---|
|
|
179
|
-
| 调研结论 | 会话上文 / 用户指定的文档路径 / 直接粘贴 |
|
|
180
|
-
| 落地范围 | 做什么、不做什么 |
|
|
181
|
-
| 验收标准 | 怎么算"端到端跑通" |
|
|
182
|
-
| 工作目录与技术栈 | 项目根路径、语言、框架 |
|
|
183
|
-
|
|
184
|
-
## 执行循环
|
|
185
|
-
|
|
186
|
-
\`\`\`
|
|
187
|
-
while 还有未完成的 MVP 子任务:
|
|
188
|
-
1. 选定下一个最小闭环子任务
|
|
189
|
-
- 可交付:能独立存在的产物
|
|
190
|
-
- 可验证:有明确的运行/检查方式
|
|
191
|
-
2. 写代码(最小变更,KISS)
|
|
192
|
-
3. 自运行验证:跑命令、调接口、看输出,不依赖用户点头
|
|
193
|
-
4. 输出【阶段 N 交付总结 + 验证报告】
|
|
194
|
-
5. 不停顿,进入下一阶段
|
|
195
|
-
end while
|
|
196
|
-
|
|
197
|
-
最后输出【整体回看:端到端交互验证 + 总交付清单】
|
|
198
|
-
\`\`\`
|
|
199
|
-
|
|
200
|
-
## 每阶段输出格式
|
|
201
|
-
|
|
202
|
-
\`\`\`markdown
|
|
203
|
-
### 阶段 N:<子任务名>
|
|
204
|
-
|
|
205
|
-
**交付总结**
|
|
206
|
-
- 目标:<这阶段要达成什么>
|
|
207
|
-
- 变更:
|
|
208
|
-
- <文件1>: <做了什么>
|
|
209
|
-
- <文件2>: <做了什么>
|
|
210
|
-
- 状态:✅ 完成 / ⚠️ 部分完成 / ❌ 阻塞
|
|
211
|
-
|
|
212
|
-
**验证报告**
|
|
213
|
-
- 验证方式:<跑了什么命令 / 调了什么接口>
|
|
214
|
-
- 验证结果:<输出摘要 / 关键指标>
|
|
215
|
-
- 遗留问题:<无 / 列表>
|
|
216
|
-
\`\`\`
|
|
217
|
-
|
|
218
|
-
## 最终回看格式
|
|
219
|
-
|
|
220
|
-
\`\`\`markdown
|
|
221
|
-
## 整体回看
|
|
222
|
-
|
|
223
|
-
### 端到端交互验证
|
|
224
|
-
- 场景:<完整用户流程描述>
|
|
225
|
-
- 步骤:<1 → 2 → 3>
|
|
226
|
-
- 结果:<跑通 / 失败点>
|
|
227
|
-
|
|
228
|
-
### 总交付清单
|
|
229
|
-
| 阶段 | 子任务 | 关键产物 | 状态 |
|
|
230
|
-
|
|
231
|
-
### 已知遗留
|
|
232
|
-
<无 / 列出未解决项及优先级建议>
|
|
233
|
-
\`\`\`
|
|
234
|
-
|
|
235
|
-
## 何时停下来问(仅限三种情况)
|
|
236
|
-
|
|
237
|
-
1. **阻塞性歧义**:缺关键信息无法推进(未知 API 契约、不明业务规则)
|
|
238
|
-
2. **破坏性操作**:删数据、强推远端、改 git 历史等不可逆动作
|
|
239
|
-
3. **方案分叉**:发现调研结论没覆盖的关键选型决策
|
|
240
|
-
|
|
241
|
-
**不要因为以下原因停**:
|
|
242
|
-
- "这步看起来重要要不要确认" → 不要,按 KISS 默认做
|
|
243
|
-
- "可能想这样可能想那样" → 选最简实现继续
|
|
244
|
-
- "完成一阶段汇报等批复" → 不要,直接进下一阶段
|
|
245
|
-
|
|
246
|
-
## 关键原则
|
|
247
|
-
|
|
248
|
-
- **KISS 优于完备**:能跑通的最小实现 > 大而全
|
|
249
|
-
- **运行优于阅读**:实际跑起来验证 > 静态看代码
|
|
250
|
-
- **连续优于停顿**:自动推进 > 频繁问询
|
|
251
|
-
- **回看优于中断**:最后统一 review > 中途打断
|
|
252
|
-
`,en:`---
|
|
253
|
-
name: go
|
|
254
|
-
description: "Based on prior research conclusions, drive landing forward in minimum-deliverable-verifiable slices. Per stage: write code → self-verify → emit [delivery summary + verification report] → auto advance to the next stage; after all stages, do one end-to-end recap. Use when: research is converged, the user says 'start landing / start implementing / go', and wants continuous progress without mid-stage interruption."
|
|
255
|
-
argument-hint: "[research conclusion path / brief / leave empty to reuse current session context]"
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
# Landing Mode (落地模式)
|
|
259
|
-
|
|
260
|
-
Take the already-converged research conclusion and land it as MVP slices continuously and automatically; each stage closes its own verification loop, with one end-to-end recap at the very end.
|
|
261
|
-
|
|
262
|
-
## Trigger conditions (all must hold)
|
|
263
|
-
|
|
264
|
-
1. The research / discussion phase has ended and the conclusion has converged
|
|
265
|
-
2. The user explicitly says "start landing / implement / go"
|
|
266
|
-
3. The user wants continuous, automatic progress without per-stage confirmation
|
|
267
|
-
|
|
268
|
-
If any condition fails, fall back to \`qa\` mode for clarification first.
|
|
269
|
-
|
|
270
|
-
## Pre-flight check (mandatory before starting)
|
|
271
|
-
|
|
272
|
-
Confirm the following are **in hand**; if any is missing, stop and ask — do not guess:
|
|
273
|
-
|
|
274
|
-
| Item | Source |
|
|
275
|
-
|---|---|
|
|
276
|
-
| Research conclusion | Session context / a path the user gives / pasted text |
|
|
277
|
-
| Landing scope | What's in, what's out |
|
|
278
|
-
| Acceptance criteria | What counts as "end-to-end runs" |
|
|
279
|
-
| Working directory and stack | Project root path, language, framework |
|
|
280
|
-
|
|
281
|
-
## Execution loop
|
|
282
|
-
|
|
283
|
-
\`\`\`
|
|
284
|
-
while there are unfinished MVP sub-tasks:
|
|
285
|
-
1. Pick the next minimum closed-loop sub-task
|
|
286
|
-
- Deliverable: a standalone artifact
|
|
287
|
-
- Verifiable: a clear way to run / check it
|
|
288
|
-
2. Write code (minimum change, KISS)
|
|
289
|
-
3. Self-verify: run commands, hit endpoints, read output — do not wait for the user's nod
|
|
290
|
-
4. Emit [Stage N delivery summary + verification report]
|
|
291
|
-
5. No pause; proceed to the next stage
|
|
292
|
-
end while
|
|
293
|
-
|
|
294
|
-
Finally emit [Overall recap: end-to-end interaction verification + total delivery list]
|
|
295
|
-
\`\`\`
|
|
296
|
-
|
|
297
|
-
## Per-stage output format
|
|
298
|
-
|
|
299
|
-
\`\`\`markdown
|
|
300
|
-
### Stage N: <sub-task name>
|
|
301
|
-
|
|
302
|
-
**Delivery summary**
|
|
303
|
-
- Goal: <what this stage achieves>
|
|
304
|
-
- Changes:
|
|
305
|
-
- <file1>: <what was done>
|
|
306
|
-
- <file2>: <what was done>
|
|
307
|
-
- Status: ✅ done / ⚠️ partial / ❌ blocked
|
|
308
|
-
|
|
309
|
-
**Verification report**
|
|
310
|
-
- How verified: <commands run / endpoints called>
|
|
311
|
-
- Result: <output summary / key metrics>
|
|
312
|
-
- Residual issues: <none / list>
|
|
313
|
-
\`\`\`
|
|
314
|
-
|
|
315
|
-
## Final recap format
|
|
316
|
-
|
|
317
|
-
\`\`\`markdown
|
|
318
|
-
## Overall recap
|
|
319
|
-
|
|
320
|
-
### End-to-end interaction verification
|
|
321
|
-
- Scenario: <full user-flow description>
|
|
322
|
-
- Steps: <1 → 2 → 3>
|
|
323
|
-
- Result: <passes / failure points>
|
|
324
|
-
|
|
325
|
-
### Total delivery list
|
|
326
|
-
| Stage | Sub-task | Key artifact | Status |
|
|
327
|
-
|
|
328
|
-
### Known residuals
|
|
329
|
-
<none / list with suggested priority>
|
|
330
|
-
\`\`\`
|
|
331
|
-
|
|
332
|
-
## When to stop and ask (only three cases)
|
|
333
|
-
|
|
334
|
-
1. **Blocking ambiguity**: a key piece of info is missing and progress is impossible (unknown API contract, unclear business rule)
|
|
335
|
-
2. **Destructive operation**: deleting data, force-pushing, rewriting git history, or other irreversible actions
|
|
336
|
-
3. **Branching decision**: a key design choice the research did not cover
|
|
337
|
-
|
|
338
|
-
**Do NOT stop for**:
|
|
339
|
-
- "This step looks important, should I confirm?" → No, do the KISS default
|
|
340
|
-
- "Maybe this way, maybe that way" → Pick the simplest implementation and continue
|
|
341
|
-
- "Done with a stage, awaiting sign-off" → No, go straight to the next stage
|
|
342
|
-
|
|
343
|
-
## Key principles
|
|
344
|
-
|
|
345
|
-
- **KISS over completeness**: a minimal runnable implementation > grand-and-complete
|
|
346
|
-
- **Running over reading**: actually run it to verify > stare at code
|
|
347
|
-
- **Continuous over pausing**: auto-advance > frequent asking
|
|
348
|
-
- **Recap over interruption**: one final review > mid-flow breaks
|
|
349
|
-
`},cg:{zh:`进入项目图谱探索模式(CodeGraph)
|
|
350
|
-
|
|
351
|
-
CodeGraph = 项目预建的符号 + 调用图索引 + git 协同视图。6 个接口各回答一类问题:
|
|
352
|
-
|
|
353
|
-
| 问题 | 接口 |
|
|
354
|
-
|---|---|
|
|
355
|
-
| X 在哪定义 / 有哪些同名符号? | search?q=X |
|
|
356
|
-
| 谁调用 X? | callers?qname=X |
|
|
357
|
-
| X 调用了什么? | callees?qname=X |
|
|
358
|
-
| 改 X 会影响哪些符号? | impact?qname=X&depth=2 |
|
|
359
|
-
| 文件 F 有哪些符号? | file?path=F |
|
|
360
|
-
| 文件 F 常和哪些文件一起改?(约定耦合 / 双写注册表) | coedit?filePath=F |
|
|
361
|
-
|
|
362
|
-
所有响应都是坐标 / 文件路径,不含源码——比 grep 字面匹配精确,比 Read 全文扫描省 token。
|
|
363
|
-
|
|
364
|
-
## 6 个图谱接口({{BASE_URL}})
|
|
365
|
-
|
|
366
|
-
# search: 按名字找符号 → file / qname / kind / startLine / endLine / params
|
|
367
|
-
# q 自动做命名风格归一:user_profile / userProfile / user-profile / USER_PROFILE 等价
|
|
368
|
-
# 加 includeLiterals=true 时,还搜源码里的字符串字面量(tool 名 / 事件名 / 配置 key / 路由路径
|
|
369
|
-
# 等"长得像名字但不是 identifier"的字符串),返回字段多一个 literals[],每项含 value/filePath/line/enclosingSymbol
|
|
370
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/search?cwd=$PWD&q=<NAME>"
|
|
371
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/search?cwd=$PWD&q=<NAME>&includeLiterals=true"
|
|
372
|
-
|
|
373
|
-
# callers / callees: 1-hop 调用关系
|
|
374
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/callers?cwd=$PWD&qname=<QNAME>"
|
|
375
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/callees?cwd=$PWD&qname=<QNAME>"
|
|
376
|
-
|
|
377
|
-
# impact: 传递性 callers BFS(depth 1-5,默认 2)
|
|
378
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/impact?cwd=$PWD&qname=<QNAME>&depth=2"
|
|
379
|
-
|
|
380
|
-
# file: 文件符号树(无源码)
|
|
381
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/file?cwd=$PWD&path=<REL_PATH>"
|
|
382
|
-
|
|
383
|
-
# coedit: 与目标文件协同编辑的文件 = git log 历史 + 当前 working tree 同时被改的文件
|
|
384
|
-
# 抓 call-graph 抓不到的"约定耦合"(平行注册表 / 双写 / 同名 .md 配置等)
|
|
385
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/coedit?cwd=$PWD&filePath=<REL_PATH>"
|
|
386
|
-
|
|
387
|
-
## 技术契约
|
|
388
|
-
- 接口只返坐标,源码用 Read 自取:\`Read offset=startLine limit=endLine-startLine+1\`
|
|
389
|
-
- qname 用 \`Parent>Child\` 形式(不是 \`.\`),直接复用 search 返回的 \`qualifiedName\`
|
|
390
|
-
- 同名符号跨多文件时响应里 \`ambiguousIn\` 列出,加 \`&filePath=<rel>\` 消歧
|
|
391
|
-
|
|
392
|
-
## 3 个进阶接口(智能排序 / 关联 / 风险)
|
|
393
|
-
|
|
394
|
-
当基础 6 个接口的纯结构信息不够用 —— 尤其在"探索式追代码"或"评估影响范围"时 —— 用这 3 个接口拿到带相关性评分和风险标注的结果。
|
|
395
|
-
|
|
396
|
-
| 问题 | 接口 |
|
|
397
|
-
|---|---|
|
|
398
|
-
| 这个问题/光标位置相关的代码在哪? | context?query=&cursor= |
|
|
399
|
-
| 看 X 时,还应该顺手看哪些相关代码? | related?qname=X |
|
|
400
|
-
| 改 X 真正高风险的少数节点是哪些?哪些测试要跑? | risk?qname=X |
|
|
401
|
-
| 改了这些文件,CI 应该跑哪些测试文件?(保守闭包) | affected?files=… |
|
|
402
|
-
|
|
403
|
-
# context: 多源种子语义检索(query / cursor / openFiles 任传其一)
|
|
404
|
-
# 返回 Top-K 相关坐标 + signals(query-match / ppr / pagerank / open)
|
|
405
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/context?cwd=$PWD&query=<TEXT>&cursor=<FILE>::<QNAME>&topK=15"
|
|
406
|
-
|
|
407
|
-
# related: 比 callers/callees 更广,纳入 coedit / PPR 邻居 / Louvain 社区
|
|
408
|
-
# 每个结果带 relations 数组:caller / callee / ppr-neighbor / frequent-coedit / sibling-in-community
|
|
409
|
-
# 同名跨多文件时响应里 ambiguousIn 列出,加 &filePath=<rel> 消歧(同 callers/callees 行为)
|
|
410
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/related?cwd=$PWD&qname=<QNAME>&topK=10"
|
|
411
|
-
|
|
412
|
-
# risk: impact 的风险化版本
|
|
413
|
-
# 返回 highRisk(按 risk.score 降序) + suggestedTests 建议运行的测试文件
|
|
414
|
-
# risk.score = callFreq + coeditProb + (hasTest ? 0 : penalty) + pagerank,按 depth 衰减
|
|
415
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/risk?cwd=$PWD&qname=<QNAME>&depth=2&topK=20"
|
|
416
|
-
|
|
417
|
-
# affected: 给定一组改动文件,沿 importedBy 闭包返回受影响的测试文件
|
|
418
|
-
# 与 risk 互补:risk 给人/LLM 看(按符号、精准),affected 给 CI/管道用(按文件、保守)
|
|
419
|
-
# 多文件输入用 POST,URL 太长用 POST;要纯文本输出用 format=plain
|
|
420
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/affected?cwd=$PWD&files=<a.ts,b.ts>&depth=10"
|
|
421
|
-
|
|
422
|
-
## 进阶接口契约
|
|
423
|
-
- \`score\` / \`risk.score\` 只用于排序参考,无绝对意义
|
|
424
|
-
- \`signals\` / \`relations\` / \`tags\` 是"为什么相关"的解释,引用时可直接告诉用户
|
|
425
|
-
- \`degraded: true\` 时结果仍可用,但精度降低;\`degradedReason\` 给出原因(\`analytics-warming\` 表示后台索引还在预热,\`coedit-unavailable\` 表示 git 历史信号不可用,回落手工挑测试)
|
|
426
|
-
- **risk / related 响应里已经带 \`coedit\` 字段**(target 文件的 coedit 历史),同一文件不要再单独发 /coedit 请求
|
|
427
|
-
- related 响应若有 \`ambiguousIn\`,表示同名符号跨多文件,下次调用补 \`&filePath=\`
|
|
428
|
-
- 这 3 个接口同样只返坐标,源码用 Read 自取`,en:`Enter project graph exploration mode (CodeGraph).
|
|
429
|
-
|
|
430
|
-
CodeGraph = pre-built symbol + call-graph index + git co-edit view. Six endpoints, each answers one class of question:
|
|
431
|
-
|
|
432
|
-
| Question | Endpoint |
|
|
433
|
-
|---|---|
|
|
434
|
-
| Where is X defined / which files share the name? | search?q=X |
|
|
435
|
-
| Who calls X? | callers?qname=X |
|
|
436
|
-
| What does X call? | callees?qname=X |
|
|
437
|
-
| Changing X affects which symbols? | impact?qname=X&depth=2 |
|
|
438
|
-
| What symbols does file F contain? | file?path=F |
|
|
439
|
-
| Which files are commonly edited alongside F? (conventional coupling / parallel registries) | coedit?filePath=F |
|
|
440
|
-
|
|
441
|
-
All responses are coordinates / file paths — never source. More precise than grep's textual match, cheaper in tokens than Reading whole files.
|
|
442
|
-
|
|
443
|
-
## The 6 graph endpoints ({{BASE_URL}})
|
|
444
|
-
|
|
445
|
-
# search: find symbols by name → file / qname / kind / startLine / endLine / params
|
|
446
|
-
# q is normalized for naming style: user_profile / userProfile / user-profile / USER_PROFILE are equivalent
|
|
447
|
-
# Pass includeLiterals=true to also search identifier-shaped string literals (tool names, event names,
|
|
448
|
-
# config keys, route paths — the "looks like a name but isn't an identifier" strings). The response
|
|
449
|
-
# then carries an extra literals[] array with value / filePath / line / enclosingSymbol per hit.
|
|
450
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/search?cwd=$PWD&q=<NAME>"
|
|
451
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/search?cwd=$PWD&q=<NAME>&includeLiterals=true"
|
|
452
|
-
|
|
453
|
-
# callers / callees: 1-hop call relations
|
|
454
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/callers?cwd=$PWD&qname=<QNAME>"
|
|
455
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/callees?cwd=$PWD&qname=<QNAME>"
|
|
456
|
-
|
|
457
|
-
# impact: transitive callers BFS (depth 1-5, default 2)
|
|
458
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/impact?cwd=$PWD&qname=<QNAME>&depth=2"
|
|
459
|
-
|
|
460
|
-
# file: file symbol tree (no source)
|
|
461
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/file?cwd=$PWD&path=<REL_PATH>"
|
|
462
|
-
|
|
463
|
-
# coedit: files commonly edited alongside the target = git log history + current working-tree co-edits
|
|
464
|
-
# catches "conventional coupling" the call-graph can't see (parallel registries / double-writes / sibling .md configs)
|
|
465
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/coedit?cwd=$PWD&filePath=<REL_PATH>"
|
|
466
|
-
|
|
467
|
-
## Technical contract
|
|
468
|
-
- Endpoints return coordinates only. Fetch source with Read: \`Read offset=startLine limit=endLine-startLine+1\`
|
|
469
|
-
- qname uses \`Parent>Child\` form (not \`.\`); copy \`qualifiedName\` from search's response directly
|
|
470
|
-
- Cross-file name collisions are listed in \`ambiguousIn\` — pass \`&filePath=<rel>\` to disambiguate
|
|
471
|
-
|
|
472
|
-
## Three advanced endpoints (smart ranking / relatedness / risk)
|
|
473
|
-
|
|
474
|
-
When the six base endpoints' pure structural data isn't enough — especially when exploring code or evaluating change impact — use these to get scored, signal-annotated results.
|
|
475
|
-
|
|
476
|
-
| Question | Endpoint |
|
|
477
|
-
|---|---|
|
|
478
|
-
| Where is the code related to this question / cursor? | context?query=&cursor= |
|
|
479
|
-
| What else should I read while looking at X? | related?qname=X |
|
|
480
|
-
| Changing X — which few nodes truly matter? Which tests to run? | risk?qname=X |
|
|
481
|
-
| Changed these files — which tests should CI run? (conservative closure) | affected?files=… |
|
|
482
|
-
|
|
483
|
-
# context: multi-source semantic retrieval (query / cursor / openFiles — at least one)
|
|
484
|
-
# Returns Top-K relevant coordinates + signals (query-match / ppr / pagerank / open)
|
|
485
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/context?cwd=$PWD&query=<TEXT>&cursor=<FILE>::<QNAME>&topK=15"
|
|
486
|
-
|
|
487
|
-
# related: broader than callers/callees — includes coedit / PPR neighbours / Louvain community
|
|
488
|
-
# Each result carries a relations[] array: caller / callee / ppr-neighbor / frequent-coedit / sibling-in-community
|
|
489
|
-
# Cross-file name collisions are listed in ambiguousIn — pass &filePath=<rel> to disambiguate (same as callers/callees)
|
|
490
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/related?cwd=$PWD&qname=<QNAME>&topK=10"
|
|
491
|
-
|
|
492
|
-
# risk: risk-scored impact
|
|
493
|
-
# Returns highRisk (sorted by risk.score desc) + suggestedTests
|
|
494
|
-
# risk.score = callFreq + coeditProb + (hasTest ? 0 : penalty) + pagerank, decayed by depth
|
|
495
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/risk?cwd=$PWD&qname=<QNAME>&depth=2&topK=20"
|
|
496
|
-
|
|
497
|
-
# affected: file-level reverse-import closure → test files transitively affected
|
|
498
|
-
# Sister to /risk: risk is symbol-centric + precision-oriented (for analysis),
|
|
499
|
-
# affected is file-centric + recall-oriented (for CI / selective-test pipelines).
|
|
500
|
-
# Use POST when files list is large; use format=plain for newline-separated paths.
|
|
501
|
-
curl -fsS "{{BASE_URL}}/api/projectGraph/affected?cwd=$PWD&files=<a.ts,b.ts>&depth=10"
|
|
502
|
-
|
|
503
|
-
## Advanced endpoint contract
|
|
504
|
-
- \`score\` / \`risk.score\` are for ranking only; absolute values have no meaning
|
|
505
|
-
- \`signals\` / \`relations\` / \`tags\` explain WHY each result is relevant — feel free to cite them to the user
|
|
506
|
-
- \`degraded: true\` means results are still usable but lower precision; \`degradedReason\` gives the cause (\`analytics-warming\` = backing index warming up; \`coedit-unavailable\` = git history signal unavailable, fall back to manually picking tests)
|
|
507
|
-
- **risk / related responses already include a \`coedit\` field** (target file's coedit history) — DO NOT issue a separate /coedit request for the same file
|
|
508
|
-
- If related returns \`ambiguousIn\`, the same qname exists in multiple files — retry with \`&filePath=<rel>\`
|
|
509
|
-
- These three endpoints also return coordinates only; fetch source with Read`,labelZh:"探索问题:",labelEn:"Exploration: "},cc:{zh:'进入 Cockpit CLI 操作模式\n\nCockpit CLI 是本机 Cockpit server 的瘦客户端:每个调用都把请求转发到正在跑的 server,复用其索引、缓存、git 视图等。\n\nCLI 入口选择(**默认 = prod**):\n\n- 默认用 **`cockpit`**(prod,端口 3457)—— 没有明确信号就用这个\n- 仅在用户**明确给出 dev 信号**时才换成 `cockpit-dev`(dev,端口 3456),两种信号:\n 1. 任务文本里直接写了 `cockpit-dev ...`\n 2. `/cc` 后第一个词是 `dev`(例:`/cc dev terminal bmfb 看错误`)\n- `cock` 是 `cockpit` 的 prod 短别名,行为一致;dev 无对应短别名\n\n下文统一写 `cockpit`,仅在上述 dev 信号触发时替换为 `cockpit-dev`。\n\n## 子命令\n\n| 子命令 | 用途 |\n|---|---|\n| (无) / `<path>` | 启动 server,打开项目 |\n| `browser <id> <action>` | 控制浏览器气泡 |\n| `terminal <id> [<action>]` | 只读观察终端 ring buffer |\n| `codegraph <subcmd>` | 项目代码图(search/callers/callees/impact/file/coedit/context/related/risk/affected) |\n| `update` | 升级到最新 npm 版本 |\n\n## 典型用法模式\n\nUI 上的 terminal / browser 气泡带一个 4 字符短 id(如 `bmfb` / `mpcw`)。用户输入 `/cc` 后通常跟一段 `cockpit <subcmd> <id> <要做的事>` 描述,例如:\n\n```\n/cc cockpit terminal bmfb 看一下最近的错误日志 ← 默认 prod (cockpit)\n/cc cockpit browser mpcw 截图当前页面 ← 默认 prod (cockpit)\n/cc cockpit codegraph risk searchIndex 评估改这个的影响 ← 默认 prod (cockpit)\n/cc dev terminal aqou 看一下错误 ← dev 信号 #2 → 用 cockpit-dev\n/cc cockpit-dev codegraph file packages/... ← dev 信号 #1 → 用 cockpit-dev\n```\n\n收到这类输入时:\n1. 把 `<id>` 当作具体的气泡标识传给对应子命令\n2. 先跑 `cockpit <subcmd> <id>`(或 `<subcmd> --help`)看支持的 action\n3. 选合适的 action 执行用户任务\n\n## 先看气泡清单(不知道用哪个 id 时)\n\n当用户用 "alloydb 那个 terminal" / "看一下后台" 这种**语义指代**而非具体 id 时,先用 `connection list` 拿到当前项目所有气泡 + 用户起的 title:\n\n```bash\ncockpit connection list --cwd $PWD\n```\n\n输出每行:`<type> <shortId> <title> <projectCwd> <command-or-url>`(TAB 分隔)。按 title 匹配用户的语义指代挑出 `<shortId>`,再走「典型用法模式」。title 没设的气泡显示为 `(none)`,此时可结合 `<command>` 字段(terminal 的命令字符串 / browser 的 URL)区分。\n\n## 获取详细用法\n\n每个子命令的 `--help` 是 canonical reference,**包含 usage / flags / 输出格式 / exit code / 示例**。先看 help 再用:\n\n```bash\ncockpit --help\ncockpit <subcommand> --help\ncockpit codegraph <subsubcmd> --help\n```',en:"Enter Cockpit CLI operation mode.\n\nThe Cockpit CLI is a thin local client over the running Cockpit server: each invocation forwards to the server and reuses its CodeIndex / caches / git views.\n\nCLI entry point selection (**default = prod**):\n\n- Default: **`cockpit`** (prod, port 3457) — use this when no explicit dev signal is given.\n- Switch to `cockpit-dev` (dev, port 3456) ONLY when the user explicitly signals dev mode, via one of:\n 1. They write `cockpit-dev ...` directly in the task text.\n 2. The first word after `/cc` is `dev` (e.g. `/cc dev terminal bmfb check the errors`).\n- `cock` is the prod-only short alias of `cockpit`; behaviour is identical. There is no short alias for dev.\n\nExamples below use `cockpit`; only swap in `cockpit-dev` when one of the two dev signals above is present.\n\n## Subcommands\n\n| Subcommand | Purpose |\n|---|---|\n| (none) / `<path>` | Start server, open project |\n| `browser <id> <action>` | Drive browser bubbles |\n| `terminal <id> [<action>]` | Read-only observation of a terminal ring buffer |\n| `codegraph <subcmd>` | Project code graph (search/callers/callees/impact/file/coedit/context/related/risk/affected) |\n| `update` | Upgrade to latest npm version |\n\n## Typical usage pattern\n\nTerminal / browser bubbles in the UI carry a 4-char short id (e.g. `bmfb` / `mpcw`). After `/cc` users typically follow with `cockpit <subcmd> <id> <what to do>`, e.g.:\n\n```\n/cc cockpit terminal bmfb look at the recent error logs ← default prod (cockpit)\n/cc cockpit browser mpcw take a screenshot of the current page ← default prod (cockpit)\n/cc cockpit codegraph risk searchIndex assess the impact ← default prod (cockpit)\n/cc dev terminal aqou check the errors ← dev signal #2 → use cockpit-dev\n/cc cockpit-dev codegraph file packages/... ← dev signal #1 → use cockpit-dev\n```\n\nWhen you receive such input:\n1. Treat `<id>` as the concrete bubble identifier and pass it to the subcommand\n2. Run `cockpit <subcmd> <id>` (or `<subcmd> --help`) first to see supported actions\n3. Pick the right action to fulfil the user's task\n\n## When you don't know which id to use — list bubbles first\n\nIf the user refers to a bubble semantically (\"the alloydb proxy terminal\" / \"the admin page\") rather than by id, list every bubble in the current project — each one carries any user-set title:\n\n```bash\ncockpit connection list --cwd $PWD\n```\n\nOutput rows are TAB-separated: `<type> <shortId> <title> <projectCwd> <command-or-url>`. Match the user's reference against the title, take the `<shortId>`, then proceed with the typical usage pattern. Unnamed bubbles show `(none)` for title — fall back to the `<command>` column (terminal's command string / browser's URL) to disambiguate.\n\n## Getting detailed usage\n\nEvery subcommand's `--help` is the canonical reference — **it includes usage, flags, output format, exit codes, and examples.** Read it first:\n\n```bash\ncockpit --help\ncockpit <subcommand> --help\ncockpit codegraph <subsubcmd> --help\n```",labelZh:"任务:",labelEn:"Task: "}};function e(a,b="en",c){var f,g;let h,i=a.trimStart(),j=i.match(/^\/([a-zA-Z]+)(?:\s+|$)/);if(!j)return a;let k=j[1],l=b.startsWith("zh")?"zh":"en",m=d[k],n=m?.[l];if(!n)return a;let o=function(a){if(a){let b=new URL(a.url),c=a.headers.get("x-forwarded-proto"),d=a.headers.get("x-forwarded-host");return c||d?`${c??b.protocol.replace(":","")}://${d??b.host}`:b.origin}let b=process.env.COCKPIT_PORT||process.env.PORT||"3457";return`http://localhost:${b}`}(c),p=n.replaceAll("{{BASE_URL}}",o),q=i.slice(j[0].length).trimStart(),r=(f=m,(h="zh"===(g=l)?f.labelZh:f.labelEn)||("zh"===g?"问题:":"Question: "));return q?`${p}
|
|
510
|
-
|
|
511
|
-
${r}${q}`:p}}};
|