Goal
Bring claude to full three-mode alignment like pi / opencode / dsh already have:
- Mode 1 — proxy (URL prefix, exists today via launcher)
- Mode 2 — launcher (
bili claude — exists)
- Mode 3 — native plugin (
bili plugin install claude — the gap): plugin loaded by the CLIENT itself, spawns/attaches its own proxy, rewrites model traffic, registers ACP tools natively, stamps plugin-mode headers, implements the runtime-info protocol.
Feasibility pre-assessment
hooks/MCP only
LOW-MEDIUM — Claude Code exposes hooks (shell commands), MCP, skills, but no in-process wire-interception API is documented. If no wire hook exists, full native mode is structurally out; document the best achievable posture (e.g. native TOOLS via MCP + wire via proxy) and stop there — do NOT ship a hybrid without discussing the design in this issue first.
Reference implementations (read these first)
Requirements if feasible
- No launcher, no env vars, no fixed port for the end user; opt-out env
BILI_NATIVE_CLAUDE=0
- Plugin-mode gating: stamp
x-bili-plugin ONLY after native tools are registered (round 1 rides wire mode)
- Parent-pid watchdog proxy teardown; attach to a healthy proxy when present
- Runtime-info stamps (model + contextWindow + maxOutput whenever the client exposes them)
npm run typecheck + npm test + npm run build green; new tests for the plugin module (see tests/dsh-native.test.ts for the harness style)
- README (en + zh) client table + install section updated
If NOT feasible
Post the evidence (what extension points exist, why wire interception / native tools are impossible) and close as wontfix — a documented no is a deliverable too.
For ework
This issue is directly implementable. Follow the dsh playbook; ask in this thread before inventing new protocol surface. PR must reference this issue (Fixes #N).
Goal
Bring
claudeto full three-mode alignment like pi / opencode / dsh already have:bili claude— exists)bili plugin install claude— the gap): plugin loaded by the CLIENT itself, spawns/attaches its own proxy, rewrites model traffic, registers ACP tools natively, stamps plugin-mode headers, implements the runtime-info protocol.Feasibility pre-assessment
hooks/MCP only
LOW-MEDIUM — Claude Code exposes hooks (shell commands), MCP, skills, but no in-process wire-interception API is documented. If no wire hook exists, full native mode is structurally out; document the best achievable posture (e.g. native TOOLS via MCP + wire via proxy) and stop there — do NOT ship a hybrid without discussing the design in this issue first.
Reference implementations (read these first)
src/agent/dsh-native.ts— cleanest full native (dynamic service inject, fetch patch, header gating, runtime-info stamps). PR feat: dsh native mode — full plugin viabili plugin install dsh+ upgraded launcher (#941) #942 / issue dsh: full plugin/native mode (mode 3) + upgrade launcher to plugin-mode compression (mode 2) #941.src/agent/opencode-native.ts(v1) +src/agent/opencode-v2.ts— config/catalog-based window+output maps, legacy-lane routing. PRs feat: OpenCode 1.x native support — V1 .server() hooks on the standard install path #919/feat: v1 legacy-lane routing — opencode-acp old sessions keep working, new sessions go to bili (#920) #921.src/agent/pi.ts/src/agent/pi-native.ts— header stamping discipline (toolsReady gate).src/plugin-install.ts(bili plugin install <client>); launcher wiring:src/launcher.ts.x-bili-plugin-context-window/x-bili-plugin-max-output/x-bili-plugin-model(gated onx-bili-plugin) + bootstrapPOST /__bili/plugin/runtime-info. README "Runtime-info protocol" table is the contract — follow it exactly.Requirements if feasible
BILI_NATIVE_CLAUDE=0x-bili-pluginONLY after native tools are registered (round 1 rides wire mode)npm run typecheck+npm test+npm run buildgreen; new tests for the plugin module (see tests/dsh-native.test.ts for the harness style)If NOT feasible
Post the evidence (what extension points exist, why wire interception / native tools are impossible) and close as
wontfix— a documented no is a deliverable too.For ework
This issue is directly implementable. Follow the dsh playbook; ask in this thread before inventing new protocol surface. PR must reference this issue (
Fixes #N).