Skip to content

[native] claude: three-mode alignment (proxy / launcher / native plugin) + runtime-info #964

Description

@ranxianglei

Goal

Bring claude to full three-mode alignment like pi / opencode / dsh already have:

  1. Mode 1 — proxy (URL prefix, exists today via launcher)
  2. Mode 2 — launcher (bili claude — exists)
  3. 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions