文件最后提交记录最后更新时间
feat: complete brand migration from CodeGenie to DevEco Code Migrate all remaining CODEGENIE/codegenie references to DEVECO/deveco across the entire codebase: - Fix critical build define mismatch (CODEGENIE_* → DEVECO_*) that caused version/channel to always be "local" in built artifacts - Rename npm scope to @deveco and package name to @deveco/deveco - Rename plugin files: codegenie.ts → deveco.ts, codegenie-models.ts → deveco-models.ts, codegenie-onboarding.tsx → deveco-onboarding.tsx - Update provider ID, class names, and function names - Update all env vars, build scripts, SDK headers, and display text - Fix electron.vite.config.ts CODEGENIE_SERVER_DIST variable reference bug - Update binary output name from bin/codegenie to bin/deveco Signed-off-by: zhangyuchen <zhangyuchen45@huawei.com> 18 天前
sync: OpenCode v1.15.0 -> v1.15.1 Upstream commits: - feat(tui): add minimal thinking mode with click-to-expand - feat(tui): enable pinned session switching - refactor(instance): retire WithInstance adapter - refactor(lsp): require explicit instance context - refactor(workspace): centralize adapter invocation - refactor(flags): migrate flags to runtime flags - fix(tui): dedupe consecutive prompt history entries - fix(tui): show config error details on startup - fix(tool): bridge custom tool zod metadata - fix: markdown table rendering - fix(watcher): resolve symlinked .git path - Various Effect instance context refactoring Conflicts resolved: 44 files - package.json/bun.lock: accept upstream versions - flag/flag.ts: accepted upstream removals, kept DEVECO_ prefix - runtime-flags.ts: accepted upstream new flags, kept DEVECO_ prefix - bridge.ts: accepted upstream refactoring (standalone bind/fromPromise) - lsp/server.ts: accepted upstream flags parameter refactoring - instance.ts: accepted upstream deletion (retired WithInstance adapter) - TUI files: accepted upstream features, kept DEVECO_ branding - Test files: accepted upstream test updates, kept DEVECO_ env vars - config.ts: accepted upstream import changes - instruction.ts, skill, db, workspace-routing: accepted upstream refactoring Brand identifiers preserved throughout, HarmonyOS tools and plugins retained Baseline updated in BASELINE.md Signed-off-by: OwenO <ouwen7@huawei.com> 14 天前
sync: OpenCode v1.15.0 -> v1.15.1 Upstream commits: - feat(tui): add minimal thinking mode with click-to-expand - feat(tui): enable pinned session switching - refactor(instance): retire WithInstance adapter - refactor(lsp): require explicit instance context - refactor(workspace): centralize adapter invocation - refactor(flags): migrate flags to runtime flags - fix(tui): dedupe consecutive prompt history entries - fix(tui): show config error details on startup - fix(tool): bridge custom tool zod metadata - fix: markdown table rendering - fix(watcher): resolve symlinked .git path - Various Effect instance context refactoring Conflicts resolved: 44 files - package.json/bun.lock: accept upstream versions - flag/flag.ts: accepted upstream removals, kept DEVECO_ prefix - runtime-flags.ts: accepted upstream new flags, kept DEVECO_ prefix - bridge.ts: accepted upstream refactoring (standalone bind/fromPromise) - lsp/server.ts: accepted upstream flags parameter refactoring - instance.ts: accepted upstream deletion (retired WithInstance adapter) - TUI files: accepted upstream features, kept DEVECO_ branding - Test files: accepted upstream test updates, kept DEVECO_ env vars - config.ts: accepted upstream import changes - instruction.ts, skill, db, workspace-routing: accepted upstream refactoring Brand identifiers preserved throughout, HarmonyOS tools and plugins retained Baseline updated in BASELINE.md Signed-off-by: OwenO <ouwen7@huawei.com> 14 天前
sync: OpenCode v1.14.40 -> v1.14.41 Upstream commits: - feat(core): copy file changes when warping (#26190) - feat(desktop): move server to utilityProcess (#25962) - feat: Update ACP support, modernize and fix misc issues (#25663) - fix(tui): restore custom provider in /connect (#26168) - fix: guard undefined contents in diff renderer to fix share viewer SSR crash (#21763) - fix(format): restore stdout/stderr ignore for formatter processes (#26037) - fix(desktop): add macOS settings menu entry (#26081) - docs(desktop): update README from Tauri to Electron (#26146) - docs: add opencode-jfrog-plugin to ecosystem list for JFrog integration (#26019) - chore: monitoring/alerting improvements - chore: update nix hashes and generated files Conflicts resolved: 21 files - packages/*/package.json (13): accept upstream version - packages/opencode/package.json: accept version, retain name=codegenie - packages/web/package.json: accept version - packages/extensions/zed/extension.toml: accept upstream version and URLs - bun.lock: accept upstream, regenerate via bun install - packages/desktop/src/main/server.ts: accept upstream utilityProcess/sidecar refactor, preserve CODEGENIE_* flags in preferAppEnv, drop old prepareServerEnv - packages/opencode/test/server/httpapi-session.test.ts: accept upstream workspaceLayer, preserve CODEGENIE_* flags - packages/opencode/test/server/httpapi-workspace.test.ts: accept upstream workspaceLayer, preserve CODEGENIE_* flags Brand identifiers preserved throughout, HarmonyOS tools and plugins retained Signed-off-by: zhangyuchen <zhangyuchen45@huawei.com> 21 天前
refactor(provider): flow branded ProviderID/ModelID through internal signatures (#17182)2 个月前
README.md

ACP (Agent Client Protocol) Implementation

This directory contains a clean, protocol-compliant implementation of the Agent Client Protocol for opencode.

Architecture

The implementation follows a clean separation of concerns:

Core Components

  • agent.ts - Implements the Agent interface from @agentclientprotocol/sdk

    • Handles initialization and capability negotiation
    • Manages session lifecycle (session/new, session/load)
    • Processes prompts and returns responses
    • Properly implements ACP protocol v1
  • client.ts - Implements the Client interface for client-side capabilities

    • File operations (readTextFile, writeTextFile)
    • Permission requests (auto-approves for now)
    • Terminal support (stub implementation)
  • session.ts - Session state management

    • Creates and tracks ACP sessions
    • Maps ACP sessions to internal opencode sessions
    • Maintains working directory context
    • Handles MCP server configurations
  • server.ts - ACP server startup and lifecycle

    • Sets up JSON-RPC over stdio using the official library
    • Manages graceful shutdown on SIGTERM/SIGINT
    • Provides Instance context for the agent
  • types.ts - Type definitions for internal use

Usage

Command Line

# Start the ACP server in the current directory
opencode acp

# Start in a specific directory
opencode acp --cwd /path/to/project

Question Tool Opt-In

ACP excludes QuestionTool by default.

DEVECO_ENABLE_QUESTION_TOOL=1 deveco acp

Enable this only for ACP clients that support interactive question prompts.

Programmatic

import { ACPServer } from "./acp/server"

await ACPServer.start()

Integration with Zed

Add to your Zed configuration (~/.config/zed/settings.json):

{
  "agent_servers": {
    "OpenCode": {
      "command": "opencode",
      "args": ["acp"]
    }
  }
}

Protocol Compliance

This implementation follows the ACP specification v1:

Initialization

  • Proper initialize request/response with protocol version negotiation
  • Capability advertisement (agentCapabilities)
  • Authentication support (stub)

Session Management

  • session/new - Create new conversation sessions
  • session/load - Resume existing sessions (basic support)
  • Working directory context (cwd)
  • MCP server configuration support

Prompting

  • session/prompt - Process user messages
  • Content block handling (text, resources)
  • Response with stop reasons

Client Capabilities

  • File read/write operations
  • Permission requests
  • Terminal support (stub for future)

Current Limitations

Not Yet Implemented

  1. Streaming Responses - Currently returns complete responses instead of streaming via session/update notifications
  2. Tool Call Reporting - Doesn't report tool execution progress
  3. Session Modes - No mode switching support yet
  4. Authentication - No actual auth implementation
  5. Terminal Support - Placeholder only
  6. Session Persistence - session/load doesn't restore actual conversation history

Future Enhancements

  • Real-time Streaming: Implement session/update notifications for progressive responses
  • Tool Call Visibility: Report tool executions as they happen
  • Session Persistence: Save and restore full conversation history
  • Mode Support: Implement different operational modes (ask, code, etc.)
  • Enhanced Permissions: More sophisticated permission handling
  • Terminal Integration: Full terminal support via opencode's bash tool

Testing

# Run ACP tests
bun test test/acp.test.ts

# Test manually with stdio
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1}}' | opencode acp

Design Decisions

Why the Official Library?

We use @agentclientprotocol/sdk instead of implementing JSON-RPC ourselves because:

  • Ensures protocol compliance
  • Handles edge cases and future protocol versions
  • Reduces maintenance burden
  • Works with other ACP clients automatically

Clean Architecture

Each component has a single responsibility:

  • Agent = Protocol interface
  • Client = Client-side operations
  • Session = State management
  • Server = Lifecycle and I/O

This makes the codebase maintainable and testable.

Mapping to OpenCode

ACP sessions map cleanly to opencode's internal session model:

  • ACP session/new → creates internal Session
  • ACP session/prompt → uses SessionPrompt.prompt()
  • Working directory context preserved per-session
  • Tool execution uses existing ToolRegistry

References