feat(zcode): integrate ZCode as a built-in agent - #768
Open
asteroida123 wants to merge 6 commits into
Open
asteroida123 wants to merge 6 commits into
asteroida123 wants to merge 6 commits into
Conversation
ZCode becomes the sixteenth built-in, and the first one whose history is codeg's own ACP recording rather than a dedicated native-store parser: the pinned zcode-codeg-adapter keeps ZCode's store private, so the built-in rides the same parsers::acp_native transcript path as custom agents (transcript_dir_for now covers Custom(_) | ZCode). - models/agent.rs: AgentType::ZCode, wire "zcode", ordering, shadow list; "zcode-codeg" deliberately stays a valid custom id so existing custom:zcode-codeg conversations keep resolving. default_enabled lists the variant (a matches! arm compiles non-exhaustively — without it the agent is born disabled and invisible). - acp/registry.rs: AcpAgentMeta with the pinned npx distribution (zcode-codeg-adapter@0.1.3, node floor 22.16.0), registry id "zcode-acp". - acp/connection.rs: ZCODE_CODEG_ENTRY launch preflight — an explicit Agent Settings value wins (and is validated), else the standard install locations are probed; failure routes to the install prompt instead of the adapter's E_EXIT mid-handshake. - MCP: wire-only delivery (off the forward skip list), no codeg-side native store; skills intentionally undeclared until ZCode-side evidence exists; sandbox roots stay empty like custom agents. - Frontend: type/order/name/color entries, Z monogram placeholder icon, delegation defaults list; McpAppType untouched (no store to manage). - READMEs: the built-in count moves fifteen → sixteen and ZCode joins the supported-agent roster in all ten languages. - Tests: entry-env preflight matrix, transcript-recording coverage, companion enum counts (16 builtins), registry npx pin. Live acceptance on ZCode CLI 0.16.5: multi-turn chat with context retention, tool cards (Read/Write/Edit/Bash) with plan-mode read-only enforcement, permission cards (Allow once / Always / Deny), writes verified on disk, cancellation settles cleanly and the session stays usable, server restart replays history once with no duplicates and continues, and the model selector lists the full desktop-config catalog (16 models across 9 providers) with working switching on the 0.16.5 wire shape.
Collaborator
Author
|
zcode暴露出了[上传工作区/.git记录到云端]的问题,可能快要开源了,说不定近期有大变化,可以等等看。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Integrates ZCode as the sixteenth built-in agent, driven through the pinned community adapter
zcode-codeg-adapter@0.1.3(stdio ACP; the ZCode CLI itself ships no ACP server). This follows the DeepSeek Harness pattern — built-in enum entry + npm-distributed adapter — with one architectural difference called out below.ZCode's own backend keeps its history in a private store, which codeg deliberately does not parse. ZCode is therefore the first built-in whose history is codeg's own ACP recording (
parsers::acp_native, the same transcript path custom agents use) —transcript_dir_fornow coversCustom(_) | ZCode. Every other built-in keeps its dedicated native-store parser.Notable decisions
ZCODE_CODEG_ENTRY(absolute path to the ZCode app's.cjsentry) and exits before the handshake without it. codeg validates an explicit Agent Settings → ZCode env override, else probes the standard install locations (/Applications/ZCode.app/...,~/Applications/...); failure routes to an install-prompt error instead of an opaque mid-handshake exit.zcode-codegstays a valid custom-agent id, so conversations persisted ascustom:zcode-codeg(the pre-builtin registration) keep resolving; no forced migration.McpAppTypeand the MCP settings page. Skills stay undeclared until there is ZCode-side evidence of a load path.default_enabled: the variant is listed explicitly — the surroundingmatches!compiles non-exhaustively, and without the arm the agent is born disabled and never appears in the picker.Live acceptance (ZCode CLI 0.16.5, macOS arm64)
stop_reason=cancelledand the session stays usablesession/loadsession/setModelwithoptions.reasoningLevel)Checks
cargo test --features test-utils— 3953 passedcargo test --no-default-features --bin codeg-server --lib— cleancargo clippy×3 modes with-D warnings— cleanpnpm test— 6609 passed;pnpm build(static export) — cleanThe adapter itself is MIT-licensed, stdio-only, and pinned exactly; its audit trail (backend contract probes, dual-generation model-switch protocol, permission-kind mapping) lives in the adapter repo.